#! 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, "LGPS:LTUS:1:IACT") { field(DESC, "Current") field(INP, "PS:LTUS:1:IACT") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "LGPS:LTUS:1:BACT") info(autosaveFields,"HYST") } record(bi, "LGPS:LTUS:1:STATE") { field(DESC, "PS On/Off Status") field(DTYP, "Raw Soft Channel") field(INP, "PS:LTUS:1:STATE CP MS") field(ZSV, "MAJOR") field(ZNAM, "OFF") field(ONAM, "ON") } record(ao, "LGPS:LTUS:1:IDES") { field(DESC, "Desired Current") field(PREC, "3") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(MDEL, "-1") field(HIHI, "50.0") field(LOLO, "0.0") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "LGPS:LTUS:1:BDELTAS") field(DRVH, "50.0") field(DRVL, "0.0") field(DOL, "LGPS:LTUS:1: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, "LGPS:LTUS:1:ICTRL PP") } # This record is processed by LGPS:LTUS:1:ICON") # Note: we are not setting alarms here. record(ao, "LGPS:LTUS:1:ICON") { field(DESC, "Config I") field(DTYP, "Soft Channel") field(PREC, "3") field(HOPR, "50.0") field(LOPR, "0.0") field(DRVH, "50.0") field(DRVL, "0.0") field(DOL, "LGPS:LTUS:1:B2ICON.K") field(OMSL, "closed_loop") info(autosaveFields,"VAL") } record(ao, "LGPS:LTUS:1:INOM") { field(DESC, "Nominal Current") field(DOL, "LGPS:LTUS:1:BNOM.K") field(OMSL, "closed_loop") field(PREC, "3") field(EGU, "Volts") field(DRVH, "50.0") field(DRVL, "0.0") field(HOPR, "50.0") field(LOPR, "0.0") } record(ao, "LGPS:LTUS:1:ICTRL") { field(DESC, "Set Current") field(PREC, "3") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(DRVH, "50.0") field(DRVL, "0.0") field(MDEL, "-1") field(FLNK, "LGPS:LTUS:1:ICTRLGO") field(OMSL, "supervisory") info(autosavefields,"VAL") } record(seq, "LGPS:LTUS:1:ICTRLGO") { field(DESC, "Process Current Setpoint") field(PREC, "3") # Set ISETPT to supervisory field(DOL1, "0") field(LNK1, "LGPS:LTUS:1:ISETPT.OMSL") field(DOL2, "LGPS:LTUS:1:ICTRL") field(LNK2, "LGPS:LTUS:1:ISETPT PP") # Set ISETPT to closed loop - get data from BCTRLSUB.K field(DOL3, "1") field(LNK3, "LGPS:LTUS:1:ISETPT.OMSL") } record(ao, "LGPS:LTUS:1:IMAX") { field(DESC, "Max I") field(DTYP, "Soft Channel") field(DRVH, "50.0") field(DRVL, "0.0") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(PINI, "YES") field(VAL, "50.0") field(FLNK, "LGPS:LTUS:1:IMIN") } record(ao, "LGPS:LTUS:1:IMIN") { field(DESC, "Min I") field(DTYP, "Soft Channel") field(DRVH, "50.0") field(DRVL, "0.0") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(VAL, "0.0") field(FLNK, "LGPS:LTUS:1:IRANGE") } record(sel, "LGPS:LTUS:1:IACTPREVOK") { field(DESC, "Last Good Current") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(NVL, "LGPS:LTUS:1:BACT.SEVR") field(INPA, "LGPS:LTUS:1:IACT NPP MS") field(INPB, "LGPS:LTUS:1:IACTPREVOK NPP MS") field(INPC, "LGPS:LTUS:1:IACTPREVOK NPP MS") field(INPD, "LGPS:LTUS:1:IACTPREVOK NPP MS") } record(sub, "LGPS:LTUS:1:IACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "LGPS:LTUS:1:IDES") field(INPB, "LGPS:LTUS:1:ISETPT.DRVH") field(INPC, "LGPS:LTUS:1:ISETPT.DRVL") field(INPD, "LGPS:LTUS:1:IDELTAS.I") field(INPE, "LGPS:LTUS:1:IDELTAS.J") field(INPG, "LGPS:LTUS:1:STATE") field(INPH, "LGPS:LTUS:1:HSTA") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(sub, "LGPS:LTUS:1:IMONLIMITS") { field(DESC, "Aux Current Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "LGPS:LTUS:1:IDES") field(INPB, "LGPS:LTUS:1:ISETPT.DRVH") field(INPC, "LGPS:LTUS:1:ISETPT.DRVL") field(INPD, "LGPS:LTUS:1:IDELTAS.K") field(INPE, "LGPS:LTUS:1:IDELTAS.L") field(INPG, "LGPS:LTUS:1:STATE") field(INPH, "LGPS:LTUS:1:HSTA") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(seq, "LGPS:LTUS:1:ILIMITS") { field(DESC, "Set ACT and MON Limits") field(PREC, "3") field(DOL1, "LGPS:LTUS:1:BLIMITS") field(LNK1, "LGPS:LTUS:1:IACTLIMITS.F PP") field(DOL2, "LGPS:LTUS:1:IACTLIMITS.I") field(LNK2, "LGPS:LTUS:1:IACT.HIGH") field(DOL3, "LGPS:LTUS:1:IACTLIMITS.J") field(LNK3, "LGPS:LTUS:1:IACT.LOW") field(DOL4, "LGPS:LTUS:1:IACTLIMITS.K") field(LNK4, "LGPS:LTUS:1:IACT.HIHI") field(DOL5, "LGPS:LTUS:1:IACTLIMITS.L") field(LNK5, "LGPS:LTUS:1:IACT.LOLO") field(DOL6, "LGPS:LTUS:1:BLIMITS") field(LNK6, "LGPS:LTUS:1:IMONLIMITS.F PP") field(DOL7, "LGPS:LTUS:1:IMONLIMITS.I") field(LNK7, "LGPS:LTUS:1:IMON.HIGH") field(DOL8, "LGPS:LTUS:1:IMONLIMITS.J") field(LNK8, "LGPS:LTUS:1:IMON.LOW") field(DOL9, "LGPS:LTUS:1:IMONLIMITS.K") field(LNK9, "LGPS:LTUS:1:IMON.HIHI") field(DOLA, "LGPS:LTUS:1:IMONLIMITS.L") field(LNKA, "LGPS:LTUS:1: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, "LGPS:LTUS:1:IDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntRawDeltas") field(INPD, "LGPS:LTUS:1:TRIMBTOL") field(INPE, "LGPS:LTUS:1:CHCKBTOL") field(INPF, "LGPS:LTUS:1:BDELTAS.K") field(INPG, "LGPS:LTUS:1:BDELTAS.L") field(INPH, "LGPS:LTUS:1:B2IDES.L") field(EGU, "Volts") field(HOPR, "1") field(PREC, "3") field(BRSV, "INVALID") # # Used to calcualte standardize tolerance # which is returned in the VAL field. # field(INPB, "LGPS:LTUS:1:STDZITOLR") field(INPC, "LGPS:LTUS:1:STDZITOL") field(FLNK, "") } # All ps controllers with on/off control will set the macro ONOF # as follows: # # ONOF = PS:LTUS:1: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, "LGPS:LTUS:1:STATESETPT") { field(DESC, "PS On/Off") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFF") field(ONAM, "ON") field(OUT, "PS:LTUS:1:STATESETPT PP") 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:LTUS:1:RESET PP # record(bo, "LGPS:LTUS:1:RESET") { field(DESC, "Interlock Latch Reset") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFF") field(ONAM, "ON") field(HIGH, "1.0") field(OUT, "PS:LTUS:1:RESET PP") } record(bo, "LGPS:LTUS:1:RAMPSTATE") { field(DESC, "PS Ramp Status") field(DTYP, "Soft Channel") field(DOL, "PS:LTUS:1:RAMPSTATE") 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, "LGPS:LTUS:1: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, "Volts/sec") field(PREC, "3") # Set default to trim ramp rate on boot # but need to change for degauss function. field(DOL, "LGPS:LTUS:1:TRIMRAMPRATE") field(OUT, "") field(FLNK, "LGPS:LTUS:1:STDZDLY") } record(ao, "LGPS:LTUS:1:ISETPT") { field(DESC, "Current Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(DRVH, "50.0") field(DRVL, "0.0") field(MDEL, "-1") field(OUT, "PS:LTUS:1:ISETPT PP") field(DOL, "LGPS:LTUS:1: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, "LGPS:LTUS:1:IMON") { field(DESC, "Aux Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(INP, "") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "LGPS:LTUS:1:BMON") } record(ao, "LGPS:LTUS:1:IRIPL") { field(DESC, "Ripple Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(DOL, "") field(OMSL, "closed_loop") field(EGU, "Volts") field(DRVH, "1.0") field(HOPR, "1.0") field(PREC, "3") field(FLNK, "LGPS:LTUS:1:IRIPLOK") } record(sub, "LGPS:LTUS:1:IRIPLOK") { field(DESC, "Ripple Current Status") field(INAM, "mgntInit") field(SNAM, "mgntRiplOK") field(INPA, "LGPS:LTUS:1:IRIPL.VAL") field(INPB, "LGPS:LTUS:1: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, "LGPS:LTUS:1:R") { field(DESC, "Resistance") field(EGU, "Ohms") field(PREC, "4") field(PINI, "YES") field(DOL, "") 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, "LGPS:LTUS:1:IGND") { field(DESC, "Ground Current") field(EGU, "Volts") field(PREC, "6") field(PINI, "YES") field(DOL, "") field(OMSL, "closed_loop") } record(bi, "LGPS:LTUS:1:INTLKSUMY") { field(DESC, "Interlock Summary") field(INP, "PS:LTUS:1:INTLKSUMY CP MS") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(ZNAM, "OK") field(ONAM, "FAULT") field(PINI, "NO") } record(mbbo, "LGPS:LTUS:1: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:LTUS:1:COOLING") field(OMSL, "closed_loop") } # The following PV is processed by :BACTFO # which is processed by :BACT record(fanout, "LGPS:LTUS:1:IACTFO") { field(DESC, "IACT processing") field(SELM, "All") field(LNK1, "LGPS:LTUS:1:IACTPREVOK") field(LNK2, "LGPS:LTUS:1:IDIFF") field(LNK3, "LGPS:LTUS:1:IADIFF") field(LNK4, "LGPS:LTUS:1:IRATIO") field(LNK5, "LGPS:LTUS:1:IDIRECT") field(LNK6, "LGPS:LTUS:1:IACTPOL_CHECK") } record(calc, "LGPS:LTUS:1:IDIFF") { field(DESC, "IDES-IACT") field(CALC, "A-B") field(INPA, "LGPS:LTUS:1:IDES") field(INPB, "LGPS:LTUS:1:IACT") field(EGU, "Volts") field(PREC, "9") field(HOPR, "50.0") field(LOPR, "0.0") } record(calc, "LGPS:LTUS:1:IADIFF") { field(DESC, "Absolute IDES-IACT") field(CALC, "A<0?ABS(A):A") field(INPA, "LGPS:LTUS:1:IDIFF") field(PREC, "9") } record(calc, "LGPS:LTUS:1:IRATIO") { field(DESC, "IDES-IACT/IMAX") field(CALC, "B?A/B:0") field(INPA, "LGPS:LTUS:1:IDIFF") field(INPB, "LGPS:LTUS:1:IDES.DRVH") field(PREC, "9") } record(calcout, "LGPS:LTUS:1:IRANGE") { field(DESC, "Current Range") field(PINI, "YES") field(CALC, "ABS(A-B)") field(INPA, "LGPS:LTUS:1:IMIN") field(INPB, "LGPS:LTUS:1: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, "LGPS:LTUS:1: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, "LGPS:LTUS:1:IACT") field(FLNK, "LGPS:LTUS:1:IACTPOL") } record(bo, "LGPS:LTUS:1:IACTPOL") { field(DESC, "Actual I Polarity") field(DTYP, "Raw Soft Channel") field(DOL, "LGPS:LTUS:1: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,"LGPS:LTUS:1:I*LIMITS:\n Calculate alarm and warning limits based on \n deltas from LGPS:LTUS:1:IDELTAS and the\n LGPS:LTUS:1: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,"LGPS:LTUS:1:IACT: \n Get copy of LGPS:LTUS:1:I. \n",null) #! TextBox(TB12,1280,3100,1760,3200,0,"Dialog",12,1,16777215,"LGPS:LTUS:1: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,"LGPS:LTUS:1:IDES:\n Contains raw value calculated by \nLGPS:LTUS:1: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 \nLGPS:LTUS:1:BDELTAS.\n",null) #! TextBox(TB10,56,1940,316,2340,0,"Dialog",12,1,16777215,"LGPS:LTUS:1: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 LGPS:LTUS:1: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 LGPS:LTUS:1: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,"LGPS:LTUS:1:ISETPT:\n Sets the hardware. When fast feedback is set on, this record is\n set to closed loop mode by LGPS:LTUS:1:FBCKSTART sequence. When \n the loop is closed, this record takes input calculated by \n BFBCK only. When fast feedback is set off, LGPS:LTUS:1:FBCKSTOP \n will set it back to supervisory so that the value can be set by \n LGPS:LTUS:1: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, "LGPS:LTUS:1:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "LGPS:LTUS:1:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "LGPS:LTUS:1:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "LGPS:LTUS:1:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "LGPS:LTUS:1:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "LGPS:LTUS:1:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "1") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "LGPS:LTUS:1: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, "LGPS:LTUS:1:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "LGPS:LTUS:1:TRIMTYPE.RVAL") field(INPB, "LGPS:LTUS:1:CONFIG.RVAL") field(OUT, "LGPS:LTUS:1:TRIMMAXNUM PP") } record(longout, "LGPS:LTUS:1: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, "LGPS:LTUS:1:TRIMRAMPRATE") { field(DESC, "Trim Ramp rate ") field(PINI, "YES") field(ASG, "IOC_MAINT") field(PREC, "3") field(EGU, "Volts/sec") field(HOPR, "20.0") field(DRVH, "20.0") field(DRVL, "0.1") field(LOPR, "0.5") # field(DOL, "") field(OMSL, "supervisory") field(VAL, "10") field(OUT, "LGPS:LTUS:1:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "LGPS:LTUS:1: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, "") field(OMSL, "supervisory") field(VAL, "10") } record(bo, "LGPS:LTUS:1: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, "LGPS:LTUS:1: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, "LGPS:LTUS:1:TRIMSTEPMIN") { field(DESC, "Min step in current") field(DTYP, "Soft Channel") # field(DOL, "") field(PREC, "7") field(EGUF, "10") field(EGUL, "0") field(EGU, "Volts") field(HOPR, "10") field(LOPR, "0") field(VAL, "5.0") } record(bo, "LGPS:LTUS:1:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "0") } record(ao, "LGPS:LTUS:1: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, "LGPS:LTUS:1:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "LGPS:LTUS:1: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, "LGPS:LTUS:1: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, "LGPS:LTUS:1:IMOVE") field(INPB, "LGPS:LTUS:1:IACT") field(INPC, "LGPS:LTUS:1:IRAMPRATE") field(INPD, "1.577") field(INPE, "LGPS:LTUS:1:TRIMDLYPCT") field(INPF, "LGPS:LTUS:1:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "LGPS:LTUS:1:RAMPTIME_LEFT PP") } record(longout, "LGPS:LTUS:1:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "LGPS:LTUS:1:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "LGPS:LTUS:1:RAMPDONE_CALC") } record(calc, "LGPS:LTUS:1:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "LGPS:LTUS:1:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "LGPS:LTUS:1:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "LGPS:LTUS:1: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, "LGPS:LTUS:1:RAMPTIME_LEFT") field(OUT, "LGPS:LTUS:1:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "LGPS:LTUS:1:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "LGPS:LTUS:1:RAMPTIME_LEFT NMS") field(OUT, "LGPS:LTUS:1:RAMPDONE PP") } record(bo, "LGPS:LTUS:1:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "LGPS:LTUS:1:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "LGPS:LTUS:1: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, "LGPS:LTUS:1: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, "LGPS:LTUS:1:STDZINIT") { field(DESC, "Proc. Stdz PVs on boot") field(PINI, "YES") field(DOL1, "1") field(DOL2, "1") field(DOL3, "1") field(LNK1, "LGPS:LTUS:1:DEBUG.PROC PP") field(LNK2, "LGPS:LTUS:1:STDZCYCLENUM.PROC PP") field(LNK3, "LGPS:LTUS:1:STDZDISABLE.PROC PP") field(LNK4, "LGPS:LTUS:1: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, "LGPS:LTUS:1:STDZSUB") { field(DESC, "Stdz subroutine") field(INAM, "mgntStdzInit") field(SNAM, "mgntStdz") field(BRSV, "INVALID") field(INPA, "LGPS:LTUS:1:STDZIMIN NPP NMS") field(INPB, "LGPS:LTUS:1:STDZIMAX NPP NMS") field(INPC, "LGPS:LTUS:1:STDZIFINAL NPP NMS") field(INPD, "LGPS:LTUS:1:STDZCYCLENUM NPP NMS") field(INPE, "LGPS:LTUS:1:STDZDIRECT.RVAL NPP NMS") field(INPF, "LGPS:LTUS:1:STDZDISABLE.RVAL CPP NMS") field(INPG, "LGPS:LTUS:1: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, "LGPS:LTUS:1:STDZWF PP") field(OUTB, "LGPS:LTUS:1: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, "LGPS:LTUS:1:STDZWF") } record(mbbo, "LGPS:LTUS:1: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, "LGPS:LTUS:1: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, "LGPS:LTUS:1:STDZMAINPS") { field(DESC, "Stdz by main or self") field(PINI, "YES") field(DTYP, "Soft Channel") field(ZNAM, "SELF") field(ONAM, "MAIN") } record(bo, "LGPS:LTUS:1: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, "LGPS:LTUS:1: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, "LGPS:LTUS:1: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, "LGPS:LTUS:1:STDZTOD") { field(DESC, "Successful Standardize Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "LGPS:LTUS:1:STDZLOSTTOD") { field(DESC, "Standardize Lost Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(longout, "LGPS:LTUS:1:STDZCYCLECNT") { field(DESC, "Cycle Count") field(PINI, "YES") } record(longout, "LGPS:LTUS:1:STDZCYCLENUM") { field(DESC, "No. Standardize Cycles") field(VAL, "3") field(HOPR, "10") field(LOPR, "0") field(DRVH, "10") field(DRVL, "0") field(PINI, "YES") field(FLNK, "LGPS:LTUS:1:STDZDIRECT") } # The default standardize direction is "UP" for # all LCLS Magnets.. record(bo, "LGPS:LTUS:1:STDZDIRECT") { field(DESC, "Standardize Direction ") field(ZNAM, "UP") field(ONAM, "DOWN") field(VAL, "0") field(FLNK, "LGPS:LTUS:1:STDZIMIN") } record(ao, "LGPS:LTUS:1:STDZIMIN") { field(DESC, "Min-STDZ Current") field(PREC, "1") field(EGU, "A") field(HOPR, "50.0") field(LOPR, "0.0") field(VAL, "0.0") field(FLNK, "LGPS:LTUS:1:STDZIMAX") } record(ao, "LGPS:LTUS:1:STDZIMAX") { field(DESC, "Max. Standarize Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "50.0") field(LOPR, "0.0") field(VAL, "50.0") field(FLNK, "LGPS:LTUS:1:STDZIFINAL") } record(ao, "LGPS:LTUS:1:STDZIFINAL") { field(DESC, "Final SDTZ Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "50.0") field(LOPR, "0.0") field(VAL, "0.0") field(FLNK, "LGPS:LTUS:1: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, "LGPS:LTUS:1: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, "LGPS:LTUS:1:STDZITOL") { field(DESC, "Stdz min tolerance") field(PREC, "5") field(CALC, "MAX(ABS(A),ABS(B))*C") field(INPA, "LGPS:LTUS:1:STDZIMIN CP NMS") field(INPB, "LGPS:LTUS:1:STDZIMAX CP MMS") field(INPC, "0.05") field(INPD, "LGPS:LTUS:1:STDZITOLR CP MMS") field(EGU, "A") field(FLNK, "LGPS:LTUS:1:IDELTAS") field(PINI, "YES") } # D - factor (3.154/2 = 1.577) for EPSC, otherwise, set to 1.0 record(calc, "LGPS:LTUS:1:STDZDLY") { field(DESC, "Ramp time for stdz cycle") field(CALC, "C>0?MAX(1,ABS((A-B)/C)*D):0") field(INPA, "LGPS:LTUS:1:STDZIMIN CP NMS") field(INPB, "LGPS:LTUS:1:STDZIMAX CP NMS") field(INPC, "LGPS:LTUS:1:TRIMRAMPRATE CP NMS") field(INPD, "1.0") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") } record(calc, "LGPS:LTUS:1:STDZRAMPDLY") { field(DESC, "Ramp delay total") field(CALC, "MAX(1,((A/100)*B+B))") field(PREC, "5") field(INPA, "LGPS:LTUS:1:TRIMDLYPCT CP MS") field(INPB, "LGPS:LTUS:1: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, "LGPS:LTUS:1:STDZMINIDLY") { field(DESC, "Mini-stdz delay") field(CALC, "A") field(PREC, "5") field(A, "1.0") field(EGU, "sec") field(PINI, "YES") } record(ao, "LGPS:LTUS:1: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, "LGPS:LTUS:1:STDZMINIDELTA") { field(DESC, "Stdz mini % of IMAX") field(CALC, "(B/100)*(A-C)") field(INPA, "LGPS:LTUS:1:IDES.HOPR") field(INPB, "LGPS:LTUS:1:STDZMINIPCT CPP NMS") field(INPC, "LGPS:LTUS:1:IDES.LOPR") field(PREC, "5") } record(calc, "LGPS:LTUS:1:STDZMINISETPT") { field(DESC, "Mini Stdz delta") field(CALC, "C==0?MAX(E-D,B):MIN(E+D,A)") field(INPA, "LGPS:LTUS:1:IDES.HOPR") field(INPB, "LGPS:LTUS:1:IDES.LOPR") field(INPC, "LGPS:LTUS:1:STDZDIRECT.RVAL") field(INPD, "LGPS:LTUS:1:STDZMINIDELTA") field(INPE, "LGPS:LTUS:1:IDES") field(PREC, "5") field(FLNK, "LGPS:LTUS:1: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, "LGPS:LTUS:1:STDZMINISETPTOOR") { field(DESC, "Mini Stdz setpoint out of range") field(CALC, "C==0?(E-DA)") field(INPA, "LGPS:LTUS:1:IDES.HOPR") field(INPB, "LGPS:LTUS:1:IDES.LOPR") field(INPC, "LGPS:LTUS:1:STDZDIRECT.RVAL") field(INPD, "LGPS:LTUS:1:STDZMINIDELTA") field(INPE, "LGPS:LTUS:1: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, "LGPS:LTUS:1: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, "LGPS:LTUS:1:IADJUST.RVAL") field(INPB, "LGPS:LTUS:1:STDZDIRECT.RVAL") field(INPC, "LGPS:LTUS:1:STDZOK.RVAL") field(INPD, "LGPS:LTUS:1:STDZDISABLE.RVAL") field(INPE, "LGPS:LTUS:1:STATE.RVAL CPP NMS") field(INPF, "LGPS:LTUS:1:ICTRL.RVAL") field(INPG, "LGPS:LTUS:1:STATE.SEVR") field(INPH, "LGPS:LTUS:1:BDELTAS.M") field(INPI, "LGPS:LTUS:1:IACT.SEVR") field(OUT, "LGPS:LTUS:1:STDZLOSTGO.SELN PP NMS") field(OOPT, "Transition To Non-zero") } record(seq, "LGPS:LTUS:1:STDZLOSTGO") { field(DESC, "Process lost stdz") field(SELM, "Mask") field(DOL1, "1") field(DOL2, "0") field(LNK1, "LGPS:LTUS:1:STDZLOSTTOD.PROC") field(LNK2, "LGPS:LTUS:1:STDZOK PP") } # Record maximum current after standardize # Reset to IACT from sequence after trim # Disable processing during (mini-)standardize or trim record(calc, "LGPS:LTUS:1:STDZIACTMAX") { field(DESC, "Max act current after stdz") field(CALC, "MAX(A, B)") field(DISV, "0") field(SDIS, "LGPS:LTUS:1:CHECKPWRDIP_ENABLE") field(INPA, "LGPS:LTUS:1:IACT CP") field(INPB, "LGPS:LTUS:1:STDZIACTMAX") field(EGU, "A") field(FLNK, "LGPS:LTUS:1:CHECKPWRDIP") } # Detect power dip if STDZOK is YES, STDZ is enabled, and IACT is valid # If IACT drops below STDZIACTMAX by more than the trim tolerance, clear STDZOK # Warning: Take the absolute value of the trim tolerance, or else quads of # negative polarity will always lose STDZ since their IDELTAS.I are negative. # Note: Large quads and bends are prone to losing STDZ even if they are # perturbed toward higher current since their current tends to overshoot # by greater than the trim tolerance before settling down. record(calcout, "LGPS:LTUS:1:CHECKPWRDIP") { field(DESC, "Detect power dip") field(CALC, "(A-B>ABS(C))?3:0") field(DISV, "0") field(SDIS, "LGPS:LTUS:1:CHECKPWRDIP_ENABLE") field(INPA, "LGPS:LTUS:1:STDZIACTMAX") field(INPB, "LGPS:LTUS:1:IACT") field(INPC, "LGPS:LTUS:1:IDELTAS.I") field(OUT, "LGPS:LTUS:1:STDZLOSTGO.SELN PP NMS") field(OOPT, "When Non-zero") } # Enable processing of STDZIACTMAX and CHECKPWRDIP only if # STDZOK = YES, STDZDISABLE = NO, CTRL != Trim (2), and # CTRL != Stdz (4) record(calc, "LGPS:LTUS:1:CHECKPWRDIP_ENABLE") { field(CALC, "A&&!B&&(C#2)&&(C#4)") field(INPA, "LGPS:LTUS:1:STDZOK.RVAL CP") field(INPB, "LGPS:LTUS:1:STDZDISABLE.RVAL CP") field(INPC, "LGPS:LTUS:1:CTRL.RVAL CP") } #! 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, "LGPS:LTUS:1: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, "LGPS:LTUS:1: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, "LGPS:LTUS:1:CALBSET") { field(DESC, "Use DAC Calbration") field(SCAN, "10 second") field(CALC, "A&&(B==0)&&C?31:960") field(INPA, "LGPS:LTUS:1:CALBOK") field(INPB, "LGPS:LTUS:1:CALBDISABLE") field(INPC, "LGPS:LTUS:1:CALBSLOPE") field(OOPT, "On Change") field(OUT, "LGPS:LTUS:1: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, "LGPS:LTUS:1:CALB_SEQ") { field(DESC, "Output Calib Values") field(SELM, "Mask") field(SELL, "LGPS:LTUS:1: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, "LGPS:LTUS:1:CALBSLOPE") field(DOL3, "LGPS:LTUS:1: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, "LGPS:LTUS:1:CALBTOD") { field(DESC, "Calibration Success Time") field(PINI, "YES") # field(DOL, "") field(OMSL, "supervisory") field(DTYP, "Soft Channel") info(autosaveFields,"VAL") } record(ao, "LGPS:LTUS:1: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, "LGPS:LTUS:1: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, "LGPS:LTUS:1: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, "LGPS:LTUS:1:CALBOFFSET") { field(DESC, "Calc DAC Offset") field(PREC, "6") field(EGU, "Counts") field(PINI, "YES") } record(bo, "LGPS:LTUS:1: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, "LGPS:LTUS:1:DACSLOPE") { field(DESC, "V to DAC slope") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "supervisory") field(PINI, "YES") field(FLNK, "LGPS:LTUS:1:DACOFFSET") } # Default Offset used in conversion from Volts to DAC Counts record(ao, "LGPS:LTUS:1:DACOFFSET") { field(DESC, "V to DAC offset") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "supervisory") field(PINI, "YES") field(FLNK, "LGPS:LTUS:1: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, "LGPS:LTUS:1: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, "LGPS:LTUS:1:IACT") field(INPD, "LGPS:LTUS:1:DACSLOPE") field(INPE, "LGPS:LTUS:1:DACOFFSET") field(EGU, "Counts") field(PREC, "6") } record(ao, "LGPS:LTUS:1:DAC") { field(DESC, "DAC Set point") field(EGU, "Counts") field(DOL, "") field(OMSL, "supervisory") field(PREC, "6") field(PINI, "YES") } record(ao, "LGPS:LTUS:1:CALBIMIN") { field(DESC, "Calibration Min Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(DRVH, "50.0") field(HOPR, "50.0") field(DRVL, "0.0") field(LOPR, "0.0") field(PREC, "3") field(EGU, "A") field(VAL, "0.0") field(FLNK, "LGPS:LTUS:1:CALBIMAX") } record(ao, "LGPS:LTUS:1:CALBIMAX") { field(DESC, "Calibration Max Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(DRVH, "50.0") field(HOPR, "50.0") field(LOPR, "0.0") field(DRVL, "0.0") field(EGU, "A") field(VAL, "50.0") field(FLNK, "LGPS:LTUS:1:CALBSTEPNUM") } record(ao, "LGPS:LTUS:1:CALBIFINAL") { field(DESC, "Calibration Last Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(PREC, "3") field(EGU, "A") field(HOPR, "50.0") field(LOPR, "0.0") field(VAL, "0") } record(longout, "LGPS:LTUS:1: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, "LGPS:LTUS:1:CALBIDELTA") } record(calc, "LGPS:LTUS:1:CALBIDELTA") { field(DESC, "Step size for CALB") field(CALC, "C=0?0:ABS((A-B)/C)") field(INPA, "LGPS:LTUS:1:CALBIMAX") field(INPB, "LGPS:LTUS:1:CALBIMIN") field(INPC, "LGPS:LTUS:1: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, "LGPS:LTUS:1:CALBIMULT") { field(DESC, "IACT vs ISETPT mult") field(CALC, "C#0||A=0?1:ABS(B/A)") field(INPA, "PS:LTUS:1:ISETPT.DRVH") field(INPB, "PS:LTUS:1:IACT.HOPR") field(INPC, "LGPS:LTUS:1:PSCONTROLLER.RVAL CPP") field(EGU, "A") field(PINI, "YES") } # SNL dbputs DAC values here. 6-10 steps are possible. record(waveform, "LGPS:LTUS:1:CALBICTRLWF") { field(DESC, "ICTRL setpoint array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") } record(waveform, "LGPS:LTUS:1:DACWF") { field(DESC, "DAC count array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "LGPS:LTUS:1:DACSA") } # Used only for xygraph edm plot record(subArray, "LGPS:LTUS:1:DACSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "LGPS:LTUS:1: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, "LGPS:LTUS:1:CALCDACWF") { field(DESC, "Calc DAC counts array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "LGPS:LTUS:1:CALCDACSA") } # Used only for xygraph edm plot record(subArray, "LGPS:LTUS:1:CALCDACSA") { field(DESC, "Calc DAC counts") field(DTYP, "Soft Channel") field(INP, "LGPS:LTUS:1: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, "LGPS:LTUS:1:CALBYWF") { field(DESC, "mx + b") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "LGPS:LTUS:1:CALBYSA") } # Used only for xygraph edm plot record(subArray, "LGPS:LTUS:1:CALBYSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "LGPS:LTUS:1:CALBYWF") field(MALM, "10") field(NELM, "6") field(INDX, "0") field(FTVL, "DOUBLE") } record(waveform, "LGPS:LTUS:1:CALBIACTWF") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "LGPS:LTUS:1:CALBIACTSA") } # Used only for xygraph edm plot record(subArray, "LGPS:LTUS:1:CALBIACTSA") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(MALM, "10") field(NELM, "6") field(INP, "LGPS:LTUS:1:CALBIACTWF") field(INDX, "0") field(FTVL, "DOUBLE") field(FLNK, "LGPS:LTUS:1:CALBLIMITS") } # Check that measured current during calibration is within # tolerance. record(aSub, "LGPS:LTUS:1: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, "LGPS:LTUS:1:CALBSTEPNUM") field(INPB, "LGPS:LTUS:1:CALBIACTWF") field(INPC, "LGPS:LTUS:1: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, "LGPS:LTUS:1: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, "LGPS:LTUS:1:STDZITOL") field(INPH, "LGPS:LTUS:1:DACSLOPE") field(INPI, "LGPS:LTUS:1: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, "LGPS:LTUS:1: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, "LGPS:LTUS:1:CALBSTEPNUM") field(INPB, "LGPS:LTUS:1:CALBIACTWF") field(INPC, "LGPS:LTUS:1:DACWF") field(INPF, "LGPS:LTUS:1: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 LGPS:LTUS:1CALBOK 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, "LGPS:LTUS:1:DEGAUSINIT") { field(DESC, "Proc. Degauss PVs on boot") field(PINI, "YES") field(DOL, "1") field(OUTA, "LGPS:LTUS:1:DEGAUSIMIN.PROC PP") field(OUTB, "LGPS:LTUS:1:DEGAUSIMAX.PROC PP") field(OUTC, "LGPS:LTUS:1:DEGAUSTYPE.PROC PP") field(OUTD, "LGPS:LTUS:1:DEGAUSSTEP.PROC PP") field(OUTE, "LGPS:LTUS:1:MADNAME.PROC PP") field(OUTF, "LGPS:LTUS:1:PSTYPE.PROC PP") field(OUTG, "LGPS:LTUS:1: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, "LGPS:LTUS:1:DEGAUSSUB") { field(DESC, "Degauss subroutine") field(INAM, "mgntDegaussInit") field(SNAM, "mgntDegauss") field(BRSV, "INVALID") field(INPA, "LGPS:LTUS:1:DEGAUSIMIN NPP NMS") field(INPB, "LGPS:LTUS:1:DEGAUSIMAX NPP NMS") field(INPC, "LGPS:LTUS:1:DEGAUSTYPE.RVAL NPP NMS") field(INPE, "LGPS:LTUS:1:DEGAUSMETHOD.RVAL NPP NMS") field(INPF, "LGPS:LTUS:1:PSTYPE NPP NMS") field(INPG, "LGPS:LTUS:1:DEBUG.RVAL NPP NMS") field(INPH, "LGPS:LTUS:1: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, "LGPS:LTUS:1:DEGAUSWF PP") field(OUTB, "LGPS:LTUS:1:DEGAUSMSG PP") field(OUTC, "LGPS:LTUS:1: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, "LGPS:LTUS:1:DEGAUSWF") { field(DESC, "Degauss Setpts") field(NELM, "60") field(FTVL, "DOUBLE") } record(mbbo,"LGPS:LTUS:1: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, "LGPS:LTUS:1: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, "LGPS:LTUS:1: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, "LGPS:LTUS:1: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, "LGPS:LTUS:1: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, "LGPS:LTUS:1:DEGAUSIMIN") { field(DESC, "Min. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "50.0") field(LOPR, "-50.0") field(DRVH, "50.0") field(DRVL, "-50.0") field(VAL, "-50.0") } record(ao, "LGPS:LTUS:1:DEGAUSIMAX") { field(DESC, "Max. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "50.0") field(LOPR, "-50.0") field(DRVH, "50.0") field(DRVL, "-50.0") field(VAL, "50.0") } # 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,"LGPS:LTUS:1: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, "LGPS:LTUS:1: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,"LGPS:LTUS:1: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, "LGPS:LTUS:1: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, "LGPS:LTUS:1: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, "LGPS:LTUS:1: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, "LGPS:LTUS:1:DEGAUSTOD") { field(DESC, "Successful Degauss Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "LGPS:LTUS:1:DEGAUSLOSTTOD") { field(DESC, "Degauss Lost Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "LGPS:LTUS:1:DEGAUSTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "LGPS:LTUS:1:DEGAUSTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "LGPS:LTUS:1: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, "LGPS:LTUS:1:DEGAUSGO") { field(DESC, "Set bdes of btrms to zero") field(ASG, "Internal") field(OUTA, "") field(OUTB, "") field(OUTC, "") field(OUTD, "") } # =========== CRYO ONLY =========== record(bo, "LGPS:LTUS:1: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, "LGPS:LTUS:1:DEGAUS_IMAX_CHECK") { field(DESC, "Check if imax shoud chg") field(CALC, "(C==4)&&(ABS(B)>ABS(A))?1:0") field(INPA, "LGPS:LTUS:1:DEGAUS_IMAX") field(INPB, "LGPS:LTUS:1:ISETPT") field(INPC, "LGPS:LTUS:1:DEGAUSTYPE.RVAL") field(OUT, "LGPS:LTUS:1:DEGAUS_IMAX_UPDATE.SELN") field(FLNK, "LGPS:LTUS:1:DEGAUS_IMAX_UPDATE") } record(seq, "LGPS:LTUS:1:DEGAUS_IMAX_UPDATE") { field(DESC, "Degauss IMAX Update") field(SELM, "Specified") field(DOL1, "LGPS:LTUS:1:ISETPT") field(LNK1, "LGPS:LTUS:1:DEGAUS_IMAX PP") } # Set the maximum current after a successful # degauss. This pv is updated by the # sequence. record(ao, "LGPS:LTUS:1:DEGAUS_IMAX") { field(DESC, "Max I set afer a degauss") field(EGU, "Amps") field(PINI, "YES") field(PREC, "6") field(HOPR, "50.0") field(LOPR, "-50.0") field(DRVH, "50.0") field(DRVL, "-50.0") field(VAL, "50.0") field(FLNK, "LGPS:LTUS:1:DEGAUS_IMAXPOL_CHECK") info(autosaveFields,"VAL,RVAL") } # Set the polarity if degauss_imax record(calcout, "LGPS:LTUS:1:DEGAUS_IMAXPOL_CHECK") { field(DESC, "Determine polarity of imax") field(CALC, "A>=0?0:1") field(INPA, "LGPS:LTUS:1:DEGAUS_IMAX") field(FLNK, "LGPS:LTUS:1:DEGAUS_IMAXPOL") } record(bo, "LGPS:LTUS:1:DEGAUS_IMAXPOL") { field(DESC, "Polarity of imax I") field(DTYP, "Raw Soft Channel") field(DOL, "LGPS:LTUS:1:DEGAUS_IMAXPOL_CHECK") field(OMSL, "closed_loop") field(ZNAM, "Positive") field(ONAM, "Negative") field(FLNK, "LGPS:LTUS:1: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, "LGPS:LTUS:1:DEGAUS_ABSIMAX") { field(DESC, "Absolute Max. Degauss I") field(CALC, "ABS(A)") field(INPA, "LGPS:LTUS:1:DEGAUS_IMAX") field(PREC, "6") field(EGU, "Amps") field(HOPR, "50.0") field(LOPR, "-50.0") info(autosaveFields,"VAL RVAL") } # IACT Polarity record(calcout, "LGPS:LTUS:1:IACTPOL_CHECK") { field(DESC, "Determine IACT polarity") field(SCAN, "5 second") field(CALC, "ABS(A-B)>C?(A>=0?0:1):D") field(INPA, "LGPS:LTUS:1:IACT") field(INPB, "LGPS:LTUS:1:IACTPOL_CHECK.LA") field(INPC, "0.0001") field(INPD, "LGPS:LTUS:1:IACTPOL_CHECK.PVAL") field(OOPT, "On Change") field(FLNK, "LGPS:LTUS:1:IACTPOL") } record(bo, "LGPS:LTUS:1: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,"LGPS:LTUS:1: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, "LGPS:LTUS:1:DEGAUSENABLE CP") field(INPB, "LGPS:LTUS:1:DEGAUSOK") field(INPC, "LGPS:LTUS:1:STATE CP") field(INPD, "LGPS:LTUS:1:STATE.SEVR") field(OUT, "LGPS:LTUS:1:DEGAUS_STATE_SEQ.SELN PP") field(ASG, "Internal") } record(seq, "LGPS:LTUS:1:DEGAUS_STATE_SEQ") { field(DESC, "Degauss State Sequence") field(SELM, "Specified") field(SELL, "LGPS:LTUS:1:DEGAUS_STATE_CHECK") field(LNK1, "LGPS:LTUS:1:DEGAUS_STATE_DISABLE.PROC PP") field(LNK2, "LGPS:LTUS:1:DEGAUS_STATE_LOST.PROC PP") field(LNK3, "LGPS:LTUS:1:DEGAUS_STATE_GOOD.PROC PP") field(LNK4, "LGPS:LTUS:1: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, "LGPS:LTUS:1:DEGAUS_STATE_DISABLE") { field(DESC, "Degauss not used") field(LNK1, "LGPS:LTUS:1:DEGAUSOK.ZSV") field(LNK2, "LGPS:LTUS:1: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, "LGPS:LTUS:1:STATMSG.FRSV") field(LNK4, "LGPS:LTUS:1: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, "LGPS:LTUS:1:DEGAUS_STATE_LOST") { field(DESC, "Degauss lost and ps On") field(DOL1, "1") field(LNK1, "LGPS:LTUS:1:DEGAUSOK.ZSV") field(LNK2, "LGPS:LTUS:1: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, "LGPS:LTUS:1:STATMSG.FRSV") field(LNK4, "LGPS:LTUS:1: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, "LGPS:LTUS:1:DEGAUS_STATE_OFF") { field(DESC, "Degaused lost and ps Off") field(DOL1, "2") field(LNK1, "LGPS:LTUS:1: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, "LGPS:LTUS:1:STATMSG.FRSV") field(LNK3, "LGPS:LTUS:1: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, "LGPS:LTUS:1:DEGAUS_STATE_GOOD") { field(DESC, "Degauss good") field(DOL1, "1") field(LNK1, "LGPS:LTUS:1: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, "LGPS:LTUS:1:STATMSG.FRSV PP") field(LNK3, "LGPS:LTUS:1:STATMSG.FVSV PP") field(LNK4, "") field(ASG, "Internal") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(mbbo, "LGPS:LTUS:1:FUNC") { field(DESC, "LGPS:LTUS:1 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, "1") field(NIVL, "2") field(TEVL, "3") field(ELVL, "0") field(TVVL, "0") field(TTVL, "0") field(FTVL, "0") field(FFVL, "0") field(OUT, "LGPS:LTUS:1:CTRL CA") } # :CTRL pv is processed at boot in the # sequence mgntCtrl.st Processed in sequence # record(mbbo, "LGPS:LTUS:1:CTRL") { field(DESC, "LGPS:LTUS:1 Control") field(PINI, "NO") field(ZRST, "Ready") field(ONST, "RESET") field(TWST, "TURN_ON") field(THST, "TURN_OFF") 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, "8") field(TWVL, "9") field(THVL, "10") 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, "LGPS:LTUS:1:SELECTEN.A PP") field(SDIS, "0") } # If a function has been selected set this unit to busy record(calcout, "LGPS:LTUS:1:SELECTEN") { field(DESC, "Control Select Enable") field(CALC, "A>0?1:A") field(FLNK, "LGPS:LTUS:1:BUSY") } # Set to FREE on IOC reboot record(bo, "LGPS:LTUS:1:BUSY") { field(DESC, "LGPS:LTUS:1 Ctrl Done") field(DOL, "LGPS:LTUS:1:SELECTEN") field(ZNAM, "FREE") field(ONAM, "BUSY") field(PINI, "YES") field(FLNK, "LGPS:LTUS:1:SELECT") } record(bo, "LGPS:LTUS:1:SELECT") { field(ZNAM, "NO") field(ONAM, "YES") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") } record(bo, "LGPS:LTUS:1: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, "LGPS:LTUS:1:CTRLSTATE") { field(DESC, "LGPS:LTUS:1 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("LGPS:LTUS:1:CTRL",20,20,0,0,"LGPS:LTUS:1:CTRL") #! Field("LGPS:LTUS:1:CTRL.OUT",16777215,1,"LGPS:LTUS:1:CTRL.OUT") #! Link("LGPS:LTUS:1:CTRL.OUT","LGPS:LTUS:1:SELECTEN.A") #! Field("LGPS:LTUS:1:CTRL.VAL",16777215,1,"LGPS:LTUS:1:CTRL.VAL") #! Record("LGPS:LTUS:1:SELECTEN",321,381,0,0,"LGPS:LTUS:1:SELECTEN") #! Field("LGPS:LTUS:1:SELECTEN.A",16777215,0,"LGPS:LTUS:1:SELECTEN.A") #! Field("LGPS:LTUS:1:SELECTEN.FLNK",16777215,1,"LGPS:LTUS:1:SELECTEN.FLNK") #! Link("LGPS:LTUS:1:SELECTEN.FLNK","LGPS:LTUS:1:BUSY") #! Field("LGPS:LTUS:1:SELECTEN.VAL",16777215,1,"LGPS:LTUS:1:SELECTEN.VAL") #! Record("LGPS:LTUS:1:BUSY",623,274,0,0,"LGPS:LTUS:1:BUSY") #! Field("LGPS:LTUS:1:BUSY.DOL",16777215,0,"LGPS:LTUS:1:BUSY.DOL") #! Link("LGPS:LTUS:1:BUSY.DOL","LGPS:LTUS:1:SELECTEN.VAL") #! Field("LGPS:LTUS:1:BUSY.FLNK",16777215,1,"LGPS:LTUS:1:BUSY.FLNK") #! Link("LGPS:LTUS:1:BUSY.FLNK","LGPS:LTUS:1:SELECT") #! Record("LGPS:LTUS:1:SELECT",669,508,0,1,"LGPS:LTUS:1:SELECT") #! Record("LGPS:LTUS:1:FUNC",940,120,0,0,"LGPS:LTUS:1:FUNC") #! Field("LGPS:LTUS:1:FUNC.OUT",16777215,0,"LGPS:LTUS:1:FUNC.OUT") #! Link("LGPS:LTUS:1:FUNC.OUT","LGPS:LTUS:1:CTRL.VAL") #! Record("LGPS:LTUS:1:ABORT",193,41,0,0,"LGPS:LTUS:1:ABORT") #! Record("LGPS:LTUS:1:CTRLSTATE",369,34,0,0,"LGPS:LTUS:1: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,"LGPS:LTUS:1:SELECT is used for Multi-device selection.\nIt is enabled when associated LGPS:LTUS:1:CTRL is \"0\" (DONE).\nIt is disabled when associated LGPS:LTUS:1: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,"LGPS:LTUS:1: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, "LGPS:LTUS:1:BCTRL_INIT") { field(DESC, "Process BCTRL on boot") field(PINI, "YES") field(CALC, "A=3?1:0") field(INPA, "LGPS:LTUS:1:BCTRL.SEVR") field(OUT, "LGPS:LTUS:1: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, "LGPS:LTUS:1:BACT") { field(DESC, "Actual B") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "LGPS:LTUS:1:BACT") field(INPB, "LGPS:LTUS:1:POLYCOEF") field(INPC, "LGPS:LTUS:1:POLYCOEF.A") field(INPD, "LGPS:LTUS:1:POLYCOEF.B") field(INPE, "LGPS:LTUS:1:IACT MS") field(INPF, "LGPS:LTUS:1:BDELTAS PP") field(INPG, "100") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(HIHI, "50.0") field(LOLO, "0.0") field(PREC, "3") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "50.0") field(LOW, "0.0") field(FLNK, "LGPS:LTUS:1: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, "LGPS:LTUS:1:BDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntPhyDeltas") field(EGU, "Volts") field(HOPR, "1") field(PREC, "3") field(BRSV, "INVALID") field(INPA, "LGPS:LTUS:1:BDES") field(INPB, "LGPS:LTUS:1:TRIMBTOL") field(INPC, "LGPS:LTUS:1:TRIMBTOLR") field(INPD, "LGPS:LTUS:1:CHCKBTOL") field(INPE, "LGPS:LTUS:1:CHCKBTOLR") field(F, "0.0") field(INPG, "30") field(INPH, "LGPS:LTUS:1:BACT.VAL") # # MPS absolute and relative tolerances field(INPP, "LGPS:LTUS:1:MPSBTOL") field(INPQ, "LGPS:LTUS:1:MPSBTOLR") field(FLNK, "LGPS:LTUS:1:BCONLIMITS") info(autosaveFields,"F") } # This record is processed by BDELTAS record(aSub, "LGPS:LTUS:1:BCONLIMITS") { field(DESC, "Config B-field Limits") field(INAM, "mgntInit") field(SNAM, "mgntBCONLimits") field(INPA, "LGPS:LTUS:1:BDES") field(INPB, "LGPS:LTUS:1:BDELTAS.I") field(INPG, "LGPS:LTUS:1:DEBUG.RVAL") field(FTA, "DOUBLE") field(FTB, "DOUBLE") field(FTG, "ULONG") field(OUTA, "LGPS:LTUS:1:BCON.HIGH") field(OUTB, "LGPS:LTUS:1:BCON.LOW") field(OUTC, "LGPS:LTUS:1:BCON.HIHI") field(OUTD, "LGPS:LTUS:1:BCON.LOLO PP") field(FTVA, "DOUBLE") field(FTVB, "DOUBLE") field(FTVC, "DOUBLE") field(FTVD, "DOUBLE") field(BRSV, "INVALID") field(FLNK, "LGPS:LTUS:1:IDELTAS") } # The following PV is processed by :BACT # which is processed by :BACT # record(fanout, "LGPS:LTUS:1:BACTFO") { field(DESC, "BACT processing") field(SELM, "All") field(LNK1, "LGPS:LTUS:1:BDIFF") field(LNK2, "LGPS:LTUS:1:BADIFF") field(LNK3, "LGPS:LTUS:1:BRATIO") field(LNK4, "LGPS:LTUS:1:MPSLIMITS") field(LNK5, "LGPS:LTUS:1:I2BSTATUS") field(LNK6, "LGPS:LTUS:1:IACTFO.PROC") } record(calc, "LGPS:LTUS:1:BDIFF") { field(DESC, "BDES-BACT") field(CALC, "A-B") field(INPA, "LGPS:LTUS:1:BDES") field(INPB, "LGPS:LTUS:1:BACT") field(EGU, "Volts") field(PREC, "7") } record(calc, "LGPS:LTUS:1:BADIFF") { field(DESC, "Absolute BDES-BACT") field(INPA, "LGPS:LTUS:1:BDIFF") field(EGU, "Volts") field(PREC, "7") field(CALC, "A<0?ABS(A):A") } record(calc, "LGPS:LTUS:1:BRATIO") { field(DESC, "BACT Error") field(CALC, "B?A/B:0") field(INPA, "LGPS:LTUS:1:BDIFF") field(INPB, "LGPS:LTUS:1:BDES.HOPR") field(EGU, "Volts") field(PREC, "7") } record(mbbi, "LGPS:LTUS:1: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, "LGPS:LTUS:1:BACT.J") } # Note: for a string slave set the MONFL # macro to the following: # MONFL=:IMONCALC MS record(sub, "LGPS:LTUS:1:BMON") { field(DESC, "Second Transductor") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "LGPS:LTUS:1:BMON") field(INPB, "LGPS:LTUS:1:POLYCOEF") field(INPC, "LGPS:LTUS:1:POLYCOEF.A") field(INPD, "LGPS:LTUS:1:POLYCOEF.B") field(INPE, "LGPS:LTUS:1:IMON MS") field(INPF, "LGPS:LTUS:1:BDELTAS.VAL") field(INPG, "100") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(HIHI, "50.0") field(LOLO, "0.0") field(PREC, "3") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "50.0") field(LOW, "0.0") } # 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:LTUS:1:BDES CP record(ao, "LGPS:LTUS:1:BDES") { field(DESC, "Desired B-Field") field(PINI, "YES") field(DRVH, "50.0") field(DRVL, "0.0") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(EGU, "Volts") field(MDEL, "-1") field(OMSL, "closed_loop") field(DOL, "LGPS:LTUS:1:BDES.DRVH") field(OUT, "LGPS:LTUS:1:B2IDES PP") info(autosaveFields,"VAL") } record(sub, "LGPS:LTUS:1:B2IDES") { field(DESC, "Convert Desired B-Field to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "LGPS:LTUS:1:POLYCOEF") field(INPC, "LGPS:LTUS:1:POLYCOEF.A") field(INPD, "LGPS:LTUS:1:POLYCOEF.B") field(PREC, "3") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(MDEL, "-1") field(INPE, "LGPS:LTUS:1:BDES.DRVH") field(INPF, "LGPS:LTUS:1:BDES.DRVL") field(BRSV, "INVALID") field(FLNK, "LGPS:LTUS:1:IDES") } record(sub, "LGPS:LTUS:1:BNOM") { field(DESC, "Nominal Field") field(PINI, "YES") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "LGPS:LTUS:1:POLYCOEF") field(INPC, "LGPS:LTUS:1:POLYCOEF.A") field(INPD, "LGPS:LTUS:1:POLYCOEF.B") field(INPE, "LGPS:LTUS:1:BDES.DRVH") field(INPF, "LGPS:LTUS:1:BDES.DRVL") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(VAL, "0.0") field(FLNK, "LGPS:LTUS:1:INOM") } record(sub, "LGPS:LTUS:1:BACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "LGPS:LTUS:1:BDES.VAL") field(INPB, "LGPS:LTUS:1:BDES.DRVH") field(INPC, "LGPS:LTUS:1:BDES.DRVL") field(INPD, "LGPS:LTUS:1:BDELTAS.I") field(INPE, "LGPS:LTUS:1:BDELTAS.J") field(INPG, "LGPS:LTUS:1:STATE") field(INPH, "LGPS:LTUS:1:HSTA") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(sub, "LGPS:LTUS:1:BMONLIMITS") { field(DESC, "MON Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "LGPS:LTUS:1:BDES.VAL") field(INPB, "LGPS:LTUS:1:BDES.DRVH") field(INPC, "LGPS:LTUS:1:BDES.DRVL") field(INPD, "LGPS:LTUS:1:BDELTAS.K") field(INPE, "LGPS:LTUS:1:BDELTAS.L") field(INPG, "LGPS:LTUS:1:STATE") field(INPH, "LGPS:LTUS:1:HSTA") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(seq, "LGPS:LTUS:1:BLIMITS") { field(DESC, "ACT Limits") field(PREC, "3") field(DOL1, "LGPS:LTUS:1:BLIMITS") field(LNK1, "LGPS:LTUS:1:BACTLIMITS.F PP") field(DOL2, "LGPS:LTUS:1:BACTLIMITS.I") field(LNK2, "LGPS:LTUS:1:BACT.HIGH") field(DOL3, "LGPS:LTUS:1:BACTLIMITS.J") field(LNK3, "LGPS:LTUS:1:BACT.LOW") field(DOL4, "LGPS:LTUS:1:BACTLIMITS.K") field(LNK4, "LGPS:LTUS:1:BACT.HIHI") field(DOL5, "LGPS:LTUS:1:BACTLIMITS.L") field(LNK5, "LGPS:LTUS:1:BACT.LOLO") field(DOL6, "LGPS:LTUS:1:BLIMITS") field(LNK6, "LGPS:LTUS:1:BMONLIMITS.F PP") field(DOL7, "LGPS:LTUS:1:BMONLIMITS.I") field(LNK7, "LGPS:LTUS:1:BMON.HIGH") field(DOL8, "LGPS:LTUS:1:BMONLIMITS.J") field(LNK8, "LGPS:LTUS:1:BMON.LOW") field(DOL9, "LGPS:LTUS:1:BMONLIMITS.K") field(LNK9, "LGPS:LTUS:1:BMON.HIHI") field(DOLA, "LGPS:LTUS:1:BMONLIMITS.L") field(LNKA, "LGPS:LTUS:1:BMON.LOLO") field(FLNK, "LGPS:LTUS:1:ILIMITS") field(SCAN, "5 second") } record(ao, "LGPS:LTUS:1:BCTRL") { field(DESC, "B-Perturb") field(PREC, "3") field(EGU, "Volts") field(DRVH, "50.0") field(DRVL, "0.0") field(HOPR, "50.0") field(LOPR, "0.0") # 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, "LGPS:LTUS:1: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, "LGPS:LTUS:1:BCTRLGO") { field(DESC, "Update DES and perturb") field(PREC, "3") # Disable BACT limits field(DOL1, "1") field(LNK1, "LGPS:LTUS:1:BLIMITS.VAL") # Update BDES with the BCTRL (slider) value field(DOL2, "LGPS:LTUS:1:BCTRL.VAL") field(LNK2, "LGPS:LTUS:1:BDES PP") field(DOL3, "1") field(LNK3, "LGPS:LTUS:1:IDIRECT.PROC PP") field(DOL4, "1") field(LNK4, "LGPS:LTUS:1:CHECKSTDZLOST.PROC PP") field(DOL5, "LGPS:LTUS:1:BCTRL.VAL") field(LNK5, "LGPS:LTUS:1:BCTRLSUB PP") # Re-enable BACT limits field(DOL6, "0") field(LNK6, "LGPS:LTUS:1:BLIMITS.VAL") } # Convert B-field to Current and output to ISETPT record(sub, "LGPS:LTUS:1:BCTRLSUB") { field(DESC, "Feedback") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "LGPS:LTUS:1:POLYCOEF") field(INPC, "LGPS:LTUS:1:POLYCOEF.A") field(INPD, "LGPS:LTUS:1:POLYCOEF.B") field(INPE, "LGPS:LTUS:1:BDES.DRVH") field(INPF, "LGPS:LTUS:1:BDES.DRVL") field(PREC, "3") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(MDEL, "-1") field(BRSV, "INVALID") field(FLNK, "LGPS:LTUS:1:ISETPT") } record(ao, "LGPS:LTUS:1:BDESPREVTRIM") { field(DESC, "trim bdes for undo") field(DTYP, "Soft Channel") field(DRVH, "50.0") field(DRVL, "0.0") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(PINI, "YES") info(autosaveFields,"VAL") } record(stringin, "LGPS:LTUS:1:MADNAME") { field(DESC, "MAD deck nomenclature") field(PINI, "YES") field(VAL, "B005-2009") } record(ai, "LGPS:LTUS:1: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, "0.0") } record(ao, "LGPS:LTUS:1:BMAX") { field(DESC, "Max B-Field") field(DTYP, "Soft Channel") field(DRVH, "50.0") field(DRVL, "0.0") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(PINI, "YES") field(VAL, "50.0") field(FLNK, "LGPS:LTUS:1:BSTEP") } record(ao, "LGPS:LTUS:1:BMIN") { field(DESC, "Min B-Field") field(DTYP, "Soft Channel") field(DRVH, "50.0") field(DRVL, "0.0") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(PINI, "YES") field(VAL, "0.0") field(FLNK, "LGPS:LTUS:1:BSTEP") } record(ao, "LGPS:LTUS:1:BDESSAVE") { field(DESC, "bdes for save/load") field(DTYP, "Soft Channel") field(DRVH, "50.0") field(DRVL, "0.0") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PINI, "YES") field(PREC, "3") } # This record is processed by LGPS:LTUS:1: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, "LGPS:LTUS:1:BCON") { field(DESC, "Config B-Field ") field(DTYP, "Soft Channel") field(PREC, "3") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(DRVH, "50.0") field(DRVL, "0.0") # 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 , "") field(OMSL, "closed_loop") field(OUT, "LGPS:LTUS:1:B2ICON PP") info(autosaveFields,"VAL") } record(sub, "LGPS:LTUS:1:B2ICON") { field(DESC, "Convert Desired ICon to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "LGPS:LTUS:1:POLYCOEF") field(INPC, "LGPS:LTUS:1:POLYCOEF.A") field(INPD, "LGPS:LTUS:1:POLYCOEF.B") field(PREC, "3") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(MDEL, "-1") field(INPE, "LGPS:LTUS:1:BCON.DRVH") field(INPF, "LGPS:LTUS:1:BCON.DRVL") field(BRSV, "INVALID") field(FLNK, "LGPS:LTUS:1: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, "LGPS:LTUS:1:BSTEP") { field(DESC, "B-Field step size") field(CALC, "(C==3)||(D==3)?0:ABS(A-B)*0.005") field(INPA, "LGPS:LTUS:1:BMAX") field(INPB, "LGPS:LTUS:1:BMIN") field(INPC, "LGPS:LTUS:1:BMIN.SEVR") field(INPD, "LGPS:LTUS:1:BMAX.SEVR") field(EGU, "Volts") 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,"LGPS:LTUS:1:BCTRLDISABLECALC") { field(DESC, "Calc for disabling BCTRL") field(ASG, "Internal") field(CALC, "A?2:1") field(INPA, "LGPS:LTUS:1:ONLINE CP") field(OUT, "LGPS:LTUS:1:BCTRLDISABLEFOUT PP") } record(fanout, "LGPS:LTUS:1:BCTRLDISABLEFOUT") { field(DESC, "Disable BCTRL fanout") field(SELM, "Specified") field(SELL, "LGPS:LTUS:1:BCTRLDISABLECALC") field(LNK1, "LGPS:LTUS:1:BCTRLDISABLE") field(LNK2, "LGPS:LTUS:1:BCTRLENABLE") } record(stringout, "LGPS:LTUS:1:BCTRLDISABLE") { field(DESC, "Disable BCTRL") field(DTYP, "Soft Channel") field(OUT, "LGPS:LTUS:1:BCTRL.ASG") field(VAL, "NOWRITE") field(FLNK, "LGPS:LTUS:1:BCTRLDISV_UPDATE") } record(stringout, "LGPS:LTUS:1:BCTRLENABLE") { field(DESC, "Enable BCTRL") field(DTYP, "Soft Channel") field(OUT, "LGPS:LTUS:1:BCTRL.ASG") field(VAL, "") field(FLNK, "LGPS:LTUS:1:BCTRLDISV_UPDATE") } record(calcout, "LGPS:LTUS:1:BCTRLDISV_UPDATE") { field(DESC, "Calc for updating BCTRL.DISV") field(ASG, "Internal") field(CALC, "A") field(INPA, "LGPS:LTUS:1:ONLINE") field(OUT, "LGPS:LTUS:1: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,"LGPS:LTUS:1:BACT and MON\n are processed via links from \n LGPS:LTUS:1:IACT (device raw value readback 1)\n and\n LGPS:LTUS:1: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 LGPS:LTUS:1:POLYCOEF\nC = First polynomial coefficient (offset if linear)\nD = Second polynomial coefficient (slope if linear)\nE = LGPS:LTUS:1: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,"LGPS:LTUS:1:BDES\n is processed when set by CA users or \n LGPS:LTUS:1: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,"LGPS:LTUS:1: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 LGPS:LTUS:1: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 (LGPS:LTUS:1: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,"LGPS:LTUS:1:B*LIMITS and LGPS:LTUS:1:BLIMITS:\n Calculate alarm and warning limits based on \n deltas from LGPS:LTUS:1: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,"LGPS:LTUS:1: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,"LGPS:LTUS:1: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, "LGPS:LTUS:1: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, "LGPS:LTUS:1:MPSBTOL") { field(DESC, "Absolute mps tol") field(EGU, "Volts") field(PREC, "2") field(CALC, "ABS(A)*0.02") field(INPA, "LGPS:LTUS:1:BMAX") field(PINI, "YES") } # # 21-Aug-2013: K. Luchini # Set channel access security so that users # cannot easily change values. record(ao, "LGPS:LTUS:1:MPSBMAX") { field(DESC, "MPS Max B-field") field(EGU, "Volts") field(PREC, "7") field(DRVH, "50.0") field(DRVL, "0.0") field(PINI, "YES") field(VAL, "50.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "LGPS:LTUS:1:MPSBMIN") { field(DESC, "MPS Min B-field") field(EGU, "Volts") field(PREC, "7") field(DRVH, "50.0") field(DRVL, "0.0") field(PINI, "YES") field(VAL, "0.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "LGPS:LTUS:1:MPSBLLIM") { field(DESC, "MPS Low Limit B-field") field(EGU, "Volts") field(PREC, "7") field(DRVH, "50.0") field(DRVL, "0.0") field(PINI, "YES") field(VAL, "0.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "LGPS:LTUS:1:MPSBLLIM2") { field(DESC, "MPS Low Limit #2 B-field") field(EGU, "Volts") field(PREC, "7") field(DRVH, "50.0") field(DRVL, "0.0") field(PINI, "YES") field(VAL, "0.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } # Set the default to Std record(mbbo, "LGPS:LTUS:1: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, "LGPS:LTUS:1:MPSLIMITS.E PP") } record(aSub, "LGPS:LTUS:1: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, "LGPS:LTUS:1:MPS.RVAL") field(INPB, "LGPS:LTUS:1:BADIFF") field(INPC, "LGPS:LTUS:1:BDELTAS.N") field(INPD, "LGPS:LTUS:1:BACT") field(INPE, "LGPS:LTUS:1:MPSBITMASK.RVAL") field(INPF, "LGPS:LTUS:1:MPSBLLIM") field(INPG, "LGPS:LTUS:1:MPSBMIN") field(INPH, "LGPS:LTUS:1:MPSBMAX") field(INPI, "LGPS:LTUS:1: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, "LGPS:LTUS:1:INTOL.RVAL PP") field(OUTB, "LGPS:LTUS:1:INTOL_BMIN.RVAL PP") field(OUTC, "LGPS:LTUS:1:INTOL_BRANGE.RVAL PP") field(OUTD, "LGPS:LTUS:1: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, "LGPS:LTUS:1:INTOL") { field(DESC, "BACT within MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "LGPS:LTUS:1:MPSLIMITS.VALA") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "LGPS:LTUS:1:INTOL_BMIN") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "LGPS:LTUS:1:MPSLIMITS.VALB") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "LGPS:LTUS:1:INTOL_BMIN2") { field(DESC, "MPS tol #2") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "LGPS:LTUS:1:MPSLIMITS.VALD") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "LGPS:LTUS:1:INTOL_BRANGE") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "LGPS:LTUS:1: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, "LGPS:LTUS:1:CHCKITOL") { field(DESC, "Absolute Check I Tolerance") field(EGU, "A") field(FLNK, "LGPS:LTUS:1:TRIMITOL") field(CALC, "ABS(A*B)") field(INPA, "LGPS:LTUS:1:CHCKBTOL") field(INPB, "LGPS:LTUS:1:POLYCOEF.B") field(PREC, "9") } record(calc, "LGPS:LTUS:1:TRIMBTOL") { field(EGU, "Volts") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(DESC, "Absolute Trim Tolerance") field(CALC, "ABS(A)/2") field(INPA, "LGPS:LTUS:1:CHCKBTOL") field(FLNK, "LGPS:LTUS:1:CHCKITOL") } record(calc, "LGPS:LTUS:1:CHCKBTOL") { field(DESC, "Check absolute tolerance") field(EGU, "A") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(FLNK, "LGPS:LTUS:1:TRIMBTOL") field(CALC, "MAX(ABS(A),ABS(C))*(B/1000000)") field(INPA, "LGPS:LTUS:1:BDES.HOPR") field(INPB, "LGPS:LTUS:1:STABILITY") field(INPC, "LGPS:LTUS:1:BDES.LOPR") } record(longout, "LGPS:LTUS:1:STABILITY") { field(DESC, "Long Term Stability") field(PINI, "YES") field(VAL, "15000") field(EGU, "ppm") field(DRVH, "20000") field(DRVL, "100") field(HOPR, "20000") field(LOPR, "100") field(FLNK, "LGPS:LTUS:1:CHCKBTOL") } record(calc, "LGPS:LTUS:1:TRIMITOL") { field(DESC, "Absolute Trim I Tolerance") field(EGU, "Volts") field(CALC, "ABS(A*B)") field(INPA, "LGPS:LTUS:1:POLYCOEF.B") field(INPB, "LGPS:LTUS:1:TRIMBTOL") field(PREC, "9") } record(ai, "LGPS:LTUS:1:TRIMBTOLR") { field(DESC, "Relative trim tol") field(PREC, "4") field(EGU, "%") field(HOPR, "1.0") field(LOPR, "0.0") field(PINI, "YES") } record(ai, "LGPS:LTUS:1: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, "LGPS:LTUS:1:FBCKFCOM") { field(ZNAM, "CA") field(ONAM, "FCOM") field(DESC, "CA Mode") field(PINI, "YES") field(SDIS, "0") } record(bo, "LGPS:LTUS:1:PAU") { field(ZNAM, "NotConfigured") field(ONAM, "Configured") field(DESC, "PAU Present") field(PINI, "YES") field(SDIS, "0") field(FLNK, "LGPS:LTUS:1:PAUGO") } record(fanout, "LGPS:LTUS:1:PAUGO") { field(DESC, "PAU control") field(LNK1, "LGPS:LTUS:1:PAUSTOP") field(LNK2, "LGPS:LTUS:1: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, "LGPS:LTUS:1:PAUSTART") { field(DESC, "Setup for PAU On") field(SDIS, "LGPS:LTUS:1: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, "LGPS:LTUS:1:PAUSTOP") { field(DESC, "Setup for PAU Off") field(SDIS, "LGPS:LTUS:1: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, "LGPS:LTUS:1:MCORDEVNAME") { field(DESC, "PS device name") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, "PS:LTUS:1:") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "LGPS:LTUS:1: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, "LGPS:LTUS:1:PSTYPE.RVAL") field(INPC, "LGPS:LTUS:1:TURNEDOFF.RVAL") field(INPD, "LGPS:LTUS:1:CONFIG.RVAL") field(INPE, "LGPS:LTUS:1:PSCATEGORY.RVAL") field(INPF, "LGPS:LTUS:1:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "LGPS:LTUS:1:AUTOCTRL.RVAL") field(INPJ, "LGPS:LTUS:1:OUTOFSERVICE.RVAL") field(INPL, "LGPS:LTUS:1:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "LGPS:LTUS:1:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "LGPS:LTUS:1:PAU") field(INPP, "LGPS:LTUS:1:CALBDISABLE.RVAL") field(INPQ, "LGPS:LTUS:1:PTRBDISABLE.RVAL") field(INPR, "LGPS:LTUS:1:TRIMDISABLE.RVAL") field(INPS, "LGPS:LTUS:1:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "LGPS:LTUS:1:FBCK") field(INPU, "LGPS:LTUS:1:TRIMTYPE.RVAL") field(INPV, "LGPS:LTUS:1:STDZDIRECT.RVAL") field(INPW, "LGPS:LTUS:1:DEGAUSENABLE.RVAL") field(FLNK, "LGPS:LTUS:1:HSTA") } record(longin, "LGPS:LTUS:1:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "LGPS:LTUS:1:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "LGPS:LTUS:1: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, "LGPS:LTUS:1: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, "LGPS:LTUS:1: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, "LGPS:LTUS:1: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, "LGPS:LTUS:1: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, "LGPS:LTUS:1: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 LGPS:LTUS:1:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses LGPS:LTUS:1:FBCK. # This PV should be replaced by LGPS:LTUS:1: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, "LGPS:LTUS:1: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, "LGPS:LTUS:1: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, "LGPS:LTUS:1: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, "") field(OMSL, "supervisory") field(FLNK, "LGPS:LTUS:1:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"LGPS:LTUS:1:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "LGPS:LTUS:1:OUTOFSERVICE NPP NMS") field(OUT, "LGPS:LTUS:1:ONLINE PP") } record(bo, "LGPS:LTUS:1:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "LGPS:LTUS:1: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, "1") } record(bo, "LGPS:LTUS:1: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, "1") } record(bo, "LGPS:LTUS:1: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, "1") } # This PV is modified by :STATSUB.U record(bo, "LGPS:LTUS:1: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, "LGPS:LTUS:1: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, "LGPS:LTUS:1: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, "LGPS:LTUS:1: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, "LGPS:LTUS:1: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, "1") field(ASG, "NOWRITE") } record(mbbo, "LGPS:LTUS:1: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, "2") field(ASG, "NOWRITE") } record(mbbo, "LGPS:LTUS:1: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, "3") field(ASG, "NOWRITE") } record(mbbo, "LGPS:LTUS:1: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, "0") field(ASG, "NOWRITE") field(FLNK, "LGPS:LTUS:1:TRIMTYPE") } record(stringout, "LGPS:LTUS:1:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "LGPS:LTUS:1:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "LGPS:LTUS:1:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "LGPS:LTUS:1:STATE.RVAL") field(INPB, "LGPS:LTUS:1:INTLKSUMY.RVAL") field(OUT, "LGPS:LTUS:1:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "LGPS:LTUS:1: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, "LGPS:LTUS:1:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "LGPS:LTUS:1:STATE.RVAL") field(INPB, "LGPS:LTUS:1:INTLKSUMY.RVAL") field(OUT, "LGPS:LTUS:1:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "LGPS:LTUS:1:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "LGPS:LTUS:1:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "LGPS:LTUS:1: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, "LGPS:LTUS:1: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, "LGPS:LTUS:1: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, "LGPS:LTUS:1: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,"LGPS:LTUS:1: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("LGPS:LTUS:1:TURNEDOFF",3140,1907,0,1,"LGPS:LTUS:1:TURNEDOFF") #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "LGPS:LTUS:1:STATSUB") { field(DESC, "Build STATus ") field(INAM, "mgntInit") field(SNAM, "mgntSlcStat") field(INPA, "LGPS:LTUS:1:BACT.STAT") field(INPB, "LGPS:LTUS:1:BDES.STAT") field(INPC, "LGPS:LTUS:1:IRIPL.STAT") field(INPD, "PS:LTUS:1:ISETPT.STAT") field(INPE, "PS:LTUS:1:IACT.STAT") # 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, "LGPS:LTUS:1:BACT.SEVR") field(INPH, "LGPS:LTUS:1:BDES.SEVR") field(INPI, "LGPS:LTUS:1:IRIPL.SEVR") field(INPJ, "PS:LTUS:1:ISETPT.SEVR") field(INPK, "PS:LTUS:1:IACT.SEVR") # # 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, "LGPS:LTUS:1:STATE.RVAL") field(INPN, "LGPS:LTUS:1:STDZOK") field(INPO, "LGPS:LTUS:1:CALBOK") field(INPP, "LGPS:LTUS:1:OUTOFSERVICE.RVAL") field(INPQ, "LGPS:LTUS:1:CONFIG.RVAL") field(INPR, "LGPS:LTUS:1:HSTA") field(INPS, "LGPS:LTUS:1:CTRL.RVAL") field(INPT, "LGPS:LTUS:1:DEGAUSOK") field(INPV, "LGPS:LTUS:1: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, "LGPS:LTUS:1:STAT") } record(longout, "LGPS:LTUS:1:STAT") { field(DESC, "STAT sent to SLC") field(SCAN, "Passive") field(FLNK, "LGPS:LTUS:1:STATCTRLSUB") field(DOL, "LGPS:LTUS:1:STATSUB.VAL") field(OMSL, "closed_loop") } record(sSub, "LGPS:LTUS:1:STATCTRLSUB") { field(DESC, "Decode SLC STAT into mbbo") field(INAM, "mgntInit") field(SNAM, "mgntStatDecode") field(INPA, "LGPS:LTUS:1:STAT") field(INPB, "LGPS:LTUS:1:HSTA") field(INPD, "LGPS:LTUS:1:ONOFFCTRL.RVAL") field(FLNK, "LGPS:LTUS:1:STATMSG") } record(mbbo, "LGPS:LTUS:1: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, "LGPS:LTUS:1:UNAVAILGO") field(DOL, "LGPS:LTUS:1:STATCTRLSUB.W") } record(seq, "LGPS:LTUS:1:UNAVAILGO") { field(DESC, "Process UNAVAIL") field(DOL1, "LGPS:LTUS:1:STATSUB.U") field(LNK1, "LGPS:LTUS:1:UNAVAIL PP") } record(stringout, "LGPS:LTUS:1:SNLSTATMSG") { field(DTYP, "Soft Channel") } #! TextBox(TB0,820,1000,1200,1220,0,"Dialog",12,1,16777215,"LGPS:LTUS:1:STATUSSUB - future\nOverall device status - takes input from action snls, record sevrs, master snl(s) and outputs final status\n\nInputs:\nA - LGPS:LTUS:1:CTRLSTATUS - snl status\nB - MGNT:CTRLSTATUS - master list status\nC\nD - LGPS:LTUS:1: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,"LGPS:LTUS:1STATSUB\nformat control bo's into slc STAT\n\nInputs:\nA - LGPS:LTUS:1:STATUS\nC - LGPS:LTUS:1:ON\nD - LGPS:LTUS:1:STDZOK\nE - LGPS:LTUS:1:CALBOK\nF - LGPS:LTUS:1:BACTDRIFT (future)\nG -\nH- LGPS:LTUS:1:DACSTATUS\nI -LGPS:LTUS:1:ADCSTATUS\nJ - LGPS:LTUS:1:BACTSTATUS\nK - LGPS:LTUS:1:BDESSTATUS\nL - LGPS:LTUS:1:RIPLSTATUS\n\nOutput:\nP - LGPS:LTUS:1: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, "LGPS:LTUS:1: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, "LGPS:LTUS:1: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, "LGPS:LTUS:1: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, "LGPS:LTUS:1: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.6 #! DBDSTART #! DBD("../../../../dbd/mgntSoft.dbd") #! DBDEND record(stringout, "LGPS:LTUS:1:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "LGPS:LTUS:1:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "LGPS:LTUS:1:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "LGPS:LTUS:1:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "LGPS:LTUS:1:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "LGPS:LTUS:1:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "1") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "LGPS:LTUS:1: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, "LGPS:LTUS:1:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "LGPS:LTUS:1:TRIMTYPE.RVAL") field(INPB, "LGPS:LTUS:1:CONFIG.RVAL") field(OUT, "LGPS:LTUS:1:TRIMMAXNUM PP") } record(longout, "LGPS:LTUS:1: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, "LGPS:LTUS:1:TRIMRAMPRATE") { field(DESC, "Trim Ramp rate ") field(PINI, "YES") field(ASG, "IOC_MAINT") field(PREC, "3") field(EGU, "Volts/sec") field(HOPR, "20.0") field(DRVH, "20.0") field(DRVL, "0.1") field(LOPR, "0.5") # field(DOL, "") field(OMSL, "supervisory") field(VAL, "10") field(OUT, "LGPS:LTUS:1:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "LGPS:LTUS:1: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, "") field(OMSL, "supervisory") field(VAL, "10") } record(bo, "LGPS:LTUS:1: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, "LGPS:LTUS:1: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, "LGPS:LTUS:1:TRIMSTEPMIN") { field(DESC, "Min step in current") field(DTYP, "Soft Channel") # field(DOL, "") field(PREC, "7") field(EGUF, "10") field(EGUL, "0") field(EGU, "Volts") field(HOPR, "10") field(LOPR, "0") field(VAL, "5.0") } record(bo, "LGPS:LTUS:1:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "0") } record(ao, "LGPS:LTUS:1: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, "LGPS:LTUS:1:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "LGPS:LTUS:1: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, "LGPS:LTUS:1: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, "LGPS:LTUS:1:IMOVE") field(INPB, "LGPS:LTUS:1:IACT") field(INPC, "LGPS:LTUS:1:IRAMPRATE") field(INPD, "1.0") field(INPE, "LGPS:LTUS:1:TRIMDLYPCT") field(INPF, "LGPS:LTUS:1:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "LGPS:LTUS:1:RAMPTIME_LEFT PP") } record(longout, "LGPS:LTUS:1:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "LGPS:LTUS:1:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "LGPS:LTUS:1:RAMPDONE_CALC") } record(calc, "LGPS:LTUS:1:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "LGPS:LTUS:1:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "LGPS:LTUS:1:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "LGPS:LTUS:1: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, "LGPS:LTUS:1:RAMPTIME_LEFT") field(OUT, "LGPS:LTUS:1:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "LGPS:LTUS:1:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "LGPS:LTUS:1:RAMPTIME_LEFT NMS") field(OUT, "LGPS:LTUS:1:RAMPDONE PP") } record(bo, "LGPS:LTUS:1:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "LGPS:LTUS:1:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "LGPS:LTUS:1: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, "LGPS:LTUS:1: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(ai, "LGPS:LTUS:1: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, "LGPS:LTUS:1:MPSBTOL") { field(DESC, "Absolute mps tol") field(EGU, "Volts") field(PREC, "2") field(CALC, "ABS(A)*0.02") field(INPA, "LGPS:LTUS:1:BMAX") field(PINI, "YES") } # # 21-Aug-2013: K. Luchini # Set channel access security so that users # cannot easily change values. record(ao, "LGPS:LTUS:1:MPSBMAX") { field(DESC, "MPS Max B-field") field(EGU, "Volts") field(PREC, "7") field(DRVH, "50.0") field(DRVL, "0.0") field(PINI, "YES") field(VAL, "50.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "LGPS:LTUS:1:MPSBMIN") { field(DESC, "MPS Min B-field") field(EGU, "Volts") field(PREC, "7") field(DRVH, "50.0") field(DRVL, "0.0") field(PINI, "YES") field(VAL, "0.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "LGPS:LTUS:1:MPSBLLIM") { field(DESC, "MPS Low Limit B-field") field(EGU, "Volts") field(PREC, "7") field(DRVH, "50.0") field(DRVL, "0.0") field(PINI, "YES") field(VAL, "0.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "LGPS:LTUS:1:MPSBLLIM2") { field(DESC, "MPS Low Limit #2 B-field") field(EGU, "Volts") field(PREC, "7") field(DRVH, "50.0") field(DRVL, "0.0") field(PINI, "YES") field(VAL, "0.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } # Set the default to Std record(mbbo, "LGPS:LTUS:1: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, "LGPS:LTUS:1:MPSLIMITS.E PP") } record(aSub, "LGPS:LTUS:1: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, "LGPS:LTUS:1:MPS.RVAL") field(INPB, "LGPS:LTUS:1:BADIFF") field(INPC, "LGPS:LTUS:1:BDELTAS.N") field(INPD, "LGPS:LTUS:1:BACT") field(INPE, "LGPS:LTUS:1:MPSBITMASK.RVAL") field(INPF, "LGPS:LTUS:1:MPSBLLIM") field(INPG, "LGPS:LTUS:1:MPSBMIN") field(INPH, "LGPS:LTUS:1:MPSBMAX") field(INPI, "LGPS:LTUS:1: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, "LGPS:LTUS:1:INTOL.RVAL PP") field(OUTB, "LGPS:LTUS:1:INTOL_BMIN.RVAL PP") field(OUTC, "LGPS:LTUS:1:INTOL_BRANGE.RVAL PP") field(OUTD, "LGPS:LTUS:1: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, "LGPS:LTUS:1:INTOL") { field(DESC, "BACT within MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "LGPS:LTUS:1:MPSLIMITS.VALA") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "LGPS:LTUS:1:INTOL_BMIN") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "LGPS:LTUS:1:MPSLIMITS.VALB") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "LGPS:LTUS:1:INTOL_BMIN2") { field(DESC, "MPS tol #2") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "LGPS:LTUS:1:MPSLIMITS.VALD") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "LGPS:LTUS:1:INTOL_BRANGE") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "LGPS:LTUS:1: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, "LGPS:LTUS:1:CHCKITOL") { field(DESC, "Absolute Check I Tolerance") field(EGU, "A") field(FLNK, "LGPS:LTUS:1:TRIMITOL") field(CALC, "ABS(A*B)") field(INPA, "LGPS:LTUS:1:CHCKBTOL") field(INPB, "LGPS:LTUS:1:POLYCOEF.B") field(PREC, "9") } record(calc, "LGPS:LTUS:1:TRIMBTOL") { field(EGU, "Volts") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(DESC, "Absolute Trim Tolerance") field(CALC, "ABS(A)/2") field(INPA, "LGPS:LTUS:1:CHCKBTOL") field(FLNK, "LGPS:LTUS:1:CHCKITOL") } record(calc, "LGPS:LTUS:1:CHCKBTOL") { field(DESC, "Check absolute tolerance") field(EGU, "A") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(FLNK, "LGPS:LTUS:1:TRIMBTOL") field(CALC, "MAX(ABS(A),ABS(C))*(B/1000000)") field(INPA, "LGPS:LTUS:1:BDES.HOPR") field(INPB, "LGPS:LTUS:1:STABILITY") field(INPC, "LGPS:LTUS:1:BDES.LOPR") } record(longout, "LGPS:LTUS:1:STABILITY") { field(DESC, "Long Term Stability") field(PINI, "YES") field(VAL, "1000") field(EGU, "ppm") field(DRVH, "20000") field(DRVL, "100") field(HOPR, "20000") field(LOPR, "100") field(FLNK, "LGPS:LTUS:1:CHCKBTOL") } record(calc, "LGPS:LTUS:1:TRIMITOL") { field(DESC, "Absolute Trim I Tolerance") field(EGU, "Volts") field(CALC, "ABS(A*B)") field(INPA, "LGPS:LTUS:1:POLYCOEF.B") field(INPB, "LGPS:LTUS:1:TRIMBTOL") field(PREC, "9") } record(ai, "LGPS:LTUS:1:TRIMBTOLR") { field(DESC, "Relative trim tol") field(PREC, "4") field(EGU, "%") field(HOPR, "1.0") field(LOPR, "0.0") field(PINI, "YES") } record(ai, "LGPS:LTUS:1: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.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "LGPS:LTUS:1: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, "LGPS:LTUS:1:PSTYPE.RVAL") field(INPC, "LGPS:LTUS:1:TURNEDOFF.RVAL") field(INPD, "LGPS:LTUS:1:CONFIG.RVAL") field(INPE, "LGPS:LTUS:1:PSCATEGORY.RVAL") field(INPF, "LGPS:LTUS:1:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "LGPS:LTUS:1:AUTOCTRL.RVAL") field(INPJ, "LGPS:LTUS:1:OUTOFSERVICE.RVAL") field(INPL, "LGPS:LTUS:1:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "LGPS:LTUS:1:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "LGPS:LTUS:1:PAU") field(INPP, "LGPS:LTUS:1:CALBDISABLE.RVAL") field(INPQ, "LGPS:LTUS:1:PTRBDISABLE.RVAL") field(INPR, "LGPS:LTUS:1:TRIMDISABLE.RVAL") field(INPS, "LGPS:LTUS:1:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "LGPS:LTUS:1:FBCK") field(INPU, "LGPS:LTUS:1:TRIMTYPE.RVAL") field(INPV, "LGPS:LTUS:1:STDZDIRECT.RVAL") field(INPW, "LGPS:LTUS:1:DEGAUSENABLE.RVAL") field(FLNK, "LGPS:LTUS:1:HSTA") } record(longin, "LGPS:LTUS:1:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "LGPS:LTUS:1:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "LGPS:LTUS:1: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, "LGPS:LTUS:1: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, "LGPS:LTUS:1: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, "LGPS:LTUS:1: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, "LGPS:LTUS:1: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, "LGPS:LTUS:1: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 LGPS:LTUS:1:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses LGPS:LTUS:1:FBCK. # This PV should be replaced by LGPS:LTUS:1: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, "LGPS:LTUS:1: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, "LGPS:LTUS:1: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, "LGPS:LTUS:1: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, "") field(OMSL, "supervisory") field(FLNK, "LGPS:LTUS:1:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"LGPS:LTUS:1:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "LGPS:LTUS:1:OUTOFSERVICE NPP NMS") field(OUT, "LGPS:LTUS:1:ONLINE PP") } record(bo, "LGPS:LTUS:1:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "PS:LTUS:1:CommLink PP") } record(bo, "LGPS:LTUS:1: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, "1") } record(bo, "LGPS:LTUS:1: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, "1") } record(bo, "LGPS:LTUS:1: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, "1") } # This PV is modified by :STATSUB.U record(bo, "LGPS:LTUS:1: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, "LGPS:LTUS:1: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, "LGPS:LTUS:1: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, "LGPS:LTUS:1: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, "LGPS:LTUS:1: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, "1") field(ASG, "NOWRITE") } record(mbbo, "LGPS:LTUS:1: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, "2") field(ASG, "NOWRITE") } record(mbbo, "LGPS:LTUS:1: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, "5") field(ASG, "NOWRITE") } record(mbbo, "LGPS:LTUS:1: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, "0") field(ASG, "NOWRITE") field(FLNK, "LGPS:LTUS:1:TRIMTYPE") } record(stringout, "LGPS:LTUS:1:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "LGPS:LTUS:1:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "LGPS:LTUS:1:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "LGPS:LTUS:1:STATE.RVAL") field(INPB, "LGPS:LTUS:1:INTLKSUMY.RVAL") field(OUT, "LGPS:LTUS:1:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "LGPS:LTUS:1: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, "LGPS:LTUS:1:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "LGPS:LTUS:1:STATE.RVAL") field(INPB, "LGPS:LTUS:1:INTLKSUMY.RVAL") field(OUT, "LGPS:LTUS:1:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "LGPS:LTUS:1:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "LGPS:LTUS:1:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "LGPS:LTUS:1: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, "LGPS:LTUS:1: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, "LGPS:LTUS:1: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, "LGPS:LTUS:1: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,"LGPS:LTUS:1: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("LGPS:LTUS:1:TURNEDOFF",3140,1907,0,1,"LGPS:LTUS:1:TURNEDOFF") #! 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, "LGPS:LTUS:2:IACT") { field(DESC, "Current") field(INP, "PS:LTUS:2:IACT") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "LGPS:LTUS:2:BACT") info(autosaveFields,"HYST") } record(bi, "LGPS:LTUS:2:STATE") { field(DESC, "PS On/Off Status") field(DTYP, "Raw Soft Channel") field(INP, "PS:LTUS:2:STATE CP MS") field(ZSV, "MAJOR") field(ZNAM, "OFF") field(ONAM, "ON") } record(ao, "LGPS:LTUS:2:IDES") { field(DESC, "Desired Current") field(PREC, "3") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(MDEL, "-1") field(HIHI, "50.0") field(LOLO, "0.0") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "LGPS:LTUS:2:BDELTAS") field(DRVH, "50.0") field(DRVL, "0.0") field(DOL, "LGPS:LTUS:2: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, "LGPS:LTUS:2:ICTRL PP") } # This record is processed by LGPS:LTUS:2:ICON") # Note: we are not setting alarms here. record(ao, "LGPS:LTUS:2:ICON") { field(DESC, "Config I") field(DTYP, "Soft Channel") field(PREC, "3") field(HOPR, "50.0") field(LOPR, "0.0") field(DRVH, "50.0") field(DRVL, "0.0") field(DOL, "LGPS:LTUS:2:B2ICON.K") field(OMSL, "closed_loop") info(autosaveFields,"VAL") } record(ao, "LGPS:LTUS:2:INOM") { field(DESC, "Nominal Current") field(DOL, "LGPS:LTUS:2:BNOM.K") field(OMSL, "closed_loop") field(PREC, "3") field(EGU, "Volts") field(DRVH, "50.0") field(DRVL, "0.0") field(HOPR, "50.0") field(LOPR, "0.0") } record(ao, "LGPS:LTUS:2:ICTRL") { field(DESC, "Set Current") field(PREC, "3") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(DRVH, "50.0") field(DRVL, "0.0") field(MDEL, "-1") field(FLNK, "LGPS:LTUS:2:ICTRLGO") field(OMSL, "supervisory") info(autosavefields,"VAL") } record(seq, "LGPS:LTUS:2:ICTRLGO") { field(DESC, "Process Current Setpoint") field(PREC, "3") # Set ISETPT to supervisory field(DOL1, "0") field(LNK1, "LGPS:LTUS:2:ISETPT.OMSL") field(DOL2, "LGPS:LTUS:2:ICTRL") field(LNK2, "LGPS:LTUS:2:ISETPT PP") # Set ISETPT to closed loop - get data from BCTRLSUB.K field(DOL3, "1") field(LNK3, "LGPS:LTUS:2:ISETPT.OMSL") } record(ao, "LGPS:LTUS:2:IMAX") { field(DESC, "Max I") field(DTYP, "Soft Channel") field(DRVH, "50.0") field(DRVL, "0.0") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(PINI, "YES") field(VAL, "50.0") field(FLNK, "LGPS:LTUS:2:IMIN") } record(ao, "LGPS:LTUS:2:IMIN") { field(DESC, "Min I") field(DTYP, "Soft Channel") field(DRVH, "50.0") field(DRVL, "0.0") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(VAL, "0.0") field(FLNK, "LGPS:LTUS:2:IRANGE") } record(sel, "LGPS:LTUS:2:IACTPREVOK") { field(DESC, "Last Good Current") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(NVL, "LGPS:LTUS:2:BACT.SEVR") field(INPA, "LGPS:LTUS:2:IACT NPP MS") field(INPB, "LGPS:LTUS:2:IACTPREVOK NPP MS") field(INPC, "LGPS:LTUS:2:IACTPREVOK NPP MS") field(INPD, "LGPS:LTUS:2:IACTPREVOK NPP MS") } record(sub, "LGPS:LTUS:2:IACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "LGPS:LTUS:2:IDES") field(INPB, "LGPS:LTUS:2:ISETPT.DRVH") field(INPC, "LGPS:LTUS:2:ISETPT.DRVL") field(INPD, "LGPS:LTUS:2:IDELTAS.I") field(INPE, "LGPS:LTUS:2:IDELTAS.J") field(INPG, "LGPS:LTUS:2:STATE") field(INPH, "LGPS:LTUS:2:HSTA") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(sub, "LGPS:LTUS:2:IMONLIMITS") { field(DESC, "Aux Current Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "LGPS:LTUS:2:IDES") field(INPB, "LGPS:LTUS:2:ISETPT.DRVH") field(INPC, "LGPS:LTUS:2:ISETPT.DRVL") field(INPD, "LGPS:LTUS:2:IDELTAS.K") field(INPE, "LGPS:LTUS:2:IDELTAS.L") field(INPG, "LGPS:LTUS:2:STATE") field(INPH, "LGPS:LTUS:2:HSTA") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(seq, "LGPS:LTUS:2:ILIMITS") { field(DESC, "Set ACT and MON Limits") field(PREC, "3") field(DOL1, "LGPS:LTUS:2:BLIMITS") field(LNK1, "LGPS:LTUS:2:IACTLIMITS.F PP") field(DOL2, "LGPS:LTUS:2:IACTLIMITS.I") field(LNK2, "LGPS:LTUS:2:IACT.HIGH") field(DOL3, "LGPS:LTUS:2:IACTLIMITS.J") field(LNK3, "LGPS:LTUS:2:IACT.LOW") field(DOL4, "LGPS:LTUS:2:IACTLIMITS.K") field(LNK4, "LGPS:LTUS:2:IACT.HIHI") field(DOL5, "LGPS:LTUS:2:IACTLIMITS.L") field(LNK5, "LGPS:LTUS:2:IACT.LOLO") field(DOL6, "LGPS:LTUS:2:BLIMITS") field(LNK6, "LGPS:LTUS:2:IMONLIMITS.F PP") field(DOL7, "LGPS:LTUS:2:IMONLIMITS.I") field(LNK7, "LGPS:LTUS:2:IMON.HIGH") field(DOL8, "LGPS:LTUS:2:IMONLIMITS.J") field(LNK8, "LGPS:LTUS:2:IMON.LOW") field(DOL9, "LGPS:LTUS:2:IMONLIMITS.K") field(LNK9, "LGPS:LTUS:2:IMON.HIHI") field(DOLA, "LGPS:LTUS:2:IMONLIMITS.L") field(LNKA, "LGPS:LTUS:2: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, "LGPS:LTUS:2:IDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntRawDeltas") field(INPD, "LGPS:LTUS:2:TRIMBTOL") field(INPE, "LGPS:LTUS:2:CHCKBTOL") field(INPF, "LGPS:LTUS:2:BDELTAS.K") field(INPG, "LGPS:LTUS:2:BDELTAS.L") field(INPH, "LGPS:LTUS:2:B2IDES.L") field(EGU, "Volts") field(HOPR, "1") field(PREC, "3") field(BRSV, "INVALID") # # Used to calcualte standardize tolerance # which is returned in the VAL field. # field(INPB, "LGPS:LTUS:2:STDZITOLR") field(INPC, "LGPS:LTUS:2:STDZITOL") field(FLNK, "") } # All ps controllers with on/off control will set the macro ONOF # as follows: # # ONOF = PS:LTUS:2: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, "LGPS:LTUS:2:STATESETPT") { field(DESC, "PS On/Off") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFF") field(ONAM, "ON") field(OUT, "PS:LTUS:2:STATESETPT PP") 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:LTUS:2:RESET PP # record(bo, "LGPS:LTUS:2:RESET") { field(DESC, "Interlock Latch Reset") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFF") field(ONAM, "ON") field(HIGH, "1.0") field(OUT, "PS:LTUS:2:RESET PP") } record(bo, "LGPS:LTUS:2:RAMPSTATE") { field(DESC, "PS Ramp Status") field(DTYP, "Soft Channel") field(DOL, "PS:LTUS:2:RAMPSTATE") 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, "LGPS:LTUS:2: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, "Volts/sec") field(PREC, "3") # Set default to trim ramp rate on boot # but need to change for degauss function. field(DOL, "LGPS:LTUS:2:TRIMRAMPRATE") field(OUT, "") field(FLNK, "LGPS:LTUS:2:STDZDLY") } record(ao, "LGPS:LTUS:2:ISETPT") { field(DESC, "Current Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(DRVH, "50.0") field(DRVL, "0.0") field(MDEL, "-1") field(OUT, "PS:LTUS:2:ISETPT PP") field(DOL, "LGPS:LTUS:2: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, "LGPS:LTUS:2:IMON") { field(DESC, "Aux Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(INP, "") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "LGPS:LTUS:2:BMON") } record(ao, "LGPS:LTUS:2:IRIPL") { field(DESC, "Ripple Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(DOL, "") field(OMSL, "closed_loop") field(EGU, "Volts") field(DRVH, "1.0") field(HOPR, "1.0") field(PREC, "3") field(FLNK, "LGPS:LTUS:2:IRIPLOK") } record(sub, "LGPS:LTUS:2:IRIPLOK") { field(DESC, "Ripple Current Status") field(INAM, "mgntInit") field(SNAM, "mgntRiplOK") field(INPA, "LGPS:LTUS:2:IRIPL.VAL") field(INPB, "LGPS:LTUS:2: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, "LGPS:LTUS:2:R") { field(DESC, "Resistance") field(EGU, "Ohms") field(PREC, "4") field(PINI, "YES") field(DOL, "") 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, "LGPS:LTUS:2:IGND") { field(DESC, "Ground Current") field(EGU, "Volts") field(PREC, "6") field(PINI, "YES") field(DOL, "") field(OMSL, "closed_loop") } record(bi, "LGPS:LTUS:2:INTLKSUMY") { field(DESC, "Interlock Summary") field(INP, "PS:LTUS:2:INTLKSUMY CP MS") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(ZNAM, "OK") field(ONAM, "FAULT") field(PINI, "NO") } record(mbbo, "LGPS:LTUS:2: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:LTUS:2:COOLING") field(OMSL, "closed_loop") } # The following PV is processed by :BACTFO # which is processed by :BACT record(fanout, "LGPS:LTUS:2:IACTFO") { field(DESC, "IACT processing") field(SELM, "All") field(LNK1, "LGPS:LTUS:2:IACTPREVOK") field(LNK2, "LGPS:LTUS:2:IDIFF") field(LNK3, "LGPS:LTUS:2:IADIFF") field(LNK4, "LGPS:LTUS:2:IRATIO") field(LNK5, "LGPS:LTUS:2:IDIRECT") field(LNK6, "LGPS:LTUS:2:IACTPOL_CHECK") } record(calc, "LGPS:LTUS:2:IDIFF") { field(DESC, "IDES-IACT") field(CALC, "A-B") field(INPA, "LGPS:LTUS:2:IDES") field(INPB, "LGPS:LTUS:2:IACT") field(EGU, "Volts") field(PREC, "9") field(HOPR, "50.0") field(LOPR, "0.0") } record(calc, "LGPS:LTUS:2:IADIFF") { field(DESC, "Absolute IDES-IACT") field(CALC, "A<0?ABS(A):A") field(INPA, "LGPS:LTUS:2:IDIFF") field(PREC, "9") } record(calc, "LGPS:LTUS:2:IRATIO") { field(DESC, "IDES-IACT/IMAX") field(CALC, "B?A/B:0") field(INPA, "LGPS:LTUS:2:IDIFF") field(INPB, "LGPS:LTUS:2:IDES.DRVH") field(PREC, "9") } record(calcout, "LGPS:LTUS:2:IRANGE") { field(DESC, "Current Range") field(PINI, "YES") field(CALC, "ABS(A-B)") field(INPA, "LGPS:LTUS:2:IMIN") field(INPB, "LGPS:LTUS:2: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, "LGPS:LTUS:2: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, "LGPS:LTUS:2:IACT") field(FLNK, "LGPS:LTUS:2:IACTPOL") } record(bo, "LGPS:LTUS:2:IACTPOL") { field(DESC, "Actual I Polarity") field(DTYP, "Raw Soft Channel") field(DOL, "LGPS:LTUS:2: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,"LGPS:LTUS:2:I*LIMITS:\n Calculate alarm and warning limits based on \n deltas from LGPS:LTUS:2:IDELTAS and the\n LGPS:LTUS:2: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,"LGPS:LTUS:2:IACT: \n Get copy of LGPS:LTUS:2:I. \n",null) #! TextBox(TB12,1280,3100,1760,3200,0,"Dialog",12,1,16777215,"LGPS:LTUS:2: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,"LGPS:LTUS:2:IDES:\n Contains raw value calculated by \nLGPS:LTUS:2: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 \nLGPS:LTUS:2:BDELTAS.\n",null) #! TextBox(TB10,56,1940,316,2340,0,"Dialog",12,1,16777215,"LGPS:LTUS:2: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 LGPS:LTUS:2: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 LGPS:LTUS:2: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,"LGPS:LTUS:2:ISETPT:\n Sets the hardware. When fast feedback is set on, this record is\n set to closed loop mode by LGPS:LTUS:2:FBCKSTART sequence. When \n the loop is closed, this record takes input calculated by \n BFBCK only. When fast feedback is set off, LGPS:LTUS:2:FBCKSTOP \n will set it back to supervisory so that the value can be set by \n LGPS:LTUS:2: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, "LGPS:LTUS:2:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "LGPS:LTUS:2:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "LGPS:LTUS:2:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "LGPS:LTUS:2:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "LGPS:LTUS:2:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "LGPS:LTUS:2:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "1") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "LGPS:LTUS:2: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, "LGPS:LTUS:2:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "LGPS:LTUS:2:TRIMTYPE.RVAL") field(INPB, "LGPS:LTUS:2:CONFIG.RVAL") field(OUT, "LGPS:LTUS:2:TRIMMAXNUM PP") } record(longout, "LGPS:LTUS:2: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, "LGPS:LTUS:2:TRIMRAMPRATE") { field(DESC, "Trim Ramp rate ") field(PINI, "YES") field(ASG, "IOC_MAINT") field(PREC, "3") field(EGU, "Volts/sec") field(HOPR, "20.0") field(DRVH, "20.0") field(DRVL, "0.1") field(LOPR, "0.5") # field(DOL, "") field(OMSL, "supervisory") field(VAL, "10") field(OUT, "LGPS:LTUS:2:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "LGPS:LTUS:2: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, "") field(OMSL, "supervisory") field(VAL, "10") } record(bo, "LGPS:LTUS:2: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, "LGPS:LTUS:2: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, "LGPS:LTUS:2:TRIMSTEPMIN") { field(DESC, "Min step in current") field(DTYP, "Soft Channel") # field(DOL, "") field(PREC, "7") field(EGUF, "10") field(EGUL, "0") field(EGU, "Volts") field(HOPR, "10") field(LOPR, "0") field(VAL, "5.0") } record(bo, "LGPS:LTUS:2:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "0") } record(ao, "LGPS:LTUS:2: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, "LGPS:LTUS:2:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "LGPS:LTUS:2: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, "LGPS:LTUS:2: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, "LGPS:LTUS:2:IMOVE") field(INPB, "LGPS:LTUS:2:IACT") field(INPC, "LGPS:LTUS:2:IRAMPRATE") field(INPD, "1.577") field(INPE, "LGPS:LTUS:2:TRIMDLYPCT") field(INPF, "LGPS:LTUS:2:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "LGPS:LTUS:2:RAMPTIME_LEFT PP") } record(longout, "LGPS:LTUS:2:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "LGPS:LTUS:2:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "LGPS:LTUS:2:RAMPDONE_CALC") } record(calc, "LGPS:LTUS:2:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "LGPS:LTUS:2:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "LGPS:LTUS:2:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "LGPS:LTUS:2: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, "LGPS:LTUS:2:RAMPTIME_LEFT") field(OUT, "LGPS:LTUS:2:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "LGPS:LTUS:2:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "LGPS:LTUS:2:RAMPTIME_LEFT NMS") field(OUT, "LGPS:LTUS:2:RAMPDONE PP") } record(bo, "LGPS:LTUS:2:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "LGPS:LTUS:2:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "LGPS:LTUS:2: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, "LGPS:LTUS:2: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, "LGPS:LTUS:2:STDZINIT") { field(DESC, "Proc. Stdz PVs on boot") field(PINI, "YES") field(DOL1, "1") field(DOL2, "1") field(DOL3, "1") field(LNK1, "LGPS:LTUS:2:DEBUG.PROC PP") field(LNK2, "LGPS:LTUS:2:STDZCYCLENUM.PROC PP") field(LNK3, "LGPS:LTUS:2:STDZDISABLE.PROC PP") field(LNK4, "LGPS:LTUS:2: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, "LGPS:LTUS:2:STDZSUB") { field(DESC, "Stdz subroutine") field(INAM, "mgntStdzInit") field(SNAM, "mgntStdz") field(BRSV, "INVALID") field(INPA, "LGPS:LTUS:2:STDZIMIN NPP NMS") field(INPB, "LGPS:LTUS:2:STDZIMAX NPP NMS") field(INPC, "LGPS:LTUS:2:STDZIFINAL NPP NMS") field(INPD, "LGPS:LTUS:2:STDZCYCLENUM NPP NMS") field(INPE, "LGPS:LTUS:2:STDZDIRECT.RVAL NPP NMS") field(INPF, "LGPS:LTUS:2:STDZDISABLE.RVAL CPP NMS") field(INPG, "LGPS:LTUS:2: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, "LGPS:LTUS:2:STDZWF PP") field(OUTB, "LGPS:LTUS:2: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, "LGPS:LTUS:2:STDZWF") } record(mbbo, "LGPS:LTUS:2: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, "LGPS:LTUS:2: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, "LGPS:LTUS:2:STDZMAINPS") { field(DESC, "Stdz by main or self") field(PINI, "YES") field(DTYP, "Soft Channel") field(ZNAM, "SELF") field(ONAM, "MAIN") } record(bo, "LGPS:LTUS:2: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, "LGPS:LTUS:2: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, "LGPS:LTUS:2: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, "LGPS:LTUS:2:STDZTOD") { field(DESC, "Successful Standardize Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "LGPS:LTUS:2:STDZLOSTTOD") { field(DESC, "Standardize Lost Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(longout, "LGPS:LTUS:2:STDZCYCLECNT") { field(DESC, "Cycle Count") field(PINI, "YES") } record(longout, "LGPS:LTUS:2:STDZCYCLENUM") { field(DESC, "No. Standardize Cycles") field(VAL, "3") field(HOPR, "10") field(LOPR, "0") field(DRVH, "10") field(DRVL, "0") field(PINI, "YES") field(FLNK, "LGPS:LTUS:2:STDZDIRECT") } # The default standardize direction is "UP" for # all LCLS Magnets.. record(bo, "LGPS:LTUS:2:STDZDIRECT") { field(DESC, "Standardize Direction ") field(ZNAM, "UP") field(ONAM, "DOWN") field(VAL, "0") field(FLNK, "LGPS:LTUS:2:STDZIMIN") } record(ao, "LGPS:LTUS:2:STDZIMIN") { field(DESC, "Min-STDZ Current") field(PREC, "1") field(EGU, "A") field(HOPR, "50.0") field(LOPR, "0.0") field(VAL, "0.0") field(FLNK, "LGPS:LTUS:2:STDZIMAX") } record(ao, "LGPS:LTUS:2:STDZIMAX") { field(DESC, "Max. Standarize Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "50.0") field(LOPR, "0.0") field(VAL, "50.0") field(FLNK, "LGPS:LTUS:2:STDZIFINAL") } record(ao, "LGPS:LTUS:2:STDZIFINAL") { field(DESC, "Final SDTZ Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "50.0") field(LOPR, "0.0") field(VAL, "0.0") field(FLNK, "LGPS:LTUS:2: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, "LGPS:LTUS:2: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, "LGPS:LTUS:2:STDZITOL") { field(DESC, "Stdz min tolerance") field(PREC, "5") field(CALC, "MAX(ABS(A),ABS(B))*C") field(INPA, "LGPS:LTUS:2:STDZIMIN CP NMS") field(INPB, "LGPS:LTUS:2:STDZIMAX CP MMS") field(INPC, "0.05") field(INPD, "LGPS:LTUS:2:STDZITOLR CP MMS") field(EGU, "A") field(FLNK, "LGPS:LTUS:2:IDELTAS") field(PINI, "YES") } # D - factor (3.154/2 = 1.577) for EPSC, otherwise, set to 1.0 record(calc, "LGPS:LTUS:2:STDZDLY") { field(DESC, "Ramp time for stdz cycle") field(CALC, "C>0?MAX(1,ABS((A-B)/C)*D):0") field(INPA, "LGPS:LTUS:2:STDZIMIN CP NMS") field(INPB, "LGPS:LTUS:2:STDZIMAX CP NMS") field(INPC, "LGPS:LTUS:2:TRIMRAMPRATE CP NMS") field(INPD, "1.0") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") } record(calc, "LGPS:LTUS:2:STDZRAMPDLY") { field(DESC, "Ramp delay total") field(CALC, "MAX(1,((A/100)*B+B))") field(PREC, "5") field(INPA, "LGPS:LTUS:2:TRIMDLYPCT CP MS") field(INPB, "LGPS:LTUS:2: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, "LGPS:LTUS:2:STDZMINIDLY") { field(DESC, "Mini-stdz delay") field(CALC, "A") field(PREC, "5") field(A, "1.0") field(EGU, "sec") field(PINI, "YES") } record(ao, "LGPS:LTUS:2: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, "LGPS:LTUS:2:STDZMINIDELTA") { field(DESC, "Stdz mini % of IMAX") field(CALC, "(B/100)*(A-C)") field(INPA, "LGPS:LTUS:2:IDES.HOPR") field(INPB, "LGPS:LTUS:2:STDZMINIPCT CPP NMS") field(INPC, "LGPS:LTUS:2:IDES.LOPR") field(PREC, "5") } record(calc, "LGPS:LTUS:2:STDZMINISETPT") { field(DESC, "Mini Stdz delta") field(CALC, "C==0?MAX(E-D,B):MIN(E+D,A)") field(INPA, "LGPS:LTUS:2:IDES.HOPR") field(INPB, "LGPS:LTUS:2:IDES.LOPR") field(INPC, "LGPS:LTUS:2:STDZDIRECT.RVAL") field(INPD, "LGPS:LTUS:2:STDZMINIDELTA") field(INPE, "LGPS:LTUS:2:IDES") field(PREC, "5") field(FLNK, "LGPS:LTUS:2: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, "LGPS:LTUS:2:STDZMINISETPTOOR") { field(DESC, "Mini Stdz setpoint out of range") field(CALC, "C==0?(E-DA)") field(INPA, "LGPS:LTUS:2:IDES.HOPR") field(INPB, "LGPS:LTUS:2:IDES.LOPR") field(INPC, "LGPS:LTUS:2:STDZDIRECT.RVAL") field(INPD, "LGPS:LTUS:2:STDZMINIDELTA") field(INPE, "LGPS:LTUS:2: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, "LGPS:LTUS:2: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, "LGPS:LTUS:2:IADJUST.RVAL") field(INPB, "LGPS:LTUS:2:STDZDIRECT.RVAL") field(INPC, "LGPS:LTUS:2:STDZOK.RVAL") field(INPD, "LGPS:LTUS:2:STDZDISABLE.RVAL") field(INPE, "LGPS:LTUS:2:STATE.RVAL CPP NMS") field(INPF, "LGPS:LTUS:2:ICTRL.RVAL") field(INPG, "LGPS:LTUS:2:STATE.SEVR") field(INPH, "LGPS:LTUS:2:BDELTAS.M") field(INPI, "LGPS:LTUS:2:IACT.SEVR") field(OUT, "LGPS:LTUS:2:STDZLOSTGO.SELN PP NMS") field(OOPT, "Transition To Non-zero") } record(seq, "LGPS:LTUS:2:STDZLOSTGO") { field(DESC, "Process lost stdz") field(SELM, "Mask") field(DOL1, "1") field(DOL2, "0") field(LNK1, "LGPS:LTUS:2:STDZLOSTTOD.PROC") field(LNK2, "LGPS:LTUS:2:STDZOK PP") } # Record maximum current after standardize # Reset to IACT from sequence after trim # Disable processing during (mini-)standardize or trim record(calc, "LGPS:LTUS:2:STDZIACTMAX") { field(DESC, "Max act current after stdz") field(CALC, "MAX(A, B)") field(DISV, "0") field(SDIS, "LGPS:LTUS:2:CHECKPWRDIP_ENABLE") field(INPA, "LGPS:LTUS:2:IACT CP") field(INPB, "LGPS:LTUS:2:STDZIACTMAX") field(EGU, "A") field(FLNK, "LGPS:LTUS:2:CHECKPWRDIP") } # Detect power dip if STDZOK is YES, STDZ is enabled, and IACT is valid # If IACT drops below STDZIACTMAX by more than the trim tolerance, clear STDZOK # Warning: Take the absolute value of the trim tolerance, or else quads of # negative polarity will always lose STDZ since their IDELTAS.I are negative. # Note: Large quads and bends are prone to losing STDZ even if they are # perturbed toward higher current since their current tends to overshoot # by greater than the trim tolerance before settling down. record(calcout, "LGPS:LTUS:2:CHECKPWRDIP") { field(DESC, "Detect power dip") field(CALC, "(A-B>ABS(C))?3:0") field(DISV, "0") field(SDIS, "LGPS:LTUS:2:CHECKPWRDIP_ENABLE") field(INPA, "LGPS:LTUS:2:STDZIACTMAX") field(INPB, "LGPS:LTUS:2:IACT") field(INPC, "LGPS:LTUS:2:IDELTAS.I") field(OUT, "LGPS:LTUS:2:STDZLOSTGO.SELN PP NMS") field(OOPT, "When Non-zero") } # Enable processing of STDZIACTMAX and CHECKPWRDIP only if # STDZOK = YES, STDZDISABLE = NO, CTRL != Trim (2), and # CTRL != Stdz (4) record(calc, "LGPS:LTUS:2:CHECKPWRDIP_ENABLE") { field(CALC, "A&&!B&&(C#2)&&(C#4)") field(INPA, "LGPS:LTUS:2:STDZOK.RVAL CP") field(INPB, "LGPS:LTUS:2:STDZDISABLE.RVAL CP") field(INPC, "LGPS:LTUS:2:CTRL.RVAL CP") } #! 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, "LGPS:LTUS:2: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, "LGPS:LTUS:2: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, "LGPS:LTUS:2:CALBSET") { field(DESC, "Use DAC Calbration") field(SCAN, "10 second") field(CALC, "A&&(B==0)&&C?31:960") field(INPA, "LGPS:LTUS:2:CALBOK") field(INPB, "LGPS:LTUS:2:CALBDISABLE") field(INPC, "LGPS:LTUS:2:CALBSLOPE") field(OOPT, "On Change") field(OUT, "LGPS:LTUS:2: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, "LGPS:LTUS:2:CALB_SEQ") { field(DESC, "Output Calib Values") field(SELM, "Mask") field(SELL, "LGPS:LTUS:2: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, "LGPS:LTUS:2:CALBSLOPE") field(DOL3, "LGPS:LTUS:2: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, "LGPS:LTUS:2:CALBTOD") { field(DESC, "Calibration Success Time") field(PINI, "YES") # field(DOL, "") field(OMSL, "supervisory") field(DTYP, "Soft Channel") info(autosaveFields,"VAL") } record(ao, "LGPS:LTUS:2: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, "LGPS:LTUS:2: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, "LGPS:LTUS:2: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, "LGPS:LTUS:2:CALBOFFSET") { field(DESC, "Calc DAC Offset") field(PREC, "6") field(EGU, "Counts") field(PINI, "YES") } record(bo, "LGPS:LTUS:2: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, "LGPS:LTUS:2:DACSLOPE") { field(DESC, "V to DAC slope") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "supervisory") field(PINI, "YES") field(FLNK, "LGPS:LTUS:2:DACOFFSET") } # Default Offset used in conversion from Volts to DAC Counts record(ao, "LGPS:LTUS:2:DACOFFSET") { field(DESC, "V to DAC offset") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "supervisory") field(PINI, "YES") field(FLNK, "LGPS:LTUS:2: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, "LGPS:LTUS:2: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, "LGPS:LTUS:2:IACT") field(INPD, "LGPS:LTUS:2:DACSLOPE") field(INPE, "LGPS:LTUS:2:DACOFFSET") field(EGU, "Counts") field(PREC, "6") } record(ao, "LGPS:LTUS:2:DAC") { field(DESC, "DAC Set point") field(EGU, "Counts") field(DOL, "") field(OMSL, "supervisory") field(PREC, "6") field(PINI, "YES") } record(ao, "LGPS:LTUS:2:CALBIMIN") { field(DESC, "Calibration Min Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(DRVH, "50.0") field(HOPR, "50.0") field(DRVL, "0.0") field(LOPR, "0.0") field(PREC, "3") field(EGU, "A") field(VAL, "0.0") field(FLNK, "LGPS:LTUS:2:CALBIMAX") } record(ao, "LGPS:LTUS:2:CALBIMAX") { field(DESC, "Calibration Max Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(DRVH, "50.0") field(HOPR, "50.0") field(LOPR, "0.0") field(DRVL, "0.0") field(EGU, "A") field(VAL, "50.0") field(FLNK, "LGPS:LTUS:2:CALBSTEPNUM") } record(ao, "LGPS:LTUS:2:CALBIFINAL") { field(DESC, "Calibration Last Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(PREC, "3") field(EGU, "A") field(HOPR, "50.0") field(LOPR, "0.0") field(VAL, "0") } record(longout, "LGPS:LTUS:2: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, "LGPS:LTUS:2:CALBIDELTA") } record(calc, "LGPS:LTUS:2:CALBIDELTA") { field(DESC, "Step size for CALB") field(CALC, "C=0?0:ABS((A-B)/C)") field(INPA, "LGPS:LTUS:2:CALBIMAX") field(INPB, "LGPS:LTUS:2:CALBIMIN") field(INPC, "LGPS:LTUS:2: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, "LGPS:LTUS:2:CALBIMULT") { field(DESC, "IACT vs ISETPT mult") field(CALC, "C#0||A=0?1:ABS(B/A)") field(INPA, "PS:LTUS:2:ISETPT.DRVH") field(INPB, "PS:LTUS:2:IACT.HOPR") field(INPC, "LGPS:LTUS:2:PSCONTROLLER.RVAL CPP") field(EGU, "A") field(PINI, "YES") } # SNL dbputs DAC values here. 6-10 steps are possible. record(waveform, "LGPS:LTUS:2:CALBICTRLWF") { field(DESC, "ICTRL setpoint array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") } record(waveform, "LGPS:LTUS:2:DACWF") { field(DESC, "DAC count array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "LGPS:LTUS:2:DACSA") } # Used only for xygraph edm plot record(subArray, "LGPS:LTUS:2:DACSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "LGPS:LTUS:2: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, "LGPS:LTUS:2:CALCDACWF") { field(DESC, "Calc DAC counts array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "LGPS:LTUS:2:CALCDACSA") } # Used only for xygraph edm plot record(subArray, "LGPS:LTUS:2:CALCDACSA") { field(DESC, "Calc DAC counts") field(DTYP, "Soft Channel") field(INP, "LGPS:LTUS:2: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, "LGPS:LTUS:2:CALBYWF") { field(DESC, "mx + b") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "LGPS:LTUS:2:CALBYSA") } # Used only for xygraph edm plot record(subArray, "LGPS:LTUS:2:CALBYSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "LGPS:LTUS:2:CALBYWF") field(MALM, "10") field(NELM, "6") field(INDX, "0") field(FTVL, "DOUBLE") } record(waveform, "LGPS:LTUS:2:CALBIACTWF") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "LGPS:LTUS:2:CALBIACTSA") } # Used only for xygraph edm plot record(subArray, "LGPS:LTUS:2:CALBIACTSA") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(MALM, "10") field(NELM, "6") field(INP, "LGPS:LTUS:2:CALBIACTWF") field(INDX, "0") field(FTVL, "DOUBLE") field(FLNK, "LGPS:LTUS:2:CALBLIMITS") } # Check that measured current during calibration is within # tolerance. record(aSub, "LGPS:LTUS:2: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, "LGPS:LTUS:2:CALBSTEPNUM") field(INPB, "LGPS:LTUS:2:CALBIACTWF") field(INPC, "LGPS:LTUS:2: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, "LGPS:LTUS:2: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, "LGPS:LTUS:2:STDZITOL") field(INPH, "LGPS:LTUS:2:DACSLOPE") field(INPI, "LGPS:LTUS:2: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, "LGPS:LTUS:2: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, "LGPS:LTUS:2:CALBSTEPNUM") field(INPB, "LGPS:LTUS:2:CALBIACTWF") field(INPC, "LGPS:LTUS:2:DACWF") field(INPF, "LGPS:LTUS:2: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 LGPS:LTUS:2CALBOK 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, "LGPS:LTUS:2:DEGAUSINIT") { field(DESC, "Proc. Degauss PVs on boot") field(PINI, "YES") field(DOL, "1") field(OUTA, "LGPS:LTUS:2:DEGAUSIMIN.PROC PP") field(OUTB, "LGPS:LTUS:2:DEGAUSIMAX.PROC PP") field(OUTC, "LGPS:LTUS:2:DEGAUSTYPE.PROC PP") field(OUTD, "LGPS:LTUS:2:DEGAUSSTEP.PROC PP") field(OUTE, "LGPS:LTUS:2:MADNAME.PROC PP") field(OUTF, "LGPS:LTUS:2:PSTYPE.PROC PP") field(OUTG, "LGPS:LTUS:2: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, "LGPS:LTUS:2:DEGAUSSUB") { field(DESC, "Degauss subroutine") field(INAM, "mgntDegaussInit") field(SNAM, "mgntDegauss") field(BRSV, "INVALID") field(INPA, "LGPS:LTUS:2:DEGAUSIMIN NPP NMS") field(INPB, "LGPS:LTUS:2:DEGAUSIMAX NPP NMS") field(INPC, "LGPS:LTUS:2:DEGAUSTYPE.RVAL NPP NMS") field(INPE, "LGPS:LTUS:2:DEGAUSMETHOD.RVAL NPP NMS") field(INPF, "LGPS:LTUS:2:PSTYPE NPP NMS") field(INPG, "LGPS:LTUS:2:DEBUG.RVAL NPP NMS") field(INPH, "LGPS:LTUS:2: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, "LGPS:LTUS:2:DEGAUSWF PP") field(OUTB, "LGPS:LTUS:2:DEGAUSMSG PP") field(OUTC, "LGPS:LTUS:2: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, "LGPS:LTUS:2:DEGAUSWF") { field(DESC, "Degauss Setpts") field(NELM, "60") field(FTVL, "DOUBLE") } record(mbbo,"LGPS:LTUS:2: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, "LGPS:LTUS:2: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, "LGPS:LTUS:2: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, "LGPS:LTUS:2: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, "LGPS:LTUS:2: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, "LGPS:LTUS:2:DEGAUSIMIN") { field(DESC, "Min. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "50.0") field(LOPR, "-50.0") field(DRVH, "50.0") field(DRVL, "-50.0") field(VAL, "-50.0") } record(ao, "LGPS:LTUS:2:DEGAUSIMAX") { field(DESC, "Max. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "50.0") field(LOPR, "-50.0") field(DRVH, "50.0") field(DRVL, "-50.0") field(VAL, "50.0") } # 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,"LGPS:LTUS:2: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, "LGPS:LTUS:2: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,"LGPS:LTUS:2: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, "LGPS:LTUS:2: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, "LGPS:LTUS:2: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, "LGPS:LTUS:2: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, "LGPS:LTUS:2:DEGAUSTOD") { field(DESC, "Successful Degauss Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "LGPS:LTUS:2:DEGAUSLOSTTOD") { field(DESC, "Degauss Lost Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "LGPS:LTUS:2:DEGAUSTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "LGPS:LTUS:2:DEGAUSTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "LGPS:LTUS:2: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, "LGPS:LTUS:2:DEGAUSGO") { field(DESC, "Set bdes of btrms to zero") field(ASG, "Internal") field(OUTA, "") field(OUTB, "") field(OUTC, "") field(OUTD, "") } # =========== CRYO ONLY =========== record(bo, "LGPS:LTUS:2: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, "LGPS:LTUS:2:DEGAUS_IMAX_CHECK") { field(DESC, "Check if imax shoud chg") field(CALC, "(C==4)&&(ABS(B)>ABS(A))?1:0") field(INPA, "LGPS:LTUS:2:DEGAUS_IMAX") field(INPB, "LGPS:LTUS:2:ISETPT") field(INPC, "LGPS:LTUS:2:DEGAUSTYPE.RVAL") field(OUT, "LGPS:LTUS:2:DEGAUS_IMAX_UPDATE.SELN") field(FLNK, "LGPS:LTUS:2:DEGAUS_IMAX_UPDATE") } record(seq, "LGPS:LTUS:2:DEGAUS_IMAX_UPDATE") { field(DESC, "Degauss IMAX Update") field(SELM, "Specified") field(DOL1, "LGPS:LTUS:2:ISETPT") field(LNK1, "LGPS:LTUS:2:DEGAUS_IMAX PP") } # Set the maximum current after a successful # degauss. This pv is updated by the # sequence. record(ao, "LGPS:LTUS:2:DEGAUS_IMAX") { field(DESC, "Max I set afer a degauss") field(EGU, "Amps") field(PINI, "YES") field(PREC, "6") field(HOPR, "50.0") field(LOPR, "-50.0") field(DRVH, "50.0") field(DRVL, "-50.0") field(VAL, "50.0") field(FLNK, "LGPS:LTUS:2:DEGAUS_IMAXPOL_CHECK") info(autosaveFields,"VAL,RVAL") } # Set the polarity if degauss_imax record(calcout, "LGPS:LTUS:2:DEGAUS_IMAXPOL_CHECK") { field(DESC, "Determine polarity of imax") field(CALC, "A>=0?0:1") field(INPA, "LGPS:LTUS:2:DEGAUS_IMAX") field(FLNK, "LGPS:LTUS:2:DEGAUS_IMAXPOL") } record(bo, "LGPS:LTUS:2:DEGAUS_IMAXPOL") { field(DESC, "Polarity of imax I") field(DTYP, "Raw Soft Channel") field(DOL, "LGPS:LTUS:2:DEGAUS_IMAXPOL_CHECK") field(OMSL, "closed_loop") field(ZNAM, "Positive") field(ONAM, "Negative") field(FLNK, "LGPS:LTUS:2: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, "LGPS:LTUS:2:DEGAUS_ABSIMAX") { field(DESC, "Absolute Max. Degauss I") field(CALC, "ABS(A)") field(INPA, "LGPS:LTUS:2:DEGAUS_IMAX") field(PREC, "6") field(EGU, "Amps") field(HOPR, "50.0") field(LOPR, "-50.0") info(autosaveFields,"VAL RVAL") } # IACT Polarity record(calcout, "LGPS:LTUS:2:IACTPOL_CHECK") { field(DESC, "Determine IACT polarity") field(SCAN, "5 second") field(CALC, "ABS(A-B)>C?(A>=0?0:1):D") field(INPA, "LGPS:LTUS:2:IACT") field(INPB, "LGPS:LTUS:2:IACTPOL_CHECK.LA") field(INPC, "0.0001") field(INPD, "LGPS:LTUS:2:IACTPOL_CHECK.PVAL") field(OOPT, "On Change") field(FLNK, "LGPS:LTUS:2:IACTPOL") } record(bo, "LGPS:LTUS:2: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,"LGPS:LTUS:2: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, "LGPS:LTUS:2:DEGAUSENABLE CP") field(INPB, "LGPS:LTUS:2:DEGAUSOK") field(INPC, "LGPS:LTUS:2:STATE CP") field(INPD, "LGPS:LTUS:2:STATE.SEVR") field(OUT, "LGPS:LTUS:2:DEGAUS_STATE_SEQ.SELN PP") field(ASG, "Internal") } record(seq, "LGPS:LTUS:2:DEGAUS_STATE_SEQ") { field(DESC, "Degauss State Sequence") field(SELM, "Specified") field(SELL, "LGPS:LTUS:2:DEGAUS_STATE_CHECK") field(LNK1, "LGPS:LTUS:2:DEGAUS_STATE_DISABLE.PROC PP") field(LNK2, "LGPS:LTUS:2:DEGAUS_STATE_LOST.PROC PP") field(LNK3, "LGPS:LTUS:2:DEGAUS_STATE_GOOD.PROC PP") field(LNK4, "LGPS:LTUS:2: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, "LGPS:LTUS:2:DEGAUS_STATE_DISABLE") { field(DESC, "Degauss not used") field(LNK1, "LGPS:LTUS:2:DEGAUSOK.ZSV") field(LNK2, "LGPS:LTUS:2: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, "LGPS:LTUS:2:STATMSG.FRSV") field(LNK4, "LGPS:LTUS:2: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, "LGPS:LTUS:2:DEGAUS_STATE_LOST") { field(DESC, "Degauss lost and ps On") field(DOL1, "1") field(LNK1, "LGPS:LTUS:2:DEGAUSOK.ZSV") field(LNK2, "LGPS:LTUS:2: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, "LGPS:LTUS:2:STATMSG.FRSV") field(LNK4, "LGPS:LTUS:2: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, "LGPS:LTUS:2:DEGAUS_STATE_OFF") { field(DESC, "Degaused lost and ps Off") field(DOL1, "2") field(LNK1, "LGPS:LTUS:2: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, "LGPS:LTUS:2:STATMSG.FRSV") field(LNK3, "LGPS:LTUS:2: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, "LGPS:LTUS:2:DEGAUS_STATE_GOOD") { field(DESC, "Degauss good") field(DOL1, "1") field(LNK1, "LGPS:LTUS:2: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, "LGPS:LTUS:2:STATMSG.FRSV PP") field(LNK3, "LGPS:LTUS:2:STATMSG.FVSV PP") field(LNK4, "") field(ASG, "Internal") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(mbbo, "LGPS:LTUS:2:FUNC") { field(DESC, "LGPS:LTUS:2 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, "1") field(NIVL, "2") field(TEVL, "3") field(ELVL, "0") field(TVVL, "0") field(TTVL, "0") field(FTVL, "0") field(FFVL, "0") field(OUT, "LGPS:LTUS:2:CTRL CA") } # :CTRL pv is processed at boot in the # sequence mgntCtrl.st Processed in sequence # record(mbbo, "LGPS:LTUS:2:CTRL") { field(DESC, "LGPS:LTUS:2 Control") field(PINI, "NO") field(ZRST, "Ready") field(ONST, "RESET") field(TWST, "TURN_ON") field(THST, "TURN_OFF") 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, "8") field(TWVL, "9") field(THVL, "10") 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, "LGPS:LTUS:2:SELECTEN.A PP") field(SDIS, "0") } # If a function has been selected set this unit to busy record(calcout, "LGPS:LTUS:2:SELECTEN") { field(DESC, "Control Select Enable") field(CALC, "A>0?1:A") field(FLNK, "LGPS:LTUS:2:BUSY") } # Set to FREE on IOC reboot record(bo, "LGPS:LTUS:2:BUSY") { field(DESC, "LGPS:LTUS:2 Ctrl Done") field(DOL, "LGPS:LTUS:2:SELECTEN") field(ZNAM, "FREE") field(ONAM, "BUSY") field(PINI, "YES") field(FLNK, "LGPS:LTUS:2:SELECT") } record(bo, "LGPS:LTUS:2:SELECT") { field(ZNAM, "NO") field(ONAM, "YES") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") } record(bo, "LGPS:LTUS:2: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, "LGPS:LTUS:2:CTRLSTATE") { field(DESC, "LGPS:LTUS:2 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("LGPS:LTUS:2:CTRL",20,20,0,0,"LGPS:LTUS:2:CTRL") #! Field("LGPS:LTUS:2:CTRL.OUT",16777215,1,"LGPS:LTUS:2:CTRL.OUT") #! Link("LGPS:LTUS:2:CTRL.OUT","LGPS:LTUS:2:SELECTEN.A") #! Field("LGPS:LTUS:2:CTRL.VAL",16777215,1,"LGPS:LTUS:2:CTRL.VAL") #! Record("LGPS:LTUS:2:SELECTEN",321,381,0,0,"LGPS:LTUS:2:SELECTEN") #! Field("LGPS:LTUS:2:SELECTEN.A",16777215,0,"LGPS:LTUS:2:SELECTEN.A") #! Field("LGPS:LTUS:2:SELECTEN.FLNK",16777215,1,"LGPS:LTUS:2:SELECTEN.FLNK") #! Link("LGPS:LTUS:2:SELECTEN.FLNK","LGPS:LTUS:2:BUSY") #! Field("LGPS:LTUS:2:SELECTEN.VAL",16777215,1,"LGPS:LTUS:2:SELECTEN.VAL") #! Record("LGPS:LTUS:2:BUSY",623,274,0,0,"LGPS:LTUS:2:BUSY") #! Field("LGPS:LTUS:2:BUSY.DOL",16777215,0,"LGPS:LTUS:2:BUSY.DOL") #! Link("LGPS:LTUS:2:BUSY.DOL","LGPS:LTUS:2:SELECTEN.VAL") #! Field("LGPS:LTUS:2:BUSY.FLNK",16777215,1,"LGPS:LTUS:2:BUSY.FLNK") #! Link("LGPS:LTUS:2:BUSY.FLNK","LGPS:LTUS:2:SELECT") #! Record("LGPS:LTUS:2:SELECT",669,508,0,1,"LGPS:LTUS:2:SELECT") #! Record("LGPS:LTUS:2:FUNC",940,120,0,0,"LGPS:LTUS:2:FUNC") #! Field("LGPS:LTUS:2:FUNC.OUT",16777215,0,"LGPS:LTUS:2:FUNC.OUT") #! Link("LGPS:LTUS:2:FUNC.OUT","LGPS:LTUS:2:CTRL.VAL") #! Record("LGPS:LTUS:2:ABORT",193,41,0,0,"LGPS:LTUS:2:ABORT") #! Record("LGPS:LTUS:2:CTRLSTATE",369,34,0,0,"LGPS:LTUS:2: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,"LGPS:LTUS:2:SELECT is used for Multi-device selection.\nIt is enabled when associated LGPS:LTUS:2:CTRL is \"0\" (DONE).\nIt is disabled when associated LGPS:LTUS:2: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,"LGPS:LTUS:2: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, "LGPS:LTUS:2:BCTRL_INIT") { field(DESC, "Process BCTRL on boot") field(PINI, "YES") field(CALC, "A=3?1:0") field(INPA, "LGPS:LTUS:2:BCTRL.SEVR") field(OUT, "LGPS:LTUS:2: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, "LGPS:LTUS:2:BACT") { field(DESC, "Actual B") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "LGPS:LTUS:2:BACT") field(INPB, "LGPS:LTUS:2:POLYCOEF") field(INPC, "LGPS:LTUS:2:POLYCOEF.A") field(INPD, "LGPS:LTUS:2:POLYCOEF.B") field(INPE, "LGPS:LTUS:2:IACT MS") field(INPF, "LGPS:LTUS:2:BDELTAS PP") field(INPG, "100") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(HIHI, "50.0") field(LOLO, "0.0") field(PREC, "3") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "50.0") field(LOW, "0.0") field(FLNK, "LGPS:LTUS:2: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, "LGPS:LTUS:2:BDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntPhyDeltas") field(EGU, "Volts") field(HOPR, "1") field(PREC, "3") field(BRSV, "INVALID") field(INPA, "LGPS:LTUS:2:BDES") field(INPB, "LGPS:LTUS:2:TRIMBTOL") field(INPC, "LGPS:LTUS:2:TRIMBTOLR") field(INPD, "LGPS:LTUS:2:CHCKBTOL") field(INPE, "LGPS:LTUS:2:CHCKBTOLR") field(F, "0.0") field(INPG, "30") field(INPH, "LGPS:LTUS:2:BACT.VAL") # # MPS absolute and relative tolerances field(INPP, "LGPS:LTUS:2:MPSBTOL") field(INPQ, "LGPS:LTUS:2:MPSBTOLR") field(FLNK, "LGPS:LTUS:2:BCONLIMITS") info(autosaveFields,"F") } # This record is processed by BDELTAS record(aSub, "LGPS:LTUS:2:BCONLIMITS") { field(DESC, "Config B-field Limits") field(INAM, "mgntInit") field(SNAM, "mgntBCONLimits") field(INPA, "LGPS:LTUS:2:BDES") field(INPB, "LGPS:LTUS:2:BDELTAS.I") field(INPG, "LGPS:LTUS:2:DEBUG.RVAL") field(FTA, "DOUBLE") field(FTB, "DOUBLE") field(FTG, "ULONG") field(OUTA, "LGPS:LTUS:2:BCON.HIGH") field(OUTB, "LGPS:LTUS:2:BCON.LOW") field(OUTC, "LGPS:LTUS:2:BCON.HIHI") field(OUTD, "LGPS:LTUS:2:BCON.LOLO PP") field(FTVA, "DOUBLE") field(FTVB, "DOUBLE") field(FTVC, "DOUBLE") field(FTVD, "DOUBLE") field(BRSV, "INVALID") field(FLNK, "LGPS:LTUS:2:IDELTAS") } # The following PV is processed by :BACT # which is processed by :BACT # record(fanout, "LGPS:LTUS:2:BACTFO") { field(DESC, "BACT processing") field(SELM, "All") field(LNK1, "LGPS:LTUS:2:BDIFF") field(LNK2, "LGPS:LTUS:2:BADIFF") field(LNK3, "LGPS:LTUS:2:BRATIO") field(LNK4, "LGPS:LTUS:2:MPSLIMITS") field(LNK5, "LGPS:LTUS:2:I2BSTATUS") field(LNK6, "LGPS:LTUS:2:IACTFO.PROC") } record(calc, "LGPS:LTUS:2:BDIFF") { field(DESC, "BDES-BACT") field(CALC, "A-B") field(INPA, "LGPS:LTUS:2:BDES") field(INPB, "LGPS:LTUS:2:BACT") field(EGU, "Volts") field(PREC, "7") } record(calc, "LGPS:LTUS:2:BADIFF") { field(DESC, "Absolute BDES-BACT") field(INPA, "LGPS:LTUS:2:BDIFF") field(EGU, "Volts") field(PREC, "7") field(CALC, "A<0?ABS(A):A") } record(calc, "LGPS:LTUS:2:BRATIO") { field(DESC, "BACT Error") field(CALC, "B?A/B:0") field(INPA, "LGPS:LTUS:2:BDIFF") field(INPB, "LGPS:LTUS:2:BDES.HOPR") field(EGU, "Volts") field(PREC, "7") } record(mbbi, "LGPS:LTUS:2: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, "LGPS:LTUS:2:BACT.J") } # Note: for a string slave set the MONFL # macro to the following: # MONFL=:IMONCALC MS record(sub, "LGPS:LTUS:2:BMON") { field(DESC, "Second Transductor") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "LGPS:LTUS:2:BMON") field(INPB, "LGPS:LTUS:2:POLYCOEF") field(INPC, "LGPS:LTUS:2:POLYCOEF.A") field(INPD, "LGPS:LTUS:2:POLYCOEF.B") field(INPE, "LGPS:LTUS:2:IMON MS") field(INPF, "LGPS:LTUS:2:BDELTAS.VAL") field(INPG, "100") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(HIHI, "50.0") field(LOLO, "0.0") field(PREC, "3") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "50.0") field(LOW, "0.0") } # 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:LTUS:2:BDES CP record(ao, "LGPS:LTUS:2:BDES") { field(DESC, "Desired B-Field") field(PINI, "YES") field(DRVH, "50.0") field(DRVL, "0.0") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(EGU, "Volts") field(MDEL, "-1") field(OMSL, "closed_loop") field(DOL, "LGPS:LTUS:2:BDES.DRVH") field(OUT, "LGPS:LTUS:2:B2IDES PP") info(autosaveFields,"VAL") } record(sub, "LGPS:LTUS:2:B2IDES") { field(DESC, "Convert Desired B-Field to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "LGPS:LTUS:2:POLYCOEF") field(INPC, "LGPS:LTUS:2:POLYCOEF.A") field(INPD, "LGPS:LTUS:2:POLYCOEF.B") field(PREC, "3") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(MDEL, "-1") field(INPE, "LGPS:LTUS:2:BDES.DRVH") field(INPF, "LGPS:LTUS:2:BDES.DRVL") field(BRSV, "INVALID") field(FLNK, "LGPS:LTUS:2:IDES") } record(sub, "LGPS:LTUS:2:BNOM") { field(DESC, "Nominal Field") field(PINI, "YES") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "LGPS:LTUS:2:POLYCOEF") field(INPC, "LGPS:LTUS:2:POLYCOEF.A") field(INPD, "LGPS:LTUS:2:POLYCOEF.B") field(INPE, "LGPS:LTUS:2:BDES.DRVH") field(INPF, "LGPS:LTUS:2:BDES.DRVL") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(VAL, "0.0") field(FLNK, "LGPS:LTUS:2:INOM") } record(sub, "LGPS:LTUS:2:BACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "LGPS:LTUS:2:BDES.VAL") field(INPB, "LGPS:LTUS:2:BDES.DRVH") field(INPC, "LGPS:LTUS:2:BDES.DRVL") field(INPD, "LGPS:LTUS:2:BDELTAS.I") field(INPE, "LGPS:LTUS:2:BDELTAS.J") field(INPG, "LGPS:LTUS:2:STATE") field(INPH, "LGPS:LTUS:2:HSTA") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(sub, "LGPS:LTUS:2:BMONLIMITS") { field(DESC, "MON Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "LGPS:LTUS:2:BDES.VAL") field(INPB, "LGPS:LTUS:2:BDES.DRVH") field(INPC, "LGPS:LTUS:2:BDES.DRVL") field(INPD, "LGPS:LTUS:2:BDELTAS.K") field(INPE, "LGPS:LTUS:2:BDELTAS.L") field(INPG, "LGPS:LTUS:2:STATE") field(INPH, "LGPS:LTUS:2:HSTA") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(seq, "LGPS:LTUS:2:BLIMITS") { field(DESC, "ACT Limits") field(PREC, "3") field(DOL1, "LGPS:LTUS:2:BLIMITS") field(LNK1, "LGPS:LTUS:2:BACTLIMITS.F PP") field(DOL2, "LGPS:LTUS:2:BACTLIMITS.I") field(LNK2, "LGPS:LTUS:2:BACT.HIGH") field(DOL3, "LGPS:LTUS:2:BACTLIMITS.J") field(LNK3, "LGPS:LTUS:2:BACT.LOW") field(DOL4, "LGPS:LTUS:2:BACTLIMITS.K") field(LNK4, "LGPS:LTUS:2:BACT.HIHI") field(DOL5, "LGPS:LTUS:2:BACTLIMITS.L") field(LNK5, "LGPS:LTUS:2:BACT.LOLO") field(DOL6, "LGPS:LTUS:2:BLIMITS") field(LNK6, "LGPS:LTUS:2:BMONLIMITS.F PP") field(DOL7, "LGPS:LTUS:2:BMONLIMITS.I") field(LNK7, "LGPS:LTUS:2:BMON.HIGH") field(DOL8, "LGPS:LTUS:2:BMONLIMITS.J") field(LNK8, "LGPS:LTUS:2:BMON.LOW") field(DOL9, "LGPS:LTUS:2:BMONLIMITS.K") field(LNK9, "LGPS:LTUS:2:BMON.HIHI") field(DOLA, "LGPS:LTUS:2:BMONLIMITS.L") field(LNKA, "LGPS:LTUS:2:BMON.LOLO") field(FLNK, "LGPS:LTUS:2:ILIMITS") field(SCAN, "5 second") } record(ao, "LGPS:LTUS:2:BCTRL") { field(DESC, "B-Perturb") field(PREC, "3") field(EGU, "Volts") field(DRVH, "50.0") field(DRVL, "0.0") field(HOPR, "50.0") field(LOPR, "0.0") # 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, "LGPS:LTUS:2: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, "LGPS:LTUS:2:BCTRLGO") { field(DESC, "Update DES and perturb") field(PREC, "3") # Disable BACT limits field(DOL1, "1") field(LNK1, "LGPS:LTUS:2:BLIMITS.VAL") # Update BDES with the BCTRL (slider) value field(DOL2, "LGPS:LTUS:2:BCTRL.VAL") field(LNK2, "LGPS:LTUS:2:BDES PP") field(DOL3, "1") field(LNK3, "LGPS:LTUS:2:IDIRECT.PROC PP") field(DOL4, "1") field(LNK4, "LGPS:LTUS:2:CHECKSTDZLOST.PROC PP") field(DOL5, "LGPS:LTUS:2:BCTRL.VAL") field(LNK5, "LGPS:LTUS:2:BCTRLSUB PP") # Re-enable BACT limits field(DOL6, "0") field(LNK6, "LGPS:LTUS:2:BLIMITS.VAL") } # Convert B-field to Current and output to ISETPT record(sub, "LGPS:LTUS:2:BCTRLSUB") { field(DESC, "Feedback") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "LGPS:LTUS:2:POLYCOEF") field(INPC, "LGPS:LTUS:2:POLYCOEF.A") field(INPD, "LGPS:LTUS:2:POLYCOEF.B") field(INPE, "LGPS:LTUS:2:BDES.DRVH") field(INPF, "LGPS:LTUS:2:BDES.DRVL") field(PREC, "3") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(MDEL, "-1") field(BRSV, "INVALID") field(FLNK, "LGPS:LTUS:2:ISETPT") } record(ao, "LGPS:LTUS:2:BDESPREVTRIM") { field(DESC, "trim bdes for undo") field(DTYP, "Soft Channel") field(DRVH, "50.0") field(DRVL, "0.0") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(PINI, "YES") info(autosaveFields,"VAL") } record(stringin, "LGPS:LTUS:2:MADNAME") { field(DESC, "MAD deck nomenclature") field(PINI, "YES") field(VAL, "B911-3301") } record(ai, "LGPS:LTUS:2: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, "0.0") } record(ao, "LGPS:LTUS:2:BMAX") { field(DESC, "Max B-Field") field(DTYP, "Soft Channel") field(DRVH, "50.0") field(DRVL, "0.0") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(PINI, "YES") field(VAL, "50.0") field(FLNK, "LGPS:LTUS:2:BSTEP") } record(ao, "LGPS:LTUS:2:BMIN") { field(DESC, "Min B-Field") field(DTYP, "Soft Channel") field(DRVH, "50.0") field(DRVL, "0.0") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(PINI, "YES") field(VAL, "0.0") field(FLNK, "LGPS:LTUS:2:BSTEP") } record(ao, "LGPS:LTUS:2:BDESSAVE") { field(DESC, "bdes for save/load") field(DTYP, "Soft Channel") field(DRVH, "50.0") field(DRVL, "0.0") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PINI, "YES") field(PREC, "3") } # This record is processed by LGPS:LTUS:2: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, "LGPS:LTUS:2:BCON") { field(DESC, "Config B-Field ") field(DTYP, "Soft Channel") field(PREC, "3") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(DRVH, "50.0") field(DRVL, "0.0") # 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 , "") field(OMSL, "closed_loop") field(OUT, "LGPS:LTUS:2:B2ICON PP") info(autosaveFields,"VAL") } record(sub, "LGPS:LTUS:2:B2ICON") { field(DESC, "Convert Desired ICon to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "LGPS:LTUS:2:POLYCOEF") field(INPC, "LGPS:LTUS:2:POLYCOEF.A") field(INPD, "LGPS:LTUS:2:POLYCOEF.B") field(PREC, "3") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(MDEL, "-1") field(INPE, "LGPS:LTUS:2:BCON.DRVH") field(INPF, "LGPS:LTUS:2:BCON.DRVL") field(BRSV, "INVALID") field(FLNK, "LGPS:LTUS:2: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, "LGPS:LTUS:2:BSTEP") { field(DESC, "B-Field step size") field(CALC, "(C==3)||(D==3)?0:ABS(A-B)*0.005") field(INPA, "LGPS:LTUS:2:BMAX") field(INPB, "LGPS:LTUS:2:BMIN") field(INPC, "LGPS:LTUS:2:BMIN.SEVR") field(INPD, "LGPS:LTUS:2:BMAX.SEVR") field(EGU, "Volts") 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,"LGPS:LTUS:2:BCTRLDISABLECALC") { field(DESC, "Calc for disabling BCTRL") field(ASG, "Internal") field(CALC, "A?2:1") field(INPA, "LGPS:LTUS:2:ONLINE CP") field(OUT, "LGPS:LTUS:2:BCTRLDISABLEFOUT PP") } record(fanout, "LGPS:LTUS:2:BCTRLDISABLEFOUT") { field(DESC, "Disable BCTRL fanout") field(SELM, "Specified") field(SELL, "LGPS:LTUS:2:BCTRLDISABLECALC") field(LNK1, "LGPS:LTUS:2:BCTRLDISABLE") field(LNK2, "LGPS:LTUS:2:BCTRLENABLE") } record(stringout, "LGPS:LTUS:2:BCTRLDISABLE") { field(DESC, "Disable BCTRL") field(DTYP, "Soft Channel") field(OUT, "LGPS:LTUS:2:BCTRL.ASG") field(VAL, "NOWRITE") field(FLNK, "LGPS:LTUS:2:BCTRLDISV_UPDATE") } record(stringout, "LGPS:LTUS:2:BCTRLENABLE") { field(DESC, "Enable BCTRL") field(DTYP, "Soft Channel") field(OUT, "LGPS:LTUS:2:BCTRL.ASG") field(VAL, "") field(FLNK, "LGPS:LTUS:2:BCTRLDISV_UPDATE") } record(calcout, "LGPS:LTUS:2:BCTRLDISV_UPDATE") { field(DESC, "Calc for updating BCTRL.DISV") field(ASG, "Internal") field(CALC, "A") field(INPA, "LGPS:LTUS:2:ONLINE") field(OUT, "LGPS:LTUS:2: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,"LGPS:LTUS:2:BACT and MON\n are processed via links from \n LGPS:LTUS:2:IACT (device raw value readback 1)\n and\n LGPS:LTUS:2: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 LGPS:LTUS:2:POLYCOEF\nC = First polynomial coefficient (offset if linear)\nD = Second polynomial coefficient (slope if linear)\nE = LGPS:LTUS:2: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,"LGPS:LTUS:2:BDES\n is processed when set by CA users or \n LGPS:LTUS:2: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,"LGPS:LTUS:2: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 LGPS:LTUS:2: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 (LGPS:LTUS:2: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,"LGPS:LTUS:2:B*LIMITS and LGPS:LTUS:2:BLIMITS:\n Calculate alarm and warning limits based on \n deltas from LGPS:LTUS:2: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,"LGPS:LTUS:2: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,"LGPS:LTUS:2: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, "LGPS:LTUS:2: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, "LGPS:LTUS:2:MPSBTOL") { field(DESC, "Absolute mps tol") field(EGU, "Volts") field(PREC, "2") field(CALC, "ABS(A)*0.02") field(INPA, "LGPS:LTUS:2:BMAX") field(PINI, "YES") } # # 21-Aug-2013: K. Luchini # Set channel access security so that users # cannot easily change values. record(ao, "LGPS:LTUS:2:MPSBMAX") { field(DESC, "MPS Max B-field") field(EGU, "Volts") field(PREC, "7") field(DRVH, "50.0") field(DRVL, "0.0") field(PINI, "YES") field(VAL, "50.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "LGPS:LTUS:2:MPSBMIN") { field(DESC, "MPS Min B-field") field(EGU, "Volts") field(PREC, "7") field(DRVH, "50.0") field(DRVL, "0.0") field(PINI, "YES") field(VAL, "0.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "LGPS:LTUS:2:MPSBLLIM") { field(DESC, "MPS Low Limit B-field") field(EGU, "Volts") field(PREC, "7") field(DRVH, "50.0") field(DRVL, "0.0") field(PINI, "YES") field(VAL, "0.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "LGPS:LTUS:2:MPSBLLIM2") { field(DESC, "MPS Low Limit #2 B-field") field(EGU, "Volts") field(PREC, "7") field(DRVH, "50.0") field(DRVL, "0.0") field(PINI, "YES") field(VAL, "0.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } # Set the default to Std record(mbbo, "LGPS:LTUS:2: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, "LGPS:LTUS:2:MPSLIMITS.E PP") } record(aSub, "LGPS:LTUS:2: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, "LGPS:LTUS:2:MPS.RVAL") field(INPB, "LGPS:LTUS:2:BADIFF") field(INPC, "LGPS:LTUS:2:BDELTAS.N") field(INPD, "LGPS:LTUS:2:BACT") field(INPE, "LGPS:LTUS:2:MPSBITMASK.RVAL") field(INPF, "LGPS:LTUS:2:MPSBLLIM") field(INPG, "LGPS:LTUS:2:MPSBMIN") field(INPH, "LGPS:LTUS:2:MPSBMAX") field(INPI, "LGPS:LTUS:2: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, "LGPS:LTUS:2:INTOL.RVAL PP") field(OUTB, "LGPS:LTUS:2:INTOL_BMIN.RVAL PP") field(OUTC, "LGPS:LTUS:2:INTOL_BRANGE.RVAL PP") field(OUTD, "LGPS:LTUS:2: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, "LGPS:LTUS:2:INTOL") { field(DESC, "BACT within MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "LGPS:LTUS:2:MPSLIMITS.VALA") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "LGPS:LTUS:2:INTOL_BMIN") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "LGPS:LTUS:2:MPSLIMITS.VALB") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "LGPS:LTUS:2:INTOL_BMIN2") { field(DESC, "MPS tol #2") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "LGPS:LTUS:2:MPSLIMITS.VALD") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "LGPS:LTUS:2:INTOL_BRANGE") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "LGPS:LTUS:2: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, "LGPS:LTUS:2:CHCKITOL") { field(DESC, "Absolute Check I Tolerance") field(EGU, "A") field(FLNK, "LGPS:LTUS:2:TRIMITOL") field(CALC, "ABS(A*B)") field(INPA, "LGPS:LTUS:2:CHCKBTOL") field(INPB, "LGPS:LTUS:2:POLYCOEF.B") field(PREC, "9") } record(calc, "LGPS:LTUS:2:TRIMBTOL") { field(EGU, "Volts") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(DESC, "Absolute Trim Tolerance") field(CALC, "ABS(A)/2") field(INPA, "LGPS:LTUS:2:CHCKBTOL") field(FLNK, "LGPS:LTUS:2:CHCKITOL") } record(calc, "LGPS:LTUS:2:CHCKBTOL") { field(DESC, "Check absolute tolerance") field(EGU, "A") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(FLNK, "LGPS:LTUS:2:TRIMBTOL") field(CALC, "MAX(ABS(A),ABS(C))*(B/1000000)") field(INPA, "LGPS:LTUS:2:BDES.HOPR") field(INPB, "LGPS:LTUS:2:STABILITY") field(INPC, "LGPS:LTUS:2:BDES.LOPR") } record(longout, "LGPS:LTUS:2:STABILITY") { field(DESC, "Long Term Stability") field(PINI, "YES") field(VAL, "15000") field(EGU, "ppm") field(DRVH, "20000") field(DRVL, "100") field(HOPR, "20000") field(LOPR, "100") field(FLNK, "LGPS:LTUS:2:CHCKBTOL") } record(calc, "LGPS:LTUS:2:TRIMITOL") { field(DESC, "Absolute Trim I Tolerance") field(EGU, "Volts") field(CALC, "ABS(A*B)") field(INPA, "LGPS:LTUS:2:POLYCOEF.B") field(INPB, "LGPS:LTUS:2:TRIMBTOL") field(PREC, "9") } record(ai, "LGPS:LTUS:2:TRIMBTOLR") { field(DESC, "Relative trim tol") field(PREC, "4") field(EGU, "%") field(HOPR, "1.0") field(LOPR, "0.0") field(PINI, "YES") } record(ai, "LGPS:LTUS:2: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, "LGPS:LTUS:2:FBCKFCOM") { field(ZNAM, "CA") field(ONAM, "FCOM") field(DESC, "CA Mode") field(PINI, "YES") field(SDIS, "0") } record(bo, "LGPS:LTUS:2:PAU") { field(ZNAM, "NotConfigured") field(ONAM, "Configured") field(DESC, "PAU Present") field(PINI, "YES") field(SDIS, "0") field(FLNK, "LGPS:LTUS:2:PAUGO") } record(fanout, "LGPS:LTUS:2:PAUGO") { field(DESC, "PAU control") field(LNK1, "LGPS:LTUS:2:PAUSTOP") field(LNK2, "LGPS:LTUS:2: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, "LGPS:LTUS:2:PAUSTART") { field(DESC, "Setup for PAU On") field(SDIS, "LGPS:LTUS:2: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, "LGPS:LTUS:2:PAUSTOP") { field(DESC, "Setup for PAU Off") field(SDIS, "LGPS:LTUS:2: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, "LGPS:LTUS:2:MCORDEVNAME") { field(DESC, "PS device name") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, "PS:LTUS:2:") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "LGPS:LTUS:2: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, "LGPS:LTUS:2:PSTYPE.RVAL") field(INPC, "LGPS:LTUS:2:TURNEDOFF.RVAL") field(INPD, "LGPS:LTUS:2:CONFIG.RVAL") field(INPE, "LGPS:LTUS:2:PSCATEGORY.RVAL") field(INPF, "LGPS:LTUS:2:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "LGPS:LTUS:2:AUTOCTRL.RVAL") field(INPJ, "LGPS:LTUS:2:OUTOFSERVICE.RVAL") field(INPL, "LGPS:LTUS:2:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "LGPS:LTUS:2:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "LGPS:LTUS:2:PAU") field(INPP, "LGPS:LTUS:2:CALBDISABLE.RVAL") field(INPQ, "LGPS:LTUS:2:PTRBDISABLE.RVAL") field(INPR, "LGPS:LTUS:2:TRIMDISABLE.RVAL") field(INPS, "LGPS:LTUS:2:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "LGPS:LTUS:2:FBCK") field(INPU, "LGPS:LTUS:2:TRIMTYPE.RVAL") field(INPV, "LGPS:LTUS:2:STDZDIRECT.RVAL") field(INPW, "LGPS:LTUS:2:DEGAUSENABLE.RVAL") field(FLNK, "LGPS:LTUS:2:HSTA") } record(longin, "LGPS:LTUS:2:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "LGPS:LTUS:2:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "LGPS:LTUS:2: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, "LGPS:LTUS:2: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, "LGPS:LTUS:2: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, "LGPS:LTUS:2: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, "LGPS:LTUS:2: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, "LGPS:LTUS:2: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 LGPS:LTUS:2:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses LGPS:LTUS:2:FBCK. # This PV should be replaced by LGPS:LTUS:2: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, "LGPS:LTUS:2: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, "LGPS:LTUS:2: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, "LGPS:LTUS:2: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, "") field(OMSL, "supervisory") field(FLNK, "LGPS:LTUS:2:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"LGPS:LTUS:2:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "LGPS:LTUS:2:OUTOFSERVICE NPP NMS") field(OUT, "LGPS:LTUS:2:ONLINE PP") } record(bo, "LGPS:LTUS:2:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "LGPS:LTUS:2: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, "1") } record(bo, "LGPS:LTUS:2: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, "1") } record(bo, "LGPS:LTUS:2: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, "1") } # This PV is modified by :STATSUB.U record(bo, "LGPS:LTUS:2: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, "LGPS:LTUS:2: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, "LGPS:LTUS:2: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, "LGPS:LTUS:2: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, "LGPS:LTUS:2: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, "1") field(ASG, "NOWRITE") } record(mbbo, "LGPS:LTUS:2: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, "2") field(ASG, "NOWRITE") } record(mbbo, "LGPS:LTUS:2: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, "3") field(ASG, "NOWRITE") } record(mbbo, "LGPS:LTUS:2: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, "0") field(ASG, "NOWRITE") field(FLNK, "LGPS:LTUS:2:TRIMTYPE") } record(stringout, "LGPS:LTUS:2:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "LGPS:LTUS:2:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "LGPS:LTUS:2:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "LGPS:LTUS:2:STATE.RVAL") field(INPB, "LGPS:LTUS:2:INTLKSUMY.RVAL") field(OUT, "LGPS:LTUS:2:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "LGPS:LTUS:2: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, "LGPS:LTUS:2:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "LGPS:LTUS:2:STATE.RVAL") field(INPB, "LGPS:LTUS:2:INTLKSUMY.RVAL") field(OUT, "LGPS:LTUS:2:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "LGPS:LTUS:2:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "LGPS:LTUS:2:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "LGPS:LTUS:2: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, "LGPS:LTUS:2: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, "LGPS:LTUS:2: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, "LGPS:LTUS:2: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,"LGPS:LTUS:2: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("LGPS:LTUS:2:TURNEDOFF",3140,1907,0,1,"LGPS:LTUS:2:TURNEDOFF") #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "LGPS:LTUS:2:STATSUB") { field(DESC, "Build STATus ") field(INAM, "mgntInit") field(SNAM, "mgntSlcStat") field(INPA, "LGPS:LTUS:2:BACT.STAT") field(INPB, "LGPS:LTUS:2:BDES.STAT") field(INPC, "LGPS:LTUS:2:IRIPL.STAT") field(INPD, "PS:LTUS:2:ISETPT.STAT") field(INPE, "PS:LTUS:2:IACT.STAT") # 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, "LGPS:LTUS:2:BACT.SEVR") field(INPH, "LGPS:LTUS:2:BDES.SEVR") field(INPI, "LGPS:LTUS:2:IRIPL.SEVR") field(INPJ, "PS:LTUS:2:ISETPT.SEVR") field(INPK, "PS:LTUS:2:IACT.SEVR") # # 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, "LGPS:LTUS:2:STATE.RVAL") field(INPN, "LGPS:LTUS:2:STDZOK") field(INPO, "LGPS:LTUS:2:CALBOK") field(INPP, "LGPS:LTUS:2:OUTOFSERVICE.RVAL") field(INPQ, "LGPS:LTUS:2:CONFIG.RVAL") field(INPR, "LGPS:LTUS:2:HSTA") field(INPS, "LGPS:LTUS:2:CTRL.RVAL") field(INPT, "LGPS:LTUS:2:DEGAUSOK") field(INPV, "LGPS:LTUS:2: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, "LGPS:LTUS:2:STAT") } record(longout, "LGPS:LTUS:2:STAT") { field(DESC, "STAT sent to SLC") field(SCAN, "Passive") field(FLNK, "LGPS:LTUS:2:STATCTRLSUB") field(DOL, "LGPS:LTUS:2:STATSUB.VAL") field(OMSL, "closed_loop") } record(sSub, "LGPS:LTUS:2:STATCTRLSUB") { field(DESC, "Decode SLC STAT into mbbo") field(INAM, "mgntInit") field(SNAM, "mgntStatDecode") field(INPA, "LGPS:LTUS:2:STAT") field(INPB, "LGPS:LTUS:2:HSTA") field(INPD, "LGPS:LTUS:2:ONOFFCTRL.RVAL") field(FLNK, "LGPS:LTUS:2:STATMSG") } record(mbbo, "LGPS:LTUS:2: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, "LGPS:LTUS:2:UNAVAILGO") field(DOL, "LGPS:LTUS:2:STATCTRLSUB.W") } record(seq, "LGPS:LTUS:2:UNAVAILGO") { field(DESC, "Process UNAVAIL") field(DOL1, "LGPS:LTUS:2:STATSUB.U") field(LNK1, "LGPS:LTUS:2:UNAVAIL PP") } record(stringout, "LGPS:LTUS:2:SNLSTATMSG") { field(DTYP, "Soft Channel") } #! TextBox(TB0,820,1000,1200,1220,0,"Dialog",12,1,16777215,"LGPS:LTUS:2:STATUSSUB - future\nOverall device status - takes input from action snls, record sevrs, master snl(s) and outputs final status\n\nInputs:\nA - LGPS:LTUS:2:CTRLSTATUS - snl status\nB - MGNT:CTRLSTATUS - master list status\nC\nD - LGPS:LTUS:2: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,"LGPS:LTUS:2STATSUB\nformat control bo's into slc STAT\n\nInputs:\nA - LGPS:LTUS:2:STATUS\nC - LGPS:LTUS:2:ON\nD - LGPS:LTUS:2:STDZOK\nE - LGPS:LTUS:2:CALBOK\nF - LGPS:LTUS:2:BACTDRIFT (future)\nG -\nH- LGPS:LTUS:2:DACSTATUS\nI -LGPS:LTUS:2:ADCSTATUS\nJ - LGPS:LTUS:2:BACTSTATUS\nK - LGPS:LTUS:2:BDESSTATUS\nL - LGPS:LTUS:2:RIPLSTATUS\n\nOutput:\nP - LGPS:LTUS:2: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, "LGPS:LTUS:2: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, "LGPS:LTUS:2: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, "LGPS:LTUS:2: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, "LGPS:LTUS:2: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.6 #! DBDSTART #! DBD("../../../../dbd/mgntSoft.dbd") #! DBDEND record(stringout, "LGPS:LTUS:2:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "LGPS:LTUS:2:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "LGPS:LTUS:2:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "LGPS:LTUS:2:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "LGPS:LTUS:2:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "LGPS:LTUS:2:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "1") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "LGPS:LTUS:2: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, "LGPS:LTUS:2:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "LGPS:LTUS:2:TRIMTYPE.RVAL") field(INPB, "LGPS:LTUS:2:CONFIG.RVAL") field(OUT, "LGPS:LTUS:2:TRIMMAXNUM PP") } record(longout, "LGPS:LTUS:2: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, "LGPS:LTUS:2:TRIMRAMPRATE") { field(DESC, "Trim Ramp rate ") field(PINI, "YES") field(ASG, "IOC_MAINT") field(PREC, "3") field(EGU, "Volts/sec") field(HOPR, "20.0") field(DRVH, "20.0") field(DRVL, "0.1") field(LOPR, "0.5") # field(DOL, "") field(OMSL, "supervisory") field(VAL, "10") field(OUT, "LGPS:LTUS:2:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "LGPS:LTUS:2: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, "") field(OMSL, "supervisory") field(VAL, "10") } record(bo, "LGPS:LTUS:2: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, "LGPS:LTUS:2: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, "LGPS:LTUS:2:TRIMSTEPMIN") { field(DESC, "Min step in current") field(DTYP, "Soft Channel") # field(DOL, "") field(PREC, "7") field(EGUF, "10") field(EGUL, "0") field(EGU, "Volts") field(HOPR, "10") field(LOPR, "0") field(VAL, "5.0") } record(bo, "LGPS:LTUS:2:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "0") } record(ao, "LGPS:LTUS:2: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, "LGPS:LTUS:2:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "LGPS:LTUS:2: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, "LGPS:LTUS:2: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, "LGPS:LTUS:2:IMOVE") field(INPB, "LGPS:LTUS:2:IACT") field(INPC, "LGPS:LTUS:2:IRAMPRATE") field(INPD, "1.0") field(INPE, "LGPS:LTUS:2:TRIMDLYPCT") field(INPF, "LGPS:LTUS:2:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "LGPS:LTUS:2:RAMPTIME_LEFT PP") } record(longout, "LGPS:LTUS:2:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "LGPS:LTUS:2:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "LGPS:LTUS:2:RAMPDONE_CALC") } record(calc, "LGPS:LTUS:2:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "LGPS:LTUS:2:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "LGPS:LTUS:2:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "LGPS:LTUS:2: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, "LGPS:LTUS:2:RAMPTIME_LEFT") field(OUT, "LGPS:LTUS:2:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "LGPS:LTUS:2:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "LGPS:LTUS:2:RAMPTIME_LEFT NMS") field(OUT, "LGPS:LTUS:2:RAMPDONE PP") } record(bo, "LGPS:LTUS:2:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "LGPS:LTUS:2:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "LGPS:LTUS:2: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, "LGPS:LTUS:2: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(ai, "LGPS:LTUS:2: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, "LGPS:LTUS:2:MPSBTOL") { field(DESC, "Absolute mps tol") field(EGU, "Volts") field(PREC, "2") field(CALC, "ABS(A)*0.02") field(INPA, "LGPS:LTUS:2:BMAX") field(PINI, "YES") } # # 21-Aug-2013: K. Luchini # Set channel access security so that users # cannot easily change values. record(ao, "LGPS:LTUS:2:MPSBMAX") { field(DESC, "MPS Max B-field") field(EGU, "Volts") field(PREC, "7") field(DRVH, "50.0") field(DRVL, "0.0") field(PINI, "YES") field(VAL, "50.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "LGPS:LTUS:2:MPSBMIN") { field(DESC, "MPS Min B-field") field(EGU, "Volts") field(PREC, "7") field(DRVH, "50.0") field(DRVL, "0.0") field(PINI, "YES") field(VAL, "0.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "LGPS:LTUS:2:MPSBLLIM") { field(DESC, "MPS Low Limit B-field") field(EGU, "Volts") field(PREC, "7") field(DRVH, "50.0") field(DRVL, "0.0") field(PINI, "YES") field(VAL, "0.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "LGPS:LTUS:2:MPSBLLIM2") { field(DESC, "MPS Low Limit #2 B-field") field(EGU, "Volts") field(PREC, "7") field(DRVH, "50.0") field(DRVL, "0.0") field(PINI, "YES") field(VAL, "0.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } # Set the default to Std record(mbbo, "LGPS:LTUS:2: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, "LGPS:LTUS:2:MPSLIMITS.E PP") } record(aSub, "LGPS:LTUS:2: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, "LGPS:LTUS:2:MPS.RVAL") field(INPB, "LGPS:LTUS:2:BADIFF") field(INPC, "LGPS:LTUS:2:BDELTAS.N") field(INPD, "LGPS:LTUS:2:BACT") field(INPE, "LGPS:LTUS:2:MPSBITMASK.RVAL") field(INPF, "LGPS:LTUS:2:MPSBLLIM") field(INPG, "LGPS:LTUS:2:MPSBMIN") field(INPH, "LGPS:LTUS:2:MPSBMAX") field(INPI, "LGPS:LTUS:2: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, "LGPS:LTUS:2:INTOL.RVAL PP") field(OUTB, "LGPS:LTUS:2:INTOL_BMIN.RVAL PP") field(OUTC, "LGPS:LTUS:2:INTOL_BRANGE.RVAL PP") field(OUTD, "LGPS:LTUS:2: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, "LGPS:LTUS:2:INTOL") { field(DESC, "BACT within MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "LGPS:LTUS:2:MPSLIMITS.VALA") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "LGPS:LTUS:2:INTOL_BMIN") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "LGPS:LTUS:2:MPSLIMITS.VALB") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "LGPS:LTUS:2:INTOL_BMIN2") { field(DESC, "MPS tol #2") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "LGPS:LTUS:2:MPSLIMITS.VALD") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "LGPS:LTUS:2:INTOL_BRANGE") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "LGPS:LTUS:2: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, "LGPS:LTUS:2:CHCKITOL") { field(DESC, "Absolute Check I Tolerance") field(EGU, "A") field(FLNK, "LGPS:LTUS:2:TRIMITOL") field(CALC, "ABS(A*B)") field(INPA, "LGPS:LTUS:2:CHCKBTOL") field(INPB, "LGPS:LTUS:2:POLYCOEF.B") field(PREC, "9") } record(calc, "LGPS:LTUS:2:TRIMBTOL") { field(EGU, "Volts") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(DESC, "Absolute Trim Tolerance") field(CALC, "ABS(A)/2") field(INPA, "LGPS:LTUS:2:CHCKBTOL") field(FLNK, "LGPS:LTUS:2:CHCKITOL") } record(calc, "LGPS:LTUS:2:CHCKBTOL") { field(DESC, "Check absolute tolerance") field(EGU, "A") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(FLNK, "LGPS:LTUS:2:TRIMBTOL") field(CALC, "MAX(ABS(A),ABS(C))*(B/1000000)") field(INPA, "LGPS:LTUS:2:BDES.HOPR") field(INPB, "LGPS:LTUS:2:STABILITY") field(INPC, "LGPS:LTUS:2:BDES.LOPR") } record(longout, "LGPS:LTUS:2:STABILITY") { field(DESC, "Long Term Stability") field(PINI, "YES") field(VAL, "1000") field(EGU, "ppm") field(DRVH, "20000") field(DRVL, "100") field(HOPR, "20000") field(LOPR, "100") field(FLNK, "LGPS:LTUS:2:CHCKBTOL") } record(calc, "LGPS:LTUS:2:TRIMITOL") { field(DESC, "Absolute Trim I Tolerance") field(EGU, "Volts") field(CALC, "ABS(A*B)") field(INPA, "LGPS:LTUS:2:POLYCOEF.B") field(INPB, "LGPS:LTUS:2:TRIMBTOL") field(PREC, "9") } record(ai, "LGPS:LTUS:2:TRIMBTOLR") { field(DESC, "Relative trim tol") field(PREC, "4") field(EGU, "%") field(HOPR, "1.0") field(LOPR, "0.0") field(PINI, "YES") } record(ai, "LGPS:LTUS:2: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.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "LGPS:LTUS:2: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, "LGPS:LTUS:2:PSTYPE.RVAL") field(INPC, "LGPS:LTUS:2:TURNEDOFF.RVAL") field(INPD, "LGPS:LTUS:2:CONFIG.RVAL") field(INPE, "LGPS:LTUS:2:PSCATEGORY.RVAL") field(INPF, "LGPS:LTUS:2:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "LGPS:LTUS:2:AUTOCTRL.RVAL") field(INPJ, "LGPS:LTUS:2:OUTOFSERVICE.RVAL") field(INPL, "LGPS:LTUS:2:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "LGPS:LTUS:2:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "LGPS:LTUS:2:PAU") field(INPP, "LGPS:LTUS:2:CALBDISABLE.RVAL") field(INPQ, "LGPS:LTUS:2:PTRBDISABLE.RVAL") field(INPR, "LGPS:LTUS:2:TRIMDISABLE.RVAL") field(INPS, "LGPS:LTUS:2:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "LGPS:LTUS:2:FBCK") field(INPU, "LGPS:LTUS:2:TRIMTYPE.RVAL") field(INPV, "LGPS:LTUS:2:STDZDIRECT.RVAL") field(INPW, "LGPS:LTUS:2:DEGAUSENABLE.RVAL") field(FLNK, "LGPS:LTUS:2:HSTA") } record(longin, "LGPS:LTUS:2:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "LGPS:LTUS:2:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "LGPS:LTUS:2: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, "LGPS:LTUS:2: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, "LGPS:LTUS:2: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, "LGPS:LTUS:2: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, "LGPS:LTUS:2: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, "LGPS:LTUS:2: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 LGPS:LTUS:2:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses LGPS:LTUS:2:FBCK. # This PV should be replaced by LGPS:LTUS:2: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, "LGPS:LTUS:2: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, "LGPS:LTUS:2: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, "LGPS:LTUS:2: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, "") field(OMSL, "supervisory") field(FLNK, "LGPS:LTUS:2:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"LGPS:LTUS:2:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "LGPS:LTUS:2:OUTOFSERVICE NPP NMS") field(OUT, "LGPS:LTUS:2:ONLINE PP") } record(bo, "LGPS:LTUS:2:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "PS:LTUS:2:CommLink PP") } record(bo, "LGPS:LTUS:2: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, "1") } record(bo, "LGPS:LTUS:2: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, "1") } record(bo, "LGPS:LTUS:2: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, "1") } # This PV is modified by :STATSUB.U record(bo, "LGPS:LTUS:2: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, "LGPS:LTUS:2: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, "LGPS:LTUS:2: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, "LGPS:LTUS:2: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, "LGPS:LTUS:2: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, "1") field(ASG, "NOWRITE") } record(mbbo, "LGPS:LTUS:2: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, "2") field(ASG, "NOWRITE") } record(mbbo, "LGPS:LTUS:2: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, "5") field(ASG, "NOWRITE") } record(mbbo, "LGPS:LTUS:2: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, "0") field(ASG, "NOWRITE") field(FLNK, "LGPS:LTUS:2:TRIMTYPE") } record(stringout, "LGPS:LTUS:2:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "LGPS:LTUS:2:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "LGPS:LTUS:2:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "LGPS:LTUS:2:STATE.RVAL") field(INPB, "LGPS:LTUS:2:INTLKSUMY.RVAL") field(OUT, "LGPS:LTUS:2:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "LGPS:LTUS:2: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, "LGPS:LTUS:2:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "LGPS:LTUS:2:STATE.RVAL") field(INPB, "LGPS:LTUS:2:INTLKSUMY.RVAL") field(OUT, "LGPS:LTUS:2:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "LGPS:LTUS:2:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "LGPS:LTUS:2:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "LGPS:LTUS:2: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, "LGPS:LTUS:2: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, "LGPS:LTUS:2: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, "LGPS:LTUS:2: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,"LGPS:LTUS:2: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("LGPS:LTUS:2:TURNEDOFF",3140,1907,0,1,"LGPS:LTUS:2:TURNEDOFF") #! 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, "LGPS:LTUS:3:IACT") { field(DESC, "Current") field(INP, "PS:LTUS:3:IACT") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "LGPS:LTUS:3:BACT") info(autosaveFields,"HYST") } record(bi, "LGPS:LTUS:3:STATE") { field(DESC, "PS On/Off Status") field(DTYP, "Raw Soft Channel") field(INP, "PS:LTUS:3:STATE CP MS") field(ZSV, "MAJOR") field(ZNAM, "OFF") field(ONAM, "ON") } record(ao, "LGPS:LTUS:3:IDES") { field(DESC, "Desired Current") field(PREC, "3") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(MDEL, "-1") field(HIHI, "50.0") field(LOLO, "0.0") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "LGPS:LTUS:3:BDELTAS") field(DRVH, "50.0") field(DRVL, "0.0") field(DOL, "LGPS:LTUS:3: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, "LGPS:LTUS:3:ICTRL PP") } # This record is processed by LGPS:LTUS:3:ICON") # Note: we are not setting alarms here. record(ao, "LGPS:LTUS:3:ICON") { field(DESC, "Config I") field(DTYP, "Soft Channel") field(PREC, "3") field(HOPR, "50.0") field(LOPR, "0.0") field(DRVH, "50.0") field(DRVL, "0.0") field(DOL, "LGPS:LTUS:3:B2ICON.K") field(OMSL, "closed_loop") info(autosaveFields,"VAL") } record(ao, "LGPS:LTUS:3:INOM") { field(DESC, "Nominal Current") field(DOL, "LGPS:LTUS:3:BNOM.K") field(OMSL, "closed_loop") field(PREC, "3") field(EGU, "Volts") field(DRVH, "50.0") field(DRVL, "0.0") field(HOPR, "50.0") field(LOPR, "0.0") } record(ao, "LGPS:LTUS:3:ICTRL") { field(DESC, "Set Current") field(PREC, "3") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(DRVH, "50.0") field(DRVL, "0.0") field(MDEL, "-1") field(FLNK, "LGPS:LTUS:3:ICTRLGO") field(OMSL, "supervisory") info(autosavefields,"VAL") } record(seq, "LGPS:LTUS:3:ICTRLGO") { field(DESC, "Process Current Setpoint") field(PREC, "3") # Set ISETPT to supervisory field(DOL1, "0") field(LNK1, "LGPS:LTUS:3:ISETPT.OMSL") field(DOL2, "LGPS:LTUS:3:ICTRL") field(LNK2, "LGPS:LTUS:3:ISETPT PP") # Set ISETPT to closed loop - get data from BCTRLSUB.K field(DOL3, "1") field(LNK3, "LGPS:LTUS:3:ISETPT.OMSL") } record(ao, "LGPS:LTUS:3:IMAX") { field(DESC, "Max I") field(DTYP, "Soft Channel") field(DRVH, "50.0") field(DRVL, "0.0") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(PINI, "YES") field(VAL, "50.0") field(FLNK, "LGPS:LTUS:3:IMIN") } record(ao, "LGPS:LTUS:3:IMIN") { field(DESC, "Min I") field(DTYP, "Soft Channel") field(DRVH, "50.0") field(DRVL, "0.0") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(VAL, "0.0") field(FLNK, "LGPS:LTUS:3:IRANGE") } record(sel, "LGPS:LTUS:3:IACTPREVOK") { field(DESC, "Last Good Current") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(NVL, "LGPS:LTUS:3:BACT.SEVR") field(INPA, "LGPS:LTUS:3:IACT NPP MS") field(INPB, "LGPS:LTUS:3:IACTPREVOK NPP MS") field(INPC, "LGPS:LTUS:3:IACTPREVOK NPP MS") field(INPD, "LGPS:LTUS:3:IACTPREVOK NPP MS") } record(sub, "LGPS:LTUS:3:IACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "LGPS:LTUS:3:IDES") field(INPB, "LGPS:LTUS:3:ISETPT.DRVH") field(INPC, "LGPS:LTUS:3:ISETPT.DRVL") field(INPD, "LGPS:LTUS:3:IDELTAS.I") field(INPE, "LGPS:LTUS:3:IDELTAS.J") field(INPG, "LGPS:LTUS:3:STATE") field(INPH, "LGPS:LTUS:3:HSTA") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(sub, "LGPS:LTUS:3:IMONLIMITS") { field(DESC, "Aux Current Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "LGPS:LTUS:3:IDES") field(INPB, "LGPS:LTUS:3:ISETPT.DRVH") field(INPC, "LGPS:LTUS:3:ISETPT.DRVL") field(INPD, "LGPS:LTUS:3:IDELTAS.K") field(INPE, "LGPS:LTUS:3:IDELTAS.L") field(INPG, "LGPS:LTUS:3:STATE") field(INPH, "LGPS:LTUS:3:HSTA") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(seq, "LGPS:LTUS:3:ILIMITS") { field(DESC, "Set ACT and MON Limits") field(PREC, "3") field(DOL1, "LGPS:LTUS:3:BLIMITS") field(LNK1, "LGPS:LTUS:3:IACTLIMITS.F PP") field(DOL2, "LGPS:LTUS:3:IACTLIMITS.I") field(LNK2, "LGPS:LTUS:3:IACT.HIGH") field(DOL3, "LGPS:LTUS:3:IACTLIMITS.J") field(LNK3, "LGPS:LTUS:3:IACT.LOW") field(DOL4, "LGPS:LTUS:3:IACTLIMITS.K") field(LNK4, "LGPS:LTUS:3:IACT.HIHI") field(DOL5, "LGPS:LTUS:3:IACTLIMITS.L") field(LNK5, "LGPS:LTUS:3:IACT.LOLO") field(DOL6, "LGPS:LTUS:3:BLIMITS") field(LNK6, "LGPS:LTUS:3:IMONLIMITS.F PP") field(DOL7, "LGPS:LTUS:3:IMONLIMITS.I") field(LNK7, "LGPS:LTUS:3:IMON.HIGH") field(DOL8, "LGPS:LTUS:3:IMONLIMITS.J") field(LNK8, "LGPS:LTUS:3:IMON.LOW") field(DOL9, "LGPS:LTUS:3:IMONLIMITS.K") field(LNK9, "LGPS:LTUS:3:IMON.HIHI") field(DOLA, "LGPS:LTUS:3:IMONLIMITS.L") field(LNKA, "LGPS:LTUS:3: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, "LGPS:LTUS:3:IDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntRawDeltas") field(INPD, "LGPS:LTUS:3:TRIMBTOL") field(INPE, "LGPS:LTUS:3:CHCKBTOL") field(INPF, "LGPS:LTUS:3:BDELTAS.K") field(INPG, "LGPS:LTUS:3:BDELTAS.L") field(INPH, "LGPS:LTUS:3:B2IDES.L") field(EGU, "Volts") field(HOPR, "1") field(PREC, "3") field(BRSV, "INVALID") # # Used to calcualte standardize tolerance # which is returned in the VAL field. # field(INPB, "LGPS:LTUS:3:STDZITOLR") field(INPC, "LGPS:LTUS:3:STDZITOL") field(FLNK, "") } # All ps controllers with on/off control will set the macro ONOF # as follows: # # ONOF = PS:LTUS:3: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, "LGPS:LTUS:3:STATESETPT") { field(DESC, "PS On/Off") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFF") field(ONAM, "ON") field(OUT, "PS:LTUS:3:STATESETPT PP") 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:LTUS:3:RESET PP # record(bo, "LGPS:LTUS:3:RESET") { field(DESC, "Interlock Latch Reset") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFF") field(ONAM, "ON") field(HIGH, "1.0") field(OUT, "PS:LTUS:3:RESET PP") } record(bo, "LGPS:LTUS:3:RAMPSTATE") { field(DESC, "PS Ramp Status") field(DTYP, "Soft Channel") field(DOL, "PS:LTUS:3:RAMPSTATE") 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, "LGPS:LTUS:3: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, "Volts/sec") field(PREC, "3") # Set default to trim ramp rate on boot # but need to change for degauss function. field(DOL, "LGPS:LTUS:3:TRIMRAMPRATE") field(OUT, "") field(FLNK, "LGPS:LTUS:3:STDZDLY") } record(ao, "LGPS:LTUS:3:ISETPT") { field(DESC, "Current Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(DRVH, "50.0") field(DRVL, "0.0") field(MDEL, "-1") field(OUT, "PS:LTUS:3:ISETPT PP") field(DOL, "LGPS:LTUS:3: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, "LGPS:LTUS:3:IMON") { field(DESC, "Aux Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(INP, "") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "LGPS:LTUS:3:BMON") } record(ao, "LGPS:LTUS:3:IRIPL") { field(DESC, "Ripple Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(DOL, "") field(OMSL, "closed_loop") field(EGU, "Volts") field(DRVH, "1.0") field(HOPR, "1.0") field(PREC, "3") field(FLNK, "LGPS:LTUS:3:IRIPLOK") } record(sub, "LGPS:LTUS:3:IRIPLOK") { field(DESC, "Ripple Current Status") field(INAM, "mgntInit") field(SNAM, "mgntRiplOK") field(INPA, "LGPS:LTUS:3:IRIPL.VAL") field(INPB, "LGPS:LTUS:3: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, "LGPS:LTUS:3:R") { field(DESC, "Resistance") field(EGU, "Ohms") field(PREC, "4") field(PINI, "YES") field(DOL, "") 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, "LGPS:LTUS:3:IGND") { field(DESC, "Ground Current") field(EGU, "Volts") field(PREC, "6") field(PINI, "YES") field(DOL, "") field(OMSL, "closed_loop") } record(bi, "LGPS:LTUS:3:INTLKSUMY") { field(DESC, "Interlock Summary") field(INP, "PS:LTUS:3:INTLKSUMY CP MS") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(ZNAM, "OK") field(ONAM, "FAULT") field(PINI, "NO") } record(mbbo, "LGPS:LTUS:3: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:LTUS:3:COOLING") field(OMSL, "closed_loop") } # The following PV is processed by :BACTFO # which is processed by :BACT record(fanout, "LGPS:LTUS:3:IACTFO") { field(DESC, "IACT processing") field(SELM, "All") field(LNK1, "LGPS:LTUS:3:IACTPREVOK") field(LNK2, "LGPS:LTUS:3:IDIFF") field(LNK3, "LGPS:LTUS:3:IADIFF") field(LNK4, "LGPS:LTUS:3:IRATIO") field(LNK5, "LGPS:LTUS:3:IDIRECT") field(LNK6, "LGPS:LTUS:3:IACTPOL_CHECK") } record(calc, "LGPS:LTUS:3:IDIFF") { field(DESC, "IDES-IACT") field(CALC, "A-B") field(INPA, "LGPS:LTUS:3:IDES") field(INPB, "LGPS:LTUS:3:IACT") field(EGU, "Volts") field(PREC, "9") field(HOPR, "50.0") field(LOPR, "0.0") } record(calc, "LGPS:LTUS:3:IADIFF") { field(DESC, "Absolute IDES-IACT") field(CALC, "A<0?ABS(A):A") field(INPA, "LGPS:LTUS:3:IDIFF") field(PREC, "9") } record(calc, "LGPS:LTUS:3:IRATIO") { field(DESC, "IDES-IACT/IMAX") field(CALC, "B?A/B:0") field(INPA, "LGPS:LTUS:3:IDIFF") field(INPB, "LGPS:LTUS:3:IDES.DRVH") field(PREC, "9") } record(calcout, "LGPS:LTUS:3:IRANGE") { field(DESC, "Current Range") field(PINI, "YES") field(CALC, "ABS(A-B)") field(INPA, "LGPS:LTUS:3:IMIN") field(INPB, "LGPS:LTUS:3: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, "LGPS:LTUS:3: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, "LGPS:LTUS:3:IACT") field(FLNK, "LGPS:LTUS:3:IACTPOL") } record(bo, "LGPS:LTUS:3:IACTPOL") { field(DESC, "Actual I Polarity") field(DTYP, "Raw Soft Channel") field(DOL, "LGPS:LTUS:3: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,"LGPS:LTUS:3:I*LIMITS:\n Calculate alarm and warning limits based on \n deltas from LGPS:LTUS:3:IDELTAS and the\n LGPS:LTUS:3: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,"LGPS:LTUS:3:IACT: \n Get copy of LGPS:LTUS:3:I. \n",null) #! TextBox(TB12,1280,3100,1760,3200,0,"Dialog",12,1,16777215,"LGPS:LTUS:3: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,"LGPS:LTUS:3:IDES:\n Contains raw value calculated by \nLGPS:LTUS:3: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 \nLGPS:LTUS:3:BDELTAS.\n",null) #! TextBox(TB10,56,1940,316,2340,0,"Dialog",12,1,16777215,"LGPS:LTUS:3: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 LGPS:LTUS:3: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 LGPS:LTUS:3: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,"LGPS:LTUS:3:ISETPT:\n Sets the hardware. When fast feedback is set on, this record is\n set to closed loop mode by LGPS:LTUS:3:FBCKSTART sequence. When \n the loop is closed, this record takes input calculated by \n BFBCK only. When fast feedback is set off, LGPS:LTUS:3:FBCKSTOP \n will set it back to supervisory so that the value can be set by \n LGPS:LTUS:3: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, "LGPS:LTUS:3:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "LGPS:LTUS:3:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "LGPS:LTUS:3:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "LGPS:LTUS:3:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "LGPS:LTUS:3:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "LGPS:LTUS:3:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "1") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "LGPS:LTUS:3: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, "LGPS:LTUS:3:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "LGPS:LTUS:3:TRIMTYPE.RVAL") field(INPB, "LGPS:LTUS:3:CONFIG.RVAL") field(OUT, "LGPS:LTUS:3:TRIMMAXNUM PP") } record(longout, "LGPS:LTUS:3: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, "LGPS:LTUS:3:TRIMRAMPRATE") { field(DESC, "Trim Ramp rate ") field(PINI, "YES") field(ASG, "IOC_MAINT") field(PREC, "3") field(EGU, "Volts/sec") field(HOPR, "20.0") field(DRVH, "20.0") field(DRVL, "0.1") field(LOPR, "0.5") # field(DOL, "") field(OMSL, "supervisory") field(VAL, "10") field(OUT, "LGPS:LTUS:3:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "LGPS:LTUS:3: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, "") field(OMSL, "supervisory") field(VAL, "10") } record(bo, "LGPS:LTUS:3: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, "LGPS:LTUS:3: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, "LGPS:LTUS:3:TRIMSTEPMIN") { field(DESC, "Min step in current") field(DTYP, "Soft Channel") # field(DOL, "") field(PREC, "7") field(EGUF, "10") field(EGUL, "0") field(EGU, "Volts") field(HOPR, "10") field(LOPR, "0") field(VAL, "5.0") } record(bo, "LGPS:LTUS:3:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "0") } record(ao, "LGPS:LTUS:3: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, "LGPS:LTUS:3:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "LGPS:LTUS:3: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, "LGPS:LTUS:3: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, "LGPS:LTUS:3:IMOVE") field(INPB, "LGPS:LTUS:3:IACT") field(INPC, "LGPS:LTUS:3:IRAMPRATE") field(INPD, "1.577") field(INPE, "LGPS:LTUS:3:TRIMDLYPCT") field(INPF, "LGPS:LTUS:3:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "LGPS:LTUS:3:RAMPTIME_LEFT PP") } record(longout, "LGPS:LTUS:3:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "LGPS:LTUS:3:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "LGPS:LTUS:3:RAMPDONE_CALC") } record(calc, "LGPS:LTUS:3:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "LGPS:LTUS:3:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "LGPS:LTUS:3:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "LGPS:LTUS:3: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, "LGPS:LTUS:3:RAMPTIME_LEFT") field(OUT, "LGPS:LTUS:3:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "LGPS:LTUS:3:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "LGPS:LTUS:3:RAMPTIME_LEFT NMS") field(OUT, "LGPS:LTUS:3:RAMPDONE PP") } record(bo, "LGPS:LTUS:3:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "LGPS:LTUS:3:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "LGPS:LTUS:3: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, "LGPS:LTUS:3: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, "LGPS:LTUS:3:STDZINIT") { field(DESC, "Proc. Stdz PVs on boot") field(PINI, "YES") field(DOL1, "1") field(DOL2, "1") field(DOL3, "1") field(LNK1, "LGPS:LTUS:3:DEBUG.PROC PP") field(LNK2, "LGPS:LTUS:3:STDZCYCLENUM.PROC PP") field(LNK3, "LGPS:LTUS:3:STDZDISABLE.PROC PP") field(LNK4, "LGPS:LTUS:3: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, "LGPS:LTUS:3:STDZSUB") { field(DESC, "Stdz subroutine") field(INAM, "mgntStdzInit") field(SNAM, "mgntStdz") field(BRSV, "INVALID") field(INPA, "LGPS:LTUS:3:STDZIMIN NPP NMS") field(INPB, "LGPS:LTUS:3:STDZIMAX NPP NMS") field(INPC, "LGPS:LTUS:3:STDZIFINAL NPP NMS") field(INPD, "LGPS:LTUS:3:STDZCYCLENUM NPP NMS") field(INPE, "LGPS:LTUS:3:STDZDIRECT.RVAL NPP NMS") field(INPF, "LGPS:LTUS:3:STDZDISABLE.RVAL CPP NMS") field(INPG, "LGPS:LTUS:3: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, "LGPS:LTUS:3:STDZWF PP") field(OUTB, "LGPS:LTUS:3: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, "LGPS:LTUS:3:STDZWF") } record(mbbo, "LGPS:LTUS:3: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, "LGPS:LTUS:3: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, "LGPS:LTUS:3:STDZMAINPS") { field(DESC, "Stdz by main or self") field(PINI, "YES") field(DTYP, "Soft Channel") field(ZNAM, "SELF") field(ONAM, "MAIN") } record(bo, "LGPS:LTUS:3: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, "LGPS:LTUS:3: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, "LGPS:LTUS:3: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, "LGPS:LTUS:3:STDZTOD") { field(DESC, "Successful Standardize Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "LGPS:LTUS:3:STDZLOSTTOD") { field(DESC, "Standardize Lost Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(longout, "LGPS:LTUS:3:STDZCYCLECNT") { field(DESC, "Cycle Count") field(PINI, "YES") } record(longout, "LGPS:LTUS:3:STDZCYCLENUM") { field(DESC, "No. Standardize Cycles") field(VAL, "3") field(HOPR, "10") field(LOPR, "0") field(DRVH, "10") field(DRVL, "0") field(PINI, "YES") field(FLNK, "LGPS:LTUS:3:STDZDIRECT") } # The default standardize direction is "UP" for # all LCLS Magnets.. record(bo, "LGPS:LTUS:3:STDZDIRECT") { field(DESC, "Standardize Direction ") field(ZNAM, "UP") field(ONAM, "DOWN") field(VAL, "0") field(FLNK, "LGPS:LTUS:3:STDZIMIN") } record(ao, "LGPS:LTUS:3:STDZIMIN") { field(DESC, "Min-STDZ Current") field(PREC, "1") field(EGU, "A") field(HOPR, "50.0") field(LOPR, "0.0") field(VAL, "0.0") field(FLNK, "LGPS:LTUS:3:STDZIMAX") } record(ao, "LGPS:LTUS:3:STDZIMAX") { field(DESC, "Max. Standarize Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "50.0") field(LOPR, "0.0") field(VAL, "50.0") field(FLNK, "LGPS:LTUS:3:STDZIFINAL") } record(ao, "LGPS:LTUS:3:STDZIFINAL") { field(DESC, "Final SDTZ Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "50.0") field(LOPR, "0.0") field(VAL, "0.0") field(FLNK, "LGPS:LTUS:3: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, "LGPS:LTUS:3: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, "LGPS:LTUS:3:STDZITOL") { field(DESC, "Stdz min tolerance") field(PREC, "5") field(CALC, "MAX(ABS(A),ABS(B))*C") field(INPA, "LGPS:LTUS:3:STDZIMIN CP NMS") field(INPB, "LGPS:LTUS:3:STDZIMAX CP MMS") field(INPC, "0.05") field(INPD, "LGPS:LTUS:3:STDZITOLR CP MMS") field(EGU, "A") field(FLNK, "LGPS:LTUS:3:IDELTAS") field(PINI, "YES") } # D - factor (3.154/2 = 1.577) for EPSC, otherwise, set to 1.0 record(calc, "LGPS:LTUS:3:STDZDLY") { field(DESC, "Ramp time for stdz cycle") field(CALC, "C>0?MAX(1,ABS((A-B)/C)*D):0") field(INPA, "LGPS:LTUS:3:STDZIMIN CP NMS") field(INPB, "LGPS:LTUS:3:STDZIMAX CP NMS") field(INPC, "LGPS:LTUS:3:TRIMRAMPRATE CP NMS") field(INPD, "1.0") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") } record(calc, "LGPS:LTUS:3:STDZRAMPDLY") { field(DESC, "Ramp delay total") field(CALC, "MAX(1,((A/100)*B+B))") field(PREC, "5") field(INPA, "LGPS:LTUS:3:TRIMDLYPCT CP MS") field(INPB, "LGPS:LTUS:3: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, "LGPS:LTUS:3:STDZMINIDLY") { field(DESC, "Mini-stdz delay") field(CALC, "A") field(PREC, "5") field(A, "1.0") field(EGU, "sec") field(PINI, "YES") } record(ao, "LGPS:LTUS:3: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, "LGPS:LTUS:3:STDZMINIDELTA") { field(DESC, "Stdz mini % of IMAX") field(CALC, "(B/100)*(A-C)") field(INPA, "LGPS:LTUS:3:IDES.HOPR") field(INPB, "LGPS:LTUS:3:STDZMINIPCT CPP NMS") field(INPC, "LGPS:LTUS:3:IDES.LOPR") field(PREC, "5") } record(calc, "LGPS:LTUS:3:STDZMINISETPT") { field(DESC, "Mini Stdz delta") field(CALC, "C==0?MAX(E-D,B):MIN(E+D,A)") field(INPA, "LGPS:LTUS:3:IDES.HOPR") field(INPB, "LGPS:LTUS:3:IDES.LOPR") field(INPC, "LGPS:LTUS:3:STDZDIRECT.RVAL") field(INPD, "LGPS:LTUS:3:STDZMINIDELTA") field(INPE, "LGPS:LTUS:3:IDES") field(PREC, "5") field(FLNK, "LGPS:LTUS:3: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, "LGPS:LTUS:3:STDZMINISETPTOOR") { field(DESC, "Mini Stdz setpoint out of range") field(CALC, "C==0?(E-DA)") field(INPA, "LGPS:LTUS:3:IDES.HOPR") field(INPB, "LGPS:LTUS:3:IDES.LOPR") field(INPC, "LGPS:LTUS:3:STDZDIRECT.RVAL") field(INPD, "LGPS:LTUS:3:STDZMINIDELTA") field(INPE, "LGPS:LTUS:3: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, "LGPS:LTUS:3: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, "LGPS:LTUS:3:IADJUST.RVAL") field(INPB, "LGPS:LTUS:3:STDZDIRECT.RVAL") field(INPC, "LGPS:LTUS:3:STDZOK.RVAL") field(INPD, "LGPS:LTUS:3:STDZDISABLE.RVAL") field(INPE, "LGPS:LTUS:3:STATE.RVAL CPP NMS") field(INPF, "LGPS:LTUS:3:ICTRL.RVAL") field(INPG, "LGPS:LTUS:3:STATE.SEVR") field(INPH, "LGPS:LTUS:3:BDELTAS.M") field(INPI, "LGPS:LTUS:3:IACT.SEVR") field(OUT, "LGPS:LTUS:3:STDZLOSTGO.SELN PP NMS") field(OOPT, "Transition To Non-zero") } record(seq, "LGPS:LTUS:3:STDZLOSTGO") { field(DESC, "Process lost stdz") field(SELM, "Mask") field(DOL1, "1") field(DOL2, "0") field(LNK1, "LGPS:LTUS:3:STDZLOSTTOD.PROC") field(LNK2, "LGPS:LTUS:3:STDZOK PP") } # Record maximum current after standardize # Reset to IACT from sequence after trim # Disable processing during (mini-)standardize or trim record(calc, "LGPS:LTUS:3:STDZIACTMAX") { field(DESC, "Max act current after stdz") field(CALC, "MAX(A, B)") field(DISV, "0") field(SDIS, "LGPS:LTUS:3:CHECKPWRDIP_ENABLE") field(INPA, "LGPS:LTUS:3:IACT CP") field(INPB, "LGPS:LTUS:3:STDZIACTMAX") field(EGU, "A") field(FLNK, "LGPS:LTUS:3:CHECKPWRDIP") } # Detect power dip if STDZOK is YES, STDZ is enabled, and IACT is valid # If IACT drops below STDZIACTMAX by more than the trim tolerance, clear STDZOK # Warning: Take the absolute value of the trim tolerance, or else quads of # negative polarity will always lose STDZ since their IDELTAS.I are negative. # Note: Large quads and bends are prone to losing STDZ even if they are # perturbed toward higher current since their current tends to overshoot # by greater than the trim tolerance before settling down. record(calcout, "LGPS:LTUS:3:CHECKPWRDIP") { field(DESC, "Detect power dip") field(CALC, "(A-B>ABS(C))?3:0") field(DISV, "0") field(SDIS, "LGPS:LTUS:3:CHECKPWRDIP_ENABLE") field(INPA, "LGPS:LTUS:3:STDZIACTMAX") field(INPB, "LGPS:LTUS:3:IACT") field(INPC, "LGPS:LTUS:3:IDELTAS.I") field(OUT, "LGPS:LTUS:3:STDZLOSTGO.SELN PP NMS") field(OOPT, "When Non-zero") } # Enable processing of STDZIACTMAX and CHECKPWRDIP only if # STDZOK = YES, STDZDISABLE = NO, CTRL != Trim (2), and # CTRL != Stdz (4) record(calc, "LGPS:LTUS:3:CHECKPWRDIP_ENABLE") { field(CALC, "A&&!B&&(C#2)&&(C#4)") field(INPA, "LGPS:LTUS:3:STDZOK.RVAL CP") field(INPB, "LGPS:LTUS:3:STDZDISABLE.RVAL CP") field(INPC, "LGPS:LTUS:3:CTRL.RVAL CP") } #! 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, "LGPS:LTUS:3: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, "LGPS:LTUS:3: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, "LGPS:LTUS:3:CALBSET") { field(DESC, "Use DAC Calbration") field(SCAN, "10 second") field(CALC, "A&&(B==0)&&C?31:960") field(INPA, "LGPS:LTUS:3:CALBOK") field(INPB, "LGPS:LTUS:3:CALBDISABLE") field(INPC, "LGPS:LTUS:3:CALBSLOPE") field(OOPT, "On Change") field(OUT, "LGPS:LTUS:3: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, "LGPS:LTUS:3:CALB_SEQ") { field(DESC, "Output Calib Values") field(SELM, "Mask") field(SELL, "LGPS:LTUS:3: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, "LGPS:LTUS:3:CALBSLOPE") field(DOL3, "LGPS:LTUS:3: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, "LGPS:LTUS:3:CALBTOD") { field(DESC, "Calibration Success Time") field(PINI, "YES") # field(DOL, "") field(OMSL, "supervisory") field(DTYP, "Soft Channel") info(autosaveFields,"VAL") } record(ao, "LGPS:LTUS:3: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, "LGPS:LTUS:3: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, "LGPS:LTUS:3: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, "LGPS:LTUS:3:CALBOFFSET") { field(DESC, "Calc DAC Offset") field(PREC, "6") field(EGU, "Counts") field(PINI, "YES") } record(bo, "LGPS:LTUS:3: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, "LGPS:LTUS:3:DACSLOPE") { field(DESC, "V to DAC slope") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "supervisory") field(PINI, "YES") field(FLNK, "LGPS:LTUS:3:DACOFFSET") } # Default Offset used in conversion from Volts to DAC Counts record(ao, "LGPS:LTUS:3:DACOFFSET") { field(DESC, "V to DAC offset") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "supervisory") field(PINI, "YES") field(FLNK, "LGPS:LTUS:3: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, "LGPS:LTUS:3: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, "LGPS:LTUS:3:IACT") field(INPD, "LGPS:LTUS:3:DACSLOPE") field(INPE, "LGPS:LTUS:3:DACOFFSET") field(EGU, "Counts") field(PREC, "6") } record(ao, "LGPS:LTUS:3:DAC") { field(DESC, "DAC Set point") field(EGU, "Counts") field(DOL, "") field(OMSL, "supervisory") field(PREC, "6") field(PINI, "YES") } record(ao, "LGPS:LTUS:3:CALBIMIN") { field(DESC, "Calibration Min Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(DRVH, "50.0") field(HOPR, "50.0") field(DRVL, "0.0") field(LOPR, "0.0") field(PREC, "3") field(EGU, "A") field(VAL, "0.0") field(FLNK, "LGPS:LTUS:3:CALBIMAX") } record(ao, "LGPS:LTUS:3:CALBIMAX") { field(DESC, "Calibration Max Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(DRVH, "50.0") field(HOPR, "50.0") field(LOPR, "0.0") field(DRVL, "0.0") field(EGU, "A") field(VAL, "50.0") field(FLNK, "LGPS:LTUS:3:CALBSTEPNUM") } record(ao, "LGPS:LTUS:3:CALBIFINAL") { field(DESC, "Calibration Last Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(PREC, "3") field(EGU, "A") field(HOPR, "50.0") field(LOPR, "0.0") field(VAL, "0") } record(longout, "LGPS:LTUS:3: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, "LGPS:LTUS:3:CALBIDELTA") } record(calc, "LGPS:LTUS:3:CALBIDELTA") { field(DESC, "Step size for CALB") field(CALC, "C=0?0:ABS((A-B)/C)") field(INPA, "LGPS:LTUS:3:CALBIMAX") field(INPB, "LGPS:LTUS:3:CALBIMIN") field(INPC, "LGPS:LTUS:3: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, "LGPS:LTUS:3:CALBIMULT") { field(DESC, "IACT vs ISETPT mult") field(CALC, "C#0||A=0?1:ABS(B/A)") field(INPA, "PS:LTUS:3:ISETPT.DRVH") field(INPB, "PS:LTUS:3:IACT.HOPR") field(INPC, "LGPS:LTUS:3:PSCONTROLLER.RVAL CPP") field(EGU, "A") field(PINI, "YES") } # SNL dbputs DAC values here. 6-10 steps are possible. record(waveform, "LGPS:LTUS:3:CALBICTRLWF") { field(DESC, "ICTRL setpoint array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") } record(waveform, "LGPS:LTUS:3:DACWF") { field(DESC, "DAC count array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "LGPS:LTUS:3:DACSA") } # Used only for xygraph edm plot record(subArray, "LGPS:LTUS:3:DACSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "LGPS:LTUS:3: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, "LGPS:LTUS:3:CALCDACWF") { field(DESC, "Calc DAC counts array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "LGPS:LTUS:3:CALCDACSA") } # Used only for xygraph edm plot record(subArray, "LGPS:LTUS:3:CALCDACSA") { field(DESC, "Calc DAC counts") field(DTYP, "Soft Channel") field(INP, "LGPS:LTUS:3: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, "LGPS:LTUS:3:CALBYWF") { field(DESC, "mx + b") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "LGPS:LTUS:3:CALBYSA") } # Used only for xygraph edm plot record(subArray, "LGPS:LTUS:3:CALBYSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "LGPS:LTUS:3:CALBYWF") field(MALM, "10") field(NELM, "6") field(INDX, "0") field(FTVL, "DOUBLE") } record(waveform, "LGPS:LTUS:3:CALBIACTWF") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "LGPS:LTUS:3:CALBIACTSA") } # Used only for xygraph edm plot record(subArray, "LGPS:LTUS:3:CALBIACTSA") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(MALM, "10") field(NELM, "6") field(INP, "LGPS:LTUS:3:CALBIACTWF") field(INDX, "0") field(FTVL, "DOUBLE") field(FLNK, "LGPS:LTUS:3:CALBLIMITS") } # Check that measured current during calibration is within # tolerance. record(aSub, "LGPS:LTUS:3: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, "LGPS:LTUS:3:CALBSTEPNUM") field(INPB, "LGPS:LTUS:3:CALBIACTWF") field(INPC, "LGPS:LTUS:3: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, "LGPS:LTUS:3: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, "LGPS:LTUS:3:STDZITOL") field(INPH, "LGPS:LTUS:3:DACSLOPE") field(INPI, "LGPS:LTUS:3: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, "LGPS:LTUS:3: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, "LGPS:LTUS:3:CALBSTEPNUM") field(INPB, "LGPS:LTUS:3:CALBIACTWF") field(INPC, "LGPS:LTUS:3:DACWF") field(INPF, "LGPS:LTUS:3: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 LGPS:LTUS:3CALBOK 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, "LGPS:LTUS:3:DEGAUSINIT") { field(DESC, "Proc. Degauss PVs on boot") field(PINI, "YES") field(DOL, "1") field(OUTA, "LGPS:LTUS:3:DEGAUSIMIN.PROC PP") field(OUTB, "LGPS:LTUS:3:DEGAUSIMAX.PROC PP") field(OUTC, "LGPS:LTUS:3:DEGAUSTYPE.PROC PP") field(OUTD, "LGPS:LTUS:3:DEGAUSSTEP.PROC PP") field(OUTE, "LGPS:LTUS:3:MADNAME.PROC PP") field(OUTF, "LGPS:LTUS:3:PSTYPE.PROC PP") field(OUTG, "LGPS:LTUS:3: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, "LGPS:LTUS:3:DEGAUSSUB") { field(DESC, "Degauss subroutine") field(INAM, "mgntDegaussInit") field(SNAM, "mgntDegauss") field(BRSV, "INVALID") field(INPA, "LGPS:LTUS:3:DEGAUSIMIN NPP NMS") field(INPB, "LGPS:LTUS:3:DEGAUSIMAX NPP NMS") field(INPC, "LGPS:LTUS:3:DEGAUSTYPE.RVAL NPP NMS") field(INPE, "LGPS:LTUS:3:DEGAUSMETHOD.RVAL NPP NMS") field(INPF, "LGPS:LTUS:3:PSTYPE NPP NMS") field(INPG, "LGPS:LTUS:3:DEBUG.RVAL NPP NMS") field(INPH, "LGPS:LTUS:3: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, "LGPS:LTUS:3:DEGAUSWF PP") field(OUTB, "LGPS:LTUS:3:DEGAUSMSG PP") field(OUTC, "LGPS:LTUS:3: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, "LGPS:LTUS:3:DEGAUSWF") { field(DESC, "Degauss Setpts") field(NELM, "60") field(FTVL, "DOUBLE") } record(mbbo,"LGPS:LTUS:3: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, "LGPS:LTUS:3: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, "LGPS:LTUS:3: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, "LGPS:LTUS:3: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, "LGPS:LTUS:3: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, "LGPS:LTUS:3:DEGAUSIMIN") { field(DESC, "Min. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "50.0") field(LOPR, "-50.0") field(DRVH, "50.0") field(DRVL, "-50.0") field(VAL, "-50.0") } record(ao, "LGPS:LTUS:3:DEGAUSIMAX") { field(DESC, "Max. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "50.0") field(LOPR, "-50.0") field(DRVH, "50.0") field(DRVL, "-50.0") field(VAL, "50.0") } # 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,"LGPS:LTUS:3: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, "LGPS:LTUS:3: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,"LGPS:LTUS:3: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, "LGPS:LTUS:3: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, "LGPS:LTUS:3: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, "LGPS:LTUS:3: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, "LGPS:LTUS:3:DEGAUSTOD") { field(DESC, "Successful Degauss Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "LGPS:LTUS:3:DEGAUSLOSTTOD") { field(DESC, "Degauss Lost Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "LGPS:LTUS:3:DEGAUSTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "LGPS:LTUS:3:DEGAUSTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "LGPS:LTUS:3: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, "LGPS:LTUS:3:DEGAUSGO") { field(DESC, "Set bdes of btrms to zero") field(ASG, "Internal") field(OUTA, "") field(OUTB, "") field(OUTC, "") field(OUTD, "") } # =========== CRYO ONLY =========== record(bo, "LGPS:LTUS:3: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, "LGPS:LTUS:3:DEGAUS_IMAX_CHECK") { field(DESC, "Check if imax shoud chg") field(CALC, "(C==4)&&(ABS(B)>ABS(A))?1:0") field(INPA, "LGPS:LTUS:3:DEGAUS_IMAX") field(INPB, "LGPS:LTUS:3:ISETPT") field(INPC, "LGPS:LTUS:3:DEGAUSTYPE.RVAL") field(OUT, "LGPS:LTUS:3:DEGAUS_IMAX_UPDATE.SELN") field(FLNK, "LGPS:LTUS:3:DEGAUS_IMAX_UPDATE") } record(seq, "LGPS:LTUS:3:DEGAUS_IMAX_UPDATE") { field(DESC, "Degauss IMAX Update") field(SELM, "Specified") field(DOL1, "LGPS:LTUS:3:ISETPT") field(LNK1, "LGPS:LTUS:3:DEGAUS_IMAX PP") } # Set the maximum current after a successful # degauss. This pv is updated by the # sequence. record(ao, "LGPS:LTUS:3:DEGAUS_IMAX") { field(DESC, "Max I set afer a degauss") field(EGU, "Amps") field(PINI, "YES") field(PREC, "6") field(HOPR, "50.0") field(LOPR, "-50.0") field(DRVH, "50.0") field(DRVL, "-50.0") field(VAL, "50.0") field(FLNK, "LGPS:LTUS:3:DEGAUS_IMAXPOL_CHECK") info(autosaveFields,"VAL,RVAL") } # Set the polarity if degauss_imax record(calcout, "LGPS:LTUS:3:DEGAUS_IMAXPOL_CHECK") { field(DESC, "Determine polarity of imax") field(CALC, "A>=0?0:1") field(INPA, "LGPS:LTUS:3:DEGAUS_IMAX") field(FLNK, "LGPS:LTUS:3:DEGAUS_IMAXPOL") } record(bo, "LGPS:LTUS:3:DEGAUS_IMAXPOL") { field(DESC, "Polarity of imax I") field(DTYP, "Raw Soft Channel") field(DOL, "LGPS:LTUS:3:DEGAUS_IMAXPOL_CHECK") field(OMSL, "closed_loop") field(ZNAM, "Positive") field(ONAM, "Negative") field(FLNK, "LGPS:LTUS:3: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, "LGPS:LTUS:3:DEGAUS_ABSIMAX") { field(DESC, "Absolute Max. Degauss I") field(CALC, "ABS(A)") field(INPA, "LGPS:LTUS:3:DEGAUS_IMAX") field(PREC, "6") field(EGU, "Amps") field(HOPR, "50.0") field(LOPR, "-50.0") info(autosaveFields,"VAL RVAL") } # IACT Polarity record(calcout, "LGPS:LTUS:3:IACTPOL_CHECK") { field(DESC, "Determine IACT polarity") field(SCAN, "5 second") field(CALC, "ABS(A-B)>C?(A>=0?0:1):D") field(INPA, "LGPS:LTUS:3:IACT") field(INPB, "LGPS:LTUS:3:IACTPOL_CHECK.LA") field(INPC, "0.0001") field(INPD, "LGPS:LTUS:3:IACTPOL_CHECK.PVAL") field(OOPT, "On Change") field(FLNK, "LGPS:LTUS:3:IACTPOL") } record(bo, "LGPS:LTUS:3: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,"LGPS:LTUS:3: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, "LGPS:LTUS:3:DEGAUSENABLE CP") field(INPB, "LGPS:LTUS:3:DEGAUSOK") field(INPC, "LGPS:LTUS:3:STATE CP") field(INPD, "LGPS:LTUS:3:STATE.SEVR") field(OUT, "LGPS:LTUS:3:DEGAUS_STATE_SEQ.SELN PP") field(ASG, "Internal") } record(seq, "LGPS:LTUS:3:DEGAUS_STATE_SEQ") { field(DESC, "Degauss State Sequence") field(SELM, "Specified") field(SELL, "LGPS:LTUS:3:DEGAUS_STATE_CHECK") field(LNK1, "LGPS:LTUS:3:DEGAUS_STATE_DISABLE.PROC PP") field(LNK2, "LGPS:LTUS:3:DEGAUS_STATE_LOST.PROC PP") field(LNK3, "LGPS:LTUS:3:DEGAUS_STATE_GOOD.PROC PP") field(LNK4, "LGPS:LTUS:3: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, "LGPS:LTUS:3:DEGAUS_STATE_DISABLE") { field(DESC, "Degauss not used") field(LNK1, "LGPS:LTUS:3:DEGAUSOK.ZSV") field(LNK2, "LGPS:LTUS:3: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, "LGPS:LTUS:3:STATMSG.FRSV") field(LNK4, "LGPS:LTUS:3: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, "LGPS:LTUS:3:DEGAUS_STATE_LOST") { field(DESC, "Degauss lost and ps On") field(DOL1, "1") field(LNK1, "LGPS:LTUS:3:DEGAUSOK.ZSV") field(LNK2, "LGPS:LTUS:3: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, "LGPS:LTUS:3:STATMSG.FRSV") field(LNK4, "LGPS:LTUS:3: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, "LGPS:LTUS:3:DEGAUS_STATE_OFF") { field(DESC, "Degaused lost and ps Off") field(DOL1, "2") field(LNK1, "LGPS:LTUS:3: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, "LGPS:LTUS:3:STATMSG.FRSV") field(LNK3, "LGPS:LTUS:3: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, "LGPS:LTUS:3:DEGAUS_STATE_GOOD") { field(DESC, "Degauss good") field(DOL1, "1") field(LNK1, "LGPS:LTUS:3: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, "LGPS:LTUS:3:STATMSG.FRSV PP") field(LNK3, "LGPS:LTUS:3:STATMSG.FVSV PP") field(LNK4, "") field(ASG, "Internal") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(mbbo, "LGPS:LTUS:3:FUNC") { field(DESC, "LGPS:LTUS:3 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, "1") field(NIVL, "2") field(TEVL, "3") field(ELVL, "0") field(TVVL, "0") field(TTVL, "0") field(FTVL, "0") field(FFVL, "0") field(OUT, "LGPS:LTUS:3:CTRL CA") } # :CTRL pv is processed at boot in the # sequence mgntCtrl.st Processed in sequence # record(mbbo, "LGPS:LTUS:3:CTRL") { field(DESC, "LGPS:LTUS:3 Control") field(PINI, "NO") field(ZRST, "Ready") field(ONST, "RESET") field(TWST, "TURN_ON") field(THST, "TURN_OFF") 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, "8") field(TWVL, "9") field(THVL, "10") 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, "LGPS:LTUS:3:SELECTEN.A PP") field(SDIS, "0") } # If a function has been selected set this unit to busy record(calcout, "LGPS:LTUS:3:SELECTEN") { field(DESC, "Control Select Enable") field(CALC, "A>0?1:A") field(FLNK, "LGPS:LTUS:3:BUSY") } # Set to FREE on IOC reboot record(bo, "LGPS:LTUS:3:BUSY") { field(DESC, "LGPS:LTUS:3 Ctrl Done") field(DOL, "LGPS:LTUS:3:SELECTEN") field(ZNAM, "FREE") field(ONAM, "BUSY") field(PINI, "YES") field(FLNK, "LGPS:LTUS:3:SELECT") } record(bo, "LGPS:LTUS:3:SELECT") { field(ZNAM, "NO") field(ONAM, "YES") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") } record(bo, "LGPS:LTUS:3: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, "LGPS:LTUS:3:CTRLSTATE") { field(DESC, "LGPS:LTUS:3 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("LGPS:LTUS:3:CTRL",20,20,0,0,"LGPS:LTUS:3:CTRL") #! Field("LGPS:LTUS:3:CTRL.OUT",16777215,1,"LGPS:LTUS:3:CTRL.OUT") #! Link("LGPS:LTUS:3:CTRL.OUT","LGPS:LTUS:3:SELECTEN.A") #! Field("LGPS:LTUS:3:CTRL.VAL",16777215,1,"LGPS:LTUS:3:CTRL.VAL") #! Record("LGPS:LTUS:3:SELECTEN",321,381,0,0,"LGPS:LTUS:3:SELECTEN") #! Field("LGPS:LTUS:3:SELECTEN.A",16777215,0,"LGPS:LTUS:3:SELECTEN.A") #! Field("LGPS:LTUS:3:SELECTEN.FLNK",16777215,1,"LGPS:LTUS:3:SELECTEN.FLNK") #! Link("LGPS:LTUS:3:SELECTEN.FLNK","LGPS:LTUS:3:BUSY") #! Field("LGPS:LTUS:3:SELECTEN.VAL",16777215,1,"LGPS:LTUS:3:SELECTEN.VAL") #! Record("LGPS:LTUS:3:BUSY",623,274,0,0,"LGPS:LTUS:3:BUSY") #! Field("LGPS:LTUS:3:BUSY.DOL",16777215,0,"LGPS:LTUS:3:BUSY.DOL") #! Link("LGPS:LTUS:3:BUSY.DOL","LGPS:LTUS:3:SELECTEN.VAL") #! Field("LGPS:LTUS:3:BUSY.FLNK",16777215,1,"LGPS:LTUS:3:BUSY.FLNK") #! Link("LGPS:LTUS:3:BUSY.FLNK","LGPS:LTUS:3:SELECT") #! Record("LGPS:LTUS:3:SELECT",669,508,0,1,"LGPS:LTUS:3:SELECT") #! Record("LGPS:LTUS:3:FUNC",940,120,0,0,"LGPS:LTUS:3:FUNC") #! Field("LGPS:LTUS:3:FUNC.OUT",16777215,0,"LGPS:LTUS:3:FUNC.OUT") #! Link("LGPS:LTUS:3:FUNC.OUT","LGPS:LTUS:3:CTRL.VAL") #! Record("LGPS:LTUS:3:ABORT",193,41,0,0,"LGPS:LTUS:3:ABORT") #! Record("LGPS:LTUS:3:CTRLSTATE",369,34,0,0,"LGPS:LTUS:3: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,"LGPS:LTUS:3:SELECT is used for Multi-device selection.\nIt is enabled when associated LGPS:LTUS:3:CTRL is \"0\" (DONE).\nIt is disabled when associated LGPS:LTUS:3: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,"LGPS:LTUS:3: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, "LGPS:LTUS:3:BCTRL_INIT") { field(DESC, "Process BCTRL on boot") field(PINI, "YES") field(CALC, "A=3?1:0") field(INPA, "LGPS:LTUS:3:BCTRL.SEVR") field(OUT, "LGPS:LTUS:3: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, "LGPS:LTUS:3:BACT") { field(DESC, "Actual B") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "LGPS:LTUS:3:BACT") field(INPB, "LGPS:LTUS:3:POLYCOEF") field(INPC, "LGPS:LTUS:3:POLYCOEF.A") field(INPD, "LGPS:LTUS:3:POLYCOEF.B") field(INPE, "LGPS:LTUS:3:IACT MS") field(INPF, "LGPS:LTUS:3:BDELTAS PP") field(INPG, "100") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(HIHI, "50.0") field(LOLO, "0.0") field(PREC, "3") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "50.0") field(LOW, "0.0") field(FLNK, "LGPS:LTUS:3: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, "LGPS:LTUS:3:BDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntPhyDeltas") field(EGU, "Volts") field(HOPR, "1") field(PREC, "3") field(BRSV, "INVALID") field(INPA, "LGPS:LTUS:3:BDES") field(INPB, "LGPS:LTUS:3:TRIMBTOL") field(INPC, "LGPS:LTUS:3:TRIMBTOLR") field(INPD, "LGPS:LTUS:3:CHCKBTOL") field(INPE, "LGPS:LTUS:3:CHCKBTOLR") field(F, "0.0") field(INPG, "30") field(INPH, "LGPS:LTUS:3:BACT.VAL") # # MPS absolute and relative tolerances field(INPP, "LGPS:LTUS:3:MPSBTOL") field(INPQ, "LGPS:LTUS:3:MPSBTOLR") field(FLNK, "LGPS:LTUS:3:BCONLIMITS") info(autosaveFields,"F") } # This record is processed by BDELTAS record(aSub, "LGPS:LTUS:3:BCONLIMITS") { field(DESC, "Config B-field Limits") field(INAM, "mgntInit") field(SNAM, "mgntBCONLimits") field(INPA, "LGPS:LTUS:3:BDES") field(INPB, "LGPS:LTUS:3:BDELTAS.I") field(INPG, "LGPS:LTUS:3:DEBUG.RVAL") field(FTA, "DOUBLE") field(FTB, "DOUBLE") field(FTG, "ULONG") field(OUTA, "LGPS:LTUS:3:BCON.HIGH") field(OUTB, "LGPS:LTUS:3:BCON.LOW") field(OUTC, "LGPS:LTUS:3:BCON.HIHI") field(OUTD, "LGPS:LTUS:3:BCON.LOLO PP") field(FTVA, "DOUBLE") field(FTVB, "DOUBLE") field(FTVC, "DOUBLE") field(FTVD, "DOUBLE") field(BRSV, "INVALID") field(FLNK, "LGPS:LTUS:3:IDELTAS") } # The following PV is processed by :BACT # which is processed by :BACT # record(fanout, "LGPS:LTUS:3:BACTFO") { field(DESC, "BACT processing") field(SELM, "All") field(LNK1, "LGPS:LTUS:3:BDIFF") field(LNK2, "LGPS:LTUS:3:BADIFF") field(LNK3, "LGPS:LTUS:3:BRATIO") field(LNK4, "LGPS:LTUS:3:MPSLIMITS") field(LNK5, "LGPS:LTUS:3:I2BSTATUS") field(LNK6, "LGPS:LTUS:3:IACTFO.PROC") } record(calc, "LGPS:LTUS:3:BDIFF") { field(DESC, "BDES-BACT") field(CALC, "A-B") field(INPA, "LGPS:LTUS:3:BDES") field(INPB, "LGPS:LTUS:3:BACT") field(EGU, "Volts") field(PREC, "7") } record(calc, "LGPS:LTUS:3:BADIFF") { field(DESC, "Absolute BDES-BACT") field(INPA, "LGPS:LTUS:3:BDIFF") field(EGU, "Volts") field(PREC, "7") field(CALC, "A<0?ABS(A):A") } record(calc, "LGPS:LTUS:3:BRATIO") { field(DESC, "BACT Error") field(CALC, "B?A/B:0") field(INPA, "LGPS:LTUS:3:BDIFF") field(INPB, "LGPS:LTUS:3:BDES.HOPR") field(EGU, "Volts") field(PREC, "7") } record(mbbi, "LGPS:LTUS:3: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, "LGPS:LTUS:3:BACT.J") } # Note: for a string slave set the MONFL # macro to the following: # MONFL=:IMONCALC MS record(sub, "LGPS:LTUS:3:BMON") { field(DESC, "Second Transductor") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "LGPS:LTUS:3:BMON") field(INPB, "LGPS:LTUS:3:POLYCOEF") field(INPC, "LGPS:LTUS:3:POLYCOEF.A") field(INPD, "LGPS:LTUS:3:POLYCOEF.B") field(INPE, "LGPS:LTUS:3:IMON MS") field(INPF, "LGPS:LTUS:3:BDELTAS.VAL") field(INPG, "100") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(HIHI, "50.0") field(LOLO, "0.0") field(PREC, "3") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "50.0") field(LOW, "0.0") } # 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:LTUS:3:BDES CP record(ao, "LGPS:LTUS:3:BDES") { field(DESC, "Desired B-Field") field(PINI, "YES") field(DRVH, "50.0") field(DRVL, "0.0") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(EGU, "Volts") field(MDEL, "-1") field(OMSL, "closed_loop") field(DOL, "LGPS:LTUS:3:BDES.DRVH") field(OUT, "LGPS:LTUS:3:B2IDES PP") info(autosaveFields,"VAL") } record(sub, "LGPS:LTUS:3:B2IDES") { field(DESC, "Convert Desired B-Field to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "LGPS:LTUS:3:POLYCOEF") field(INPC, "LGPS:LTUS:3:POLYCOEF.A") field(INPD, "LGPS:LTUS:3:POLYCOEF.B") field(PREC, "3") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(MDEL, "-1") field(INPE, "LGPS:LTUS:3:BDES.DRVH") field(INPF, "LGPS:LTUS:3:BDES.DRVL") field(BRSV, "INVALID") field(FLNK, "LGPS:LTUS:3:IDES") } record(sub, "LGPS:LTUS:3:BNOM") { field(DESC, "Nominal Field") field(PINI, "YES") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "LGPS:LTUS:3:POLYCOEF") field(INPC, "LGPS:LTUS:3:POLYCOEF.A") field(INPD, "LGPS:LTUS:3:POLYCOEF.B") field(INPE, "LGPS:LTUS:3:BDES.DRVH") field(INPF, "LGPS:LTUS:3:BDES.DRVL") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(VAL, "0.0") field(FLNK, "LGPS:LTUS:3:INOM") } record(sub, "LGPS:LTUS:3:BACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "LGPS:LTUS:3:BDES.VAL") field(INPB, "LGPS:LTUS:3:BDES.DRVH") field(INPC, "LGPS:LTUS:3:BDES.DRVL") field(INPD, "LGPS:LTUS:3:BDELTAS.I") field(INPE, "LGPS:LTUS:3:BDELTAS.J") field(INPG, "LGPS:LTUS:3:STATE") field(INPH, "LGPS:LTUS:3:HSTA") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(sub, "LGPS:LTUS:3:BMONLIMITS") { field(DESC, "MON Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "LGPS:LTUS:3:BDES.VAL") field(INPB, "LGPS:LTUS:3:BDES.DRVH") field(INPC, "LGPS:LTUS:3:BDES.DRVL") field(INPD, "LGPS:LTUS:3:BDELTAS.K") field(INPE, "LGPS:LTUS:3:BDELTAS.L") field(INPG, "LGPS:LTUS:3:STATE") field(INPH, "LGPS:LTUS:3:HSTA") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(seq, "LGPS:LTUS:3:BLIMITS") { field(DESC, "ACT Limits") field(PREC, "3") field(DOL1, "LGPS:LTUS:3:BLIMITS") field(LNK1, "LGPS:LTUS:3:BACTLIMITS.F PP") field(DOL2, "LGPS:LTUS:3:BACTLIMITS.I") field(LNK2, "LGPS:LTUS:3:BACT.HIGH") field(DOL3, "LGPS:LTUS:3:BACTLIMITS.J") field(LNK3, "LGPS:LTUS:3:BACT.LOW") field(DOL4, "LGPS:LTUS:3:BACTLIMITS.K") field(LNK4, "LGPS:LTUS:3:BACT.HIHI") field(DOL5, "LGPS:LTUS:3:BACTLIMITS.L") field(LNK5, "LGPS:LTUS:3:BACT.LOLO") field(DOL6, "LGPS:LTUS:3:BLIMITS") field(LNK6, "LGPS:LTUS:3:BMONLIMITS.F PP") field(DOL7, "LGPS:LTUS:3:BMONLIMITS.I") field(LNK7, "LGPS:LTUS:3:BMON.HIGH") field(DOL8, "LGPS:LTUS:3:BMONLIMITS.J") field(LNK8, "LGPS:LTUS:3:BMON.LOW") field(DOL9, "LGPS:LTUS:3:BMONLIMITS.K") field(LNK9, "LGPS:LTUS:3:BMON.HIHI") field(DOLA, "LGPS:LTUS:3:BMONLIMITS.L") field(LNKA, "LGPS:LTUS:3:BMON.LOLO") field(FLNK, "LGPS:LTUS:3:ILIMITS") field(SCAN, "5 second") } record(ao, "LGPS:LTUS:3:BCTRL") { field(DESC, "B-Perturb") field(PREC, "3") field(EGU, "Volts") field(DRVH, "50.0") field(DRVL, "0.0") field(HOPR, "50.0") field(LOPR, "0.0") # 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, "LGPS:LTUS:3: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, "LGPS:LTUS:3:BCTRLGO") { field(DESC, "Update DES and perturb") field(PREC, "3") # Disable BACT limits field(DOL1, "1") field(LNK1, "LGPS:LTUS:3:BLIMITS.VAL") # Update BDES with the BCTRL (slider) value field(DOL2, "LGPS:LTUS:3:BCTRL.VAL") field(LNK2, "LGPS:LTUS:3:BDES PP") field(DOL3, "1") field(LNK3, "LGPS:LTUS:3:IDIRECT.PROC PP") field(DOL4, "1") field(LNK4, "LGPS:LTUS:3:CHECKSTDZLOST.PROC PP") field(DOL5, "LGPS:LTUS:3:BCTRL.VAL") field(LNK5, "LGPS:LTUS:3:BCTRLSUB PP") # Re-enable BACT limits field(DOL6, "0") field(LNK6, "LGPS:LTUS:3:BLIMITS.VAL") } # Convert B-field to Current and output to ISETPT record(sub, "LGPS:LTUS:3:BCTRLSUB") { field(DESC, "Feedback") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "LGPS:LTUS:3:POLYCOEF") field(INPC, "LGPS:LTUS:3:POLYCOEF.A") field(INPD, "LGPS:LTUS:3:POLYCOEF.B") field(INPE, "LGPS:LTUS:3:BDES.DRVH") field(INPF, "LGPS:LTUS:3:BDES.DRVL") field(PREC, "3") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(MDEL, "-1") field(BRSV, "INVALID") field(FLNK, "LGPS:LTUS:3:ISETPT") } record(ao, "LGPS:LTUS:3:BDESPREVTRIM") { field(DESC, "trim bdes for undo") field(DTYP, "Soft Channel") field(DRVH, "50.0") field(DRVL, "0.0") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(PINI, "YES") info(autosaveFields,"VAL") } record(stringin, "LGPS:LTUS:3:MADNAME") { field(DESC, "MAD deck nomenclature") field(PINI, "YES") field(VAL, "B911-3401") } record(ai, "LGPS:LTUS:3: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, "0.0") } record(ao, "LGPS:LTUS:3:BMAX") { field(DESC, "Max B-Field") field(DTYP, "Soft Channel") field(DRVH, "50.0") field(DRVL, "0.0") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(PINI, "YES") field(VAL, "50.0") field(FLNK, "LGPS:LTUS:3:BSTEP") } record(ao, "LGPS:LTUS:3:BMIN") { field(DESC, "Min B-Field") field(DTYP, "Soft Channel") field(DRVH, "50.0") field(DRVL, "0.0") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(PINI, "YES") field(VAL, "0.0") field(FLNK, "LGPS:LTUS:3:BSTEP") } record(ao, "LGPS:LTUS:3:BDESSAVE") { field(DESC, "bdes for save/load") field(DTYP, "Soft Channel") field(DRVH, "50.0") field(DRVL, "0.0") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PINI, "YES") field(PREC, "3") } # This record is processed by LGPS:LTUS:3: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, "LGPS:LTUS:3:BCON") { field(DESC, "Config B-Field ") field(DTYP, "Soft Channel") field(PREC, "3") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(DRVH, "50.0") field(DRVL, "0.0") # 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 , "") field(OMSL, "closed_loop") field(OUT, "LGPS:LTUS:3:B2ICON PP") info(autosaveFields,"VAL") } record(sub, "LGPS:LTUS:3:B2ICON") { field(DESC, "Convert Desired ICon to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "LGPS:LTUS:3:POLYCOEF") field(INPC, "LGPS:LTUS:3:POLYCOEF.A") field(INPD, "LGPS:LTUS:3:POLYCOEF.B") field(PREC, "3") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(MDEL, "-1") field(INPE, "LGPS:LTUS:3:BCON.DRVH") field(INPF, "LGPS:LTUS:3:BCON.DRVL") field(BRSV, "INVALID") field(FLNK, "LGPS:LTUS:3: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, "LGPS:LTUS:3:BSTEP") { field(DESC, "B-Field step size") field(CALC, "(C==3)||(D==3)?0:ABS(A-B)*0.005") field(INPA, "LGPS:LTUS:3:BMAX") field(INPB, "LGPS:LTUS:3:BMIN") field(INPC, "LGPS:LTUS:3:BMIN.SEVR") field(INPD, "LGPS:LTUS:3:BMAX.SEVR") field(EGU, "Volts") 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,"LGPS:LTUS:3:BCTRLDISABLECALC") { field(DESC, "Calc for disabling BCTRL") field(ASG, "Internal") field(CALC, "A?2:1") field(INPA, "LGPS:LTUS:3:ONLINE CP") field(OUT, "LGPS:LTUS:3:BCTRLDISABLEFOUT PP") } record(fanout, "LGPS:LTUS:3:BCTRLDISABLEFOUT") { field(DESC, "Disable BCTRL fanout") field(SELM, "Specified") field(SELL, "LGPS:LTUS:3:BCTRLDISABLECALC") field(LNK1, "LGPS:LTUS:3:BCTRLDISABLE") field(LNK2, "LGPS:LTUS:3:BCTRLENABLE") } record(stringout, "LGPS:LTUS:3:BCTRLDISABLE") { field(DESC, "Disable BCTRL") field(DTYP, "Soft Channel") field(OUT, "LGPS:LTUS:3:BCTRL.ASG") field(VAL, "NOWRITE") field(FLNK, "LGPS:LTUS:3:BCTRLDISV_UPDATE") } record(stringout, "LGPS:LTUS:3:BCTRLENABLE") { field(DESC, "Enable BCTRL") field(DTYP, "Soft Channel") field(OUT, "LGPS:LTUS:3:BCTRL.ASG") field(VAL, "") field(FLNK, "LGPS:LTUS:3:BCTRLDISV_UPDATE") } record(calcout, "LGPS:LTUS:3:BCTRLDISV_UPDATE") { field(DESC, "Calc for updating BCTRL.DISV") field(ASG, "Internal") field(CALC, "A") field(INPA, "LGPS:LTUS:3:ONLINE") field(OUT, "LGPS:LTUS:3: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,"LGPS:LTUS:3:BACT and MON\n are processed via links from \n LGPS:LTUS:3:IACT (device raw value readback 1)\n and\n LGPS:LTUS:3: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 LGPS:LTUS:3:POLYCOEF\nC = First polynomial coefficient (offset if linear)\nD = Second polynomial coefficient (slope if linear)\nE = LGPS:LTUS:3: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,"LGPS:LTUS:3:BDES\n is processed when set by CA users or \n LGPS:LTUS:3: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,"LGPS:LTUS:3: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 LGPS:LTUS:3: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 (LGPS:LTUS:3: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,"LGPS:LTUS:3:B*LIMITS and LGPS:LTUS:3:BLIMITS:\n Calculate alarm and warning limits based on \n deltas from LGPS:LTUS:3: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,"LGPS:LTUS:3: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,"LGPS:LTUS:3: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, "LGPS:LTUS:3: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, "LGPS:LTUS:3:MPSBTOL") { field(DESC, "Absolute mps tol") field(EGU, "Volts") field(PREC, "2") field(CALC, "ABS(A)*0.02") field(INPA, "LGPS:LTUS:3:BMAX") field(PINI, "YES") } # # 21-Aug-2013: K. Luchini # Set channel access security so that users # cannot easily change values. record(ao, "LGPS:LTUS:3:MPSBMAX") { field(DESC, "MPS Max B-field") field(EGU, "Volts") field(PREC, "7") field(DRVH, "50.0") field(DRVL, "0.0") field(PINI, "YES") field(VAL, "50.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "LGPS:LTUS:3:MPSBMIN") { field(DESC, "MPS Min B-field") field(EGU, "Volts") field(PREC, "7") field(DRVH, "50.0") field(DRVL, "0.0") field(PINI, "YES") field(VAL, "0.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "LGPS:LTUS:3:MPSBLLIM") { field(DESC, "MPS Low Limit B-field") field(EGU, "Volts") field(PREC, "7") field(DRVH, "50.0") field(DRVL, "0.0") field(PINI, "YES") field(VAL, "0.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "LGPS:LTUS:3:MPSBLLIM2") { field(DESC, "MPS Low Limit #2 B-field") field(EGU, "Volts") field(PREC, "7") field(DRVH, "50.0") field(DRVL, "0.0") field(PINI, "YES") field(VAL, "0.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } # Set the default to Std record(mbbo, "LGPS:LTUS:3: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, "LGPS:LTUS:3:MPSLIMITS.E PP") } record(aSub, "LGPS:LTUS:3: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, "LGPS:LTUS:3:MPS.RVAL") field(INPB, "LGPS:LTUS:3:BADIFF") field(INPC, "LGPS:LTUS:3:BDELTAS.N") field(INPD, "LGPS:LTUS:3:BACT") field(INPE, "LGPS:LTUS:3:MPSBITMASK.RVAL") field(INPF, "LGPS:LTUS:3:MPSBLLIM") field(INPG, "LGPS:LTUS:3:MPSBMIN") field(INPH, "LGPS:LTUS:3:MPSBMAX") field(INPI, "LGPS:LTUS:3: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, "LGPS:LTUS:3:INTOL.RVAL PP") field(OUTB, "LGPS:LTUS:3:INTOL_BMIN.RVAL PP") field(OUTC, "LGPS:LTUS:3:INTOL_BRANGE.RVAL PP") field(OUTD, "LGPS:LTUS:3: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, "LGPS:LTUS:3:INTOL") { field(DESC, "BACT within MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "LGPS:LTUS:3:MPSLIMITS.VALA") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "LGPS:LTUS:3:INTOL_BMIN") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "LGPS:LTUS:3:MPSLIMITS.VALB") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "LGPS:LTUS:3:INTOL_BMIN2") { field(DESC, "MPS tol #2") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "LGPS:LTUS:3:MPSLIMITS.VALD") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "LGPS:LTUS:3:INTOL_BRANGE") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "LGPS:LTUS:3: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, "LGPS:LTUS:3:CHCKITOL") { field(DESC, "Absolute Check I Tolerance") field(EGU, "A") field(FLNK, "LGPS:LTUS:3:TRIMITOL") field(CALC, "ABS(A*B)") field(INPA, "LGPS:LTUS:3:CHCKBTOL") field(INPB, "LGPS:LTUS:3:POLYCOEF.B") field(PREC, "9") } record(calc, "LGPS:LTUS:3:TRIMBTOL") { field(EGU, "Volts") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(DESC, "Absolute Trim Tolerance") field(CALC, "ABS(A)/2") field(INPA, "LGPS:LTUS:3:CHCKBTOL") field(FLNK, "LGPS:LTUS:3:CHCKITOL") } record(calc, "LGPS:LTUS:3:CHCKBTOL") { field(DESC, "Check absolute tolerance") field(EGU, "A") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(FLNK, "LGPS:LTUS:3:TRIMBTOL") field(CALC, "MAX(ABS(A),ABS(C))*(B/1000000)") field(INPA, "LGPS:LTUS:3:BDES.HOPR") field(INPB, "LGPS:LTUS:3:STABILITY") field(INPC, "LGPS:LTUS:3:BDES.LOPR") } record(longout, "LGPS:LTUS:3:STABILITY") { field(DESC, "Long Term Stability") field(PINI, "YES") field(VAL, "15000") field(EGU, "ppm") field(DRVH, "20000") field(DRVL, "100") field(HOPR, "20000") field(LOPR, "100") field(FLNK, "LGPS:LTUS:3:CHCKBTOL") } record(calc, "LGPS:LTUS:3:TRIMITOL") { field(DESC, "Absolute Trim I Tolerance") field(EGU, "Volts") field(CALC, "ABS(A*B)") field(INPA, "LGPS:LTUS:3:POLYCOEF.B") field(INPB, "LGPS:LTUS:3:TRIMBTOL") field(PREC, "9") } record(ai, "LGPS:LTUS:3:TRIMBTOLR") { field(DESC, "Relative trim tol") field(PREC, "4") field(EGU, "%") field(HOPR, "1.0") field(LOPR, "0.0") field(PINI, "YES") } record(ai, "LGPS:LTUS:3: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, "LGPS:LTUS:3:FBCKFCOM") { field(ZNAM, "CA") field(ONAM, "FCOM") field(DESC, "CA Mode") field(PINI, "YES") field(SDIS, "0") } record(bo, "LGPS:LTUS:3:PAU") { field(ZNAM, "NotConfigured") field(ONAM, "Configured") field(DESC, "PAU Present") field(PINI, "YES") field(SDIS, "0") field(FLNK, "LGPS:LTUS:3:PAUGO") } record(fanout, "LGPS:LTUS:3:PAUGO") { field(DESC, "PAU control") field(LNK1, "LGPS:LTUS:3:PAUSTOP") field(LNK2, "LGPS:LTUS:3: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, "LGPS:LTUS:3:PAUSTART") { field(DESC, "Setup for PAU On") field(SDIS, "LGPS:LTUS:3: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, "LGPS:LTUS:3:PAUSTOP") { field(DESC, "Setup for PAU Off") field(SDIS, "LGPS:LTUS:3: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, "LGPS:LTUS:3:MCORDEVNAME") { field(DESC, "PS device name") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, "PS:LTUS:3:") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "LGPS:LTUS:3: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, "LGPS:LTUS:3:PSTYPE.RVAL") field(INPC, "LGPS:LTUS:3:TURNEDOFF.RVAL") field(INPD, "LGPS:LTUS:3:CONFIG.RVAL") field(INPE, "LGPS:LTUS:3:PSCATEGORY.RVAL") field(INPF, "LGPS:LTUS:3:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "LGPS:LTUS:3:AUTOCTRL.RVAL") field(INPJ, "LGPS:LTUS:3:OUTOFSERVICE.RVAL") field(INPL, "LGPS:LTUS:3:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "LGPS:LTUS:3:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "LGPS:LTUS:3:PAU") field(INPP, "LGPS:LTUS:3:CALBDISABLE.RVAL") field(INPQ, "LGPS:LTUS:3:PTRBDISABLE.RVAL") field(INPR, "LGPS:LTUS:3:TRIMDISABLE.RVAL") field(INPS, "LGPS:LTUS:3:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "LGPS:LTUS:3:FBCK") field(INPU, "LGPS:LTUS:3:TRIMTYPE.RVAL") field(INPV, "LGPS:LTUS:3:STDZDIRECT.RVAL") field(INPW, "LGPS:LTUS:3:DEGAUSENABLE.RVAL") field(FLNK, "LGPS:LTUS:3:HSTA") } record(longin, "LGPS:LTUS:3:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "LGPS:LTUS:3:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "LGPS:LTUS:3: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, "LGPS:LTUS:3: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, "LGPS:LTUS:3: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, "LGPS:LTUS:3: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, "LGPS:LTUS:3: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, "LGPS:LTUS:3: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 LGPS:LTUS:3:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses LGPS:LTUS:3:FBCK. # This PV should be replaced by LGPS:LTUS:3: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, "LGPS:LTUS:3: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, "LGPS:LTUS:3: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, "LGPS:LTUS:3: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, "") field(OMSL, "supervisory") field(FLNK, "LGPS:LTUS:3:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"LGPS:LTUS:3:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "LGPS:LTUS:3:OUTOFSERVICE NPP NMS") field(OUT, "LGPS:LTUS:3:ONLINE PP") } record(bo, "LGPS:LTUS:3:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "LGPS:LTUS:3: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, "1") } record(bo, "LGPS:LTUS:3: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, "1") } record(bo, "LGPS:LTUS:3: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, "1") } # This PV is modified by :STATSUB.U record(bo, "LGPS:LTUS:3: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, "LGPS:LTUS:3: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, "LGPS:LTUS:3: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, "LGPS:LTUS:3: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, "LGPS:LTUS:3: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, "1") field(ASG, "NOWRITE") } record(mbbo, "LGPS:LTUS:3: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, "2") field(ASG, "NOWRITE") } record(mbbo, "LGPS:LTUS:3: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, "3") field(ASG, "NOWRITE") } record(mbbo, "LGPS:LTUS:3: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, "0") field(ASG, "NOWRITE") field(FLNK, "LGPS:LTUS:3:TRIMTYPE") } record(stringout, "LGPS:LTUS:3:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "LGPS:LTUS:3:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "LGPS:LTUS:3:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "LGPS:LTUS:3:STATE.RVAL") field(INPB, "LGPS:LTUS:3:INTLKSUMY.RVAL") field(OUT, "LGPS:LTUS:3:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "LGPS:LTUS:3: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, "LGPS:LTUS:3:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "LGPS:LTUS:3:STATE.RVAL") field(INPB, "LGPS:LTUS:3:INTLKSUMY.RVAL") field(OUT, "LGPS:LTUS:3:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "LGPS:LTUS:3:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "LGPS:LTUS:3:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "LGPS:LTUS:3: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, "LGPS:LTUS:3: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, "LGPS:LTUS:3: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, "LGPS:LTUS:3: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,"LGPS:LTUS:3: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("LGPS:LTUS:3:TURNEDOFF",3140,1907,0,1,"LGPS:LTUS:3:TURNEDOFF") #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "LGPS:LTUS:3:STATSUB") { field(DESC, "Build STATus ") field(INAM, "mgntInit") field(SNAM, "mgntSlcStat") field(INPA, "LGPS:LTUS:3:BACT.STAT") field(INPB, "LGPS:LTUS:3:BDES.STAT") field(INPC, "LGPS:LTUS:3:IRIPL.STAT") field(INPD, "PS:LTUS:3:ISETPT.STAT") field(INPE, "PS:LTUS:3:IACT.STAT") # 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, "LGPS:LTUS:3:BACT.SEVR") field(INPH, "LGPS:LTUS:3:BDES.SEVR") field(INPI, "LGPS:LTUS:3:IRIPL.SEVR") field(INPJ, "PS:LTUS:3:ISETPT.SEVR") field(INPK, "PS:LTUS:3:IACT.SEVR") # # 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, "LGPS:LTUS:3:STATE.RVAL") field(INPN, "LGPS:LTUS:3:STDZOK") field(INPO, "LGPS:LTUS:3:CALBOK") field(INPP, "LGPS:LTUS:3:OUTOFSERVICE.RVAL") field(INPQ, "LGPS:LTUS:3:CONFIG.RVAL") field(INPR, "LGPS:LTUS:3:HSTA") field(INPS, "LGPS:LTUS:3:CTRL.RVAL") field(INPT, "LGPS:LTUS:3:DEGAUSOK") field(INPV, "LGPS:LTUS:3: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, "LGPS:LTUS:3:STAT") } record(longout, "LGPS:LTUS:3:STAT") { field(DESC, "STAT sent to SLC") field(SCAN, "Passive") field(FLNK, "LGPS:LTUS:3:STATCTRLSUB") field(DOL, "LGPS:LTUS:3:STATSUB.VAL") field(OMSL, "closed_loop") } record(sSub, "LGPS:LTUS:3:STATCTRLSUB") { field(DESC, "Decode SLC STAT into mbbo") field(INAM, "mgntInit") field(SNAM, "mgntStatDecode") field(INPA, "LGPS:LTUS:3:STAT") field(INPB, "LGPS:LTUS:3:HSTA") field(INPD, "LGPS:LTUS:3:ONOFFCTRL.RVAL") field(FLNK, "LGPS:LTUS:3:STATMSG") } record(mbbo, "LGPS:LTUS:3: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, "LGPS:LTUS:3:UNAVAILGO") field(DOL, "LGPS:LTUS:3:STATCTRLSUB.W") } record(seq, "LGPS:LTUS:3:UNAVAILGO") { field(DESC, "Process UNAVAIL") field(DOL1, "LGPS:LTUS:3:STATSUB.U") field(LNK1, "LGPS:LTUS:3:UNAVAIL PP") } record(stringout, "LGPS:LTUS:3:SNLSTATMSG") { field(DTYP, "Soft Channel") } #! TextBox(TB0,820,1000,1200,1220,0,"Dialog",12,1,16777215,"LGPS:LTUS:3:STATUSSUB - future\nOverall device status - takes input from action snls, record sevrs, master snl(s) and outputs final status\n\nInputs:\nA - LGPS:LTUS:3:CTRLSTATUS - snl status\nB - MGNT:CTRLSTATUS - master list status\nC\nD - LGPS:LTUS:3: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,"LGPS:LTUS:3STATSUB\nformat control bo's into slc STAT\n\nInputs:\nA - LGPS:LTUS:3:STATUS\nC - LGPS:LTUS:3:ON\nD - LGPS:LTUS:3:STDZOK\nE - LGPS:LTUS:3:CALBOK\nF - LGPS:LTUS:3:BACTDRIFT (future)\nG -\nH- LGPS:LTUS:3:DACSTATUS\nI -LGPS:LTUS:3:ADCSTATUS\nJ - LGPS:LTUS:3:BACTSTATUS\nK - LGPS:LTUS:3:BDESSTATUS\nL - LGPS:LTUS:3:RIPLSTATUS\n\nOutput:\nP - LGPS:LTUS:3: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, "LGPS:LTUS:3: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, "LGPS:LTUS:3: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, "LGPS:LTUS:3: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, "LGPS:LTUS:3: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.6 #! DBDSTART #! DBD("../../../../dbd/mgntSoft.dbd") #! DBDEND record(stringout, "LGPS:LTUS:3:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "LGPS:LTUS:3:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "LGPS:LTUS:3:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "LGPS:LTUS:3:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "LGPS:LTUS:3:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "LGPS:LTUS:3:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "1") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "LGPS:LTUS:3: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, "LGPS:LTUS:3:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "LGPS:LTUS:3:TRIMTYPE.RVAL") field(INPB, "LGPS:LTUS:3:CONFIG.RVAL") field(OUT, "LGPS:LTUS:3:TRIMMAXNUM PP") } record(longout, "LGPS:LTUS:3: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, "LGPS:LTUS:3:TRIMRAMPRATE") { field(DESC, "Trim Ramp rate ") field(PINI, "YES") field(ASG, "IOC_MAINT") field(PREC, "3") field(EGU, "Volts/sec") field(HOPR, "20.0") field(DRVH, "20.0") field(DRVL, "0.1") field(LOPR, "0.5") # field(DOL, "") field(OMSL, "supervisory") field(VAL, "10") field(OUT, "LGPS:LTUS:3:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "LGPS:LTUS:3: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, "") field(OMSL, "supervisory") field(VAL, "10") } record(bo, "LGPS:LTUS:3: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, "LGPS:LTUS:3: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, "LGPS:LTUS:3:TRIMSTEPMIN") { field(DESC, "Min step in current") field(DTYP, "Soft Channel") # field(DOL, "") field(PREC, "7") field(EGUF, "10") field(EGUL, "0") field(EGU, "Volts") field(HOPR, "10") field(LOPR, "0") field(VAL, "5.0") } record(bo, "LGPS:LTUS:3:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "0") } record(ao, "LGPS:LTUS:3: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, "LGPS:LTUS:3:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "LGPS:LTUS:3: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, "LGPS:LTUS:3: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, "LGPS:LTUS:3:IMOVE") field(INPB, "LGPS:LTUS:3:IACT") field(INPC, "LGPS:LTUS:3:IRAMPRATE") field(INPD, "1.0") field(INPE, "LGPS:LTUS:3:TRIMDLYPCT") field(INPF, "LGPS:LTUS:3:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "LGPS:LTUS:3:RAMPTIME_LEFT PP") } record(longout, "LGPS:LTUS:3:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "LGPS:LTUS:3:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "LGPS:LTUS:3:RAMPDONE_CALC") } record(calc, "LGPS:LTUS:3:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "LGPS:LTUS:3:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "LGPS:LTUS:3:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "LGPS:LTUS:3: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, "LGPS:LTUS:3:RAMPTIME_LEFT") field(OUT, "LGPS:LTUS:3:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "LGPS:LTUS:3:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "LGPS:LTUS:3:RAMPTIME_LEFT NMS") field(OUT, "LGPS:LTUS:3:RAMPDONE PP") } record(bo, "LGPS:LTUS:3:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "LGPS:LTUS:3:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "LGPS:LTUS:3: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, "LGPS:LTUS:3: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(ai, "LGPS:LTUS:3: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, "LGPS:LTUS:3:MPSBTOL") { field(DESC, "Absolute mps tol") field(EGU, "Volts") field(PREC, "2") field(CALC, "ABS(A)*0.02") field(INPA, "LGPS:LTUS:3:BMAX") field(PINI, "YES") } # # 21-Aug-2013: K. Luchini # Set channel access security so that users # cannot easily change values. record(ao, "LGPS:LTUS:3:MPSBMAX") { field(DESC, "MPS Max B-field") field(EGU, "Volts") field(PREC, "7") field(DRVH, "50.0") field(DRVL, "0.0") field(PINI, "YES") field(VAL, "50.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "LGPS:LTUS:3:MPSBMIN") { field(DESC, "MPS Min B-field") field(EGU, "Volts") field(PREC, "7") field(DRVH, "50.0") field(DRVL, "0.0") field(PINI, "YES") field(VAL, "0.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "LGPS:LTUS:3:MPSBLLIM") { field(DESC, "MPS Low Limit B-field") field(EGU, "Volts") field(PREC, "7") field(DRVH, "50.0") field(DRVL, "0.0") field(PINI, "YES") field(VAL, "0.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "LGPS:LTUS:3:MPSBLLIM2") { field(DESC, "MPS Low Limit #2 B-field") field(EGU, "Volts") field(PREC, "7") field(DRVH, "50.0") field(DRVL, "0.0") field(PINI, "YES") field(VAL, "0.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } # Set the default to Std record(mbbo, "LGPS:LTUS:3: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, "LGPS:LTUS:3:MPSLIMITS.E PP") } record(aSub, "LGPS:LTUS:3: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, "LGPS:LTUS:3:MPS.RVAL") field(INPB, "LGPS:LTUS:3:BADIFF") field(INPC, "LGPS:LTUS:3:BDELTAS.N") field(INPD, "LGPS:LTUS:3:BACT") field(INPE, "LGPS:LTUS:3:MPSBITMASK.RVAL") field(INPF, "LGPS:LTUS:3:MPSBLLIM") field(INPG, "LGPS:LTUS:3:MPSBMIN") field(INPH, "LGPS:LTUS:3:MPSBMAX") field(INPI, "LGPS:LTUS:3: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, "LGPS:LTUS:3:INTOL.RVAL PP") field(OUTB, "LGPS:LTUS:3:INTOL_BMIN.RVAL PP") field(OUTC, "LGPS:LTUS:3:INTOL_BRANGE.RVAL PP") field(OUTD, "LGPS:LTUS:3: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, "LGPS:LTUS:3:INTOL") { field(DESC, "BACT within MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "LGPS:LTUS:3:MPSLIMITS.VALA") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "LGPS:LTUS:3:INTOL_BMIN") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "LGPS:LTUS:3:MPSLIMITS.VALB") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "LGPS:LTUS:3:INTOL_BMIN2") { field(DESC, "MPS tol #2") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "LGPS:LTUS:3:MPSLIMITS.VALD") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "LGPS:LTUS:3:INTOL_BRANGE") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "LGPS:LTUS:3: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, "LGPS:LTUS:3:CHCKITOL") { field(DESC, "Absolute Check I Tolerance") field(EGU, "A") field(FLNK, "LGPS:LTUS:3:TRIMITOL") field(CALC, "ABS(A*B)") field(INPA, "LGPS:LTUS:3:CHCKBTOL") field(INPB, "LGPS:LTUS:3:POLYCOEF.B") field(PREC, "9") } record(calc, "LGPS:LTUS:3:TRIMBTOL") { field(EGU, "Volts") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(DESC, "Absolute Trim Tolerance") field(CALC, "ABS(A)/2") field(INPA, "LGPS:LTUS:3:CHCKBTOL") field(FLNK, "LGPS:LTUS:3:CHCKITOL") } record(calc, "LGPS:LTUS:3:CHCKBTOL") { field(DESC, "Check absolute tolerance") field(EGU, "A") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(FLNK, "LGPS:LTUS:3:TRIMBTOL") field(CALC, "MAX(ABS(A),ABS(C))*(B/1000000)") field(INPA, "LGPS:LTUS:3:BDES.HOPR") field(INPB, "LGPS:LTUS:3:STABILITY") field(INPC, "LGPS:LTUS:3:BDES.LOPR") } record(longout, "LGPS:LTUS:3:STABILITY") { field(DESC, "Long Term Stability") field(PINI, "YES") field(VAL, "1000") field(EGU, "ppm") field(DRVH, "20000") field(DRVL, "100") field(HOPR, "20000") field(LOPR, "100") field(FLNK, "LGPS:LTUS:3:CHCKBTOL") } record(calc, "LGPS:LTUS:3:TRIMITOL") { field(DESC, "Absolute Trim I Tolerance") field(EGU, "Volts") field(CALC, "ABS(A*B)") field(INPA, "LGPS:LTUS:3:POLYCOEF.B") field(INPB, "LGPS:LTUS:3:TRIMBTOL") field(PREC, "9") } record(ai, "LGPS:LTUS:3:TRIMBTOLR") { field(DESC, "Relative trim tol") field(PREC, "4") field(EGU, "%") field(HOPR, "1.0") field(LOPR, "0.0") field(PINI, "YES") } record(ai, "LGPS:LTUS:3: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.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "LGPS:LTUS:3: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, "LGPS:LTUS:3:PSTYPE.RVAL") field(INPC, "LGPS:LTUS:3:TURNEDOFF.RVAL") field(INPD, "LGPS:LTUS:3:CONFIG.RVAL") field(INPE, "LGPS:LTUS:3:PSCATEGORY.RVAL") field(INPF, "LGPS:LTUS:3:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "LGPS:LTUS:3:AUTOCTRL.RVAL") field(INPJ, "LGPS:LTUS:3:OUTOFSERVICE.RVAL") field(INPL, "LGPS:LTUS:3:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "LGPS:LTUS:3:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "LGPS:LTUS:3:PAU") field(INPP, "LGPS:LTUS:3:CALBDISABLE.RVAL") field(INPQ, "LGPS:LTUS:3:PTRBDISABLE.RVAL") field(INPR, "LGPS:LTUS:3:TRIMDISABLE.RVAL") field(INPS, "LGPS:LTUS:3:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "LGPS:LTUS:3:FBCK") field(INPU, "LGPS:LTUS:3:TRIMTYPE.RVAL") field(INPV, "LGPS:LTUS:3:STDZDIRECT.RVAL") field(INPW, "LGPS:LTUS:3:DEGAUSENABLE.RVAL") field(FLNK, "LGPS:LTUS:3:HSTA") } record(longin, "LGPS:LTUS:3:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "LGPS:LTUS:3:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "LGPS:LTUS:3: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, "LGPS:LTUS:3: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, "LGPS:LTUS:3: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, "LGPS:LTUS:3: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, "LGPS:LTUS:3: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, "LGPS:LTUS:3: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 LGPS:LTUS:3:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses LGPS:LTUS:3:FBCK. # This PV should be replaced by LGPS:LTUS:3: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, "LGPS:LTUS:3: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, "LGPS:LTUS:3: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, "LGPS:LTUS:3: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, "") field(OMSL, "supervisory") field(FLNK, "LGPS:LTUS:3:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"LGPS:LTUS:3:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "LGPS:LTUS:3:OUTOFSERVICE NPP NMS") field(OUT, "LGPS:LTUS:3:ONLINE PP") } record(bo, "LGPS:LTUS:3:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "PS:LTUS:3:CommLink PP") } record(bo, "LGPS:LTUS:3: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, "1") } record(bo, "LGPS:LTUS:3: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, "1") } record(bo, "LGPS:LTUS:3: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, "1") } # This PV is modified by :STATSUB.U record(bo, "LGPS:LTUS:3: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, "LGPS:LTUS:3: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, "LGPS:LTUS:3: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, "LGPS:LTUS:3: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, "LGPS:LTUS:3: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, "1") field(ASG, "NOWRITE") } record(mbbo, "LGPS:LTUS:3: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, "2") field(ASG, "NOWRITE") } record(mbbo, "LGPS:LTUS:3: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, "5") field(ASG, "NOWRITE") } record(mbbo, "LGPS:LTUS:3: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, "0") field(ASG, "NOWRITE") field(FLNK, "LGPS:LTUS:3:TRIMTYPE") } record(stringout, "LGPS:LTUS:3:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "LGPS:LTUS:3:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "LGPS:LTUS:3:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "LGPS:LTUS:3:STATE.RVAL") field(INPB, "LGPS:LTUS:3:INTLKSUMY.RVAL") field(OUT, "LGPS:LTUS:3:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "LGPS:LTUS:3: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, "LGPS:LTUS:3:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "LGPS:LTUS:3:STATE.RVAL") field(INPB, "LGPS:LTUS:3:INTLKSUMY.RVAL") field(OUT, "LGPS:LTUS:3:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "LGPS:LTUS:3:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "LGPS:LTUS:3:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "LGPS:LTUS:3: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, "LGPS:LTUS:3: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, "LGPS:LTUS:3: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, "LGPS:LTUS:3: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,"LGPS:LTUS:3: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("LGPS:LTUS:3:TURNEDOFF",3140,1907,0,1,"LGPS:LTUS:3:TURNEDOFF") #! 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, "LGPS:LTUS:4:IACT") { field(DESC, "Current") field(INP, "PS:LTUS:4:IACT") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "LGPS:LTUS:4:BACT") info(autosaveFields,"HYST") } record(bi, "LGPS:LTUS:4:STATE") { field(DESC, "PS On/Off Status") field(DTYP, "Raw Soft Channel") field(INP, "PS:LTUS:4:STATE CP MS") field(ZSV, "MAJOR") field(ZNAM, "OFF") field(ONAM, "ON") } record(ao, "LGPS:LTUS:4:IDES") { field(DESC, "Desired Current") field(PREC, "3") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(MDEL, "-1") field(HIHI, "50.0") field(LOLO, "0.0") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "LGPS:LTUS:4:BDELTAS") field(DRVH, "50.0") field(DRVL, "0.0") field(DOL, "LGPS:LTUS:4: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, "LGPS:LTUS:4:ICTRL PP") } # This record is processed by LGPS:LTUS:4:ICON") # Note: we are not setting alarms here. record(ao, "LGPS:LTUS:4:ICON") { field(DESC, "Config I") field(DTYP, "Soft Channel") field(PREC, "3") field(HOPR, "50.0") field(LOPR, "0.0") field(DRVH, "50.0") field(DRVL, "0.0") field(DOL, "LGPS:LTUS:4:B2ICON.K") field(OMSL, "closed_loop") info(autosaveFields,"VAL") } record(ao, "LGPS:LTUS:4:INOM") { field(DESC, "Nominal Current") field(DOL, "LGPS:LTUS:4:BNOM.K") field(OMSL, "closed_loop") field(PREC, "3") field(EGU, "Volts") field(DRVH, "50.0") field(DRVL, "0.0") field(HOPR, "50.0") field(LOPR, "0.0") } record(ao, "LGPS:LTUS:4:ICTRL") { field(DESC, "Set Current") field(PREC, "3") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(DRVH, "50.0") field(DRVL, "0.0") field(MDEL, "-1") field(FLNK, "LGPS:LTUS:4:ICTRLGO") field(OMSL, "supervisory") info(autosavefields,"VAL") } record(seq, "LGPS:LTUS:4:ICTRLGO") { field(DESC, "Process Current Setpoint") field(PREC, "3") # Set ISETPT to supervisory field(DOL1, "0") field(LNK1, "LGPS:LTUS:4:ISETPT.OMSL") field(DOL2, "LGPS:LTUS:4:ICTRL") field(LNK2, "LGPS:LTUS:4:ISETPT PP") # Set ISETPT to closed loop - get data from BCTRLSUB.K field(DOL3, "1") field(LNK3, "LGPS:LTUS:4:ISETPT.OMSL") } record(ao, "LGPS:LTUS:4:IMAX") { field(DESC, "Max I") field(DTYP, "Soft Channel") field(DRVH, "50.0") field(DRVL, "0.0") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(PINI, "YES") field(VAL, "50.0") field(FLNK, "LGPS:LTUS:4:IMIN") } record(ao, "LGPS:LTUS:4:IMIN") { field(DESC, "Min I") field(DTYP, "Soft Channel") field(DRVH, "50.0") field(DRVL, "0.0") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(VAL, "0.0") field(FLNK, "LGPS:LTUS:4:IRANGE") } record(sel, "LGPS:LTUS:4:IACTPREVOK") { field(DESC, "Last Good Current") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(NVL, "LGPS:LTUS:4:BACT.SEVR") field(INPA, "LGPS:LTUS:4:IACT NPP MS") field(INPB, "LGPS:LTUS:4:IACTPREVOK NPP MS") field(INPC, "LGPS:LTUS:4:IACTPREVOK NPP MS") field(INPD, "LGPS:LTUS:4:IACTPREVOK NPP MS") } record(sub, "LGPS:LTUS:4:IACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "LGPS:LTUS:4:IDES") field(INPB, "LGPS:LTUS:4:ISETPT.DRVH") field(INPC, "LGPS:LTUS:4:ISETPT.DRVL") field(INPD, "LGPS:LTUS:4:IDELTAS.I") field(INPE, "LGPS:LTUS:4:IDELTAS.J") field(INPG, "LGPS:LTUS:4:STATE") field(INPH, "LGPS:LTUS:4:HSTA") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(sub, "LGPS:LTUS:4:IMONLIMITS") { field(DESC, "Aux Current Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "LGPS:LTUS:4:IDES") field(INPB, "LGPS:LTUS:4:ISETPT.DRVH") field(INPC, "LGPS:LTUS:4:ISETPT.DRVL") field(INPD, "LGPS:LTUS:4:IDELTAS.K") field(INPE, "LGPS:LTUS:4:IDELTAS.L") field(INPG, "LGPS:LTUS:4:STATE") field(INPH, "LGPS:LTUS:4:HSTA") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(seq, "LGPS:LTUS:4:ILIMITS") { field(DESC, "Set ACT and MON Limits") field(PREC, "3") field(DOL1, "LGPS:LTUS:4:BLIMITS") field(LNK1, "LGPS:LTUS:4:IACTLIMITS.F PP") field(DOL2, "LGPS:LTUS:4:IACTLIMITS.I") field(LNK2, "LGPS:LTUS:4:IACT.HIGH") field(DOL3, "LGPS:LTUS:4:IACTLIMITS.J") field(LNK3, "LGPS:LTUS:4:IACT.LOW") field(DOL4, "LGPS:LTUS:4:IACTLIMITS.K") field(LNK4, "LGPS:LTUS:4:IACT.HIHI") field(DOL5, "LGPS:LTUS:4:IACTLIMITS.L") field(LNK5, "LGPS:LTUS:4:IACT.LOLO") field(DOL6, "LGPS:LTUS:4:BLIMITS") field(LNK6, "LGPS:LTUS:4:IMONLIMITS.F PP") field(DOL7, "LGPS:LTUS:4:IMONLIMITS.I") field(LNK7, "LGPS:LTUS:4:IMON.HIGH") field(DOL8, "LGPS:LTUS:4:IMONLIMITS.J") field(LNK8, "LGPS:LTUS:4:IMON.LOW") field(DOL9, "LGPS:LTUS:4:IMONLIMITS.K") field(LNK9, "LGPS:LTUS:4:IMON.HIHI") field(DOLA, "LGPS:LTUS:4:IMONLIMITS.L") field(LNKA, "LGPS:LTUS:4: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, "LGPS:LTUS:4:IDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntRawDeltas") field(INPD, "LGPS:LTUS:4:TRIMBTOL") field(INPE, "LGPS:LTUS:4:CHCKBTOL") field(INPF, "LGPS:LTUS:4:BDELTAS.K") field(INPG, "LGPS:LTUS:4:BDELTAS.L") field(INPH, "LGPS:LTUS:4:B2IDES.L") field(EGU, "Volts") field(HOPR, "1") field(PREC, "3") field(BRSV, "INVALID") # # Used to calcualte standardize tolerance # which is returned in the VAL field. # field(INPB, "LGPS:LTUS:4:STDZITOLR") field(INPC, "LGPS:LTUS:4:STDZITOL") field(FLNK, "") } # All ps controllers with on/off control will set the macro ONOF # as follows: # # ONOF = PS:LTUS:4: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, "LGPS:LTUS:4:STATESETPT") { field(DESC, "PS On/Off") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFF") field(ONAM, "ON") field(OUT, "PS:LTUS:4:STATESETPT PP") 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:LTUS:4:RESET PP # record(bo, "LGPS:LTUS:4:RESET") { field(DESC, "Interlock Latch Reset") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFF") field(ONAM, "ON") field(HIGH, "1.0") field(OUT, "PS:LTUS:4:RESET PP") } record(bo, "LGPS:LTUS:4:RAMPSTATE") { field(DESC, "PS Ramp Status") field(DTYP, "Soft Channel") field(DOL, "PS:LTUS:4:RAMPSTATE") 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, "LGPS:LTUS:4: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, "Volts/sec") field(PREC, "3") # Set default to trim ramp rate on boot # but need to change for degauss function. field(DOL, "LGPS:LTUS:4:TRIMRAMPRATE") field(OUT, "") field(FLNK, "LGPS:LTUS:4:STDZDLY") } record(ao, "LGPS:LTUS:4:ISETPT") { field(DESC, "Current Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(DRVH, "50.0") field(DRVL, "0.0") field(MDEL, "-1") field(OUT, "PS:LTUS:4:ISETPT PP") field(DOL, "LGPS:LTUS:4: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, "LGPS:LTUS:4:IMON") { field(DESC, "Aux Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(INP, "") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "LGPS:LTUS:4:BMON") } record(ao, "LGPS:LTUS:4:IRIPL") { field(DESC, "Ripple Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(DOL, "") field(OMSL, "closed_loop") field(EGU, "Volts") field(DRVH, "1.0") field(HOPR, "1.0") field(PREC, "3") field(FLNK, "LGPS:LTUS:4:IRIPLOK") } record(sub, "LGPS:LTUS:4:IRIPLOK") { field(DESC, "Ripple Current Status") field(INAM, "mgntInit") field(SNAM, "mgntRiplOK") field(INPA, "LGPS:LTUS:4:IRIPL.VAL") field(INPB, "LGPS:LTUS:4: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, "LGPS:LTUS:4:R") { field(DESC, "Resistance") field(EGU, "Ohms") field(PREC, "4") field(PINI, "YES") field(DOL, "") 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, "LGPS:LTUS:4:IGND") { field(DESC, "Ground Current") field(EGU, "Volts") field(PREC, "6") field(PINI, "YES") field(DOL, "") field(OMSL, "closed_loop") } record(bi, "LGPS:LTUS:4:INTLKSUMY") { field(DESC, "Interlock Summary") field(INP, "PS:LTUS:4:INTLKSUMY CP MS") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(ZNAM, "OK") field(ONAM, "FAULT") field(PINI, "NO") } record(mbbo, "LGPS:LTUS:4: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:LTUS:4:COOLING") field(OMSL, "closed_loop") } # The following PV is processed by :BACTFO # which is processed by :BACT record(fanout, "LGPS:LTUS:4:IACTFO") { field(DESC, "IACT processing") field(SELM, "All") field(LNK1, "LGPS:LTUS:4:IACTPREVOK") field(LNK2, "LGPS:LTUS:4:IDIFF") field(LNK3, "LGPS:LTUS:4:IADIFF") field(LNK4, "LGPS:LTUS:4:IRATIO") field(LNK5, "LGPS:LTUS:4:IDIRECT") field(LNK6, "LGPS:LTUS:4:IACTPOL_CHECK") } record(calc, "LGPS:LTUS:4:IDIFF") { field(DESC, "IDES-IACT") field(CALC, "A-B") field(INPA, "LGPS:LTUS:4:IDES") field(INPB, "LGPS:LTUS:4:IACT") field(EGU, "Volts") field(PREC, "9") field(HOPR, "50.0") field(LOPR, "0.0") } record(calc, "LGPS:LTUS:4:IADIFF") { field(DESC, "Absolute IDES-IACT") field(CALC, "A<0?ABS(A):A") field(INPA, "LGPS:LTUS:4:IDIFF") field(PREC, "9") } record(calc, "LGPS:LTUS:4:IRATIO") { field(DESC, "IDES-IACT/IMAX") field(CALC, "B?A/B:0") field(INPA, "LGPS:LTUS:4:IDIFF") field(INPB, "LGPS:LTUS:4:IDES.DRVH") field(PREC, "9") } record(calcout, "LGPS:LTUS:4:IRANGE") { field(DESC, "Current Range") field(PINI, "YES") field(CALC, "ABS(A-B)") field(INPA, "LGPS:LTUS:4:IMIN") field(INPB, "LGPS:LTUS:4: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, "LGPS:LTUS:4: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, "LGPS:LTUS:4:IACT") field(FLNK, "LGPS:LTUS:4:IACTPOL") } record(bo, "LGPS:LTUS:4:IACTPOL") { field(DESC, "Actual I Polarity") field(DTYP, "Raw Soft Channel") field(DOL, "LGPS:LTUS:4: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,"LGPS:LTUS:4:I*LIMITS:\n Calculate alarm and warning limits based on \n deltas from LGPS:LTUS:4:IDELTAS and the\n LGPS:LTUS:4: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,"LGPS:LTUS:4:IACT: \n Get copy of LGPS:LTUS:4:I. \n",null) #! TextBox(TB12,1280,3100,1760,3200,0,"Dialog",12,1,16777215,"LGPS:LTUS:4: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,"LGPS:LTUS:4:IDES:\n Contains raw value calculated by \nLGPS:LTUS:4: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 \nLGPS:LTUS:4:BDELTAS.\n",null) #! TextBox(TB10,56,1940,316,2340,0,"Dialog",12,1,16777215,"LGPS:LTUS:4: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 LGPS:LTUS:4: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 LGPS:LTUS:4: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,"LGPS:LTUS:4:ISETPT:\n Sets the hardware. When fast feedback is set on, this record is\n set to closed loop mode by LGPS:LTUS:4:FBCKSTART sequence. When \n the loop is closed, this record takes input calculated by \n BFBCK only. When fast feedback is set off, LGPS:LTUS:4:FBCKSTOP \n will set it back to supervisory so that the value can be set by \n LGPS:LTUS:4: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, "LGPS:LTUS:4:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "LGPS:LTUS:4:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "LGPS:LTUS:4:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "LGPS:LTUS:4:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "LGPS:LTUS:4:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "LGPS:LTUS:4:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "1") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "LGPS:LTUS:4: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, "LGPS:LTUS:4:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "LGPS:LTUS:4:TRIMTYPE.RVAL") field(INPB, "LGPS:LTUS:4:CONFIG.RVAL") field(OUT, "LGPS:LTUS:4:TRIMMAXNUM PP") } record(longout, "LGPS:LTUS:4: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, "LGPS:LTUS:4:TRIMRAMPRATE") { field(DESC, "Trim Ramp rate ") field(PINI, "YES") field(ASG, "IOC_MAINT") field(PREC, "3") field(EGU, "Volts/sec") field(HOPR, "20.0") field(DRVH, "20.0") field(DRVL, "0.1") field(LOPR, "0.5") # field(DOL, "") field(OMSL, "supervisory") field(VAL, "10") field(OUT, "LGPS:LTUS:4:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "LGPS:LTUS:4: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, "") field(OMSL, "supervisory") field(VAL, "10") } record(bo, "LGPS:LTUS:4: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, "LGPS:LTUS:4: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, "LGPS:LTUS:4:TRIMSTEPMIN") { field(DESC, "Min step in current") field(DTYP, "Soft Channel") # field(DOL, "") field(PREC, "7") field(EGUF, "10") field(EGUL, "0") field(EGU, "Volts") field(HOPR, "10") field(LOPR, "0") field(VAL, "5.0") } record(bo, "LGPS:LTUS:4:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "0") } record(ao, "LGPS:LTUS:4: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, "LGPS:LTUS:4:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "LGPS:LTUS:4: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, "LGPS:LTUS:4: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, "LGPS:LTUS:4:IMOVE") field(INPB, "LGPS:LTUS:4:IACT") field(INPC, "LGPS:LTUS:4:IRAMPRATE") field(INPD, "1.577") field(INPE, "LGPS:LTUS:4:TRIMDLYPCT") field(INPF, "LGPS:LTUS:4:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "LGPS:LTUS:4:RAMPTIME_LEFT PP") } record(longout, "LGPS:LTUS:4:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "LGPS:LTUS:4:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "LGPS:LTUS:4:RAMPDONE_CALC") } record(calc, "LGPS:LTUS:4:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "LGPS:LTUS:4:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "LGPS:LTUS:4:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "LGPS:LTUS:4: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, "LGPS:LTUS:4:RAMPTIME_LEFT") field(OUT, "LGPS:LTUS:4:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "LGPS:LTUS:4:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "LGPS:LTUS:4:RAMPTIME_LEFT NMS") field(OUT, "LGPS:LTUS:4:RAMPDONE PP") } record(bo, "LGPS:LTUS:4:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "LGPS:LTUS:4:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "LGPS:LTUS:4: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, "LGPS:LTUS:4: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, "LGPS:LTUS:4:STDZINIT") { field(DESC, "Proc. Stdz PVs on boot") field(PINI, "YES") field(DOL1, "1") field(DOL2, "1") field(DOL3, "1") field(LNK1, "LGPS:LTUS:4:DEBUG.PROC PP") field(LNK2, "LGPS:LTUS:4:STDZCYCLENUM.PROC PP") field(LNK3, "LGPS:LTUS:4:STDZDISABLE.PROC PP") field(LNK4, "LGPS:LTUS:4: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, "LGPS:LTUS:4:STDZSUB") { field(DESC, "Stdz subroutine") field(INAM, "mgntStdzInit") field(SNAM, "mgntStdz") field(BRSV, "INVALID") field(INPA, "LGPS:LTUS:4:STDZIMIN NPP NMS") field(INPB, "LGPS:LTUS:4:STDZIMAX NPP NMS") field(INPC, "LGPS:LTUS:4:STDZIFINAL NPP NMS") field(INPD, "LGPS:LTUS:4:STDZCYCLENUM NPP NMS") field(INPE, "LGPS:LTUS:4:STDZDIRECT.RVAL NPP NMS") field(INPF, "LGPS:LTUS:4:STDZDISABLE.RVAL CPP NMS") field(INPG, "LGPS:LTUS:4: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, "LGPS:LTUS:4:STDZWF PP") field(OUTB, "LGPS:LTUS:4: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, "LGPS:LTUS:4:STDZWF") } record(mbbo, "LGPS:LTUS:4: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, "LGPS:LTUS:4: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, "LGPS:LTUS:4:STDZMAINPS") { field(DESC, "Stdz by main or self") field(PINI, "YES") field(DTYP, "Soft Channel") field(ZNAM, "SELF") field(ONAM, "MAIN") } record(bo, "LGPS:LTUS:4: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, "LGPS:LTUS:4: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, "LGPS:LTUS:4: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, "LGPS:LTUS:4:STDZTOD") { field(DESC, "Successful Standardize Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "LGPS:LTUS:4:STDZLOSTTOD") { field(DESC, "Standardize Lost Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(longout, "LGPS:LTUS:4:STDZCYCLECNT") { field(DESC, "Cycle Count") field(PINI, "YES") } record(longout, "LGPS:LTUS:4:STDZCYCLENUM") { field(DESC, "No. Standardize Cycles") field(VAL, "3") field(HOPR, "10") field(LOPR, "0") field(DRVH, "10") field(DRVL, "0") field(PINI, "YES") field(FLNK, "LGPS:LTUS:4:STDZDIRECT") } # The default standardize direction is "UP" for # all LCLS Magnets.. record(bo, "LGPS:LTUS:4:STDZDIRECT") { field(DESC, "Standardize Direction ") field(ZNAM, "UP") field(ONAM, "DOWN") field(VAL, "0") field(FLNK, "LGPS:LTUS:4:STDZIMIN") } record(ao, "LGPS:LTUS:4:STDZIMIN") { field(DESC, "Min-STDZ Current") field(PREC, "1") field(EGU, "A") field(HOPR, "50.0") field(LOPR, "0.0") field(VAL, "0.0") field(FLNK, "LGPS:LTUS:4:STDZIMAX") } record(ao, "LGPS:LTUS:4:STDZIMAX") { field(DESC, "Max. Standarize Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "50.0") field(LOPR, "0.0") field(VAL, "50.0") field(FLNK, "LGPS:LTUS:4:STDZIFINAL") } record(ao, "LGPS:LTUS:4:STDZIFINAL") { field(DESC, "Final SDTZ Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "50.0") field(LOPR, "0.0") field(VAL, "0.0") field(FLNK, "LGPS:LTUS:4: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, "LGPS:LTUS:4: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, "LGPS:LTUS:4:STDZITOL") { field(DESC, "Stdz min tolerance") field(PREC, "5") field(CALC, "MAX(ABS(A),ABS(B))*C") field(INPA, "LGPS:LTUS:4:STDZIMIN CP NMS") field(INPB, "LGPS:LTUS:4:STDZIMAX CP MMS") field(INPC, "0.05") field(INPD, "LGPS:LTUS:4:STDZITOLR CP MMS") field(EGU, "A") field(FLNK, "LGPS:LTUS:4:IDELTAS") field(PINI, "YES") } # D - factor (3.154/2 = 1.577) for EPSC, otherwise, set to 1.0 record(calc, "LGPS:LTUS:4:STDZDLY") { field(DESC, "Ramp time for stdz cycle") field(CALC, "C>0?MAX(1,ABS((A-B)/C)*D):0") field(INPA, "LGPS:LTUS:4:STDZIMIN CP NMS") field(INPB, "LGPS:LTUS:4:STDZIMAX CP NMS") field(INPC, "LGPS:LTUS:4:TRIMRAMPRATE CP NMS") field(INPD, "1.0") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") } record(calc, "LGPS:LTUS:4:STDZRAMPDLY") { field(DESC, "Ramp delay total") field(CALC, "MAX(1,((A/100)*B+B))") field(PREC, "5") field(INPA, "LGPS:LTUS:4:TRIMDLYPCT CP MS") field(INPB, "LGPS:LTUS:4: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, "LGPS:LTUS:4:STDZMINIDLY") { field(DESC, "Mini-stdz delay") field(CALC, "A") field(PREC, "5") field(A, "1.0") field(EGU, "sec") field(PINI, "YES") } record(ao, "LGPS:LTUS:4: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, "LGPS:LTUS:4:STDZMINIDELTA") { field(DESC, "Stdz mini % of IMAX") field(CALC, "(B/100)*(A-C)") field(INPA, "LGPS:LTUS:4:IDES.HOPR") field(INPB, "LGPS:LTUS:4:STDZMINIPCT CPP NMS") field(INPC, "LGPS:LTUS:4:IDES.LOPR") field(PREC, "5") } record(calc, "LGPS:LTUS:4:STDZMINISETPT") { field(DESC, "Mini Stdz delta") field(CALC, "C==0?MAX(E-D,B):MIN(E+D,A)") field(INPA, "LGPS:LTUS:4:IDES.HOPR") field(INPB, "LGPS:LTUS:4:IDES.LOPR") field(INPC, "LGPS:LTUS:4:STDZDIRECT.RVAL") field(INPD, "LGPS:LTUS:4:STDZMINIDELTA") field(INPE, "LGPS:LTUS:4:IDES") field(PREC, "5") field(FLNK, "LGPS:LTUS:4: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, "LGPS:LTUS:4:STDZMINISETPTOOR") { field(DESC, "Mini Stdz setpoint out of range") field(CALC, "C==0?(E-DA)") field(INPA, "LGPS:LTUS:4:IDES.HOPR") field(INPB, "LGPS:LTUS:4:IDES.LOPR") field(INPC, "LGPS:LTUS:4:STDZDIRECT.RVAL") field(INPD, "LGPS:LTUS:4:STDZMINIDELTA") field(INPE, "LGPS:LTUS:4: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, "LGPS:LTUS:4: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, "LGPS:LTUS:4:IADJUST.RVAL") field(INPB, "LGPS:LTUS:4:STDZDIRECT.RVAL") field(INPC, "LGPS:LTUS:4:STDZOK.RVAL") field(INPD, "LGPS:LTUS:4:STDZDISABLE.RVAL") field(INPE, "LGPS:LTUS:4:STATE.RVAL CPP NMS") field(INPF, "LGPS:LTUS:4:ICTRL.RVAL") field(INPG, "LGPS:LTUS:4:STATE.SEVR") field(INPH, "LGPS:LTUS:4:BDELTAS.M") field(INPI, "LGPS:LTUS:4:IACT.SEVR") field(OUT, "LGPS:LTUS:4:STDZLOSTGO.SELN PP NMS") field(OOPT, "Transition To Non-zero") } record(seq, "LGPS:LTUS:4:STDZLOSTGO") { field(DESC, "Process lost stdz") field(SELM, "Mask") field(DOL1, "1") field(DOL2, "0") field(LNK1, "LGPS:LTUS:4:STDZLOSTTOD.PROC") field(LNK2, "LGPS:LTUS:4:STDZOK PP") } # Record maximum current after standardize # Reset to IACT from sequence after trim # Disable processing during (mini-)standardize or trim record(calc, "LGPS:LTUS:4:STDZIACTMAX") { field(DESC, "Max act current after stdz") field(CALC, "MAX(A, B)") field(DISV, "0") field(SDIS, "LGPS:LTUS:4:CHECKPWRDIP_ENABLE") field(INPA, "LGPS:LTUS:4:IACT CP") field(INPB, "LGPS:LTUS:4:STDZIACTMAX") field(EGU, "A") field(FLNK, "LGPS:LTUS:4:CHECKPWRDIP") } # Detect power dip if STDZOK is YES, STDZ is enabled, and IACT is valid # If IACT drops below STDZIACTMAX by more than the trim tolerance, clear STDZOK # Warning: Take the absolute value of the trim tolerance, or else quads of # negative polarity will always lose STDZ since their IDELTAS.I are negative. # Note: Large quads and bends are prone to losing STDZ even if they are # perturbed toward higher current since their current tends to overshoot # by greater than the trim tolerance before settling down. record(calcout, "LGPS:LTUS:4:CHECKPWRDIP") { field(DESC, "Detect power dip") field(CALC, "(A-B>ABS(C))?3:0") field(DISV, "0") field(SDIS, "LGPS:LTUS:4:CHECKPWRDIP_ENABLE") field(INPA, "LGPS:LTUS:4:STDZIACTMAX") field(INPB, "LGPS:LTUS:4:IACT") field(INPC, "LGPS:LTUS:4:IDELTAS.I") field(OUT, "LGPS:LTUS:4:STDZLOSTGO.SELN PP NMS") field(OOPT, "When Non-zero") } # Enable processing of STDZIACTMAX and CHECKPWRDIP only if # STDZOK = YES, STDZDISABLE = NO, CTRL != Trim (2), and # CTRL != Stdz (4) record(calc, "LGPS:LTUS:4:CHECKPWRDIP_ENABLE") { field(CALC, "A&&!B&&(C#2)&&(C#4)") field(INPA, "LGPS:LTUS:4:STDZOK.RVAL CP") field(INPB, "LGPS:LTUS:4:STDZDISABLE.RVAL CP") field(INPC, "LGPS:LTUS:4:CTRL.RVAL CP") } #! 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, "LGPS:LTUS:4: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, "LGPS:LTUS:4: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, "LGPS:LTUS:4:CALBSET") { field(DESC, "Use DAC Calbration") field(SCAN, "10 second") field(CALC, "A&&(B==0)&&C?31:960") field(INPA, "LGPS:LTUS:4:CALBOK") field(INPB, "LGPS:LTUS:4:CALBDISABLE") field(INPC, "LGPS:LTUS:4:CALBSLOPE") field(OOPT, "On Change") field(OUT, "LGPS:LTUS:4: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, "LGPS:LTUS:4:CALB_SEQ") { field(DESC, "Output Calib Values") field(SELM, "Mask") field(SELL, "LGPS:LTUS:4: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, "LGPS:LTUS:4:CALBSLOPE") field(DOL3, "LGPS:LTUS:4: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, "LGPS:LTUS:4:CALBTOD") { field(DESC, "Calibration Success Time") field(PINI, "YES") # field(DOL, "") field(OMSL, "supervisory") field(DTYP, "Soft Channel") info(autosaveFields,"VAL") } record(ao, "LGPS:LTUS:4: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, "LGPS:LTUS:4: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, "LGPS:LTUS:4: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, "LGPS:LTUS:4:CALBOFFSET") { field(DESC, "Calc DAC Offset") field(PREC, "6") field(EGU, "Counts") field(PINI, "YES") } record(bo, "LGPS:LTUS:4: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, "LGPS:LTUS:4:DACSLOPE") { field(DESC, "V to DAC slope") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "supervisory") field(PINI, "YES") field(FLNK, "LGPS:LTUS:4:DACOFFSET") } # Default Offset used in conversion from Volts to DAC Counts record(ao, "LGPS:LTUS:4:DACOFFSET") { field(DESC, "V to DAC offset") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "supervisory") field(PINI, "YES") field(FLNK, "LGPS:LTUS:4: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, "LGPS:LTUS:4: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, "LGPS:LTUS:4:IACT") field(INPD, "LGPS:LTUS:4:DACSLOPE") field(INPE, "LGPS:LTUS:4:DACOFFSET") field(EGU, "Counts") field(PREC, "6") } record(ao, "LGPS:LTUS:4:DAC") { field(DESC, "DAC Set point") field(EGU, "Counts") field(DOL, "") field(OMSL, "supervisory") field(PREC, "6") field(PINI, "YES") } record(ao, "LGPS:LTUS:4:CALBIMIN") { field(DESC, "Calibration Min Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(DRVH, "50.0") field(HOPR, "50.0") field(DRVL, "0.0") field(LOPR, "0.0") field(PREC, "3") field(EGU, "A") field(VAL, "0.0") field(FLNK, "LGPS:LTUS:4:CALBIMAX") } record(ao, "LGPS:LTUS:4:CALBIMAX") { field(DESC, "Calibration Max Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(DRVH, "50.0") field(HOPR, "50.0") field(LOPR, "0.0") field(DRVL, "0.0") field(EGU, "A") field(VAL, "50.0") field(FLNK, "LGPS:LTUS:4:CALBSTEPNUM") } record(ao, "LGPS:LTUS:4:CALBIFINAL") { field(DESC, "Calibration Last Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(PREC, "3") field(EGU, "A") field(HOPR, "50.0") field(LOPR, "0.0") field(VAL, "0") } record(longout, "LGPS:LTUS:4: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, "LGPS:LTUS:4:CALBIDELTA") } record(calc, "LGPS:LTUS:4:CALBIDELTA") { field(DESC, "Step size for CALB") field(CALC, "C=0?0:ABS((A-B)/C)") field(INPA, "LGPS:LTUS:4:CALBIMAX") field(INPB, "LGPS:LTUS:4:CALBIMIN") field(INPC, "LGPS:LTUS:4: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, "LGPS:LTUS:4:CALBIMULT") { field(DESC, "IACT vs ISETPT mult") field(CALC, "C#0||A=0?1:ABS(B/A)") field(INPA, "PS:LTUS:4:ISETPT.DRVH") field(INPB, "PS:LTUS:4:IACT.HOPR") field(INPC, "LGPS:LTUS:4:PSCONTROLLER.RVAL CPP") field(EGU, "A") field(PINI, "YES") } # SNL dbputs DAC values here. 6-10 steps are possible. record(waveform, "LGPS:LTUS:4:CALBICTRLWF") { field(DESC, "ICTRL setpoint array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") } record(waveform, "LGPS:LTUS:4:DACWF") { field(DESC, "DAC count array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "LGPS:LTUS:4:DACSA") } # Used only for xygraph edm plot record(subArray, "LGPS:LTUS:4:DACSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "LGPS:LTUS:4: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, "LGPS:LTUS:4:CALCDACWF") { field(DESC, "Calc DAC counts array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "LGPS:LTUS:4:CALCDACSA") } # Used only for xygraph edm plot record(subArray, "LGPS:LTUS:4:CALCDACSA") { field(DESC, "Calc DAC counts") field(DTYP, "Soft Channel") field(INP, "LGPS:LTUS:4: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, "LGPS:LTUS:4:CALBYWF") { field(DESC, "mx + b") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "LGPS:LTUS:4:CALBYSA") } # Used only for xygraph edm plot record(subArray, "LGPS:LTUS:4:CALBYSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "LGPS:LTUS:4:CALBYWF") field(MALM, "10") field(NELM, "6") field(INDX, "0") field(FTVL, "DOUBLE") } record(waveform, "LGPS:LTUS:4:CALBIACTWF") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "LGPS:LTUS:4:CALBIACTSA") } # Used only for xygraph edm plot record(subArray, "LGPS:LTUS:4:CALBIACTSA") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(MALM, "10") field(NELM, "6") field(INP, "LGPS:LTUS:4:CALBIACTWF") field(INDX, "0") field(FTVL, "DOUBLE") field(FLNK, "LGPS:LTUS:4:CALBLIMITS") } # Check that measured current during calibration is within # tolerance. record(aSub, "LGPS:LTUS:4: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, "LGPS:LTUS:4:CALBSTEPNUM") field(INPB, "LGPS:LTUS:4:CALBIACTWF") field(INPC, "LGPS:LTUS:4: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, "LGPS:LTUS:4: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, "LGPS:LTUS:4:STDZITOL") field(INPH, "LGPS:LTUS:4:DACSLOPE") field(INPI, "LGPS:LTUS:4: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, "LGPS:LTUS:4: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, "LGPS:LTUS:4:CALBSTEPNUM") field(INPB, "LGPS:LTUS:4:CALBIACTWF") field(INPC, "LGPS:LTUS:4:DACWF") field(INPF, "LGPS:LTUS:4: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 LGPS:LTUS:4CALBOK 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, "LGPS:LTUS:4:DEGAUSINIT") { field(DESC, "Proc. Degauss PVs on boot") field(PINI, "YES") field(DOL, "1") field(OUTA, "LGPS:LTUS:4:DEGAUSIMIN.PROC PP") field(OUTB, "LGPS:LTUS:4:DEGAUSIMAX.PROC PP") field(OUTC, "LGPS:LTUS:4:DEGAUSTYPE.PROC PP") field(OUTD, "LGPS:LTUS:4:DEGAUSSTEP.PROC PP") field(OUTE, "LGPS:LTUS:4:MADNAME.PROC PP") field(OUTF, "LGPS:LTUS:4:PSTYPE.PROC PP") field(OUTG, "LGPS:LTUS:4: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, "LGPS:LTUS:4:DEGAUSSUB") { field(DESC, "Degauss subroutine") field(INAM, "mgntDegaussInit") field(SNAM, "mgntDegauss") field(BRSV, "INVALID") field(INPA, "LGPS:LTUS:4:DEGAUSIMIN NPP NMS") field(INPB, "LGPS:LTUS:4:DEGAUSIMAX NPP NMS") field(INPC, "LGPS:LTUS:4:DEGAUSTYPE.RVAL NPP NMS") field(INPE, "LGPS:LTUS:4:DEGAUSMETHOD.RVAL NPP NMS") field(INPF, "LGPS:LTUS:4:PSTYPE NPP NMS") field(INPG, "LGPS:LTUS:4:DEBUG.RVAL NPP NMS") field(INPH, "LGPS:LTUS:4: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, "LGPS:LTUS:4:DEGAUSWF PP") field(OUTB, "LGPS:LTUS:4:DEGAUSMSG PP") field(OUTC, "LGPS:LTUS:4: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, "LGPS:LTUS:4:DEGAUSWF") { field(DESC, "Degauss Setpts") field(NELM, "60") field(FTVL, "DOUBLE") } record(mbbo,"LGPS:LTUS:4: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, "LGPS:LTUS:4: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, "LGPS:LTUS:4: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, "LGPS:LTUS:4: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, "LGPS:LTUS:4: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, "LGPS:LTUS:4:DEGAUSIMIN") { field(DESC, "Min. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "50.0") field(LOPR, "-50.0") field(DRVH, "50.0") field(DRVL, "-50.0") field(VAL, "-50.0") } record(ao, "LGPS:LTUS:4:DEGAUSIMAX") { field(DESC, "Max. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "50.0") field(LOPR, "-50.0") field(DRVH, "50.0") field(DRVL, "-50.0") field(VAL, "50.0") } # 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,"LGPS:LTUS:4: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, "LGPS:LTUS:4: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,"LGPS:LTUS:4: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, "LGPS:LTUS:4: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, "LGPS:LTUS:4: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, "LGPS:LTUS:4: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, "LGPS:LTUS:4:DEGAUSTOD") { field(DESC, "Successful Degauss Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "LGPS:LTUS:4:DEGAUSLOSTTOD") { field(DESC, "Degauss Lost Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "LGPS:LTUS:4:DEGAUSTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "LGPS:LTUS:4:DEGAUSTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "LGPS:LTUS:4: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, "LGPS:LTUS:4:DEGAUSGO") { field(DESC, "Set bdes of btrms to zero") field(ASG, "Internal") field(OUTA, "") field(OUTB, "") field(OUTC, "") field(OUTD, "") } # =========== CRYO ONLY =========== record(bo, "LGPS:LTUS:4: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, "LGPS:LTUS:4:DEGAUS_IMAX_CHECK") { field(DESC, "Check if imax shoud chg") field(CALC, "(C==4)&&(ABS(B)>ABS(A))?1:0") field(INPA, "LGPS:LTUS:4:DEGAUS_IMAX") field(INPB, "LGPS:LTUS:4:ISETPT") field(INPC, "LGPS:LTUS:4:DEGAUSTYPE.RVAL") field(OUT, "LGPS:LTUS:4:DEGAUS_IMAX_UPDATE.SELN") field(FLNK, "LGPS:LTUS:4:DEGAUS_IMAX_UPDATE") } record(seq, "LGPS:LTUS:4:DEGAUS_IMAX_UPDATE") { field(DESC, "Degauss IMAX Update") field(SELM, "Specified") field(DOL1, "LGPS:LTUS:4:ISETPT") field(LNK1, "LGPS:LTUS:4:DEGAUS_IMAX PP") } # Set the maximum current after a successful # degauss. This pv is updated by the # sequence. record(ao, "LGPS:LTUS:4:DEGAUS_IMAX") { field(DESC, "Max I set afer a degauss") field(EGU, "Amps") field(PINI, "YES") field(PREC, "6") field(HOPR, "50.0") field(LOPR, "-50.0") field(DRVH, "50.0") field(DRVL, "-50.0") field(VAL, "50.0") field(FLNK, "LGPS:LTUS:4:DEGAUS_IMAXPOL_CHECK") info(autosaveFields,"VAL,RVAL") } # Set the polarity if degauss_imax record(calcout, "LGPS:LTUS:4:DEGAUS_IMAXPOL_CHECK") { field(DESC, "Determine polarity of imax") field(CALC, "A>=0?0:1") field(INPA, "LGPS:LTUS:4:DEGAUS_IMAX") field(FLNK, "LGPS:LTUS:4:DEGAUS_IMAXPOL") } record(bo, "LGPS:LTUS:4:DEGAUS_IMAXPOL") { field(DESC, "Polarity of imax I") field(DTYP, "Raw Soft Channel") field(DOL, "LGPS:LTUS:4:DEGAUS_IMAXPOL_CHECK") field(OMSL, "closed_loop") field(ZNAM, "Positive") field(ONAM, "Negative") field(FLNK, "LGPS:LTUS:4: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, "LGPS:LTUS:4:DEGAUS_ABSIMAX") { field(DESC, "Absolute Max. Degauss I") field(CALC, "ABS(A)") field(INPA, "LGPS:LTUS:4:DEGAUS_IMAX") field(PREC, "6") field(EGU, "Amps") field(HOPR, "50.0") field(LOPR, "-50.0") info(autosaveFields,"VAL RVAL") } # IACT Polarity record(calcout, "LGPS:LTUS:4:IACTPOL_CHECK") { field(DESC, "Determine IACT polarity") field(SCAN, "5 second") field(CALC, "ABS(A-B)>C?(A>=0?0:1):D") field(INPA, "LGPS:LTUS:4:IACT") field(INPB, "LGPS:LTUS:4:IACTPOL_CHECK.LA") field(INPC, "0.0001") field(INPD, "LGPS:LTUS:4:IACTPOL_CHECK.PVAL") field(OOPT, "On Change") field(FLNK, "LGPS:LTUS:4:IACTPOL") } record(bo, "LGPS:LTUS:4: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,"LGPS:LTUS:4: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, "LGPS:LTUS:4:DEGAUSENABLE CP") field(INPB, "LGPS:LTUS:4:DEGAUSOK") field(INPC, "LGPS:LTUS:4:STATE CP") field(INPD, "LGPS:LTUS:4:STATE.SEVR") field(OUT, "LGPS:LTUS:4:DEGAUS_STATE_SEQ.SELN PP") field(ASG, "Internal") } record(seq, "LGPS:LTUS:4:DEGAUS_STATE_SEQ") { field(DESC, "Degauss State Sequence") field(SELM, "Specified") field(SELL, "LGPS:LTUS:4:DEGAUS_STATE_CHECK") field(LNK1, "LGPS:LTUS:4:DEGAUS_STATE_DISABLE.PROC PP") field(LNK2, "LGPS:LTUS:4:DEGAUS_STATE_LOST.PROC PP") field(LNK3, "LGPS:LTUS:4:DEGAUS_STATE_GOOD.PROC PP") field(LNK4, "LGPS:LTUS:4: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, "LGPS:LTUS:4:DEGAUS_STATE_DISABLE") { field(DESC, "Degauss not used") field(LNK1, "LGPS:LTUS:4:DEGAUSOK.ZSV") field(LNK2, "LGPS:LTUS:4: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, "LGPS:LTUS:4:STATMSG.FRSV") field(LNK4, "LGPS:LTUS:4: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, "LGPS:LTUS:4:DEGAUS_STATE_LOST") { field(DESC, "Degauss lost and ps On") field(DOL1, "1") field(LNK1, "LGPS:LTUS:4:DEGAUSOK.ZSV") field(LNK2, "LGPS:LTUS:4: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, "LGPS:LTUS:4:STATMSG.FRSV") field(LNK4, "LGPS:LTUS:4: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, "LGPS:LTUS:4:DEGAUS_STATE_OFF") { field(DESC, "Degaused lost and ps Off") field(DOL1, "2") field(LNK1, "LGPS:LTUS:4: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, "LGPS:LTUS:4:STATMSG.FRSV") field(LNK3, "LGPS:LTUS:4: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, "LGPS:LTUS:4:DEGAUS_STATE_GOOD") { field(DESC, "Degauss good") field(DOL1, "1") field(LNK1, "LGPS:LTUS:4: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, "LGPS:LTUS:4:STATMSG.FRSV PP") field(LNK3, "LGPS:LTUS:4:STATMSG.FVSV PP") field(LNK4, "") field(ASG, "Internal") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(mbbo, "LGPS:LTUS:4:FUNC") { field(DESC, "LGPS:LTUS:4 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, "1") field(NIVL, "2") field(TEVL, "3") field(ELVL, "0") field(TVVL, "0") field(TTVL, "0") field(FTVL, "0") field(FFVL, "0") field(OUT, "LGPS:LTUS:4:CTRL CA") } # :CTRL pv is processed at boot in the # sequence mgntCtrl.st Processed in sequence # record(mbbo, "LGPS:LTUS:4:CTRL") { field(DESC, "LGPS:LTUS:4 Control") field(PINI, "NO") field(ZRST, "Ready") field(ONST, "RESET") field(TWST, "TURN_ON") field(THST, "TURN_OFF") 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, "8") field(TWVL, "9") field(THVL, "10") 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, "LGPS:LTUS:4:SELECTEN.A PP") field(SDIS, "0") } # If a function has been selected set this unit to busy record(calcout, "LGPS:LTUS:4:SELECTEN") { field(DESC, "Control Select Enable") field(CALC, "A>0?1:A") field(FLNK, "LGPS:LTUS:4:BUSY") } # Set to FREE on IOC reboot record(bo, "LGPS:LTUS:4:BUSY") { field(DESC, "LGPS:LTUS:4 Ctrl Done") field(DOL, "LGPS:LTUS:4:SELECTEN") field(ZNAM, "FREE") field(ONAM, "BUSY") field(PINI, "YES") field(FLNK, "LGPS:LTUS:4:SELECT") } record(bo, "LGPS:LTUS:4:SELECT") { field(ZNAM, "NO") field(ONAM, "YES") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") } record(bo, "LGPS:LTUS:4: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, "LGPS:LTUS:4:CTRLSTATE") { field(DESC, "LGPS:LTUS:4 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("LGPS:LTUS:4:CTRL",20,20,0,0,"LGPS:LTUS:4:CTRL") #! Field("LGPS:LTUS:4:CTRL.OUT",16777215,1,"LGPS:LTUS:4:CTRL.OUT") #! Link("LGPS:LTUS:4:CTRL.OUT","LGPS:LTUS:4:SELECTEN.A") #! Field("LGPS:LTUS:4:CTRL.VAL",16777215,1,"LGPS:LTUS:4:CTRL.VAL") #! Record("LGPS:LTUS:4:SELECTEN",321,381,0,0,"LGPS:LTUS:4:SELECTEN") #! Field("LGPS:LTUS:4:SELECTEN.A",16777215,0,"LGPS:LTUS:4:SELECTEN.A") #! Field("LGPS:LTUS:4:SELECTEN.FLNK",16777215,1,"LGPS:LTUS:4:SELECTEN.FLNK") #! Link("LGPS:LTUS:4:SELECTEN.FLNK","LGPS:LTUS:4:BUSY") #! Field("LGPS:LTUS:4:SELECTEN.VAL",16777215,1,"LGPS:LTUS:4:SELECTEN.VAL") #! Record("LGPS:LTUS:4:BUSY",623,274,0,0,"LGPS:LTUS:4:BUSY") #! Field("LGPS:LTUS:4:BUSY.DOL",16777215,0,"LGPS:LTUS:4:BUSY.DOL") #! Link("LGPS:LTUS:4:BUSY.DOL","LGPS:LTUS:4:SELECTEN.VAL") #! Field("LGPS:LTUS:4:BUSY.FLNK",16777215,1,"LGPS:LTUS:4:BUSY.FLNK") #! Link("LGPS:LTUS:4:BUSY.FLNK","LGPS:LTUS:4:SELECT") #! Record("LGPS:LTUS:4:SELECT",669,508,0,1,"LGPS:LTUS:4:SELECT") #! Record("LGPS:LTUS:4:FUNC",940,120,0,0,"LGPS:LTUS:4:FUNC") #! Field("LGPS:LTUS:4:FUNC.OUT",16777215,0,"LGPS:LTUS:4:FUNC.OUT") #! Link("LGPS:LTUS:4:FUNC.OUT","LGPS:LTUS:4:CTRL.VAL") #! Record("LGPS:LTUS:4:ABORT",193,41,0,0,"LGPS:LTUS:4:ABORT") #! Record("LGPS:LTUS:4:CTRLSTATE",369,34,0,0,"LGPS:LTUS:4: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,"LGPS:LTUS:4:SELECT is used for Multi-device selection.\nIt is enabled when associated LGPS:LTUS:4:CTRL is \"0\" (DONE).\nIt is disabled when associated LGPS:LTUS:4: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,"LGPS:LTUS:4: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, "LGPS:LTUS:4:BCTRL_INIT") { field(DESC, "Process BCTRL on boot") field(PINI, "YES") field(CALC, "A=3?1:0") field(INPA, "LGPS:LTUS:4:BCTRL.SEVR") field(OUT, "LGPS:LTUS:4: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, "LGPS:LTUS:4:BACT") { field(DESC, "Actual B") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "LGPS:LTUS:4:BACT") field(INPB, "LGPS:LTUS:4:POLYCOEF") field(INPC, "LGPS:LTUS:4:POLYCOEF.A") field(INPD, "LGPS:LTUS:4:POLYCOEF.B") field(INPE, "LGPS:LTUS:4:IACT MS") field(INPF, "LGPS:LTUS:4:BDELTAS PP") field(INPG, "100") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(HIHI, "50.0") field(LOLO, "0.0") field(PREC, "3") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "50.0") field(LOW, "0.0") field(FLNK, "LGPS:LTUS:4: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, "LGPS:LTUS:4:BDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntPhyDeltas") field(EGU, "Volts") field(HOPR, "1") field(PREC, "3") field(BRSV, "INVALID") field(INPA, "LGPS:LTUS:4:BDES") field(INPB, "LGPS:LTUS:4:TRIMBTOL") field(INPC, "LGPS:LTUS:4:TRIMBTOLR") field(INPD, "LGPS:LTUS:4:CHCKBTOL") field(INPE, "LGPS:LTUS:4:CHCKBTOLR") field(F, "0.0") field(INPG, "30") field(INPH, "LGPS:LTUS:4:BACT.VAL") # # MPS absolute and relative tolerances field(INPP, "LGPS:LTUS:4:MPSBTOL") field(INPQ, "LGPS:LTUS:4:MPSBTOLR") field(FLNK, "LGPS:LTUS:4:BCONLIMITS") info(autosaveFields,"F") } # This record is processed by BDELTAS record(aSub, "LGPS:LTUS:4:BCONLIMITS") { field(DESC, "Config B-field Limits") field(INAM, "mgntInit") field(SNAM, "mgntBCONLimits") field(INPA, "LGPS:LTUS:4:BDES") field(INPB, "LGPS:LTUS:4:BDELTAS.I") field(INPG, "LGPS:LTUS:4:DEBUG.RVAL") field(FTA, "DOUBLE") field(FTB, "DOUBLE") field(FTG, "ULONG") field(OUTA, "LGPS:LTUS:4:BCON.HIGH") field(OUTB, "LGPS:LTUS:4:BCON.LOW") field(OUTC, "LGPS:LTUS:4:BCON.HIHI") field(OUTD, "LGPS:LTUS:4:BCON.LOLO PP") field(FTVA, "DOUBLE") field(FTVB, "DOUBLE") field(FTVC, "DOUBLE") field(FTVD, "DOUBLE") field(BRSV, "INVALID") field(FLNK, "LGPS:LTUS:4:IDELTAS") } # The following PV is processed by :BACT # which is processed by :BACT # record(fanout, "LGPS:LTUS:4:BACTFO") { field(DESC, "BACT processing") field(SELM, "All") field(LNK1, "LGPS:LTUS:4:BDIFF") field(LNK2, "LGPS:LTUS:4:BADIFF") field(LNK3, "LGPS:LTUS:4:BRATIO") field(LNK4, "LGPS:LTUS:4:MPSLIMITS") field(LNK5, "LGPS:LTUS:4:I2BSTATUS") field(LNK6, "LGPS:LTUS:4:IACTFO.PROC") } record(calc, "LGPS:LTUS:4:BDIFF") { field(DESC, "BDES-BACT") field(CALC, "A-B") field(INPA, "LGPS:LTUS:4:BDES") field(INPB, "LGPS:LTUS:4:BACT") field(EGU, "Volts") field(PREC, "7") } record(calc, "LGPS:LTUS:4:BADIFF") { field(DESC, "Absolute BDES-BACT") field(INPA, "LGPS:LTUS:4:BDIFF") field(EGU, "Volts") field(PREC, "7") field(CALC, "A<0?ABS(A):A") } record(calc, "LGPS:LTUS:4:BRATIO") { field(DESC, "BACT Error") field(CALC, "B?A/B:0") field(INPA, "LGPS:LTUS:4:BDIFF") field(INPB, "LGPS:LTUS:4:BDES.HOPR") field(EGU, "Volts") field(PREC, "7") } record(mbbi, "LGPS:LTUS:4: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, "LGPS:LTUS:4:BACT.J") } # Note: for a string slave set the MONFL # macro to the following: # MONFL=:IMONCALC MS record(sub, "LGPS:LTUS:4:BMON") { field(DESC, "Second Transductor") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "LGPS:LTUS:4:BMON") field(INPB, "LGPS:LTUS:4:POLYCOEF") field(INPC, "LGPS:LTUS:4:POLYCOEF.A") field(INPD, "LGPS:LTUS:4:POLYCOEF.B") field(INPE, "LGPS:LTUS:4:IMON MS") field(INPF, "LGPS:LTUS:4:BDELTAS.VAL") field(INPG, "100") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(HIHI, "50.0") field(LOLO, "0.0") field(PREC, "3") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "50.0") field(LOW, "0.0") } # 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:LTUS:4:BDES CP record(ao, "LGPS:LTUS:4:BDES") { field(DESC, "Desired B-Field") field(PINI, "YES") field(DRVH, "50.0") field(DRVL, "0.0") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(EGU, "Volts") field(MDEL, "-1") field(OMSL, "closed_loop") field(DOL, "LGPS:LTUS:4:BDES.DRVH") field(OUT, "LGPS:LTUS:4:B2IDES PP") info(autosaveFields,"VAL") } record(sub, "LGPS:LTUS:4:B2IDES") { field(DESC, "Convert Desired B-Field to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "LGPS:LTUS:4:POLYCOEF") field(INPC, "LGPS:LTUS:4:POLYCOEF.A") field(INPD, "LGPS:LTUS:4:POLYCOEF.B") field(PREC, "3") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(MDEL, "-1") field(INPE, "LGPS:LTUS:4:BDES.DRVH") field(INPF, "LGPS:LTUS:4:BDES.DRVL") field(BRSV, "INVALID") field(FLNK, "LGPS:LTUS:4:IDES") } record(sub, "LGPS:LTUS:4:BNOM") { field(DESC, "Nominal Field") field(PINI, "YES") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "LGPS:LTUS:4:POLYCOEF") field(INPC, "LGPS:LTUS:4:POLYCOEF.A") field(INPD, "LGPS:LTUS:4:POLYCOEF.B") field(INPE, "LGPS:LTUS:4:BDES.DRVH") field(INPF, "LGPS:LTUS:4:BDES.DRVL") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(VAL, "0.0") field(FLNK, "LGPS:LTUS:4:INOM") } record(sub, "LGPS:LTUS:4:BACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "LGPS:LTUS:4:BDES.VAL") field(INPB, "LGPS:LTUS:4:BDES.DRVH") field(INPC, "LGPS:LTUS:4:BDES.DRVL") field(INPD, "LGPS:LTUS:4:BDELTAS.I") field(INPE, "LGPS:LTUS:4:BDELTAS.J") field(INPG, "LGPS:LTUS:4:STATE") field(INPH, "LGPS:LTUS:4:HSTA") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(sub, "LGPS:LTUS:4:BMONLIMITS") { field(DESC, "MON Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "LGPS:LTUS:4:BDES.VAL") field(INPB, "LGPS:LTUS:4:BDES.DRVH") field(INPC, "LGPS:LTUS:4:BDES.DRVL") field(INPD, "LGPS:LTUS:4:BDELTAS.K") field(INPE, "LGPS:LTUS:4:BDELTAS.L") field(INPG, "LGPS:LTUS:4:STATE") field(INPH, "LGPS:LTUS:4:HSTA") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(seq, "LGPS:LTUS:4:BLIMITS") { field(DESC, "ACT Limits") field(PREC, "3") field(DOL1, "LGPS:LTUS:4:BLIMITS") field(LNK1, "LGPS:LTUS:4:BACTLIMITS.F PP") field(DOL2, "LGPS:LTUS:4:BACTLIMITS.I") field(LNK2, "LGPS:LTUS:4:BACT.HIGH") field(DOL3, "LGPS:LTUS:4:BACTLIMITS.J") field(LNK3, "LGPS:LTUS:4:BACT.LOW") field(DOL4, "LGPS:LTUS:4:BACTLIMITS.K") field(LNK4, "LGPS:LTUS:4:BACT.HIHI") field(DOL5, "LGPS:LTUS:4:BACTLIMITS.L") field(LNK5, "LGPS:LTUS:4:BACT.LOLO") field(DOL6, "LGPS:LTUS:4:BLIMITS") field(LNK6, "LGPS:LTUS:4:BMONLIMITS.F PP") field(DOL7, "LGPS:LTUS:4:BMONLIMITS.I") field(LNK7, "LGPS:LTUS:4:BMON.HIGH") field(DOL8, "LGPS:LTUS:4:BMONLIMITS.J") field(LNK8, "LGPS:LTUS:4:BMON.LOW") field(DOL9, "LGPS:LTUS:4:BMONLIMITS.K") field(LNK9, "LGPS:LTUS:4:BMON.HIHI") field(DOLA, "LGPS:LTUS:4:BMONLIMITS.L") field(LNKA, "LGPS:LTUS:4:BMON.LOLO") field(FLNK, "LGPS:LTUS:4:ILIMITS") field(SCAN, "5 second") } record(ao, "LGPS:LTUS:4:BCTRL") { field(DESC, "B-Perturb") field(PREC, "3") field(EGU, "Volts") field(DRVH, "50.0") field(DRVL, "0.0") field(HOPR, "50.0") field(LOPR, "0.0") # 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, "LGPS:LTUS:4: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, "LGPS:LTUS:4:BCTRLGO") { field(DESC, "Update DES and perturb") field(PREC, "3") # Disable BACT limits field(DOL1, "1") field(LNK1, "LGPS:LTUS:4:BLIMITS.VAL") # Update BDES with the BCTRL (slider) value field(DOL2, "LGPS:LTUS:4:BCTRL.VAL") field(LNK2, "LGPS:LTUS:4:BDES PP") field(DOL3, "1") field(LNK3, "LGPS:LTUS:4:IDIRECT.PROC PP") field(DOL4, "1") field(LNK4, "LGPS:LTUS:4:CHECKSTDZLOST.PROC PP") field(DOL5, "LGPS:LTUS:4:BCTRL.VAL") field(LNK5, "LGPS:LTUS:4:BCTRLSUB PP") # Re-enable BACT limits field(DOL6, "0") field(LNK6, "LGPS:LTUS:4:BLIMITS.VAL") } # Convert B-field to Current and output to ISETPT record(sub, "LGPS:LTUS:4:BCTRLSUB") { field(DESC, "Feedback") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "LGPS:LTUS:4:POLYCOEF") field(INPC, "LGPS:LTUS:4:POLYCOEF.A") field(INPD, "LGPS:LTUS:4:POLYCOEF.B") field(INPE, "LGPS:LTUS:4:BDES.DRVH") field(INPF, "LGPS:LTUS:4:BDES.DRVL") field(PREC, "3") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(MDEL, "-1") field(BRSV, "INVALID") field(FLNK, "LGPS:LTUS:4:ISETPT") } record(ao, "LGPS:LTUS:4:BDESPREVTRIM") { field(DESC, "trim bdes for undo") field(DTYP, "Soft Channel") field(DRVH, "50.0") field(DRVL, "0.0") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(PINI, "YES") info(autosaveFields,"VAL") } record(stringin, "LGPS:LTUS:4:MADNAME") { field(DESC, "MAD deck nomenclature") field(PINI, "YES") field(VAL, "B911-3404") } record(ai, "LGPS:LTUS:4: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, "0.0") } record(ao, "LGPS:LTUS:4:BMAX") { field(DESC, "Max B-Field") field(DTYP, "Soft Channel") field(DRVH, "50.0") field(DRVL, "0.0") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(PINI, "YES") field(VAL, "50.0") field(FLNK, "LGPS:LTUS:4:BSTEP") } record(ao, "LGPS:LTUS:4:BMIN") { field(DESC, "Min B-Field") field(DTYP, "Soft Channel") field(DRVH, "50.0") field(DRVL, "0.0") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(PINI, "YES") field(VAL, "0.0") field(FLNK, "LGPS:LTUS:4:BSTEP") } record(ao, "LGPS:LTUS:4:BDESSAVE") { field(DESC, "bdes for save/load") field(DTYP, "Soft Channel") field(DRVH, "50.0") field(DRVL, "0.0") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PINI, "YES") field(PREC, "3") } # This record is processed by LGPS:LTUS:4: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, "LGPS:LTUS:4:BCON") { field(DESC, "Config B-Field ") field(DTYP, "Soft Channel") field(PREC, "3") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(DRVH, "50.0") field(DRVL, "0.0") # 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 , "") field(OMSL, "closed_loop") field(OUT, "LGPS:LTUS:4:B2ICON PP") info(autosaveFields,"VAL") } record(sub, "LGPS:LTUS:4:B2ICON") { field(DESC, "Convert Desired ICon to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "LGPS:LTUS:4:POLYCOEF") field(INPC, "LGPS:LTUS:4:POLYCOEF.A") field(INPD, "LGPS:LTUS:4:POLYCOEF.B") field(PREC, "3") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(MDEL, "-1") field(INPE, "LGPS:LTUS:4:BCON.DRVH") field(INPF, "LGPS:LTUS:4:BCON.DRVL") field(BRSV, "INVALID") field(FLNK, "LGPS:LTUS:4: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, "LGPS:LTUS:4:BSTEP") { field(DESC, "B-Field step size") field(CALC, "(C==3)||(D==3)?0:ABS(A-B)*0.005") field(INPA, "LGPS:LTUS:4:BMAX") field(INPB, "LGPS:LTUS:4:BMIN") field(INPC, "LGPS:LTUS:4:BMIN.SEVR") field(INPD, "LGPS:LTUS:4:BMAX.SEVR") field(EGU, "Volts") 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,"LGPS:LTUS:4:BCTRLDISABLECALC") { field(DESC, "Calc for disabling BCTRL") field(ASG, "Internal") field(CALC, "A?2:1") field(INPA, "LGPS:LTUS:4:ONLINE CP") field(OUT, "LGPS:LTUS:4:BCTRLDISABLEFOUT PP") } record(fanout, "LGPS:LTUS:4:BCTRLDISABLEFOUT") { field(DESC, "Disable BCTRL fanout") field(SELM, "Specified") field(SELL, "LGPS:LTUS:4:BCTRLDISABLECALC") field(LNK1, "LGPS:LTUS:4:BCTRLDISABLE") field(LNK2, "LGPS:LTUS:4:BCTRLENABLE") } record(stringout, "LGPS:LTUS:4:BCTRLDISABLE") { field(DESC, "Disable BCTRL") field(DTYP, "Soft Channel") field(OUT, "LGPS:LTUS:4:BCTRL.ASG") field(VAL, "NOWRITE") field(FLNK, "LGPS:LTUS:4:BCTRLDISV_UPDATE") } record(stringout, "LGPS:LTUS:4:BCTRLENABLE") { field(DESC, "Enable BCTRL") field(DTYP, "Soft Channel") field(OUT, "LGPS:LTUS:4:BCTRL.ASG") field(VAL, "") field(FLNK, "LGPS:LTUS:4:BCTRLDISV_UPDATE") } record(calcout, "LGPS:LTUS:4:BCTRLDISV_UPDATE") { field(DESC, "Calc for updating BCTRL.DISV") field(ASG, "Internal") field(CALC, "A") field(INPA, "LGPS:LTUS:4:ONLINE") field(OUT, "LGPS:LTUS:4: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,"LGPS:LTUS:4:BACT and MON\n are processed via links from \n LGPS:LTUS:4:IACT (device raw value readback 1)\n and\n LGPS:LTUS:4: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 LGPS:LTUS:4:POLYCOEF\nC = First polynomial coefficient (offset if linear)\nD = Second polynomial coefficient (slope if linear)\nE = LGPS:LTUS:4: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,"LGPS:LTUS:4:BDES\n is processed when set by CA users or \n LGPS:LTUS:4: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,"LGPS:LTUS:4: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 LGPS:LTUS:4: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 (LGPS:LTUS:4: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,"LGPS:LTUS:4:B*LIMITS and LGPS:LTUS:4:BLIMITS:\n Calculate alarm and warning limits based on \n deltas from LGPS:LTUS:4: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,"LGPS:LTUS:4: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,"LGPS:LTUS:4: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, "LGPS:LTUS:4: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, "LGPS:LTUS:4:MPSBTOL") { field(DESC, "Absolute mps tol") field(EGU, "Volts") field(PREC, "2") field(CALC, "ABS(A)*0.02") field(INPA, "LGPS:LTUS:4:BMAX") field(PINI, "YES") } # # 21-Aug-2013: K. Luchini # Set channel access security so that users # cannot easily change values. record(ao, "LGPS:LTUS:4:MPSBMAX") { field(DESC, "MPS Max B-field") field(EGU, "Volts") field(PREC, "7") field(DRVH, "50.0") field(DRVL, "0.0") field(PINI, "YES") field(VAL, "50.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "LGPS:LTUS:4:MPSBMIN") { field(DESC, "MPS Min B-field") field(EGU, "Volts") field(PREC, "7") field(DRVH, "50.0") field(DRVL, "0.0") field(PINI, "YES") field(VAL, "0.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "LGPS:LTUS:4:MPSBLLIM") { field(DESC, "MPS Low Limit B-field") field(EGU, "Volts") field(PREC, "7") field(DRVH, "50.0") field(DRVL, "0.0") field(PINI, "YES") field(VAL, "0.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "LGPS:LTUS:4:MPSBLLIM2") { field(DESC, "MPS Low Limit #2 B-field") field(EGU, "Volts") field(PREC, "7") field(DRVH, "50.0") field(DRVL, "0.0") field(PINI, "YES") field(VAL, "0.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } # Set the default to Std record(mbbo, "LGPS:LTUS:4: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, "LGPS:LTUS:4:MPSLIMITS.E PP") } record(aSub, "LGPS:LTUS:4: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, "LGPS:LTUS:4:MPS.RVAL") field(INPB, "LGPS:LTUS:4:BADIFF") field(INPC, "LGPS:LTUS:4:BDELTAS.N") field(INPD, "LGPS:LTUS:4:BACT") field(INPE, "LGPS:LTUS:4:MPSBITMASK.RVAL") field(INPF, "LGPS:LTUS:4:MPSBLLIM") field(INPG, "LGPS:LTUS:4:MPSBMIN") field(INPH, "LGPS:LTUS:4:MPSBMAX") field(INPI, "LGPS:LTUS:4: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, "LGPS:LTUS:4:INTOL.RVAL PP") field(OUTB, "LGPS:LTUS:4:INTOL_BMIN.RVAL PP") field(OUTC, "LGPS:LTUS:4:INTOL_BRANGE.RVAL PP") field(OUTD, "LGPS:LTUS:4: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, "LGPS:LTUS:4:INTOL") { field(DESC, "BACT within MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "LGPS:LTUS:4:MPSLIMITS.VALA") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "LGPS:LTUS:4:INTOL_BMIN") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "LGPS:LTUS:4:MPSLIMITS.VALB") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "LGPS:LTUS:4:INTOL_BMIN2") { field(DESC, "MPS tol #2") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "LGPS:LTUS:4:MPSLIMITS.VALD") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "LGPS:LTUS:4:INTOL_BRANGE") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "LGPS:LTUS:4: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, "LGPS:LTUS:4:CHCKITOL") { field(DESC, "Absolute Check I Tolerance") field(EGU, "A") field(FLNK, "LGPS:LTUS:4:TRIMITOL") field(CALC, "ABS(A*B)") field(INPA, "LGPS:LTUS:4:CHCKBTOL") field(INPB, "LGPS:LTUS:4:POLYCOEF.B") field(PREC, "9") } record(calc, "LGPS:LTUS:4:TRIMBTOL") { field(EGU, "Volts") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(DESC, "Absolute Trim Tolerance") field(CALC, "ABS(A)/2") field(INPA, "LGPS:LTUS:4:CHCKBTOL") field(FLNK, "LGPS:LTUS:4:CHCKITOL") } record(calc, "LGPS:LTUS:4:CHCKBTOL") { field(DESC, "Check absolute tolerance") field(EGU, "A") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(FLNK, "LGPS:LTUS:4:TRIMBTOL") field(CALC, "MAX(ABS(A),ABS(C))*(B/1000000)") field(INPA, "LGPS:LTUS:4:BDES.HOPR") field(INPB, "LGPS:LTUS:4:STABILITY") field(INPC, "LGPS:LTUS:4:BDES.LOPR") } record(longout, "LGPS:LTUS:4:STABILITY") { field(DESC, "Long Term Stability") field(PINI, "YES") field(VAL, "15000") field(EGU, "ppm") field(DRVH, "20000") field(DRVL, "100") field(HOPR, "20000") field(LOPR, "100") field(FLNK, "LGPS:LTUS:4:CHCKBTOL") } record(calc, "LGPS:LTUS:4:TRIMITOL") { field(DESC, "Absolute Trim I Tolerance") field(EGU, "Volts") field(CALC, "ABS(A*B)") field(INPA, "LGPS:LTUS:4:POLYCOEF.B") field(INPB, "LGPS:LTUS:4:TRIMBTOL") field(PREC, "9") } record(ai, "LGPS:LTUS:4:TRIMBTOLR") { field(DESC, "Relative trim tol") field(PREC, "4") field(EGU, "%") field(HOPR, "1.0") field(LOPR, "0.0") field(PINI, "YES") } record(ai, "LGPS:LTUS:4: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, "LGPS:LTUS:4:FBCKFCOM") { field(ZNAM, "CA") field(ONAM, "FCOM") field(DESC, "CA Mode") field(PINI, "YES") field(SDIS, "0") } record(bo, "LGPS:LTUS:4:PAU") { field(ZNAM, "NotConfigured") field(ONAM, "Configured") field(DESC, "PAU Present") field(PINI, "YES") field(SDIS, "0") field(FLNK, "LGPS:LTUS:4:PAUGO") } record(fanout, "LGPS:LTUS:4:PAUGO") { field(DESC, "PAU control") field(LNK1, "LGPS:LTUS:4:PAUSTOP") field(LNK2, "LGPS:LTUS:4: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, "LGPS:LTUS:4:PAUSTART") { field(DESC, "Setup for PAU On") field(SDIS, "LGPS:LTUS:4: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, "LGPS:LTUS:4:PAUSTOP") { field(DESC, "Setup for PAU Off") field(SDIS, "LGPS:LTUS:4: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, "LGPS:LTUS:4:MCORDEVNAME") { field(DESC, "PS device name") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, "PS:LTUS:4:") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "LGPS:LTUS:4: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, "LGPS:LTUS:4:PSTYPE.RVAL") field(INPC, "LGPS:LTUS:4:TURNEDOFF.RVAL") field(INPD, "LGPS:LTUS:4:CONFIG.RVAL") field(INPE, "LGPS:LTUS:4:PSCATEGORY.RVAL") field(INPF, "LGPS:LTUS:4:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "LGPS:LTUS:4:AUTOCTRL.RVAL") field(INPJ, "LGPS:LTUS:4:OUTOFSERVICE.RVAL") field(INPL, "LGPS:LTUS:4:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "LGPS:LTUS:4:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "LGPS:LTUS:4:PAU") field(INPP, "LGPS:LTUS:4:CALBDISABLE.RVAL") field(INPQ, "LGPS:LTUS:4:PTRBDISABLE.RVAL") field(INPR, "LGPS:LTUS:4:TRIMDISABLE.RVAL") field(INPS, "LGPS:LTUS:4:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "LGPS:LTUS:4:FBCK") field(INPU, "LGPS:LTUS:4:TRIMTYPE.RVAL") field(INPV, "LGPS:LTUS:4:STDZDIRECT.RVAL") field(INPW, "LGPS:LTUS:4:DEGAUSENABLE.RVAL") field(FLNK, "LGPS:LTUS:4:HSTA") } record(longin, "LGPS:LTUS:4:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "LGPS:LTUS:4:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "LGPS:LTUS:4: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, "LGPS:LTUS:4: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, "LGPS:LTUS:4: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, "LGPS:LTUS:4: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, "LGPS:LTUS:4: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, "LGPS:LTUS:4: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 LGPS:LTUS:4:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses LGPS:LTUS:4:FBCK. # This PV should be replaced by LGPS:LTUS:4: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, "LGPS:LTUS:4: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, "LGPS:LTUS:4: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, "LGPS:LTUS:4: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, "") field(OMSL, "supervisory") field(FLNK, "LGPS:LTUS:4:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"LGPS:LTUS:4:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "LGPS:LTUS:4:OUTOFSERVICE NPP NMS") field(OUT, "LGPS:LTUS:4:ONLINE PP") } record(bo, "LGPS:LTUS:4:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "LGPS:LTUS:4: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, "1") } record(bo, "LGPS:LTUS:4: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, "1") } record(bo, "LGPS:LTUS:4: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, "1") } # This PV is modified by :STATSUB.U record(bo, "LGPS:LTUS:4: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, "LGPS:LTUS:4: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, "LGPS:LTUS:4: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, "LGPS:LTUS:4: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, "LGPS:LTUS:4: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, "1") field(ASG, "NOWRITE") } record(mbbo, "LGPS:LTUS:4: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, "2") field(ASG, "NOWRITE") } record(mbbo, "LGPS:LTUS:4: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, "3") field(ASG, "NOWRITE") } record(mbbo, "LGPS:LTUS:4: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, "0") field(ASG, "NOWRITE") field(FLNK, "LGPS:LTUS:4:TRIMTYPE") } record(stringout, "LGPS:LTUS:4:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "LGPS:LTUS:4:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "LGPS:LTUS:4:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "LGPS:LTUS:4:STATE.RVAL") field(INPB, "LGPS:LTUS:4:INTLKSUMY.RVAL") field(OUT, "LGPS:LTUS:4:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "LGPS:LTUS:4: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, "LGPS:LTUS:4:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "LGPS:LTUS:4:STATE.RVAL") field(INPB, "LGPS:LTUS:4:INTLKSUMY.RVAL") field(OUT, "LGPS:LTUS:4:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "LGPS:LTUS:4:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "LGPS:LTUS:4:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "LGPS:LTUS:4: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, "LGPS:LTUS:4: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, "LGPS:LTUS:4: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, "LGPS:LTUS:4: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,"LGPS:LTUS:4: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("LGPS:LTUS:4:TURNEDOFF",3140,1907,0,1,"LGPS:LTUS:4:TURNEDOFF") #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "LGPS:LTUS:4:STATSUB") { field(DESC, "Build STATus ") field(INAM, "mgntInit") field(SNAM, "mgntSlcStat") field(INPA, "LGPS:LTUS:4:BACT.STAT") field(INPB, "LGPS:LTUS:4:BDES.STAT") field(INPC, "LGPS:LTUS:4:IRIPL.STAT") field(INPD, "PS:LTUS:4:ISETPT.STAT") field(INPE, "PS:LTUS:4:IACT.STAT") # 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, "LGPS:LTUS:4:BACT.SEVR") field(INPH, "LGPS:LTUS:4:BDES.SEVR") field(INPI, "LGPS:LTUS:4:IRIPL.SEVR") field(INPJ, "PS:LTUS:4:ISETPT.SEVR") field(INPK, "PS:LTUS:4:IACT.SEVR") # # 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, "LGPS:LTUS:4:STATE.RVAL") field(INPN, "LGPS:LTUS:4:STDZOK") field(INPO, "LGPS:LTUS:4:CALBOK") field(INPP, "LGPS:LTUS:4:OUTOFSERVICE.RVAL") field(INPQ, "LGPS:LTUS:4:CONFIG.RVAL") field(INPR, "LGPS:LTUS:4:HSTA") field(INPS, "LGPS:LTUS:4:CTRL.RVAL") field(INPT, "LGPS:LTUS:4:DEGAUSOK") field(INPV, "LGPS:LTUS:4: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, "LGPS:LTUS:4:STAT") } record(longout, "LGPS:LTUS:4:STAT") { field(DESC, "STAT sent to SLC") field(SCAN, "Passive") field(FLNK, "LGPS:LTUS:4:STATCTRLSUB") field(DOL, "LGPS:LTUS:4:STATSUB.VAL") field(OMSL, "closed_loop") } record(sSub, "LGPS:LTUS:4:STATCTRLSUB") { field(DESC, "Decode SLC STAT into mbbo") field(INAM, "mgntInit") field(SNAM, "mgntStatDecode") field(INPA, "LGPS:LTUS:4:STAT") field(INPB, "LGPS:LTUS:4:HSTA") field(INPD, "LGPS:LTUS:4:ONOFFCTRL.RVAL") field(FLNK, "LGPS:LTUS:4:STATMSG") } record(mbbo, "LGPS:LTUS:4: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, "LGPS:LTUS:4:UNAVAILGO") field(DOL, "LGPS:LTUS:4:STATCTRLSUB.W") } record(seq, "LGPS:LTUS:4:UNAVAILGO") { field(DESC, "Process UNAVAIL") field(DOL1, "LGPS:LTUS:4:STATSUB.U") field(LNK1, "LGPS:LTUS:4:UNAVAIL PP") } record(stringout, "LGPS:LTUS:4:SNLSTATMSG") { field(DTYP, "Soft Channel") } #! TextBox(TB0,820,1000,1200,1220,0,"Dialog",12,1,16777215,"LGPS:LTUS:4:STATUSSUB - future\nOverall device status - takes input from action snls, record sevrs, master snl(s) and outputs final status\n\nInputs:\nA - LGPS:LTUS:4:CTRLSTATUS - snl status\nB - MGNT:CTRLSTATUS - master list status\nC\nD - LGPS:LTUS:4: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,"LGPS:LTUS:4STATSUB\nformat control bo's into slc STAT\n\nInputs:\nA - LGPS:LTUS:4:STATUS\nC - LGPS:LTUS:4:ON\nD - LGPS:LTUS:4:STDZOK\nE - LGPS:LTUS:4:CALBOK\nF - LGPS:LTUS:4:BACTDRIFT (future)\nG -\nH- LGPS:LTUS:4:DACSTATUS\nI -LGPS:LTUS:4:ADCSTATUS\nJ - LGPS:LTUS:4:BACTSTATUS\nK - LGPS:LTUS:4:BDESSTATUS\nL - LGPS:LTUS:4:RIPLSTATUS\n\nOutput:\nP - LGPS:LTUS:4: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, "LGPS:LTUS:4: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, "LGPS:LTUS:4: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, "LGPS:LTUS:4: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, "LGPS:LTUS:4: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.6 #! DBDSTART #! DBD("../../../../dbd/mgntSoft.dbd") #! DBDEND record(stringout, "LGPS:LTUS:4:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "LGPS:LTUS:4:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "LGPS:LTUS:4:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "LGPS:LTUS:4:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "LGPS:LTUS:4:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "LGPS:LTUS:4:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "1") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "LGPS:LTUS:4: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, "LGPS:LTUS:4:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "LGPS:LTUS:4:TRIMTYPE.RVAL") field(INPB, "LGPS:LTUS:4:CONFIG.RVAL") field(OUT, "LGPS:LTUS:4:TRIMMAXNUM PP") } record(longout, "LGPS:LTUS:4: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, "LGPS:LTUS:4:TRIMRAMPRATE") { field(DESC, "Trim Ramp rate ") field(PINI, "YES") field(ASG, "IOC_MAINT") field(PREC, "3") field(EGU, "Volts/sec") field(HOPR, "20.0") field(DRVH, "20.0") field(DRVL, "0.1") field(LOPR, "0.5") # field(DOL, "") field(OMSL, "supervisory") field(VAL, "10") field(OUT, "LGPS:LTUS:4:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "LGPS:LTUS:4: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, "") field(OMSL, "supervisory") field(VAL, "10") } record(bo, "LGPS:LTUS:4: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, "LGPS:LTUS:4: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, "LGPS:LTUS:4:TRIMSTEPMIN") { field(DESC, "Min step in current") field(DTYP, "Soft Channel") # field(DOL, "") field(PREC, "7") field(EGUF, "10") field(EGUL, "0") field(EGU, "Volts") field(HOPR, "10") field(LOPR, "0") field(VAL, "5.0") } record(bo, "LGPS:LTUS:4:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "0") } record(ao, "LGPS:LTUS:4: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, "LGPS:LTUS:4:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "LGPS:LTUS:4: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, "LGPS:LTUS:4: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, "LGPS:LTUS:4:IMOVE") field(INPB, "LGPS:LTUS:4:IACT") field(INPC, "LGPS:LTUS:4:IRAMPRATE") field(INPD, "1.0") field(INPE, "LGPS:LTUS:4:TRIMDLYPCT") field(INPF, "LGPS:LTUS:4:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "LGPS:LTUS:4:RAMPTIME_LEFT PP") } record(longout, "LGPS:LTUS:4:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "LGPS:LTUS:4:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "LGPS:LTUS:4:RAMPDONE_CALC") } record(calc, "LGPS:LTUS:4:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "LGPS:LTUS:4:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "LGPS:LTUS:4:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "LGPS:LTUS:4: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, "LGPS:LTUS:4:RAMPTIME_LEFT") field(OUT, "LGPS:LTUS:4:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "LGPS:LTUS:4:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "LGPS:LTUS:4:RAMPTIME_LEFT NMS") field(OUT, "LGPS:LTUS:4:RAMPDONE PP") } record(bo, "LGPS:LTUS:4:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "LGPS:LTUS:4:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "LGPS:LTUS:4: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, "LGPS:LTUS:4: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(ai, "LGPS:LTUS:4: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, "LGPS:LTUS:4:MPSBTOL") { field(DESC, "Absolute mps tol") field(EGU, "Volts") field(PREC, "2") field(CALC, "ABS(A)*0.02") field(INPA, "LGPS:LTUS:4:BMAX") field(PINI, "YES") } # # 21-Aug-2013: K. Luchini # Set channel access security so that users # cannot easily change values. record(ao, "LGPS:LTUS:4:MPSBMAX") { field(DESC, "MPS Max B-field") field(EGU, "Volts") field(PREC, "7") field(DRVH, "50.0") field(DRVL, "0.0") field(PINI, "YES") field(VAL, "50.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "LGPS:LTUS:4:MPSBMIN") { field(DESC, "MPS Min B-field") field(EGU, "Volts") field(PREC, "7") field(DRVH, "50.0") field(DRVL, "0.0") field(PINI, "YES") field(VAL, "0.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "LGPS:LTUS:4:MPSBLLIM") { field(DESC, "MPS Low Limit B-field") field(EGU, "Volts") field(PREC, "7") field(DRVH, "50.0") field(DRVL, "0.0") field(PINI, "YES") field(VAL, "0.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "LGPS:LTUS:4:MPSBLLIM2") { field(DESC, "MPS Low Limit #2 B-field") field(EGU, "Volts") field(PREC, "7") field(DRVH, "50.0") field(DRVL, "0.0") field(PINI, "YES") field(VAL, "0.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } # Set the default to Std record(mbbo, "LGPS:LTUS:4: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, "LGPS:LTUS:4:MPSLIMITS.E PP") } record(aSub, "LGPS:LTUS:4: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, "LGPS:LTUS:4:MPS.RVAL") field(INPB, "LGPS:LTUS:4:BADIFF") field(INPC, "LGPS:LTUS:4:BDELTAS.N") field(INPD, "LGPS:LTUS:4:BACT") field(INPE, "LGPS:LTUS:4:MPSBITMASK.RVAL") field(INPF, "LGPS:LTUS:4:MPSBLLIM") field(INPG, "LGPS:LTUS:4:MPSBMIN") field(INPH, "LGPS:LTUS:4:MPSBMAX") field(INPI, "LGPS:LTUS:4: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, "LGPS:LTUS:4:INTOL.RVAL PP") field(OUTB, "LGPS:LTUS:4:INTOL_BMIN.RVAL PP") field(OUTC, "LGPS:LTUS:4:INTOL_BRANGE.RVAL PP") field(OUTD, "LGPS:LTUS:4: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, "LGPS:LTUS:4:INTOL") { field(DESC, "BACT within MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "LGPS:LTUS:4:MPSLIMITS.VALA") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "LGPS:LTUS:4:INTOL_BMIN") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "LGPS:LTUS:4:MPSLIMITS.VALB") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "LGPS:LTUS:4:INTOL_BMIN2") { field(DESC, "MPS tol #2") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "LGPS:LTUS:4:MPSLIMITS.VALD") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "LGPS:LTUS:4:INTOL_BRANGE") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "LGPS:LTUS:4: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, "LGPS:LTUS:4:CHCKITOL") { field(DESC, "Absolute Check I Tolerance") field(EGU, "A") field(FLNK, "LGPS:LTUS:4:TRIMITOL") field(CALC, "ABS(A*B)") field(INPA, "LGPS:LTUS:4:CHCKBTOL") field(INPB, "LGPS:LTUS:4:POLYCOEF.B") field(PREC, "9") } record(calc, "LGPS:LTUS:4:TRIMBTOL") { field(EGU, "Volts") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(DESC, "Absolute Trim Tolerance") field(CALC, "ABS(A)/2") field(INPA, "LGPS:LTUS:4:CHCKBTOL") field(FLNK, "LGPS:LTUS:4:CHCKITOL") } record(calc, "LGPS:LTUS:4:CHCKBTOL") { field(DESC, "Check absolute tolerance") field(EGU, "A") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(FLNK, "LGPS:LTUS:4:TRIMBTOL") field(CALC, "MAX(ABS(A),ABS(C))*(B/1000000)") field(INPA, "LGPS:LTUS:4:BDES.HOPR") field(INPB, "LGPS:LTUS:4:STABILITY") field(INPC, "LGPS:LTUS:4:BDES.LOPR") } record(longout, "LGPS:LTUS:4:STABILITY") { field(DESC, "Long Term Stability") field(PINI, "YES") field(VAL, "1000") field(EGU, "ppm") field(DRVH, "20000") field(DRVL, "100") field(HOPR, "20000") field(LOPR, "100") field(FLNK, "LGPS:LTUS:4:CHCKBTOL") } record(calc, "LGPS:LTUS:4:TRIMITOL") { field(DESC, "Absolute Trim I Tolerance") field(EGU, "Volts") field(CALC, "ABS(A*B)") field(INPA, "LGPS:LTUS:4:POLYCOEF.B") field(INPB, "LGPS:LTUS:4:TRIMBTOL") field(PREC, "9") } record(ai, "LGPS:LTUS:4:TRIMBTOLR") { field(DESC, "Relative trim tol") field(PREC, "4") field(EGU, "%") field(HOPR, "1.0") field(LOPR, "0.0") field(PINI, "YES") } record(ai, "LGPS:LTUS:4: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.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "LGPS:LTUS:4: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, "LGPS:LTUS:4:PSTYPE.RVAL") field(INPC, "LGPS:LTUS:4:TURNEDOFF.RVAL") field(INPD, "LGPS:LTUS:4:CONFIG.RVAL") field(INPE, "LGPS:LTUS:4:PSCATEGORY.RVAL") field(INPF, "LGPS:LTUS:4:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "LGPS:LTUS:4:AUTOCTRL.RVAL") field(INPJ, "LGPS:LTUS:4:OUTOFSERVICE.RVAL") field(INPL, "LGPS:LTUS:4:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "LGPS:LTUS:4:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "LGPS:LTUS:4:PAU") field(INPP, "LGPS:LTUS:4:CALBDISABLE.RVAL") field(INPQ, "LGPS:LTUS:4:PTRBDISABLE.RVAL") field(INPR, "LGPS:LTUS:4:TRIMDISABLE.RVAL") field(INPS, "LGPS:LTUS:4:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "LGPS:LTUS:4:FBCK") field(INPU, "LGPS:LTUS:4:TRIMTYPE.RVAL") field(INPV, "LGPS:LTUS:4:STDZDIRECT.RVAL") field(INPW, "LGPS:LTUS:4:DEGAUSENABLE.RVAL") field(FLNK, "LGPS:LTUS:4:HSTA") } record(longin, "LGPS:LTUS:4:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "LGPS:LTUS:4:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "LGPS:LTUS:4: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, "LGPS:LTUS:4: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, "LGPS:LTUS:4: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, "LGPS:LTUS:4: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, "LGPS:LTUS:4: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, "LGPS:LTUS:4: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 LGPS:LTUS:4:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses LGPS:LTUS:4:FBCK. # This PV should be replaced by LGPS:LTUS:4: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, "LGPS:LTUS:4: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, "LGPS:LTUS:4: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, "LGPS:LTUS:4: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, "") field(OMSL, "supervisory") field(FLNK, "LGPS:LTUS:4:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"LGPS:LTUS:4:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "LGPS:LTUS:4:OUTOFSERVICE NPP NMS") field(OUT, "LGPS:LTUS:4:ONLINE PP") } record(bo, "LGPS:LTUS:4:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "PS:LTUS:4:CommLink PP") } record(bo, "LGPS:LTUS:4: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, "1") } record(bo, "LGPS:LTUS:4: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, "1") } record(bo, "LGPS:LTUS:4: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, "1") } # This PV is modified by :STATSUB.U record(bo, "LGPS:LTUS:4: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, "LGPS:LTUS:4: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, "LGPS:LTUS:4: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, "LGPS:LTUS:4: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, "LGPS:LTUS:4: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, "1") field(ASG, "NOWRITE") } record(mbbo, "LGPS:LTUS:4: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, "2") field(ASG, "NOWRITE") } record(mbbo, "LGPS:LTUS:4: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, "5") field(ASG, "NOWRITE") } record(mbbo, "LGPS:LTUS:4: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, "0") field(ASG, "NOWRITE") field(FLNK, "LGPS:LTUS:4:TRIMTYPE") } record(stringout, "LGPS:LTUS:4:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "LGPS:LTUS:4:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "LGPS:LTUS:4:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "LGPS:LTUS:4:STATE.RVAL") field(INPB, "LGPS:LTUS:4:INTLKSUMY.RVAL") field(OUT, "LGPS:LTUS:4:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "LGPS:LTUS:4: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, "LGPS:LTUS:4:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "LGPS:LTUS:4:STATE.RVAL") field(INPB, "LGPS:LTUS:4:INTLKSUMY.RVAL") field(OUT, "LGPS:LTUS:4:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "LGPS:LTUS:4:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "LGPS:LTUS:4:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "LGPS:LTUS:4: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, "LGPS:LTUS:4: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, "LGPS:LTUS:4: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, "LGPS:LTUS:4: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,"LGPS:LTUS:4: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("LGPS:LTUS:4:TURNEDOFF",3140,1907,0,1,"LGPS:LTUS:4:TURNEDOFF") #! 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, "LGPS:LTUS:5:IACT") { field(DESC, "Current") field(INP, "PS:LTUS:5:IACT") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "LGPS:LTUS:5:BACT") info(autosaveFields,"HYST") } record(bi, "LGPS:LTUS:5:STATE") { field(DESC, "PS On/Off Status") field(DTYP, "Raw Soft Channel") field(INP, "PS:LTUS:5:STATE CP MS") field(ZSV, "MAJOR") field(ZNAM, "OFF") field(ONAM, "ON") } record(ao, "LGPS:LTUS:5:IDES") { field(DESC, "Desired Current") field(PREC, "3") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(MDEL, "-1") field(HIHI, "50.0") field(LOLO, "0.0") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "LGPS:LTUS:5:BDELTAS") field(DRVH, "50.0") field(DRVL, "0.0") field(DOL, "LGPS:LTUS:5: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, "LGPS:LTUS:5:ICTRL PP") } # This record is processed by LGPS:LTUS:5:ICON") # Note: we are not setting alarms here. record(ao, "LGPS:LTUS:5:ICON") { field(DESC, "Config I") field(DTYP, "Soft Channel") field(PREC, "3") field(HOPR, "50.0") field(LOPR, "0.0") field(DRVH, "50.0") field(DRVL, "0.0") field(DOL, "LGPS:LTUS:5:B2ICON.K") field(OMSL, "closed_loop") info(autosaveFields,"VAL") } record(ao, "LGPS:LTUS:5:INOM") { field(DESC, "Nominal Current") field(DOL, "LGPS:LTUS:5:BNOM.K") field(OMSL, "closed_loop") field(PREC, "3") field(EGU, "Volts") field(DRVH, "50.0") field(DRVL, "0.0") field(HOPR, "50.0") field(LOPR, "0.0") } record(ao, "LGPS:LTUS:5:ICTRL") { field(DESC, "Set Current") field(PREC, "3") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(DRVH, "50.0") field(DRVL, "0.0") field(MDEL, "-1") field(FLNK, "LGPS:LTUS:5:ICTRLGO") field(OMSL, "supervisory") info(autosavefields,"VAL") } record(seq, "LGPS:LTUS:5:ICTRLGO") { field(DESC, "Process Current Setpoint") field(PREC, "3") # Set ISETPT to supervisory field(DOL1, "0") field(LNK1, "LGPS:LTUS:5:ISETPT.OMSL") field(DOL2, "LGPS:LTUS:5:ICTRL") field(LNK2, "LGPS:LTUS:5:ISETPT PP") # Set ISETPT to closed loop - get data from BCTRLSUB.K field(DOL3, "1") field(LNK3, "LGPS:LTUS:5:ISETPT.OMSL") } record(ao, "LGPS:LTUS:5:IMAX") { field(DESC, "Max I") field(DTYP, "Soft Channel") field(DRVH, "50.0") field(DRVL, "0.0") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(PINI, "YES") field(VAL, "50.0") field(FLNK, "LGPS:LTUS:5:IMIN") } record(ao, "LGPS:LTUS:5:IMIN") { field(DESC, "Min I") field(DTYP, "Soft Channel") field(DRVH, "50.0") field(DRVL, "0.0") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(VAL, "0.0") field(FLNK, "LGPS:LTUS:5:IRANGE") } record(sel, "LGPS:LTUS:5:IACTPREVOK") { field(DESC, "Last Good Current") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(NVL, "LGPS:LTUS:5:BACT.SEVR") field(INPA, "LGPS:LTUS:5:IACT NPP MS") field(INPB, "LGPS:LTUS:5:IACTPREVOK NPP MS") field(INPC, "LGPS:LTUS:5:IACTPREVOK NPP MS") field(INPD, "LGPS:LTUS:5:IACTPREVOK NPP MS") } record(sub, "LGPS:LTUS:5:IACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "LGPS:LTUS:5:IDES") field(INPB, "LGPS:LTUS:5:ISETPT.DRVH") field(INPC, "LGPS:LTUS:5:ISETPT.DRVL") field(INPD, "LGPS:LTUS:5:IDELTAS.I") field(INPE, "LGPS:LTUS:5:IDELTAS.J") field(INPG, "LGPS:LTUS:5:STATE") field(INPH, "LGPS:LTUS:5:HSTA") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(sub, "LGPS:LTUS:5:IMONLIMITS") { field(DESC, "Aux Current Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "LGPS:LTUS:5:IDES") field(INPB, "LGPS:LTUS:5:ISETPT.DRVH") field(INPC, "LGPS:LTUS:5:ISETPT.DRVL") field(INPD, "LGPS:LTUS:5:IDELTAS.K") field(INPE, "LGPS:LTUS:5:IDELTAS.L") field(INPG, "LGPS:LTUS:5:STATE") field(INPH, "LGPS:LTUS:5:HSTA") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(seq, "LGPS:LTUS:5:ILIMITS") { field(DESC, "Set ACT and MON Limits") field(PREC, "3") field(DOL1, "LGPS:LTUS:5:BLIMITS") field(LNK1, "LGPS:LTUS:5:IACTLIMITS.F PP") field(DOL2, "LGPS:LTUS:5:IACTLIMITS.I") field(LNK2, "LGPS:LTUS:5:IACT.HIGH") field(DOL3, "LGPS:LTUS:5:IACTLIMITS.J") field(LNK3, "LGPS:LTUS:5:IACT.LOW") field(DOL4, "LGPS:LTUS:5:IACTLIMITS.K") field(LNK4, "LGPS:LTUS:5:IACT.HIHI") field(DOL5, "LGPS:LTUS:5:IACTLIMITS.L") field(LNK5, "LGPS:LTUS:5:IACT.LOLO") field(DOL6, "LGPS:LTUS:5:BLIMITS") field(LNK6, "LGPS:LTUS:5:IMONLIMITS.F PP") field(DOL7, "LGPS:LTUS:5:IMONLIMITS.I") field(LNK7, "LGPS:LTUS:5:IMON.HIGH") field(DOL8, "LGPS:LTUS:5:IMONLIMITS.J") field(LNK8, "LGPS:LTUS:5:IMON.LOW") field(DOL9, "LGPS:LTUS:5:IMONLIMITS.K") field(LNK9, "LGPS:LTUS:5:IMON.HIHI") field(DOLA, "LGPS:LTUS:5:IMONLIMITS.L") field(LNKA, "LGPS:LTUS:5: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, "LGPS:LTUS:5:IDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntRawDeltas") field(INPD, "LGPS:LTUS:5:TRIMBTOL") field(INPE, "LGPS:LTUS:5:CHCKBTOL") field(INPF, "LGPS:LTUS:5:BDELTAS.K") field(INPG, "LGPS:LTUS:5:BDELTAS.L") field(INPH, "LGPS:LTUS:5:B2IDES.L") field(EGU, "Volts") field(HOPR, "1") field(PREC, "3") field(BRSV, "INVALID") # # Used to calcualte standardize tolerance # which is returned in the VAL field. # field(INPB, "LGPS:LTUS:5:STDZITOLR") field(INPC, "LGPS:LTUS:5:STDZITOL") field(FLNK, "") } # All ps controllers with on/off control will set the macro ONOF # as follows: # # ONOF = PS:LTUS:5: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, "LGPS:LTUS:5:STATESETPT") { field(DESC, "PS On/Off") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFF") field(ONAM, "ON") field(OUT, "PS:LTUS:5:STATESETPT PP") 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:LTUS:5:RESET PP # record(bo, "LGPS:LTUS:5:RESET") { field(DESC, "Interlock Latch Reset") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFF") field(ONAM, "ON") field(HIGH, "1.0") field(OUT, "PS:LTUS:5:RESET PP") } record(bo, "LGPS:LTUS:5:RAMPSTATE") { field(DESC, "PS Ramp Status") field(DTYP, "Soft Channel") field(DOL, "PS:LTUS:5:RAMPSTATE") 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, "LGPS:LTUS:5: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, "Volts/sec") field(PREC, "3") # Set default to trim ramp rate on boot # but need to change for degauss function. field(DOL, "LGPS:LTUS:5:TRIMRAMPRATE") field(OUT, "") field(FLNK, "LGPS:LTUS:5:STDZDLY") } record(ao, "LGPS:LTUS:5:ISETPT") { field(DESC, "Current Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(DRVH, "50.0") field(DRVL, "0.0") field(MDEL, "-1") field(OUT, "PS:LTUS:5:ISETPT PP") field(DOL, "LGPS:LTUS:5: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, "LGPS:LTUS:5:IMON") { field(DESC, "Aux Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(INP, "") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "LGPS:LTUS:5:BMON") } record(ao, "LGPS:LTUS:5:IRIPL") { field(DESC, "Ripple Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(DOL, "") field(OMSL, "closed_loop") field(EGU, "Volts") field(DRVH, "1.0") field(HOPR, "1.0") field(PREC, "3") field(FLNK, "LGPS:LTUS:5:IRIPLOK") } record(sub, "LGPS:LTUS:5:IRIPLOK") { field(DESC, "Ripple Current Status") field(INAM, "mgntInit") field(SNAM, "mgntRiplOK") field(INPA, "LGPS:LTUS:5:IRIPL.VAL") field(INPB, "LGPS:LTUS:5: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, "LGPS:LTUS:5:R") { field(DESC, "Resistance") field(EGU, "Ohms") field(PREC, "4") field(PINI, "YES") field(DOL, "") 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, "LGPS:LTUS:5:IGND") { field(DESC, "Ground Current") field(EGU, "Volts") field(PREC, "6") field(PINI, "YES") field(DOL, "") field(OMSL, "closed_loop") } record(bi, "LGPS:LTUS:5:INTLKSUMY") { field(DESC, "Interlock Summary") field(INP, "PS:LTUS:5:INTLKSUMY CP MS") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(ZNAM, "OK") field(ONAM, "FAULT") field(PINI, "NO") } record(mbbo, "LGPS:LTUS:5: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:LTUS:5:COOLING") field(OMSL, "closed_loop") } # The following PV is processed by :BACTFO # which is processed by :BACT record(fanout, "LGPS:LTUS:5:IACTFO") { field(DESC, "IACT processing") field(SELM, "All") field(LNK1, "LGPS:LTUS:5:IACTPREVOK") field(LNK2, "LGPS:LTUS:5:IDIFF") field(LNK3, "LGPS:LTUS:5:IADIFF") field(LNK4, "LGPS:LTUS:5:IRATIO") field(LNK5, "LGPS:LTUS:5:IDIRECT") field(LNK6, "LGPS:LTUS:5:IACTPOL_CHECK") } record(calc, "LGPS:LTUS:5:IDIFF") { field(DESC, "IDES-IACT") field(CALC, "A-B") field(INPA, "LGPS:LTUS:5:IDES") field(INPB, "LGPS:LTUS:5:IACT") field(EGU, "Volts") field(PREC, "9") field(HOPR, "50.0") field(LOPR, "0.0") } record(calc, "LGPS:LTUS:5:IADIFF") { field(DESC, "Absolute IDES-IACT") field(CALC, "A<0?ABS(A):A") field(INPA, "LGPS:LTUS:5:IDIFF") field(PREC, "9") } record(calc, "LGPS:LTUS:5:IRATIO") { field(DESC, "IDES-IACT/IMAX") field(CALC, "B?A/B:0") field(INPA, "LGPS:LTUS:5:IDIFF") field(INPB, "LGPS:LTUS:5:IDES.DRVH") field(PREC, "9") } record(calcout, "LGPS:LTUS:5:IRANGE") { field(DESC, "Current Range") field(PINI, "YES") field(CALC, "ABS(A-B)") field(INPA, "LGPS:LTUS:5:IMIN") field(INPB, "LGPS:LTUS:5: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, "LGPS:LTUS:5: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, "LGPS:LTUS:5:IACT") field(FLNK, "LGPS:LTUS:5:IACTPOL") } record(bo, "LGPS:LTUS:5:IACTPOL") { field(DESC, "Actual I Polarity") field(DTYP, "Raw Soft Channel") field(DOL, "LGPS:LTUS:5: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,"LGPS:LTUS:5:I*LIMITS:\n Calculate alarm and warning limits based on \n deltas from LGPS:LTUS:5:IDELTAS and the\n LGPS:LTUS:5: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,"LGPS:LTUS:5:IACT: \n Get copy of LGPS:LTUS:5:I. \n",null) #! TextBox(TB12,1280,3100,1760,3200,0,"Dialog",12,1,16777215,"LGPS:LTUS:5: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,"LGPS:LTUS:5:IDES:\n Contains raw value calculated by \nLGPS:LTUS:5: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 \nLGPS:LTUS:5:BDELTAS.\n",null) #! TextBox(TB10,56,1940,316,2340,0,"Dialog",12,1,16777215,"LGPS:LTUS:5: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 LGPS:LTUS:5: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 LGPS:LTUS:5: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,"LGPS:LTUS:5:ISETPT:\n Sets the hardware. When fast feedback is set on, this record is\n set to closed loop mode by LGPS:LTUS:5:FBCKSTART sequence. When \n the loop is closed, this record takes input calculated by \n BFBCK only. When fast feedback is set off, LGPS:LTUS:5:FBCKSTOP \n will set it back to supervisory so that the value can be set by \n LGPS:LTUS:5: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, "LGPS:LTUS:5:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "LGPS:LTUS:5:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "LGPS:LTUS:5:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "LGPS:LTUS:5:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "LGPS:LTUS:5:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "LGPS:LTUS:5:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "1") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "LGPS:LTUS:5: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, "LGPS:LTUS:5:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "LGPS:LTUS:5:TRIMTYPE.RVAL") field(INPB, "LGPS:LTUS:5:CONFIG.RVAL") field(OUT, "LGPS:LTUS:5:TRIMMAXNUM PP") } record(longout, "LGPS:LTUS:5: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, "LGPS:LTUS:5:TRIMRAMPRATE") { field(DESC, "Trim Ramp rate ") field(PINI, "YES") field(ASG, "IOC_MAINT") field(PREC, "3") field(EGU, "Volts/sec") field(HOPR, "20.0") field(DRVH, "20.0") field(DRVL, "0.1") field(LOPR, "0.5") # field(DOL, "") field(OMSL, "supervisory") field(VAL, "10") field(OUT, "LGPS:LTUS:5:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "LGPS:LTUS:5: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, "") field(OMSL, "supervisory") field(VAL, "10") } record(bo, "LGPS:LTUS:5: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, "LGPS:LTUS:5: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, "LGPS:LTUS:5:TRIMSTEPMIN") { field(DESC, "Min step in current") field(DTYP, "Soft Channel") # field(DOL, "") field(PREC, "7") field(EGUF, "10") field(EGUL, "0") field(EGU, "Volts") field(HOPR, "10") field(LOPR, "0") field(VAL, "5.0") } record(bo, "LGPS:LTUS:5:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "0") } record(ao, "LGPS:LTUS:5: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, "LGPS:LTUS:5:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "LGPS:LTUS:5: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, "LGPS:LTUS:5: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, "LGPS:LTUS:5:IMOVE") field(INPB, "LGPS:LTUS:5:IACT") field(INPC, "LGPS:LTUS:5:IRAMPRATE") field(INPD, "1.577") field(INPE, "LGPS:LTUS:5:TRIMDLYPCT") field(INPF, "LGPS:LTUS:5:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "LGPS:LTUS:5:RAMPTIME_LEFT PP") } record(longout, "LGPS:LTUS:5:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "LGPS:LTUS:5:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "LGPS:LTUS:5:RAMPDONE_CALC") } record(calc, "LGPS:LTUS:5:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "LGPS:LTUS:5:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "LGPS:LTUS:5:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "LGPS:LTUS:5: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, "LGPS:LTUS:5:RAMPTIME_LEFT") field(OUT, "LGPS:LTUS:5:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "LGPS:LTUS:5:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "LGPS:LTUS:5:RAMPTIME_LEFT NMS") field(OUT, "LGPS:LTUS:5:RAMPDONE PP") } record(bo, "LGPS:LTUS:5:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "LGPS:LTUS:5:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "LGPS:LTUS:5: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, "LGPS:LTUS:5: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, "LGPS:LTUS:5:STDZINIT") { field(DESC, "Proc. Stdz PVs on boot") field(PINI, "YES") field(DOL1, "1") field(DOL2, "1") field(DOL3, "1") field(LNK1, "LGPS:LTUS:5:DEBUG.PROC PP") field(LNK2, "LGPS:LTUS:5:STDZCYCLENUM.PROC PP") field(LNK3, "LGPS:LTUS:5:STDZDISABLE.PROC PP") field(LNK4, "LGPS:LTUS:5: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, "LGPS:LTUS:5:STDZSUB") { field(DESC, "Stdz subroutine") field(INAM, "mgntStdzInit") field(SNAM, "mgntStdz") field(BRSV, "INVALID") field(INPA, "LGPS:LTUS:5:STDZIMIN NPP NMS") field(INPB, "LGPS:LTUS:5:STDZIMAX NPP NMS") field(INPC, "LGPS:LTUS:5:STDZIFINAL NPP NMS") field(INPD, "LGPS:LTUS:5:STDZCYCLENUM NPP NMS") field(INPE, "LGPS:LTUS:5:STDZDIRECT.RVAL NPP NMS") field(INPF, "LGPS:LTUS:5:STDZDISABLE.RVAL CPP NMS") field(INPG, "LGPS:LTUS:5: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, "LGPS:LTUS:5:STDZWF PP") field(OUTB, "LGPS:LTUS:5: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, "LGPS:LTUS:5:STDZWF") } record(mbbo, "LGPS:LTUS:5: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, "LGPS:LTUS:5: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, "LGPS:LTUS:5:STDZMAINPS") { field(DESC, "Stdz by main or self") field(PINI, "YES") field(DTYP, "Soft Channel") field(ZNAM, "SELF") field(ONAM, "MAIN") } record(bo, "LGPS:LTUS:5: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, "LGPS:LTUS:5: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, "LGPS:LTUS:5: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, "LGPS:LTUS:5:STDZTOD") { field(DESC, "Successful Standardize Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "LGPS:LTUS:5:STDZLOSTTOD") { field(DESC, "Standardize Lost Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(longout, "LGPS:LTUS:5:STDZCYCLECNT") { field(DESC, "Cycle Count") field(PINI, "YES") } record(longout, "LGPS:LTUS:5:STDZCYCLENUM") { field(DESC, "No. Standardize Cycles") field(VAL, "3") field(HOPR, "10") field(LOPR, "0") field(DRVH, "10") field(DRVL, "0") field(PINI, "YES") field(FLNK, "LGPS:LTUS:5:STDZDIRECT") } # The default standardize direction is "UP" for # all LCLS Magnets.. record(bo, "LGPS:LTUS:5:STDZDIRECT") { field(DESC, "Standardize Direction ") field(ZNAM, "UP") field(ONAM, "DOWN") field(VAL, "0") field(FLNK, "LGPS:LTUS:5:STDZIMIN") } record(ao, "LGPS:LTUS:5:STDZIMIN") { field(DESC, "Min-STDZ Current") field(PREC, "1") field(EGU, "A") field(HOPR, "50.0") field(LOPR, "0.0") field(VAL, "0.0") field(FLNK, "LGPS:LTUS:5:STDZIMAX") } record(ao, "LGPS:LTUS:5:STDZIMAX") { field(DESC, "Max. Standarize Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "50.0") field(LOPR, "0.0") field(VAL, "50.0") field(FLNK, "LGPS:LTUS:5:STDZIFINAL") } record(ao, "LGPS:LTUS:5:STDZIFINAL") { field(DESC, "Final SDTZ Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "50.0") field(LOPR, "0.0") field(VAL, "0.0") field(FLNK, "LGPS:LTUS:5: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, "LGPS:LTUS:5: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, "LGPS:LTUS:5:STDZITOL") { field(DESC, "Stdz min tolerance") field(PREC, "5") field(CALC, "MAX(ABS(A),ABS(B))*C") field(INPA, "LGPS:LTUS:5:STDZIMIN CP NMS") field(INPB, "LGPS:LTUS:5:STDZIMAX CP MMS") field(INPC, "0.05") field(INPD, "LGPS:LTUS:5:STDZITOLR CP MMS") field(EGU, "A") field(FLNK, "LGPS:LTUS:5:IDELTAS") field(PINI, "YES") } # D - factor (3.154/2 = 1.577) for EPSC, otherwise, set to 1.0 record(calc, "LGPS:LTUS:5:STDZDLY") { field(DESC, "Ramp time for stdz cycle") field(CALC, "C>0?MAX(1,ABS((A-B)/C)*D):0") field(INPA, "LGPS:LTUS:5:STDZIMIN CP NMS") field(INPB, "LGPS:LTUS:5:STDZIMAX CP NMS") field(INPC, "LGPS:LTUS:5:TRIMRAMPRATE CP NMS") field(INPD, "1.0") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") } record(calc, "LGPS:LTUS:5:STDZRAMPDLY") { field(DESC, "Ramp delay total") field(CALC, "MAX(1,((A/100)*B+B))") field(PREC, "5") field(INPA, "LGPS:LTUS:5:TRIMDLYPCT CP MS") field(INPB, "LGPS:LTUS:5: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, "LGPS:LTUS:5:STDZMINIDLY") { field(DESC, "Mini-stdz delay") field(CALC, "A") field(PREC, "5") field(A, "1.0") field(EGU, "sec") field(PINI, "YES") } record(ao, "LGPS:LTUS:5: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, "LGPS:LTUS:5:STDZMINIDELTA") { field(DESC, "Stdz mini % of IMAX") field(CALC, "(B/100)*(A-C)") field(INPA, "LGPS:LTUS:5:IDES.HOPR") field(INPB, "LGPS:LTUS:5:STDZMINIPCT CPP NMS") field(INPC, "LGPS:LTUS:5:IDES.LOPR") field(PREC, "5") } record(calc, "LGPS:LTUS:5:STDZMINISETPT") { field(DESC, "Mini Stdz delta") field(CALC, "C==0?MAX(E-D,B):MIN(E+D,A)") field(INPA, "LGPS:LTUS:5:IDES.HOPR") field(INPB, "LGPS:LTUS:5:IDES.LOPR") field(INPC, "LGPS:LTUS:5:STDZDIRECT.RVAL") field(INPD, "LGPS:LTUS:5:STDZMINIDELTA") field(INPE, "LGPS:LTUS:5:IDES") field(PREC, "5") field(FLNK, "LGPS:LTUS:5: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, "LGPS:LTUS:5:STDZMINISETPTOOR") { field(DESC, "Mini Stdz setpoint out of range") field(CALC, "C==0?(E-DA)") field(INPA, "LGPS:LTUS:5:IDES.HOPR") field(INPB, "LGPS:LTUS:5:IDES.LOPR") field(INPC, "LGPS:LTUS:5:STDZDIRECT.RVAL") field(INPD, "LGPS:LTUS:5:STDZMINIDELTA") field(INPE, "LGPS:LTUS:5: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, "LGPS:LTUS:5: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, "LGPS:LTUS:5:IADJUST.RVAL") field(INPB, "LGPS:LTUS:5:STDZDIRECT.RVAL") field(INPC, "LGPS:LTUS:5:STDZOK.RVAL") field(INPD, "LGPS:LTUS:5:STDZDISABLE.RVAL") field(INPE, "LGPS:LTUS:5:STATE.RVAL CPP NMS") field(INPF, "LGPS:LTUS:5:ICTRL.RVAL") field(INPG, "LGPS:LTUS:5:STATE.SEVR") field(INPH, "LGPS:LTUS:5:BDELTAS.M") field(INPI, "LGPS:LTUS:5:IACT.SEVR") field(OUT, "LGPS:LTUS:5:STDZLOSTGO.SELN PP NMS") field(OOPT, "Transition To Non-zero") } record(seq, "LGPS:LTUS:5:STDZLOSTGO") { field(DESC, "Process lost stdz") field(SELM, "Mask") field(DOL1, "1") field(DOL2, "0") field(LNK1, "LGPS:LTUS:5:STDZLOSTTOD.PROC") field(LNK2, "LGPS:LTUS:5:STDZOK PP") } # Record maximum current after standardize # Reset to IACT from sequence after trim # Disable processing during (mini-)standardize or trim record(calc, "LGPS:LTUS:5:STDZIACTMAX") { field(DESC, "Max act current after stdz") field(CALC, "MAX(A, B)") field(DISV, "0") field(SDIS, "LGPS:LTUS:5:CHECKPWRDIP_ENABLE") field(INPA, "LGPS:LTUS:5:IACT CP") field(INPB, "LGPS:LTUS:5:STDZIACTMAX") field(EGU, "A") field(FLNK, "LGPS:LTUS:5:CHECKPWRDIP") } # Detect power dip if STDZOK is YES, STDZ is enabled, and IACT is valid # If IACT drops below STDZIACTMAX by more than the trim tolerance, clear STDZOK # Warning: Take the absolute value of the trim tolerance, or else quads of # negative polarity will always lose STDZ since their IDELTAS.I are negative. # Note: Large quads and bends are prone to losing STDZ even if they are # perturbed toward higher current since their current tends to overshoot # by greater than the trim tolerance before settling down. record(calcout, "LGPS:LTUS:5:CHECKPWRDIP") { field(DESC, "Detect power dip") field(CALC, "(A-B>ABS(C))?3:0") field(DISV, "0") field(SDIS, "LGPS:LTUS:5:CHECKPWRDIP_ENABLE") field(INPA, "LGPS:LTUS:5:STDZIACTMAX") field(INPB, "LGPS:LTUS:5:IACT") field(INPC, "LGPS:LTUS:5:IDELTAS.I") field(OUT, "LGPS:LTUS:5:STDZLOSTGO.SELN PP NMS") field(OOPT, "When Non-zero") } # Enable processing of STDZIACTMAX and CHECKPWRDIP only if # STDZOK = YES, STDZDISABLE = NO, CTRL != Trim (2), and # CTRL != Stdz (4) record(calc, "LGPS:LTUS:5:CHECKPWRDIP_ENABLE") { field(CALC, "A&&!B&&(C#2)&&(C#4)") field(INPA, "LGPS:LTUS:5:STDZOK.RVAL CP") field(INPB, "LGPS:LTUS:5:STDZDISABLE.RVAL CP") field(INPC, "LGPS:LTUS:5:CTRL.RVAL CP") } #! 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, "LGPS:LTUS:5: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, "LGPS:LTUS:5: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, "LGPS:LTUS:5:CALBSET") { field(DESC, "Use DAC Calbration") field(SCAN, "10 second") field(CALC, "A&&(B==0)&&C?31:960") field(INPA, "LGPS:LTUS:5:CALBOK") field(INPB, "LGPS:LTUS:5:CALBDISABLE") field(INPC, "LGPS:LTUS:5:CALBSLOPE") field(OOPT, "On Change") field(OUT, "LGPS:LTUS:5: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, "LGPS:LTUS:5:CALB_SEQ") { field(DESC, "Output Calib Values") field(SELM, "Mask") field(SELL, "LGPS:LTUS:5: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, "LGPS:LTUS:5:CALBSLOPE") field(DOL3, "LGPS:LTUS:5: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, "LGPS:LTUS:5:CALBTOD") { field(DESC, "Calibration Success Time") field(PINI, "YES") # field(DOL, "") field(OMSL, "supervisory") field(DTYP, "Soft Channel") info(autosaveFields,"VAL") } record(ao, "LGPS:LTUS:5: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, "LGPS:LTUS:5: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, "LGPS:LTUS:5: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, "LGPS:LTUS:5:CALBOFFSET") { field(DESC, "Calc DAC Offset") field(PREC, "6") field(EGU, "Counts") field(PINI, "YES") } record(bo, "LGPS:LTUS:5: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, "LGPS:LTUS:5:DACSLOPE") { field(DESC, "V to DAC slope") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "supervisory") field(PINI, "YES") field(FLNK, "LGPS:LTUS:5:DACOFFSET") } # Default Offset used in conversion from Volts to DAC Counts record(ao, "LGPS:LTUS:5:DACOFFSET") { field(DESC, "V to DAC offset") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "supervisory") field(PINI, "YES") field(FLNK, "LGPS:LTUS:5: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, "LGPS:LTUS:5: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, "LGPS:LTUS:5:IACT") field(INPD, "LGPS:LTUS:5:DACSLOPE") field(INPE, "LGPS:LTUS:5:DACOFFSET") field(EGU, "Counts") field(PREC, "6") } record(ao, "LGPS:LTUS:5:DAC") { field(DESC, "DAC Set point") field(EGU, "Counts") field(DOL, "") field(OMSL, "supervisory") field(PREC, "6") field(PINI, "YES") } record(ao, "LGPS:LTUS:5:CALBIMIN") { field(DESC, "Calibration Min Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(DRVH, "50.0") field(HOPR, "50.0") field(DRVL, "0.0") field(LOPR, "0.0") field(PREC, "3") field(EGU, "A") field(VAL, "0.0") field(FLNK, "LGPS:LTUS:5:CALBIMAX") } record(ao, "LGPS:LTUS:5:CALBIMAX") { field(DESC, "Calibration Max Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(DRVH, "50.0") field(HOPR, "50.0") field(LOPR, "0.0") field(DRVL, "0.0") field(EGU, "A") field(VAL, "50.0") field(FLNK, "LGPS:LTUS:5:CALBSTEPNUM") } record(ao, "LGPS:LTUS:5:CALBIFINAL") { field(DESC, "Calibration Last Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(PREC, "3") field(EGU, "A") field(HOPR, "50.0") field(LOPR, "0.0") field(VAL, "0") } record(longout, "LGPS:LTUS:5: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, "LGPS:LTUS:5:CALBIDELTA") } record(calc, "LGPS:LTUS:5:CALBIDELTA") { field(DESC, "Step size for CALB") field(CALC, "C=0?0:ABS((A-B)/C)") field(INPA, "LGPS:LTUS:5:CALBIMAX") field(INPB, "LGPS:LTUS:5:CALBIMIN") field(INPC, "LGPS:LTUS:5: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, "LGPS:LTUS:5:CALBIMULT") { field(DESC, "IACT vs ISETPT mult") field(CALC, "C#0||A=0?1:ABS(B/A)") field(INPA, "PS:LTUS:5:ISETPT.DRVH") field(INPB, "PS:LTUS:5:IACT.HOPR") field(INPC, "LGPS:LTUS:5:PSCONTROLLER.RVAL CPP") field(EGU, "A") field(PINI, "YES") } # SNL dbputs DAC values here. 6-10 steps are possible. record(waveform, "LGPS:LTUS:5:CALBICTRLWF") { field(DESC, "ICTRL setpoint array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") } record(waveform, "LGPS:LTUS:5:DACWF") { field(DESC, "DAC count array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "LGPS:LTUS:5:DACSA") } # Used only for xygraph edm plot record(subArray, "LGPS:LTUS:5:DACSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "LGPS:LTUS:5: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, "LGPS:LTUS:5:CALCDACWF") { field(DESC, "Calc DAC counts array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "LGPS:LTUS:5:CALCDACSA") } # Used only for xygraph edm plot record(subArray, "LGPS:LTUS:5:CALCDACSA") { field(DESC, "Calc DAC counts") field(DTYP, "Soft Channel") field(INP, "LGPS:LTUS:5: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, "LGPS:LTUS:5:CALBYWF") { field(DESC, "mx + b") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "LGPS:LTUS:5:CALBYSA") } # Used only for xygraph edm plot record(subArray, "LGPS:LTUS:5:CALBYSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "LGPS:LTUS:5:CALBYWF") field(MALM, "10") field(NELM, "6") field(INDX, "0") field(FTVL, "DOUBLE") } record(waveform, "LGPS:LTUS:5:CALBIACTWF") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "LGPS:LTUS:5:CALBIACTSA") } # Used only for xygraph edm plot record(subArray, "LGPS:LTUS:5:CALBIACTSA") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(MALM, "10") field(NELM, "6") field(INP, "LGPS:LTUS:5:CALBIACTWF") field(INDX, "0") field(FTVL, "DOUBLE") field(FLNK, "LGPS:LTUS:5:CALBLIMITS") } # Check that measured current during calibration is within # tolerance. record(aSub, "LGPS:LTUS:5: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, "LGPS:LTUS:5:CALBSTEPNUM") field(INPB, "LGPS:LTUS:5:CALBIACTWF") field(INPC, "LGPS:LTUS:5: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, "LGPS:LTUS:5: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, "LGPS:LTUS:5:STDZITOL") field(INPH, "LGPS:LTUS:5:DACSLOPE") field(INPI, "LGPS:LTUS:5: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, "LGPS:LTUS:5: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, "LGPS:LTUS:5:CALBSTEPNUM") field(INPB, "LGPS:LTUS:5:CALBIACTWF") field(INPC, "LGPS:LTUS:5:DACWF") field(INPF, "LGPS:LTUS:5: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 LGPS:LTUS:5CALBOK 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, "LGPS:LTUS:5:DEGAUSINIT") { field(DESC, "Proc. Degauss PVs on boot") field(PINI, "YES") field(DOL, "1") field(OUTA, "LGPS:LTUS:5:DEGAUSIMIN.PROC PP") field(OUTB, "LGPS:LTUS:5:DEGAUSIMAX.PROC PP") field(OUTC, "LGPS:LTUS:5:DEGAUSTYPE.PROC PP") field(OUTD, "LGPS:LTUS:5:DEGAUSSTEP.PROC PP") field(OUTE, "LGPS:LTUS:5:MADNAME.PROC PP") field(OUTF, "LGPS:LTUS:5:PSTYPE.PROC PP") field(OUTG, "LGPS:LTUS:5: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, "LGPS:LTUS:5:DEGAUSSUB") { field(DESC, "Degauss subroutine") field(INAM, "mgntDegaussInit") field(SNAM, "mgntDegauss") field(BRSV, "INVALID") field(INPA, "LGPS:LTUS:5:DEGAUSIMIN NPP NMS") field(INPB, "LGPS:LTUS:5:DEGAUSIMAX NPP NMS") field(INPC, "LGPS:LTUS:5:DEGAUSTYPE.RVAL NPP NMS") field(INPE, "LGPS:LTUS:5:DEGAUSMETHOD.RVAL NPP NMS") field(INPF, "LGPS:LTUS:5:PSTYPE NPP NMS") field(INPG, "LGPS:LTUS:5:DEBUG.RVAL NPP NMS") field(INPH, "LGPS:LTUS:5: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, "LGPS:LTUS:5:DEGAUSWF PP") field(OUTB, "LGPS:LTUS:5:DEGAUSMSG PP") field(OUTC, "LGPS:LTUS:5: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, "LGPS:LTUS:5:DEGAUSWF") { field(DESC, "Degauss Setpts") field(NELM, "60") field(FTVL, "DOUBLE") } record(mbbo,"LGPS:LTUS:5: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, "LGPS:LTUS:5: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, "LGPS:LTUS:5: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, "LGPS:LTUS:5: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, "LGPS:LTUS:5: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, "LGPS:LTUS:5:DEGAUSIMIN") { field(DESC, "Min. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "50.0") field(LOPR, "-50.0") field(DRVH, "50.0") field(DRVL, "-50.0") field(VAL, "-50.0") } record(ao, "LGPS:LTUS:5:DEGAUSIMAX") { field(DESC, "Max. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "50.0") field(LOPR, "-50.0") field(DRVH, "50.0") field(DRVL, "-50.0") field(VAL, "50.0") } # 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,"LGPS:LTUS:5: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, "LGPS:LTUS:5: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,"LGPS:LTUS:5: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, "LGPS:LTUS:5: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, "LGPS:LTUS:5: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, "LGPS:LTUS:5: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, "LGPS:LTUS:5:DEGAUSTOD") { field(DESC, "Successful Degauss Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "LGPS:LTUS:5:DEGAUSLOSTTOD") { field(DESC, "Degauss Lost Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "LGPS:LTUS:5:DEGAUSTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "LGPS:LTUS:5:DEGAUSTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "LGPS:LTUS:5: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, "LGPS:LTUS:5:DEGAUSGO") { field(DESC, "Set bdes of btrms to zero") field(ASG, "Internal") field(OUTA, "") field(OUTB, "") field(OUTC, "") field(OUTD, "") } # =========== CRYO ONLY =========== record(bo, "LGPS:LTUS:5: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, "LGPS:LTUS:5:DEGAUS_IMAX_CHECK") { field(DESC, "Check if imax shoud chg") field(CALC, "(C==4)&&(ABS(B)>ABS(A))?1:0") field(INPA, "LGPS:LTUS:5:DEGAUS_IMAX") field(INPB, "LGPS:LTUS:5:ISETPT") field(INPC, "LGPS:LTUS:5:DEGAUSTYPE.RVAL") field(OUT, "LGPS:LTUS:5:DEGAUS_IMAX_UPDATE.SELN") field(FLNK, "LGPS:LTUS:5:DEGAUS_IMAX_UPDATE") } record(seq, "LGPS:LTUS:5:DEGAUS_IMAX_UPDATE") { field(DESC, "Degauss IMAX Update") field(SELM, "Specified") field(DOL1, "LGPS:LTUS:5:ISETPT") field(LNK1, "LGPS:LTUS:5:DEGAUS_IMAX PP") } # Set the maximum current after a successful # degauss. This pv is updated by the # sequence. record(ao, "LGPS:LTUS:5:DEGAUS_IMAX") { field(DESC, "Max I set afer a degauss") field(EGU, "Amps") field(PINI, "YES") field(PREC, "6") field(HOPR, "50.0") field(LOPR, "-50.0") field(DRVH, "50.0") field(DRVL, "-50.0") field(VAL, "50.0") field(FLNK, "LGPS:LTUS:5:DEGAUS_IMAXPOL_CHECK") info(autosaveFields,"VAL,RVAL") } # Set the polarity if degauss_imax record(calcout, "LGPS:LTUS:5:DEGAUS_IMAXPOL_CHECK") { field(DESC, "Determine polarity of imax") field(CALC, "A>=0?0:1") field(INPA, "LGPS:LTUS:5:DEGAUS_IMAX") field(FLNK, "LGPS:LTUS:5:DEGAUS_IMAXPOL") } record(bo, "LGPS:LTUS:5:DEGAUS_IMAXPOL") { field(DESC, "Polarity of imax I") field(DTYP, "Raw Soft Channel") field(DOL, "LGPS:LTUS:5:DEGAUS_IMAXPOL_CHECK") field(OMSL, "closed_loop") field(ZNAM, "Positive") field(ONAM, "Negative") field(FLNK, "LGPS:LTUS:5: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, "LGPS:LTUS:5:DEGAUS_ABSIMAX") { field(DESC, "Absolute Max. Degauss I") field(CALC, "ABS(A)") field(INPA, "LGPS:LTUS:5:DEGAUS_IMAX") field(PREC, "6") field(EGU, "Amps") field(HOPR, "50.0") field(LOPR, "-50.0") info(autosaveFields,"VAL RVAL") } # IACT Polarity record(calcout, "LGPS:LTUS:5:IACTPOL_CHECK") { field(DESC, "Determine IACT polarity") field(SCAN, "5 second") field(CALC, "ABS(A-B)>C?(A>=0?0:1):D") field(INPA, "LGPS:LTUS:5:IACT") field(INPB, "LGPS:LTUS:5:IACTPOL_CHECK.LA") field(INPC, "0.0001") field(INPD, "LGPS:LTUS:5:IACTPOL_CHECK.PVAL") field(OOPT, "On Change") field(FLNK, "LGPS:LTUS:5:IACTPOL") } record(bo, "LGPS:LTUS:5: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,"LGPS:LTUS:5: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, "LGPS:LTUS:5:DEGAUSENABLE CP") field(INPB, "LGPS:LTUS:5:DEGAUSOK") field(INPC, "LGPS:LTUS:5:STATE CP") field(INPD, "LGPS:LTUS:5:STATE.SEVR") field(OUT, "LGPS:LTUS:5:DEGAUS_STATE_SEQ.SELN PP") field(ASG, "Internal") } record(seq, "LGPS:LTUS:5:DEGAUS_STATE_SEQ") { field(DESC, "Degauss State Sequence") field(SELM, "Specified") field(SELL, "LGPS:LTUS:5:DEGAUS_STATE_CHECK") field(LNK1, "LGPS:LTUS:5:DEGAUS_STATE_DISABLE.PROC PP") field(LNK2, "LGPS:LTUS:5:DEGAUS_STATE_LOST.PROC PP") field(LNK3, "LGPS:LTUS:5:DEGAUS_STATE_GOOD.PROC PP") field(LNK4, "LGPS:LTUS:5: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, "LGPS:LTUS:5:DEGAUS_STATE_DISABLE") { field(DESC, "Degauss not used") field(LNK1, "LGPS:LTUS:5:DEGAUSOK.ZSV") field(LNK2, "LGPS:LTUS:5: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, "LGPS:LTUS:5:STATMSG.FRSV") field(LNK4, "LGPS:LTUS:5: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, "LGPS:LTUS:5:DEGAUS_STATE_LOST") { field(DESC, "Degauss lost and ps On") field(DOL1, "1") field(LNK1, "LGPS:LTUS:5:DEGAUSOK.ZSV") field(LNK2, "LGPS:LTUS:5: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, "LGPS:LTUS:5:STATMSG.FRSV") field(LNK4, "LGPS:LTUS:5: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, "LGPS:LTUS:5:DEGAUS_STATE_OFF") { field(DESC, "Degaused lost and ps Off") field(DOL1, "2") field(LNK1, "LGPS:LTUS:5: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, "LGPS:LTUS:5:STATMSG.FRSV") field(LNK3, "LGPS:LTUS:5: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, "LGPS:LTUS:5:DEGAUS_STATE_GOOD") { field(DESC, "Degauss good") field(DOL1, "1") field(LNK1, "LGPS:LTUS:5: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, "LGPS:LTUS:5:STATMSG.FRSV PP") field(LNK3, "LGPS:LTUS:5:STATMSG.FVSV PP") field(LNK4, "") field(ASG, "Internal") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(mbbo, "LGPS:LTUS:5:FUNC") { field(DESC, "LGPS:LTUS:5 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, "1") field(NIVL, "2") field(TEVL, "3") field(ELVL, "0") field(TVVL, "0") field(TTVL, "0") field(FTVL, "0") field(FFVL, "0") field(OUT, "LGPS:LTUS:5:CTRL CA") } # :CTRL pv is processed at boot in the # sequence mgntCtrl.st Processed in sequence # record(mbbo, "LGPS:LTUS:5:CTRL") { field(DESC, "LGPS:LTUS:5 Control") field(PINI, "NO") field(ZRST, "Ready") field(ONST, "RESET") field(TWST, "TURN_ON") field(THST, "TURN_OFF") 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, "8") field(TWVL, "9") field(THVL, "10") 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, "LGPS:LTUS:5:SELECTEN.A PP") field(SDIS, "0") } # If a function has been selected set this unit to busy record(calcout, "LGPS:LTUS:5:SELECTEN") { field(DESC, "Control Select Enable") field(CALC, "A>0?1:A") field(FLNK, "LGPS:LTUS:5:BUSY") } # Set to FREE on IOC reboot record(bo, "LGPS:LTUS:5:BUSY") { field(DESC, "LGPS:LTUS:5 Ctrl Done") field(DOL, "LGPS:LTUS:5:SELECTEN") field(ZNAM, "FREE") field(ONAM, "BUSY") field(PINI, "YES") field(FLNK, "LGPS:LTUS:5:SELECT") } record(bo, "LGPS:LTUS:5:SELECT") { field(ZNAM, "NO") field(ONAM, "YES") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") } record(bo, "LGPS:LTUS:5: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, "LGPS:LTUS:5:CTRLSTATE") { field(DESC, "LGPS:LTUS:5 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("LGPS:LTUS:5:CTRL",20,20,0,0,"LGPS:LTUS:5:CTRL") #! Field("LGPS:LTUS:5:CTRL.OUT",16777215,1,"LGPS:LTUS:5:CTRL.OUT") #! Link("LGPS:LTUS:5:CTRL.OUT","LGPS:LTUS:5:SELECTEN.A") #! Field("LGPS:LTUS:5:CTRL.VAL",16777215,1,"LGPS:LTUS:5:CTRL.VAL") #! Record("LGPS:LTUS:5:SELECTEN",321,381,0,0,"LGPS:LTUS:5:SELECTEN") #! Field("LGPS:LTUS:5:SELECTEN.A",16777215,0,"LGPS:LTUS:5:SELECTEN.A") #! Field("LGPS:LTUS:5:SELECTEN.FLNK",16777215,1,"LGPS:LTUS:5:SELECTEN.FLNK") #! Link("LGPS:LTUS:5:SELECTEN.FLNK","LGPS:LTUS:5:BUSY") #! Field("LGPS:LTUS:5:SELECTEN.VAL",16777215,1,"LGPS:LTUS:5:SELECTEN.VAL") #! Record("LGPS:LTUS:5:BUSY",623,274,0,0,"LGPS:LTUS:5:BUSY") #! Field("LGPS:LTUS:5:BUSY.DOL",16777215,0,"LGPS:LTUS:5:BUSY.DOL") #! Link("LGPS:LTUS:5:BUSY.DOL","LGPS:LTUS:5:SELECTEN.VAL") #! Field("LGPS:LTUS:5:BUSY.FLNK",16777215,1,"LGPS:LTUS:5:BUSY.FLNK") #! Link("LGPS:LTUS:5:BUSY.FLNK","LGPS:LTUS:5:SELECT") #! Record("LGPS:LTUS:5:SELECT",669,508,0,1,"LGPS:LTUS:5:SELECT") #! Record("LGPS:LTUS:5:FUNC",940,120,0,0,"LGPS:LTUS:5:FUNC") #! Field("LGPS:LTUS:5:FUNC.OUT",16777215,0,"LGPS:LTUS:5:FUNC.OUT") #! Link("LGPS:LTUS:5:FUNC.OUT","LGPS:LTUS:5:CTRL.VAL") #! Record("LGPS:LTUS:5:ABORT",193,41,0,0,"LGPS:LTUS:5:ABORT") #! Record("LGPS:LTUS:5:CTRLSTATE",369,34,0,0,"LGPS:LTUS:5: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,"LGPS:LTUS:5:SELECT is used for Multi-device selection.\nIt is enabled when associated LGPS:LTUS:5:CTRL is \"0\" (DONE).\nIt is disabled when associated LGPS:LTUS:5: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,"LGPS:LTUS:5: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, "LGPS:LTUS:5:BCTRL_INIT") { field(DESC, "Process BCTRL on boot") field(PINI, "YES") field(CALC, "A=3?1:0") field(INPA, "LGPS:LTUS:5:BCTRL.SEVR") field(OUT, "LGPS:LTUS:5: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, "LGPS:LTUS:5:BACT") { field(DESC, "Actual B") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "LGPS:LTUS:5:BACT") field(INPB, "LGPS:LTUS:5:POLYCOEF") field(INPC, "LGPS:LTUS:5:POLYCOEF.A") field(INPD, "LGPS:LTUS:5:POLYCOEF.B") field(INPE, "LGPS:LTUS:5:IACT MS") field(INPF, "LGPS:LTUS:5:BDELTAS PP") field(INPG, "100") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(HIHI, "50.0") field(LOLO, "0.0") field(PREC, "3") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "50.0") field(LOW, "0.0") field(FLNK, "LGPS:LTUS:5: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, "LGPS:LTUS:5:BDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntPhyDeltas") field(EGU, "Volts") field(HOPR, "1") field(PREC, "3") field(BRSV, "INVALID") field(INPA, "LGPS:LTUS:5:BDES") field(INPB, "LGPS:LTUS:5:TRIMBTOL") field(INPC, "LGPS:LTUS:5:TRIMBTOLR") field(INPD, "LGPS:LTUS:5:CHCKBTOL") field(INPE, "LGPS:LTUS:5:CHCKBTOLR") field(F, "0.0") field(INPG, "30") field(INPH, "LGPS:LTUS:5:BACT.VAL") # # MPS absolute and relative tolerances field(INPP, "LGPS:LTUS:5:MPSBTOL") field(INPQ, "LGPS:LTUS:5:MPSBTOLR") field(FLNK, "LGPS:LTUS:5:BCONLIMITS") info(autosaveFields,"F") } # This record is processed by BDELTAS record(aSub, "LGPS:LTUS:5:BCONLIMITS") { field(DESC, "Config B-field Limits") field(INAM, "mgntInit") field(SNAM, "mgntBCONLimits") field(INPA, "LGPS:LTUS:5:BDES") field(INPB, "LGPS:LTUS:5:BDELTAS.I") field(INPG, "LGPS:LTUS:5:DEBUG.RVAL") field(FTA, "DOUBLE") field(FTB, "DOUBLE") field(FTG, "ULONG") field(OUTA, "LGPS:LTUS:5:BCON.HIGH") field(OUTB, "LGPS:LTUS:5:BCON.LOW") field(OUTC, "LGPS:LTUS:5:BCON.HIHI") field(OUTD, "LGPS:LTUS:5:BCON.LOLO PP") field(FTVA, "DOUBLE") field(FTVB, "DOUBLE") field(FTVC, "DOUBLE") field(FTVD, "DOUBLE") field(BRSV, "INVALID") field(FLNK, "LGPS:LTUS:5:IDELTAS") } # The following PV is processed by :BACT # which is processed by :BACT # record(fanout, "LGPS:LTUS:5:BACTFO") { field(DESC, "BACT processing") field(SELM, "All") field(LNK1, "LGPS:LTUS:5:BDIFF") field(LNK2, "LGPS:LTUS:5:BADIFF") field(LNK3, "LGPS:LTUS:5:BRATIO") field(LNK4, "LGPS:LTUS:5:MPSLIMITS") field(LNK5, "LGPS:LTUS:5:I2BSTATUS") field(LNK6, "LGPS:LTUS:5:IACTFO.PROC") } record(calc, "LGPS:LTUS:5:BDIFF") { field(DESC, "BDES-BACT") field(CALC, "A-B") field(INPA, "LGPS:LTUS:5:BDES") field(INPB, "LGPS:LTUS:5:BACT") field(EGU, "Volts") field(PREC, "7") } record(calc, "LGPS:LTUS:5:BADIFF") { field(DESC, "Absolute BDES-BACT") field(INPA, "LGPS:LTUS:5:BDIFF") field(EGU, "Volts") field(PREC, "7") field(CALC, "A<0?ABS(A):A") } record(calc, "LGPS:LTUS:5:BRATIO") { field(DESC, "BACT Error") field(CALC, "B?A/B:0") field(INPA, "LGPS:LTUS:5:BDIFF") field(INPB, "LGPS:LTUS:5:BDES.HOPR") field(EGU, "Volts") field(PREC, "7") } record(mbbi, "LGPS:LTUS:5: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, "LGPS:LTUS:5:BACT.J") } # Note: for a string slave set the MONFL # macro to the following: # MONFL=:IMONCALC MS record(sub, "LGPS:LTUS:5:BMON") { field(DESC, "Second Transductor") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "LGPS:LTUS:5:BMON") field(INPB, "LGPS:LTUS:5:POLYCOEF") field(INPC, "LGPS:LTUS:5:POLYCOEF.A") field(INPD, "LGPS:LTUS:5:POLYCOEF.B") field(INPE, "LGPS:LTUS:5:IMON MS") field(INPF, "LGPS:LTUS:5:BDELTAS.VAL") field(INPG, "100") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(HIHI, "50.0") field(LOLO, "0.0") field(PREC, "3") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "50.0") field(LOW, "0.0") } # 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:LTUS:5:BDES CP record(ao, "LGPS:LTUS:5:BDES") { field(DESC, "Desired B-Field") field(PINI, "YES") field(DRVH, "50.0") field(DRVL, "0.0") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(EGU, "Volts") field(MDEL, "-1") field(OMSL, "closed_loop") field(DOL, "LGPS:LTUS:5:BDES.DRVH") field(OUT, "LGPS:LTUS:5:B2IDES PP") info(autosaveFields,"VAL") } record(sub, "LGPS:LTUS:5:B2IDES") { field(DESC, "Convert Desired B-Field to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "LGPS:LTUS:5:POLYCOEF") field(INPC, "LGPS:LTUS:5:POLYCOEF.A") field(INPD, "LGPS:LTUS:5:POLYCOEF.B") field(PREC, "3") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(MDEL, "-1") field(INPE, "LGPS:LTUS:5:BDES.DRVH") field(INPF, "LGPS:LTUS:5:BDES.DRVL") field(BRSV, "INVALID") field(FLNK, "LGPS:LTUS:5:IDES") } record(sub, "LGPS:LTUS:5:BNOM") { field(DESC, "Nominal Field") field(PINI, "YES") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "LGPS:LTUS:5:POLYCOEF") field(INPC, "LGPS:LTUS:5:POLYCOEF.A") field(INPD, "LGPS:LTUS:5:POLYCOEF.B") field(INPE, "LGPS:LTUS:5:BDES.DRVH") field(INPF, "LGPS:LTUS:5:BDES.DRVL") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(VAL, "0.0") field(FLNK, "LGPS:LTUS:5:INOM") } record(sub, "LGPS:LTUS:5:BACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "LGPS:LTUS:5:BDES.VAL") field(INPB, "LGPS:LTUS:5:BDES.DRVH") field(INPC, "LGPS:LTUS:5:BDES.DRVL") field(INPD, "LGPS:LTUS:5:BDELTAS.I") field(INPE, "LGPS:LTUS:5:BDELTAS.J") field(INPG, "LGPS:LTUS:5:STATE") field(INPH, "LGPS:LTUS:5:HSTA") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(sub, "LGPS:LTUS:5:BMONLIMITS") { field(DESC, "MON Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "LGPS:LTUS:5:BDES.VAL") field(INPB, "LGPS:LTUS:5:BDES.DRVH") field(INPC, "LGPS:LTUS:5:BDES.DRVL") field(INPD, "LGPS:LTUS:5:BDELTAS.K") field(INPE, "LGPS:LTUS:5:BDELTAS.L") field(INPG, "LGPS:LTUS:5:STATE") field(INPH, "LGPS:LTUS:5:HSTA") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(seq, "LGPS:LTUS:5:BLIMITS") { field(DESC, "ACT Limits") field(PREC, "3") field(DOL1, "LGPS:LTUS:5:BLIMITS") field(LNK1, "LGPS:LTUS:5:BACTLIMITS.F PP") field(DOL2, "LGPS:LTUS:5:BACTLIMITS.I") field(LNK2, "LGPS:LTUS:5:BACT.HIGH") field(DOL3, "LGPS:LTUS:5:BACTLIMITS.J") field(LNK3, "LGPS:LTUS:5:BACT.LOW") field(DOL4, "LGPS:LTUS:5:BACTLIMITS.K") field(LNK4, "LGPS:LTUS:5:BACT.HIHI") field(DOL5, "LGPS:LTUS:5:BACTLIMITS.L") field(LNK5, "LGPS:LTUS:5:BACT.LOLO") field(DOL6, "LGPS:LTUS:5:BLIMITS") field(LNK6, "LGPS:LTUS:5:BMONLIMITS.F PP") field(DOL7, "LGPS:LTUS:5:BMONLIMITS.I") field(LNK7, "LGPS:LTUS:5:BMON.HIGH") field(DOL8, "LGPS:LTUS:5:BMONLIMITS.J") field(LNK8, "LGPS:LTUS:5:BMON.LOW") field(DOL9, "LGPS:LTUS:5:BMONLIMITS.K") field(LNK9, "LGPS:LTUS:5:BMON.HIHI") field(DOLA, "LGPS:LTUS:5:BMONLIMITS.L") field(LNKA, "LGPS:LTUS:5:BMON.LOLO") field(FLNK, "LGPS:LTUS:5:ILIMITS") field(SCAN, "5 second") } record(ao, "LGPS:LTUS:5:BCTRL") { field(DESC, "B-Perturb") field(PREC, "3") field(EGU, "Volts") field(DRVH, "50.0") field(DRVL, "0.0") field(HOPR, "50.0") field(LOPR, "0.0") # 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, "LGPS:LTUS:5: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, "LGPS:LTUS:5:BCTRLGO") { field(DESC, "Update DES and perturb") field(PREC, "3") # Disable BACT limits field(DOL1, "1") field(LNK1, "LGPS:LTUS:5:BLIMITS.VAL") # Update BDES with the BCTRL (slider) value field(DOL2, "LGPS:LTUS:5:BCTRL.VAL") field(LNK2, "LGPS:LTUS:5:BDES PP") field(DOL3, "1") field(LNK3, "LGPS:LTUS:5:IDIRECT.PROC PP") field(DOL4, "1") field(LNK4, "LGPS:LTUS:5:CHECKSTDZLOST.PROC PP") field(DOL5, "LGPS:LTUS:5:BCTRL.VAL") field(LNK5, "LGPS:LTUS:5:BCTRLSUB PP") # Re-enable BACT limits field(DOL6, "0") field(LNK6, "LGPS:LTUS:5:BLIMITS.VAL") } # Convert B-field to Current and output to ISETPT record(sub, "LGPS:LTUS:5:BCTRLSUB") { field(DESC, "Feedback") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "LGPS:LTUS:5:POLYCOEF") field(INPC, "LGPS:LTUS:5:POLYCOEF.A") field(INPD, "LGPS:LTUS:5:POLYCOEF.B") field(INPE, "LGPS:LTUS:5:BDES.DRVH") field(INPF, "LGPS:LTUS:5:BDES.DRVL") field(PREC, "3") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(MDEL, "-1") field(BRSV, "INVALID") field(FLNK, "LGPS:LTUS:5:ISETPT") } record(ao, "LGPS:LTUS:5:BDESPREVTRIM") { field(DESC, "trim bdes for undo") field(DTYP, "Soft Channel") field(DRVH, "50.0") field(DRVL, "0.0") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(PINI, "YES") info(autosaveFields,"VAL") } record(stringin, "LGPS:LTUS:5:MADNAME") { field(DESC, "MAD deck nomenclature") field(PINI, "YES") field(VAL, "B911-3501") } record(ai, "LGPS:LTUS:5: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, "0.0") } record(ao, "LGPS:LTUS:5:BMAX") { field(DESC, "Max B-Field") field(DTYP, "Soft Channel") field(DRVH, "50.0") field(DRVL, "0.0") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(PINI, "YES") field(VAL, "50.0") field(FLNK, "LGPS:LTUS:5:BSTEP") } record(ao, "LGPS:LTUS:5:BMIN") { field(DESC, "Min B-Field") field(DTYP, "Soft Channel") field(DRVH, "50.0") field(DRVL, "0.0") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(PINI, "YES") field(VAL, "0.0") field(FLNK, "LGPS:LTUS:5:BSTEP") } record(ao, "LGPS:LTUS:5:BDESSAVE") { field(DESC, "bdes for save/load") field(DTYP, "Soft Channel") field(DRVH, "50.0") field(DRVL, "0.0") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PINI, "YES") field(PREC, "3") } # This record is processed by LGPS:LTUS:5: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, "LGPS:LTUS:5:BCON") { field(DESC, "Config B-Field ") field(DTYP, "Soft Channel") field(PREC, "3") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(DRVH, "50.0") field(DRVL, "0.0") # 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 , "") field(OMSL, "closed_loop") field(OUT, "LGPS:LTUS:5:B2ICON PP") info(autosaveFields,"VAL") } record(sub, "LGPS:LTUS:5:B2ICON") { field(DESC, "Convert Desired ICon to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "LGPS:LTUS:5:POLYCOEF") field(INPC, "LGPS:LTUS:5:POLYCOEF.A") field(INPD, "LGPS:LTUS:5:POLYCOEF.B") field(PREC, "3") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(MDEL, "-1") field(INPE, "LGPS:LTUS:5:BCON.DRVH") field(INPF, "LGPS:LTUS:5:BCON.DRVL") field(BRSV, "INVALID") field(FLNK, "LGPS:LTUS:5: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, "LGPS:LTUS:5:BSTEP") { field(DESC, "B-Field step size") field(CALC, "(C==3)||(D==3)?0:ABS(A-B)*0.005") field(INPA, "LGPS:LTUS:5:BMAX") field(INPB, "LGPS:LTUS:5:BMIN") field(INPC, "LGPS:LTUS:5:BMIN.SEVR") field(INPD, "LGPS:LTUS:5:BMAX.SEVR") field(EGU, "Volts") 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,"LGPS:LTUS:5:BCTRLDISABLECALC") { field(DESC, "Calc for disabling BCTRL") field(ASG, "Internal") field(CALC, "A?2:1") field(INPA, "LGPS:LTUS:5:ONLINE CP") field(OUT, "LGPS:LTUS:5:BCTRLDISABLEFOUT PP") } record(fanout, "LGPS:LTUS:5:BCTRLDISABLEFOUT") { field(DESC, "Disable BCTRL fanout") field(SELM, "Specified") field(SELL, "LGPS:LTUS:5:BCTRLDISABLECALC") field(LNK1, "LGPS:LTUS:5:BCTRLDISABLE") field(LNK2, "LGPS:LTUS:5:BCTRLENABLE") } record(stringout, "LGPS:LTUS:5:BCTRLDISABLE") { field(DESC, "Disable BCTRL") field(DTYP, "Soft Channel") field(OUT, "LGPS:LTUS:5:BCTRL.ASG") field(VAL, "NOWRITE") field(FLNK, "LGPS:LTUS:5:BCTRLDISV_UPDATE") } record(stringout, "LGPS:LTUS:5:BCTRLENABLE") { field(DESC, "Enable BCTRL") field(DTYP, "Soft Channel") field(OUT, "LGPS:LTUS:5:BCTRL.ASG") field(VAL, "") field(FLNK, "LGPS:LTUS:5:BCTRLDISV_UPDATE") } record(calcout, "LGPS:LTUS:5:BCTRLDISV_UPDATE") { field(DESC, "Calc for updating BCTRL.DISV") field(ASG, "Internal") field(CALC, "A") field(INPA, "LGPS:LTUS:5:ONLINE") field(OUT, "LGPS:LTUS:5: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,"LGPS:LTUS:5:BACT and MON\n are processed via links from \n LGPS:LTUS:5:IACT (device raw value readback 1)\n and\n LGPS:LTUS:5: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 LGPS:LTUS:5:POLYCOEF\nC = First polynomial coefficient (offset if linear)\nD = Second polynomial coefficient (slope if linear)\nE = LGPS:LTUS:5: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,"LGPS:LTUS:5:BDES\n is processed when set by CA users or \n LGPS:LTUS:5: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,"LGPS:LTUS:5: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 LGPS:LTUS:5: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 (LGPS:LTUS:5: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,"LGPS:LTUS:5:B*LIMITS and LGPS:LTUS:5:BLIMITS:\n Calculate alarm and warning limits based on \n deltas from LGPS:LTUS:5: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,"LGPS:LTUS:5: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,"LGPS:LTUS:5: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, "LGPS:LTUS:5: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, "LGPS:LTUS:5:MPSBTOL") { field(DESC, "Absolute mps tol") field(EGU, "Volts") field(PREC, "2") field(CALC, "ABS(A)*0.02") field(INPA, "LGPS:LTUS:5:BMAX") field(PINI, "YES") } # # 21-Aug-2013: K. Luchini # Set channel access security so that users # cannot easily change values. record(ao, "LGPS:LTUS:5:MPSBMAX") { field(DESC, "MPS Max B-field") field(EGU, "Volts") field(PREC, "7") field(DRVH, "50.0") field(DRVL, "0.0") field(PINI, "YES") field(VAL, "50.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "LGPS:LTUS:5:MPSBMIN") { field(DESC, "MPS Min B-field") field(EGU, "Volts") field(PREC, "7") field(DRVH, "50.0") field(DRVL, "0.0") field(PINI, "YES") field(VAL, "0.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "LGPS:LTUS:5:MPSBLLIM") { field(DESC, "MPS Low Limit B-field") field(EGU, "Volts") field(PREC, "7") field(DRVH, "50.0") field(DRVL, "0.0") field(PINI, "YES") field(VAL, "0.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "LGPS:LTUS:5:MPSBLLIM2") { field(DESC, "MPS Low Limit #2 B-field") field(EGU, "Volts") field(PREC, "7") field(DRVH, "50.0") field(DRVL, "0.0") field(PINI, "YES") field(VAL, "0.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } # Set the default to Std record(mbbo, "LGPS:LTUS:5: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, "LGPS:LTUS:5:MPSLIMITS.E PP") } record(aSub, "LGPS:LTUS:5: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, "LGPS:LTUS:5:MPS.RVAL") field(INPB, "LGPS:LTUS:5:BADIFF") field(INPC, "LGPS:LTUS:5:BDELTAS.N") field(INPD, "LGPS:LTUS:5:BACT") field(INPE, "LGPS:LTUS:5:MPSBITMASK.RVAL") field(INPF, "LGPS:LTUS:5:MPSBLLIM") field(INPG, "LGPS:LTUS:5:MPSBMIN") field(INPH, "LGPS:LTUS:5:MPSBMAX") field(INPI, "LGPS:LTUS:5: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, "LGPS:LTUS:5:INTOL.RVAL PP") field(OUTB, "LGPS:LTUS:5:INTOL_BMIN.RVAL PP") field(OUTC, "LGPS:LTUS:5:INTOL_BRANGE.RVAL PP") field(OUTD, "LGPS:LTUS:5: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, "LGPS:LTUS:5:INTOL") { field(DESC, "BACT within MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "LGPS:LTUS:5:MPSLIMITS.VALA") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "LGPS:LTUS:5:INTOL_BMIN") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "LGPS:LTUS:5:MPSLIMITS.VALB") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "LGPS:LTUS:5:INTOL_BMIN2") { field(DESC, "MPS tol #2") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "LGPS:LTUS:5:MPSLIMITS.VALD") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "LGPS:LTUS:5:INTOL_BRANGE") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "LGPS:LTUS:5: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, "LGPS:LTUS:5:CHCKITOL") { field(DESC, "Absolute Check I Tolerance") field(EGU, "A") field(FLNK, "LGPS:LTUS:5:TRIMITOL") field(CALC, "ABS(A*B)") field(INPA, "LGPS:LTUS:5:CHCKBTOL") field(INPB, "LGPS:LTUS:5:POLYCOEF.B") field(PREC, "9") } record(calc, "LGPS:LTUS:5:TRIMBTOL") { field(EGU, "Volts") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(DESC, "Absolute Trim Tolerance") field(CALC, "ABS(A)/2") field(INPA, "LGPS:LTUS:5:CHCKBTOL") field(FLNK, "LGPS:LTUS:5:CHCKITOL") } record(calc, "LGPS:LTUS:5:CHCKBTOL") { field(DESC, "Check absolute tolerance") field(EGU, "A") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(FLNK, "LGPS:LTUS:5:TRIMBTOL") field(CALC, "MAX(ABS(A),ABS(C))*(B/1000000)") field(INPA, "LGPS:LTUS:5:BDES.HOPR") field(INPB, "LGPS:LTUS:5:STABILITY") field(INPC, "LGPS:LTUS:5:BDES.LOPR") } record(longout, "LGPS:LTUS:5:STABILITY") { field(DESC, "Long Term Stability") field(PINI, "YES") field(VAL, "15000") field(EGU, "ppm") field(DRVH, "20000") field(DRVL, "100") field(HOPR, "20000") field(LOPR, "100") field(FLNK, "LGPS:LTUS:5:CHCKBTOL") } record(calc, "LGPS:LTUS:5:TRIMITOL") { field(DESC, "Absolute Trim I Tolerance") field(EGU, "Volts") field(CALC, "ABS(A*B)") field(INPA, "LGPS:LTUS:5:POLYCOEF.B") field(INPB, "LGPS:LTUS:5:TRIMBTOL") field(PREC, "9") } record(ai, "LGPS:LTUS:5:TRIMBTOLR") { field(DESC, "Relative trim tol") field(PREC, "4") field(EGU, "%") field(HOPR, "1.0") field(LOPR, "0.0") field(PINI, "YES") } record(ai, "LGPS:LTUS:5: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, "LGPS:LTUS:5:FBCKFCOM") { field(ZNAM, "CA") field(ONAM, "FCOM") field(DESC, "CA Mode") field(PINI, "YES") field(SDIS, "0") } record(bo, "LGPS:LTUS:5:PAU") { field(ZNAM, "NotConfigured") field(ONAM, "Configured") field(DESC, "PAU Present") field(PINI, "YES") field(SDIS, "0") field(FLNK, "LGPS:LTUS:5:PAUGO") } record(fanout, "LGPS:LTUS:5:PAUGO") { field(DESC, "PAU control") field(LNK1, "LGPS:LTUS:5:PAUSTOP") field(LNK2, "LGPS:LTUS:5: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, "LGPS:LTUS:5:PAUSTART") { field(DESC, "Setup for PAU On") field(SDIS, "LGPS:LTUS:5: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, "LGPS:LTUS:5:PAUSTOP") { field(DESC, "Setup for PAU Off") field(SDIS, "LGPS:LTUS:5: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, "LGPS:LTUS:5:MCORDEVNAME") { field(DESC, "PS device name") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, "PS:LTUS:5:") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "LGPS:LTUS:5: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, "LGPS:LTUS:5:PSTYPE.RVAL") field(INPC, "LGPS:LTUS:5:TURNEDOFF.RVAL") field(INPD, "LGPS:LTUS:5:CONFIG.RVAL") field(INPE, "LGPS:LTUS:5:PSCATEGORY.RVAL") field(INPF, "LGPS:LTUS:5:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "LGPS:LTUS:5:AUTOCTRL.RVAL") field(INPJ, "LGPS:LTUS:5:OUTOFSERVICE.RVAL") field(INPL, "LGPS:LTUS:5:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "LGPS:LTUS:5:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "LGPS:LTUS:5:PAU") field(INPP, "LGPS:LTUS:5:CALBDISABLE.RVAL") field(INPQ, "LGPS:LTUS:5:PTRBDISABLE.RVAL") field(INPR, "LGPS:LTUS:5:TRIMDISABLE.RVAL") field(INPS, "LGPS:LTUS:5:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "LGPS:LTUS:5:FBCK") field(INPU, "LGPS:LTUS:5:TRIMTYPE.RVAL") field(INPV, "LGPS:LTUS:5:STDZDIRECT.RVAL") field(INPW, "LGPS:LTUS:5:DEGAUSENABLE.RVAL") field(FLNK, "LGPS:LTUS:5:HSTA") } record(longin, "LGPS:LTUS:5:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "LGPS:LTUS:5:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "LGPS:LTUS:5: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, "LGPS:LTUS:5: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, "LGPS:LTUS:5: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, "LGPS:LTUS:5: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, "LGPS:LTUS:5: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, "LGPS:LTUS:5: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 LGPS:LTUS:5:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses LGPS:LTUS:5:FBCK. # This PV should be replaced by LGPS:LTUS:5: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, "LGPS:LTUS:5: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, "LGPS:LTUS:5: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, "LGPS:LTUS:5: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, "") field(OMSL, "supervisory") field(FLNK, "LGPS:LTUS:5:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"LGPS:LTUS:5:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "LGPS:LTUS:5:OUTOFSERVICE NPP NMS") field(OUT, "LGPS:LTUS:5:ONLINE PP") } record(bo, "LGPS:LTUS:5:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "LGPS:LTUS:5: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, "1") } record(bo, "LGPS:LTUS:5: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, "1") } record(bo, "LGPS:LTUS:5: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, "1") } # This PV is modified by :STATSUB.U record(bo, "LGPS:LTUS:5: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, "LGPS:LTUS:5: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, "LGPS:LTUS:5: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, "LGPS:LTUS:5: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, "LGPS:LTUS:5: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, "1") field(ASG, "NOWRITE") } record(mbbo, "LGPS:LTUS:5: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, "2") field(ASG, "NOWRITE") } record(mbbo, "LGPS:LTUS:5: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, "3") field(ASG, "NOWRITE") } record(mbbo, "LGPS:LTUS:5: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, "0") field(ASG, "NOWRITE") field(FLNK, "LGPS:LTUS:5:TRIMTYPE") } record(stringout, "LGPS:LTUS:5:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "LGPS:LTUS:5:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "LGPS:LTUS:5:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "LGPS:LTUS:5:STATE.RVAL") field(INPB, "LGPS:LTUS:5:INTLKSUMY.RVAL") field(OUT, "LGPS:LTUS:5:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "LGPS:LTUS:5: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, "LGPS:LTUS:5:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "LGPS:LTUS:5:STATE.RVAL") field(INPB, "LGPS:LTUS:5:INTLKSUMY.RVAL") field(OUT, "LGPS:LTUS:5:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "LGPS:LTUS:5:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "LGPS:LTUS:5:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "LGPS:LTUS:5: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, "LGPS:LTUS:5: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, "LGPS:LTUS:5: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, "LGPS:LTUS:5: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,"LGPS:LTUS:5: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("LGPS:LTUS:5:TURNEDOFF",3140,1907,0,1,"LGPS:LTUS:5:TURNEDOFF") #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "LGPS:LTUS:5:STATSUB") { field(DESC, "Build STATus ") field(INAM, "mgntInit") field(SNAM, "mgntSlcStat") field(INPA, "LGPS:LTUS:5:BACT.STAT") field(INPB, "LGPS:LTUS:5:BDES.STAT") field(INPC, "LGPS:LTUS:5:IRIPL.STAT") field(INPD, "PS:LTUS:5:ISETPT.STAT") field(INPE, "PS:LTUS:5:IACT.STAT") # 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, "LGPS:LTUS:5:BACT.SEVR") field(INPH, "LGPS:LTUS:5:BDES.SEVR") field(INPI, "LGPS:LTUS:5:IRIPL.SEVR") field(INPJ, "PS:LTUS:5:ISETPT.SEVR") field(INPK, "PS:LTUS:5:IACT.SEVR") # # 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, "LGPS:LTUS:5:STATE.RVAL") field(INPN, "LGPS:LTUS:5:STDZOK") field(INPO, "LGPS:LTUS:5:CALBOK") field(INPP, "LGPS:LTUS:5:OUTOFSERVICE.RVAL") field(INPQ, "LGPS:LTUS:5:CONFIG.RVAL") field(INPR, "LGPS:LTUS:5:HSTA") field(INPS, "LGPS:LTUS:5:CTRL.RVAL") field(INPT, "LGPS:LTUS:5:DEGAUSOK") field(INPV, "LGPS:LTUS:5: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, "LGPS:LTUS:5:STAT") } record(longout, "LGPS:LTUS:5:STAT") { field(DESC, "STAT sent to SLC") field(SCAN, "Passive") field(FLNK, "LGPS:LTUS:5:STATCTRLSUB") field(DOL, "LGPS:LTUS:5:STATSUB.VAL") field(OMSL, "closed_loop") } record(sSub, "LGPS:LTUS:5:STATCTRLSUB") { field(DESC, "Decode SLC STAT into mbbo") field(INAM, "mgntInit") field(SNAM, "mgntStatDecode") field(INPA, "LGPS:LTUS:5:STAT") field(INPB, "LGPS:LTUS:5:HSTA") field(INPD, "LGPS:LTUS:5:ONOFFCTRL.RVAL") field(FLNK, "LGPS:LTUS:5:STATMSG") } record(mbbo, "LGPS:LTUS:5: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, "LGPS:LTUS:5:UNAVAILGO") field(DOL, "LGPS:LTUS:5:STATCTRLSUB.W") } record(seq, "LGPS:LTUS:5:UNAVAILGO") { field(DESC, "Process UNAVAIL") field(DOL1, "LGPS:LTUS:5:STATSUB.U") field(LNK1, "LGPS:LTUS:5:UNAVAIL PP") } record(stringout, "LGPS:LTUS:5:SNLSTATMSG") { field(DTYP, "Soft Channel") } #! TextBox(TB0,820,1000,1200,1220,0,"Dialog",12,1,16777215,"LGPS:LTUS:5:STATUSSUB - future\nOverall device status - takes input from action snls, record sevrs, master snl(s) and outputs final status\n\nInputs:\nA - LGPS:LTUS:5:CTRLSTATUS - snl status\nB - MGNT:CTRLSTATUS - master list status\nC\nD - LGPS:LTUS:5: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,"LGPS:LTUS:5STATSUB\nformat control bo's into slc STAT\n\nInputs:\nA - LGPS:LTUS:5:STATUS\nC - LGPS:LTUS:5:ON\nD - LGPS:LTUS:5:STDZOK\nE - LGPS:LTUS:5:CALBOK\nF - LGPS:LTUS:5:BACTDRIFT (future)\nG -\nH- LGPS:LTUS:5:DACSTATUS\nI -LGPS:LTUS:5:ADCSTATUS\nJ - LGPS:LTUS:5:BACTSTATUS\nK - LGPS:LTUS:5:BDESSTATUS\nL - LGPS:LTUS:5:RIPLSTATUS\n\nOutput:\nP - LGPS:LTUS:5: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, "LGPS:LTUS:5: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, "LGPS:LTUS:5: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, "LGPS:LTUS:5: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, "LGPS:LTUS:5: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.6 #! DBDSTART #! DBD("../../../../dbd/mgntSoft.dbd") #! DBDEND record(stringout, "LGPS:LTUS:5:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "LGPS:LTUS:5:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "LGPS:LTUS:5:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "LGPS:LTUS:5:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "LGPS:LTUS:5:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "LGPS:LTUS:5:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "1") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "LGPS:LTUS:5: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, "LGPS:LTUS:5:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "LGPS:LTUS:5:TRIMTYPE.RVAL") field(INPB, "LGPS:LTUS:5:CONFIG.RVAL") field(OUT, "LGPS:LTUS:5:TRIMMAXNUM PP") } record(longout, "LGPS:LTUS:5: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, "LGPS:LTUS:5:TRIMRAMPRATE") { field(DESC, "Trim Ramp rate ") field(PINI, "YES") field(ASG, "IOC_MAINT") field(PREC, "3") field(EGU, "Volts/sec") field(HOPR, "20.0") field(DRVH, "20.0") field(DRVL, "0.1") field(LOPR, "0.5") # field(DOL, "") field(OMSL, "supervisory") field(VAL, "10") field(OUT, "LGPS:LTUS:5:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "LGPS:LTUS:5: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, "") field(OMSL, "supervisory") field(VAL, "10") } record(bo, "LGPS:LTUS:5: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, "LGPS:LTUS:5: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, "LGPS:LTUS:5:TRIMSTEPMIN") { field(DESC, "Min step in current") field(DTYP, "Soft Channel") # field(DOL, "") field(PREC, "7") field(EGUF, "10") field(EGUL, "0") field(EGU, "Volts") field(HOPR, "10") field(LOPR, "0") field(VAL, "5.0") } record(bo, "LGPS:LTUS:5:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "0") } record(ao, "LGPS:LTUS:5: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, "LGPS:LTUS:5:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "LGPS:LTUS:5: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, "LGPS:LTUS:5: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, "LGPS:LTUS:5:IMOVE") field(INPB, "LGPS:LTUS:5:IACT") field(INPC, "LGPS:LTUS:5:IRAMPRATE") field(INPD, "1.0") field(INPE, "LGPS:LTUS:5:TRIMDLYPCT") field(INPF, "LGPS:LTUS:5:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "LGPS:LTUS:5:RAMPTIME_LEFT PP") } record(longout, "LGPS:LTUS:5:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "LGPS:LTUS:5:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "LGPS:LTUS:5:RAMPDONE_CALC") } record(calc, "LGPS:LTUS:5:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "LGPS:LTUS:5:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "LGPS:LTUS:5:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "LGPS:LTUS:5: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, "LGPS:LTUS:5:RAMPTIME_LEFT") field(OUT, "LGPS:LTUS:5:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "LGPS:LTUS:5:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "LGPS:LTUS:5:RAMPTIME_LEFT NMS") field(OUT, "LGPS:LTUS:5:RAMPDONE PP") } record(bo, "LGPS:LTUS:5:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "LGPS:LTUS:5:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "LGPS:LTUS:5: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, "LGPS:LTUS:5: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(ai, "LGPS:LTUS:5: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, "LGPS:LTUS:5:MPSBTOL") { field(DESC, "Absolute mps tol") field(EGU, "Volts") field(PREC, "2") field(CALC, "ABS(A)*0.02") field(INPA, "LGPS:LTUS:5:BMAX") field(PINI, "YES") } # # 21-Aug-2013: K. Luchini # Set channel access security so that users # cannot easily change values. record(ao, "LGPS:LTUS:5:MPSBMAX") { field(DESC, "MPS Max B-field") field(EGU, "Volts") field(PREC, "7") field(DRVH, "50.0") field(DRVL, "0.0") field(PINI, "YES") field(VAL, "50.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "LGPS:LTUS:5:MPSBMIN") { field(DESC, "MPS Min B-field") field(EGU, "Volts") field(PREC, "7") field(DRVH, "50.0") field(DRVL, "0.0") field(PINI, "YES") field(VAL, "0.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "LGPS:LTUS:5:MPSBLLIM") { field(DESC, "MPS Low Limit B-field") field(EGU, "Volts") field(PREC, "7") field(DRVH, "50.0") field(DRVL, "0.0") field(PINI, "YES") field(VAL, "0.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "LGPS:LTUS:5:MPSBLLIM2") { field(DESC, "MPS Low Limit #2 B-field") field(EGU, "Volts") field(PREC, "7") field(DRVH, "50.0") field(DRVL, "0.0") field(PINI, "YES") field(VAL, "0.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } # Set the default to Std record(mbbo, "LGPS:LTUS:5: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, "LGPS:LTUS:5:MPSLIMITS.E PP") } record(aSub, "LGPS:LTUS:5: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, "LGPS:LTUS:5:MPS.RVAL") field(INPB, "LGPS:LTUS:5:BADIFF") field(INPC, "LGPS:LTUS:5:BDELTAS.N") field(INPD, "LGPS:LTUS:5:BACT") field(INPE, "LGPS:LTUS:5:MPSBITMASK.RVAL") field(INPF, "LGPS:LTUS:5:MPSBLLIM") field(INPG, "LGPS:LTUS:5:MPSBMIN") field(INPH, "LGPS:LTUS:5:MPSBMAX") field(INPI, "LGPS:LTUS:5: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, "LGPS:LTUS:5:INTOL.RVAL PP") field(OUTB, "LGPS:LTUS:5:INTOL_BMIN.RVAL PP") field(OUTC, "LGPS:LTUS:5:INTOL_BRANGE.RVAL PP") field(OUTD, "LGPS:LTUS:5: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, "LGPS:LTUS:5:INTOL") { field(DESC, "BACT within MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "LGPS:LTUS:5:MPSLIMITS.VALA") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "LGPS:LTUS:5:INTOL_BMIN") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "LGPS:LTUS:5:MPSLIMITS.VALB") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "LGPS:LTUS:5:INTOL_BMIN2") { field(DESC, "MPS tol #2") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "LGPS:LTUS:5:MPSLIMITS.VALD") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "LGPS:LTUS:5:INTOL_BRANGE") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "LGPS:LTUS:5: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, "LGPS:LTUS:5:CHCKITOL") { field(DESC, "Absolute Check I Tolerance") field(EGU, "A") field(FLNK, "LGPS:LTUS:5:TRIMITOL") field(CALC, "ABS(A*B)") field(INPA, "LGPS:LTUS:5:CHCKBTOL") field(INPB, "LGPS:LTUS:5:POLYCOEF.B") field(PREC, "9") } record(calc, "LGPS:LTUS:5:TRIMBTOL") { field(EGU, "Volts") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(DESC, "Absolute Trim Tolerance") field(CALC, "ABS(A)/2") field(INPA, "LGPS:LTUS:5:CHCKBTOL") field(FLNK, "LGPS:LTUS:5:CHCKITOL") } record(calc, "LGPS:LTUS:5:CHCKBTOL") { field(DESC, "Check absolute tolerance") field(EGU, "A") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(FLNK, "LGPS:LTUS:5:TRIMBTOL") field(CALC, "MAX(ABS(A),ABS(C))*(B/1000000)") field(INPA, "LGPS:LTUS:5:BDES.HOPR") field(INPB, "LGPS:LTUS:5:STABILITY") field(INPC, "LGPS:LTUS:5:BDES.LOPR") } record(longout, "LGPS:LTUS:5:STABILITY") { field(DESC, "Long Term Stability") field(PINI, "YES") field(VAL, "1000") field(EGU, "ppm") field(DRVH, "20000") field(DRVL, "100") field(HOPR, "20000") field(LOPR, "100") field(FLNK, "LGPS:LTUS:5:CHCKBTOL") } record(calc, "LGPS:LTUS:5:TRIMITOL") { field(DESC, "Absolute Trim I Tolerance") field(EGU, "Volts") field(CALC, "ABS(A*B)") field(INPA, "LGPS:LTUS:5:POLYCOEF.B") field(INPB, "LGPS:LTUS:5:TRIMBTOL") field(PREC, "9") } record(ai, "LGPS:LTUS:5:TRIMBTOLR") { field(DESC, "Relative trim tol") field(PREC, "4") field(EGU, "%") field(HOPR, "1.0") field(LOPR, "0.0") field(PINI, "YES") } record(ai, "LGPS:LTUS:5: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.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "LGPS:LTUS:5: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, "LGPS:LTUS:5:PSTYPE.RVAL") field(INPC, "LGPS:LTUS:5:TURNEDOFF.RVAL") field(INPD, "LGPS:LTUS:5:CONFIG.RVAL") field(INPE, "LGPS:LTUS:5:PSCATEGORY.RVAL") field(INPF, "LGPS:LTUS:5:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "LGPS:LTUS:5:AUTOCTRL.RVAL") field(INPJ, "LGPS:LTUS:5:OUTOFSERVICE.RVAL") field(INPL, "LGPS:LTUS:5:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "LGPS:LTUS:5:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "LGPS:LTUS:5:PAU") field(INPP, "LGPS:LTUS:5:CALBDISABLE.RVAL") field(INPQ, "LGPS:LTUS:5:PTRBDISABLE.RVAL") field(INPR, "LGPS:LTUS:5:TRIMDISABLE.RVAL") field(INPS, "LGPS:LTUS:5:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "LGPS:LTUS:5:FBCK") field(INPU, "LGPS:LTUS:5:TRIMTYPE.RVAL") field(INPV, "LGPS:LTUS:5:STDZDIRECT.RVAL") field(INPW, "LGPS:LTUS:5:DEGAUSENABLE.RVAL") field(FLNK, "LGPS:LTUS:5:HSTA") } record(longin, "LGPS:LTUS:5:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "LGPS:LTUS:5:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "LGPS:LTUS:5: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, "LGPS:LTUS:5: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, "LGPS:LTUS:5: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, "LGPS:LTUS:5: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, "LGPS:LTUS:5: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, "LGPS:LTUS:5: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 LGPS:LTUS:5:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses LGPS:LTUS:5:FBCK. # This PV should be replaced by LGPS:LTUS:5: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, "LGPS:LTUS:5: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, "LGPS:LTUS:5: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, "LGPS:LTUS:5: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, "") field(OMSL, "supervisory") field(FLNK, "LGPS:LTUS:5:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"LGPS:LTUS:5:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "LGPS:LTUS:5:OUTOFSERVICE NPP NMS") field(OUT, "LGPS:LTUS:5:ONLINE PP") } record(bo, "LGPS:LTUS:5:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "PS:LTUS:5:CommLink PP") } record(bo, "LGPS:LTUS:5: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, "1") } record(bo, "LGPS:LTUS:5: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, "1") } record(bo, "LGPS:LTUS:5: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, "1") } # This PV is modified by :STATSUB.U record(bo, "LGPS:LTUS:5: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, "LGPS:LTUS:5: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, "LGPS:LTUS:5: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, "LGPS:LTUS:5: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, "LGPS:LTUS:5: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, "1") field(ASG, "NOWRITE") } record(mbbo, "LGPS:LTUS:5: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, "2") field(ASG, "NOWRITE") } record(mbbo, "LGPS:LTUS:5: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, "5") field(ASG, "NOWRITE") } record(mbbo, "LGPS:LTUS:5: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, "0") field(ASG, "NOWRITE") field(FLNK, "LGPS:LTUS:5:TRIMTYPE") } record(stringout, "LGPS:LTUS:5:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "LGPS:LTUS:5:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "LGPS:LTUS:5:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "LGPS:LTUS:5:STATE.RVAL") field(INPB, "LGPS:LTUS:5:INTLKSUMY.RVAL") field(OUT, "LGPS:LTUS:5:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "LGPS:LTUS:5: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, "LGPS:LTUS:5:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "LGPS:LTUS:5:STATE.RVAL") field(INPB, "LGPS:LTUS:5:INTLKSUMY.RVAL") field(OUT, "LGPS:LTUS:5:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "LGPS:LTUS:5:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "LGPS:LTUS:5:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "LGPS:LTUS:5: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, "LGPS:LTUS:5: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, "LGPS:LTUS:5: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, "LGPS:LTUS:5: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,"LGPS:LTUS:5: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("LGPS:LTUS:5:TURNEDOFF",3140,1907,0,1,"LGPS:LTUS:5:TURNEDOFF") #! 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, "LGPS:LTUS:6:IACT") { field(DESC, "Current") field(INP, "PS:LTUS:6:IACT") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "LGPS:LTUS:6:BACT") info(autosaveFields,"HYST") } record(bi, "LGPS:LTUS:6:STATE") { field(DESC, "PS On/Off Status") field(DTYP, "Raw Soft Channel") field(INP, "PS:LTUS:6:STATE CP MS") field(ZSV, "MAJOR") field(ZNAM, "OFF") field(ONAM, "ON") } record(ao, "LGPS:LTUS:6:IDES") { field(DESC, "Desired Current") field(PREC, "3") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(MDEL, "-1") field(HIHI, "50.0") field(LOLO, "0.0") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "LGPS:LTUS:6:BDELTAS") field(DRVH, "50.0") field(DRVL, "0.0") field(DOL, "LGPS:LTUS:6: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, "LGPS:LTUS:6:ICTRL PP") } # This record is processed by LGPS:LTUS:6:ICON") # Note: we are not setting alarms here. record(ao, "LGPS:LTUS:6:ICON") { field(DESC, "Config I") field(DTYP, "Soft Channel") field(PREC, "3") field(HOPR, "50.0") field(LOPR, "0.0") field(DRVH, "50.0") field(DRVL, "0.0") field(DOL, "LGPS:LTUS:6:B2ICON.K") field(OMSL, "closed_loop") info(autosaveFields,"VAL") } record(ao, "LGPS:LTUS:6:INOM") { field(DESC, "Nominal Current") field(DOL, "LGPS:LTUS:6:BNOM.K") field(OMSL, "closed_loop") field(PREC, "3") field(EGU, "Volts") field(DRVH, "50.0") field(DRVL, "0.0") field(HOPR, "50.0") field(LOPR, "0.0") } record(ao, "LGPS:LTUS:6:ICTRL") { field(DESC, "Set Current") field(PREC, "3") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(DRVH, "50.0") field(DRVL, "0.0") field(MDEL, "-1") field(FLNK, "LGPS:LTUS:6:ICTRLGO") field(OMSL, "supervisory") info(autosavefields,"VAL") } record(seq, "LGPS:LTUS:6:ICTRLGO") { field(DESC, "Process Current Setpoint") field(PREC, "3") # Set ISETPT to supervisory field(DOL1, "0") field(LNK1, "LGPS:LTUS:6:ISETPT.OMSL") field(DOL2, "LGPS:LTUS:6:ICTRL") field(LNK2, "LGPS:LTUS:6:ISETPT PP") # Set ISETPT to closed loop - get data from BCTRLSUB.K field(DOL3, "1") field(LNK3, "LGPS:LTUS:6:ISETPT.OMSL") } record(ao, "LGPS:LTUS:6:IMAX") { field(DESC, "Max I") field(DTYP, "Soft Channel") field(DRVH, "50.0") field(DRVL, "0.0") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(PINI, "YES") field(VAL, "50.0") field(FLNK, "LGPS:LTUS:6:IMIN") } record(ao, "LGPS:LTUS:6:IMIN") { field(DESC, "Min I") field(DTYP, "Soft Channel") field(DRVH, "50.0") field(DRVL, "0.0") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(VAL, "0.0") field(FLNK, "LGPS:LTUS:6:IRANGE") } record(sel, "LGPS:LTUS:6:IACTPREVOK") { field(DESC, "Last Good Current") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(NVL, "LGPS:LTUS:6:BACT.SEVR") field(INPA, "LGPS:LTUS:6:IACT NPP MS") field(INPB, "LGPS:LTUS:6:IACTPREVOK NPP MS") field(INPC, "LGPS:LTUS:6:IACTPREVOK NPP MS") field(INPD, "LGPS:LTUS:6:IACTPREVOK NPP MS") } record(sub, "LGPS:LTUS:6:IACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "LGPS:LTUS:6:IDES") field(INPB, "LGPS:LTUS:6:ISETPT.DRVH") field(INPC, "LGPS:LTUS:6:ISETPT.DRVL") field(INPD, "LGPS:LTUS:6:IDELTAS.I") field(INPE, "LGPS:LTUS:6:IDELTAS.J") field(INPG, "LGPS:LTUS:6:STATE") field(INPH, "LGPS:LTUS:6:HSTA") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(sub, "LGPS:LTUS:6:IMONLIMITS") { field(DESC, "Aux Current Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "LGPS:LTUS:6:IDES") field(INPB, "LGPS:LTUS:6:ISETPT.DRVH") field(INPC, "LGPS:LTUS:6:ISETPT.DRVL") field(INPD, "LGPS:LTUS:6:IDELTAS.K") field(INPE, "LGPS:LTUS:6:IDELTAS.L") field(INPG, "LGPS:LTUS:6:STATE") field(INPH, "LGPS:LTUS:6:HSTA") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(seq, "LGPS:LTUS:6:ILIMITS") { field(DESC, "Set ACT and MON Limits") field(PREC, "3") field(DOL1, "LGPS:LTUS:6:BLIMITS") field(LNK1, "LGPS:LTUS:6:IACTLIMITS.F PP") field(DOL2, "LGPS:LTUS:6:IACTLIMITS.I") field(LNK2, "LGPS:LTUS:6:IACT.HIGH") field(DOL3, "LGPS:LTUS:6:IACTLIMITS.J") field(LNK3, "LGPS:LTUS:6:IACT.LOW") field(DOL4, "LGPS:LTUS:6:IACTLIMITS.K") field(LNK4, "LGPS:LTUS:6:IACT.HIHI") field(DOL5, "LGPS:LTUS:6:IACTLIMITS.L") field(LNK5, "LGPS:LTUS:6:IACT.LOLO") field(DOL6, "LGPS:LTUS:6:BLIMITS") field(LNK6, "LGPS:LTUS:6:IMONLIMITS.F PP") field(DOL7, "LGPS:LTUS:6:IMONLIMITS.I") field(LNK7, "LGPS:LTUS:6:IMON.HIGH") field(DOL8, "LGPS:LTUS:6:IMONLIMITS.J") field(LNK8, "LGPS:LTUS:6:IMON.LOW") field(DOL9, "LGPS:LTUS:6:IMONLIMITS.K") field(LNK9, "LGPS:LTUS:6:IMON.HIHI") field(DOLA, "LGPS:LTUS:6:IMONLIMITS.L") field(LNKA, "LGPS:LTUS:6: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, "LGPS:LTUS:6:IDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntRawDeltas") field(INPD, "LGPS:LTUS:6:TRIMBTOL") field(INPE, "LGPS:LTUS:6:CHCKBTOL") field(INPF, "LGPS:LTUS:6:BDELTAS.K") field(INPG, "LGPS:LTUS:6:BDELTAS.L") field(INPH, "LGPS:LTUS:6:B2IDES.L") field(EGU, "Volts") field(HOPR, "1") field(PREC, "3") field(BRSV, "INVALID") # # Used to calcualte standardize tolerance # which is returned in the VAL field. # field(INPB, "LGPS:LTUS:6:STDZITOLR") field(INPC, "LGPS:LTUS:6:STDZITOL") field(FLNK, "") } # All ps controllers with on/off control will set the macro ONOF # as follows: # # ONOF = PS:LTUS:6: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, "LGPS:LTUS:6:STATESETPT") { field(DESC, "PS On/Off") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFF") field(ONAM, "ON") field(OUT, "PS:LTUS:6:STATESETPT PP") 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:LTUS:6:RESET PP # record(bo, "LGPS:LTUS:6:RESET") { field(DESC, "Interlock Latch Reset") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFF") field(ONAM, "ON") field(HIGH, "1.0") field(OUT, "PS:LTUS:6:RESET PP") } record(bo, "LGPS:LTUS:6:RAMPSTATE") { field(DESC, "PS Ramp Status") field(DTYP, "Soft Channel") field(DOL, "PS:LTUS:6:RAMPSTATE") 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, "LGPS:LTUS:6: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, "Volts/sec") field(PREC, "3") # Set default to trim ramp rate on boot # but need to change for degauss function. field(DOL, "LGPS:LTUS:6:TRIMRAMPRATE") field(OUT, "") field(FLNK, "LGPS:LTUS:6:STDZDLY") } record(ao, "LGPS:LTUS:6:ISETPT") { field(DESC, "Current Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(DRVH, "50.0") field(DRVL, "0.0") field(MDEL, "-1") field(OUT, "PS:LTUS:6:ISETPT PP") field(DOL, "LGPS:LTUS:6: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, "LGPS:LTUS:6:IMON") { field(DESC, "Aux Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(INP, "") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "LGPS:LTUS:6:BMON") } record(ao, "LGPS:LTUS:6:IRIPL") { field(DESC, "Ripple Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(DOL, "") field(OMSL, "closed_loop") field(EGU, "Volts") field(DRVH, "1.0") field(HOPR, "1.0") field(PREC, "3") field(FLNK, "LGPS:LTUS:6:IRIPLOK") } record(sub, "LGPS:LTUS:6:IRIPLOK") { field(DESC, "Ripple Current Status") field(INAM, "mgntInit") field(SNAM, "mgntRiplOK") field(INPA, "LGPS:LTUS:6:IRIPL.VAL") field(INPB, "LGPS:LTUS:6: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, "LGPS:LTUS:6:R") { field(DESC, "Resistance") field(EGU, "Ohms") field(PREC, "4") field(PINI, "YES") field(DOL, "") 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, "LGPS:LTUS:6:IGND") { field(DESC, "Ground Current") field(EGU, "Volts") field(PREC, "6") field(PINI, "YES") field(DOL, "") field(OMSL, "closed_loop") } record(bi, "LGPS:LTUS:6:INTLKSUMY") { field(DESC, "Interlock Summary") field(INP, "PS:LTUS:6:INTLKSUMY CP MS") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(ZNAM, "OK") field(ONAM, "FAULT") field(PINI, "NO") } record(mbbo, "LGPS:LTUS:6: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:LTUS:6:COOLING") field(OMSL, "closed_loop") } # The following PV is processed by :BACTFO # which is processed by :BACT record(fanout, "LGPS:LTUS:6:IACTFO") { field(DESC, "IACT processing") field(SELM, "All") field(LNK1, "LGPS:LTUS:6:IACTPREVOK") field(LNK2, "LGPS:LTUS:6:IDIFF") field(LNK3, "LGPS:LTUS:6:IADIFF") field(LNK4, "LGPS:LTUS:6:IRATIO") field(LNK5, "LGPS:LTUS:6:IDIRECT") field(LNK6, "LGPS:LTUS:6:IACTPOL_CHECK") } record(calc, "LGPS:LTUS:6:IDIFF") { field(DESC, "IDES-IACT") field(CALC, "A-B") field(INPA, "LGPS:LTUS:6:IDES") field(INPB, "LGPS:LTUS:6:IACT") field(EGU, "Volts") field(PREC, "9") field(HOPR, "50.0") field(LOPR, "0.0") } record(calc, "LGPS:LTUS:6:IADIFF") { field(DESC, "Absolute IDES-IACT") field(CALC, "A<0?ABS(A):A") field(INPA, "LGPS:LTUS:6:IDIFF") field(PREC, "9") } record(calc, "LGPS:LTUS:6:IRATIO") { field(DESC, "IDES-IACT/IMAX") field(CALC, "B?A/B:0") field(INPA, "LGPS:LTUS:6:IDIFF") field(INPB, "LGPS:LTUS:6:IDES.DRVH") field(PREC, "9") } record(calcout, "LGPS:LTUS:6:IRANGE") { field(DESC, "Current Range") field(PINI, "YES") field(CALC, "ABS(A-B)") field(INPA, "LGPS:LTUS:6:IMIN") field(INPB, "LGPS:LTUS:6: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, "LGPS:LTUS:6: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, "LGPS:LTUS:6:IACT") field(FLNK, "LGPS:LTUS:6:IACTPOL") } record(bo, "LGPS:LTUS:6:IACTPOL") { field(DESC, "Actual I Polarity") field(DTYP, "Raw Soft Channel") field(DOL, "LGPS:LTUS:6: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,"LGPS:LTUS:6:I*LIMITS:\n Calculate alarm and warning limits based on \n deltas from LGPS:LTUS:6:IDELTAS and the\n LGPS:LTUS:6: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,"LGPS:LTUS:6:IACT: \n Get copy of LGPS:LTUS:6:I. \n",null) #! TextBox(TB12,1280,3100,1760,3200,0,"Dialog",12,1,16777215,"LGPS:LTUS:6: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,"LGPS:LTUS:6:IDES:\n Contains raw value calculated by \nLGPS:LTUS:6: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 \nLGPS:LTUS:6:BDELTAS.\n",null) #! TextBox(TB10,56,1940,316,2340,0,"Dialog",12,1,16777215,"LGPS:LTUS:6: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 LGPS:LTUS:6: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 LGPS:LTUS:6: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,"LGPS:LTUS:6:ISETPT:\n Sets the hardware. When fast feedback is set on, this record is\n set to closed loop mode by LGPS:LTUS:6:FBCKSTART sequence. When \n the loop is closed, this record takes input calculated by \n BFBCK only. When fast feedback is set off, LGPS:LTUS:6:FBCKSTOP \n will set it back to supervisory so that the value can be set by \n LGPS:LTUS:6: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, "LGPS:LTUS:6:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "LGPS:LTUS:6:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "LGPS:LTUS:6:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "LGPS:LTUS:6:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "LGPS:LTUS:6:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "LGPS:LTUS:6:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "1") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "LGPS:LTUS:6: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, "LGPS:LTUS:6:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "LGPS:LTUS:6:TRIMTYPE.RVAL") field(INPB, "LGPS:LTUS:6:CONFIG.RVAL") field(OUT, "LGPS:LTUS:6:TRIMMAXNUM PP") } record(longout, "LGPS:LTUS:6: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, "LGPS:LTUS:6:TRIMRAMPRATE") { field(DESC, "Trim Ramp rate ") field(PINI, "YES") field(ASG, "IOC_MAINT") field(PREC, "3") field(EGU, "Volts/sec") field(HOPR, "20.0") field(DRVH, "20.0") field(DRVL, "0.1") field(LOPR, "0.5") # field(DOL, "") field(OMSL, "supervisory") field(VAL, "10") field(OUT, "LGPS:LTUS:6:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "LGPS:LTUS:6: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, "") field(OMSL, "supervisory") field(VAL, "10") } record(bo, "LGPS:LTUS:6: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, "LGPS:LTUS:6: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, "LGPS:LTUS:6:TRIMSTEPMIN") { field(DESC, "Min step in current") field(DTYP, "Soft Channel") # field(DOL, "") field(PREC, "7") field(EGUF, "10") field(EGUL, "0") field(EGU, "Volts") field(HOPR, "10") field(LOPR, "0") field(VAL, "5.0") } record(bo, "LGPS:LTUS:6:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "0") } record(ao, "LGPS:LTUS:6: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, "LGPS:LTUS:6:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "LGPS:LTUS:6: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, "LGPS:LTUS:6: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, "LGPS:LTUS:6:IMOVE") field(INPB, "LGPS:LTUS:6:IACT") field(INPC, "LGPS:LTUS:6:IRAMPRATE") field(INPD, "1.577") field(INPE, "LGPS:LTUS:6:TRIMDLYPCT") field(INPF, "LGPS:LTUS:6:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "LGPS:LTUS:6:RAMPTIME_LEFT PP") } record(longout, "LGPS:LTUS:6:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "LGPS:LTUS:6:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "LGPS:LTUS:6:RAMPDONE_CALC") } record(calc, "LGPS:LTUS:6:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "LGPS:LTUS:6:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "LGPS:LTUS:6:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "LGPS:LTUS:6: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, "LGPS:LTUS:6:RAMPTIME_LEFT") field(OUT, "LGPS:LTUS:6:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "LGPS:LTUS:6:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "LGPS:LTUS:6:RAMPTIME_LEFT NMS") field(OUT, "LGPS:LTUS:6:RAMPDONE PP") } record(bo, "LGPS:LTUS:6:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "LGPS:LTUS:6:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "LGPS:LTUS:6: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, "LGPS:LTUS:6: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, "LGPS:LTUS:6:STDZINIT") { field(DESC, "Proc. Stdz PVs on boot") field(PINI, "YES") field(DOL1, "1") field(DOL2, "1") field(DOL3, "1") field(LNK1, "LGPS:LTUS:6:DEBUG.PROC PP") field(LNK2, "LGPS:LTUS:6:STDZCYCLENUM.PROC PP") field(LNK3, "LGPS:LTUS:6:STDZDISABLE.PROC PP") field(LNK4, "LGPS:LTUS:6: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, "LGPS:LTUS:6:STDZSUB") { field(DESC, "Stdz subroutine") field(INAM, "mgntStdzInit") field(SNAM, "mgntStdz") field(BRSV, "INVALID") field(INPA, "LGPS:LTUS:6:STDZIMIN NPP NMS") field(INPB, "LGPS:LTUS:6:STDZIMAX NPP NMS") field(INPC, "LGPS:LTUS:6:STDZIFINAL NPP NMS") field(INPD, "LGPS:LTUS:6:STDZCYCLENUM NPP NMS") field(INPE, "LGPS:LTUS:6:STDZDIRECT.RVAL NPP NMS") field(INPF, "LGPS:LTUS:6:STDZDISABLE.RVAL CPP NMS") field(INPG, "LGPS:LTUS:6: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, "LGPS:LTUS:6:STDZWF PP") field(OUTB, "LGPS:LTUS:6: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, "LGPS:LTUS:6:STDZWF") } record(mbbo, "LGPS:LTUS:6: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, "LGPS:LTUS:6: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, "LGPS:LTUS:6:STDZMAINPS") { field(DESC, "Stdz by main or self") field(PINI, "YES") field(DTYP, "Soft Channel") field(ZNAM, "SELF") field(ONAM, "MAIN") } record(bo, "LGPS:LTUS:6: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, "LGPS:LTUS:6: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, "LGPS:LTUS:6: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, "LGPS:LTUS:6:STDZTOD") { field(DESC, "Successful Standardize Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "LGPS:LTUS:6:STDZLOSTTOD") { field(DESC, "Standardize Lost Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(longout, "LGPS:LTUS:6:STDZCYCLECNT") { field(DESC, "Cycle Count") field(PINI, "YES") } record(longout, "LGPS:LTUS:6:STDZCYCLENUM") { field(DESC, "No. Standardize Cycles") field(VAL, "3") field(HOPR, "10") field(LOPR, "0") field(DRVH, "10") field(DRVL, "0") field(PINI, "YES") field(FLNK, "LGPS:LTUS:6:STDZDIRECT") } # The default standardize direction is "UP" for # all LCLS Magnets.. record(bo, "LGPS:LTUS:6:STDZDIRECT") { field(DESC, "Standardize Direction ") field(ZNAM, "UP") field(ONAM, "DOWN") field(VAL, "0") field(FLNK, "LGPS:LTUS:6:STDZIMIN") } record(ao, "LGPS:LTUS:6:STDZIMIN") { field(DESC, "Min-STDZ Current") field(PREC, "1") field(EGU, "A") field(HOPR, "50.0") field(LOPR, "0.0") field(VAL, "0.0") field(FLNK, "LGPS:LTUS:6:STDZIMAX") } record(ao, "LGPS:LTUS:6:STDZIMAX") { field(DESC, "Max. Standarize Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "50.0") field(LOPR, "0.0") field(VAL, "50.0") field(FLNK, "LGPS:LTUS:6:STDZIFINAL") } record(ao, "LGPS:LTUS:6:STDZIFINAL") { field(DESC, "Final SDTZ Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "50.0") field(LOPR, "0.0") field(VAL, "0.0") field(FLNK, "LGPS:LTUS:6: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, "LGPS:LTUS:6: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, "LGPS:LTUS:6:STDZITOL") { field(DESC, "Stdz min tolerance") field(PREC, "5") field(CALC, "MAX(ABS(A),ABS(B))*C") field(INPA, "LGPS:LTUS:6:STDZIMIN CP NMS") field(INPB, "LGPS:LTUS:6:STDZIMAX CP MMS") field(INPC, "0.05") field(INPD, "LGPS:LTUS:6:STDZITOLR CP MMS") field(EGU, "A") field(FLNK, "LGPS:LTUS:6:IDELTAS") field(PINI, "YES") } # D - factor (3.154/2 = 1.577) for EPSC, otherwise, set to 1.0 record(calc, "LGPS:LTUS:6:STDZDLY") { field(DESC, "Ramp time for stdz cycle") field(CALC, "C>0?MAX(1,ABS((A-B)/C)*D):0") field(INPA, "LGPS:LTUS:6:STDZIMIN CP NMS") field(INPB, "LGPS:LTUS:6:STDZIMAX CP NMS") field(INPC, "LGPS:LTUS:6:TRIMRAMPRATE CP NMS") field(INPD, "1.0") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") } record(calc, "LGPS:LTUS:6:STDZRAMPDLY") { field(DESC, "Ramp delay total") field(CALC, "MAX(1,((A/100)*B+B))") field(PREC, "5") field(INPA, "LGPS:LTUS:6:TRIMDLYPCT CP MS") field(INPB, "LGPS:LTUS:6: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, "LGPS:LTUS:6:STDZMINIDLY") { field(DESC, "Mini-stdz delay") field(CALC, "A") field(PREC, "5") field(A, "1.0") field(EGU, "sec") field(PINI, "YES") } record(ao, "LGPS:LTUS:6: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, "LGPS:LTUS:6:STDZMINIDELTA") { field(DESC, "Stdz mini % of IMAX") field(CALC, "(B/100)*(A-C)") field(INPA, "LGPS:LTUS:6:IDES.HOPR") field(INPB, "LGPS:LTUS:6:STDZMINIPCT CPP NMS") field(INPC, "LGPS:LTUS:6:IDES.LOPR") field(PREC, "5") } record(calc, "LGPS:LTUS:6:STDZMINISETPT") { field(DESC, "Mini Stdz delta") field(CALC, "C==0?MAX(E-D,B):MIN(E+D,A)") field(INPA, "LGPS:LTUS:6:IDES.HOPR") field(INPB, "LGPS:LTUS:6:IDES.LOPR") field(INPC, "LGPS:LTUS:6:STDZDIRECT.RVAL") field(INPD, "LGPS:LTUS:6:STDZMINIDELTA") field(INPE, "LGPS:LTUS:6:IDES") field(PREC, "5") field(FLNK, "LGPS:LTUS:6: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, "LGPS:LTUS:6:STDZMINISETPTOOR") { field(DESC, "Mini Stdz setpoint out of range") field(CALC, "C==0?(E-DA)") field(INPA, "LGPS:LTUS:6:IDES.HOPR") field(INPB, "LGPS:LTUS:6:IDES.LOPR") field(INPC, "LGPS:LTUS:6:STDZDIRECT.RVAL") field(INPD, "LGPS:LTUS:6:STDZMINIDELTA") field(INPE, "LGPS:LTUS:6: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, "LGPS:LTUS:6: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, "LGPS:LTUS:6:IADJUST.RVAL") field(INPB, "LGPS:LTUS:6:STDZDIRECT.RVAL") field(INPC, "LGPS:LTUS:6:STDZOK.RVAL") field(INPD, "LGPS:LTUS:6:STDZDISABLE.RVAL") field(INPE, "LGPS:LTUS:6:STATE.RVAL CPP NMS") field(INPF, "LGPS:LTUS:6:ICTRL.RVAL") field(INPG, "LGPS:LTUS:6:STATE.SEVR") field(INPH, "LGPS:LTUS:6:BDELTAS.M") field(INPI, "LGPS:LTUS:6:IACT.SEVR") field(OUT, "LGPS:LTUS:6:STDZLOSTGO.SELN PP NMS") field(OOPT, "Transition To Non-zero") } record(seq, "LGPS:LTUS:6:STDZLOSTGO") { field(DESC, "Process lost stdz") field(SELM, "Mask") field(DOL1, "1") field(DOL2, "0") field(LNK1, "LGPS:LTUS:6:STDZLOSTTOD.PROC") field(LNK2, "LGPS:LTUS:6:STDZOK PP") } # Record maximum current after standardize # Reset to IACT from sequence after trim # Disable processing during (mini-)standardize or trim record(calc, "LGPS:LTUS:6:STDZIACTMAX") { field(DESC, "Max act current after stdz") field(CALC, "MAX(A, B)") field(DISV, "0") field(SDIS, "LGPS:LTUS:6:CHECKPWRDIP_ENABLE") field(INPA, "LGPS:LTUS:6:IACT CP") field(INPB, "LGPS:LTUS:6:STDZIACTMAX") field(EGU, "A") field(FLNK, "LGPS:LTUS:6:CHECKPWRDIP") } # Detect power dip if STDZOK is YES, STDZ is enabled, and IACT is valid # If IACT drops below STDZIACTMAX by more than the trim tolerance, clear STDZOK # Warning: Take the absolute value of the trim tolerance, or else quads of # negative polarity will always lose STDZ since their IDELTAS.I are negative. # Note: Large quads and bends are prone to losing STDZ even if they are # perturbed toward higher current since their current tends to overshoot # by greater than the trim tolerance before settling down. record(calcout, "LGPS:LTUS:6:CHECKPWRDIP") { field(DESC, "Detect power dip") field(CALC, "(A-B>ABS(C))?3:0") field(DISV, "0") field(SDIS, "LGPS:LTUS:6:CHECKPWRDIP_ENABLE") field(INPA, "LGPS:LTUS:6:STDZIACTMAX") field(INPB, "LGPS:LTUS:6:IACT") field(INPC, "LGPS:LTUS:6:IDELTAS.I") field(OUT, "LGPS:LTUS:6:STDZLOSTGO.SELN PP NMS") field(OOPT, "When Non-zero") } # Enable processing of STDZIACTMAX and CHECKPWRDIP only if # STDZOK = YES, STDZDISABLE = NO, CTRL != Trim (2), and # CTRL != Stdz (4) record(calc, "LGPS:LTUS:6:CHECKPWRDIP_ENABLE") { field(CALC, "A&&!B&&(C#2)&&(C#4)") field(INPA, "LGPS:LTUS:6:STDZOK.RVAL CP") field(INPB, "LGPS:LTUS:6:STDZDISABLE.RVAL CP") field(INPC, "LGPS:LTUS:6:CTRL.RVAL CP") } #! 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, "LGPS:LTUS:6: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, "LGPS:LTUS:6: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, "LGPS:LTUS:6:CALBSET") { field(DESC, "Use DAC Calbration") field(SCAN, "10 second") field(CALC, "A&&(B==0)&&C?31:960") field(INPA, "LGPS:LTUS:6:CALBOK") field(INPB, "LGPS:LTUS:6:CALBDISABLE") field(INPC, "LGPS:LTUS:6:CALBSLOPE") field(OOPT, "On Change") field(OUT, "LGPS:LTUS:6: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, "LGPS:LTUS:6:CALB_SEQ") { field(DESC, "Output Calib Values") field(SELM, "Mask") field(SELL, "LGPS:LTUS:6: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, "LGPS:LTUS:6:CALBSLOPE") field(DOL3, "LGPS:LTUS:6: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, "LGPS:LTUS:6:CALBTOD") { field(DESC, "Calibration Success Time") field(PINI, "YES") # field(DOL, "") field(OMSL, "supervisory") field(DTYP, "Soft Channel") info(autosaveFields,"VAL") } record(ao, "LGPS:LTUS:6: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, "LGPS:LTUS:6: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, "LGPS:LTUS:6: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, "LGPS:LTUS:6:CALBOFFSET") { field(DESC, "Calc DAC Offset") field(PREC, "6") field(EGU, "Counts") field(PINI, "YES") } record(bo, "LGPS:LTUS:6: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, "LGPS:LTUS:6:DACSLOPE") { field(DESC, "V to DAC slope") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "supervisory") field(PINI, "YES") field(FLNK, "LGPS:LTUS:6:DACOFFSET") } # Default Offset used in conversion from Volts to DAC Counts record(ao, "LGPS:LTUS:6:DACOFFSET") { field(DESC, "V to DAC offset") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "supervisory") field(PINI, "YES") field(FLNK, "LGPS:LTUS:6: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, "LGPS:LTUS:6: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, "LGPS:LTUS:6:IACT") field(INPD, "LGPS:LTUS:6:DACSLOPE") field(INPE, "LGPS:LTUS:6:DACOFFSET") field(EGU, "Counts") field(PREC, "6") } record(ao, "LGPS:LTUS:6:DAC") { field(DESC, "DAC Set point") field(EGU, "Counts") field(DOL, "") field(OMSL, "supervisory") field(PREC, "6") field(PINI, "YES") } record(ao, "LGPS:LTUS:6:CALBIMIN") { field(DESC, "Calibration Min Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(DRVH, "50.0") field(HOPR, "50.0") field(DRVL, "0.0") field(LOPR, "0.0") field(PREC, "3") field(EGU, "A") field(VAL, "0.0") field(FLNK, "LGPS:LTUS:6:CALBIMAX") } record(ao, "LGPS:LTUS:6:CALBIMAX") { field(DESC, "Calibration Max Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(DRVH, "50.0") field(HOPR, "50.0") field(LOPR, "0.0") field(DRVL, "0.0") field(EGU, "A") field(VAL, "50.0") field(FLNK, "LGPS:LTUS:6:CALBSTEPNUM") } record(ao, "LGPS:LTUS:6:CALBIFINAL") { field(DESC, "Calibration Last Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(PREC, "3") field(EGU, "A") field(HOPR, "50.0") field(LOPR, "0.0") field(VAL, "0") } record(longout, "LGPS:LTUS:6: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, "LGPS:LTUS:6:CALBIDELTA") } record(calc, "LGPS:LTUS:6:CALBIDELTA") { field(DESC, "Step size for CALB") field(CALC, "C=0?0:ABS((A-B)/C)") field(INPA, "LGPS:LTUS:6:CALBIMAX") field(INPB, "LGPS:LTUS:6:CALBIMIN") field(INPC, "LGPS:LTUS:6: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, "LGPS:LTUS:6:CALBIMULT") { field(DESC, "IACT vs ISETPT mult") field(CALC, "C#0||A=0?1:ABS(B/A)") field(INPA, "PS:LTUS:6:ISETPT.DRVH") field(INPB, "PS:LTUS:6:IACT.HOPR") field(INPC, "LGPS:LTUS:6:PSCONTROLLER.RVAL CPP") field(EGU, "A") field(PINI, "YES") } # SNL dbputs DAC values here. 6-10 steps are possible. record(waveform, "LGPS:LTUS:6:CALBICTRLWF") { field(DESC, "ICTRL setpoint array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") } record(waveform, "LGPS:LTUS:6:DACWF") { field(DESC, "DAC count array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "LGPS:LTUS:6:DACSA") } # Used only for xygraph edm plot record(subArray, "LGPS:LTUS:6:DACSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "LGPS:LTUS:6: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, "LGPS:LTUS:6:CALCDACWF") { field(DESC, "Calc DAC counts array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "LGPS:LTUS:6:CALCDACSA") } # Used only for xygraph edm plot record(subArray, "LGPS:LTUS:6:CALCDACSA") { field(DESC, "Calc DAC counts") field(DTYP, "Soft Channel") field(INP, "LGPS:LTUS:6: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, "LGPS:LTUS:6:CALBYWF") { field(DESC, "mx + b") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "LGPS:LTUS:6:CALBYSA") } # Used only for xygraph edm plot record(subArray, "LGPS:LTUS:6:CALBYSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "LGPS:LTUS:6:CALBYWF") field(MALM, "10") field(NELM, "6") field(INDX, "0") field(FTVL, "DOUBLE") } record(waveform, "LGPS:LTUS:6:CALBIACTWF") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "LGPS:LTUS:6:CALBIACTSA") } # Used only for xygraph edm plot record(subArray, "LGPS:LTUS:6:CALBIACTSA") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(MALM, "10") field(NELM, "6") field(INP, "LGPS:LTUS:6:CALBIACTWF") field(INDX, "0") field(FTVL, "DOUBLE") field(FLNK, "LGPS:LTUS:6:CALBLIMITS") } # Check that measured current during calibration is within # tolerance. record(aSub, "LGPS:LTUS:6: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, "LGPS:LTUS:6:CALBSTEPNUM") field(INPB, "LGPS:LTUS:6:CALBIACTWF") field(INPC, "LGPS:LTUS:6: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, "LGPS:LTUS:6: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, "LGPS:LTUS:6:STDZITOL") field(INPH, "LGPS:LTUS:6:DACSLOPE") field(INPI, "LGPS:LTUS:6: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, "LGPS:LTUS:6: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, "LGPS:LTUS:6:CALBSTEPNUM") field(INPB, "LGPS:LTUS:6:CALBIACTWF") field(INPC, "LGPS:LTUS:6:DACWF") field(INPF, "LGPS:LTUS:6: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 LGPS:LTUS:6CALBOK 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, "LGPS:LTUS:6:DEGAUSINIT") { field(DESC, "Proc. Degauss PVs on boot") field(PINI, "YES") field(DOL, "1") field(OUTA, "LGPS:LTUS:6:DEGAUSIMIN.PROC PP") field(OUTB, "LGPS:LTUS:6:DEGAUSIMAX.PROC PP") field(OUTC, "LGPS:LTUS:6:DEGAUSTYPE.PROC PP") field(OUTD, "LGPS:LTUS:6:DEGAUSSTEP.PROC PP") field(OUTE, "LGPS:LTUS:6:MADNAME.PROC PP") field(OUTF, "LGPS:LTUS:6:PSTYPE.PROC PP") field(OUTG, "LGPS:LTUS:6: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, "LGPS:LTUS:6:DEGAUSSUB") { field(DESC, "Degauss subroutine") field(INAM, "mgntDegaussInit") field(SNAM, "mgntDegauss") field(BRSV, "INVALID") field(INPA, "LGPS:LTUS:6:DEGAUSIMIN NPP NMS") field(INPB, "LGPS:LTUS:6:DEGAUSIMAX NPP NMS") field(INPC, "LGPS:LTUS:6:DEGAUSTYPE.RVAL NPP NMS") field(INPE, "LGPS:LTUS:6:DEGAUSMETHOD.RVAL NPP NMS") field(INPF, "LGPS:LTUS:6:PSTYPE NPP NMS") field(INPG, "LGPS:LTUS:6:DEBUG.RVAL NPP NMS") field(INPH, "LGPS:LTUS:6: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, "LGPS:LTUS:6:DEGAUSWF PP") field(OUTB, "LGPS:LTUS:6:DEGAUSMSG PP") field(OUTC, "LGPS:LTUS:6: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, "LGPS:LTUS:6:DEGAUSWF") { field(DESC, "Degauss Setpts") field(NELM, "60") field(FTVL, "DOUBLE") } record(mbbo,"LGPS:LTUS:6: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, "LGPS:LTUS:6: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, "LGPS:LTUS:6: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, "LGPS:LTUS:6: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, "LGPS:LTUS:6: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, "LGPS:LTUS:6:DEGAUSIMIN") { field(DESC, "Min. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "50.0") field(LOPR, "-50.0") field(DRVH, "50.0") field(DRVL, "-50.0") field(VAL, "-50.0") } record(ao, "LGPS:LTUS:6:DEGAUSIMAX") { field(DESC, "Max. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "50.0") field(LOPR, "-50.0") field(DRVH, "50.0") field(DRVL, "-50.0") field(VAL, "50.0") } # 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,"LGPS:LTUS:6: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, "LGPS:LTUS:6: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,"LGPS:LTUS:6: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, "LGPS:LTUS:6: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, "LGPS:LTUS:6: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, "LGPS:LTUS:6: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, "LGPS:LTUS:6:DEGAUSTOD") { field(DESC, "Successful Degauss Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "LGPS:LTUS:6:DEGAUSLOSTTOD") { field(DESC, "Degauss Lost Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "LGPS:LTUS:6:DEGAUSTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "LGPS:LTUS:6:DEGAUSTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "LGPS:LTUS:6: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, "LGPS:LTUS:6:DEGAUSGO") { field(DESC, "Set bdes of btrms to zero") field(ASG, "Internal") field(OUTA, "") field(OUTB, "") field(OUTC, "") field(OUTD, "") } # =========== CRYO ONLY =========== record(bo, "LGPS:LTUS:6: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, "LGPS:LTUS:6:DEGAUS_IMAX_CHECK") { field(DESC, "Check if imax shoud chg") field(CALC, "(C==4)&&(ABS(B)>ABS(A))?1:0") field(INPA, "LGPS:LTUS:6:DEGAUS_IMAX") field(INPB, "LGPS:LTUS:6:ISETPT") field(INPC, "LGPS:LTUS:6:DEGAUSTYPE.RVAL") field(OUT, "LGPS:LTUS:6:DEGAUS_IMAX_UPDATE.SELN") field(FLNK, "LGPS:LTUS:6:DEGAUS_IMAX_UPDATE") } record(seq, "LGPS:LTUS:6:DEGAUS_IMAX_UPDATE") { field(DESC, "Degauss IMAX Update") field(SELM, "Specified") field(DOL1, "LGPS:LTUS:6:ISETPT") field(LNK1, "LGPS:LTUS:6:DEGAUS_IMAX PP") } # Set the maximum current after a successful # degauss. This pv is updated by the # sequence. record(ao, "LGPS:LTUS:6:DEGAUS_IMAX") { field(DESC, "Max I set afer a degauss") field(EGU, "Amps") field(PINI, "YES") field(PREC, "6") field(HOPR, "50.0") field(LOPR, "-50.0") field(DRVH, "50.0") field(DRVL, "-50.0") field(VAL, "50.0") field(FLNK, "LGPS:LTUS:6:DEGAUS_IMAXPOL_CHECK") info(autosaveFields,"VAL,RVAL") } # Set the polarity if degauss_imax record(calcout, "LGPS:LTUS:6:DEGAUS_IMAXPOL_CHECK") { field(DESC, "Determine polarity of imax") field(CALC, "A>=0?0:1") field(INPA, "LGPS:LTUS:6:DEGAUS_IMAX") field(FLNK, "LGPS:LTUS:6:DEGAUS_IMAXPOL") } record(bo, "LGPS:LTUS:6:DEGAUS_IMAXPOL") { field(DESC, "Polarity of imax I") field(DTYP, "Raw Soft Channel") field(DOL, "LGPS:LTUS:6:DEGAUS_IMAXPOL_CHECK") field(OMSL, "closed_loop") field(ZNAM, "Positive") field(ONAM, "Negative") field(FLNK, "LGPS:LTUS:6: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, "LGPS:LTUS:6:DEGAUS_ABSIMAX") { field(DESC, "Absolute Max. Degauss I") field(CALC, "ABS(A)") field(INPA, "LGPS:LTUS:6:DEGAUS_IMAX") field(PREC, "6") field(EGU, "Amps") field(HOPR, "50.0") field(LOPR, "-50.0") info(autosaveFields,"VAL RVAL") } # IACT Polarity record(calcout, "LGPS:LTUS:6:IACTPOL_CHECK") { field(DESC, "Determine IACT polarity") field(SCAN, "5 second") field(CALC, "ABS(A-B)>C?(A>=0?0:1):D") field(INPA, "LGPS:LTUS:6:IACT") field(INPB, "LGPS:LTUS:6:IACTPOL_CHECK.LA") field(INPC, "0.0001") field(INPD, "LGPS:LTUS:6:IACTPOL_CHECK.PVAL") field(OOPT, "On Change") field(FLNK, "LGPS:LTUS:6:IACTPOL") } record(bo, "LGPS:LTUS:6: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,"LGPS:LTUS:6: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, "LGPS:LTUS:6:DEGAUSENABLE CP") field(INPB, "LGPS:LTUS:6:DEGAUSOK") field(INPC, "LGPS:LTUS:6:STATE CP") field(INPD, "LGPS:LTUS:6:STATE.SEVR") field(OUT, "LGPS:LTUS:6:DEGAUS_STATE_SEQ.SELN PP") field(ASG, "Internal") } record(seq, "LGPS:LTUS:6:DEGAUS_STATE_SEQ") { field(DESC, "Degauss State Sequence") field(SELM, "Specified") field(SELL, "LGPS:LTUS:6:DEGAUS_STATE_CHECK") field(LNK1, "LGPS:LTUS:6:DEGAUS_STATE_DISABLE.PROC PP") field(LNK2, "LGPS:LTUS:6:DEGAUS_STATE_LOST.PROC PP") field(LNK3, "LGPS:LTUS:6:DEGAUS_STATE_GOOD.PROC PP") field(LNK4, "LGPS:LTUS:6: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, "LGPS:LTUS:6:DEGAUS_STATE_DISABLE") { field(DESC, "Degauss not used") field(LNK1, "LGPS:LTUS:6:DEGAUSOK.ZSV") field(LNK2, "LGPS:LTUS:6: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, "LGPS:LTUS:6:STATMSG.FRSV") field(LNK4, "LGPS:LTUS:6: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, "LGPS:LTUS:6:DEGAUS_STATE_LOST") { field(DESC, "Degauss lost and ps On") field(DOL1, "1") field(LNK1, "LGPS:LTUS:6:DEGAUSOK.ZSV") field(LNK2, "LGPS:LTUS:6: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, "LGPS:LTUS:6:STATMSG.FRSV") field(LNK4, "LGPS:LTUS:6: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, "LGPS:LTUS:6:DEGAUS_STATE_OFF") { field(DESC, "Degaused lost and ps Off") field(DOL1, "2") field(LNK1, "LGPS:LTUS:6: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, "LGPS:LTUS:6:STATMSG.FRSV") field(LNK3, "LGPS:LTUS:6: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, "LGPS:LTUS:6:DEGAUS_STATE_GOOD") { field(DESC, "Degauss good") field(DOL1, "1") field(LNK1, "LGPS:LTUS:6: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, "LGPS:LTUS:6:STATMSG.FRSV PP") field(LNK3, "LGPS:LTUS:6:STATMSG.FVSV PP") field(LNK4, "") field(ASG, "Internal") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(mbbo, "LGPS:LTUS:6:FUNC") { field(DESC, "LGPS:LTUS:6 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, "1") field(NIVL, "2") field(TEVL, "3") field(ELVL, "0") field(TVVL, "0") field(TTVL, "0") field(FTVL, "0") field(FFVL, "0") field(OUT, "LGPS:LTUS:6:CTRL CA") } # :CTRL pv is processed at boot in the # sequence mgntCtrl.st Processed in sequence # record(mbbo, "LGPS:LTUS:6:CTRL") { field(DESC, "LGPS:LTUS:6 Control") field(PINI, "NO") field(ZRST, "Ready") field(ONST, "RESET") field(TWST, "TURN_ON") field(THST, "TURN_OFF") 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, "8") field(TWVL, "9") field(THVL, "10") 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, "LGPS:LTUS:6:SELECTEN.A PP") field(SDIS, "0") } # If a function has been selected set this unit to busy record(calcout, "LGPS:LTUS:6:SELECTEN") { field(DESC, "Control Select Enable") field(CALC, "A>0?1:A") field(FLNK, "LGPS:LTUS:6:BUSY") } # Set to FREE on IOC reboot record(bo, "LGPS:LTUS:6:BUSY") { field(DESC, "LGPS:LTUS:6 Ctrl Done") field(DOL, "LGPS:LTUS:6:SELECTEN") field(ZNAM, "FREE") field(ONAM, "BUSY") field(PINI, "YES") field(FLNK, "LGPS:LTUS:6:SELECT") } record(bo, "LGPS:LTUS:6:SELECT") { field(ZNAM, "NO") field(ONAM, "YES") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") } record(bo, "LGPS:LTUS:6: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, "LGPS:LTUS:6:CTRLSTATE") { field(DESC, "LGPS:LTUS:6 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("LGPS:LTUS:6:CTRL",20,20,0,0,"LGPS:LTUS:6:CTRL") #! Field("LGPS:LTUS:6:CTRL.OUT",16777215,1,"LGPS:LTUS:6:CTRL.OUT") #! Link("LGPS:LTUS:6:CTRL.OUT","LGPS:LTUS:6:SELECTEN.A") #! Field("LGPS:LTUS:6:CTRL.VAL",16777215,1,"LGPS:LTUS:6:CTRL.VAL") #! Record("LGPS:LTUS:6:SELECTEN",321,381,0,0,"LGPS:LTUS:6:SELECTEN") #! Field("LGPS:LTUS:6:SELECTEN.A",16777215,0,"LGPS:LTUS:6:SELECTEN.A") #! Field("LGPS:LTUS:6:SELECTEN.FLNK",16777215,1,"LGPS:LTUS:6:SELECTEN.FLNK") #! Link("LGPS:LTUS:6:SELECTEN.FLNK","LGPS:LTUS:6:BUSY") #! Field("LGPS:LTUS:6:SELECTEN.VAL",16777215,1,"LGPS:LTUS:6:SELECTEN.VAL") #! Record("LGPS:LTUS:6:BUSY",623,274,0,0,"LGPS:LTUS:6:BUSY") #! Field("LGPS:LTUS:6:BUSY.DOL",16777215,0,"LGPS:LTUS:6:BUSY.DOL") #! Link("LGPS:LTUS:6:BUSY.DOL","LGPS:LTUS:6:SELECTEN.VAL") #! Field("LGPS:LTUS:6:BUSY.FLNK",16777215,1,"LGPS:LTUS:6:BUSY.FLNK") #! Link("LGPS:LTUS:6:BUSY.FLNK","LGPS:LTUS:6:SELECT") #! Record("LGPS:LTUS:6:SELECT",669,508,0,1,"LGPS:LTUS:6:SELECT") #! Record("LGPS:LTUS:6:FUNC",940,120,0,0,"LGPS:LTUS:6:FUNC") #! Field("LGPS:LTUS:6:FUNC.OUT",16777215,0,"LGPS:LTUS:6:FUNC.OUT") #! Link("LGPS:LTUS:6:FUNC.OUT","LGPS:LTUS:6:CTRL.VAL") #! Record("LGPS:LTUS:6:ABORT",193,41,0,0,"LGPS:LTUS:6:ABORT") #! Record("LGPS:LTUS:6:CTRLSTATE",369,34,0,0,"LGPS:LTUS:6: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,"LGPS:LTUS:6:SELECT is used for Multi-device selection.\nIt is enabled when associated LGPS:LTUS:6:CTRL is \"0\" (DONE).\nIt is disabled when associated LGPS:LTUS:6: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,"LGPS:LTUS:6: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, "LGPS:LTUS:6:BCTRL_INIT") { field(DESC, "Process BCTRL on boot") field(PINI, "YES") field(CALC, "A=3?1:0") field(INPA, "LGPS:LTUS:6:BCTRL.SEVR") field(OUT, "LGPS:LTUS:6: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, "LGPS:LTUS:6:BACT") { field(DESC, "Actual B") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "LGPS:LTUS:6:BACT") field(INPB, "LGPS:LTUS:6:POLYCOEF") field(INPC, "LGPS:LTUS:6:POLYCOEF.A") field(INPD, "LGPS:LTUS:6:POLYCOEF.B") field(INPE, "LGPS:LTUS:6:IACT MS") field(INPF, "LGPS:LTUS:6:BDELTAS PP") field(INPG, "100") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(HIHI, "50.0") field(LOLO, "0.0") field(PREC, "3") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "50.0") field(LOW, "0.0") field(FLNK, "LGPS:LTUS:6: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, "LGPS:LTUS:6:BDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntPhyDeltas") field(EGU, "Volts") field(HOPR, "1") field(PREC, "3") field(BRSV, "INVALID") field(INPA, "LGPS:LTUS:6:BDES") field(INPB, "LGPS:LTUS:6:TRIMBTOL") field(INPC, "LGPS:LTUS:6:TRIMBTOLR") field(INPD, "LGPS:LTUS:6:CHCKBTOL") field(INPE, "LGPS:LTUS:6:CHCKBTOLR") field(F, "0.0") field(INPG, "30") field(INPH, "LGPS:LTUS:6:BACT.VAL") # # MPS absolute and relative tolerances field(INPP, "LGPS:LTUS:6:MPSBTOL") field(INPQ, "LGPS:LTUS:6:MPSBTOLR") field(FLNK, "LGPS:LTUS:6:BCONLIMITS") info(autosaveFields,"F") } # This record is processed by BDELTAS record(aSub, "LGPS:LTUS:6:BCONLIMITS") { field(DESC, "Config B-field Limits") field(INAM, "mgntInit") field(SNAM, "mgntBCONLimits") field(INPA, "LGPS:LTUS:6:BDES") field(INPB, "LGPS:LTUS:6:BDELTAS.I") field(INPG, "LGPS:LTUS:6:DEBUG.RVAL") field(FTA, "DOUBLE") field(FTB, "DOUBLE") field(FTG, "ULONG") field(OUTA, "LGPS:LTUS:6:BCON.HIGH") field(OUTB, "LGPS:LTUS:6:BCON.LOW") field(OUTC, "LGPS:LTUS:6:BCON.HIHI") field(OUTD, "LGPS:LTUS:6:BCON.LOLO PP") field(FTVA, "DOUBLE") field(FTVB, "DOUBLE") field(FTVC, "DOUBLE") field(FTVD, "DOUBLE") field(BRSV, "INVALID") field(FLNK, "LGPS:LTUS:6:IDELTAS") } # The following PV is processed by :BACT # which is processed by :BACT # record(fanout, "LGPS:LTUS:6:BACTFO") { field(DESC, "BACT processing") field(SELM, "All") field(LNK1, "LGPS:LTUS:6:BDIFF") field(LNK2, "LGPS:LTUS:6:BADIFF") field(LNK3, "LGPS:LTUS:6:BRATIO") field(LNK4, "LGPS:LTUS:6:MPSLIMITS") field(LNK5, "LGPS:LTUS:6:I2BSTATUS") field(LNK6, "LGPS:LTUS:6:IACTFO.PROC") } record(calc, "LGPS:LTUS:6:BDIFF") { field(DESC, "BDES-BACT") field(CALC, "A-B") field(INPA, "LGPS:LTUS:6:BDES") field(INPB, "LGPS:LTUS:6:BACT") field(EGU, "Volts") field(PREC, "7") } record(calc, "LGPS:LTUS:6:BADIFF") { field(DESC, "Absolute BDES-BACT") field(INPA, "LGPS:LTUS:6:BDIFF") field(EGU, "Volts") field(PREC, "7") field(CALC, "A<0?ABS(A):A") } record(calc, "LGPS:LTUS:6:BRATIO") { field(DESC, "BACT Error") field(CALC, "B?A/B:0") field(INPA, "LGPS:LTUS:6:BDIFF") field(INPB, "LGPS:LTUS:6:BDES.HOPR") field(EGU, "Volts") field(PREC, "7") } record(mbbi, "LGPS:LTUS:6: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, "LGPS:LTUS:6:BACT.J") } # Note: for a string slave set the MONFL # macro to the following: # MONFL=:IMONCALC MS record(sub, "LGPS:LTUS:6:BMON") { field(DESC, "Second Transductor") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "LGPS:LTUS:6:BMON") field(INPB, "LGPS:LTUS:6:POLYCOEF") field(INPC, "LGPS:LTUS:6:POLYCOEF.A") field(INPD, "LGPS:LTUS:6:POLYCOEF.B") field(INPE, "LGPS:LTUS:6:IMON MS") field(INPF, "LGPS:LTUS:6:BDELTAS.VAL") field(INPG, "100") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(HIHI, "50.0") field(LOLO, "0.0") field(PREC, "3") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "50.0") field(LOW, "0.0") } # 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:LTUS:6:BDES CP record(ao, "LGPS:LTUS:6:BDES") { field(DESC, "Desired B-Field") field(PINI, "YES") field(DRVH, "50.0") field(DRVL, "0.0") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(EGU, "Volts") field(MDEL, "-1") field(OMSL, "closed_loop") field(DOL, "LGPS:LTUS:6:BDES.DRVH") field(OUT, "LGPS:LTUS:6:B2IDES PP") info(autosaveFields,"VAL") } record(sub, "LGPS:LTUS:6:B2IDES") { field(DESC, "Convert Desired B-Field to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "LGPS:LTUS:6:POLYCOEF") field(INPC, "LGPS:LTUS:6:POLYCOEF.A") field(INPD, "LGPS:LTUS:6:POLYCOEF.B") field(PREC, "3") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(MDEL, "-1") field(INPE, "LGPS:LTUS:6:BDES.DRVH") field(INPF, "LGPS:LTUS:6:BDES.DRVL") field(BRSV, "INVALID") field(FLNK, "LGPS:LTUS:6:IDES") } record(sub, "LGPS:LTUS:6:BNOM") { field(DESC, "Nominal Field") field(PINI, "YES") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "LGPS:LTUS:6:POLYCOEF") field(INPC, "LGPS:LTUS:6:POLYCOEF.A") field(INPD, "LGPS:LTUS:6:POLYCOEF.B") field(INPE, "LGPS:LTUS:6:BDES.DRVH") field(INPF, "LGPS:LTUS:6:BDES.DRVL") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(VAL, "0.0") field(FLNK, "LGPS:LTUS:6:INOM") } record(sub, "LGPS:LTUS:6:BACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "LGPS:LTUS:6:BDES.VAL") field(INPB, "LGPS:LTUS:6:BDES.DRVH") field(INPC, "LGPS:LTUS:6:BDES.DRVL") field(INPD, "LGPS:LTUS:6:BDELTAS.I") field(INPE, "LGPS:LTUS:6:BDELTAS.J") field(INPG, "LGPS:LTUS:6:STATE") field(INPH, "LGPS:LTUS:6:HSTA") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(sub, "LGPS:LTUS:6:BMONLIMITS") { field(DESC, "MON Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "LGPS:LTUS:6:BDES.VAL") field(INPB, "LGPS:LTUS:6:BDES.DRVH") field(INPC, "LGPS:LTUS:6:BDES.DRVL") field(INPD, "LGPS:LTUS:6:BDELTAS.K") field(INPE, "LGPS:LTUS:6:BDELTAS.L") field(INPG, "LGPS:LTUS:6:STATE") field(INPH, "LGPS:LTUS:6:HSTA") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(seq, "LGPS:LTUS:6:BLIMITS") { field(DESC, "ACT Limits") field(PREC, "3") field(DOL1, "LGPS:LTUS:6:BLIMITS") field(LNK1, "LGPS:LTUS:6:BACTLIMITS.F PP") field(DOL2, "LGPS:LTUS:6:BACTLIMITS.I") field(LNK2, "LGPS:LTUS:6:BACT.HIGH") field(DOL3, "LGPS:LTUS:6:BACTLIMITS.J") field(LNK3, "LGPS:LTUS:6:BACT.LOW") field(DOL4, "LGPS:LTUS:6:BACTLIMITS.K") field(LNK4, "LGPS:LTUS:6:BACT.HIHI") field(DOL5, "LGPS:LTUS:6:BACTLIMITS.L") field(LNK5, "LGPS:LTUS:6:BACT.LOLO") field(DOL6, "LGPS:LTUS:6:BLIMITS") field(LNK6, "LGPS:LTUS:6:BMONLIMITS.F PP") field(DOL7, "LGPS:LTUS:6:BMONLIMITS.I") field(LNK7, "LGPS:LTUS:6:BMON.HIGH") field(DOL8, "LGPS:LTUS:6:BMONLIMITS.J") field(LNK8, "LGPS:LTUS:6:BMON.LOW") field(DOL9, "LGPS:LTUS:6:BMONLIMITS.K") field(LNK9, "LGPS:LTUS:6:BMON.HIHI") field(DOLA, "LGPS:LTUS:6:BMONLIMITS.L") field(LNKA, "LGPS:LTUS:6:BMON.LOLO") field(FLNK, "LGPS:LTUS:6:ILIMITS") field(SCAN, "5 second") } record(ao, "LGPS:LTUS:6:BCTRL") { field(DESC, "B-Perturb") field(PREC, "3") field(EGU, "Volts") field(DRVH, "50.0") field(DRVL, "0.0") field(HOPR, "50.0") field(LOPR, "0.0") # 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, "LGPS:LTUS:6: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, "LGPS:LTUS:6:BCTRLGO") { field(DESC, "Update DES and perturb") field(PREC, "3") # Disable BACT limits field(DOL1, "1") field(LNK1, "LGPS:LTUS:6:BLIMITS.VAL") # Update BDES with the BCTRL (slider) value field(DOL2, "LGPS:LTUS:6:BCTRL.VAL") field(LNK2, "LGPS:LTUS:6:BDES PP") field(DOL3, "1") field(LNK3, "LGPS:LTUS:6:IDIRECT.PROC PP") field(DOL4, "1") field(LNK4, "LGPS:LTUS:6:CHECKSTDZLOST.PROC PP") field(DOL5, "LGPS:LTUS:6:BCTRL.VAL") field(LNK5, "LGPS:LTUS:6:BCTRLSUB PP") # Re-enable BACT limits field(DOL6, "0") field(LNK6, "LGPS:LTUS:6:BLIMITS.VAL") } # Convert B-field to Current and output to ISETPT record(sub, "LGPS:LTUS:6:BCTRLSUB") { field(DESC, "Feedback") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "LGPS:LTUS:6:POLYCOEF") field(INPC, "LGPS:LTUS:6:POLYCOEF.A") field(INPD, "LGPS:LTUS:6:POLYCOEF.B") field(INPE, "LGPS:LTUS:6:BDES.DRVH") field(INPF, "LGPS:LTUS:6:BDES.DRVL") field(PREC, "3") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(MDEL, "-1") field(BRSV, "INVALID") field(FLNK, "LGPS:LTUS:6:ISETPT") } record(ao, "LGPS:LTUS:6:BDESPREVTRIM") { field(DESC, "trim bdes for undo") field(DTYP, "Soft Channel") field(DRVH, "50.0") field(DRVL, "0.0") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(PINI, "YES") info(autosaveFields,"VAL") } record(stringin, "LGPS:LTUS:6:MADNAME") { field(DESC, "MAD deck nomenclature") field(PINI, "YES") field(VAL, "B912-1201") } record(ai, "LGPS:LTUS:6: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, "0.0") } record(ao, "LGPS:LTUS:6:BMAX") { field(DESC, "Max B-Field") field(DTYP, "Soft Channel") field(DRVH, "50.0") field(DRVL, "0.0") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(PINI, "YES") field(VAL, "50.0") field(FLNK, "LGPS:LTUS:6:BSTEP") } record(ao, "LGPS:LTUS:6:BMIN") { field(DESC, "Min B-Field") field(DTYP, "Soft Channel") field(DRVH, "50.0") field(DRVL, "0.0") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(PINI, "YES") field(VAL, "0.0") field(FLNK, "LGPS:LTUS:6:BSTEP") } record(ao, "LGPS:LTUS:6:BDESSAVE") { field(DESC, "bdes for save/load") field(DTYP, "Soft Channel") field(DRVH, "50.0") field(DRVL, "0.0") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PINI, "YES") field(PREC, "3") } # This record is processed by LGPS:LTUS:6: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, "LGPS:LTUS:6:BCON") { field(DESC, "Config B-Field ") field(DTYP, "Soft Channel") field(PREC, "3") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(DRVH, "50.0") field(DRVL, "0.0") # 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 , "") field(OMSL, "closed_loop") field(OUT, "LGPS:LTUS:6:B2ICON PP") info(autosaveFields,"VAL") } record(sub, "LGPS:LTUS:6:B2ICON") { field(DESC, "Convert Desired ICon to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "LGPS:LTUS:6:POLYCOEF") field(INPC, "LGPS:LTUS:6:POLYCOEF.A") field(INPD, "LGPS:LTUS:6:POLYCOEF.B") field(PREC, "3") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(MDEL, "-1") field(INPE, "LGPS:LTUS:6:BCON.DRVH") field(INPF, "LGPS:LTUS:6:BCON.DRVL") field(BRSV, "INVALID") field(FLNK, "LGPS:LTUS:6: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, "LGPS:LTUS:6:BSTEP") { field(DESC, "B-Field step size") field(CALC, "(C==3)||(D==3)?0:ABS(A-B)*0.005") field(INPA, "LGPS:LTUS:6:BMAX") field(INPB, "LGPS:LTUS:6:BMIN") field(INPC, "LGPS:LTUS:6:BMIN.SEVR") field(INPD, "LGPS:LTUS:6:BMAX.SEVR") field(EGU, "Volts") 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,"LGPS:LTUS:6:BCTRLDISABLECALC") { field(DESC, "Calc for disabling BCTRL") field(ASG, "Internal") field(CALC, "A?2:1") field(INPA, "LGPS:LTUS:6:ONLINE CP") field(OUT, "LGPS:LTUS:6:BCTRLDISABLEFOUT PP") } record(fanout, "LGPS:LTUS:6:BCTRLDISABLEFOUT") { field(DESC, "Disable BCTRL fanout") field(SELM, "Specified") field(SELL, "LGPS:LTUS:6:BCTRLDISABLECALC") field(LNK1, "LGPS:LTUS:6:BCTRLDISABLE") field(LNK2, "LGPS:LTUS:6:BCTRLENABLE") } record(stringout, "LGPS:LTUS:6:BCTRLDISABLE") { field(DESC, "Disable BCTRL") field(DTYP, "Soft Channel") field(OUT, "LGPS:LTUS:6:BCTRL.ASG") field(VAL, "NOWRITE") field(FLNK, "LGPS:LTUS:6:BCTRLDISV_UPDATE") } record(stringout, "LGPS:LTUS:6:BCTRLENABLE") { field(DESC, "Enable BCTRL") field(DTYP, "Soft Channel") field(OUT, "LGPS:LTUS:6:BCTRL.ASG") field(VAL, "") field(FLNK, "LGPS:LTUS:6:BCTRLDISV_UPDATE") } record(calcout, "LGPS:LTUS:6:BCTRLDISV_UPDATE") { field(DESC, "Calc for updating BCTRL.DISV") field(ASG, "Internal") field(CALC, "A") field(INPA, "LGPS:LTUS:6:ONLINE") field(OUT, "LGPS:LTUS:6: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,"LGPS:LTUS:6:BACT and MON\n are processed via links from \n LGPS:LTUS:6:IACT (device raw value readback 1)\n and\n LGPS:LTUS:6: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 LGPS:LTUS:6:POLYCOEF\nC = First polynomial coefficient (offset if linear)\nD = Second polynomial coefficient (slope if linear)\nE = LGPS:LTUS:6: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,"LGPS:LTUS:6:BDES\n is processed when set by CA users or \n LGPS:LTUS:6: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,"LGPS:LTUS:6: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 LGPS:LTUS:6: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 (LGPS:LTUS:6: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,"LGPS:LTUS:6:B*LIMITS and LGPS:LTUS:6:BLIMITS:\n Calculate alarm and warning limits based on \n deltas from LGPS:LTUS:6: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,"LGPS:LTUS:6: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,"LGPS:LTUS:6: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, "LGPS:LTUS:6: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, "LGPS:LTUS:6:MPSBTOL") { field(DESC, "Absolute mps tol") field(EGU, "Volts") field(PREC, "2") field(CALC, "ABS(A)*0.02") field(INPA, "LGPS:LTUS:6:BMAX") field(PINI, "YES") } # # 21-Aug-2013: K. Luchini # Set channel access security so that users # cannot easily change values. record(ao, "LGPS:LTUS:6:MPSBMAX") { field(DESC, "MPS Max B-field") field(EGU, "Volts") field(PREC, "7") field(DRVH, "50.0") field(DRVL, "0.0") field(PINI, "YES") field(VAL, "50.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "LGPS:LTUS:6:MPSBMIN") { field(DESC, "MPS Min B-field") field(EGU, "Volts") field(PREC, "7") field(DRVH, "50.0") field(DRVL, "0.0") field(PINI, "YES") field(VAL, "0.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "LGPS:LTUS:6:MPSBLLIM") { field(DESC, "MPS Low Limit B-field") field(EGU, "Volts") field(PREC, "7") field(DRVH, "50.0") field(DRVL, "0.0") field(PINI, "YES") field(VAL, "0.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "LGPS:LTUS:6:MPSBLLIM2") { field(DESC, "MPS Low Limit #2 B-field") field(EGU, "Volts") field(PREC, "7") field(DRVH, "50.0") field(DRVL, "0.0") field(PINI, "YES") field(VAL, "0.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } # Set the default to Std record(mbbo, "LGPS:LTUS:6: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, "LGPS:LTUS:6:MPSLIMITS.E PP") } record(aSub, "LGPS:LTUS:6: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, "LGPS:LTUS:6:MPS.RVAL") field(INPB, "LGPS:LTUS:6:BADIFF") field(INPC, "LGPS:LTUS:6:BDELTAS.N") field(INPD, "LGPS:LTUS:6:BACT") field(INPE, "LGPS:LTUS:6:MPSBITMASK.RVAL") field(INPF, "LGPS:LTUS:6:MPSBLLIM") field(INPG, "LGPS:LTUS:6:MPSBMIN") field(INPH, "LGPS:LTUS:6:MPSBMAX") field(INPI, "LGPS:LTUS:6: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, "LGPS:LTUS:6:INTOL.RVAL PP") field(OUTB, "LGPS:LTUS:6:INTOL_BMIN.RVAL PP") field(OUTC, "LGPS:LTUS:6:INTOL_BRANGE.RVAL PP") field(OUTD, "LGPS:LTUS:6: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, "LGPS:LTUS:6:INTOL") { field(DESC, "BACT within MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "LGPS:LTUS:6:MPSLIMITS.VALA") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "LGPS:LTUS:6:INTOL_BMIN") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "LGPS:LTUS:6:MPSLIMITS.VALB") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "LGPS:LTUS:6:INTOL_BMIN2") { field(DESC, "MPS tol #2") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "LGPS:LTUS:6:MPSLIMITS.VALD") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "LGPS:LTUS:6:INTOL_BRANGE") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "LGPS:LTUS:6: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, "LGPS:LTUS:6:CHCKITOL") { field(DESC, "Absolute Check I Tolerance") field(EGU, "A") field(FLNK, "LGPS:LTUS:6:TRIMITOL") field(CALC, "ABS(A*B)") field(INPA, "LGPS:LTUS:6:CHCKBTOL") field(INPB, "LGPS:LTUS:6:POLYCOEF.B") field(PREC, "9") } record(calc, "LGPS:LTUS:6:TRIMBTOL") { field(EGU, "Volts") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(DESC, "Absolute Trim Tolerance") field(CALC, "ABS(A)/2") field(INPA, "LGPS:LTUS:6:CHCKBTOL") field(FLNK, "LGPS:LTUS:6:CHCKITOL") } record(calc, "LGPS:LTUS:6:CHCKBTOL") { field(DESC, "Check absolute tolerance") field(EGU, "A") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(FLNK, "LGPS:LTUS:6:TRIMBTOL") field(CALC, "MAX(ABS(A),ABS(C))*(B/1000000)") field(INPA, "LGPS:LTUS:6:BDES.HOPR") field(INPB, "LGPS:LTUS:6:STABILITY") field(INPC, "LGPS:LTUS:6:BDES.LOPR") } record(longout, "LGPS:LTUS:6:STABILITY") { field(DESC, "Long Term Stability") field(PINI, "YES") field(VAL, "15000") field(EGU, "ppm") field(DRVH, "20000") field(DRVL, "100") field(HOPR, "20000") field(LOPR, "100") field(FLNK, "LGPS:LTUS:6:CHCKBTOL") } record(calc, "LGPS:LTUS:6:TRIMITOL") { field(DESC, "Absolute Trim I Tolerance") field(EGU, "Volts") field(CALC, "ABS(A*B)") field(INPA, "LGPS:LTUS:6:POLYCOEF.B") field(INPB, "LGPS:LTUS:6:TRIMBTOL") field(PREC, "9") } record(ai, "LGPS:LTUS:6:TRIMBTOLR") { field(DESC, "Relative trim tol") field(PREC, "4") field(EGU, "%") field(HOPR, "1.0") field(LOPR, "0.0") field(PINI, "YES") } record(ai, "LGPS:LTUS:6: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, "LGPS:LTUS:6:FBCKFCOM") { field(ZNAM, "CA") field(ONAM, "FCOM") field(DESC, "CA Mode") field(PINI, "YES") field(SDIS, "0") } record(bo, "LGPS:LTUS:6:PAU") { field(ZNAM, "NotConfigured") field(ONAM, "Configured") field(DESC, "PAU Present") field(PINI, "YES") field(SDIS, "0") field(FLNK, "LGPS:LTUS:6:PAUGO") } record(fanout, "LGPS:LTUS:6:PAUGO") { field(DESC, "PAU control") field(LNK1, "LGPS:LTUS:6:PAUSTOP") field(LNK2, "LGPS:LTUS:6: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, "LGPS:LTUS:6:PAUSTART") { field(DESC, "Setup for PAU On") field(SDIS, "LGPS:LTUS:6: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, "LGPS:LTUS:6:PAUSTOP") { field(DESC, "Setup for PAU Off") field(SDIS, "LGPS:LTUS:6: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, "LGPS:LTUS:6:MCORDEVNAME") { field(DESC, "PS device name") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, "PS:LTUS:6:") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "LGPS:LTUS:6: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, "LGPS:LTUS:6:PSTYPE.RVAL") field(INPC, "LGPS:LTUS:6:TURNEDOFF.RVAL") field(INPD, "LGPS:LTUS:6:CONFIG.RVAL") field(INPE, "LGPS:LTUS:6:PSCATEGORY.RVAL") field(INPF, "LGPS:LTUS:6:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "LGPS:LTUS:6:AUTOCTRL.RVAL") field(INPJ, "LGPS:LTUS:6:OUTOFSERVICE.RVAL") field(INPL, "LGPS:LTUS:6:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "LGPS:LTUS:6:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "LGPS:LTUS:6:PAU") field(INPP, "LGPS:LTUS:6:CALBDISABLE.RVAL") field(INPQ, "LGPS:LTUS:6:PTRBDISABLE.RVAL") field(INPR, "LGPS:LTUS:6:TRIMDISABLE.RVAL") field(INPS, "LGPS:LTUS:6:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "LGPS:LTUS:6:FBCK") field(INPU, "LGPS:LTUS:6:TRIMTYPE.RVAL") field(INPV, "LGPS:LTUS:6:STDZDIRECT.RVAL") field(INPW, "LGPS:LTUS:6:DEGAUSENABLE.RVAL") field(FLNK, "LGPS:LTUS:6:HSTA") } record(longin, "LGPS:LTUS:6:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "LGPS:LTUS:6:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "LGPS:LTUS:6: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, "LGPS:LTUS:6: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, "LGPS:LTUS:6: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, "LGPS:LTUS:6: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, "LGPS:LTUS:6: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, "LGPS:LTUS:6: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 LGPS:LTUS:6:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses LGPS:LTUS:6:FBCK. # This PV should be replaced by LGPS:LTUS:6: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, "LGPS:LTUS:6: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, "LGPS:LTUS:6: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, "LGPS:LTUS:6: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, "") field(OMSL, "supervisory") field(FLNK, "LGPS:LTUS:6:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"LGPS:LTUS:6:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "LGPS:LTUS:6:OUTOFSERVICE NPP NMS") field(OUT, "LGPS:LTUS:6:ONLINE PP") } record(bo, "LGPS:LTUS:6:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "LGPS:LTUS:6: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, "1") } record(bo, "LGPS:LTUS:6: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, "1") } record(bo, "LGPS:LTUS:6: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, "1") } # This PV is modified by :STATSUB.U record(bo, "LGPS:LTUS:6: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, "LGPS:LTUS:6: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, "LGPS:LTUS:6: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, "LGPS:LTUS:6: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, "LGPS:LTUS:6: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, "1") field(ASG, "NOWRITE") } record(mbbo, "LGPS:LTUS:6: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, "2") field(ASG, "NOWRITE") } record(mbbo, "LGPS:LTUS:6: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, "3") field(ASG, "NOWRITE") } record(mbbo, "LGPS:LTUS:6: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, "0") field(ASG, "NOWRITE") field(FLNK, "LGPS:LTUS:6:TRIMTYPE") } record(stringout, "LGPS:LTUS:6:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "LGPS:LTUS:6:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "LGPS:LTUS:6:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "LGPS:LTUS:6:STATE.RVAL") field(INPB, "LGPS:LTUS:6:INTLKSUMY.RVAL") field(OUT, "LGPS:LTUS:6:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "LGPS:LTUS:6: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, "LGPS:LTUS:6:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "LGPS:LTUS:6:STATE.RVAL") field(INPB, "LGPS:LTUS:6:INTLKSUMY.RVAL") field(OUT, "LGPS:LTUS:6:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "LGPS:LTUS:6:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "LGPS:LTUS:6:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "LGPS:LTUS:6: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, "LGPS:LTUS:6: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, "LGPS:LTUS:6: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, "LGPS:LTUS:6: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,"LGPS:LTUS:6: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("LGPS:LTUS:6:TURNEDOFF",3140,1907,0,1,"LGPS:LTUS:6:TURNEDOFF") #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "LGPS:LTUS:6:STATSUB") { field(DESC, "Build STATus ") field(INAM, "mgntInit") field(SNAM, "mgntSlcStat") field(INPA, "LGPS:LTUS:6:BACT.STAT") field(INPB, "LGPS:LTUS:6:BDES.STAT") field(INPC, "LGPS:LTUS:6:IRIPL.STAT") field(INPD, "PS:LTUS:6:ISETPT.STAT") field(INPE, "PS:LTUS:6:IACT.STAT") # 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, "LGPS:LTUS:6:BACT.SEVR") field(INPH, "LGPS:LTUS:6:BDES.SEVR") field(INPI, "LGPS:LTUS:6:IRIPL.SEVR") field(INPJ, "PS:LTUS:6:ISETPT.SEVR") field(INPK, "PS:LTUS:6:IACT.SEVR") # # 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, "LGPS:LTUS:6:STATE.RVAL") field(INPN, "LGPS:LTUS:6:STDZOK") field(INPO, "LGPS:LTUS:6:CALBOK") field(INPP, "LGPS:LTUS:6:OUTOFSERVICE.RVAL") field(INPQ, "LGPS:LTUS:6:CONFIG.RVAL") field(INPR, "LGPS:LTUS:6:HSTA") field(INPS, "LGPS:LTUS:6:CTRL.RVAL") field(INPT, "LGPS:LTUS:6:DEGAUSOK") field(INPV, "LGPS:LTUS:6: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, "LGPS:LTUS:6:STAT") } record(longout, "LGPS:LTUS:6:STAT") { field(DESC, "STAT sent to SLC") field(SCAN, "Passive") field(FLNK, "LGPS:LTUS:6:STATCTRLSUB") field(DOL, "LGPS:LTUS:6:STATSUB.VAL") field(OMSL, "closed_loop") } record(sSub, "LGPS:LTUS:6:STATCTRLSUB") { field(DESC, "Decode SLC STAT into mbbo") field(INAM, "mgntInit") field(SNAM, "mgntStatDecode") field(INPA, "LGPS:LTUS:6:STAT") field(INPB, "LGPS:LTUS:6:HSTA") field(INPD, "LGPS:LTUS:6:ONOFFCTRL.RVAL") field(FLNK, "LGPS:LTUS:6:STATMSG") } record(mbbo, "LGPS:LTUS:6: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, "LGPS:LTUS:6:UNAVAILGO") field(DOL, "LGPS:LTUS:6:STATCTRLSUB.W") } record(seq, "LGPS:LTUS:6:UNAVAILGO") { field(DESC, "Process UNAVAIL") field(DOL1, "LGPS:LTUS:6:STATSUB.U") field(LNK1, "LGPS:LTUS:6:UNAVAIL PP") } record(stringout, "LGPS:LTUS:6:SNLSTATMSG") { field(DTYP, "Soft Channel") } #! TextBox(TB0,820,1000,1200,1220,0,"Dialog",12,1,16777215,"LGPS:LTUS:6:STATUSSUB - future\nOverall device status - takes input from action snls, record sevrs, master snl(s) and outputs final status\n\nInputs:\nA - LGPS:LTUS:6:CTRLSTATUS - snl status\nB - MGNT:CTRLSTATUS - master list status\nC\nD - LGPS:LTUS:6: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,"LGPS:LTUS:6STATSUB\nformat control bo's into slc STAT\n\nInputs:\nA - LGPS:LTUS:6:STATUS\nC - LGPS:LTUS:6:ON\nD - LGPS:LTUS:6:STDZOK\nE - LGPS:LTUS:6:CALBOK\nF - LGPS:LTUS:6:BACTDRIFT (future)\nG -\nH- LGPS:LTUS:6:DACSTATUS\nI -LGPS:LTUS:6:ADCSTATUS\nJ - LGPS:LTUS:6:BACTSTATUS\nK - LGPS:LTUS:6:BDESSTATUS\nL - LGPS:LTUS:6:RIPLSTATUS\n\nOutput:\nP - LGPS:LTUS:6: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, "LGPS:LTUS:6: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, "LGPS:LTUS:6: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, "LGPS:LTUS:6: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, "LGPS:LTUS:6: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.6 #! DBDSTART #! DBD("../../../../dbd/mgntSoft.dbd") #! DBDEND record(stringout, "LGPS:LTUS:6:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "LGPS:LTUS:6:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "LGPS:LTUS:6:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "LGPS:LTUS:6:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "LGPS:LTUS:6:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "LGPS:LTUS:6:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "1") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "LGPS:LTUS:6: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, "LGPS:LTUS:6:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "LGPS:LTUS:6:TRIMTYPE.RVAL") field(INPB, "LGPS:LTUS:6:CONFIG.RVAL") field(OUT, "LGPS:LTUS:6:TRIMMAXNUM PP") } record(longout, "LGPS:LTUS:6: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, "LGPS:LTUS:6:TRIMRAMPRATE") { field(DESC, "Trim Ramp rate ") field(PINI, "YES") field(ASG, "IOC_MAINT") field(PREC, "3") field(EGU, "Volts/sec") field(HOPR, "20.0") field(DRVH, "20.0") field(DRVL, "0.1") field(LOPR, "0.5") # field(DOL, "") field(OMSL, "supervisory") field(VAL, "10") field(OUT, "LGPS:LTUS:6:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "LGPS:LTUS:6: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, "") field(OMSL, "supervisory") field(VAL, "10") } record(bo, "LGPS:LTUS:6: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, "LGPS:LTUS:6: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, "LGPS:LTUS:6:TRIMSTEPMIN") { field(DESC, "Min step in current") field(DTYP, "Soft Channel") # field(DOL, "") field(PREC, "7") field(EGUF, "10") field(EGUL, "0") field(EGU, "Volts") field(HOPR, "10") field(LOPR, "0") field(VAL, "5.0") } record(bo, "LGPS:LTUS:6:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "0") } record(ao, "LGPS:LTUS:6: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, "LGPS:LTUS:6:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "LGPS:LTUS:6: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, "LGPS:LTUS:6: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, "LGPS:LTUS:6:IMOVE") field(INPB, "LGPS:LTUS:6:IACT") field(INPC, "LGPS:LTUS:6:IRAMPRATE") field(INPD, "1.0") field(INPE, "LGPS:LTUS:6:TRIMDLYPCT") field(INPF, "LGPS:LTUS:6:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "LGPS:LTUS:6:RAMPTIME_LEFT PP") } record(longout, "LGPS:LTUS:6:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "LGPS:LTUS:6:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "LGPS:LTUS:6:RAMPDONE_CALC") } record(calc, "LGPS:LTUS:6:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "LGPS:LTUS:6:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "LGPS:LTUS:6:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "LGPS:LTUS:6: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, "LGPS:LTUS:6:RAMPTIME_LEFT") field(OUT, "LGPS:LTUS:6:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "LGPS:LTUS:6:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "LGPS:LTUS:6:RAMPTIME_LEFT NMS") field(OUT, "LGPS:LTUS:6:RAMPDONE PP") } record(bo, "LGPS:LTUS:6:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "LGPS:LTUS:6:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "LGPS:LTUS:6: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, "LGPS:LTUS:6: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(ai, "LGPS:LTUS:6: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, "LGPS:LTUS:6:MPSBTOL") { field(DESC, "Absolute mps tol") field(EGU, "Volts") field(PREC, "2") field(CALC, "ABS(A)*0.02") field(INPA, "LGPS:LTUS:6:BMAX") field(PINI, "YES") } # # 21-Aug-2013: K. Luchini # Set channel access security so that users # cannot easily change values. record(ao, "LGPS:LTUS:6:MPSBMAX") { field(DESC, "MPS Max B-field") field(EGU, "Volts") field(PREC, "7") field(DRVH, "50.0") field(DRVL, "0.0") field(PINI, "YES") field(VAL, "50.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "LGPS:LTUS:6:MPSBMIN") { field(DESC, "MPS Min B-field") field(EGU, "Volts") field(PREC, "7") field(DRVH, "50.0") field(DRVL, "0.0") field(PINI, "YES") field(VAL, "0.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "LGPS:LTUS:6:MPSBLLIM") { field(DESC, "MPS Low Limit B-field") field(EGU, "Volts") field(PREC, "7") field(DRVH, "50.0") field(DRVL, "0.0") field(PINI, "YES") field(VAL, "0.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "LGPS:LTUS:6:MPSBLLIM2") { field(DESC, "MPS Low Limit #2 B-field") field(EGU, "Volts") field(PREC, "7") field(DRVH, "50.0") field(DRVL, "0.0") field(PINI, "YES") field(VAL, "0.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } # Set the default to Std record(mbbo, "LGPS:LTUS:6: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, "LGPS:LTUS:6:MPSLIMITS.E PP") } record(aSub, "LGPS:LTUS:6: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, "LGPS:LTUS:6:MPS.RVAL") field(INPB, "LGPS:LTUS:6:BADIFF") field(INPC, "LGPS:LTUS:6:BDELTAS.N") field(INPD, "LGPS:LTUS:6:BACT") field(INPE, "LGPS:LTUS:6:MPSBITMASK.RVAL") field(INPF, "LGPS:LTUS:6:MPSBLLIM") field(INPG, "LGPS:LTUS:6:MPSBMIN") field(INPH, "LGPS:LTUS:6:MPSBMAX") field(INPI, "LGPS:LTUS:6: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, "LGPS:LTUS:6:INTOL.RVAL PP") field(OUTB, "LGPS:LTUS:6:INTOL_BMIN.RVAL PP") field(OUTC, "LGPS:LTUS:6:INTOL_BRANGE.RVAL PP") field(OUTD, "LGPS:LTUS:6: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, "LGPS:LTUS:6:INTOL") { field(DESC, "BACT within MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "LGPS:LTUS:6:MPSLIMITS.VALA") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "LGPS:LTUS:6:INTOL_BMIN") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "LGPS:LTUS:6:MPSLIMITS.VALB") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "LGPS:LTUS:6:INTOL_BMIN2") { field(DESC, "MPS tol #2") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "LGPS:LTUS:6:MPSLIMITS.VALD") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "LGPS:LTUS:6:INTOL_BRANGE") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "LGPS:LTUS:6: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, "LGPS:LTUS:6:CHCKITOL") { field(DESC, "Absolute Check I Tolerance") field(EGU, "A") field(FLNK, "LGPS:LTUS:6:TRIMITOL") field(CALC, "ABS(A*B)") field(INPA, "LGPS:LTUS:6:CHCKBTOL") field(INPB, "LGPS:LTUS:6:POLYCOEF.B") field(PREC, "9") } record(calc, "LGPS:LTUS:6:TRIMBTOL") { field(EGU, "Volts") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(DESC, "Absolute Trim Tolerance") field(CALC, "ABS(A)/2") field(INPA, "LGPS:LTUS:6:CHCKBTOL") field(FLNK, "LGPS:LTUS:6:CHCKITOL") } record(calc, "LGPS:LTUS:6:CHCKBTOL") { field(DESC, "Check absolute tolerance") field(EGU, "A") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(FLNK, "LGPS:LTUS:6:TRIMBTOL") field(CALC, "MAX(ABS(A),ABS(C))*(B/1000000)") field(INPA, "LGPS:LTUS:6:BDES.HOPR") field(INPB, "LGPS:LTUS:6:STABILITY") field(INPC, "LGPS:LTUS:6:BDES.LOPR") } record(longout, "LGPS:LTUS:6:STABILITY") { field(DESC, "Long Term Stability") field(PINI, "YES") field(VAL, "1000") field(EGU, "ppm") field(DRVH, "20000") field(DRVL, "100") field(HOPR, "20000") field(LOPR, "100") field(FLNK, "LGPS:LTUS:6:CHCKBTOL") } record(calc, "LGPS:LTUS:6:TRIMITOL") { field(DESC, "Absolute Trim I Tolerance") field(EGU, "Volts") field(CALC, "ABS(A*B)") field(INPA, "LGPS:LTUS:6:POLYCOEF.B") field(INPB, "LGPS:LTUS:6:TRIMBTOL") field(PREC, "9") } record(ai, "LGPS:LTUS:6:TRIMBTOLR") { field(DESC, "Relative trim tol") field(PREC, "4") field(EGU, "%") field(HOPR, "1.0") field(LOPR, "0.0") field(PINI, "YES") } record(ai, "LGPS:LTUS:6: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.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "LGPS:LTUS:6: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, "LGPS:LTUS:6:PSTYPE.RVAL") field(INPC, "LGPS:LTUS:6:TURNEDOFF.RVAL") field(INPD, "LGPS:LTUS:6:CONFIG.RVAL") field(INPE, "LGPS:LTUS:6:PSCATEGORY.RVAL") field(INPF, "LGPS:LTUS:6:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "LGPS:LTUS:6:AUTOCTRL.RVAL") field(INPJ, "LGPS:LTUS:6:OUTOFSERVICE.RVAL") field(INPL, "LGPS:LTUS:6:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "LGPS:LTUS:6:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "LGPS:LTUS:6:PAU") field(INPP, "LGPS:LTUS:6:CALBDISABLE.RVAL") field(INPQ, "LGPS:LTUS:6:PTRBDISABLE.RVAL") field(INPR, "LGPS:LTUS:6:TRIMDISABLE.RVAL") field(INPS, "LGPS:LTUS:6:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "LGPS:LTUS:6:FBCK") field(INPU, "LGPS:LTUS:6:TRIMTYPE.RVAL") field(INPV, "LGPS:LTUS:6:STDZDIRECT.RVAL") field(INPW, "LGPS:LTUS:6:DEGAUSENABLE.RVAL") field(FLNK, "LGPS:LTUS:6:HSTA") } record(longin, "LGPS:LTUS:6:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "LGPS:LTUS:6:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "LGPS:LTUS:6: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, "LGPS:LTUS:6: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, "LGPS:LTUS:6: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, "LGPS:LTUS:6: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, "LGPS:LTUS:6: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, "LGPS:LTUS:6: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 LGPS:LTUS:6:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses LGPS:LTUS:6:FBCK. # This PV should be replaced by LGPS:LTUS:6: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, "LGPS:LTUS:6: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, "LGPS:LTUS:6: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, "LGPS:LTUS:6: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, "") field(OMSL, "supervisory") field(FLNK, "LGPS:LTUS:6:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"LGPS:LTUS:6:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "LGPS:LTUS:6:OUTOFSERVICE NPP NMS") field(OUT, "LGPS:LTUS:6:ONLINE PP") } record(bo, "LGPS:LTUS:6:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "PS:LTUS:6:CommLink PP") } record(bo, "LGPS:LTUS:6: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, "1") } record(bo, "LGPS:LTUS:6: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, "1") } record(bo, "LGPS:LTUS:6: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, "1") } # This PV is modified by :STATSUB.U record(bo, "LGPS:LTUS:6: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, "LGPS:LTUS:6: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, "LGPS:LTUS:6: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, "LGPS:LTUS:6: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, "LGPS:LTUS:6: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, "1") field(ASG, "NOWRITE") } record(mbbo, "LGPS:LTUS:6: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, "2") field(ASG, "NOWRITE") } record(mbbo, "LGPS:LTUS:6: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, "5") field(ASG, "NOWRITE") } record(mbbo, "LGPS:LTUS:6: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, "0") field(ASG, "NOWRITE") field(FLNK, "LGPS:LTUS:6:TRIMTYPE") } record(stringout, "LGPS:LTUS:6:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "LGPS:LTUS:6:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "LGPS:LTUS:6:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "LGPS:LTUS:6:STATE.RVAL") field(INPB, "LGPS:LTUS:6:INTLKSUMY.RVAL") field(OUT, "LGPS:LTUS:6:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "LGPS:LTUS:6: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, "LGPS:LTUS:6:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "LGPS:LTUS:6:STATE.RVAL") field(INPB, "LGPS:LTUS:6:INTLKSUMY.RVAL") field(OUT, "LGPS:LTUS:6:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "LGPS:LTUS:6:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "LGPS:LTUS:6:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "LGPS:LTUS:6: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, "LGPS:LTUS:6: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, "LGPS:LTUS:6: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, "LGPS:LTUS:6: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,"LGPS:LTUS:6: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("LGPS:LTUS:6:TURNEDOFF",3140,1907,0,1,"LGPS:LTUS:6:TURNEDOFF") #! 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, "LGPS:LTUS:7:IACT") { field(DESC, "Current") field(INP, "PS:LTUS:7:IACT") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "LGPS:LTUS:7:BACT") info(autosaveFields,"HYST") } record(bi, "LGPS:LTUS:7:STATE") { field(DESC, "PS On/Off Status") field(DTYP, "Raw Soft Channel") field(INP, "PS:LTUS:7:STATE CP MS") field(ZSV, "MAJOR") field(ZNAM, "OFF") field(ONAM, "ON") } record(ao, "LGPS:LTUS:7:IDES") { field(DESC, "Desired Current") field(PREC, "3") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(MDEL, "-1") field(HIHI, "50.0") field(LOLO, "0.0") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "LGPS:LTUS:7:BDELTAS") field(DRVH, "50.0") field(DRVL, "0.0") field(DOL, "LGPS:LTUS:7: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, "LGPS:LTUS:7:ICTRL PP") } # This record is processed by LGPS:LTUS:7:ICON") # Note: we are not setting alarms here. record(ao, "LGPS:LTUS:7:ICON") { field(DESC, "Config I") field(DTYP, "Soft Channel") field(PREC, "3") field(HOPR, "50.0") field(LOPR, "0.0") field(DRVH, "50.0") field(DRVL, "0.0") field(DOL, "LGPS:LTUS:7:B2ICON.K") field(OMSL, "closed_loop") info(autosaveFields,"VAL") } record(ao, "LGPS:LTUS:7:INOM") { field(DESC, "Nominal Current") field(DOL, "LGPS:LTUS:7:BNOM.K") field(OMSL, "closed_loop") field(PREC, "3") field(EGU, "Volts") field(DRVH, "50.0") field(DRVL, "0.0") field(HOPR, "50.0") field(LOPR, "0.0") } record(ao, "LGPS:LTUS:7:ICTRL") { field(DESC, "Set Current") field(PREC, "3") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(DRVH, "50.0") field(DRVL, "0.0") field(MDEL, "-1") field(FLNK, "LGPS:LTUS:7:ICTRLGO") field(OMSL, "supervisory") info(autosavefields,"VAL") } record(seq, "LGPS:LTUS:7:ICTRLGO") { field(DESC, "Process Current Setpoint") field(PREC, "3") # Set ISETPT to supervisory field(DOL1, "0") field(LNK1, "LGPS:LTUS:7:ISETPT.OMSL") field(DOL2, "LGPS:LTUS:7:ICTRL") field(LNK2, "LGPS:LTUS:7:ISETPT PP") # Set ISETPT to closed loop - get data from BCTRLSUB.K field(DOL3, "1") field(LNK3, "LGPS:LTUS:7:ISETPT.OMSL") } record(ao, "LGPS:LTUS:7:IMAX") { field(DESC, "Max I") field(DTYP, "Soft Channel") field(DRVH, "50.0") field(DRVL, "0.0") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(PINI, "YES") field(VAL, "50.0") field(FLNK, "LGPS:LTUS:7:IMIN") } record(ao, "LGPS:LTUS:7:IMIN") { field(DESC, "Min I") field(DTYP, "Soft Channel") field(DRVH, "50.0") field(DRVL, "0.0") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(VAL, "0.0") field(FLNK, "LGPS:LTUS:7:IRANGE") } record(sel, "LGPS:LTUS:7:IACTPREVOK") { field(DESC, "Last Good Current") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(NVL, "LGPS:LTUS:7:BACT.SEVR") field(INPA, "LGPS:LTUS:7:IACT NPP MS") field(INPB, "LGPS:LTUS:7:IACTPREVOK NPP MS") field(INPC, "LGPS:LTUS:7:IACTPREVOK NPP MS") field(INPD, "LGPS:LTUS:7:IACTPREVOK NPP MS") } record(sub, "LGPS:LTUS:7:IACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "LGPS:LTUS:7:IDES") field(INPB, "LGPS:LTUS:7:ISETPT.DRVH") field(INPC, "LGPS:LTUS:7:ISETPT.DRVL") field(INPD, "LGPS:LTUS:7:IDELTAS.I") field(INPE, "LGPS:LTUS:7:IDELTAS.J") field(INPG, "LGPS:LTUS:7:STATE") field(INPH, "LGPS:LTUS:7:HSTA") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(sub, "LGPS:LTUS:7:IMONLIMITS") { field(DESC, "Aux Current Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "LGPS:LTUS:7:IDES") field(INPB, "LGPS:LTUS:7:ISETPT.DRVH") field(INPC, "LGPS:LTUS:7:ISETPT.DRVL") field(INPD, "LGPS:LTUS:7:IDELTAS.K") field(INPE, "LGPS:LTUS:7:IDELTAS.L") field(INPG, "LGPS:LTUS:7:STATE") field(INPH, "LGPS:LTUS:7:HSTA") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(seq, "LGPS:LTUS:7:ILIMITS") { field(DESC, "Set ACT and MON Limits") field(PREC, "3") field(DOL1, "LGPS:LTUS:7:BLIMITS") field(LNK1, "LGPS:LTUS:7:IACTLIMITS.F PP") field(DOL2, "LGPS:LTUS:7:IACTLIMITS.I") field(LNK2, "LGPS:LTUS:7:IACT.HIGH") field(DOL3, "LGPS:LTUS:7:IACTLIMITS.J") field(LNK3, "LGPS:LTUS:7:IACT.LOW") field(DOL4, "LGPS:LTUS:7:IACTLIMITS.K") field(LNK4, "LGPS:LTUS:7:IACT.HIHI") field(DOL5, "LGPS:LTUS:7:IACTLIMITS.L") field(LNK5, "LGPS:LTUS:7:IACT.LOLO") field(DOL6, "LGPS:LTUS:7:BLIMITS") field(LNK6, "LGPS:LTUS:7:IMONLIMITS.F PP") field(DOL7, "LGPS:LTUS:7:IMONLIMITS.I") field(LNK7, "LGPS:LTUS:7:IMON.HIGH") field(DOL8, "LGPS:LTUS:7:IMONLIMITS.J") field(LNK8, "LGPS:LTUS:7:IMON.LOW") field(DOL9, "LGPS:LTUS:7:IMONLIMITS.K") field(LNK9, "LGPS:LTUS:7:IMON.HIHI") field(DOLA, "LGPS:LTUS:7:IMONLIMITS.L") field(LNKA, "LGPS:LTUS:7: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, "LGPS:LTUS:7:IDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntRawDeltas") field(INPD, "LGPS:LTUS:7:TRIMBTOL") field(INPE, "LGPS:LTUS:7:CHCKBTOL") field(INPF, "LGPS:LTUS:7:BDELTAS.K") field(INPG, "LGPS:LTUS:7:BDELTAS.L") field(INPH, "LGPS:LTUS:7:B2IDES.L") field(EGU, "Volts") field(HOPR, "1") field(PREC, "3") field(BRSV, "INVALID") # # Used to calcualte standardize tolerance # which is returned in the VAL field. # field(INPB, "LGPS:LTUS:7:STDZITOLR") field(INPC, "LGPS:LTUS:7:STDZITOL") field(FLNK, "") } # All ps controllers with on/off control will set the macro ONOF # as follows: # # ONOF = PS:LTUS:7: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, "LGPS:LTUS:7:STATESETPT") { field(DESC, "PS On/Off") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFF") field(ONAM, "ON") field(OUT, "PS:LTUS:7:STATESETPT PP") 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:LTUS:7:RESET PP # record(bo, "LGPS:LTUS:7:RESET") { field(DESC, "Interlock Latch Reset") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFF") field(ONAM, "ON") field(HIGH, "1.0") field(OUT, "PS:LTUS:7:RESET PP") } record(bo, "LGPS:LTUS:7:RAMPSTATE") { field(DESC, "PS Ramp Status") field(DTYP, "Soft Channel") field(DOL, "PS:LTUS:7:RAMPSTATE") 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, "LGPS:LTUS:7: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, "Volts/sec") field(PREC, "3") # Set default to trim ramp rate on boot # but need to change for degauss function. field(DOL, "LGPS:LTUS:7:TRIMRAMPRATE") field(OUT, "") field(FLNK, "LGPS:LTUS:7:STDZDLY") } record(ao, "LGPS:LTUS:7:ISETPT") { field(DESC, "Current Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(DRVH, "50.0") field(DRVL, "0.0") field(MDEL, "-1") field(OUT, "PS:LTUS:7:ISETPT PP") field(DOL, "LGPS:LTUS:7: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, "LGPS:LTUS:7:IMON") { field(DESC, "Aux Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(INP, "") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "LGPS:LTUS:7:BMON") } record(ao, "LGPS:LTUS:7:IRIPL") { field(DESC, "Ripple Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(DOL, "") field(OMSL, "closed_loop") field(EGU, "Volts") field(DRVH, "1.0") field(HOPR, "1.0") field(PREC, "3") field(FLNK, "LGPS:LTUS:7:IRIPLOK") } record(sub, "LGPS:LTUS:7:IRIPLOK") { field(DESC, "Ripple Current Status") field(INAM, "mgntInit") field(SNAM, "mgntRiplOK") field(INPA, "LGPS:LTUS:7:IRIPL.VAL") field(INPB, "LGPS:LTUS:7: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, "LGPS:LTUS:7:R") { field(DESC, "Resistance") field(EGU, "Ohms") field(PREC, "4") field(PINI, "YES") field(DOL, "") 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, "LGPS:LTUS:7:IGND") { field(DESC, "Ground Current") field(EGU, "Volts") field(PREC, "6") field(PINI, "YES") field(DOL, "") field(OMSL, "closed_loop") } record(bi, "LGPS:LTUS:7:INTLKSUMY") { field(DESC, "Interlock Summary") field(INP, "PS:LTUS:7:INTLKSUMY CP MS") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(ZNAM, "OK") field(ONAM, "FAULT") field(PINI, "NO") } record(mbbo, "LGPS:LTUS:7: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:LTUS:7:COOLING") field(OMSL, "closed_loop") } # The following PV is processed by :BACTFO # which is processed by :BACT record(fanout, "LGPS:LTUS:7:IACTFO") { field(DESC, "IACT processing") field(SELM, "All") field(LNK1, "LGPS:LTUS:7:IACTPREVOK") field(LNK2, "LGPS:LTUS:7:IDIFF") field(LNK3, "LGPS:LTUS:7:IADIFF") field(LNK4, "LGPS:LTUS:7:IRATIO") field(LNK5, "LGPS:LTUS:7:IDIRECT") field(LNK6, "LGPS:LTUS:7:IACTPOL_CHECK") } record(calc, "LGPS:LTUS:7:IDIFF") { field(DESC, "IDES-IACT") field(CALC, "A-B") field(INPA, "LGPS:LTUS:7:IDES") field(INPB, "LGPS:LTUS:7:IACT") field(EGU, "Volts") field(PREC, "9") field(HOPR, "50.0") field(LOPR, "0.0") } record(calc, "LGPS:LTUS:7:IADIFF") { field(DESC, "Absolute IDES-IACT") field(CALC, "A<0?ABS(A):A") field(INPA, "LGPS:LTUS:7:IDIFF") field(PREC, "9") } record(calc, "LGPS:LTUS:7:IRATIO") { field(DESC, "IDES-IACT/IMAX") field(CALC, "B?A/B:0") field(INPA, "LGPS:LTUS:7:IDIFF") field(INPB, "LGPS:LTUS:7:IDES.DRVH") field(PREC, "9") } record(calcout, "LGPS:LTUS:7:IRANGE") { field(DESC, "Current Range") field(PINI, "YES") field(CALC, "ABS(A-B)") field(INPA, "LGPS:LTUS:7:IMIN") field(INPB, "LGPS:LTUS:7: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, "LGPS:LTUS:7: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, "LGPS:LTUS:7:IACT") field(FLNK, "LGPS:LTUS:7:IACTPOL") } record(bo, "LGPS:LTUS:7:IACTPOL") { field(DESC, "Actual I Polarity") field(DTYP, "Raw Soft Channel") field(DOL, "LGPS:LTUS:7: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,"LGPS:LTUS:7:I*LIMITS:\n Calculate alarm and warning limits based on \n deltas from LGPS:LTUS:7:IDELTAS and the\n LGPS:LTUS:7: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,"LGPS:LTUS:7:IACT: \n Get copy of LGPS:LTUS:7:I. \n",null) #! TextBox(TB12,1280,3100,1760,3200,0,"Dialog",12,1,16777215,"LGPS:LTUS:7: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,"LGPS:LTUS:7:IDES:\n Contains raw value calculated by \nLGPS:LTUS:7: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 \nLGPS:LTUS:7:BDELTAS.\n",null) #! TextBox(TB10,56,1940,316,2340,0,"Dialog",12,1,16777215,"LGPS:LTUS:7: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 LGPS:LTUS:7: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 LGPS:LTUS:7: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,"LGPS:LTUS:7:ISETPT:\n Sets the hardware. When fast feedback is set on, this record is\n set to closed loop mode by LGPS:LTUS:7:FBCKSTART sequence. When \n the loop is closed, this record takes input calculated by \n BFBCK only. When fast feedback is set off, LGPS:LTUS:7:FBCKSTOP \n will set it back to supervisory so that the value can be set by \n LGPS:LTUS:7: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, "LGPS:LTUS:7:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "LGPS:LTUS:7:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "LGPS:LTUS:7:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "LGPS:LTUS:7:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "LGPS:LTUS:7:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "LGPS:LTUS:7:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "1") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "LGPS:LTUS:7: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, "LGPS:LTUS:7:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "LGPS:LTUS:7:TRIMTYPE.RVAL") field(INPB, "LGPS:LTUS:7:CONFIG.RVAL") field(OUT, "LGPS:LTUS:7:TRIMMAXNUM PP") } record(longout, "LGPS:LTUS:7: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, "LGPS:LTUS:7:TRIMRAMPRATE") { field(DESC, "Trim Ramp rate ") field(PINI, "YES") field(ASG, "IOC_MAINT") field(PREC, "3") field(EGU, "Volts/sec") field(HOPR, "20.0") field(DRVH, "20.0") field(DRVL, "0.1") field(LOPR, "0.5") # field(DOL, "") field(OMSL, "supervisory") field(VAL, "10") field(OUT, "LGPS:LTUS:7:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "LGPS:LTUS:7: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, "") field(OMSL, "supervisory") field(VAL, "10") } record(bo, "LGPS:LTUS:7: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, "LGPS:LTUS:7: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, "LGPS:LTUS:7:TRIMSTEPMIN") { field(DESC, "Min step in current") field(DTYP, "Soft Channel") # field(DOL, "") field(PREC, "7") field(EGUF, "10") field(EGUL, "0") field(EGU, "Volts") field(HOPR, "10") field(LOPR, "0") field(VAL, "5.0") } record(bo, "LGPS:LTUS:7:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "0") } record(ao, "LGPS:LTUS:7: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, "LGPS:LTUS:7:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "LGPS:LTUS:7: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, "LGPS:LTUS:7: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, "LGPS:LTUS:7:IMOVE") field(INPB, "LGPS:LTUS:7:IACT") field(INPC, "LGPS:LTUS:7:IRAMPRATE") field(INPD, "1.577") field(INPE, "LGPS:LTUS:7:TRIMDLYPCT") field(INPF, "LGPS:LTUS:7:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "LGPS:LTUS:7:RAMPTIME_LEFT PP") } record(longout, "LGPS:LTUS:7:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "LGPS:LTUS:7:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "LGPS:LTUS:7:RAMPDONE_CALC") } record(calc, "LGPS:LTUS:7:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "LGPS:LTUS:7:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "LGPS:LTUS:7:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "LGPS:LTUS:7: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, "LGPS:LTUS:7:RAMPTIME_LEFT") field(OUT, "LGPS:LTUS:7:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "LGPS:LTUS:7:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "LGPS:LTUS:7:RAMPTIME_LEFT NMS") field(OUT, "LGPS:LTUS:7:RAMPDONE PP") } record(bo, "LGPS:LTUS:7:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "LGPS:LTUS:7:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "LGPS:LTUS:7: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, "LGPS:LTUS:7: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, "LGPS:LTUS:7:STDZINIT") { field(DESC, "Proc. Stdz PVs on boot") field(PINI, "YES") field(DOL1, "1") field(DOL2, "1") field(DOL3, "1") field(LNK1, "LGPS:LTUS:7:DEBUG.PROC PP") field(LNK2, "LGPS:LTUS:7:STDZCYCLENUM.PROC PP") field(LNK3, "LGPS:LTUS:7:STDZDISABLE.PROC PP") field(LNK4, "LGPS:LTUS:7: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, "LGPS:LTUS:7:STDZSUB") { field(DESC, "Stdz subroutine") field(INAM, "mgntStdzInit") field(SNAM, "mgntStdz") field(BRSV, "INVALID") field(INPA, "LGPS:LTUS:7:STDZIMIN NPP NMS") field(INPB, "LGPS:LTUS:7:STDZIMAX NPP NMS") field(INPC, "LGPS:LTUS:7:STDZIFINAL NPP NMS") field(INPD, "LGPS:LTUS:7:STDZCYCLENUM NPP NMS") field(INPE, "LGPS:LTUS:7:STDZDIRECT.RVAL NPP NMS") field(INPF, "LGPS:LTUS:7:STDZDISABLE.RVAL CPP NMS") field(INPG, "LGPS:LTUS:7: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, "LGPS:LTUS:7:STDZWF PP") field(OUTB, "LGPS:LTUS:7: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, "LGPS:LTUS:7:STDZWF") } record(mbbo, "LGPS:LTUS:7: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, "LGPS:LTUS:7: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, "LGPS:LTUS:7:STDZMAINPS") { field(DESC, "Stdz by main or self") field(PINI, "YES") field(DTYP, "Soft Channel") field(ZNAM, "SELF") field(ONAM, "MAIN") } record(bo, "LGPS:LTUS:7: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, "LGPS:LTUS:7: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, "LGPS:LTUS:7: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, "LGPS:LTUS:7:STDZTOD") { field(DESC, "Successful Standardize Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "LGPS:LTUS:7:STDZLOSTTOD") { field(DESC, "Standardize Lost Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(longout, "LGPS:LTUS:7:STDZCYCLECNT") { field(DESC, "Cycle Count") field(PINI, "YES") } record(longout, "LGPS:LTUS:7:STDZCYCLENUM") { field(DESC, "No. Standardize Cycles") field(VAL, "3") field(HOPR, "10") field(LOPR, "0") field(DRVH, "10") field(DRVL, "0") field(PINI, "YES") field(FLNK, "LGPS:LTUS:7:STDZDIRECT") } # The default standardize direction is "UP" for # all LCLS Magnets.. record(bo, "LGPS:LTUS:7:STDZDIRECT") { field(DESC, "Standardize Direction ") field(ZNAM, "UP") field(ONAM, "DOWN") field(VAL, "0") field(FLNK, "LGPS:LTUS:7:STDZIMIN") } record(ao, "LGPS:LTUS:7:STDZIMIN") { field(DESC, "Min-STDZ Current") field(PREC, "1") field(EGU, "A") field(HOPR, "50.0") field(LOPR, "0.0") field(VAL, "0.0") field(FLNK, "LGPS:LTUS:7:STDZIMAX") } record(ao, "LGPS:LTUS:7:STDZIMAX") { field(DESC, "Max. Standarize Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "50.0") field(LOPR, "0.0") field(VAL, "50.0") field(FLNK, "LGPS:LTUS:7:STDZIFINAL") } record(ao, "LGPS:LTUS:7:STDZIFINAL") { field(DESC, "Final SDTZ Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "50.0") field(LOPR, "0.0") field(VAL, "0.0") field(FLNK, "LGPS:LTUS:7: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, "LGPS:LTUS:7: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, "LGPS:LTUS:7:STDZITOL") { field(DESC, "Stdz min tolerance") field(PREC, "5") field(CALC, "MAX(ABS(A),ABS(B))*C") field(INPA, "LGPS:LTUS:7:STDZIMIN CP NMS") field(INPB, "LGPS:LTUS:7:STDZIMAX CP MMS") field(INPC, "0.05") field(INPD, "LGPS:LTUS:7:STDZITOLR CP MMS") field(EGU, "A") field(FLNK, "LGPS:LTUS:7:IDELTAS") field(PINI, "YES") } # D - factor (3.154/2 = 1.577) for EPSC, otherwise, set to 1.0 record(calc, "LGPS:LTUS:7:STDZDLY") { field(DESC, "Ramp time for stdz cycle") field(CALC, "C>0?MAX(1,ABS((A-B)/C)*D):0") field(INPA, "LGPS:LTUS:7:STDZIMIN CP NMS") field(INPB, "LGPS:LTUS:7:STDZIMAX CP NMS") field(INPC, "LGPS:LTUS:7:TRIMRAMPRATE CP NMS") field(INPD, "1.0") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") } record(calc, "LGPS:LTUS:7:STDZRAMPDLY") { field(DESC, "Ramp delay total") field(CALC, "MAX(1,((A/100)*B+B))") field(PREC, "5") field(INPA, "LGPS:LTUS:7:TRIMDLYPCT CP MS") field(INPB, "LGPS:LTUS:7: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, "LGPS:LTUS:7:STDZMINIDLY") { field(DESC, "Mini-stdz delay") field(CALC, "A") field(PREC, "5") field(A, "1.0") field(EGU, "sec") field(PINI, "YES") } record(ao, "LGPS:LTUS:7: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, "LGPS:LTUS:7:STDZMINIDELTA") { field(DESC, "Stdz mini % of IMAX") field(CALC, "(B/100)*(A-C)") field(INPA, "LGPS:LTUS:7:IDES.HOPR") field(INPB, "LGPS:LTUS:7:STDZMINIPCT CPP NMS") field(INPC, "LGPS:LTUS:7:IDES.LOPR") field(PREC, "5") } record(calc, "LGPS:LTUS:7:STDZMINISETPT") { field(DESC, "Mini Stdz delta") field(CALC, "C==0?MAX(E-D,B):MIN(E+D,A)") field(INPA, "LGPS:LTUS:7:IDES.HOPR") field(INPB, "LGPS:LTUS:7:IDES.LOPR") field(INPC, "LGPS:LTUS:7:STDZDIRECT.RVAL") field(INPD, "LGPS:LTUS:7:STDZMINIDELTA") field(INPE, "LGPS:LTUS:7:IDES") field(PREC, "5") field(FLNK, "LGPS:LTUS:7: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, "LGPS:LTUS:7:STDZMINISETPTOOR") { field(DESC, "Mini Stdz setpoint out of range") field(CALC, "C==0?(E-DA)") field(INPA, "LGPS:LTUS:7:IDES.HOPR") field(INPB, "LGPS:LTUS:7:IDES.LOPR") field(INPC, "LGPS:LTUS:7:STDZDIRECT.RVAL") field(INPD, "LGPS:LTUS:7:STDZMINIDELTA") field(INPE, "LGPS:LTUS:7: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, "LGPS:LTUS:7: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, "LGPS:LTUS:7:IADJUST.RVAL") field(INPB, "LGPS:LTUS:7:STDZDIRECT.RVAL") field(INPC, "LGPS:LTUS:7:STDZOK.RVAL") field(INPD, "LGPS:LTUS:7:STDZDISABLE.RVAL") field(INPE, "LGPS:LTUS:7:STATE.RVAL CPP NMS") field(INPF, "LGPS:LTUS:7:ICTRL.RVAL") field(INPG, "LGPS:LTUS:7:STATE.SEVR") field(INPH, "LGPS:LTUS:7:BDELTAS.M") field(INPI, "LGPS:LTUS:7:IACT.SEVR") field(OUT, "LGPS:LTUS:7:STDZLOSTGO.SELN PP NMS") field(OOPT, "Transition To Non-zero") } record(seq, "LGPS:LTUS:7:STDZLOSTGO") { field(DESC, "Process lost stdz") field(SELM, "Mask") field(DOL1, "1") field(DOL2, "0") field(LNK1, "LGPS:LTUS:7:STDZLOSTTOD.PROC") field(LNK2, "LGPS:LTUS:7:STDZOK PP") } # Record maximum current after standardize # Reset to IACT from sequence after trim # Disable processing during (mini-)standardize or trim record(calc, "LGPS:LTUS:7:STDZIACTMAX") { field(DESC, "Max act current after stdz") field(CALC, "MAX(A, B)") field(DISV, "0") field(SDIS, "LGPS:LTUS:7:CHECKPWRDIP_ENABLE") field(INPA, "LGPS:LTUS:7:IACT CP") field(INPB, "LGPS:LTUS:7:STDZIACTMAX") field(EGU, "A") field(FLNK, "LGPS:LTUS:7:CHECKPWRDIP") } # Detect power dip if STDZOK is YES, STDZ is enabled, and IACT is valid # If IACT drops below STDZIACTMAX by more than the trim tolerance, clear STDZOK # Warning: Take the absolute value of the trim tolerance, or else quads of # negative polarity will always lose STDZ since their IDELTAS.I are negative. # Note: Large quads and bends are prone to losing STDZ even if they are # perturbed toward higher current since their current tends to overshoot # by greater than the trim tolerance before settling down. record(calcout, "LGPS:LTUS:7:CHECKPWRDIP") { field(DESC, "Detect power dip") field(CALC, "(A-B>ABS(C))?3:0") field(DISV, "0") field(SDIS, "LGPS:LTUS:7:CHECKPWRDIP_ENABLE") field(INPA, "LGPS:LTUS:7:STDZIACTMAX") field(INPB, "LGPS:LTUS:7:IACT") field(INPC, "LGPS:LTUS:7:IDELTAS.I") field(OUT, "LGPS:LTUS:7:STDZLOSTGO.SELN PP NMS") field(OOPT, "When Non-zero") } # Enable processing of STDZIACTMAX and CHECKPWRDIP only if # STDZOK = YES, STDZDISABLE = NO, CTRL != Trim (2), and # CTRL != Stdz (4) record(calc, "LGPS:LTUS:7:CHECKPWRDIP_ENABLE") { field(CALC, "A&&!B&&(C#2)&&(C#4)") field(INPA, "LGPS:LTUS:7:STDZOK.RVAL CP") field(INPB, "LGPS:LTUS:7:STDZDISABLE.RVAL CP") field(INPC, "LGPS:LTUS:7:CTRL.RVAL CP") } #! 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, "LGPS:LTUS:7: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, "LGPS:LTUS:7: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, "LGPS:LTUS:7:CALBSET") { field(DESC, "Use DAC Calbration") field(SCAN, "10 second") field(CALC, "A&&(B==0)&&C?31:960") field(INPA, "LGPS:LTUS:7:CALBOK") field(INPB, "LGPS:LTUS:7:CALBDISABLE") field(INPC, "LGPS:LTUS:7:CALBSLOPE") field(OOPT, "On Change") field(OUT, "LGPS:LTUS:7: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, "LGPS:LTUS:7:CALB_SEQ") { field(DESC, "Output Calib Values") field(SELM, "Mask") field(SELL, "LGPS:LTUS:7: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, "LGPS:LTUS:7:CALBSLOPE") field(DOL3, "LGPS:LTUS:7: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, "LGPS:LTUS:7:CALBTOD") { field(DESC, "Calibration Success Time") field(PINI, "YES") # field(DOL, "") field(OMSL, "supervisory") field(DTYP, "Soft Channel") info(autosaveFields,"VAL") } record(ao, "LGPS:LTUS:7: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, "LGPS:LTUS:7: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, "LGPS:LTUS:7: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, "LGPS:LTUS:7:CALBOFFSET") { field(DESC, "Calc DAC Offset") field(PREC, "6") field(EGU, "Counts") field(PINI, "YES") } record(bo, "LGPS:LTUS:7: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, "LGPS:LTUS:7:DACSLOPE") { field(DESC, "V to DAC slope") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "supervisory") field(PINI, "YES") field(FLNK, "LGPS:LTUS:7:DACOFFSET") } # Default Offset used in conversion from Volts to DAC Counts record(ao, "LGPS:LTUS:7:DACOFFSET") { field(DESC, "V to DAC offset") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "supervisory") field(PINI, "YES") field(FLNK, "LGPS:LTUS:7: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, "LGPS:LTUS:7: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, "LGPS:LTUS:7:IACT") field(INPD, "LGPS:LTUS:7:DACSLOPE") field(INPE, "LGPS:LTUS:7:DACOFFSET") field(EGU, "Counts") field(PREC, "6") } record(ao, "LGPS:LTUS:7:DAC") { field(DESC, "DAC Set point") field(EGU, "Counts") field(DOL, "") field(OMSL, "supervisory") field(PREC, "6") field(PINI, "YES") } record(ao, "LGPS:LTUS:7:CALBIMIN") { field(DESC, "Calibration Min Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(DRVH, "50.0") field(HOPR, "50.0") field(DRVL, "0.0") field(LOPR, "0.0") field(PREC, "3") field(EGU, "A") field(VAL, "0.0") field(FLNK, "LGPS:LTUS:7:CALBIMAX") } record(ao, "LGPS:LTUS:7:CALBIMAX") { field(DESC, "Calibration Max Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(DRVH, "50.0") field(HOPR, "50.0") field(LOPR, "0.0") field(DRVL, "0.0") field(EGU, "A") field(VAL, "50.0") field(FLNK, "LGPS:LTUS:7:CALBSTEPNUM") } record(ao, "LGPS:LTUS:7:CALBIFINAL") { field(DESC, "Calibration Last Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(PREC, "3") field(EGU, "A") field(HOPR, "50.0") field(LOPR, "0.0") field(VAL, "0") } record(longout, "LGPS:LTUS:7: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, "LGPS:LTUS:7:CALBIDELTA") } record(calc, "LGPS:LTUS:7:CALBIDELTA") { field(DESC, "Step size for CALB") field(CALC, "C=0?0:ABS((A-B)/C)") field(INPA, "LGPS:LTUS:7:CALBIMAX") field(INPB, "LGPS:LTUS:7:CALBIMIN") field(INPC, "LGPS:LTUS:7: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, "LGPS:LTUS:7:CALBIMULT") { field(DESC, "IACT vs ISETPT mult") field(CALC, "C#0||A=0?1:ABS(B/A)") field(INPA, "PS:LTUS:7:ISETPT.DRVH") field(INPB, "PS:LTUS:7:IACT.HOPR") field(INPC, "LGPS:LTUS:7:PSCONTROLLER.RVAL CPP") field(EGU, "A") field(PINI, "YES") } # SNL dbputs DAC values here. 6-10 steps are possible. record(waveform, "LGPS:LTUS:7:CALBICTRLWF") { field(DESC, "ICTRL setpoint array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") } record(waveform, "LGPS:LTUS:7:DACWF") { field(DESC, "DAC count array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "LGPS:LTUS:7:DACSA") } # Used only for xygraph edm plot record(subArray, "LGPS:LTUS:7:DACSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "LGPS:LTUS:7: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, "LGPS:LTUS:7:CALCDACWF") { field(DESC, "Calc DAC counts array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "LGPS:LTUS:7:CALCDACSA") } # Used only for xygraph edm plot record(subArray, "LGPS:LTUS:7:CALCDACSA") { field(DESC, "Calc DAC counts") field(DTYP, "Soft Channel") field(INP, "LGPS:LTUS:7: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, "LGPS:LTUS:7:CALBYWF") { field(DESC, "mx + b") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "LGPS:LTUS:7:CALBYSA") } # Used only for xygraph edm plot record(subArray, "LGPS:LTUS:7:CALBYSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "LGPS:LTUS:7:CALBYWF") field(MALM, "10") field(NELM, "6") field(INDX, "0") field(FTVL, "DOUBLE") } record(waveform, "LGPS:LTUS:7:CALBIACTWF") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "LGPS:LTUS:7:CALBIACTSA") } # Used only for xygraph edm plot record(subArray, "LGPS:LTUS:7:CALBIACTSA") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(MALM, "10") field(NELM, "6") field(INP, "LGPS:LTUS:7:CALBIACTWF") field(INDX, "0") field(FTVL, "DOUBLE") field(FLNK, "LGPS:LTUS:7:CALBLIMITS") } # Check that measured current during calibration is within # tolerance. record(aSub, "LGPS:LTUS:7: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, "LGPS:LTUS:7:CALBSTEPNUM") field(INPB, "LGPS:LTUS:7:CALBIACTWF") field(INPC, "LGPS:LTUS:7: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, "LGPS:LTUS:7: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, "LGPS:LTUS:7:STDZITOL") field(INPH, "LGPS:LTUS:7:DACSLOPE") field(INPI, "LGPS:LTUS:7: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, "LGPS:LTUS:7: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, "LGPS:LTUS:7:CALBSTEPNUM") field(INPB, "LGPS:LTUS:7:CALBIACTWF") field(INPC, "LGPS:LTUS:7:DACWF") field(INPF, "LGPS:LTUS:7: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 LGPS:LTUS:7CALBOK 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, "LGPS:LTUS:7:DEGAUSINIT") { field(DESC, "Proc. Degauss PVs on boot") field(PINI, "YES") field(DOL, "1") field(OUTA, "LGPS:LTUS:7:DEGAUSIMIN.PROC PP") field(OUTB, "LGPS:LTUS:7:DEGAUSIMAX.PROC PP") field(OUTC, "LGPS:LTUS:7:DEGAUSTYPE.PROC PP") field(OUTD, "LGPS:LTUS:7:DEGAUSSTEP.PROC PP") field(OUTE, "LGPS:LTUS:7:MADNAME.PROC PP") field(OUTF, "LGPS:LTUS:7:PSTYPE.PROC PP") field(OUTG, "LGPS:LTUS:7: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, "LGPS:LTUS:7:DEGAUSSUB") { field(DESC, "Degauss subroutine") field(INAM, "mgntDegaussInit") field(SNAM, "mgntDegauss") field(BRSV, "INVALID") field(INPA, "LGPS:LTUS:7:DEGAUSIMIN NPP NMS") field(INPB, "LGPS:LTUS:7:DEGAUSIMAX NPP NMS") field(INPC, "LGPS:LTUS:7:DEGAUSTYPE.RVAL NPP NMS") field(INPE, "LGPS:LTUS:7:DEGAUSMETHOD.RVAL NPP NMS") field(INPF, "LGPS:LTUS:7:PSTYPE NPP NMS") field(INPG, "LGPS:LTUS:7:DEBUG.RVAL NPP NMS") field(INPH, "LGPS:LTUS:7: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, "LGPS:LTUS:7:DEGAUSWF PP") field(OUTB, "LGPS:LTUS:7:DEGAUSMSG PP") field(OUTC, "LGPS:LTUS:7: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, "LGPS:LTUS:7:DEGAUSWF") { field(DESC, "Degauss Setpts") field(NELM, "60") field(FTVL, "DOUBLE") } record(mbbo,"LGPS:LTUS:7: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, "LGPS:LTUS:7: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, "LGPS:LTUS:7: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, "LGPS:LTUS:7: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, "LGPS:LTUS:7: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, "LGPS:LTUS:7:DEGAUSIMIN") { field(DESC, "Min. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "50.0") field(LOPR, "-50.0") field(DRVH, "50.0") field(DRVL, "-50.0") field(VAL, "-50.0") } record(ao, "LGPS:LTUS:7:DEGAUSIMAX") { field(DESC, "Max. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "50.0") field(LOPR, "-50.0") field(DRVH, "50.0") field(DRVL, "-50.0") field(VAL, "50.0") } # 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,"LGPS:LTUS:7: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, "LGPS:LTUS:7: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,"LGPS:LTUS:7: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, "LGPS:LTUS:7: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, "LGPS:LTUS:7: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, "LGPS:LTUS:7: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, "LGPS:LTUS:7:DEGAUSTOD") { field(DESC, "Successful Degauss Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "LGPS:LTUS:7:DEGAUSLOSTTOD") { field(DESC, "Degauss Lost Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "LGPS:LTUS:7:DEGAUSTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "LGPS:LTUS:7:DEGAUSTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "LGPS:LTUS:7: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, "LGPS:LTUS:7:DEGAUSGO") { field(DESC, "Set bdes of btrms to zero") field(ASG, "Internal") field(OUTA, "") field(OUTB, "") field(OUTC, "") field(OUTD, "") } # =========== CRYO ONLY =========== record(bo, "LGPS:LTUS:7: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, "LGPS:LTUS:7:DEGAUS_IMAX_CHECK") { field(DESC, "Check if imax shoud chg") field(CALC, "(C==4)&&(ABS(B)>ABS(A))?1:0") field(INPA, "LGPS:LTUS:7:DEGAUS_IMAX") field(INPB, "LGPS:LTUS:7:ISETPT") field(INPC, "LGPS:LTUS:7:DEGAUSTYPE.RVAL") field(OUT, "LGPS:LTUS:7:DEGAUS_IMAX_UPDATE.SELN") field(FLNK, "LGPS:LTUS:7:DEGAUS_IMAX_UPDATE") } record(seq, "LGPS:LTUS:7:DEGAUS_IMAX_UPDATE") { field(DESC, "Degauss IMAX Update") field(SELM, "Specified") field(DOL1, "LGPS:LTUS:7:ISETPT") field(LNK1, "LGPS:LTUS:7:DEGAUS_IMAX PP") } # Set the maximum current after a successful # degauss. This pv is updated by the # sequence. record(ao, "LGPS:LTUS:7:DEGAUS_IMAX") { field(DESC, "Max I set afer a degauss") field(EGU, "Amps") field(PINI, "YES") field(PREC, "6") field(HOPR, "50.0") field(LOPR, "-50.0") field(DRVH, "50.0") field(DRVL, "-50.0") field(VAL, "50.0") field(FLNK, "LGPS:LTUS:7:DEGAUS_IMAXPOL_CHECK") info(autosaveFields,"VAL,RVAL") } # Set the polarity if degauss_imax record(calcout, "LGPS:LTUS:7:DEGAUS_IMAXPOL_CHECK") { field(DESC, "Determine polarity of imax") field(CALC, "A>=0?0:1") field(INPA, "LGPS:LTUS:7:DEGAUS_IMAX") field(FLNK, "LGPS:LTUS:7:DEGAUS_IMAXPOL") } record(bo, "LGPS:LTUS:7:DEGAUS_IMAXPOL") { field(DESC, "Polarity of imax I") field(DTYP, "Raw Soft Channel") field(DOL, "LGPS:LTUS:7:DEGAUS_IMAXPOL_CHECK") field(OMSL, "closed_loop") field(ZNAM, "Positive") field(ONAM, "Negative") field(FLNK, "LGPS:LTUS:7: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, "LGPS:LTUS:7:DEGAUS_ABSIMAX") { field(DESC, "Absolute Max. Degauss I") field(CALC, "ABS(A)") field(INPA, "LGPS:LTUS:7:DEGAUS_IMAX") field(PREC, "6") field(EGU, "Amps") field(HOPR, "50.0") field(LOPR, "-50.0") info(autosaveFields,"VAL RVAL") } # IACT Polarity record(calcout, "LGPS:LTUS:7:IACTPOL_CHECK") { field(DESC, "Determine IACT polarity") field(SCAN, "5 second") field(CALC, "ABS(A-B)>C?(A>=0?0:1):D") field(INPA, "LGPS:LTUS:7:IACT") field(INPB, "LGPS:LTUS:7:IACTPOL_CHECK.LA") field(INPC, "0.0001") field(INPD, "LGPS:LTUS:7:IACTPOL_CHECK.PVAL") field(OOPT, "On Change") field(FLNK, "LGPS:LTUS:7:IACTPOL") } record(bo, "LGPS:LTUS:7: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,"LGPS:LTUS:7: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, "LGPS:LTUS:7:DEGAUSENABLE CP") field(INPB, "LGPS:LTUS:7:DEGAUSOK") field(INPC, "LGPS:LTUS:7:STATE CP") field(INPD, "LGPS:LTUS:7:STATE.SEVR") field(OUT, "LGPS:LTUS:7:DEGAUS_STATE_SEQ.SELN PP") field(ASG, "Internal") } record(seq, "LGPS:LTUS:7:DEGAUS_STATE_SEQ") { field(DESC, "Degauss State Sequence") field(SELM, "Specified") field(SELL, "LGPS:LTUS:7:DEGAUS_STATE_CHECK") field(LNK1, "LGPS:LTUS:7:DEGAUS_STATE_DISABLE.PROC PP") field(LNK2, "LGPS:LTUS:7:DEGAUS_STATE_LOST.PROC PP") field(LNK3, "LGPS:LTUS:7:DEGAUS_STATE_GOOD.PROC PP") field(LNK4, "LGPS:LTUS:7: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, "LGPS:LTUS:7:DEGAUS_STATE_DISABLE") { field(DESC, "Degauss not used") field(LNK1, "LGPS:LTUS:7:DEGAUSOK.ZSV") field(LNK2, "LGPS:LTUS:7: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, "LGPS:LTUS:7:STATMSG.FRSV") field(LNK4, "LGPS:LTUS:7: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, "LGPS:LTUS:7:DEGAUS_STATE_LOST") { field(DESC, "Degauss lost and ps On") field(DOL1, "1") field(LNK1, "LGPS:LTUS:7:DEGAUSOK.ZSV") field(LNK2, "LGPS:LTUS:7: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, "LGPS:LTUS:7:STATMSG.FRSV") field(LNK4, "LGPS:LTUS:7: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, "LGPS:LTUS:7:DEGAUS_STATE_OFF") { field(DESC, "Degaused lost and ps Off") field(DOL1, "2") field(LNK1, "LGPS:LTUS:7: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, "LGPS:LTUS:7:STATMSG.FRSV") field(LNK3, "LGPS:LTUS:7: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, "LGPS:LTUS:7:DEGAUS_STATE_GOOD") { field(DESC, "Degauss good") field(DOL1, "1") field(LNK1, "LGPS:LTUS:7: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, "LGPS:LTUS:7:STATMSG.FRSV PP") field(LNK3, "LGPS:LTUS:7:STATMSG.FVSV PP") field(LNK4, "") field(ASG, "Internal") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(mbbo, "LGPS:LTUS:7:FUNC") { field(DESC, "LGPS:LTUS:7 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, "1") field(NIVL, "2") field(TEVL, "3") field(ELVL, "0") field(TVVL, "0") field(TTVL, "0") field(FTVL, "0") field(FFVL, "0") field(OUT, "LGPS:LTUS:7:CTRL CA") } # :CTRL pv is processed at boot in the # sequence mgntCtrl.st Processed in sequence # record(mbbo, "LGPS:LTUS:7:CTRL") { field(DESC, "LGPS:LTUS:7 Control") field(PINI, "NO") field(ZRST, "Ready") field(ONST, "RESET") field(TWST, "TURN_ON") field(THST, "TURN_OFF") 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, "8") field(TWVL, "9") field(THVL, "10") 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, "LGPS:LTUS:7:SELECTEN.A PP") field(SDIS, "0") } # If a function has been selected set this unit to busy record(calcout, "LGPS:LTUS:7:SELECTEN") { field(DESC, "Control Select Enable") field(CALC, "A>0?1:A") field(FLNK, "LGPS:LTUS:7:BUSY") } # Set to FREE on IOC reboot record(bo, "LGPS:LTUS:7:BUSY") { field(DESC, "LGPS:LTUS:7 Ctrl Done") field(DOL, "LGPS:LTUS:7:SELECTEN") field(ZNAM, "FREE") field(ONAM, "BUSY") field(PINI, "YES") field(FLNK, "LGPS:LTUS:7:SELECT") } record(bo, "LGPS:LTUS:7:SELECT") { field(ZNAM, "NO") field(ONAM, "YES") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") } record(bo, "LGPS:LTUS:7: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, "LGPS:LTUS:7:CTRLSTATE") { field(DESC, "LGPS:LTUS:7 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("LGPS:LTUS:7:CTRL",20,20,0,0,"LGPS:LTUS:7:CTRL") #! Field("LGPS:LTUS:7:CTRL.OUT",16777215,1,"LGPS:LTUS:7:CTRL.OUT") #! Link("LGPS:LTUS:7:CTRL.OUT","LGPS:LTUS:7:SELECTEN.A") #! Field("LGPS:LTUS:7:CTRL.VAL",16777215,1,"LGPS:LTUS:7:CTRL.VAL") #! Record("LGPS:LTUS:7:SELECTEN",321,381,0,0,"LGPS:LTUS:7:SELECTEN") #! Field("LGPS:LTUS:7:SELECTEN.A",16777215,0,"LGPS:LTUS:7:SELECTEN.A") #! Field("LGPS:LTUS:7:SELECTEN.FLNK",16777215,1,"LGPS:LTUS:7:SELECTEN.FLNK") #! Link("LGPS:LTUS:7:SELECTEN.FLNK","LGPS:LTUS:7:BUSY") #! Field("LGPS:LTUS:7:SELECTEN.VAL",16777215,1,"LGPS:LTUS:7:SELECTEN.VAL") #! Record("LGPS:LTUS:7:BUSY",623,274,0,0,"LGPS:LTUS:7:BUSY") #! Field("LGPS:LTUS:7:BUSY.DOL",16777215,0,"LGPS:LTUS:7:BUSY.DOL") #! Link("LGPS:LTUS:7:BUSY.DOL","LGPS:LTUS:7:SELECTEN.VAL") #! Field("LGPS:LTUS:7:BUSY.FLNK",16777215,1,"LGPS:LTUS:7:BUSY.FLNK") #! Link("LGPS:LTUS:7:BUSY.FLNK","LGPS:LTUS:7:SELECT") #! Record("LGPS:LTUS:7:SELECT",669,508,0,1,"LGPS:LTUS:7:SELECT") #! Record("LGPS:LTUS:7:FUNC",940,120,0,0,"LGPS:LTUS:7:FUNC") #! Field("LGPS:LTUS:7:FUNC.OUT",16777215,0,"LGPS:LTUS:7:FUNC.OUT") #! Link("LGPS:LTUS:7:FUNC.OUT","LGPS:LTUS:7:CTRL.VAL") #! Record("LGPS:LTUS:7:ABORT",193,41,0,0,"LGPS:LTUS:7:ABORT") #! Record("LGPS:LTUS:7:CTRLSTATE",369,34,0,0,"LGPS:LTUS:7: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,"LGPS:LTUS:7:SELECT is used for Multi-device selection.\nIt is enabled when associated LGPS:LTUS:7:CTRL is \"0\" (DONE).\nIt is disabled when associated LGPS:LTUS:7: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,"LGPS:LTUS:7: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, "LGPS:LTUS:7:BCTRL_INIT") { field(DESC, "Process BCTRL on boot") field(PINI, "YES") field(CALC, "A=3?1:0") field(INPA, "LGPS:LTUS:7:BCTRL.SEVR") field(OUT, "LGPS:LTUS:7: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, "LGPS:LTUS:7:BACT") { field(DESC, "Actual B") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "LGPS:LTUS:7:BACT") field(INPB, "LGPS:LTUS:7:POLYCOEF") field(INPC, "LGPS:LTUS:7:POLYCOEF.A") field(INPD, "LGPS:LTUS:7:POLYCOEF.B") field(INPE, "LGPS:LTUS:7:IACT MS") field(INPF, "LGPS:LTUS:7:BDELTAS PP") field(INPG, "100") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(HIHI, "50.0") field(LOLO, "0.0") field(PREC, "3") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "50.0") field(LOW, "0.0") field(FLNK, "LGPS:LTUS:7: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, "LGPS:LTUS:7:BDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntPhyDeltas") field(EGU, "Volts") field(HOPR, "1") field(PREC, "3") field(BRSV, "INVALID") field(INPA, "LGPS:LTUS:7:BDES") field(INPB, "LGPS:LTUS:7:TRIMBTOL") field(INPC, "LGPS:LTUS:7:TRIMBTOLR") field(INPD, "LGPS:LTUS:7:CHCKBTOL") field(INPE, "LGPS:LTUS:7:CHCKBTOLR") field(F, "0.0") field(INPG, "30") field(INPH, "LGPS:LTUS:7:BACT.VAL") # # MPS absolute and relative tolerances field(INPP, "LGPS:LTUS:7:MPSBTOL") field(INPQ, "LGPS:LTUS:7:MPSBTOLR") field(FLNK, "LGPS:LTUS:7:BCONLIMITS") info(autosaveFields,"F") } # This record is processed by BDELTAS record(aSub, "LGPS:LTUS:7:BCONLIMITS") { field(DESC, "Config B-field Limits") field(INAM, "mgntInit") field(SNAM, "mgntBCONLimits") field(INPA, "LGPS:LTUS:7:BDES") field(INPB, "LGPS:LTUS:7:BDELTAS.I") field(INPG, "LGPS:LTUS:7:DEBUG.RVAL") field(FTA, "DOUBLE") field(FTB, "DOUBLE") field(FTG, "ULONG") field(OUTA, "LGPS:LTUS:7:BCON.HIGH") field(OUTB, "LGPS:LTUS:7:BCON.LOW") field(OUTC, "LGPS:LTUS:7:BCON.HIHI") field(OUTD, "LGPS:LTUS:7:BCON.LOLO PP") field(FTVA, "DOUBLE") field(FTVB, "DOUBLE") field(FTVC, "DOUBLE") field(FTVD, "DOUBLE") field(BRSV, "INVALID") field(FLNK, "LGPS:LTUS:7:IDELTAS") } # The following PV is processed by :BACT # which is processed by :BACT # record(fanout, "LGPS:LTUS:7:BACTFO") { field(DESC, "BACT processing") field(SELM, "All") field(LNK1, "LGPS:LTUS:7:BDIFF") field(LNK2, "LGPS:LTUS:7:BADIFF") field(LNK3, "LGPS:LTUS:7:BRATIO") field(LNK4, "LGPS:LTUS:7:MPSLIMITS") field(LNK5, "LGPS:LTUS:7:I2BSTATUS") field(LNK6, "LGPS:LTUS:7:IACTFO.PROC") } record(calc, "LGPS:LTUS:7:BDIFF") { field(DESC, "BDES-BACT") field(CALC, "A-B") field(INPA, "LGPS:LTUS:7:BDES") field(INPB, "LGPS:LTUS:7:BACT") field(EGU, "Volts") field(PREC, "7") } record(calc, "LGPS:LTUS:7:BADIFF") { field(DESC, "Absolute BDES-BACT") field(INPA, "LGPS:LTUS:7:BDIFF") field(EGU, "Volts") field(PREC, "7") field(CALC, "A<0?ABS(A):A") } record(calc, "LGPS:LTUS:7:BRATIO") { field(DESC, "BACT Error") field(CALC, "B?A/B:0") field(INPA, "LGPS:LTUS:7:BDIFF") field(INPB, "LGPS:LTUS:7:BDES.HOPR") field(EGU, "Volts") field(PREC, "7") } record(mbbi, "LGPS:LTUS:7: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, "LGPS:LTUS:7:BACT.J") } # Note: for a string slave set the MONFL # macro to the following: # MONFL=:IMONCALC MS record(sub, "LGPS:LTUS:7:BMON") { field(DESC, "Second Transductor") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "LGPS:LTUS:7:BMON") field(INPB, "LGPS:LTUS:7:POLYCOEF") field(INPC, "LGPS:LTUS:7:POLYCOEF.A") field(INPD, "LGPS:LTUS:7:POLYCOEF.B") field(INPE, "LGPS:LTUS:7:IMON MS") field(INPF, "LGPS:LTUS:7:BDELTAS.VAL") field(INPG, "100") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(HIHI, "50.0") field(LOLO, "0.0") field(PREC, "3") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "50.0") field(LOW, "0.0") } # 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:LTUS:7:BDES CP record(ao, "LGPS:LTUS:7:BDES") { field(DESC, "Desired B-Field") field(PINI, "YES") field(DRVH, "50.0") field(DRVL, "0.0") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(EGU, "Volts") field(MDEL, "-1") field(OMSL, "closed_loop") field(DOL, "LGPS:LTUS:7:BDES.DRVH") field(OUT, "LGPS:LTUS:7:B2IDES PP") info(autosaveFields,"VAL") } record(sub, "LGPS:LTUS:7:B2IDES") { field(DESC, "Convert Desired B-Field to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "LGPS:LTUS:7:POLYCOEF") field(INPC, "LGPS:LTUS:7:POLYCOEF.A") field(INPD, "LGPS:LTUS:7:POLYCOEF.B") field(PREC, "3") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(MDEL, "-1") field(INPE, "LGPS:LTUS:7:BDES.DRVH") field(INPF, "LGPS:LTUS:7:BDES.DRVL") field(BRSV, "INVALID") field(FLNK, "LGPS:LTUS:7:IDES") } record(sub, "LGPS:LTUS:7:BNOM") { field(DESC, "Nominal Field") field(PINI, "YES") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "LGPS:LTUS:7:POLYCOEF") field(INPC, "LGPS:LTUS:7:POLYCOEF.A") field(INPD, "LGPS:LTUS:7:POLYCOEF.B") field(INPE, "LGPS:LTUS:7:BDES.DRVH") field(INPF, "LGPS:LTUS:7:BDES.DRVL") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(VAL, "0.0") field(FLNK, "LGPS:LTUS:7:INOM") } record(sub, "LGPS:LTUS:7:BACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "LGPS:LTUS:7:BDES.VAL") field(INPB, "LGPS:LTUS:7:BDES.DRVH") field(INPC, "LGPS:LTUS:7:BDES.DRVL") field(INPD, "LGPS:LTUS:7:BDELTAS.I") field(INPE, "LGPS:LTUS:7:BDELTAS.J") field(INPG, "LGPS:LTUS:7:STATE") field(INPH, "LGPS:LTUS:7:HSTA") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(sub, "LGPS:LTUS:7:BMONLIMITS") { field(DESC, "MON Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "LGPS:LTUS:7:BDES.VAL") field(INPB, "LGPS:LTUS:7:BDES.DRVH") field(INPC, "LGPS:LTUS:7:BDES.DRVL") field(INPD, "LGPS:LTUS:7:BDELTAS.K") field(INPE, "LGPS:LTUS:7:BDELTAS.L") field(INPG, "LGPS:LTUS:7:STATE") field(INPH, "LGPS:LTUS:7:HSTA") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(seq, "LGPS:LTUS:7:BLIMITS") { field(DESC, "ACT Limits") field(PREC, "3") field(DOL1, "LGPS:LTUS:7:BLIMITS") field(LNK1, "LGPS:LTUS:7:BACTLIMITS.F PP") field(DOL2, "LGPS:LTUS:7:BACTLIMITS.I") field(LNK2, "LGPS:LTUS:7:BACT.HIGH") field(DOL3, "LGPS:LTUS:7:BACTLIMITS.J") field(LNK3, "LGPS:LTUS:7:BACT.LOW") field(DOL4, "LGPS:LTUS:7:BACTLIMITS.K") field(LNK4, "LGPS:LTUS:7:BACT.HIHI") field(DOL5, "LGPS:LTUS:7:BACTLIMITS.L") field(LNK5, "LGPS:LTUS:7:BACT.LOLO") field(DOL6, "LGPS:LTUS:7:BLIMITS") field(LNK6, "LGPS:LTUS:7:BMONLIMITS.F PP") field(DOL7, "LGPS:LTUS:7:BMONLIMITS.I") field(LNK7, "LGPS:LTUS:7:BMON.HIGH") field(DOL8, "LGPS:LTUS:7:BMONLIMITS.J") field(LNK8, "LGPS:LTUS:7:BMON.LOW") field(DOL9, "LGPS:LTUS:7:BMONLIMITS.K") field(LNK9, "LGPS:LTUS:7:BMON.HIHI") field(DOLA, "LGPS:LTUS:7:BMONLIMITS.L") field(LNKA, "LGPS:LTUS:7:BMON.LOLO") field(FLNK, "LGPS:LTUS:7:ILIMITS") field(SCAN, "5 second") } record(ao, "LGPS:LTUS:7:BCTRL") { field(DESC, "B-Perturb") field(PREC, "3") field(EGU, "Volts") field(DRVH, "50.0") field(DRVL, "0.0") field(HOPR, "50.0") field(LOPR, "0.0") # 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, "LGPS:LTUS:7: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, "LGPS:LTUS:7:BCTRLGO") { field(DESC, "Update DES and perturb") field(PREC, "3") # Disable BACT limits field(DOL1, "1") field(LNK1, "LGPS:LTUS:7:BLIMITS.VAL") # Update BDES with the BCTRL (slider) value field(DOL2, "LGPS:LTUS:7:BCTRL.VAL") field(LNK2, "LGPS:LTUS:7:BDES PP") field(DOL3, "1") field(LNK3, "LGPS:LTUS:7:IDIRECT.PROC PP") field(DOL4, "1") field(LNK4, "LGPS:LTUS:7:CHECKSTDZLOST.PROC PP") field(DOL5, "LGPS:LTUS:7:BCTRL.VAL") field(LNK5, "LGPS:LTUS:7:BCTRLSUB PP") # Re-enable BACT limits field(DOL6, "0") field(LNK6, "LGPS:LTUS:7:BLIMITS.VAL") } # Convert B-field to Current and output to ISETPT record(sub, "LGPS:LTUS:7:BCTRLSUB") { field(DESC, "Feedback") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "LGPS:LTUS:7:POLYCOEF") field(INPC, "LGPS:LTUS:7:POLYCOEF.A") field(INPD, "LGPS:LTUS:7:POLYCOEF.B") field(INPE, "LGPS:LTUS:7:BDES.DRVH") field(INPF, "LGPS:LTUS:7:BDES.DRVL") field(PREC, "3") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(MDEL, "-1") field(BRSV, "INVALID") field(FLNK, "LGPS:LTUS:7:ISETPT") } record(ao, "LGPS:LTUS:7:BDESPREVTRIM") { field(DESC, "trim bdes for undo") field(DTYP, "Soft Channel") field(DRVH, "50.0") field(DRVL, "0.0") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(PINI, "YES") info(autosaveFields,"VAL") } record(stringin, "LGPS:LTUS:7:MADNAME") { field(DESC, "MAD deck nomenclature") field(PINI, "YES") field(VAL, "B912-1301") } record(ai, "LGPS:LTUS:7: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, "0.0") } record(ao, "LGPS:LTUS:7:BMAX") { field(DESC, "Max B-Field") field(DTYP, "Soft Channel") field(DRVH, "50.0") field(DRVL, "0.0") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(PINI, "YES") field(VAL, "50.0") field(FLNK, "LGPS:LTUS:7:BSTEP") } record(ao, "LGPS:LTUS:7:BMIN") { field(DESC, "Min B-Field") field(DTYP, "Soft Channel") field(DRVH, "50.0") field(DRVL, "0.0") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(PINI, "YES") field(VAL, "0.0") field(FLNK, "LGPS:LTUS:7:BSTEP") } record(ao, "LGPS:LTUS:7:BDESSAVE") { field(DESC, "bdes for save/load") field(DTYP, "Soft Channel") field(DRVH, "50.0") field(DRVL, "0.0") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PINI, "YES") field(PREC, "3") } # This record is processed by LGPS:LTUS:7: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, "LGPS:LTUS:7:BCON") { field(DESC, "Config B-Field ") field(DTYP, "Soft Channel") field(PREC, "3") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(DRVH, "50.0") field(DRVL, "0.0") # 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 , "") field(OMSL, "closed_loop") field(OUT, "LGPS:LTUS:7:B2ICON PP") info(autosaveFields,"VAL") } record(sub, "LGPS:LTUS:7:B2ICON") { field(DESC, "Convert Desired ICon to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "LGPS:LTUS:7:POLYCOEF") field(INPC, "LGPS:LTUS:7:POLYCOEF.A") field(INPD, "LGPS:LTUS:7:POLYCOEF.B") field(PREC, "3") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(MDEL, "-1") field(INPE, "LGPS:LTUS:7:BCON.DRVH") field(INPF, "LGPS:LTUS:7:BCON.DRVL") field(BRSV, "INVALID") field(FLNK, "LGPS:LTUS:7: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, "LGPS:LTUS:7:BSTEP") { field(DESC, "B-Field step size") field(CALC, "(C==3)||(D==3)?0:ABS(A-B)*0.005") field(INPA, "LGPS:LTUS:7:BMAX") field(INPB, "LGPS:LTUS:7:BMIN") field(INPC, "LGPS:LTUS:7:BMIN.SEVR") field(INPD, "LGPS:LTUS:7:BMAX.SEVR") field(EGU, "Volts") 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,"LGPS:LTUS:7:BCTRLDISABLECALC") { field(DESC, "Calc for disabling BCTRL") field(ASG, "Internal") field(CALC, "A?2:1") field(INPA, "LGPS:LTUS:7:ONLINE CP") field(OUT, "LGPS:LTUS:7:BCTRLDISABLEFOUT PP") } record(fanout, "LGPS:LTUS:7:BCTRLDISABLEFOUT") { field(DESC, "Disable BCTRL fanout") field(SELM, "Specified") field(SELL, "LGPS:LTUS:7:BCTRLDISABLECALC") field(LNK1, "LGPS:LTUS:7:BCTRLDISABLE") field(LNK2, "LGPS:LTUS:7:BCTRLENABLE") } record(stringout, "LGPS:LTUS:7:BCTRLDISABLE") { field(DESC, "Disable BCTRL") field(DTYP, "Soft Channel") field(OUT, "LGPS:LTUS:7:BCTRL.ASG") field(VAL, "NOWRITE") field(FLNK, "LGPS:LTUS:7:BCTRLDISV_UPDATE") } record(stringout, "LGPS:LTUS:7:BCTRLENABLE") { field(DESC, "Enable BCTRL") field(DTYP, "Soft Channel") field(OUT, "LGPS:LTUS:7:BCTRL.ASG") field(VAL, "") field(FLNK, "LGPS:LTUS:7:BCTRLDISV_UPDATE") } record(calcout, "LGPS:LTUS:7:BCTRLDISV_UPDATE") { field(DESC, "Calc for updating BCTRL.DISV") field(ASG, "Internal") field(CALC, "A") field(INPA, "LGPS:LTUS:7:ONLINE") field(OUT, "LGPS:LTUS:7: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,"LGPS:LTUS:7:BACT and MON\n are processed via links from \n LGPS:LTUS:7:IACT (device raw value readback 1)\n and\n LGPS:LTUS:7: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 LGPS:LTUS:7:POLYCOEF\nC = First polynomial coefficient (offset if linear)\nD = Second polynomial coefficient (slope if linear)\nE = LGPS:LTUS:7: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,"LGPS:LTUS:7:BDES\n is processed when set by CA users or \n LGPS:LTUS:7: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,"LGPS:LTUS:7: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 LGPS:LTUS:7: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 (LGPS:LTUS:7: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,"LGPS:LTUS:7:B*LIMITS and LGPS:LTUS:7:BLIMITS:\n Calculate alarm and warning limits based on \n deltas from LGPS:LTUS:7: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,"LGPS:LTUS:7: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,"LGPS:LTUS:7: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, "LGPS:LTUS:7: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, "LGPS:LTUS:7:MPSBTOL") { field(DESC, "Absolute mps tol") field(EGU, "Volts") field(PREC, "2") field(CALC, "ABS(A)*0.02") field(INPA, "LGPS:LTUS:7:BMAX") field(PINI, "YES") } # # 21-Aug-2013: K. Luchini # Set channel access security so that users # cannot easily change values. record(ao, "LGPS:LTUS:7:MPSBMAX") { field(DESC, "MPS Max B-field") field(EGU, "Volts") field(PREC, "7") field(DRVH, "50.0") field(DRVL, "0.0") field(PINI, "YES") field(VAL, "50.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "LGPS:LTUS:7:MPSBMIN") { field(DESC, "MPS Min B-field") field(EGU, "Volts") field(PREC, "7") field(DRVH, "50.0") field(DRVL, "0.0") field(PINI, "YES") field(VAL, "0.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "LGPS:LTUS:7:MPSBLLIM") { field(DESC, "MPS Low Limit B-field") field(EGU, "Volts") field(PREC, "7") field(DRVH, "50.0") field(DRVL, "0.0") field(PINI, "YES") field(VAL, "0.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "LGPS:LTUS:7:MPSBLLIM2") { field(DESC, "MPS Low Limit #2 B-field") field(EGU, "Volts") field(PREC, "7") field(DRVH, "50.0") field(DRVL, "0.0") field(PINI, "YES") field(VAL, "0.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } # Set the default to Std record(mbbo, "LGPS:LTUS:7: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, "LGPS:LTUS:7:MPSLIMITS.E PP") } record(aSub, "LGPS:LTUS:7: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, "LGPS:LTUS:7:MPS.RVAL") field(INPB, "LGPS:LTUS:7:BADIFF") field(INPC, "LGPS:LTUS:7:BDELTAS.N") field(INPD, "LGPS:LTUS:7:BACT") field(INPE, "LGPS:LTUS:7:MPSBITMASK.RVAL") field(INPF, "LGPS:LTUS:7:MPSBLLIM") field(INPG, "LGPS:LTUS:7:MPSBMIN") field(INPH, "LGPS:LTUS:7:MPSBMAX") field(INPI, "LGPS:LTUS:7: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, "LGPS:LTUS:7:INTOL.RVAL PP") field(OUTB, "LGPS:LTUS:7:INTOL_BMIN.RVAL PP") field(OUTC, "LGPS:LTUS:7:INTOL_BRANGE.RVAL PP") field(OUTD, "LGPS:LTUS:7: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, "LGPS:LTUS:7:INTOL") { field(DESC, "BACT within MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "LGPS:LTUS:7:MPSLIMITS.VALA") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "LGPS:LTUS:7:INTOL_BMIN") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "LGPS:LTUS:7:MPSLIMITS.VALB") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "LGPS:LTUS:7:INTOL_BMIN2") { field(DESC, "MPS tol #2") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "LGPS:LTUS:7:MPSLIMITS.VALD") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "LGPS:LTUS:7:INTOL_BRANGE") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "LGPS:LTUS:7: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, "LGPS:LTUS:7:CHCKITOL") { field(DESC, "Absolute Check I Tolerance") field(EGU, "A") field(FLNK, "LGPS:LTUS:7:TRIMITOL") field(CALC, "ABS(A*B)") field(INPA, "LGPS:LTUS:7:CHCKBTOL") field(INPB, "LGPS:LTUS:7:POLYCOEF.B") field(PREC, "9") } record(calc, "LGPS:LTUS:7:TRIMBTOL") { field(EGU, "Volts") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(DESC, "Absolute Trim Tolerance") field(CALC, "ABS(A)/2") field(INPA, "LGPS:LTUS:7:CHCKBTOL") field(FLNK, "LGPS:LTUS:7:CHCKITOL") } record(calc, "LGPS:LTUS:7:CHCKBTOL") { field(DESC, "Check absolute tolerance") field(EGU, "A") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(FLNK, "LGPS:LTUS:7:TRIMBTOL") field(CALC, "MAX(ABS(A),ABS(C))*(B/1000000)") field(INPA, "LGPS:LTUS:7:BDES.HOPR") field(INPB, "LGPS:LTUS:7:STABILITY") field(INPC, "LGPS:LTUS:7:BDES.LOPR") } record(longout, "LGPS:LTUS:7:STABILITY") { field(DESC, "Long Term Stability") field(PINI, "YES") field(VAL, "15000") field(EGU, "ppm") field(DRVH, "20000") field(DRVL, "100") field(HOPR, "20000") field(LOPR, "100") field(FLNK, "LGPS:LTUS:7:CHCKBTOL") } record(calc, "LGPS:LTUS:7:TRIMITOL") { field(DESC, "Absolute Trim I Tolerance") field(EGU, "Volts") field(CALC, "ABS(A*B)") field(INPA, "LGPS:LTUS:7:POLYCOEF.B") field(INPB, "LGPS:LTUS:7:TRIMBTOL") field(PREC, "9") } record(ai, "LGPS:LTUS:7:TRIMBTOLR") { field(DESC, "Relative trim tol") field(PREC, "4") field(EGU, "%") field(HOPR, "1.0") field(LOPR, "0.0") field(PINI, "YES") } record(ai, "LGPS:LTUS:7: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, "LGPS:LTUS:7:FBCKFCOM") { field(ZNAM, "CA") field(ONAM, "FCOM") field(DESC, "CA Mode") field(PINI, "YES") field(SDIS, "0") } record(bo, "LGPS:LTUS:7:PAU") { field(ZNAM, "NotConfigured") field(ONAM, "Configured") field(DESC, "PAU Present") field(PINI, "YES") field(SDIS, "0") field(FLNK, "LGPS:LTUS:7:PAUGO") } record(fanout, "LGPS:LTUS:7:PAUGO") { field(DESC, "PAU control") field(LNK1, "LGPS:LTUS:7:PAUSTOP") field(LNK2, "LGPS:LTUS:7: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, "LGPS:LTUS:7:PAUSTART") { field(DESC, "Setup for PAU On") field(SDIS, "LGPS:LTUS:7: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, "LGPS:LTUS:7:PAUSTOP") { field(DESC, "Setup for PAU Off") field(SDIS, "LGPS:LTUS:7: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, "LGPS:LTUS:7:MCORDEVNAME") { field(DESC, "PS device name") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, "PS:LTUS:7:") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "LGPS:LTUS:7: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, "LGPS:LTUS:7:PSTYPE.RVAL") field(INPC, "LGPS:LTUS:7:TURNEDOFF.RVAL") field(INPD, "LGPS:LTUS:7:CONFIG.RVAL") field(INPE, "LGPS:LTUS:7:PSCATEGORY.RVAL") field(INPF, "LGPS:LTUS:7:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "LGPS:LTUS:7:AUTOCTRL.RVAL") field(INPJ, "LGPS:LTUS:7:OUTOFSERVICE.RVAL") field(INPL, "LGPS:LTUS:7:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "LGPS:LTUS:7:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "LGPS:LTUS:7:PAU") field(INPP, "LGPS:LTUS:7:CALBDISABLE.RVAL") field(INPQ, "LGPS:LTUS:7:PTRBDISABLE.RVAL") field(INPR, "LGPS:LTUS:7:TRIMDISABLE.RVAL") field(INPS, "LGPS:LTUS:7:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "LGPS:LTUS:7:FBCK") field(INPU, "LGPS:LTUS:7:TRIMTYPE.RVAL") field(INPV, "LGPS:LTUS:7:STDZDIRECT.RVAL") field(INPW, "LGPS:LTUS:7:DEGAUSENABLE.RVAL") field(FLNK, "LGPS:LTUS:7:HSTA") } record(longin, "LGPS:LTUS:7:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "LGPS:LTUS:7:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "LGPS:LTUS:7: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, "LGPS:LTUS:7: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, "LGPS:LTUS:7: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, "LGPS:LTUS:7: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, "LGPS:LTUS:7: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, "LGPS:LTUS:7: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 LGPS:LTUS:7:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses LGPS:LTUS:7:FBCK. # This PV should be replaced by LGPS:LTUS:7: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, "LGPS:LTUS:7: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, "LGPS:LTUS:7: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, "LGPS:LTUS:7: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, "") field(OMSL, "supervisory") field(FLNK, "LGPS:LTUS:7:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"LGPS:LTUS:7:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "LGPS:LTUS:7:OUTOFSERVICE NPP NMS") field(OUT, "LGPS:LTUS:7:ONLINE PP") } record(bo, "LGPS:LTUS:7:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "LGPS:LTUS:7: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, "1") } record(bo, "LGPS:LTUS:7: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, "1") } record(bo, "LGPS:LTUS:7: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, "1") } # This PV is modified by :STATSUB.U record(bo, "LGPS:LTUS:7: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, "LGPS:LTUS:7: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, "LGPS:LTUS:7: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, "LGPS:LTUS:7: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, "LGPS:LTUS:7: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, "1") field(ASG, "NOWRITE") } record(mbbo, "LGPS:LTUS:7: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, "2") field(ASG, "NOWRITE") } record(mbbo, "LGPS:LTUS:7: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, "3") field(ASG, "NOWRITE") } record(mbbo, "LGPS:LTUS:7: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, "0") field(ASG, "NOWRITE") field(FLNK, "LGPS:LTUS:7:TRIMTYPE") } record(stringout, "LGPS:LTUS:7:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "LGPS:LTUS:7:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "LGPS:LTUS:7:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "LGPS:LTUS:7:STATE.RVAL") field(INPB, "LGPS:LTUS:7:INTLKSUMY.RVAL") field(OUT, "LGPS:LTUS:7:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "LGPS:LTUS:7: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, "LGPS:LTUS:7:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "LGPS:LTUS:7:STATE.RVAL") field(INPB, "LGPS:LTUS:7:INTLKSUMY.RVAL") field(OUT, "LGPS:LTUS:7:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "LGPS:LTUS:7:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "LGPS:LTUS:7:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "LGPS:LTUS:7: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, "LGPS:LTUS:7: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, "LGPS:LTUS:7: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, "LGPS:LTUS:7: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,"LGPS:LTUS:7: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("LGPS:LTUS:7:TURNEDOFF",3140,1907,0,1,"LGPS:LTUS:7:TURNEDOFF") #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "LGPS:LTUS:7:STATSUB") { field(DESC, "Build STATus ") field(INAM, "mgntInit") field(SNAM, "mgntSlcStat") field(INPA, "LGPS:LTUS:7:BACT.STAT") field(INPB, "LGPS:LTUS:7:BDES.STAT") field(INPC, "LGPS:LTUS:7:IRIPL.STAT") field(INPD, "PS:LTUS:7:ISETPT.STAT") field(INPE, "PS:LTUS:7:IACT.STAT") # 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, "LGPS:LTUS:7:BACT.SEVR") field(INPH, "LGPS:LTUS:7:BDES.SEVR") field(INPI, "LGPS:LTUS:7:IRIPL.SEVR") field(INPJ, "PS:LTUS:7:ISETPT.SEVR") field(INPK, "PS:LTUS:7:IACT.SEVR") # # 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, "LGPS:LTUS:7:STATE.RVAL") field(INPN, "LGPS:LTUS:7:STDZOK") field(INPO, "LGPS:LTUS:7:CALBOK") field(INPP, "LGPS:LTUS:7:OUTOFSERVICE.RVAL") field(INPQ, "LGPS:LTUS:7:CONFIG.RVAL") field(INPR, "LGPS:LTUS:7:HSTA") field(INPS, "LGPS:LTUS:7:CTRL.RVAL") field(INPT, "LGPS:LTUS:7:DEGAUSOK") field(INPV, "LGPS:LTUS:7: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, "LGPS:LTUS:7:STAT") } record(longout, "LGPS:LTUS:7:STAT") { field(DESC, "STAT sent to SLC") field(SCAN, "Passive") field(FLNK, "LGPS:LTUS:7:STATCTRLSUB") field(DOL, "LGPS:LTUS:7:STATSUB.VAL") field(OMSL, "closed_loop") } record(sSub, "LGPS:LTUS:7:STATCTRLSUB") { field(DESC, "Decode SLC STAT into mbbo") field(INAM, "mgntInit") field(SNAM, "mgntStatDecode") field(INPA, "LGPS:LTUS:7:STAT") field(INPB, "LGPS:LTUS:7:HSTA") field(INPD, "LGPS:LTUS:7:ONOFFCTRL.RVAL") field(FLNK, "LGPS:LTUS:7:STATMSG") } record(mbbo, "LGPS:LTUS:7: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, "LGPS:LTUS:7:UNAVAILGO") field(DOL, "LGPS:LTUS:7:STATCTRLSUB.W") } record(seq, "LGPS:LTUS:7:UNAVAILGO") { field(DESC, "Process UNAVAIL") field(DOL1, "LGPS:LTUS:7:STATSUB.U") field(LNK1, "LGPS:LTUS:7:UNAVAIL PP") } record(stringout, "LGPS:LTUS:7:SNLSTATMSG") { field(DTYP, "Soft Channel") } #! TextBox(TB0,820,1000,1200,1220,0,"Dialog",12,1,16777215,"LGPS:LTUS:7:STATUSSUB - future\nOverall device status - takes input from action snls, record sevrs, master snl(s) and outputs final status\n\nInputs:\nA - LGPS:LTUS:7:CTRLSTATUS - snl status\nB - MGNT:CTRLSTATUS - master list status\nC\nD - LGPS:LTUS:7: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,"LGPS:LTUS:7STATSUB\nformat control bo's into slc STAT\n\nInputs:\nA - LGPS:LTUS:7:STATUS\nC - LGPS:LTUS:7:ON\nD - LGPS:LTUS:7:STDZOK\nE - LGPS:LTUS:7:CALBOK\nF - LGPS:LTUS:7:BACTDRIFT (future)\nG -\nH- LGPS:LTUS:7:DACSTATUS\nI -LGPS:LTUS:7:ADCSTATUS\nJ - LGPS:LTUS:7:BACTSTATUS\nK - LGPS:LTUS:7:BDESSTATUS\nL - LGPS:LTUS:7:RIPLSTATUS\n\nOutput:\nP - LGPS:LTUS:7: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, "LGPS:LTUS:7: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, "LGPS:LTUS:7: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, "LGPS:LTUS:7: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, "LGPS:LTUS:7: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.6 #! DBDSTART #! DBD("../../../../dbd/mgntSoft.dbd") #! DBDEND record(stringout, "LGPS:LTUS:7:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "LGPS:LTUS:7:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "LGPS:LTUS:7:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "LGPS:LTUS:7:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "LGPS:LTUS:7:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "LGPS:LTUS:7:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "1") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "LGPS:LTUS:7: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, "LGPS:LTUS:7:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "LGPS:LTUS:7:TRIMTYPE.RVAL") field(INPB, "LGPS:LTUS:7:CONFIG.RVAL") field(OUT, "LGPS:LTUS:7:TRIMMAXNUM PP") } record(longout, "LGPS:LTUS:7: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, "LGPS:LTUS:7:TRIMRAMPRATE") { field(DESC, "Trim Ramp rate ") field(PINI, "YES") field(ASG, "IOC_MAINT") field(PREC, "3") field(EGU, "Volts/sec") field(HOPR, "20.0") field(DRVH, "20.0") field(DRVL, "0.1") field(LOPR, "0.5") # field(DOL, "") field(OMSL, "supervisory") field(VAL, "10") field(OUT, "LGPS:LTUS:7:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "LGPS:LTUS:7: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, "") field(OMSL, "supervisory") field(VAL, "10") } record(bo, "LGPS:LTUS:7: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, "LGPS:LTUS:7: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, "LGPS:LTUS:7:TRIMSTEPMIN") { field(DESC, "Min step in current") field(DTYP, "Soft Channel") # field(DOL, "") field(PREC, "7") field(EGUF, "10") field(EGUL, "0") field(EGU, "Volts") field(HOPR, "10") field(LOPR, "0") field(VAL, "5.0") } record(bo, "LGPS:LTUS:7:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "0") } record(ao, "LGPS:LTUS:7: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, "LGPS:LTUS:7:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "LGPS:LTUS:7: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, "LGPS:LTUS:7: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, "LGPS:LTUS:7:IMOVE") field(INPB, "LGPS:LTUS:7:IACT") field(INPC, "LGPS:LTUS:7:IRAMPRATE") field(INPD, "1.0") field(INPE, "LGPS:LTUS:7:TRIMDLYPCT") field(INPF, "LGPS:LTUS:7:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "LGPS:LTUS:7:RAMPTIME_LEFT PP") } record(longout, "LGPS:LTUS:7:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "LGPS:LTUS:7:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "LGPS:LTUS:7:RAMPDONE_CALC") } record(calc, "LGPS:LTUS:7:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "LGPS:LTUS:7:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "LGPS:LTUS:7:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "LGPS:LTUS:7: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, "LGPS:LTUS:7:RAMPTIME_LEFT") field(OUT, "LGPS:LTUS:7:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "LGPS:LTUS:7:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "LGPS:LTUS:7:RAMPTIME_LEFT NMS") field(OUT, "LGPS:LTUS:7:RAMPDONE PP") } record(bo, "LGPS:LTUS:7:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "LGPS:LTUS:7:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "LGPS:LTUS:7: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, "LGPS:LTUS:7: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(ai, "LGPS:LTUS:7: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, "LGPS:LTUS:7:MPSBTOL") { field(DESC, "Absolute mps tol") field(EGU, "Volts") field(PREC, "2") field(CALC, "ABS(A)*0.02") field(INPA, "LGPS:LTUS:7:BMAX") field(PINI, "YES") } # # 21-Aug-2013: K. Luchini # Set channel access security so that users # cannot easily change values. record(ao, "LGPS:LTUS:7:MPSBMAX") { field(DESC, "MPS Max B-field") field(EGU, "Volts") field(PREC, "7") field(DRVH, "50.0") field(DRVL, "0.0") field(PINI, "YES") field(VAL, "50.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "LGPS:LTUS:7:MPSBMIN") { field(DESC, "MPS Min B-field") field(EGU, "Volts") field(PREC, "7") field(DRVH, "50.0") field(DRVL, "0.0") field(PINI, "YES") field(VAL, "0.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "LGPS:LTUS:7:MPSBLLIM") { field(DESC, "MPS Low Limit B-field") field(EGU, "Volts") field(PREC, "7") field(DRVH, "50.0") field(DRVL, "0.0") field(PINI, "YES") field(VAL, "0.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "LGPS:LTUS:7:MPSBLLIM2") { field(DESC, "MPS Low Limit #2 B-field") field(EGU, "Volts") field(PREC, "7") field(DRVH, "50.0") field(DRVL, "0.0") field(PINI, "YES") field(VAL, "0.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } # Set the default to Std record(mbbo, "LGPS:LTUS:7: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, "LGPS:LTUS:7:MPSLIMITS.E PP") } record(aSub, "LGPS:LTUS:7: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, "LGPS:LTUS:7:MPS.RVAL") field(INPB, "LGPS:LTUS:7:BADIFF") field(INPC, "LGPS:LTUS:7:BDELTAS.N") field(INPD, "LGPS:LTUS:7:BACT") field(INPE, "LGPS:LTUS:7:MPSBITMASK.RVAL") field(INPF, "LGPS:LTUS:7:MPSBLLIM") field(INPG, "LGPS:LTUS:7:MPSBMIN") field(INPH, "LGPS:LTUS:7:MPSBMAX") field(INPI, "LGPS:LTUS:7: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, "LGPS:LTUS:7:INTOL.RVAL PP") field(OUTB, "LGPS:LTUS:7:INTOL_BMIN.RVAL PP") field(OUTC, "LGPS:LTUS:7:INTOL_BRANGE.RVAL PP") field(OUTD, "LGPS:LTUS:7: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, "LGPS:LTUS:7:INTOL") { field(DESC, "BACT within MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "LGPS:LTUS:7:MPSLIMITS.VALA") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "LGPS:LTUS:7:INTOL_BMIN") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "LGPS:LTUS:7:MPSLIMITS.VALB") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "LGPS:LTUS:7:INTOL_BMIN2") { field(DESC, "MPS tol #2") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "LGPS:LTUS:7:MPSLIMITS.VALD") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "LGPS:LTUS:7:INTOL_BRANGE") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "LGPS:LTUS:7: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, "LGPS:LTUS:7:CHCKITOL") { field(DESC, "Absolute Check I Tolerance") field(EGU, "A") field(FLNK, "LGPS:LTUS:7:TRIMITOL") field(CALC, "ABS(A*B)") field(INPA, "LGPS:LTUS:7:CHCKBTOL") field(INPB, "LGPS:LTUS:7:POLYCOEF.B") field(PREC, "9") } record(calc, "LGPS:LTUS:7:TRIMBTOL") { field(EGU, "Volts") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(DESC, "Absolute Trim Tolerance") field(CALC, "ABS(A)/2") field(INPA, "LGPS:LTUS:7:CHCKBTOL") field(FLNK, "LGPS:LTUS:7:CHCKITOL") } record(calc, "LGPS:LTUS:7:CHCKBTOL") { field(DESC, "Check absolute tolerance") field(EGU, "A") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(FLNK, "LGPS:LTUS:7:TRIMBTOL") field(CALC, "MAX(ABS(A),ABS(C))*(B/1000000)") field(INPA, "LGPS:LTUS:7:BDES.HOPR") field(INPB, "LGPS:LTUS:7:STABILITY") field(INPC, "LGPS:LTUS:7:BDES.LOPR") } record(longout, "LGPS:LTUS:7:STABILITY") { field(DESC, "Long Term Stability") field(PINI, "YES") field(VAL, "1000") field(EGU, "ppm") field(DRVH, "20000") field(DRVL, "100") field(HOPR, "20000") field(LOPR, "100") field(FLNK, "LGPS:LTUS:7:CHCKBTOL") } record(calc, "LGPS:LTUS:7:TRIMITOL") { field(DESC, "Absolute Trim I Tolerance") field(EGU, "Volts") field(CALC, "ABS(A*B)") field(INPA, "LGPS:LTUS:7:POLYCOEF.B") field(INPB, "LGPS:LTUS:7:TRIMBTOL") field(PREC, "9") } record(ai, "LGPS:LTUS:7:TRIMBTOLR") { field(DESC, "Relative trim tol") field(PREC, "4") field(EGU, "%") field(HOPR, "1.0") field(LOPR, "0.0") field(PINI, "YES") } record(ai, "LGPS:LTUS:7: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.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "LGPS:LTUS:7: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, "LGPS:LTUS:7:PSTYPE.RVAL") field(INPC, "LGPS:LTUS:7:TURNEDOFF.RVAL") field(INPD, "LGPS:LTUS:7:CONFIG.RVAL") field(INPE, "LGPS:LTUS:7:PSCATEGORY.RVAL") field(INPF, "LGPS:LTUS:7:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "LGPS:LTUS:7:AUTOCTRL.RVAL") field(INPJ, "LGPS:LTUS:7:OUTOFSERVICE.RVAL") field(INPL, "LGPS:LTUS:7:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "LGPS:LTUS:7:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "LGPS:LTUS:7:PAU") field(INPP, "LGPS:LTUS:7:CALBDISABLE.RVAL") field(INPQ, "LGPS:LTUS:7:PTRBDISABLE.RVAL") field(INPR, "LGPS:LTUS:7:TRIMDISABLE.RVAL") field(INPS, "LGPS:LTUS:7:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "LGPS:LTUS:7:FBCK") field(INPU, "LGPS:LTUS:7:TRIMTYPE.RVAL") field(INPV, "LGPS:LTUS:7:STDZDIRECT.RVAL") field(INPW, "LGPS:LTUS:7:DEGAUSENABLE.RVAL") field(FLNK, "LGPS:LTUS:7:HSTA") } record(longin, "LGPS:LTUS:7:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "LGPS:LTUS:7:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "LGPS:LTUS:7: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, "LGPS:LTUS:7: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, "LGPS:LTUS:7: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, "LGPS:LTUS:7: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, "LGPS:LTUS:7: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, "LGPS:LTUS:7: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 LGPS:LTUS:7:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses LGPS:LTUS:7:FBCK. # This PV should be replaced by LGPS:LTUS:7: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, "LGPS:LTUS:7: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, "LGPS:LTUS:7: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, "LGPS:LTUS:7: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, "") field(OMSL, "supervisory") field(FLNK, "LGPS:LTUS:7:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"LGPS:LTUS:7:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "LGPS:LTUS:7:OUTOFSERVICE NPP NMS") field(OUT, "LGPS:LTUS:7:ONLINE PP") } record(bo, "LGPS:LTUS:7:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "PS:LTUS:7:CommLink PP") } record(bo, "LGPS:LTUS:7: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, "1") } record(bo, "LGPS:LTUS:7: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, "1") } record(bo, "LGPS:LTUS:7: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, "1") } # This PV is modified by :STATSUB.U record(bo, "LGPS:LTUS:7: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, "LGPS:LTUS:7: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, "LGPS:LTUS:7: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, "LGPS:LTUS:7: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, "LGPS:LTUS:7: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, "1") field(ASG, "NOWRITE") } record(mbbo, "LGPS:LTUS:7: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, "2") field(ASG, "NOWRITE") } record(mbbo, "LGPS:LTUS:7: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, "5") field(ASG, "NOWRITE") } record(mbbo, "LGPS:LTUS:7: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, "0") field(ASG, "NOWRITE") field(FLNK, "LGPS:LTUS:7:TRIMTYPE") } record(stringout, "LGPS:LTUS:7:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "LGPS:LTUS:7:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "LGPS:LTUS:7:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "LGPS:LTUS:7:STATE.RVAL") field(INPB, "LGPS:LTUS:7:INTLKSUMY.RVAL") field(OUT, "LGPS:LTUS:7:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "LGPS:LTUS:7: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, "LGPS:LTUS:7:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "LGPS:LTUS:7:STATE.RVAL") field(INPB, "LGPS:LTUS:7:INTLKSUMY.RVAL") field(OUT, "LGPS:LTUS:7:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "LGPS:LTUS:7:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "LGPS:LTUS:7:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "LGPS:LTUS:7: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, "LGPS:LTUS:7: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, "LGPS:LTUS:7: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, "LGPS:LTUS:7: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,"LGPS:LTUS:7: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("LGPS:LTUS:7:TURNEDOFF",3140,1907,0,1,"LGPS:LTUS:7:TURNEDOFF") #! 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, "LGPS:UNDS:1:IACT") { field(DESC, "Current") field(INP, "PS:UNDS:1:IACT") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "LGPS:UNDS:1:BACT") info(autosaveFields,"HYST") } record(bi, "LGPS:UNDS:1:STATE") { field(DESC, "PS On/Off Status") field(DTYP, "Raw Soft Channel") field(INP, "PS:UNDS:1:STATE CP MS") field(ZSV, "MAJOR") field(ZNAM, "OFF") field(ONAM, "ON") } record(ao, "LGPS:UNDS:1:IDES") { field(DESC, "Desired Current") field(PREC, "3") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(MDEL, "-1") field(HIHI, "50.0") field(LOLO, "0.0") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "LGPS:UNDS:1:BDELTAS") field(DRVH, "50.0") field(DRVL, "0.0") field(DOL, "LGPS:UNDS:1: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, "LGPS:UNDS:1:ICTRL PP") } # This record is processed by LGPS:UNDS:1:ICON") # Note: we are not setting alarms here. record(ao, "LGPS:UNDS:1:ICON") { field(DESC, "Config I") field(DTYP, "Soft Channel") field(PREC, "3") field(HOPR, "50.0") field(LOPR, "0.0") field(DRVH, "50.0") field(DRVL, "0.0") field(DOL, "LGPS:UNDS:1:B2ICON.K") field(OMSL, "closed_loop") info(autosaveFields,"VAL") } record(ao, "LGPS:UNDS:1:INOM") { field(DESC, "Nominal Current") field(DOL, "LGPS:UNDS:1:BNOM.K") field(OMSL, "closed_loop") field(PREC, "3") field(EGU, "Volts") field(DRVH, "50.0") field(DRVL, "0.0") field(HOPR, "50.0") field(LOPR, "0.0") } record(ao, "LGPS:UNDS:1:ICTRL") { field(DESC, "Set Current") field(PREC, "3") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(DRVH, "50.0") field(DRVL, "0.0") field(MDEL, "-1") field(FLNK, "LGPS:UNDS:1:ICTRLGO") field(OMSL, "supervisory") info(autosavefields,"VAL") } record(seq, "LGPS:UNDS:1:ICTRLGO") { field(DESC, "Process Current Setpoint") field(PREC, "3") # Set ISETPT to supervisory field(DOL1, "0") field(LNK1, "LGPS:UNDS:1:ISETPT.OMSL") field(DOL2, "LGPS:UNDS:1:ICTRL") field(LNK2, "LGPS:UNDS:1:ISETPT PP") # Set ISETPT to closed loop - get data from BCTRLSUB.K field(DOL3, "1") field(LNK3, "LGPS:UNDS:1:ISETPT.OMSL") } record(ao, "LGPS:UNDS:1:IMAX") { field(DESC, "Max I") field(DTYP, "Soft Channel") field(DRVH, "50.0") field(DRVL, "0.0") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(PINI, "YES") field(VAL, "50.0") field(FLNK, "LGPS:UNDS:1:IMIN") } record(ao, "LGPS:UNDS:1:IMIN") { field(DESC, "Min I") field(DTYP, "Soft Channel") field(DRVH, "50.0") field(DRVL, "0.0") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(VAL, "0.0") field(FLNK, "LGPS:UNDS:1:IRANGE") } record(sel, "LGPS:UNDS:1:IACTPREVOK") { field(DESC, "Last Good Current") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(NVL, "LGPS:UNDS:1:BACT.SEVR") field(INPA, "LGPS:UNDS:1:IACT NPP MS") field(INPB, "LGPS:UNDS:1:IACTPREVOK NPP MS") field(INPC, "LGPS:UNDS:1:IACTPREVOK NPP MS") field(INPD, "LGPS:UNDS:1:IACTPREVOK NPP MS") } record(sub, "LGPS:UNDS:1:IACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "LGPS:UNDS:1:IDES") field(INPB, "LGPS:UNDS:1:ISETPT.DRVH") field(INPC, "LGPS:UNDS:1:ISETPT.DRVL") field(INPD, "LGPS:UNDS:1:IDELTAS.I") field(INPE, "LGPS:UNDS:1:IDELTAS.J") field(INPG, "LGPS:UNDS:1:STATE") field(INPH, "LGPS:UNDS:1:HSTA") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(sub, "LGPS:UNDS:1:IMONLIMITS") { field(DESC, "Aux Current Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "LGPS:UNDS:1:IDES") field(INPB, "LGPS:UNDS:1:ISETPT.DRVH") field(INPC, "LGPS:UNDS:1:ISETPT.DRVL") field(INPD, "LGPS:UNDS:1:IDELTAS.K") field(INPE, "LGPS:UNDS:1:IDELTAS.L") field(INPG, "LGPS:UNDS:1:STATE") field(INPH, "LGPS:UNDS:1:HSTA") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(seq, "LGPS:UNDS:1:ILIMITS") { field(DESC, "Set ACT and MON Limits") field(PREC, "3") field(DOL1, "LGPS:UNDS:1:BLIMITS") field(LNK1, "LGPS:UNDS:1:IACTLIMITS.F PP") field(DOL2, "LGPS:UNDS:1:IACTLIMITS.I") field(LNK2, "LGPS:UNDS:1:IACT.HIGH") field(DOL3, "LGPS:UNDS:1:IACTLIMITS.J") field(LNK3, "LGPS:UNDS:1:IACT.LOW") field(DOL4, "LGPS:UNDS:1:IACTLIMITS.K") field(LNK4, "LGPS:UNDS:1:IACT.HIHI") field(DOL5, "LGPS:UNDS:1:IACTLIMITS.L") field(LNK5, "LGPS:UNDS:1:IACT.LOLO") field(DOL6, "LGPS:UNDS:1:BLIMITS") field(LNK6, "LGPS:UNDS:1:IMONLIMITS.F PP") field(DOL7, "LGPS:UNDS:1:IMONLIMITS.I") field(LNK7, "LGPS:UNDS:1:IMON.HIGH") field(DOL8, "LGPS:UNDS:1:IMONLIMITS.J") field(LNK8, "LGPS:UNDS:1:IMON.LOW") field(DOL9, "LGPS:UNDS:1:IMONLIMITS.K") field(LNK9, "LGPS:UNDS:1:IMON.HIHI") field(DOLA, "LGPS:UNDS:1:IMONLIMITS.L") field(LNKA, "LGPS:UNDS:1: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, "LGPS:UNDS:1:IDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntRawDeltas") field(INPD, "LGPS:UNDS:1:TRIMBTOL") field(INPE, "LGPS:UNDS:1:CHCKBTOL") field(INPF, "LGPS:UNDS:1:BDELTAS.K") field(INPG, "LGPS:UNDS:1:BDELTAS.L") field(INPH, "LGPS:UNDS:1:B2IDES.L") field(EGU, "Volts") field(HOPR, "1") field(PREC, "3") field(BRSV, "INVALID") # # Used to calcualte standardize tolerance # which is returned in the VAL field. # field(INPB, "LGPS:UNDS:1:STDZITOLR") field(INPC, "LGPS:UNDS:1:STDZITOL") field(FLNK, "") } # All ps controllers with on/off control will set the macro ONOF # as follows: # # ONOF = PS:UNDS:1: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, "LGPS:UNDS:1:STATESETPT") { field(DESC, "PS On/Off") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFF") field(ONAM, "ON") field(OUT, "PS:UNDS:1:STATESETPT PP") 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:UNDS:1:RESET PP # record(bo, "LGPS:UNDS:1:RESET") { field(DESC, "Interlock Latch Reset") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFF") field(ONAM, "ON") field(HIGH, "1.0") field(OUT, "PS:UNDS:1:RESET PP") } record(bo, "LGPS:UNDS:1:RAMPSTATE") { field(DESC, "PS Ramp Status") field(DTYP, "Soft Channel") field(DOL, "PS:UNDS:1:RAMPSTATE") 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, "LGPS:UNDS:1: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, "Volts/sec") field(PREC, "3") # Set default to trim ramp rate on boot # but need to change for degauss function. field(DOL, "LGPS:UNDS:1:TRIMRAMPRATE") field(OUT, "") field(FLNK, "LGPS:UNDS:1:STDZDLY") } record(ao, "LGPS:UNDS:1:ISETPT") { field(DESC, "Current Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(DRVH, "50.0") field(DRVL, "0.0") field(MDEL, "-1") field(OUT, "PS:UNDS:1:ISETPT PP") field(DOL, "LGPS:UNDS:1: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, "LGPS:UNDS:1:IMON") { field(DESC, "Aux Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(INP, "") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "LGPS:UNDS:1:BMON") } record(ao, "LGPS:UNDS:1:IRIPL") { field(DESC, "Ripple Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(DOL, "") field(OMSL, "closed_loop") field(EGU, "Volts") field(DRVH, "1.0") field(HOPR, "1.0") field(PREC, "3") field(FLNK, "LGPS:UNDS:1:IRIPLOK") } record(sub, "LGPS:UNDS:1:IRIPLOK") { field(DESC, "Ripple Current Status") field(INAM, "mgntInit") field(SNAM, "mgntRiplOK") field(INPA, "LGPS:UNDS:1:IRIPL.VAL") field(INPB, "LGPS:UNDS:1: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, "LGPS:UNDS:1:R") { field(DESC, "Resistance") field(EGU, "Ohms") field(PREC, "4") field(PINI, "YES") field(DOL, "") 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, "LGPS:UNDS:1:IGND") { field(DESC, "Ground Current") field(EGU, "Volts") field(PREC, "6") field(PINI, "YES") field(DOL, "") field(OMSL, "closed_loop") } record(bi, "LGPS:UNDS:1:INTLKSUMY") { field(DESC, "Interlock Summary") field(INP, "PS:UNDS:1:INTLKSUMY CP MS") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(ZNAM, "OK") field(ONAM, "FAULT") field(PINI, "NO") } record(mbbo, "LGPS:UNDS:1: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:UNDS:1:COOLING") field(OMSL, "closed_loop") } # The following PV is processed by :BACTFO # which is processed by :BACT record(fanout, "LGPS:UNDS:1:IACTFO") { field(DESC, "IACT processing") field(SELM, "All") field(LNK1, "LGPS:UNDS:1:IACTPREVOK") field(LNK2, "LGPS:UNDS:1:IDIFF") field(LNK3, "LGPS:UNDS:1:IADIFF") field(LNK4, "LGPS:UNDS:1:IRATIO") field(LNK5, "LGPS:UNDS:1:IDIRECT") field(LNK6, "LGPS:UNDS:1:IACTPOL_CHECK") } record(calc, "LGPS:UNDS:1:IDIFF") { field(DESC, "IDES-IACT") field(CALC, "A-B") field(INPA, "LGPS:UNDS:1:IDES") field(INPB, "LGPS:UNDS:1:IACT") field(EGU, "Volts") field(PREC, "9") field(HOPR, "50.0") field(LOPR, "0.0") } record(calc, "LGPS:UNDS:1:IADIFF") { field(DESC, "Absolute IDES-IACT") field(CALC, "A<0?ABS(A):A") field(INPA, "LGPS:UNDS:1:IDIFF") field(PREC, "9") } record(calc, "LGPS:UNDS:1:IRATIO") { field(DESC, "IDES-IACT/IMAX") field(CALC, "B?A/B:0") field(INPA, "LGPS:UNDS:1:IDIFF") field(INPB, "LGPS:UNDS:1:IDES.DRVH") field(PREC, "9") } record(calcout, "LGPS:UNDS:1:IRANGE") { field(DESC, "Current Range") field(PINI, "YES") field(CALC, "ABS(A-B)") field(INPA, "LGPS:UNDS:1:IMIN") field(INPB, "LGPS:UNDS:1: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, "LGPS:UNDS:1: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, "LGPS:UNDS:1:IACT") field(FLNK, "LGPS:UNDS:1:IACTPOL") } record(bo, "LGPS:UNDS:1:IACTPOL") { field(DESC, "Actual I Polarity") field(DTYP, "Raw Soft Channel") field(DOL, "LGPS:UNDS:1: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,"LGPS:UNDS:1:I*LIMITS:\n Calculate alarm and warning limits based on \n deltas from LGPS:UNDS:1:IDELTAS and the\n LGPS:UNDS:1: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,"LGPS:UNDS:1:IACT: \n Get copy of LGPS:UNDS:1:I. \n",null) #! TextBox(TB12,1280,3100,1760,3200,0,"Dialog",12,1,16777215,"LGPS:UNDS:1: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,"LGPS:UNDS:1:IDES:\n Contains raw value calculated by \nLGPS:UNDS:1: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 \nLGPS:UNDS:1:BDELTAS.\n",null) #! TextBox(TB10,56,1940,316,2340,0,"Dialog",12,1,16777215,"LGPS:UNDS:1: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 LGPS:UNDS:1: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 LGPS:UNDS:1: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,"LGPS:UNDS:1:ISETPT:\n Sets the hardware. When fast feedback is set on, this record is\n set to closed loop mode by LGPS:UNDS:1:FBCKSTART sequence. When \n the loop is closed, this record takes input calculated by \n BFBCK only. When fast feedback is set off, LGPS:UNDS:1:FBCKSTOP \n will set it back to supervisory so that the value can be set by \n LGPS:UNDS:1: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, "LGPS:UNDS:1:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "LGPS:UNDS:1:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "LGPS:UNDS:1:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "LGPS:UNDS:1:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "LGPS:UNDS:1:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "LGPS:UNDS:1:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "1") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "LGPS:UNDS:1: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, "LGPS:UNDS:1:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "LGPS:UNDS:1:TRIMTYPE.RVAL") field(INPB, "LGPS:UNDS:1:CONFIG.RVAL") field(OUT, "LGPS:UNDS:1:TRIMMAXNUM PP") } record(longout, "LGPS:UNDS:1: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, "LGPS:UNDS:1:TRIMRAMPRATE") { field(DESC, "Trim Ramp rate ") field(PINI, "YES") field(ASG, "IOC_MAINT") field(PREC, "3") field(EGU, "Volts/sec") field(HOPR, "20.0") field(DRVH, "20.0") field(DRVL, "0.1") field(LOPR, "0.5") # field(DOL, "") field(OMSL, "supervisory") field(VAL, "10") field(OUT, "LGPS:UNDS:1:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "LGPS:UNDS:1: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, "") field(OMSL, "supervisory") field(VAL, "10") } record(bo, "LGPS:UNDS:1: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, "LGPS:UNDS:1: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, "LGPS:UNDS:1:TRIMSTEPMIN") { field(DESC, "Min step in current") field(DTYP, "Soft Channel") # field(DOL, "") field(PREC, "7") field(EGUF, "10") field(EGUL, "0") field(EGU, "Volts") field(HOPR, "10") field(LOPR, "0") field(VAL, "5.0") } record(bo, "LGPS:UNDS:1:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "0") } record(ao, "LGPS:UNDS:1: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, "LGPS:UNDS:1:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "LGPS:UNDS:1: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, "LGPS:UNDS:1: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, "LGPS:UNDS:1:IMOVE") field(INPB, "LGPS:UNDS:1:IACT") field(INPC, "LGPS:UNDS:1:IRAMPRATE") field(INPD, "1.577") field(INPE, "LGPS:UNDS:1:TRIMDLYPCT") field(INPF, "LGPS:UNDS:1:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "LGPS:UNDS:1:RAMPTIME_LEFT PP") } record(longout, "LGPS:UNDS:1:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "LGPS:UNDS:1:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "LGPS:UNDS:1:RAMPDONE_CALC") } record(calc, "LGPS:UNDS:1:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "LGPS:UNDS:1:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "LGPS:UNDS:1:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "LGPS:UNDS:1: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, "LGPS:UNDS:1:RAMPTIME_LEFT") field(OUT, "LGPS:UNDS:1:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "LGPS:UNDS:1:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "LGPS:UNDS:1:RAMPTIME_LEFT NMS") field(OUT, "LGPS:UNDS:1:RAMPDONE PP") } record(bo, "LGPS:UNDS:1:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "LGPS:UNDS:1:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "LGPS:UNDS:1: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, "LGPS:UNDS:1: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, "LGPS:UNDS:1:STDZINIT") { field(DESC, "Proc. Stdz PVs on boot") field(PINI, "YES") field(DOL1, "1") field(DOL2, "1") field(DOL3, "1") field(LNK1, "LGPS:UNDS:1:DEBUG.PROC PP") field(LNK2, "LGPS:UNDS:1:STDZCYCLENUM.PROC PP") field(LNK3, "LGPS:UNDS:1:STDZDISABLE.PROC PP") field(LNK4, "LGPS:UNDS:1: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, "LGPS:UNDS:1:STDZSUB") { field(DESC, "Stdz subroutine") field(INAM, "mgntStdzInit") field(SNAM, "mgntStdz") field(BRSV, "INVALID") field(INPA, "LGPS:UNDS:1:STDZIMIN NPP NMS") field(INPB, "LGPS:UNDS:1:STDZIMAX NPP NMS") field(INPC, "LGPS:UNDS:1:STDZIFINAL NPP NMS") field(INPD, "LGPS:UNDS:1:STDZCYCLENUM NPP NMS") field(INPE, "LGPS:UNDS:1:STDZDIRECT.RVAL NPP NMS") field(INPF, "LGPS:UNDS:1:STDZDISABLE.RVAL CPP NMS") field(INPG, "LGPS:UNDS:1: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, "LGPS:UNDS:1:STDZWF PP") field(OUTB, "LGPS:UNDS:1: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, "LGPS:UNDS:1:STDZWF") } record(mbbo, "LGPS:UNDS:1: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, "LGPS:UNDS:1: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, "LGPS:UNDS:1:STDZMAINPS") { field(DESC, "Stdz by main or self") field(PINI, "YES") field(DTYP, "Soft Channel") field(ZNAM, "SELF") field(ONAM, "MAIN") } record(bo, "LGPS:UNDS:1: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, "LGPS:UNDS:1: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, "LGPS:UNDS:1: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, "LGPS:UNDS:1:STDZTOD") { field(DESC, "Successful Standardize Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "LGPS:UNDS:1:STDZLOSTTOD") { field(DESC, "Standardize Lost Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(longout, "LGPS:UNDS:1:STDZCYCLECNT") { field(DESC, "Cycle Count") field(PINI, "YES") } record(longout, "LGPS:UNDS:1:STDZCYCLENUM") { field(DESC, "No. Standardize Cycles") field(VAL, "3") field(HOPR, "10") field(LOPR, "0") field(DRVH, "10") field(DRVL, "0") field(PINI, "YES") field(FLNK, "LGPS:UNDS:1:STDZDIRECT") } # The default standardize direction is "UP" for # all LCLS Magnets.. record(bo, "LGPS:UNDS:1:STDZDIRECT") { field(DESC, "Standardize Direction ") field(ZNAM, "UP") field(ONAM, "DOWN") field(VAL, "0") field(FLNK, "LGPS:UNDS:1:STDZIMIN") } record(ao, "LGPS:UNDS:1:STDZIMIN") { field(DESC, "Min-STDZ Current") field(PREC, "1") field(EGU, "A") field(HOPR, "50.0") field(LOPR, "0.0") field(VAL, "0.0") field(FLNK, "LGPS:UNDS:1:STDZIMAX") } record(ao, "LGPS:UNDS:1:STDZIMAX") { field(DESC, "Max. Standarize Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "50.0") field(LOPR, "0.0") field(VAL, "50.0") field(FLNK, "LGPS:UNDS:1:STDZIFINAL") } record(ao, "LGPS:UNDS:1:STDZIFINAL") { field(DESC, "Final SDTZ Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "50.0") field(LOPR, "0.0") field(VAL, "0.0") field(FLNK, "LGPS:UNDS:1: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, "LGPS:UNDS:1: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, "LGPS:UNDS:1:STDZITOL") { field(DESC, "Stdz min tolerance") field(PREC, "5") field(CALC, "MAX(ABS(A),ABS(B))*C") field(INPA, "LGPS:UNDS:1:STDZIMIN CP NMS") field(INPB, "LGPS:UNDS:1:STDZIMAX CP MMS") field(INPC, "0.05") field(INPD, "LGPS:UNDS:1:STDZITOLR CP MMS") field(EGU, "A") field(FLNK, "LGPS:UNDS:1:IDELTAS") field(PINI, "YES") } # D - factor (3.154/2 = 1.577) for EPSC, otherwise, set to 1.0 record(calc, "LGPS:UNDS:1:STDZDLY") { field(DESC, "Ramp time for stdz cycle") field(CALC, "C>0?MAX(1,ABS((A-B)/C)*D):0") field(INPA, "LGPS:UNDS:1:STDZIMIN CP NMS") field(INPB, "LGPS:UNDS:1:STDZIMAX CP NMS") field(INPC, "LGPS:UNDS:1:TRIMRAMPRATE CP NMS") field(INPD, "1.0") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") } record(calc, "LGPS:UNDS:1:STDZRAMPDLY") { field(DESC, "Ramp delay total") field(CALC, "MAX(1,((A/100)*B+B))") field(PREC, "5") field(INPA, "LGPS:UNDS:1:TRIMDLYPCT CP MS") field(INPB, "LGPS:UNDS:1: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, "LGPS:UNDS:1:STDZMINIDLY") { field(DESC, "Mini-stdz delay") field(CALC, "A") field(PREC, "5") field(A, "1.0") field(EGU, "sec") field(PINI, "YES") } record(ao, "LGPS:UNDS:1: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, "LGPS:UNDS:1:STDZMINIDELTA") { field(DESC, "Stdz mini % of IMAX") field(CALC, "(B/100)*(A-C)") field(INPA, "LGPS:UNDS:1:IDES.HOPR") field(INPB, "LGPS:UNDS:1:STDZMINIPCT CPP NMS") field(INPC, "LGPS:UNDS:1:IDES.LOPR") field(PREC, "5") } record(calc, "LGPS:UNDS:1:STDZMINISETPT") { field(DESC, "Mini Stdz delta") field(CALC, "C==0?MAX(E-D,B):MIN(E+D,A)") field(INPA, "LGPS:UNDS:1:IDES.HOPR") field(INPB, "LGPS:UNDS:1:IDES.LOPR") field(INPC, "LGPS:UNDS:1:STDZDIRECT.RVAL") field(INPD, "LGPS:UNDS:1:STDZMINIDELTA") field(INPE, "LGPS:UNDS:1:IDES") field(PREC, "5") field(FLNK, "LGPS:UNDS:1: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, "LGPS:UNDS:1:STDZMINISETPTOOR") { field(DESC, "Mini Stdz setpoint out of range") field(CALC, "C==0?(E-DA)") field(INPA, "LGPS:UNDS:1:IDES.HOPR") field(INPB, "LGPS:UNDS:1:IDES.LOPR") field(INPC, "LGPS:UNDS:1:STDZDIRECT.RVAL") field(INPD, "LGPS:UNDS:1:STDZMINIDELTA") field(INPE, "LGPS:UNDS:1: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, "LGPS:UNDS:1: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, "LGPS:UNDS:1:IADJUST.RVAL") field(INPB, "LGPS:UNDS:1:STDZDIRECT.RVAL") field(INPC, "LGPS:UNDS:1:STDZOK.RVAL") field(INPD, "LGPS:UNDS:1:STDZDISABLE.RVAL") field(INPE, "LGPS:UNDS:1:STATE.RVAL CPP NMS") field(INPF, "LGPS:UNDS:1:ICTRL.RVAL") field(INPG, "LGPS:UNDS:1:STATE.SEVR") field(INPH, "LGPS:UNDS:1:BDELTAS.M") field(INPI, "LGPS:UNDS:1:IACT.SEVR") field(OUT, "LGPS:UNDS:1:STDZLOSTGO.SELN PP NMS") field(OOPT, "Transition To Non-zero") } record(seq, "LGPS:UNDS:1:STDZLOSTGO") { field(DESC, "Process lost stdz") field(SELM, "Mask") field(DOL1, "1") field(DOL2, "0") field(LNK1, "LGPS:UNDS:1:STDZLOSTTOD.PROC") field(LNK2, "LGPS:UNDS:1:STDZOK PP") } # Record maximum current after standardize # Reset to IACT from sequence after trim # Disable processing during (mini-)standardize or trim record(calc, "LGPS:UNDS:1:STDZIACTMAX") { field(DESC, "Max act current after stdz") field(CALC, "MAX(A, B)") field(DISV, "0") field(SDIS, "LGPS:UNDS:1:CHECKPWRDIP_ENABLE") field(INPA, "LGPS:UNDS:1:IACT CP") field(INPB, "LGPS:UNDS:1:STDZIACTMAX") field(EGU, "A") field(FLNK, "LGPS:UNDS:1:CHECKPWRDIP") } # Detect power dip if STDZOK is YES, STDZ is enabled, and IACT is valid # If IACT drops below STDZIACTMAX by more than the trim tolerance, clear STDZOK # Warning: Take the absolute value of the trim tolerance, or else quads of # negative polarity will always lose STDZ since their IDELTAS.I are negative. # Note: Large quads and bends are prone to losing STDZ even if they are # perturbed toward higher current since their current tends to overshoot # by greater than the trim tolerance before settling down. record(calcout, "LGPS:UNDS:1:CHECKPWRDIP") { field(DESC, "Detect power dip") field(CALC, "(A-B>ABS(C))?3:0") field(DISV, "0") field(SDIS, "LGPS:UNDS:1:CHECKPWRDIP_ENABLE") field(INPA, "LGPS:UNDS:1:STDZIACTMAX") field(INPB, "LGPS:UNDS:1:IACT") field(INPC, "LGPS:UNDS:1:IDELTAS.I") field(OUT, "LGPS:UNDS:1:STDZLOSTGO.SELN PP NMS") field(OOPT, "When Non-zero") } # Enable processing of STDZIACTMAX and CHECKPWRDIP only if # STDZOK = YES, STDZDISABLE = NO, CTRL != Trim (2), and # CTRL != Stdz (4) record(calc, "LGPS:UNDS:1:CHECKPWRDIP_ENABLE") { field(CALC, "A&&!B&&(C#2)&&(C#4)") field(INPA, "LGPS:UNDS:1:STDZOK.RVAL CP") field(INPB, "LGPS:UNDS:1:STDZDISABLE.RVAL CP") field(INPC, "LGPS:UNDS:1:CTRL.RVAL CP") } #! 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, "LGPS:UNDS:1: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, "LGPS:UNDS:1: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, "LGPS:UNDS:1:CALBSET") { field(DESC, "Use DAC Calbration") field(SCAN, "10 second") field(CALC, "A&&(B==0)&&C?31:960") field(INPA, "LGPS:UNDS:1:CALBOK") field(INPB, "LGPS:UNDS:1:CALBDISABLE") field(INPC, "LGPS:UNDS:1:CALBSLOPE") field(OOPT, "On Change") field(OUT, "LGPS:UNDS:1: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, "LGPS:UNDS:1:CALB_SEQ") { field(DESC, "Output Calib Values") field(SELM, "Mask") field(SELL, "LGPS:UNDS:1: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, "LGPS:UNDS:1:CALBSLOPE") field(DOL3, "LGPS:UNDS:1: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, "LGPS:UNDS:1:CALBTOD") { field(DESC, "Calibration Success Time") field(PINI, "YES") # field(DOL, "") field(OMSL, "supervisory") field(DTYP, "Soft Channel") info(autosaveFields,"VAL") } record(ao, "LGPS:UNDS:1: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, "LGPS:UNDS:1: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, "LGPS:UNDS:1: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, "LGPS:UNDS:1:CALBOFFSET") { field(DESC, "Calc DAC Offset") field(PREC, "6") field(EGU, "Counts") field(PINI, "YES") } record(bo, "LGPS:UNDS:1: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, "LGPS:UNDS:1:DACSLOPE") { field(DESC, "V to DAC slope") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "supervisory") field(PINI, "YES") field(FLNK, "LGPS:UNDS:1:DACOFFSET") } # Default Offset used in conversion from Volts to DAC Counts record(ao, "LGPS:UNDS:1:DACOFFSET") { field(DESC, "V to DAC offset") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "supervisory") field(PINI, "YES") field(FLNK, "LGPS:UNDS:1: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, "LGPS:UNDS:1: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, "LGPS:UNDS:1:IACT") field(INPD, "LGPS:UNDS:1:DACSLOPE") field(INPE, "LGPS:UNDS:1:DACOFFSET") field(EGU, "Counts") field(PREC, "6") } record(ao, "LGPS:UNDS:1:DAC") { field(DESC, "DAC Set point") field(EGU, "Counts") field(DOL, "") field(OMSL, "supervisory") field(PREC, "6") field(PINI, "YES") } record(ao, "LGPS:UNDS:1:CALBIMIN") { field(DESC, "Calibration Min Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(DRVH, "50.0") field(HOPR, "50.0") field(DRVL, "0.0") field(LOPR, "0.0") field(PREC, "3") field(EGU, "A") field(VAL, "0.0") field(FLNK, "LGPS:UNDS:1:CALBIMAX") } record(ao, "LGPS:UNDS:1:CALBIMAX") { field(DESC, "Calibration Max Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(DRVH, "50.0") field(HOPR, "50.0") field(LOPR, "0.0") field(DRVL, "0.0") field(EGU, "A") field(VAL, "50.0") field(FLNK, "LGPS:UNDS:1:CALBSTEPNUM") } record(ao, "LGPS:UNDS:1:CALBIFINAL") { field(DESC, "Calibration Last Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(PREC, "3") field(EGU, "A") field(HOPR, "50.0") field(LOPR, "0.0") field(VAL, "0") } record(longout, "LGPS:UNDS:1: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, "LGPS:UNDS:1:CALBIDELTA") } record(calc, "LGPS:UNDS:1:CALBIDELTA") { field(DESC, "Step size for CALB") field(CALC, "C=0?0:ABS((A-B)/C)") field(INPA, "LGPS:UNDS:1:CALBIMAX") field(INPB, "LGPS:UNDS:1:CALBIMIN") field(INPC, "LGPS:UNDS:1: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, "LGPS:UNDS:1:CALBIMULT") { field(DESC, "IACT vs ISETPT mult") field(CALC, "C#0||A=0?1:ABS(B/A)") field(INPA, "PS:UNDS:1:ISETPT.DRVH") field(INPB, "PS:UNDS:1:IACT.HOPR") field(INPC, "LGPS:UNDS:1:PSCONTROLLER.RVAL CPP") field(EGU, "A") field(PINI, "YES") } # SNL dbputs DAC values here. 6-10 steps are possible. record(waveform, "LGPS:UNDS:1:CALBICTRLWF") { field(DESC, "ICTRL setpoint array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") } record(waveform, "LGPS:UNDS:1:DACWF") { field(DESC, "DAC count array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "LGPS:UNDS:1:DACSA") } # Used only for xygraph edm plot record(subArray, "LGPS:UNDS:1:DACSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "LGPS:UNDS:1: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, "LGPS:UNDS:1:CALCDACWF") { field(DESC, "Calc DAC counts array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "LGPS:UNDS:1:CALCDACSA") } # Used only for xygraph edm plot record(subArray, "LGPS:UNDS:1:CALCDACSA") { field(DESC, "Calc DAC counts") field(DTYP, "Soft Channel") field(INP, "LGPS:UNDS:1: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, "LGPS:UNDS:1:CALBYWF") { field(DESC, "mx + b") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "LGPS:UNDS:1:CALBYSA") } # Used only for xygraph edm plot record(subArray, "LGPS:UNDS:1:CALBYSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "LGPS:UNDS:1:CALBYWF") field(MALM, "10") field(NELM, "6") field(INDX, "0") field(FTVL, "DOUBLE") } record(waveform, "LGPS:UNDS:1:CALBIACTWF") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "LGPS:UNDS:1:CALBIACTSA") } # Used only for xygraph edm plot record(subArray, "LGPS:UNDS:1:CALBIACTSA") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(MALM, "10") field(NELM, "6") field(INP, "LGPS:UNDS:1:CALBIACTWF") field(INDX, "0") field(FTVL, "DOUBLE") field(FLNK, "LGPS:UNDS:1:CALBLIMITS") } # Check that measured current during calibration is within # tolerance. record(aSub, "LGPS:UNDS:1: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, "LGPS:UNDS:1:CALBSTEPNUM") field(INPB, "LGPS:UNDS:1:CALBIACTWF") field(INPC, "LGPS:UNDS:1: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, "LGPS:UNDS:1: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, "LGPS:UNDS:1:STDZITOL") field(INPH, "LGPS:UNDS:1:DACSLOPE") field(INPI, "LGPS:UNDS:1: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, "LGPS:UNDS:1: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, "LGPS:UNDS:1:CALBSTEPNUM") field(INPB, "LGPS:UNDS:1:CALBIACTWF") field(INPC, "LGPS:UNDS:1:DACWF") field(INPF, "LGPS:UNDS:1: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 LGPS:UNDS:1CALBOK 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, "LGPS:UNDS:1:DEGAUSINIT") { field(DESC, "Proc. Degauss PVs on boot") field(PINI, "YES") field(DOL, "1") field(OUTA, "LGPS:UNDS:1:DEGAUSIMIN.PROC PP") field(OUTB, "LGPS:UNDS:1:DEGAUSIMAX.PROC PP") field(OUTC, "LGPS:UNDS:1:DEGAUSTYPE.PROC PP") field(OUTD, "LGPS:UNDS:1:DEGAUSSTEP.PROC PP") field(OUTE, "LGPS:UNDS:1:MADNAME.PROC PP") field(OUTF, "LGPS:UNDS:1:PSTYPE.PROC PP") field(OUTG, "LGPS:UNDS:1: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, "LGPS:UNDS:1:DEGAUSSUB") { field(DESC, "Degauss subroutine") field(INAM, "mgntDegaussInit") field(SNAM, "mgntDegauss") field(BRSV, "INVALID") field(INPA, "LGPS:UNDS:1:DEGAUSIMIN NPP NMS") field(INPB, "LGPS:UNDS:1:DEGAUSIMAX NPP NMS") field(INPC, "LGPS:UNDS:1:DEGAUSTYPE.RVAL NPP NMS") field(INPE, "LGPS:UNDS:1:DEGAUSMETHOD.RVAL NPP NMS") field(INPF, "LGPS:UNDS:1:PSTYPE NPP NMS") field(INPG, "LGPS:UNDS:1:DEBUG.RVAL NPP NMS") field(INPH, "LGPS:UNDS:1: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, "LGPS:UNDS:1:DEGAUSWF PP") field(OUTB, "LGPS:UNDS:1:DEGAUSMSG PP") field(OUTC, "LGPS:UNDS:1: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, "LGPS:UNDS:1:DEGAUSWF") { field(DESC, "Degauss Setpts") field(NELM, "60") field(FTVL, "DOUBLE") } record(mbbo,"LGPS:UNDS:1: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, "LGPS:UNDS:1: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, "LGPS:UNDS:1: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, "LGPS:UNDS:1: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, "LGPS:UNDS:1: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, "LGPS:UNDS:1:DEGAUSIMIN") { field(DESC, "Min. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "50.0") field(LOPR, "-50.0") field(DRVH, "50.0") field(DRVL, "-50.0") field(VAL, "-50.0") } record(ao, "LGPS:UNDS:1:DEGAUSIMAX") { field(DESC, "Max. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "50.0") field(LOPR, "-50.0") field(DRVH, "50.0") field(DRVL, "-50.0") field(VAL, "50.0") } # 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,"LGPS:UNDS:1: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, "LGPS:UNDS:1: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,"LGPS:UNDS:1: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, "LGPS:UNDS:1: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, "LGPS:UNDS:1: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, "LGPS:UNDS:1: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, "LGPS:UNDS:1:DEGAUSTOD") { field(DESC, "Successful Degauss Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "LGPS:UNDS:1:DEGAUSLOSTTOD") { field(DESC, "Degauss Lost Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "LGPS:UNDS:1:DEGAUSTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "LGPS:UNDS:1:DEGAUSTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "LGPS:UNDS:1: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, "LGPS:UNDS:1:DEGAUSGO") { field(DESC, "Set bdes of btrms to zero") field(ASG, "Internal") field(OUTA, "") field(OUTB, "") field(OUTC, "") field(OUTD, "") } # =========== CRYO ONLY =========== record(bo, "LGPS:UNDS:1: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, "LGPS:UNDS:1:DEGAUS_IMAX_CHECK") { field(DESC, "Check if imax shoud chg") field(CALC, "(C==4)&&(ABS(B)>ABS(A))?1:0") field(INPA, "LGPS:UNDS:1:DEGAUS_IMAX") field(INPB, "LGPS:UNDS:1:ISETPT") field(INPC, "LGPS:UNDS:1:DEGAUSTYPE.RVAL") field(OUT, "LGPS:UNDS:1:DEGAUS_IMAX_UPDATE.SELN") field(FLNK, "LGPS:UNDS:1:DEGAUS_IMAX_UPDATE") } record(seq, "LGPS:UNDS:1:DEGAUS_IMAX_UPDATE") { field(DESC, "Degauss IMAX Update") field(SELM, "Specified") field(DOL1, "LGPS:UNDS:1:ISETPT") field(LNK1, "LGPS:UNDS:1:DEGAUS_IMAX PP") } # Set the maximum current after a successful # degauss. This pv is updated by the # sequence. record(ao, "LGPS:UNDS:1:DEGAUS_IMAX") { field(DESC, "Max I set afer a degauss") field(EGU, "Amps") field(PINI, "YES") field(PREC, "6") field(HOPR, "50.0") field(LOPR, "-50.0") field(DRVH, "50.0") field(DRVL, "-50.0") field(VAL, "50.0") field(FLNK, "LGPS:UNDS:1:DEGAUS_IMAXPOL_CHECK") info(autosaveFields,"VAL,RVAL") } # Set the polarity if degauss_imax record(calcout, "LGPS:UNDS:1:DEGAUS_IMAXPOL_CHECK") { field(DESC, "Determine polarity of imax") field(CALC, "A>=0?0:1") field(INPA, "LGPS:UNDS:1:DEGAUS_IMAX") field(FLNK, "LGPS:UNDS:1:DEGAUS_IMAXPOL") } record(bo, "LGPS:UNDS:1:DEGAUS_IMAXPOL") { field(DESC, "Polarity of imax I") field(DTYP, "Raw Soft Channel") field(DOL, "LGPS:UNDS:1:DEGAUS_IMAXPOL_CHECK") field(OMSL, "closed_loop") field(ZNAM, "Positive") field(ONAM, "Negative") field(FLNK, "LGPS:UNDS:1: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, "LGPS:UNDS:1:DEGAUS_ABSIMAX") { field(DESC, "Absolute Max. Degauss I") field(CALC, "ABS(A)") field(INPA, "LGPS:UNDS:1:DEGAUS_IMAX") field(PREC, "6") field(EGU, "Amps") field(HOPR, "50.0") field(LOPR, "-50.0") info(autosaveFields,"VAL RVAL") } # IACT Polarity record(calcout, "LGPS:UNDS:1:IACTPOL_CHECK") { field(DESC, "Determine IACT polarity") field(SCAN, "5 second") field(CALC, "ABS(A-B)>C?(A>=0?0:1):D") field(INPA, "LGPS:UNDS:1:IACT") field(INPB, "LGPS:UNDS:1:IACTPOL_CHECK.LA") field(INPC, "0.0001") field(INPD, "LGPS:UNDS:1:IACTPOL_CHECK.PVAL") field(OOPT, "On Change") field(FLNK, "LGPS:UNDS:1:IACTPOL") } record(bo, "LGPS:UNDS:1: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,"LGPS:UNDS:1: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, "LGPS:UNDS:1:DEGAUSENABLE CP") field(INPB, "LGPS:UNDS:1:DEGAUSOK") field(INPC, "LGPS:UNDS:1:STATE CP") field(INPD, "LGPS:UNDS:1:STATE.SEVR") field(OUT, "LGPS:UNDS:1:DEGAUS_STATE_SEQ.SELN PP") field(ASG, "Internal") } record(seq, "LGPS:UNDS:1:DEGAUS_STATE_SEQ") { field(DESC, "Degauss State Sequence") field(SELM, "Specified") field(SELL, "LGPS:UNDS:1:DEGAUS_STATE_CHECK") field(LNK1, "LGPS:UNDS:1:DEGAUS_STATE_DISABLE.PROC PP") field(LNK2, "LGPS:UNDS:1:DEGAUS_STATE_LOST.PROC PP") field(LNK3, "LGPS:UNDS:1:DEGAUS_STATE_GOOD.PROC PP") field(LNK4, "LGPS:UNDS:1: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, "LGPS:UNDS:1:DEGAUS_STATE_DISABLE") { field(DESC, "Degauss not used") field(LNK1, "LGPS:UNDS:1:DEGAUSOK.ZSV") field(LNK2, "LGPS:UNDS:1: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, "LGPS:UNDS:1:STATMSG.FRSV") field(LNK4, "LGPS:UNDS:1: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, "LGPS:UNDS:1:DEGAUS_STATE_LOST") { field(DESC, "Degauss lost and ps On") field(DOL1, "1") field(LNK1, "LGPS:UNDS:1:DEGAUSOK.ZSV") field(LNK2, "LGPS:UNDS:1: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, "LGPS:UNDS:1:STATMSG.FRSV") field(LNK4, "LGPS:UNDS:1: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, "LGPS:UNDS:1:DEGAUS_STATE_OFF") { field(DESC, "Degaused lost and ps Off") field(DOL1, "2") field(LNK1, "LGPS:UNDS:1: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, "LGPS:UNDS:1:STATMSG.FRSV") field(LNK3, "LGPS:UNDS:1: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, "LGPS:UNDS:1:DEGAUS_STATE_GOOD") { field(DESC, "Degauss good") field(DOL1, "1") field(LNK1, "LGPS:UNDS:1: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, "LGPS:UNDS:1:STATMSG.FRSV PP") field(LNK3, "LGPS:UNDS:1:STATMSG.FVSV PP") field(LNK4, "") field(ASG, "Internal") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(mbbo, "LGPS:UNDS:1:FUNC") { field(DESC, "LGPS:UNDS:1 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, "1") field(NIVL, "2") field(TEVL, "3") field(ELVL, "0") field(TVVL, "0") field(TTVL, "0") field(FTVL, "0") field(FFVL, "0") field(OUT, "LGPS:UNDS:1:CTRL CA") } # :CTRL pv is processed at boot in the # sequence mgntCtrl.st Processed in sequence # record(mbbo, "LGPS:UNDS:1:CTRL") { field(DESC, "LGPS:UNDS:1 Control") field(PINI, "NO") field(ZRST, "Ready") field(ONST, "RESET") field(TWST, "TURN_ON") field(THST, "TURN_OFF") 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, "8") field(TWVL, "9") field(THVL, "10") 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, "LGPS:UNDS:1:SELECTEN.A PP") field(SDIS, "0") } # If a function has been selected set this unit to busy record(calcout, "LGPS:UNDS:1:SELECTEN") { field(DESC, "Control Select Enable") field(CALC, "A>0?1:A") field(FLNK, "LGPS:UNDS:1:BUSY") } # Set to FREE on IOC reboot record(bo, "LGPS:UNDS:1:BUSY") { field(DESC, "LGPS:UNDS:1 Ctrl Done") field(DOL, "LGPS:UNDS:1:SELECTEN") field(ZNAM, "FREE") field(ONAM, "BUSY") field(PINI, "YES") field(FLNK, "LGPS:UNDS:1:SELECT") } record(bo, "LGPS:UNDS:1:SELECT") { field(ZNAM, "NO") field(ONAM, "YES") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") } record(bo, "LGPS:UNDS:1: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, "LGPS:UNDS:1:CTRLSTATE") { field(DESC, "LGPS:UNDS:1 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("LGPS:UNDS:1:CTRL",20,20,0,0,"LGPS:UNDS:1:CTRL") #! Field("LGPS:UNDS:1:CTRL.OUT",16777215,1,"LGPS:UNDS:1:CTRL.OUT") #! Link("LGPS:UNDS:1:CTRL.OUT","LGPS:UNDS:1:SELECTEN.A") #! Field("LGPS:UNDS:1:CTRL.VAL",16777215,1,"LGPS:UNDS:1:CTRL.VAL") #! Record("LGPS:UNDS:1:SELECTEN",321,381,0,0,"LGPS:UNDS:1:SELECTEN") #! Field("LGPS:UNDS:1:SELECTEN.A",16777215,0,"LGPS:UNDS:1:SELECTEN.A") #! Field("LGPS:UNDS:1:SELECTEN.FLNK",16777215,1,"LGPS:UNDS:1:SELECTEN.FLNK") #! Link("LGPS:UNDS:1:SELECTEN.FLNK","LGPS:UNDS:1:BUSY") #! Field("LGPS:UNDS:1:SELECTEN.VAL",16777215,1,"LGPS:UNDS:1:SELECTEN.VAL") #! Record("LGPS:UNDS:1:BUSY",623,274,0,0,"LGPS:UNDS:1:BUSY") #! Field("LGPS:UNDS:1:BUSY.DOL",16777215,0,"LGPS:UNDS:1:BUSY.DOL") #! Link("LGPS:UNDS:1:BUSY.DOL","LGPS:UNDS:1:SELECTEN.VAL") #! Field("LGPS:UNDS:1:BUSY.FLNK",16777215,1,"LGPS:UNDS:1:BUSY.FLNK") #! Link("LGPS:UNDS:1:BUSY.FLNK","LGPS:UNDS:1:SELECT") #! Record("LGPS:UNDS:1:SELECT",669,508,0,1,"LGPS:UNDS:1:SELECT") #! Record("LGPS:UNDS:1:FUNC",940,120,0,0,"LGPS:UNDS:1:FUNC") #! Field("LGPS:UNDS:1:FUNC.OUT",16777215,0,"LGPS:UNDS:1:FUNC.OUT") #! Link("LGPS:UNDS:1:FUNC.OUT","LGPS:UNDS:1:CTRL.VAL") #! Record("LGPS:UNDS:1:ABORT",193,41,0,0,"LGPS:UNDS:1:ABORT") #! Record("LGPS:UNDS:1:CTRLSTATE",369,34,0,0,"LGPS:UNDS:1: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,"LGPS:UNDS:1:SELECT is used for Multi-device selection.\nIt is enabled when associated LGPS:UNDS:1:CTRL is \"0\" (DONE).\nIt is disabled when associated LGPS:UNDS:1: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,"LGPS:UNDS:1: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, "LGPS:UNDS:1:BCTRL_INIT") { field(DESC, "Process BCTRL on boot") field(PINI, "YES") field(CALC, "A=3?1:0") field(INPA, "LGPS:UNDS:1:BCTRL.SEVR") field(OUT, "LGPS:UNDS:1: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, "LGPS:UNDS:1:BACT") { field(DESC, "Actual B") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "LGPS:UNDS:1:BACT") field(INPB, "LGPS:UNDS:1:POLYCOEF") field(INPC, "LGPS:UNDS:1:POLYCOEF.A") field(INPD, "LGPS:UNDS:1:POLYCOEF.B") field(INPE, "LGPS:UNDS:1:IACT MS") field(INPF, "LGPS:UNDS:1:BDELTAS PP") field(INPG, "100") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(HIHI, "50.0") field(LOLO, "0.0") field(PREC, "3") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "50.0") field(LOW, "0.0") field(FLNK, "LGPS:UNDS:1: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, "LGPS:UNDS:1:BDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntPhyDeltas") field(EGU, "Volts") field(HOPR, "1") field(PREC, "3") field(BRSV, "INVALID") field(INPA, "LGPS:UNDS:1:BDES") field(INPB, "LGPS:UNDS:1:TRIMBTOL") field(INPC, "LGPS:UNDS:1:TRIMBTOLR") field(INPD, "LGPS:UNDS:1:CHCKBTOL") field(INPE, "LGPS:UNDS:1:CHCKBTOLR") field(F, "0.0") field(INPG, "30") field(INPH, "LGPS:UNDS:1:BACT.VAL") # # MPS absolute and relative tolerances field(INPP, "LGPS:UNDS:1:MPSBTOL") field(INPQ, "LGPS:UNDS:1:MPSBTOLR") field(FLNK, "LGPS:UNDS:1:BCONLIMITS") info(autosaveFields,"F") } # This record is processed by BDELTAS record(aSub, "LGPS:UNDS:1:BCONLIMITS") { field(DESC, "Config B-field Limits") field(INAM, "mgntInit") field(SNAM, "mgntBCONLimits") field(INPA, "LGPS:UNDS:1:BDES") field(INPB, "LGPS:UNDS:1:BDELTAS.I") field(INPG, "LGPS:UNDS:1:DEBUG.RVAL") field(FTA, "DOUBLE") field(FTB, "DOUBLE") field(FTG, "ULONG") field(OUTA, "LGPS:UNDS:1:BCON.HIGH") field(OUTB, "LGPS:UNDS:1:BCON.LOW") field(OUTC, "LGPS:UNDS:1:BCON.HIHI") field(OUTD, "LGPS:UNDS:1:BCON.LOLO PP") field(FTVA, "DOUBLE") field(FTVB, "DOUBLE") field(FTVC, "DOUBLE") field(FTVD, "DOUBLE") field(BRSV, "INVALID") field(FLNK, "LGPS:UNDS:1:IDELTAS") } # The following PV is processed by :BACT # which is processed by :BACT # record(fanout, "LGPS:UNDS:1:BACTFO") { field(DESC, "BACT processing") field(SELM, "All") field(LNK1, "LGPS:UNDS:1:BDIFF") field(LNK2, "LGPS:UNDS:1:BADIFF") field(LNK3, "LGPS:UNDS:1:BRATIO") field(LNK4, "LGPS:UNDS:1:MPSLIMITS") field(LNK5, "LGPS:UNDS:1:I2BSTATUS") field(LNK6, "LGPS:UNDS:1:IACTFO.PROC") } record(calc, "LGPS:UNDS:1:BDIFF") { field(DESC, "BDES-BACT") field(CALC, "A-B") field(INPA, "LGPS:UNDS:1:BDES") field(INPB, "LGPS:UNDS:1:BACT") field(EGU, "Volts") field(PREC, "7") } record(calc, "LGPS:UNDS:1:BADIFF") { field(DESC, "Absolute BDES-BACT") field(INPA, "LGPS:UNDS:1:BDIFF") field(EGU, "Volts") field(PREC, "7") field(CALC, "A<0?ABS(A):A") } record(calc, "LGPS:UNDS:1:BRATIO") { field(DESC, "BACT Error") field(CALC, "B?A/B:0") field(INPA, "LGPS:UNDS:1:BDIFF") field(INPB, "LGPS:UNDS:1:BDES.HOPR") field(EGU, "Volts") field(PREC, "7") } record(mbbi, "LGPS:UNDS:1: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, "LGPS:UNDS:1:BACT.J") } # Note: for a string slave set the MONFL # macro to the following: # MONFL=:IMONCALC MS record(sub, "LGPS:UNDS:1:BMON") { field(DESC, "Second Transductor") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "LGPS:UNDS:1:BMON") field(INPB, "LGPS:UNDS:1:POLYCOEF") field(INPC, "LGPS:UNDS:1:POLYCOEF.A") field(INPD, "LGPS:UNDS:1:POLYCOEF.B") field(INPE, "LGPS:UNDS:1:IMON MS") field(INPF, "LGPS:UNDS:1:BDELTAS.VAL") field(INPG, "100") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(HIHI, "50.0") field(LOLO, "0.0") field(PREC, "3") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "50.0") field(LOW, "0.0") } # 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:UNDS:1:BDES CP record(ao, "LGPS:UNDS:1:BDES") { field(DESC, "Desired B-Field") field(PINI, "YES") field(DRVH, "50.0") field(DRVL, "0.0") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(EGU, "Volts") field(MDEL, "-1") field(OMSL, "closed_loop") field(DOL, "LGPS:UNDS:1:BDES.DRVH") field(OUT, "LGPS:UNDS:1:B2IDES PP") info(autosaveFields,"VAL") } record(sub, "LGPS:UNDS:1:B2IDES") { field(DESC, "Convert Desired B-Field to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "LGPS:UNDS:1:POLYCOEF") field(INPC, "LGPS:UNDS:1:POLYCOEF.A") field(INPD, "LGPS:UNDS:1:POLYCOEF.B") field(PREC, "3") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(MDEL, "-1") field(INPE, "LGPS:UNDS:1:BDES.DRVH") field(INPF, "LGPS:UNDS:1:BDES.DRVL") field(BRSV, "INVALID") field(FLNK, "LGPS:UNDS:1:IDES") } record(sub, "LGPS:UNDS:1:BNOM") { field(DESC, "Nominal Field") field(PINI, "YES") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "LGPS:UNDS:1:POLYCOEF") field(INPC, "LGPS:UNDS:1:POLYCOEF.A") field(INPD, "LGPS:UNDS:1:POLYCOEF.B") field(INPE, "LGPS:UNDS:1:BDES.DRVH") field(INPF, "LGPS:UNDS:1:BDES.DRVL") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(VAL, "0.0") field(FLNK, "LGPS:UNDS:1:INOM") } record(sub, "LGPS:UNDS:1:BACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "LGPS:UNDS:1:BDES.VAL") field(INPB, "LGPS:UNDS:1:BDES.DRVH") field(INPC, "LGPS:UNDS:1:BDES.DRVL") field(INPD, "LGPS:UNDS:1:BDELTAS.I") field(INPE, "LGPS:UNDS:1:BDELTAS.J") field(INPG, "LGPS:UNDS:1:STATE") field(INPH, "LGPS:UNDS:1:HSTA") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(sub, "LGPS:UNDS:1:BMONLIMITS") { field(DESC, "MON Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "LGPS:UNDS:1:BDES.VAL") field(INPB, "LGPS:UNDS:1:BDES.DRVH") field(INPC, "LGPS:UNDS:1:BDES.DRVL") field(INPD, "LGPS:UNDS:1:BDELTAS.K") field(INPE, "LGPS:UNDS:1:BDELTAS.L") field(INPG, "LGPS:UNDS:1:STATE") field(INPH, "LGPS:UNDS:1:HSTA") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(seq, "LGPS:UNDS:1:BLIMITS") { field(DESC, "ACT Limits") field(PREC, "3") field(DOL1, "LGPS:UNDS:1:BLIMITS") field(LNK1, "LGPS:UNDS:1:BACTLIMITS.F PP") field(DOL2, "LGPS:UNDS:1:BACTLIMITS.I") field(LNK2, "LGPS:UNDS:1:BACT.HIGH") field(DOL3, "LGPS:UNDS:1:BACTLIMITS.J") field(LNK3, "LGPS:UNDS:1:BACT.LOW") field(DOL4, "LGPS:UNDS:1:BACTLIMITS.K") field(LNK4, "LGPS:UNDS:1:BACT.HIHI") field(DOL5, "LGPS:UNDS:1:BACTLIMITS.L") field(LNK5, "LGPS:UNDS:1:BACT.LOLO") field(DOL6, "LGPS:UNDS:1:BLIMITS") field(LNK6, "LGPS:UNDS:1:BMONLIMITS.F PP") field(DOL7, "LGPS:UNDS:1:BMONLIMITS.I") field(LNK7, "LGPS:UNDS:1:BMON.HIGH") field(DOL8, "LGPS:UNDS:1:BMONLIMITS.J") field(LNK8, "LGPS:UNDS:1:BMON.LOW") field(DOL9, "LGPS:UNDS:1:BMONLIMITS.K") field(LNK9, "LGPS:UNDS:1:BMON.HIHI") field(DOLA, "LGPS:UNDS:1:BMONLIMITS.L") field(LNKA, "LGPS:UNDS:1:BMON.LOLO") field(FLNK, "LGPS:UNDS:1:ILIMITS") field(SCAN, "5 second") } record(ao, "LGPS:UNDS:1:BCTRL") { field(DESC, "B-Perturb") field(PREC, "3") field(EGU, "Volts") field(DRVH, "50.0") field(DRVL, "0.0") field(HOPR, "50.0") field(LOPR, "0.0") # 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, "LGPS:UNDS:1: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, "LGPS:UNDS:1:BCTRLGO") { field(DESC, "Update DES and perturb") field(PREC, "3") # Disable BACT limits field(DOL1, "1") field(LNK1, "LGPS:UNDS:1:BLIMITS.VAL") # Update BDES with the BCTRL (slider) value field(DOL2, "LGPS:UNDS:1:BCTRL.VAL") field(LNK2, "LGPS:UNDS:1:BDES PP") field(DOL3, "1") field(LNK3, "LGPS:UNDS:1:IDIRECT.PROC PP") field(DOL4, "1") field(LNK4, "LGPS:UNDS:1:CHECKSTDZLOST.PROC PP") field(DOL5, "LGPS:UNDS:1:BCTRL.VAL") field(LNK5, "LGPS:UNDS:1:BCTRLSUB PP") # Re-enable BACT limits field(DOL6, "0") field(LNK6, "LGPS:UNDS:1:BLIMITS.VAL") } # Convert B-field to Current and output to ISETPT record(sub, "LGPS:UNDS:1:BCTRLSUB") { field(DESC, "Feedback") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "LGPS:UNDS:1:POLYCOEF") field(INPC, "LGPS:UNDS:1:POLYCOEF.A") field(INPD, "LGPS:UNDS:1:POLYCOEF.B") field(INPE, "LGPS:UNDS:1:BDES.DRVH") field(INPF, "LGPS:UNDS:1:BDES.DRVL") field(PREC, "3") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(MDEL, "-1") field(BRSV, "INVALID") field(FLNK, "LGPS:UNDS:1:ISETPT") } record(ao, "LGPS:UNDS:1:BDESPREVTRIM") { field(DESC, "trim bdes for undo") field(DTYP, "Soft Channel") field(DRVH, "50.0") field(DRVL, "0.0") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(PINI, "YES") info(autosaveFields,"VAL") } record(stringin, "LGPS:UNDS:1:MADNAME") { field(DESC, "MAD deck nomenclature") field(PINI, "YES") field(VAL, "B913-1501") } record(ai, "LGPS:UNDS:1: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, "0.0") } record(ao, "LGPS:UNDS:1:BMAX") { field(DESC, "Max B-Field") field(DTYP, "Soft Channel") field(DRVH, "50.0") field(DRVL, "0.0") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(PINI, "YES") field(VAL, "50.0") field(FLNK, "LGPS:UNDS:1:BSTEP") } record(ao, "LGPS:UNDS:1:BMIN") { field(DESC, "Min B-Field") field(DTYP, "Soft Channel") field(DRVH, "50.0") field(DRVL, "0.0") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(PINI, "YES") field(VAL, "0.0") field(FLNK, "LGPS:UNDS:1:BSTEP") } record(ao, "LGPS:UNDS:1:BDESSAVE") { field(DESC, "bdes for save/load") field(DTYP, "Soft Channel") field(DRVH, "50.0") field(DRVL, "0.0") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PINI, "YES") field(PREC, "3") } # This record is processed by LGPS:UNDS:1: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, "LGPS:UNDS:1:BCON") { field(DESC, "Config B-Field ") field(DTYP, "Soft Channel") field(PREC, "3") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(DRVH, "50.0") field(DRVL, "0.0") # 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 , "") field(OMSL, "closed_loop") field(OUT, "LGPS:UNDS:1:B2ICON PP") info(autosaveFields,"VAL") } record(sub, "LGPS:UNDS:1:B2ICON") { field(DESC, "Convert Desired ICon to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "LGPS:UNDS:1:POLYCOEF") field(INPC, "LGPS:UNDS:1:POLYCOEF.A") field(INPD, "LGPS:UNDS:1:POLYCOEF.B") field(PREC, "3") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(MDEL, "-1") field(INPE, "LGPS:UNDS:1:BCON.DRVH") field(INPF, "LGPS:UNDS:1:BCON.DRVL") field(BRSV, "INVALID") field(FLNK, "LGPS:UNDS:1: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, "LGPS:UNDS:1:BSTEP") { field(DESC, "B-Field step size") field(CALC, "(C==3)||(D==3)?0:ABS(A-B)*0.005") field(INPA, "LGPS:UNDS:1:BMAX") field(INPB, "LGPS:UNDS:1:BMIN") field(INPC, "LGPS:UNDS:1:BMIN.SEVR") field(INPD, "LGPS:UNDS:1:BMAX.SEVR") field(EGU, "Volts") 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,"LGPS:UNDS:1:BCTRLDISABLECALC") { field(DESC, "Calc for disabling BCTRL") field(ASG, "Internal") field(CALC, "A?2:1") field(INPA, "LGPS:UNDS:1:ONLINE CP") field(OUT, "LGPS:UNDS:1:BCTRLDISABLEFOUT PP") } record(fanout, "LGPS:UNDS:1:BCTRLDISABLEFOUT") { field(DESC, "Disable BCTRL fanout") field(SELM, "Specified") field(SELL, "LGPS:UNDS:1:BCTRLDISABLECALC") field(LNK1, "LGPS:UNDS:1:BCTRLDISABLE") field(LNK2, "LGPS:UNDS:1:BCTRLENABLE") } record(stringout, "LGPS:UNDS:1:BCTRLDISABLE") { field(DESC, "Disable BCTRL") field(DTYP, "Soft Channel") field(OUT, "LGPS:UNDS:1:BCTRL.ASG") field(VAL, "NOWRITE") field(FLNK, "LGPS:UNDS:1:BCTRLDISV_UPDATE") } record(stringout, "LGPS:UNDS:1:BCTRLENABLE") { field(DESC, "Enable BCTRL") field(DTYP, "Soft Channel") field(OUT, "LGPS:UNDS:1:BCTRL.ASG") field(VAL, "") field(FLNK, "LGPS:UNDS:1:BCTRLDISV_UPDATE") } record(calcout, "LGPS:UNDS:1:BCTRLDISV_UPDATE") { field(DESC, "Calc for updating BCTRL.DISV") field(ASG, "Internal") field(CALC, "A") field(INPA, "LGPS:UNDS:1:ONLINE") field(OUT, "LGPS:UNDS:1: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,"LGPS:UNDS:1:BACT and MON\n are processed via links from \n LGPS:UNDS:1:IACT (device raw value readback 1)\n and\n LGPS:UNDS:1: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 LGPS:UNDS:1:POLYCOEF\nC = First polynomial coefficient (offset if linear)\nD = Second polynomial coefficient (slope if linear)\nE = LGPS:UNDS:1: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,"LGPS:UNDS:1:BDES\n is processed when set by CA users or \n LGPS:UNDS:1: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,"LGPS:UNDS:1: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 LGPS:UNDS:1: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 (LGPS:UNDS:1: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,"LGPS:UNDS:1:B*LIMITS and LGPS:UNDS:1:BLIMITS:\n Calculate alarm and warning limits based on \n deltas from LGPS:UNDS:1: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,"LGPS:UNDS:1: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,"LGPS:UNDS:1: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, "LGPS:UNDS:1: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, "LGPS:UNDS:1:MPSBTOL") { field(DESC, "Absolute mps tol") field(EGU, "Volts") field(PREC, "2") field(CALC, "ABS(A)*0.02") field(INPA, "LGPS:UNDS:1:BMAX") field(PINI, "YES") } # # 21-Aug-2013: K. Luchini # Set channel access security so that users # cannot easily change values. record(ao, "LGPS:UNDS:1:MPSBMAX") { field(DESC, "MPS Max B-field") field(EGU, "Volts") field(PREC, "7") field(DRVH, "50.0") field(DRVL, "0.0") field(PINI, "YES") field(VAL, "50.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "LGPS:UNDS:1:MPSBMIN") { field(DESC, "MPS Min B-field") field(EGU, "Volts") field(PREC, "7") field(DRVH, "50.0") field(DRVL, "0.0") field(PINI, "YES") field(VAL, "0.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "LGPS:UNDS:1:MPSBLLIM") { field(DESC, "MPS Low Limit B-field") field(EGU, "Volts") field(PREC, "7") field(DRVH, "50.0") field(DRVL, "0.0") field(PINI, "YES") field(VAL, "0.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "LGPS:UNDS:1:MPSBLLIM2") { field(DESC, "MPS Low Limit #2 B-field") field(EGU, "Volts") field(PREC, "7") field(DRVH, "50.0") field(DRVL, "0.0") field(PINI, "YES") field(VAL, "0.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } # Set the default to Std record(mbbo, "LGPS:UNDS:1: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, "LGPS:UNDS:1:MPSLIMITS.E PP") } record(aSub, "LGPS:UNDS:1: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, "LGPS:UNDS:1:MPS.RVAL") field(INPB, "LGPS:UNDS:1:BADIFF") field(INPC, "LGPS:UNDS:1:BDELTAS.N") field(INPD, "LGPS:UNDS:1:BACT") field(INPE, "LGPS:UNDS:1:MPSBITMASK.RVAL") field(INPF, "LGPS:UNDS:1:MPSBLLIM") field(INPG, "LGPS:UNDS:1:MPSBMIN") field(INPH, "LGPS:UNDS:1:MPSBMAX") field(INPI, "LGPS:UNDS:1: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, "LGPS:UNDS:1:INTOL.RVAL PP") field(OUTB, "LGPS:UNDS:1:INTOL_BMIN.RVAL PP") field(OUTC, "LGPS:UNDS:1:INTOL_BRANGE.RVAL PP") field(OUTD, "LGPS:UNDS:1: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, "LGPS:UNDS:1:INTOL") { field(DESC, "BACT within MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "LGPS:UNDS:1:MPSLIMITS.VALA") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "LGPS:UNDS:1:INTOL_BMIN") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "LGPS:UNDS:1:MPSLIMITS.VALB") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "LGPS:UNDS:1:INTOL_BMIN2") { field(DESC, "MPS tol #2") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "LGPS:UNDS:1:MPSLIMITS.VALD") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "LGPS:UNDS:1:INTOL_BRANGE") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "LGPS:UNDS:1: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, "LGPS:UNDS:1:CHCKITOL") { field(DESC, "Absolute Check I Tolerance") field(EGU, "A") field(FLNK, "LGPS:UNDS:1:TRIMITOL") field(CALC, "ABS(A*B)") field(INPA, "LGPS:UNDS:1:CHCKBTOL") field(INPB, "LGPS:UNDS:1:POLYCOEF.B") field(PREC, "9") } record(calc, "LGPS:UNDS:1:TRIMBTOL") { field(EGU, "Volts") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(DESC, "Absolute Trim Tolerance") field(CALC, "ABS(A)/2") field(INPA, "LGPS:UNDS:1:CHCKBTOL") field(FLNK, "LGPS:UNDS:1:CHCKITOL") } record(calc, "LGPS:UNDS:1:CHCKBTOL") { field(DESC, "Check absolute tolerance") field(EGU, "A") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(FLNK, "LGPS:UNDS:1:TRIMBTOL") field(CALC, "MAX(ABS(A),ABS(C))*(B/1000000)") field(INPA, "LGPS:UNDS:1:BDES.HOPR") field(INPB, "LGPS:UNDS:1:STABILITY") field(INPC, "LGPS:UNDS:1:BDES.LOPR") } record(longout, "LGPS:UNDS:1:STABILITY") { field(DESC, "Long Term Stability") field(PINI, "YES") field(VAL, "15000") field(EGU, "ppm") field(DRVH, "20000") field(DRVL, "100") field(HOPR, "20000") field(LOPR, "100") field(FLNK, "LGPS:UNDS:1:CHCKBTOL") } record(calc, "LGPS:UNDS:1:TRIMITOL") { field(DESC, "Absolute Trim I Tolerance") field(EGU, "Volts") field(CALC, "ABS(A*B)") field(INPA, "LGPS:UNDS:1:POLYCOEF.B") field(INPB, "LGPS:UNDS:1:TRIMBTOL") field(PREC, "9") } record(ai, "LGPS:UNDS:1:TRIMBTOLR") { field(DESC, "Relative trim tol") field(PREC, "4") field(EGU, "%") field(HOPR, "1.0") field(LOPR, "0.0") field(PINI, "YES") } record(ai, "LGPS:UNDS:1: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, "LGPS:UNDS:1:FBCKFCOM") { field(ZNAM, "CA") field(ONAM, "FCOM") field(DESC, "CA Mode") field(PINI, "YES") field(SDIS, "0") } record(bo, "LGPS:UNDS:1:PAU") { field(ZNAM, "NotConfigured") field(ONAM, "Configured") field(DESC, "PAU Present") field(PINI, "YES") field(SDIS, "0") field(FLNK, "LGPS:UNDS:1:PAUGO") } record(fanout, "LGPS:UNDS:1:PAUGO") { field(DESC, "PAU control") field(LNK1, "LGPS:UNDS:1:PAUSTOP") field(LNK2, "LGPS:UNDS:1: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, "LGPS:UNDS:1:PAUSTART") { field(DESC, "Setup for PAU On") field(SDIS, "LGPS:UNDS:1: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, "LGPS:UNDS:1:PAUSTOP") { field(DESC, "Setup for PAU Off") field(SDIS, "LGPS:UNDS:1: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, "LGPS:UNDS:1:MCORDEVNAME") { field(DESC, "PS device name") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, "PS:UNDS:1:") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "LGPS:UNDS:1: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, "LGPS:UNDS:1:PSTYPE.RVAL") field(INPC, "LGPS:UNDS:1:TURNEDOFF.RVAL") field(INPD, "LGPS:UNDS:1:CONFIG.RVAL") field(INPE, "LGPS:UNDS:1:PSCATEGORY.RVAL") field(INPF, "LGPS:UNDS:1:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "LGPS:UNDS:1:AUTOCTRL.RVAL") field(INPJ, "LGPS:UNDS:1:OUTOFSERVICE.RVAL") field(INPL, "LGPS:UNDS:1:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "LGPS:UNDS:1:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "LGPS:UNDS:1:PAU") field(INPP, "LGPS:UNDS:1:CALBDISABLE.RVAL") field(INPQ, "LGPS:UNDS:1:PTRBDISABLE.RVAL") field(INPR, "LGPS:UNDS:1:TRIMDISABLE.RVAL") field(INPS, "LGPS:UNDS:1:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "LGPS:UNDS:1:FBCK") field(INPU, "LGPS:UNDS:1:TRIMTYPE.RVAL") field(INPV, "LGPS:UNDS:1:STDZDIRECT.RVAL") field(INPW, "LGPS:UNDS:1:DEGAUSENABLE.RVAL") field(FLNK, "LGPS:UNDS:1:HSTA") } record(longin, "LGPS:UNDS:1:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "LGPS:UNDS:1:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "LGPS:UNDS:1: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, "LGPS:UNDS:1: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, "LGPS:UNDS:1: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, "LGPS:UNDS:1: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, "LGPS:UNDS:1: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, "LGPS:UNDS:1: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 LGPS:UNDS:1:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses LGPS:UNDS:1:FBCK. # This PV should be replaced by LGPS:UNDS:1: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, "LGPS:UNDS:1: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, "LGPS:UNDS:1: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, "LGPS:UNDS:1: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, "") field(OMSL, "supervisory") field(FLNK, "LGPS:UNDS:1:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"LGPS:UNDS:1:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "LGPS:UNDS:1:OUTOFSERVICE NPP NMS") field(OUT, "LGPS:UNDS:1:ONLINE PP") } record(bo, "LGPS:UNDS:1:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "LGPS:UNDS:1: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, "1") } record(bo, "LGPS:UNDS:1: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, "1") } record(bo, "LGPS:UNDS:1: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, "1") } # This PV is modified by :STATSUB.U record(bo, "LGPS:UNDS:1: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, "LGPS:UNDS:1: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, "LGPS:UNDS:1: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, "LGPS:UNDS:1: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, "LGPS:UNDS:1: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, "1") field(ASG, "NOWRITE") } record(mbbo, "LGPS:UNDS:1: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, "2") field(ASG, "NOWRITE") } record(mbbo, "LGPS:UNDS:1: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, "3") field(ASG, "NOWRITE") } record(mbbo, "LGPS:UNDS:1: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, "0") field(ASG, "NOWRITE") field(FLNK, "LGPS:UNDS:1:TRIMTYPE") } record(stringout, "LGPS:UNDS:1:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "LGPS:UNDS:1:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "LGPS:UNDS:1:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "LGPS:UNDS:1:STATE.RVAL") field(INPB, "LGPS:UNDS:1:INTLKSUMY.RVAL") field(OUT, "LGPS:UNDS:1:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "LGPS:UNDS:1: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, "LGPS:UNDS:1:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "LGPS:UNDS:1:STATE.RVAL") field(INPB, "LGPS:UNDS:1:INTLKSUMY.RVAL") field(OUT, "LGPS:UNDS:1:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "LGPS:UNDS:1:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "LGPS:UNDS:1:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "LGPS:UNDS:1: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, "LGPS:UNDS:1: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, "LGPS:UNDS:1: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, "LGPS:UNDS:1: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,"LGPS:UNDS:1: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("LGPS:UNDS:1:TURNEDOFF",3140,1907,0,1,"LGPS:UNDS:1:TURNEDOFF") #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "LGPS:UNDS:1:STATSUB") { field(DESC, "Build STATus ") field(INAM, "mgntInit") field(SNAM, "mgntSlcStat") field(INPA, "LGPS:UNDS:1:BACT.STAT") field(INPB, "LGPS:UNDS:1:BDES.STAT") field(INPC, "LGPS:UNDS:1:IRIPL.STAT") field(INPD, "PS:UNDS:1:ISETPT.STAT") field(INPE, "PS:UNDS:1:IACT.STAT") # 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, "LGPS:UNDS:1:BACT.SEVR") field(INPH, "LGPS:UNDS:1:BDES.SEVR") field(INPI, "LGPS:UNDS:1:IRIPL.SEVR") field(INPJ, "PS:UNDS:1:ISETPT.SEVR") field(INPK, "PS:UNDS:1:IACT.SEVR") # # 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, "LGPS:UNDS:1:STATE.RVAL") field(INPN, "LGPS:UNDS:1:STDZOK") field(INPO, "LGPS:UNDS:1:CALBOK") field(INPP, "LGPS:UNDS:1:OUTOFSERVICE.RVAL") field(INPQ, "LGPS:UNDS:1:CONFIG.RVAL") field(INPR, "LGPS:UNDS:1:HSTA") field(INPS, "LGPS:UNDS:1:CTRL.RVAL") field(INPT, "LGPS:UNDS:1:DEGAUSOK") field(INPV, "LGPS:UNDS:1: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, "LGPS:UNDS:1:STAT") } record(longout, "LGPS:UNDS:1:STAT") { field(DESC, "STAT sent to SLC") field(SCAN, "Passive") field(FLNK, "LGPS:UNDS:1:STATCTRLSUB") field(DOL, "LGPS:UNDS:1:STATSUB.VAL") field(OMSL, "closed_loop") } record(sSub, "LGPS:UNDS:1:STATCTRLSUB") { field(DESC, "Decode SLC STAT into mbbo") field(INAM, "mgntInit") field(SNAM, "mgntStatDecode") field(INPA, "LGPS:UNDS:1:STAT") field(INPB, "LGPS:UNDS:1:HSTA") field(INPD, "LGPS:UNDS:1:ONOFFCTRL.RVAL") field(FLNK, "LGPS:UNDS:1:STATMSG") } record(mbbo, "LGPS:UNDS:1: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, "LGPS:UNDS:1:UNAVAILGO") field(DOL, "LGPS:UNDS:1:STATCTRLSUB.W") } record(seq, "LGPS:UNDS:1:UNAVAILGO") { field(DESC, "Process UNAVAIL") field(DOL1, "LGPS:UNDS:1:STATSUB.U") field(LNK1, "LGPS:UNDS:1:UNAVAIL PP") } record(stringout, "LGPS:UNDS:1:SNLSTATMSG") { field(DTYP, "Soft Channel") } #! TextBox(TB0,820,1000,1200,1220,0,"Dialog",12,1,16777215,"LGPS:UNDS:1:STATUSSUB - future\nOverall device status - takes input from action snls, record sevrs, master snl(s) and outputs final status\n\nInputs:\nA - LGPS:UNDS:1:CTRLSTATUS - snl status\nB - MGNT:CTRLSTATUS - master list status\nC\nD - LGPS:UNDS:1: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,"LGPS:UNDS:1STATSUB\nformat control bo's into slc STAT\n\nInputs:\nA - LGPS:UNDS:1:STATUS\nC - LGPS:UNDS:1:ON\nD - LGPS:UNDS:1:STDZOK\nE - LGPS:UNDS:1:CALBOK\nF - LGPS:UNDS:1:BACTDRIFT (future)\nG -\nH- LGPS:UNDS:1:DACSTATUS\nI -LGPS:UNDS:1:ADCSTATUS\nJ - LGPS:UNDS:1:BACTSTATUS\nK - LGPS:UNDS:1:BDESSTATUS\nL - LGPS:UNDS:1:RIPLSTATUS\n\nOutput:\nP - LGPS:UNDS:1: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, "LGPS:UNDS:1: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, "LGPS:UNDS:1: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, "LGPS:UNDS:1: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, "LGPS:UNDS:1: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.6 #! DBDSTART #! DBD("../../../../dbd/mgntSoft.dbd") #! DBDEND record(stringout, "LGPS:UNDS:1:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "LGPS:UNDS:1:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "LGPS:UNDS:1:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "LGPS:UNDS:1:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "LGPS:UNDS:1:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "LGPS:UNDS:1:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "1") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "LGPS:UNDS:1: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, "LGPS:UNDS:1:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "LGPS:UNDS:1:TRIMTYPE.RVAL") field(INPB, "LGPS:UNDS:1:CONFIG.RVAL") field(OUT, "LGPS:UNDS:1:TRIMMAXNUM PP") } record(longout, "LGPS:UNDS:1: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, "LGPS:UNDS:1:TRIMRAMPRATE") { field(DESC, "Trim Ramp rate ") field(PINI, "YES") field(ASG, "IOC_MAINT") field(PREC, "3") field(EGU, "Volts/sec") field(HOPR, "20.0") field(DRVH, "20.0") field(DRVL, "0.1") field(LOPR, "0.5") # field(DOL, "") field(OMSL, "supervisory") field(VAL, "10") field(OUT, "LGPS:UNDS:1:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "LGPS:UNDS:1: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, "") field(OMSL, "supervisory") field(VAL, "10") } record(bo, "LGPS:UNDS:1: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, "LGPS:UNDS:1: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, "LGPS:UNDS:1:TRIMSTEPMIN") { field(DESC, "Min step in current") field(DTYP, "Soft Channel") # field(DOL, "") field(PREC, "7") field(EGUF, "10") field(EGUL, "0") field(EGU, "Volts") field(HOPR, "10") field(LOPR, "0") field(VAL, "5.0") } record(bo, "LGPS:UNDS:1:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "0") } record(ao, "LGPS:UNDS:1: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, "LGPS:UNDS:1:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "LGPS:UNDS:1: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, "LGPS:UNDS:1: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, "LGPS:UNDS:1:IMOVE") field(INPB, "LGPS:UNDS:1:IACT") field(INPC, "LGPS:UNDS:1:IRAMPRATE") field(INPD, "1.0") field(INPE, "LGPS:UNDS:1:TRIMDLYPCT") field(INPF, "LGPS:UNDS:1:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "LGPS:UNDS:1:RAMPTIME_LEFT PP") } record(longout, "LGPS:UNDS:1:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "LGPS:UNDS:1:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "LGPS:UNDS:1:RAMPDONE_CALC") } record(calc, "LGPS:UNDS:1:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "LGPS:UNDS:1:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "LGPS:UNDS:1:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "LGPS:UNDS:1: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, "LGPS:UNDS:1:RAMPTIME_LEFT") field(OUT, "LGPS:UNDS:1:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "LGPS:UNDS:1:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "LGPS:UNDS:1:RAMPTIME_LEFT NMS") field(OUT, "LGPS:UNDS:1:RAMPDONE PP") } record(bo, "LGPS:UNDS:1:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "LGPS:UNDS:1:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "LGPS:UNDS:1: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, "LGPS:UNDS:1: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(ai, "LGPS:UNDS:1: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, "LGPS:UNDS:1:MPSBTOL") { field(DESC, "Absolute mps tol") field(EGU, "Volts") field(PREC, "2") field(CALC, "ABS(A)*0.02") field(INPA, "LGPS:UNDS:1:BMAX") field(PINI, "YES") } # # 21-Aug-2013: K. Luchini # Set channel access security so that users # cannot easily change values. record(ao, "LGPS:UNDS:1:MPSBMAX") { field(DESC, "MPS Max B-field") field(EGU, "Volts") field(PREC, "7") field(DRVH, "50.0") field(DRVL, "0.0") field(PINI, "YES") field(VAL, "50.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "LGPS:UNDS:1:MPSBMIN") { field(DESC, "MPS Min B-field") field(EGU, "Volts") field(PREC, "7") field(DRVH, "50.0") field(DRVL, "0.0") field(PINI, "YES") field(VAL, "0.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "LGPS:UNDS:1:MPSBLLIM") { field(DESC, "MPS Low Limit B-field") field(EGU, "Volts") field(PREC, "7") field(DRVH, "50.0") field(DRVL, "0.0") field(PINI, "YES") field(VAL, "0.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "LGPS:UNDS:1:MPSBLLIM2") { field(DESC, "MPS Low Limit #2 B-field") field(EGU, "Volts") field(PREC, "7") field(DRVH, "50.0") field(DRVL, "0.0") field(PINI, "YES") field(VAL, "0.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } # Set the default to Std record(mbbo, "LGPS:UNDS:1: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, "LGPS:UNDS:1:MPSLIMITS.E PP") } record(aSub, "LGPS:UNDS:1: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, "LGPS:UNDS:1:MPS.RVAL") field(INPB, "LGPS:UNDS:1:BADIFF") field(INPC, "LGPS:UNDS:1:BDELTAS.N") field(INPD, "LGPS:UNDS:1:BACT") field(INPE, "LGPS:UNDS:1:MPSBITMASK.RVAL") field(INPF, "LGPS:UNDS:1:MPSBLLIM") field(INPG, "LGPS:UNDS:1:MPSBMIN") field(INPH, "LGPS:UNDS:1:MPSBMAX") field(INPI, "LGPS:UNDS:1: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, "LGPS:UNDS:1:INTOL.RVAL PP") field(OUTB, "LGPS:UNDS:1:INTOL_BMIN.RVAL PP") field(OUTC, "LGPS:UNDS:1:INTOL_BRANGE.RVAL PP") field(OUTD, "LGPS:UNDS:1: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, "LGPS:UNDS:1:INTOL") { field(DESC, "BACT within MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "LGPS:UNDS:1:MPSLIMITS.VALA") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "LGPS:UNDS:1:INTOL_BMIN") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "LGPS:UNDS:1:MPSLIMITS.VALB") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "LGPS:UNDS:1:INTOL_BMIN2") { field(DESC, "MPS tol #2") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "LGPS:UNDS:1:MPSLIMITS.VALD") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "LGPS:UNDS:1:INTOL_BRANGE") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "LGPS:UNDS:1: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, "LGPS:UNDS:1:CHCKITOL") { field(DESC, "Absolute Check I Tolerance") field(EGU, "A") field(FLNK, "LGPS:UNDS:1:TRIMITOL") field(CALC, "ABS(A*B)") field(INPA, "LGPS:UNDS:1:CHCKBTOL") field(INPB, "LGPS:UNDS:1:POLYCOEF.B") field(PREC, "9") } record(calc, "LGPS:UNDS:1:TRIMBTOL") { field(EGU, "Volts") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(DESC, "Absolute Trim Tolerance") field(CALC, "ABS(A)/2") field(INPA, "LGPS:UNDS:1:CHCKBTOL") field(FLNK, "LGPS:UNDS:1:CHCKITOL") } record(calc, "LGPS:UNDS:1:CHCKBTOL") { field(DESC, "Check absolute tolerance") field(EGU, "A") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(FLNK, "LGPS:UNDS:1:TRIMBTOL") field(CALC, "MAX(ABS(A),ABS(C))*(B/1000000)") field(INPA, "LGPS:UNDS:1:BDES.HOPR") field(INPB, "LGPS:UNDS:1:STABILITY") field(INPC, "LGPS:UNDS:1:BDES.LOPR") } record(longout, "LGPS:UNDS:1:STABILITY") { field(DESC, "Long Term Stability") field(PINI, "YES") field(VAL, "1000") field(EGU, "ppm") field(DRVH, "20000") field(DRVL, "100") field(HOPR, "20000") field(LOPR, "100") field(FLNK, "LGPS:UNDS:1:CHCKBTOL") } record(calc, "LGPS:UNDS:1:TRIMITOL") { field(DESC, "Absolute Trim I Tolerance") field(EGU, "Volts") field(CALC, "ABS(A*B)") field(INPA, "LGPS:UNDS:1:POLYCOEF.B") field(INPB, "LGPS:UNDS:1:TRIMBTOL") field(PREC, "9") } record(ai, "LGPS:UNDS:1:TRIMBTOLR") { field(DESC, "Relative trim tol") field(PREC, "4") field(EGU, "%") field(HOPR, "1.0") field(LOPR, "0.0") field(PINI, "YES") } record(ai, "LGPS:UNDS:1: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.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "LGPS:UNDS:1: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, "LGPS:UNDS:1:PSTYPE.RVAL") field(INPC, "LGPS:UNDS:1:TURNEDOFF.RVAL") field(INPD, "LGPS:UNDS:1:CONFIG.RVAL") field(INPE, "LGPS:UNDS:1:PSCATEGORY.RVAL") field(INPF, "LGPS:UNDS:1:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "LGPS:UNDS:1:AUTOCTRL.RVAL") field(INPJ, "LGPS:UNDS:1:OUTOFSERVICE.RVAL") field(INPL, "LGPS:UNDS:1:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "LGPS:UNDS:1:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "LGPS:UNDS:1:PAU") field(INPP, "LGPS:UNDS:1:CALBDISABLE.RVAL") field(INPQ, "LGPS:UNDS:1:PTRBDISABLE.RVAL") field(INPR, "LGPS:UNDS:1:TRIMDISABLE.RVAL") field(INPS, "LGPS:UNDS:1:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "LGPS:UNDS:1:FBCK") field(INPU, "LGPS:UNDS:1:TRIMTYPE.RVAL") field(INPV, "LGPS:UNDS:1:STDZDIRECT.RVAL") field(INPW, "LGPS:UNDS:1:DEGAUSENABLE.RVAL") field(FLNK, "LGPS:UNDS:1:HSTA") } record(longin, "LGPS:UNDS:1:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "LGPS:UNDS:1:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "LGPS:UNDS:1: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, "LGPS:UNDS:1: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, "LGPS:UNDS:1: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, "LGPS:UNDS:1: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, "LGPS:UNDS:1: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, "LGPS:UNDS:1: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 LGPS:UNDS:1:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses LGPS:UNDS:1:FBCK. # This PV should be replaced by LGPS:UNDS:1: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, "LGPS:UNDS:1: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, "LGPS:UNDS:1: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, "LGPS:UNDS:1: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, "") field(OMSL, "supervisory") field(FLNK, "LGPS:UNDS:1:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"LGPS:UNDS:1:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "LGPS:UNDS:1:OUTOFSERVICE NPP NMS") field(OUT, "LGPS:UNDS:1:ONLINE PP") } record(bo, "LGPS:UNDS:1:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "PS:UNDS:1:CommLink PP") } record(bo, "LGPS:UNDS:1: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, "1") } record(bo, "LGPS:UNDS:1: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, "1") } record(bo, "LGPS:UNDS:1: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, "1") } # This PV is modified by :STATSUB.U record(bo, "LGPS:UNDS:1: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, "LGPS:UNDS:1: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, "LGPS:UNDS:1: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, "LGPS:UNDS:1: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, "LGPS:UNDS:1: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, "1") field(ASG, "NOWRITE") } record(mbbo, "LGPS:UNDS:1: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, "2") field(ASG, "NOWRITE") } record(mbbo, "LGPS:UNDS:1: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, "5") field(ASG, "NOWRITE") } record(mbbo, "LGPS:UNDS:1: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, "0") field(ASG, "NOWRITE") field(FLNK, "LGPS:UNDS:1:TRIMTYPE") } record(stringout, "LGPS:UNDS:1:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "LGPS:UNDS:1:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "LGPS:UNDS:1:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "LGPS:UNDS:1:STATE.RVAL") field(INPB, "LGPS:UNDS:1:INTLKSUMY.RVAL") field(OUT, "LGPS:UNDS:1:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "LGPS:UNDS:1: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, "LGPS:UNDS:1:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "LGPS:UNDS:1:STATE.RVAL") field(INPB, "LGPS:UNDS:1:INTLKSUMY.RVAL") field(OUT, "LGPS:UNDS:1:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "LGPS:UNDS:1:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "LGPS:UNDS:1:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "LGPS:UNDS:1: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, "LGPS:UNDS:1: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, "LGPS:UNDS:1: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, "LGPS:UNDS:1: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,"LGPS:UNDS:1: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("LGPS:UNDS:1:TURNEDOFF",3140,1907,0,1,"LGPS:UNDS:1:TURNEDOFF") #! 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, "LGPS:UNDS:2:IACT") { field(DESC, "Current") field(INP, "PS:UNDS:2:IACT") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "LGPS:UNDS:2:BACT") info(autosaveFields,"HYST") } record(bi, "LGPS:UNDS:2:STATE") { field(DESC, "PS On/Off Status") field(DTYP, "Raw Soft Channel") field(INP, "PS:UNDS:2:STATE CP MS") field(ZSV, "MAJOR") field(ZNAM, "OFF") field(ONAM, "ON") } record(ao, "LGPS:UNDS:2:IDES") { field(DESC, "Desired Current") field(PREC, "3") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(MDEL, "-1") field(HIHI, "50.0") field(LOLO, "0.0") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "LGPS:UNDS:2:BDELTAS") field(DRVH, "50.0") field(DRVL, "0.0") field(DOL, "LGPS:UNDS:2: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, "LGPS:UNDS:2:ICTRL PP") } # This record is processed by LGPS:UNDS:2:ICON") # Note: we are not setting alarms here. record(ao, "LGPS:UNDS:2:ICON") { field(DESC, "Config I") field(DTYP, "Soft Channel") field(PREC, "3") field(HOPR, "50.0") field(LOPR, "0.0") field(DRVH, "50.0") field(DRVL, "0.0") field(DOL, "LGPS:UNDS:2:B2ICON.K") field(OMSL, "closed_loop") info(autosaveFields,"VAL") } record(ao, "LGPS:UNDS:2:INOM") { field(DESC, "Nominal Current") field(DOL, "LGPS:UNDS:2:BNOM.K") field(OMSL, "closed_loop") field(PREC, "3") field(EGU, "Volts") field(DRVH, "50.0") field(DRVL, "0.0") field(HOPR, "50.0") field(LOPR, "0.0") } record(ao, "LGPS:UNDS:2:ICTRL") { field(DESC, "Set Current") field(PREC, "3") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(DRVH, "50.0") field(DRVL, "0.0") field(MDEL, "-1") field(FLNK, "LGPS:UNDS:2:ICTRLGO") field(OMSL, "supervisory") info(autosavefields,"VAL") } record(seq, "LGPS:UNDS:2:ICTRLGO") { field(DESC, "Process Current Setpoint") field(PREC, "3") # Set ISETPT to supervisory field(DOL1, "0") field(LNK1, "LGPS:UNDS:2:ISETPT.OMSL") field(DOL2, "LGPS:UNDS:2:ICTRL") field(LNK2, "LGPS:UNDS:2:ISETPT PP") # Set ISETPT to closed loop - get data from BCTRLSUB.K field(DOL3, "1") field(LNK3, "LGPS:UNDS:2:ISETPT.OMSL") } record(ao, "LGPS:UNDS:2:IMAX") { field(DESC, "Max I") field(DTYP, "Soft Channel") field(DRVH, "50.0") field(DRVL, "0.0") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(PINI, "YES") field(VAL, "50.0") field(FLNK, "LGPS:UNDS:2:IMIN") } record(ao, "LGPS:UNDS:2:IMIN") { field(DESC, "Min I") field(DTYP, "Soft Channel") field(DRVH, "50.0") field(DRVL, "0.0") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(VAL, "0.0") field(FLNK, "LGPS:UNDS:2:IRANGE") } record(sel, "LGPS:UNDS:2:IACTPREVOK") { field(DESC, "Last Good Current") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(NVL, "LGPS:UNDS:2:BACT.SEVR") field(INPA, "LGPS:UNDS:2:IACT NPP MS") field(INPB, "LGPS:UNDS:2:IACTPREVOK NPP MS") field(INPC, "LGPS:UNDS:2:IACTPREVOK NPP MS") field(INPD, "LGPS:UNDS:2:IACTPREVOK NPP MS") } record(sub, "LGPS:UNDS:2:IACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "LGPS:UNDS:2:IDES") field(INPB, "LGPS:UNDS:2:ISETPT.DRVH") field(INPC, "LGPS:UNDS:2:ISETPT.DRVL") field(INPD, "LGPS:UNDS:2:IDELTAS.I") field(INPE, "LGPS:UNDS:2:IDELTAS.J") field(INPG, "LGPS:UNDS:2:STATE") field(INPH, "LGPS:UNDS:2:HSTA") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(sub, "LGPS:UNDS:2:IMONLIMITS") { field(DESC, "Aux Current Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "LGPS:UNDS:2:IDES") field(INPB, "LGPS:UNDS:2:ISETPT.DRVH") field(INPC, "LGPS:UNDS:2:ISETPT.DRVL") field(INPD, "LGPS:UNDS:2:IDELTAS.K") field(INPE, "LGPS:UNDS:2:IDELTAS.L") field(INPG, "LGPS:UNDS:2:STATE") field(INPH, "LGPS:UNDS:2:HSTA") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(seq, "LGPS:UNDS:2:ILIMITS") { field(DESC, "Set ACT and MON Limits") field(PREC, "3") field(DOL1, "LGPS:UNDS:2:BLIMITS") field(LNK1, "LGPS:UNDS:2:IACTLIMITS.F PP") field(DOL2, "LGPS:UNDS:2:IACTLIMITS.I") field(LNK2, "LGPS:UNDS:2:IACT.HIGH") field(DOL3, "LGPS:UNDS:2:IACTLIMITS.J") field(LNK3, "LGPS:UNDS:2:IACT.LOW") field(DOL4, "LGPS:UNDS:2:IACTLIMITS.K") field(LNK4, "LGPS:UNDS:2:IACT.HIHI") field(DOL5, "LGPS:UNDS:2:IACTLIMITS.L") field(LNK5, "LGPS:UNDS:2:IACT.LOLO") field(DOL6, "LGPS:UNDS:2:BLIMITS") field(LNK6, "LGPS:UNDS:2:IMONLIMITS.F PP") field(DOL7, "LGPS:UNDS:2:IMONLIMITS.I") field(LNK7, "LGPS:UNDS:2:IMON.HIGH") field(DOL8, "LGPS:UNDS:2:IMONLIMITS.J") field(LNK8, "LGPS:UNDS:2:IMON.LOW") field(DOL9, "LGPS:UNDS:2:IMONLIMITS.K") field(LNK9, "LGPS:UNDS:2:IMON.HIHI") field(DOLA, "LGPS:UNDS:2:IMONLIMITS.L") field(LNKA, "LGPS:UNDS:2: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, "LGPS:UNDS:2:IDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntRawDeltas") field(INPD, "LGPS:UNDS:2:TRIMBTOL") field(INPE, "LGPS:UNDS:2:CHCKBTOL") field(INPF, "LGPS:UNDS:2:BDELTAS.K") field(INPG, "LGPS:UNDS:2:BDELTAS.L") field(INPH, "LGPS:UNDS:2:B2IDES.L") field(EGU, "Volts") field(HOPR, "1") field(PREC, "3") field(BRSV, "INVALID") # # Used to calcualte standardize tolerance # which is returned in the VAL field. # field(INPB, "LGPS:UNDS:2:STDZITOLR") field(INPC, "LGPS:UNDS:2:STDZITOL") field(FLNK, "") } # All ps controllers with on/off control will set the macro ONOF # as follows: # # ONOF = PS:UNDS:2: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, "LGPS:UNDS:2:STATESETPT") { field(DESC, "PS On/Off") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFF") field(ONAM, "ON") field(OUT, "PS:UNDS:2:STATESETPT PP") 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:UNDS:2:RESET PP # record(bo, "LGPS:UNDS:2:RESET") { field(DESC, "Interlock Latch Reset") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFF") field(ONAM, "ON") field(HIGH, "1.0") field(OUT, "PS:UNDS:2:RESET PP") } record(bo, "LGPS:UNDS:2:RAMPSTATE") { field(DESC, "PS Ramp Status") field(DTYP, "Soft Channel") field(DOL, "PS:UNDS:2:RAMPSTATE") 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, "LGPS:UNDS:2: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, "Volts/sec") field(PREC, "3") # Set default to trim ramp rate on boot # but need to change for degauss function. field(DOL, "LGPS:UNDS:2:TRIMRAMPRATE") field(OUT, "") field(FLNK, "LGPS:UNDS:2:STDZDLY") } record(ao, "LGPS:UNDS:2:ISETPT") { field(DESC, "Current Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(DRVH, "50.0") field(DRVL, "0.0") field(MDEL, "-1") field(OUT, "PS:UNDS:2:ISETPT PP") field(DOL, "LGPS:UNDS:2: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, "LGPS:UNDS:2:IMON") { field(DESC, "Aux Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(INP, "") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "LGPS:UNDS:2:BMON") } record(ao, "LGPS:UNDS:2:IRIPL") { field(DESC, "Ripple Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(DOL, "") field(OMSL, "closed_loop") field(EGU, "Volts") field(DRVH, "1.0") field(HOPR, "1.0") field(PREC, "3") field(FLNK, "LGPS:UNDS:2:IRIPLOK") } record(sub, "LGPS:UNDS:2:IRIPLOK") { field(DESC, "Ripple Current Status") field(INAM, "mgntInit") field(SNAM, "mgntRiplOK") field(INPA, "LGPS:UNDS:2:IRIPL.VAL") field(INPB, "LGPS:UNDS:2: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, "LGPS:UNDS:2:R") { field(DESC, "Resistance") field(EGU, "Ohms") field(PREC, "4") field(PINI, "YES") field(DOL, "") 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, "LGPS:UNDS:2:IGND") { field(DESC, "Ground Current") field(EGU, "Volts") field(PREC, "6") field(PINI, "YES") field(DOL, "") field(OMSL, "closed_loop") } record(bi, "LGPS:UNDS:2:INTLKSUMY") { field(DESC, "Interlock Summary") field(INP, "PS:UNDS:2:INTLKSUMY CP MS") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(ZNAM, "OK") field(ONAM, "FAULT") field(PINI, "NO") } record(mbbo, "LGPS:UNDS:2: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:UNDS:2:COOLING") field(OMSL, "closed_loop") } # The following PV is processed by :BACTFO # which is processed by :BACT record(fanout, "LGPS:UNDS:2:IACTFO") { field(DESC, "IACT processing") field(SELM, "All") field(LNK1, "LGPS:UNDS:2:IACTPREVOK") field(LNK2, "LGPS:UNDS:2:IDIFF") field(LNK3, "LGPS:UNDS:2:IADIFF") field(LNK4, "LGPS:UNDS:2:IRATIO") field(LNK5, "LGPS:UNDS:2:IDIRECT") field(LNK6, "LGPS:UNDS:2:IACTPOL_CHECK") } record(calc, "LGPS:UNDS:2:IDIFF") { field(DESC, "IDES-IACT") field(CALC, "A-B") field(INPA, "LGPS:UNDS:2:IDES") field(INPB, "LGPS:UNDS:2:IACT") field(EGU, "Volts") field(PREC, "9") field(HOPR, "50.0") field(LOPR, "0.0") } record(calc, "LGPS:UNDS:2:IADIFF") { field(DESC, "Absolute IDES-IACT") field(CALC, "A<0?ABS(A):A") field(INPA, "LGPS:UNDS:2:IDIFF") field(PREC, "9") } record(calc, "LGPS:UNDS:2:IRATIO") { field(DESC, "IDES-IACT/IMAX") field(CALC, "B?A/B:0") field(INPA, "LGPS:UNDS:2:IDIFF") field(INPB, "LGPS:UNDS:2:IDES.DRVH") field(PREC, "9") } record(calcout, "LGPS:UNDS:2:IRANGE") { field(DESC, "Current Range") field(PINI, "YES") field(CALC, "ABS(A-B)") field(INPA, "LGPS:UNDS:2:IMIN") field(INPB, "LGPS:UNDS:2: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, "LGPS:UNDS:2: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, "LGPS:UNDS:2:IACT") field(FLNK, "LGPS:UNDS:2:IACTPOL") } record(bo, "LGPS:UNDS:2:IACTPOL") { field(DESC, "Actual I Polarity") field(DTYP, "Raw Soft Channel") field(DOL, "LGPS:UNDS:2: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,"LGPS:UNDS:2:I*LIMITS:\n Calculate alarm and warning limits based on \n deltas from LGPS:UNDS:2:IDELTAS and the\n LGPS:UNDS:2: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,"LGPS:UNDS:2:IACT: \n Get copy of LGPS:UNDS:2:I. \n",null) #! TextBox(TB12,1280,3100,1760,3200,0,"Dialog",12,1,16777215,"LGPS:UNDS:2: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,"LGPS:UNDS:2:IDES:\n Contains raw value calculated by \nLGPS:UNDS:2: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 \nLGPS:UNDS:2:BDELTAS.\n",null) #! TextBox(TB10,56,1940,316,2340,0,"Dialog",12,1,16777215,"LGPS:UNDS:2: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 LGPS:UNDS:2: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 LGPS:UNDS:2: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,"LGPS:UNDS:2:ISETPT:\n Sets the hardware. When fast feedback is set on, this record is\n set to closed loop mode by LGPS:UNDS:2:FBCKSTART sequence. When \n the loop is closed, this record takes input calculated by \n BFBCK only. When fast feedback is set off, LGPS:UNDS:2:FBCKSTOP \n will set it back to supervisory so that the value can be set by \n LGPS:UNDS:2: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, "LGPS:UNDS:2:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "LGPS:UNDS:2:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "LGPS:UNDS:2:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "LGPS:UNDS:2:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "LGPS:UNDS:2:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "LGPS:UNDS:2:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "1") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "LGPS:UNDS:2: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, "LGPS:UNDS:2:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "LGPS:UNDS:2:TRIMTYPE.RVAL") field(INPB, "LGPS:UNDS:2:CONFIG.RVAL") field(OUT, "LGPS:UNDS:2:TRIMMAXNUM PP") } record(longout, "LGPS:UNDS:2: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, "LGPS:UNDS:2:TRIMRAMPRATE") { field(DESC, "Trim Ramp rate ") field(PINI, "YES") field(ASG, "IOC_MAINT") field(PREC, "3") field(EGU, "Volts/sec") field(HOPR, "20.0") field(DRVH, "20.0") field(DRVL, "0.1") field(LOPR, "0.5") # field(DOL, "") field(OMSL, "supervisory") field(VAL, "10") field(OUT, "LGPS:UNDS:2:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "LGPS:UNDS:2: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, "") field(OMSL, "supervisory") field(VAL, "10") } record(bo, "LGPS:UNDS:2: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, "LGPS:UNDS:2: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, "LGPS:UNDS:2:TRIMSTEPMIN") { field(DESC, "Min step in current") field(DTYP, "Soft Channel") # field(DOL, "") field(PREC, "7") field(EGUF, "10") field(EGUL, "0") field(EGU, "Volts") field(HOPR, "10") field(LOPR, "0") field(VAL, "5.0") } record(bo, "LGPS:UNDS:2:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "0") } record(ao, "LGPS:UNDS:2: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, "LGPS:UNDS:2:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "LGPS:UNDS:2: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, "LGPS:UNDS:2: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, "LGPS:UNDS:2:IMOVE") field(INPB, "LGPS:UNDS:2:IACT") field(INPC, "LGPS:UNDS:2:IRAMPRATE") field(INPD, "1.577") field(INPE, "LGPS:UNDS:2:TRIMDLYPCT") field(INPF, "LGPS:UNDS:2:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "LGPS:UNDS:2:RAMPTIME_LEFT PP") } record(longout, "LGPS:UNDS:2:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "LGPS:UNDS:2:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "LGPS:UNDS:2:RAMPDONE_CALC") } record(calc, "LGPS:UNDS:2:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "LGPS:UNDS:2:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "LGPS:UNDS:2:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "LGPS:UNDS:2: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, "LGPS:UNDS:2:RAMPTIME_LEFT") field(OUT, "LGPS:UNDS:2:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "LGPS:UNDS:2:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "LGPS:UNDS:2:RAMPTIME_LEFT NMS") field(OUT, "LGPS:UNDS:2:RAMPDONE PP") } record(bo, "LGPS:UNDS:2:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "LGPS:UNDS:2:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "LGPS:UNDS:2: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, "LGPS:UNDS:2: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, "LGPS:UNDS:2:STDZINIT") { field(DESC, "Proc. Stdz PVs on boot") field(PINI, "YES") field(DOL1, "1") field(DOL2, "1") field(DOL3, "1") field(LNK1, "LGPS:UNDS:2:DEBUG.PROC PP") field(LNK2, "LGPS:UNDS:2:STDZCYCLENUM.PROC PP") field(LNK3, "LGPS:UNDS:2:STDZDISABLE.PROC PP") field(LNK4, "LGPS:UNDS:2: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, "LGPS:UNDS:2:STDZSUB") { field(DESC, "Stdz subroutine") field(INAM, "mgntStdzInit") field(SNAM, "mgntStdz") field(BRSV, "INVALID") field(INPA, "LGPS:UNDS:2:STDZIMIN NPP NMS") field(INPB, "LGPS:UNDS:2:STDZIMAX NPP NMS") field(INPC, "LGPS:UNDS:2:STDZIFINAL NPP NMS") field(INPD, "LGPS:UNDS:2:STDZCYCLENUM NPP NMS") field(INPE, "LGPS:UNDS:2:STDZDIRECT.RVAL NPP NMS") field(INPF, "LGPS:UNDS:2:STDZDISABLE.RVAL CPP NMS") field(INPG, "LGPS:UNDS:2: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, "LGPS:UNDS:2:STDZWF PP") field(OUTB, "LGPS:UNDS:2: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, "LGPS:UNDS:2:STDZWF") } record(mbbo, "LGPS:UNDS:2: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, "LGPS:UNDS:2: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, "LGPS:UNDS:2:STDZMAINPS") { field(DESC, "Stdz by main or self") field(PINI, "YES") field(DTYP, "Soft Channel") field(ZNAM, "SELF") field(ONAM, "MAIN") } record(bo, "LGPS:UNDS:2: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, "LGPS:UNDS:2: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, "LGPS:UNDS:2: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, "LGPS:UNDS:2:STDZTOD") { field(DESC, "Successful Standardize Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "LGPS:UNDS:2:STDZLOSTTOD") { field(DESC, "Standardize Lost Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(longout, "LGPS:UNDS:2:STDZCYCLECNT") { field(DESC, "Cycle Count") field(PINI, "YES") } record(longout, "LGPS:UNDS:2:STDZCYCLENUM") { field(DESC, "No. Standardize Cycles") field(VAL, "3") field(HOPR, "10") field(LOPR, "0") field(DRVH, "10") field(DRVL, "0") field(PINI, "YES") field(FLNK, "LGPS:UNDS:2:STDZDIRECT") } # The default standardize direction is "UP" for # all LCLS Magnets.. record(bo, "LGPS:UNDS:2:STDZDIRECT") { field(DESC, "Standardize Direction ") field(ZNAM, "UP") field(ONAM, "DOWN") field(VAL, "0") field(FLNK, "LGPS:UNDS:2:STDZIMIN") } record(ao, "LGPS:UNDS:2:STDZIMIN") { field(DESC, "Min-STDZ Current") field(PREC, "1") field(EGU, "A") field(HOPR, "50.0") field(LOPR, "0.0") field(VAL, "0.0") field(FLNK, "LGPS:UNDS:2:STDZIMAX") } record(ao, "LGPS:UNDS:2:STDZIMAX") { field(DESC, "Max. Standarize Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "50.0") field(LOPR, "0.0") field(VAL, "50.0") field(FLNK, "LGPS:UNDS:2:STDZIFINAL") } record(ao, "LGPS:UNDS:2:STDZIFINAL") { field(DESC, "Final SDTZ Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "50.0") field(LOPR, "0.0") field(VAL, "0.0") field(FLNK, "LGPS:UNDS:2: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, "LGPS:UNDS:2: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, "LGPS:UNDS:2:STDZITOL") { field(DESC, "Stdz min tolerance") field(PREC, "5") field(CALC, "MAX(ABS(A),ABS(B))*C") field(INPA, "LGPS:UNDS:2:STDZIMIN CP NMS") field(INPB, "LGPS:UNDS:2:STDZIMAX CP MMS") field(INPC, "0.05") field(INPD, "LGPS:UNDS:2:STDZITOLR CP MMS") field(EGU, "A") field(FLNK, "LGPS:UNDS:2:IDELTAS") field(PINI, "YES") } # D - factor (3.154/2 = 1.577) for EPSC, otherwise, set to 1.0 record(calc, "LGPS:UNDS:2:STDZDLY") { field(DESC, "Ramp time for stdz cycle") field(CALC, "C>0?MAX(1,ABS((A-B)/C)*D):0") field(INPA, "LGPS:UNDS:2:STDZIMIN CP NMS") field(INPB, "LGPS:UNDS:2:STDZIMAX CP NMS") field(INPC, "LGPS:UNDS:2:TRIMRAMPRATE CP NMS") field(INPD, "1.0") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") } record(calc, "LGPS:UNDS:2:STDZRAMPDLY") { field(DESC, "Ramp delay total") field(CALC, "MAX(1,((A/100)*B+B))") field(PREC, "5") field(INPA, "LGPS:UNDS:2:TRIMDLYPCT CP MS") field(INPB, "LGPS:UNDS:2: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, "LGPS:UNDS:2:STDZMINIDLY") { field(DESC, "Mini-stdz delay") field(CALC, "A") field(PREC, "5") field(A, "1.0") field(EGU, "sec") field(PINI, "YES") } record(ao, "LGPS:UNDS:2: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, "LGPS:UNDS:2:STDZMINIDELTA") { field(DESC, "Stdz mini % of IMAX") field(CALC, "(B/100)*(A-C)") field(INPA, "LGPS:UNDS:2:IDES.HOPR") field(INPB, "LGPS:UNDS:2:STDZMINIPCT CPP NMS") field(INPC, "LGPS:UNDS:2:IDES.LOPR") field(PREC, "5") } record(calc, "LGPS:UNDS:2:STDZMINISETPT") { field(DESC, "Mini Stdz delta") field(CALC, "C==0?MAX(E-D,B):MIN(E+D,A)") field(INPA, "LGPS:UNDS:2:IDES.HOPR") field(INPB, "LGPS:UNDS:2:IDES.LOPR") field(INPC, "LGPS:UNDS:2:STDZDIRECT.RVAL") field(INPD, "LGPS:UNDS:2:STDZMINIDELTA") field(INPE, "LGPS:UNDS:2:IDES") field(PREC, "5") field(FLNK, "LGPS:UNDS:2: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, "LGPS:UNDS:2:STDZMINISETPTOOR") { field(DESC, "Mini Stdz setpoint out of range") field(CALC, "C==0?(E-DA)") field(INPA, "LGPS:UNDS:2:IDES.HOPR") field(INPB, "LGPS:UNDS:2:IDES.LOPR") field(INPC, "LGPS:UNDS:2:STDZDIRECT.RVAL") field(INPD, "LGPS:UNDS:2:STDZMINIDELTA") field(INPE, "LGPS:UNDS:2: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, "LGPS:UNDS:2: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, "LGPS:UNDS:2:IADJUST.RVAL") field(INPB, "LGPS:UNDS:2:STDZDIRECT.RVAL") field(INPC, "LGPS:UNDS:2:STDZOK.RVAL") field(INPD, "LGPS:UNDS:2:STDZDISABLE.RVAL") field(INPE, "LGPS:UNDS:2:STATE.RVAL CPP NMS") field(INPF, "LGPS:UNDS:2:ICTRL.RVAL") field(INPG, "LGPS:UNDS:2:STATE.SEVR") field(INPH, "LGPS:UNDS:2:BDELTAS.M") field(INPI, "LGPS:UNDS:2:IACT.SEVR") field(OUT, "LGPS:UNDS:2:STDZLOSTGO.SELN PP NMS") field(OOPT, "Transition To Non-zero") } record(seq, "LGPS:UNDS:2:STDZLOSTGO") { field(DESC, "Process lost stdz") field(SELM, "Mask") field(DOL1, "1") field(DOL2, "0") field(LNK1, "LGPS:UNDS:2:STDZLOSTTOD.PROC") field(LNK2, "LGPS:UNDS:2:STDZOK PP") } # Record maximum current after standardize # Reset to IACT from sequence after trim # Disable processing during (mini-)standardize or trim record(calc, "LGPS:UNDS:2:STDZIACTMAX") { field(DESC, "Max act current after stdz") field(CALC, "MAX(A, B)") field(DISV, "0") field(SDIS, "LGPS:UNDS:2:CHECKPWRDIP_ENABLE") field(INPA, "LGPS:UNDS:2:IACT CP") field(INPB, "LGPS:UNDS:2:STDZIACTMAX") field(EGU, "A") field(FLNK, "LGPS:UNDS:2:CHECKPWRDIP") } # Detect power dip if STDZOK is YES, STDZ is enabled, and IACT is valid # If IACT drops below STDZIACTMAX by more than the trim tolerance, clear STDZOK # Warning: Take the absolute value of the trim tolerance, or else quads of # negative polarity will always lose STDZ since their IDELTAS.I are negative. # Note: Large quads and bends are prone to losing STDZ even if they are # perturbed toward higher current since their current tends to overshoot # by greater than the trim tolerance before settling down. record(calcout, "LGPS:UNDS:2:CHECKPWRDIP") { field(DESC, "Detect power dip") field(CALC, "(A-B>ABS(C))?3:0") field(DISV, "0") field(SDIS, "LGPS:UNDS:2:CHECKPWRDIP_ENABLE") field(INPA, "LGPS:UNDS:2:STDZIACTMAX") field(INPB, "LGPS:UNDS:2:IACT") field(INPC, "LGPS:UNDS:2:IDELTAS.I") field(OUT, "LGPS:UNDS:2:STDZLOSTGO.SELN PP NMS") field(OOPT, "When Non-zero") } # Enable processing of STDZIACTMAX and CHECKPWRDIP only if # STDZOK = YES, STDZDISABLE = NO, CTRL != Trim (2), and # CTRL != Stdz (4) record(calc, "LGPS:UNDS:2:CHECKPWRDIP_ENABLE") { field(CALC, "A&&!B&&(C#2)&&(C#4)") field(INPA, "LGPS:UNDS:2:STDZOK.RVAL CP") field(INPB, "LGPS:UNDS:2:STDZDISABLE.RVAL CP") field(INPC, "LGPS:UNDS:2:CTRL.RVAL CP") } #! 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, "LGPS:UNDS:2: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, "LGPS:UNDS:2: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, "LGPS:UNDS:2:CALBSET") { field(DESC, "Use DAC Calbration") field(SCAN, "10 second") field(CALC, "A&&(B==0)&&C?31:960") field(INPA, "LGPS:UNDS:2:CALBOK") field(INPB, "LGPS:UNDS:2:CALBDISABLE") field(INPC, "LGPS:UNDS:2:CALBSLOPE") field(OOPT, "On Change") field(OUT, "LGPS:UNDS:2: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, "LGPS:UNDS:2:CALB_SEQ") { field(DESC, "Output Calib Values") field(SELM, "Mask") field(SELL, "LGPS:UNDS:2: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, "LGPS:UNDS:2:CALBSLOPE") field(DOL3, "LGPS:UNDS:2: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, "LGPS:UNDS:2:CALBTOD") { field(DESC, "Calibration Success Time") field(PINI, "YES") # field(DOL, "") field(OMSL, "supervisory") field(DTYP, "Soft Channel") info(autosaveFields,"VAL") } record(ao, "LGPS:UNDS:2: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, "LGPS:UNDS:2: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, "LGPS:UNDS:2: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, "LGPS:UNDS:2:CALBOFFSET") { field(DESC, "Calc DAC Offset") field(PREC, "6") field(EGU, "Counts") field(PINI, "YES") } record(bo, "LGPS:UNDS:2: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, "LGPS:UNDS:2:DACSLOPE") { field(DESC, "V to DAC slope") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "supervisory") field(PINI, "YES") field(FLNK, "LGPS:UNDS:2:DACOFFSET") } # Default Offset used in conversion from Volts to DAC Counts record(ao, "LGPS:UNDS:2:DACOFFSET") { field(DESC, "V to DAC offset") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "supervisory") field(PINI, "YES") field(FLNK, "LGPS:UNDS:2: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, "LGPS:UNDS:2: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, "LGPS:UNDS:2:IACT") field(INPD, "LGPS:UNDS:2:DACSLOPE") field(INPE, "LGPS:UNDS:2:DACOFFSET") field(EGU, "Counts") field(PREC, "6") } record(ao, "LGPS:UNDS:2:DAC") { field(DESC, "DAC Set point") field(EGU, "Counts") field(DOL, "") field(OMSL, "supervisory") field(PREC, "6") field(PINI, "YES") } record(ao, "LGPS:UNDS:2:CALBIMIN") { field(DESC, "Calibration Min Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(DRVH, "50.0") field(HOPR, "50.0") field(DRVL, "0.0") field(LOPR, "0.0") field(PREC, "3") field(EGU, "A") field(VAL, "0.0") field(FLNK, "LGPS:UNDS:2:CALBIMAX") } record(ao, "LGPS:UNDS:2:CALBIMAX") { field(DESC, "Calibration Max Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(DRVH, "50.0") field(HOPR, "50.0") field(LOPR, "0.0") field(DRVL, "0.0") field(EGU, "A") field(VAL, "50.0") field(FLNK, "LGPS:UNDS:2:CALBSTEPNUM") } record(ao, "LGPS:UNDS:2:CALBIFINAL") { field(DESC, "Calibration Last Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(PREC, "3") field(EGU, "A") field(HOPR, "50.0") field(LOPR, "0.0") field(VAL, "0") } record(longout, "LGPS:UNDS:2: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, "LGPS:UNDS:2:CALBIDELTA") } record(calc, "LGPS:UNDS:2:CALBIDELTA") { field(DESC, "Step size for CALB") field(CALC, "C=0?0:ABS((A-B)/C)") field(INPA, "LGPS:UNDS:2:CALBIMAX") field(INPB, "LGPS:UNDS:2:CALBIMIN") field(INPC, "LGPS:UNDS:2: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, "LGPS:UNDS:2:CALBIMULT") { field(DESC, "IACT vs ISETPT mult") field(CALC, "C#0||A=0?1:ABS(B/A)") field(INPA, "PS:UNDS:2:ISETPT.DRVH") field(INPB, "PS:UNDS:2:IACT.HOPR") field(INPC, "LGPS:UNDS:2:PSCONTROLLER.RVAL CPP") field(EGU, "A") field(PINI, "YES") } # SNL dbputs DAC values here. 6-10 steps are possible. record(waveform, "LGPS:UNDS:2:CALBICTRLWF") { field(DESC, "ICTRL setpoint array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") } record(waveform, "LGPS:UNDS:2:DACWF") { field(DESC, "DAC count array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "LGPS:UNDS:2:DACSA") } # Used only for xygraph edm plot record(subArray, "LGPS:UNDS:2:DACSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "LGPS:UNDS:2: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, "LGPS:UNDS:2:CALCDACWF") { field(DESC, "Calc DAC counts array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "LGPS:UNDS:2:CALCDACSA") } # Used only for xygraph edm plot record(subArray, "LGPS:UNDS:2:CALCDACSA") { field(DESC, "Calc DAC counts") field(DTYP, "Soft Channel") field(INP, "LGPS:UNDS:2: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, "LGPS:UNDS:2:CALBYWF") { field(DESC, "mx + b") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "LGPS:UNDS:2:CALBYSA") } # Used only for xygraph edm plot record(subArray, "LGPS:UNDS:2:CALBYSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "LGPS:UNDS:2:CALBYWF") field(MALM, "10") field(NELM, "6") field(INDX, "0") field(FTVL, "DOUBLE") } record(waveform, "LGPS:UNDS:2:CALBIACTWF") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "LGPS:UNDS:2:CALBIACTSA") } # Used only for xygraph edm plot record(subArray, "LGPS:UNDS:2:CALBIACTSA") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(MALM, "10") field(NELM, "6") field(INP, "LGPS:UNDS:2:CALBIACTWF") field(INDX, "0") field(FTVL, "DOUBLE") field(FLNK, "LGPS:UNDS:2:CALBLIMITS") } # Check that measured current during calibration is within # tolerance. record(aSub, "LGPS:UNDS:2: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, "LGPS:UNDS:2:CALBSTEPNUM") field(INPB, "LGPS:UNDS:2:CALBIACTWF") field(INPC, "LGPS:UNDS:2: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, "LGPS:UNDS:2: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, "LGPS:UNDS:2:STDZITOL") field(INPH, "LGPS:UNDS:2:DACSLOPE") field(INPI, "LGPS:UNDS:2: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, "LGPS:UNDS:2: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, "LGPS:UNDS:2:CALBSTEPNUM") field(INPB, "LGPS:UNDS:2:CALBIACTWF") field(INPC, "LGPS:UNDS:2:DACWF") field(INPF, "LGPS:UNDS:2: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 LGPS:UNDS:2CALBOK 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, "LGPS:UNDS:2:DEGAUSINIT") { field(DESC, "Proc. Degauss PVs on boot") field(PINI, "YES") field(DOL, "1") field(OUTA, "LGPS:UNDS:2:DEGAUSIMIN.PROC PP") field(OUTB, "LGPS:UNDS:2:DEGAUSIMAX.PROC PP") field(OUTC, "LGPS:UNDS:2:DEGAUSTYPE.PROC PP") field(OUTD, "LGPS:UNDS:2:DEGAUSSTEP.PROC PP") field(OUTE, "LGPS:UNDS:2:MADNAME.PROC PP") field(OUTF, "LGPS:UNDS:2:PSTYPE.PROC PP") field(OUTG, "LGPS:UNDS:2: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, "LGPS:UNDS:2:DEGAUSSUB") { field(DESC, "Degauss subroutine") field(INAM, "mgntDegaussInit") field(SNAM, "mgntDegauss") field(BRSV, "INVALID") field(INPA, "LGPS:UNDS:2:DEGAUSIMIN NPP NMS") field(INPB, "LGPS:UNDS:2:DEGAUSIMAX NPP NMS") field(INPC, "LGPS:UNDS:2:DEGAUSTYPE.RVAL NPP NMS") field(INPE, "LGPS:UNDS:2:DEGAUSMETHOD.RVAL NPP NMS") field(INPF, "LGPS:UNDS:2:PSTYPE NPP NMS") field(INPG, "LGPS:UNDS:2:DEBUG.RVAL NPP NMS") field(INPH, "LGPS:UNDS:2: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, "LGPS:UNDS:2:DEGAUSWF PP") field(OUTB, "LGPS:UNDS:2:DEGAUSMSG PP") field(OUTC, "LGPS:UNDS:2: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, "LGPS:UNDS:2:DEGAUSWF") { field(DESC, "Degauss Setpts") field(NELM, "60") field(FTVL, "DOUBLE") } record(mbbo,"LGPS:UNDS:2: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, "LGPS:UNDS:2: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, "LGPS:UNDS:2: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, "LGPS:UNDS:2: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, "LGPS:UNDS:2: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, "LGPS:UNDS:2:DEGAUSIMIN") { field(DESC, "Min. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "50.0") field(LOPR, "-50.0") field(DRVH, "50.0") field(DRVL, "-50.0") field(VAL, "-50.0") } record(ao, "LGPS:UNDS:2:DEGAUSIMAX") { field(DESC, "Max. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "50.0") field(LOPR, "-50.0") field(DRVH, "50.0") field(DRVL, "-50.0") field(VAL, "50.0") } # 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,"LGPS:UNDS:2: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, "LGPS:UNDS:2: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,"LGPS:UNDS:2: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, "LGPS:UNDS:2: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, "LGPS:UNDS:2: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, "LGPS:UNDS:2: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, "LGPS:UNDS:2:DEGAUSTOD") { field(DESC, "Successful Degauss Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "LGPS:UNDS:2:DEGAUSLOSTTOD") { field(DESC, "Degauss Lost Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "LGPS:UNDS:2:DEGAUSTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "LGPS:UNDS:2:DEGAUSTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "LGPS:UNDS:2: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, "LGPS:UNDS:2:DEGAUSGO") { field(DESC, "Set bdes of btrms to zero") field(ASG, "Internal") field(OUTA, "") field(OUTB, "") field(OUTC, "") field(OUTD, "") } # =========== CRYO ONLY =========== record(bo, "LGPS:UNDS:2: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, "LGPS:UNDS:2:DEGAUS_IMAX_CHECK") { field(DESC, "Check if imax shoud chg") field(CALC, "(C==4)&&(ABS(B)>ABS(A))?1:0") field(INPA, "LGPS:UNDS:2:DEGAUS_IMAX") field(INPB, "LGPS:UNDS:2:ISETPT") field(INPC, "LGPS:UNDS:2:DEGAUSTYPE.RVAL") field(OUT, "LGPS:UNDS:2:DEGAUS_IMAX_UPDATE.SELN") field(FLNK, "LGPS:UNDS:2:DEGAUS_IMAX_UPDATE") } record(seq, "LGPS:UNDS:2:DEGAUS_IMAX_UPDATE") { field(DESC, "Degauss IMAX Update") field(SELM, "Specified") field(DOL1, "LGPS:UNDS:2:ISETPT") field(LNK1, "LGPS:UNDS:2:DEGAUS_IMAX PP") } # Set the maximum current after a successful # degauss. This pv is updated by the # sequence. record(ao, "LGPS:UNDS:2:DEGAUS_IMAX") { field(DESC, "Max I set afer a degauss") field(EGU, "Amps") field(PINI, "YES") field(PREC, "6") field(HOPR, "50.0") field(LOPR, "-50.0") field(DRVH, "50.0") field(DRVL, "-50.0") field(VAL, "50.0") field(FLNK, "LGPS:UNDS:2:DEGAUS_IMAXPOL_CHECK") info(autosaveFields,"VAL,RVAL") } # Set the polarity if degauss_imax record(calcout, "LGPS:UNDS:2:DEGAUS_IMAXPOL_CHECK") { field(DESC, "Determine polarity of imax") field(CALC, "A>=0?0:1") field(INPA, "LGPS:UNDS:2:DEGAUS_IMAX") field(FLNK, "LGPS:UNDS:2:DEGAUS_IMAXPOL") } record(bo, "LGPS:UNDS:2:DEGAUS_IMAXPOL") { field(DESC, "Polarity of imax I") field(DTYP, "Raw Soft Channel") field(DOL, "LGPS:UNDS:2:DEGAUS_IMAXPOL_CHECK") field(OMSL, "closed_loop") field(ZNAM, "Positive") field(ONAM, "Negative") field(FLNK, "LGPS:UNDS:2: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, "LGPS:UNDS:2:DEGAUS_ABSIMAX") { field(DESC, "Absolute Max. Degauss I") field(CALC, "ABS(A)") field(INPA, "LGPS:UNDS:2:DEGAUS_IMAX") field(PREC, "6") field(EGU, "Amps") field(HOPR, "50.0") field(LOPR, "-50.0") info(autosaveFields,"VAL RVAL") } # IACT Polarity record(calcout, "LGPS:UNDS:2:IACTPOL_CHECK") { field(DESC, "Determine IACT polarity") field(SCAN, "5 second") field(CALC, "ABS(A-B)>C?(A>=0?0:1):D") field(INPA, "LGPS:UNDS:2:IACT") field(INPB, "LGPS:UNDS:2:IACTPOL_CHECK.LA") field(INPC, "0.0001") field(INPD, "LGPS:UNDS:2:IACTPOL_CHECK.PVAL") field(OOPT, "On Change") field(FLNK, "LGPS:UNDS:2:IACTPOL") } record(bo, "LGPS:UNDS:2: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,"LGPS:UNDS:2: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, "LGPS:UNDS:2:DEGAUSENABLE CP") field(INPB, "LGPS:UNDS:2:DEGAUSOK") field(INPC, "LGPS:UNDS:2:STATE CP") field(INPD, "LGPS:UNDS:2:STATE.SEVR") field(OUT, "LGPS:UNDS:2:DEGAUS_STATE_SEQ.SELN PP") field(ASG, "Internal") } record(seq, "LGPS:UNDS:2:DEGAUS_STATE_SEQ") { field(DESC, "Degauss State Sequence") field(SELM, "Specified") field(SELL, "LGPS:UNDS:2:DEGAUS_STATE_CHECK") field(LNK1, "LGPS:UNDS:2:DEGAUS_STATE_DISABLE.PROC PP") field(LNK2, "LGPS:UNDS:2:DEGAUS_STATE_LOST.PROC PP") field(LNK3, "LGPS:UNDS:2:DEGAUS_STATE_GOOD.PROC PP") field(LNK4, "LGPS:UNDS:2: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, "LGPS:UNDS:2:DEGAUS_STATE_DISABLE") { field(DESC, "Degauss not used") field(LNK1, "LGPS:UNDS:2:DEGAUSOK.ZSV") field(LNK2, "LGPS:UNDS:2: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, "LGPS:UNDS:2:STATMSG.FRSV") field(LNK4, "LGPS:UNDS:2: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, "LGPS:UNDS:2:DEGAUS_STATE_LOST") { field(DESC, "Degauss lost and ps On") field(DOL1, "1") field(LNK1, "LGPS:UNDS:2:DEGAUSOK.ZSV") field(LNK2, "LGPS:UNDS:2: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, "LGPS:UNDS:2:STATMSG.FRSV") field(LNK4, "LGPS:UNDS:2: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, "LGPS:UNDS:2:DEGAUS_STATE_OFF") { field(DESC, "Degaused lost and ps Off") field(DOL1, "2") field(LNK1, "LGPS:UNDS:2: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, "LGPS:UNDS:2:STATMSG.FRSV") field(LNK3, "LGPS:UNDS:2: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, "LGPS:UNDS:2:DEGAUS_STATE_GOOD") { field(DESC, "Degauss good") field(DOL1, "1") field(LNK1, "LGPS:UNDS:2: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, "LGPS:UNDS:2:STATMSG.FRSV PP") field(LNK3, "LGPS:UNDS:2:STATMSG.FVSV PP") field(LNK4, "") field(ASG, "Internal") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(mbbo, "LGPS:UNDS:2:FUNC") { field(DESC, "LGPS:UNDS:2 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, "1") field(NIVL, "2") field(TEVL, "3") field(ELVL, "0") field(TVVL, "0") field(TTVL, "0") field(FTVL, "0") field(FFVL, "0") field(OUT, "LGPS:UNDS:2:CTRL CA") } # :CTRL pv is processed at boot in the # sequence mgntCtrl.st Processed in sequence # record(mbbo, "LGPS:UNDS:2:CTRL") { field(DESC, "LGPS:UNDS:2 Control") field(PINI, "NO") field(ZRST, "Ready") field(ONST, "RESET") field(TWST, "TURN_ON") field(THST, "TURN_OFF") 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, "8") field(TWVL, "9") field(THVL, "10") 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, "LGPS:UNDS:2:SELECTEN.A PP") field(SDIS, "0") } # If a function has been selected set this unit to busy record(calcout, "LGPS:UNDS:2:SELECTEN") { field(DESC, "Control Select Enable") field(CALC, "A>0?1:A") field(FLNK, "LGPS:UNDS:2:BUSY") } # Set to FREE on IOC reboot record(bo, "LGPS:UNDS:2:BUSY") { field(DESC, "LGPS:UNDS:2 Ctrl Done") field(DOL, "LGPS:UNDS:2:SELECTEN") field(ZNAM, "FREE") field(ONAM, "BUSY") field(PINI, "YES") field(FLNK, "LGPS:UNDS:2:SELECT") } record(bo, "LGPS:UNDS:2:SELECT") { field(ZNAM, "NO") field(ONAM, "YES") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") } record(bo, "LGPS:UNDS:2: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, "LGPS:UNDS:2:CTRLSTATE") { field(DESC, "LGPS:UNDS:2 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("LGPS:UNDS:2:CTRL",20,20,0,0,"LGPS:UNDS:2:CTRL") #! Field("LGPS:UNDS:2:CTRL.OUT",16777215,1,"LGPS:UNDS:2:CTRL.OUT") #! Link("LGPS:UNDS:2:CTRL.OUT","LGPS:UNDS:2:SELECTEN.A") #! Field("LGPS:UNDS:2:CTRL.VAL",16777215,1,"LGPS:UNDS:2:CTRL.VAL") #! Record("LGPS:UNDS:2:SELECTEN",321,381,0,0,"LGPS:UNDS:2:SELECTEN") #! Field("LGPS:UNDS:2:SELECTEN.A",16777215,0,"LGPS:UNDS:2:SELECTEN.A") #! Field("LGPS:UNDS:2:SELECTEN.FLNK",16777215,1,"LGPS:UNDS:2:SELECTEN.FLNK") #! Link("LGPS:UNDS:2:SELECTEN.FLNK","LGPS:UNDS:2:BUSY") #! Field("LGPS:UNDS:2:SELECTEN.VAL",16777215,1,"LGPS:UNDS:2:SELECTEN.VAL") #! Record("LGPS:UNDS:2:BUSY",623,274,0,0,"LGPS:UNDS:2:BUSY") #! Field("LGPS:UNDS:2:BUSY.DOL",16777215,0,"LGPS:UNDS:2:BUSY.DOL") #! Link("LGPS:UNDS:2:BUSY.DOL","LGPS:UNDS:2:SELECTEN.VAL") #! Field("LGPS:UNDS:2:BUSY.FLNK",16777215,1,"LGPS:UNDS:2:BUSY.FLNK") #! Link("LGPS:UNDS:2:BUSY.FLNK","LGPS:UNDS:2:SELECT") #! Record("LGPS:UNDS:2:SELECT",669,508,0,1,"LGPS:UNDS:2:SELECT") #! Record("LGPS:UNDS:2:FUNC",940,120,0,0,"LGPS:UNDS:2:FUNC") #! Field("LGPS:UNDS:2:FUNC.OUT",16777215,0,"LGPS:UNDS:2:FUNC.OUT") #! Link("LGPS:UNDS:2:FUNC.OUT","LGPS:UNDS:2:CTRL.VAL") #! Record("LGPS:UNDS:2:ABORT",193,41,0,0,"LGPS:UNDS:2:ABORT") #! Record("LGPS:UNDS:2:CTRLSTATE",369,34,0,0,"LGPS:UNDS:2: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,"LGPS:UNDS:2:SELECT is used for Multi-device selection.\nIt is enabled when associated LGPS:UNDS:2:CTRL is \"0\" (DONE).\nIt is disabled when associated LGPS:UNDS:2: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,"LGPS:UNDS:2: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, "LGPS:UNDS:2:BCTRL_INIT") { field(DESC, "Process BCTRL on boot") field(PINI, "YES") field(CALC, "A=3?1:0") field(INPA, "LGPS:UNDS:2:BCTRL.SEVR") field(OUT, "LGPS:UNDS:2: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, "LGPS:UNDS:2:BACT") { field(DESC, "Actual B") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "LGPS:UNDS:2:BACT") field(INPB, "LGPS:UNDS:2:POLYCOEF") field(INPC, "LGPS:UNDS:2:POLYCOEF.A") field(INPD, "LGPS:UNDS:2:POLYCOEF.B") field(INPE, "LGPS:UNDS:2:IACT MS") field(INPF, "LGPS:UNDS:2:BDELTAS PP") field(INPG, "100") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(HIHI, "50.0") field(LOLO, "0.0") field(PREC, "3") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "50.0") field(LOW, "0.0") field(FLNK, "LGPS:UNDS:2: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, "LGPS:UNDS:2:BDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntPhyDeltas") field(EGU, "Volts") field(HOPR, "1") field(PREC, "3") field(BRSV, "INVALID") field(INPA, "LGPS:UNDS:2:BDES") field(INPB, "LGPS:UNDS:2:TRIMBTOL") field(INPC, "LGPS:UNDS:2:TRIMBTOLR") field(INPD, "LGPS:UNDS:2:CHCKBTOL") field(INPE, "LGPS:UNDS:2:CHCKBTOLR") field(F, "0.0") field(INPG, "30") field(INPH, "LGPS:UNDS:2:BACT.VAL") # # MPS absolute and relative tolerances field(INPP, "LGPS:UNDS:2:MPSBTOL") field(INPQ, "LGPS:UNDS:2:MPSBTOLR") field(FLNK, "LGPS:UNDS:2:BCONLIMITS") info(autosaveFields,"F") } # This record is processed by BDELTAS record(aSub, "LGPS:UNDS:2:BCONLIMITS") { field(DESC, "Config B-field Limits") field(INAM, "mgntInit") field(SNAM, "mgntBCONLimits") field(INPA, "LGPS:UNDS:2:BDES") field(INPB, "LGPS:UNDS:2:BDELTAS.I") field(INPG, "LGPS:UNDS:2:DEBUG.RVAL") field(FTA, "DOUBLE") field(FTB, "DOUBLE") field(FTG, "ULONG") field(OUTA, "LGPS:UNDS:2:BCON.HIGH") field(OUTB, "LGPS:UNDS:2:BCON.LOW") field(OUTC, "LGPS:UNDS:2:BCON.HIHI") field(OUTD, "LGPS:UNDS:2:BCON.LOLO PP") field(FTVA, "DOUBLE") field(FTVB, "DOUBLE") field(FTVC, "DOUBLE") field(FTVD, "DOUBLE") field(BRSV, "INVALID") field(FLNK, "LGPS:UNDS:2:IDELTAS") } # The following PV is processed by :BACT # which is processed by :BACT # record(fanout, "LGPS:UNDS:2:BACTFO") { field(DESC, "BACT processing") field(SELM, "All") field(LNK1, "LGPS:UNDS:2:BDIFF") field(LNK2, "LGPS:UNDS:2:BADIFF") field(LNK3, "LGPS:UNDS:2:BRATIO") field(LNK4, "LGPS:UNDS:2:MPSLIMITS") field(LNK5, "LGPS:UNDS:2:I2BSTATUS") field(LNK6, "LGPS:UNDS:2:IACTFO.PROC") } record(calc, "LGPS:UNDS:2:BDIFF") { field(DESC, "BDES-BACT") field(CALC, "A-B") field(INPA, "LGPS:UNDS:2:BDES") field(INPB, "LGPS:UNDS:2:BACT") field(EGU, "Volts") field(PREC, "7") } record(calc, "LGPS:UNDS:2:BADIFF") { field(DESC, "Absolute BDES-BACT") field(INPA, "LGPS:UNDS:2:BDIFF") field(EGU, "Volts") field(PREC, "7") field(CALC, "A<0?ABS(A):A") } record(calc, "LGPS:UNDS:2:BRATIO") { field(DESC, "BACT Error") field(CALC, "B?A/B:0") field(INPA, "LGPS:UNDS:2:BDIFF") field(INPB, "LGPS:UNDS:2:BDES.HOPR") field(EGU, "Volts") field(PREC, "7") } record(mbbi, "LGPS:UNDS:2: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, "LGPS:UNDS:2:BACT.J") } # Note: for a string slave set the MONFL # macro to the following: # MONFL=:IMONCALC MS record(sub, "LGPS:UNDS:2:BMON") { field(DESC, "Second Transductor") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "LGPS:UNDS:2:BMON") field(INPB, "LGPS:UNDS:2:POLYCOEF") field(INPC, "LGPS:UNDS:2:POLYCOEF.A") field(INPD, "LGPS:UNDS:2:POLYCOEF.B") field(INPE, "LGPS:UNDS:2:IMON MS") field(INPF, "LGPS:UNDS:2:BDELTAS.VAL") field(INPG, "100") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(HIHI, "50.0") field(LOLO, "0.0") field(PREC, "3") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "50.0") field(LOW, "0.0") } # 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:UNDS:2:BDES CP record(ao, "LGPS:UNDS:2:BDES") { field(DESC, "Desired B-Field") field(PINI, "YES") field(DRVH, "50.0") field(DRVL, "0.0") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(EGU, "Volts") field(MDEL, "-1") field(OMSL, "closed_loop") field(DOL, "LGPS:UNDS:2:BDES.DRVH") field(OUT, "LGPS:UNDS:2:B2IDES PP") info(autosaveFields,"VAL") } record(sub, "LGPS:UNDS:2:B2IDES") { field(DESC, "Convert Desired B-Field to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "LGPS:UNDS:2:POLYCOEF") field(INPC, "LGPS:UNDS:2:POLYCOEF.A") field(INPD, "LGPS:UNDS:2:POLYCOEF.B") field(PREC, "3") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(MDEL, "-1") field(INPE, "LGPS:UNDS:2:BDES.DRVH") field(INPF, "LGPS:UNDS:2:BDES.DRVL") field(BRSV, "INVALID") field(FLNK, "LGPS:UNDS:2:IDES") } record(sub, "LGPS:UNDS:2:BNOM") { field(DESC, "Nominal Field") field(PINI, "YES") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "LGPS:UNDS:2:POLYCOEF") field(INPC, "LGPS:UNDS:2:POLYCOEF.A") field(INPD, "LGPS:UNDS:2:POLYCOEF.B") field(INPE, "LGPS:UNDS:2:BDES.DRVH") field(INPF, "LGPS:UNDS:2:BDES.DRVL") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(VAL, "0.0") field(FLNK, "LGPS:UNDS:2:INOM") } record(sub, "LGPS:UNDS:2:BACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "LGPS:UNDS:2:BDES.VAL") field(INPB, "LGPS:UNDS:2:BDES.DRVH") field(INPC, "LGPS:UNDS:2:BDES.DRVL") field(INPD, "LGPS:UNDS:2:BDELTAS.I") field(INPE, "LGPS:UNDS:2:BDELTAS.J") field(INPG, "LGPS:UNDS:2:STATE") field(INPH, "LGPS:UNDS:2:HSTA") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(sub, "LGPS:UNDS:2:BMONLIMITS") { field(DESC, "MON Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "LGPS:UNDS:2:BDES.VAL") field(INPB, "LGPS:UNDS:2:BDES.DRVH") field(INPC, "LGPS:UNDS:2:BDES.DRVL") field(INPD, "LGPS:UNDS:2:BDELTAS.K") field(INPE, "LGPS:UNDS:2:BDELTAS.L") field(INPG, "LGPS:UNDS:2:STATE") field(INPH, "LGPS:UNDS:2:HSTA") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(seq, "LGPS:UNDS:2:BLIMITS") { field(DESC, "ACT Limits") field(PREC, "3") field(DOL1, "LGPS:UNDS:2:BLIMITS") field(LNK1, "LGPS:UNDS:2:BACTLIMITS.F PP") field(DOL2, "LGPS:UNDS:2:BACTLIMITS.I") field(LNK2, "LGPS:UNDS:2:BACT.HIGH") field(DOL3, "LGPS:UNDS:2:BACTLIMITS.J") field(LNK3, "LGPS:UNDS:2:BACT.LOW") field(DOL4, "LGPS:UNDS:2:BACTLIMITS.K") field(LNK4, "LGPS:UNDS:2:BACT.HIHI") field(DOL5, "LGPS:UNDS:2:BACTLIMITS.L") field(LNK5, "LGPS:UNDS:2:BACT.LOLO") field(DOL6, "LGPS:UNDS:2:BLIMITS") field(LNK6, "LGPS:UNDS:2:BMONLIMITS.F PP") field(DOL7, "LGPS:UNDS:2:BMONLIMITS.I") field(LNK7, "LGPS:UNDS:2:BMON.HIGH") field(DOL8, "LGPS:UNDS:2:BMONLIMITS.J") field(LNK8, "LGPS:UNDS:2:BMON.LOW") field(DOL9, "LGPS:UNDS:2:BMONLIMITS.K") field(LNK9, "LGPS:UNDS:2:BMON.HIHI") field(DOLA, "LGPS:UNDS:2:BMONLIMITS.L") field(LNKA, "LGPS:UNDS:2:BMON.LOLO") field(FLNK, "LGPS:UNDS:2:ILIMITS") field(SCAN, "5 second") } record(ao, "LGPS:UNDS:2:BCTRL") { field(DESC, "B-Perturb") field(PREC, "3") field(EGU, "Volts") field(DRVH, "50.0") field(DRVL, "0.0") field(HOPR, "50.0") field(LOPR, "0.0") # 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, "LGPS:UNDS:2: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, "LGPS:UNDS:2:BCTRLGO") { field(DESC, "Update DES and perturb") field(PREC, "3") # Disable BACT limits field(DOL1, "1") field(LNK1, "LGPS:UNDS:2:BLIMITS.VAL") # Update BDES with the BCTRL (slider) value field(DOL2, "LGPS:UNDS:2:BCTRL.VAL") field(LNK2, "LGPS:UNDS:2:BDES PP") field(DOL3, "1") field(LNK3, "LGPS:UNDS:2:IDIRECT.PROC PP") field(DOL4, "1") field(LNK4, "LGPS:UNDS:2:CHECKSTDZLOST.PROC PP") field(DOL5, "LGPS:UNDS:2:BCTRL.VAL") field(LNK5, "LGPS:UNDS:2:BCTRLSUB PP") # Re-enable BACT limits field(DOL6, "0") field(LNK6, "LGPS:UNDS:2:BLIMITS.VAL") } # Convert B-field to Current and output to ISETPT record(sub, "LGPS:UNDS:2:BCTRLSUB") { field(DESC, "Feedback") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "LGPS:UNDS:2:POLYCOEF") field(INPC, "LGPS:UNDS:2:POLYCOEF.A") field(INPD, "LGPS:UNDS:2:POLYCOEF.B") field(INPE, "LGPS:UNDS:2:BDES.DRVH") field(INPF, "LGPS:UNDS:2:BDES.DRVL") field(PREC, "3") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(MDEL, "-1") field(BRSV, "INVALID") field(FLNK, "LGPS:UNDS:2:ISETPT") } record(ao, "LGPS:UNDS:2:BDESPREVTRIM") { field(DESC, "trim bdes for undo") field(DTYP, "Soft Channel") field(DRVH, "50.0") field(DRVL, "0.0") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(PINI, "YES") info(autosaveFields,"VAL") } record(stringin, "LGPS:UNDS:2:MADNAME") { field(DESC, "MAD deck nomenclature") field(PINI, "YES") field(VAL, "B921-5101") } record(ai, "LGPS:UNDS:2: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, "0.0") } record(ao, "LGPS:UNDS:2:BMAX") { field(DESC, "Max B-Field") field(DTYP, "Soft Channel") field(DRVH, "50.0") field(DRVL, "0.0") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(PINI, "YES") field(VAL, "50.0") field(FLNK, "LGPS:UNDS:2:BSTEP") } record(ao, "LGPS:UNDS:2:BMIN") { field(DESC, "Min B-Field") field(DTYP, "Soft Channel") field(DRVH, "50.0") field(DRVL, "0.0") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PREC, "3") field(PINI, "YES") field(VAL, "0.0") field(FLNK, "LGPS:UNDS:2:BSTEP") } record(ao, "LGPS:UNDS:2:BDESSAVE") { field(DESC, "bdes for save/load") field(DTYP, "Soft Channel") field(DRVH, "50.0") field(DRVL, "0.0") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(PINI, "YES") field(PREC, "3") } # This record is processed by LGPS:UNDS:2: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, "LGPS:UNDS:2:BCON") { field(DESC, "Config B-Field ") field(DTYP, "Soft Channel") field(PREC, "3") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(DRVH, "50.0") field(DRVL, "0.0") # 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 , "") field(OMSL, "closed_loop") field(OUT, "LGPS:UNDS:2:B2ICON PP") info(autosaveFields,"VAL") } record(sub, "LGPS:UNDS:2:B2ICON") { field(DESC, "Convert Desired ICon to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "LGPS:UNDS:2:POLYCOEF") field(INPC, "LGPS:UNDS:2:POLYCOEF.A") field(INPD, "LGPS:UNDS:2:POLYCOEF.B") field(PREC, "3") field(EGU, "Volts") field(HOPR, "50.0") field(LOPR, "0.0") field(MDEL, "-1") field(INPE, "LGPS:UNDS:2:BCON.DRVH") field(INPF, "LGPS:UNDS:2:BCON.DRVL") field(BRSV, "INVALID") field(FLNK, "LGPS:UNDS:2: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, "LGPS:UNDS:2:BSTEP") { field(DESC, "B-Field step size") field(CALC, "(C==3)||(D==3)?0:ABS(A-B)*0.005") field(INPA, "LGPS:UNDS:2:BMAX") field(INPB, "LGPS:UNDS:2:BMIN") field(INPC, "LGPS:UNDS:2:BMIN.SEVR") field(INPD, "LGPS:UNDS:2:BMAX.SEVR") field(EGU, "Volts") 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,"LGPS:UNDS:2:BCTRLDISABLECALC") { field(DESC, "Calc for disabling BCTRL") field(ASG, "Internal") field(CALC, "A?2:1") field(INPA, "LGPS:UNDS:2:ONLINE CP") field(OUT, "LGPS:UNDS:2:BCTRLDISABLEFOUT PP") } record(fanout, "LGPS:UNDS:2:BCTRLDISABLEFOUT") { field(DESC, "Disable BCTRL fanout") field(SELM, "Specified") field(SELL, "LGPS:UNDS:2:BCTRLDISABLECALC") field(LNK1, "LGPS:UNDS:2:BCTRLDISABLE") field(LNK2, "LGPS:UNDS:2:BCTRLENABLE") } record(stringout, "LGPS:UNDS:2:BCTRLDISABLE") { field(DESC, "Disable BCTRL") field(DTYP, "Soft Channel") field(OUT, "LGPS:UNDS:2:BCTRL.ASG") field(VAL, "NOWRITE") field(FLNK, "LGPS:UNDS:2:BCTRLDISV_UPDATE") } record(stringout, "LGPS:UNDS:2:BCTRLENABLE") { field(DESC, "Enable BCTRL") field(DTYP, "Soft Channel") field(OUT, "LGPS:UNDS:2:BCTRL.ASG") field(VAL, "") field(FLNK, "LGPS:UNDS:2:BCTRLDISV_UPDATE") } record(calcout, "LGPS:UNDS:2:BCTRLDISV_UPDATE") { field(DESC, "Calc for updating BCTRL.DISV") field(ASG, "Internal") field(CALC, "A") field(INPA, "LGPS:UNDS:2:ONLINE") field(OUT, "LGPS:UNDS:2: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,"LGPS:UNDS:2:BACT and MON\n are processed via links from \n LGPS:UNDS:2:IACT (device raw value readback 1)\n and\n LGPS:UNDS:2: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 LGPS:UNDS:2:POLYCOEF\nC = First polynomial coefficient (offset if linear)\nD = Second polynomial coefficient (slope if linear)\nE = LGPS:UNDS:2: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,"LGPS:UNDS:2:BDES\n is processed when set by CA users or \n LGPS:UNDS:2: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,"LGPS:UNDS:2: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 LGPS:UNDS:2: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 (LGPS:UNDS:2: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,"LGPS:UNDS:2:B*LIMITS and LGPS:UNDS:2:BLIMITS:\n Calculate alarm and warning limits based on \n deltas from LGPS:UNDS:2: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,"LGPS:UNDS:2: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,"LGPS:UNDS:2: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, "LGPS:UNDS:2: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, "LGPS:UNDS:2:MPSBTOL") { field(DESC, "Absolute mps tol") field(EGU, "Volts") field(PREC, "2") field(CALC, "ABS(A)*0.02") field(INPA, "LGPS:UNDS:2:BMAX") field(PINI, "YES") } # # 21-Aug-2013: K. Luchini # Set channel access security so that users # cannot easily change values. record(ao, "LGPS:UNDS:2:MPSBMAX") { field(DESC, "MPS Max B-field") field(EGU, "Volts") field(PREC, "7") field(DRVH, "50.0") field(DRVL, "0.0") field(PINI, "YES") field(VAL, "50.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "LGPS:UNDS:2:MPSBMIN") { field(DESC, "MPS Min B-field") field(EGU, "Volts") field(PREC, "7") field(DRVH, "50.0") field(DRVL, "0.0") field(PINI, "YES") field(VAL, "0.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "LGPS:UNDS:2:MPSBLLIM") { field(DESC, "MPS Low Limit B-field") field(EGU, "Volts") field(PREC, "7") field(DRVH, "50.0") field(DRVL, "0.0") field(PINI, "YES") field(VAL, "0.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "LGPS:UNDS:2:MPSBLLIM2") { field(DESC, "MPS Low Limit #2 B-field") field(EGU, "Volts") field(PREC, "7") field(DRVH, "50.0") field(DRVL, "0.0") field(PINI, "YES") field(VAL, "0.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } # Set the default to Std record(mbbo, "LGPS:UNDS:2: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, "LGPS:UNDS:2:MPSLIMITS.E PP") } record(aSub, "LGPS:UNDS:2: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, "LGPS:UNDS:2:MPS.RVAL") field(INPB, "LGPS:UNDS:2:BADIFF") field(INPC, "LGPS:UNDS:2:BDELTAS.N") field(INPD, "LGPS:UNDS:2:BACT") field(INPE, "LGPS:UNDS:2:MPSBITMASK.RVAL") field(INPF, "LGPS:UNDS:2:MPSBLLIM") field(INPG, "LGPS:UNDS:2:MPSBMIN") field(INPH, "LGPS:UNDS:2:MPSBMAX") field(INPI, "LGPS:UNDS:2: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, "LGPS:UNDS:2:INTOL.RVAL PP") field(OUTB, "LGPS:UNDS:2:INTOL_BMIN.RVAL PP") field(OUTC, "LGPS:UNDS:2:INTOL_BRANGE.RVAL PP") field(OUTD, "LGPS:UNDS:2: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, "LGPS:UNDS:2:INTOL") { field(DESC, "BACT within MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "LGPS:UNDS:2:MPSLIMITS.VALA") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "LGPS:UNDS:2:INTOL_BMIN") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "LGPS:UNDS:2:MPSLIMITS.VALB") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "LGPS:UNDS:2:INTOL_BMIN2") { field(DESC, "MPS tol #2") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "LGPS:UNDS:2:MPSLIMITS.VALD") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "LGPS:UNDS:2:INTOL_BRANGE") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "LGPS:UNDS:2: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, "LGPS:UNDS:2:CHCKITOL") { field(DESC, "Absolute Check I Tolerance") field(EGU, "A") field(FLNK, "LGPS:UNDS:2:TRIMITOL") field(CALC, "ABS(A*B)") field(INPA, "LGPS:UNDS:2:CHCKBTOL") field(INPB, "LGPS:UNDS:2:POLYCOEF.B") field(PREC, "9") } record(calc, "LGPS:UNDS:2:TRIMBTOL") { field(EGU, "Volts") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(DESC, "Absolute Trim Tolerance") field(CALC, "ABS(A)/2") field(INPA, "LGPS:UNDS:2:CHCKBTOL") field(FLNK, "LGPS:UNDS:2:CHCKITOL") } record(calc, "LGPS:UNDS:2:CHCKBTOL") { field(DESC, "Check absolute tolerance") field(EGU, "A") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(FLNK, "LGPS:UNDS:2:TRIMBTOL") field(CALC, "MAX(ABS(A),ABS(C))*(B/1000000)") field(INPA, "LGPS:UNDS:2:BDES.HOPR") field(INPB, "LGPS:UNDS:2:STABILITY") field(INPC, "LGPS:UNDS:2:BDES.LOPR") } record(longout, "LGPS:UNDS:2:STABILITY") { field(DESC, "Long Term Stability") field(PINI, "YES") field(VAL, "15000") field(EGU, "ppm") field(DRVH, "20000") field(DRVL, "100") field(HOPR, "20000") field(LOPR, "100") field(FLNK, "LGPS:UNDS:2:CHCKBTOL") } record(calc, "LGPS:UNDS:2:TRIMITOL") { field(DESC, "Absolute Trim I Tolerance") field(EGU, "Volts") field(CALC, "ABS(A*B)") field(INPA, "LGPS:UNDS:2:POLYCOEF.B") field(INPB, "LGPS:UNDS:2:TRIMBTOL") field(PREC, "9") } record(ai, "LGPS:UNDS:2:TRIMBTOLR") { field(DESC, "Relative trim tol") field(PREC, "4") field(EGU, "%") field(HOPR, "1.0") field(LOPR, "0.0") field(PINI, "YES") } record(ai, "LGPS:UNDS:2: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, "LGPS:UNDS:2:FBCKFCOM") { field(ZNAM, "CA") field(ONAM, "FCOM") field(DESC, "CA Mode") field(PINI, "YES") field(SDIS, "0") } record(bo, "LGPS:UNDS:2:PAU") { field(ZNAM, "NotConfigured") field(ONAM, "Configured") field(DESC, "PAU Present") field(PINI, "YES") field(SDIS, "0") field(FLNK, "LGPS:UNDS:2:PAUGO") } record(fanout, "LGPS:UNDS:2:PAUGO") { field(DESC, "PAU control") field(LNK1, "LGPS:UNDS:2:PAUSTOP") field(LNK2, "LGPS:UNDS:2: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, "LGPS:UNDS:2:PAUSTART") { field(DESC, "Setup for PAU On") field(SDIS, "LGPS:UNDS:2: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, "LGPS:UNDS:2:PAUSTOP") { field(DESC, "Setup for PAU Off") field(SDIS, "LGPS:UNDS:2: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, "LGPS:UNDS:2:MCORDEVNAME") { field(DESC, "PS device name") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, "PS:UNDS:2:") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "LGPS:UNDS:2: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, "LGPS:UNDS:2:PSTYPE.RVAL") field(INPC, "LGPS:UNDS:2:TURNEDOFF.RVAL") field(INPD, "LGPS:UNDS:2:CONFIG.RVAL") field(INPE, "LGPS:UNDS:2:PSCATEGORY.RVAL") field(INPF, "LGPS:UNDS:2:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "LGPS:UNDS:2:AUTOCTRL.RVAL") field(INPJ, "LGPS:UNDS:2:OUTOFSERVICE.RVAL") field(INPL, "LGPS:UNDS:2:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "LGPS:UNDS:2:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "LGPS:UNDS:2:PAU") field(INPP, "LGPS:UNDS:2:CALBDISABLE.RVAL") field(INPQ, "LGPS:UNDS:2:PTRBDISABLE.RVAL") field(INPR, "LGPS:UNDS:2:TRIMDISABLE.RVAL") field(INPS, "LGPS:UNDS:2:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "LGPS:UNDS:2:FBCK") field(INPU, "LGPS:UNDS:2:TRIMTYPE.RVAL") field(INPV, "LGPS:UNDS:2:STDZDIRECT.RVAL") field(INPW, "LGPS:UNDS:2:DEGAUSENABLE.RVAL") field(FLNK, "LGPS:UNDS:2:HSTA") } record(longin, "LGPS:UNDS:2:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "LGPS:UNDS:2:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "LGPS:UNDS:2: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, "LGPS:UNDS:2: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, "LGPS:UNDS:2: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, "LGPS:UNDS:2: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, "LGPS:UNDS:2: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, "LGPS:UNDS:2: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 LGPS:UNDS:2:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses LGPS:UNDS:2:FBCK. # This PV should be replaced by LGPS:UNDS:2: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, "LGPS:UNDS:2: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, "LGPS:UNDS:2: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, "LGPS:UNDS:2: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, "") field(OMSL, "supervisory") field(FLNK, "LGPS:UNDS:2:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"LGPS:UNDS:2:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "LGPS:UNDS:2:OUTOFSERVICE NPP NMS") field(OUT, "LGPS:UNDS:2:ONLINE PP") } record(bo, "LGPS:UNDS:2:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "LGPS:UNDS:2: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, "1") } record(bo, "LGPS:UNDS:2: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, "1") } record(bo, "LGPS:UNDS:2: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, "1") } # This PV is modified by :STATSUB.U record(bo, "LGPS:UNDS:2: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, "LGPS:UNDS:2: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, "LGPS:UNDS:2: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, "LGPS:UNDS:2: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, "LGPS:UNDS:2: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, "1") field(ASG, "NOWRITE") } record(mbbo, "LGPS:UNDS:2: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, "2") field(ASG, "NOWRITE") } record(mbbo, "LGPS:UNDS:2: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, "3") field(ASG, "NOWRITE") } record(mbbo, "LGPS:UNDS:2: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, "0") field(ASG, "NOWRITE") field(FLNK, "LGPS:UNDS:2:TRIMTYPE") } record(stringout, "LGPS:UNDS:2:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "LGPS:UNDS:2:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "LGPS:UNDS:2:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "LGPS:UNDS:2:STATE.RVAL") field(INPB, "LGPS:UNDS:2:INTLKSUMY.RVAL") field(OUT, "LGPS:UNDS:2:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "LGPS:UNDS:2: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, "LGPS:UNDS:2:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "LGPS:UNDS:2:STATE.RVAL") field(INPB, "LGPS:UNDS:2:INTLKSUMY.RVAL") field(OUT, "LGPS:UNDS:2:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "LGPS:UNDS:2:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "LGPS:UNDS:2:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "LGPS:UNDS:2: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, "LGPS:UNDS:2: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, "LGPS:UNDS:2: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, "LGPS:UNDS:2: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,"LGPS:UNDS:2: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("LGPS:UNDS:2:TURNEDOFF",3140,1907,0,1,"LGPS:UNDS:2:TURNEDOFF") #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "LGPS:UNDS:2:STATSUB") { field(DESC, "Build STATus ") field(INAM, "mgntInit") field(SNAM, "mgntSlcStat") field(INPA, "LGPS:UNDS:2:BACT.STAT") field(INPB, "LGPS:UNDS:2:BDES.STAT") field(INPC, "LGPS:UNDS:2:IRIPL.STAT") field(INPD, "PS:UNDS:2:ISETPT.STAT") field(INPE, "PS:UNDS:2:IACT.STAT") # 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, "LGPS:UNDS:2:BACT.SEVR") field(INPH, "LGPS:UNDS:2:BDES.SEVR") field(INPI, "LGPS:UNDS:2:IRIPL.SEVR") field(INPJ, "PS:UNDS:2:ISETPT.SEVR") field(INPK, "PS:UNDS:2:IACT.SEVR") # # 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, "LGPS:UNDS:2:STATE.RVAL") field(INPN, "LGPS:UNDS:2:STDZOK") field(INPO, "LGPS:UNDS:2:CALBOK") field(INPP, "LGPS:UNDS:2:OUTOFSERVICE.RVAL") field(INPQ, "LGPS:UNDS:2:CONFIG.RVAL") field(INPR, "LGPS:UNDS:2:HSTA") field(INPS, "LGPS:UNDS:2:CTRL.RVAL") field(INPT, "LGPS:UNDS:2:DEGAUSOK") field(INPV, "LGPS:UNDS:2: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, "LGPS:UNDS:2:STAT") } record(longout, "LGPS:UNDS:2:STAT") { field(DESC, "STAT sent to SLC") field(SCAN, "Passive") field(FLNK, "LGPS:UNDS:2:STATCTRLSUB") field(DOL, "LGPS:UNDS:2:STATSUB.VAL") field(OMSL, "closed_loop") } record(sSub, "LGPS:UNDS:2:STATCTRLSUB") { field(DESC, "Decode SLC STAT into mbbo") field(INAM, "mgntInit") field(SNAM, "mgntStatDecode") field(INPA, "LGPS:UNDS:2:STAT") field(INPB, "LGPS:UNDS:2:HSTA") field(INPD, "LGPS:UNDS:2:ONOFFCTRL.RVAL") field(FLNK, "LGPS:UNDS:2:STATMSG") } record(mbbo, "LGPS:UNDS:2: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, "LGPS:UNDS:2:UNAVAILGO") field(DOL, "LGPS:UNDS:2:STATCTRLSUB.W") } record(seq, "LGPS:UNDS:2:UNAVAILGO") { field(DESC, "Process UNAVAIL") field(DOL1, "LGPS:UNDS:2:STATSUB.U") field(LNK1, "LGPS:UNDS:2:UNAVAIL PP") } record(stringout, "LGPS:UNDS:2:SNLSTATMSG") { field(DTYP, "Soft Channel") } #! TextBox(TB0,820,1000,1200,1220,0,"Dialog",12,1,16777215,"LGPS:UNDS:2:STATUSSUB - future\nOverall device status - takes input from action snls, record sevrs, master snl(s) and outputs final status\n\nInputs:\nA - LGPS:UNDS:2:CTRLSTATUS - snl status\nB - MGNT:CTRLSTATUS - master list status\nC\nD - LGPS:UNDS:2: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,"LGPS:UNDS:2STATSUB\nformat control bo's into slc STAT\n\nInputs:\nA - LGPS:UNDS:2:STATUS\nC - LGPS:UNDS:2:ON\nD - LGPS:UNDS:2:STDZOK\nE - LGPS:UNDS:2:CALBOK\nF - LGPS:UNDS:2:BACTDRIFT (future)\nG -\nH- LGPS:UNDS:2:DACSTATUS\nI -LGPS:UNDS:2:ADCSTATUS\nJ - LGPS:UNDS:2:BACTSTATUS\nK - LGPS:UNDS:2:BDESSTATUS\nL - LGPS:UNDS:2:RIPLSTATUS\n\nOutput:\nP - LGPS:UNDS:2: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, "LGPS:UNDS:2: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, "LGPS:UNDS:2: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, "LGPS:UNDS:2: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, "LGPS:UNDS:2: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.6 #! DBDSTART #! DBD("../../../../dbd/mgntSoft.dbd") #! DBDEND record(stringout, "LGPS:UNDS:2:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "LGPS:UNDS:2:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "LGPS:UNDS:2:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "LGPS:UNDS:2:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "LGPS:UNDS:2:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "LGPS:UNDS:2:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "1") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "LGPS:UNDS:2: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, "LGPS:UNDS:2:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "LGPS:UNDS:2:TRIMTYPE.RVAL") field(INPB, "LGPS:UNDS:2:CONFIG.RVAL") field(OUT, "LGPS:UNDS:2:TRIMMAXNUM PP") } record(longout, "LGPS:UNDS:2: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, "LGPS:UNDS:2:TRIMRAMPRATE") { field(DESC, "Trim Ramp rate ") field(PINI, "YES") field(ASG, "IOC_MAINT") field(PREC, "3") field(EGU, "Volts/sec") field(HOPR, "20.0") field(DRVH, "20.0") field(DRVL, "0.1") field(LOPR, "0.5") # field(DOL, "") field(OMSL, "supervisory") field(VAL, "10") field(OUT, "LGPS:UNDS:2:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "LGPS:UNDS:2: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, "") field(OMSL, "supervisory") field(VAL, "10") } record(bo, "LGPS:UNDS:2: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, "LGPS:UNDS:2: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, "LGPS:UNDS:2:TRIMSTEPMIN") { field(DESC, "Min step in current") field(DTYP, "Soft Channel") # field(DOL, "") field(PREC, "7") field(EGUF, "10") field(EGUL, "0") field(EGU, "Volts") field(HOPR, "10") field(LOPR, "0") field(VAL, "5.0") } record(bo, "LGPS:UNDS:2:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "0") } record(ao, "LGPS:UNDS:2: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, "LGPS:UNDS:2:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "LGPS:UNDS:2: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, "LGPS:UNDS:2: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, "LGPS:UNDS:2:IMOVE") field(INPB, "LGPS:UNDS:2:IACT") field(INPC, "LGPS:UNDS:2:IRAMPRATE") field(INPD, "1.0") field(INPE, "LGPS:UNDS:2:TRIMDLYPCT") field(INPF, "LGPS:UNDS:2:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "LGPS:UNDS:2:RAMPTIME_LEFT PP") } record(longout, "LGPS:UNDS:2:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "LGPS:UNDS:2:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "LGPS:UNDS:2:RAMPDONE_CALC") } record(calc, "LGPS:UNDS:2:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "LGPS:UNDS:2:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "LGPS:UNDS:2:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "LGPS:UNDS:2: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, "LGPS:UNDS:2:RAMPTIME_LEFT") field(OUT, "LGPS:UNDS:2:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "LGPS:UNDS:2:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "LGPS:UNDS:2:RAMPTIME_LEFT NMS") field(OUT, "LGPS:UNDS:2:RAMPDONE PP") } record(bo, "LGPS:UNDS:2:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "LGPS:UNDS:2:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "LGPS:UNDS:2: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, "LGPS:UNDS:2: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(ai, "LGPS:UNDS:2: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, "LGPS:UNDS:2:MPSBTOL") { field(DESC, "Absolute mps tol") field(EGU, "Volts") field(PREC, "2") field(CALC, "ABS(A)*0.02") field(INPA, "LGPS:UNDS:2:BMAX") field(PINI, "YES") } # # 21-Aug-2013: K. Luchini # Set channel access security so that users # cannot easily change values. record(ao, "LGPS:UNDS:2:MPSBMAX") { field(DESC, "MPS Max B-field") field(EGU, "Volts") field(PREC, "7") field(DRVH, "50.0") field(DRVL, "0.0") field(PINI, "YES") field(VAL, "50.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "LGPS:UNDS:2:MPSBMIN") { field(DESC, "MPS Min B-field") field(EGU, "Volts") field(PREC, "7") field(DRVH, "50.0") field(DRVL, "0.0") field(PINI, "YES") field(VAL, "0.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "LGPS:UNDS:2:MPSBLLIM") { field(DESC, "MPS Low Limit B-field") field(EGU, "Volts") field(PREC, "7") field(DRVH, "50.0") field(DRVL, "0.0") field(PINI, "YES") field(VAL, "0.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "LGPS:UNDS:2:MPSBLLIM2") { field(DESC, "MPS Low Limit #2 B-field") field(EGU, "Volts") field(PREC, "7") field(DRVH, "50.0") field(DRVL, "0.0") field(PINI, "YES") field(VAL, "0.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } # Set the default to Std record(mbbo, "LGPS:UNDS:2: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, "LGPS:UNDS:2:MPSLIMITS.E PP") } record(aSub, "LGPS:UNDS:2: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, "LGPS:UNDS:2:MPS.RVAL") field(INPB, "LGPS:UNDS:2:BADIFF") field(INPC, "LGPS:UNDS:2:BDELTAS.N") field(INPD, "LGPS:UNDS:2:BACT") field(INPE, "LGPS:UNDS:2:MPSBITMASK.RVAL") field(INPF, "LGPS:UNDS:2:MPSBLLIM") field(INPG, "LGPS:UNDS:2:MPSBMIN") field(INPH, "LGPS:UNDS:2:MPSBMAX") field(INPI, "LGPS:UNDS:2: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, "LGPS:UNDS:2:INTOL.RVAL PP") field(OUTB, "LGPS:UNDS:2:INTOL_BMIN.RVAL PP") field(OUTC, "LGPS:UNDS:2:INTOL_BRANGE.RVAL PP") field(OUTD, "LGPS:UNDS:2: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, "LGPS:UNDS:2:INTOL") { field(DESC, "BACT within MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "LGPS:UNDS:2:MPSLIMITS.VALA") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "LGPS:UNDS:2:INTOL_BMIN") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "LGPS:UNDS:2:MPSLIMITS.VALB") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "LGPS:UNDS:2:INTOL_BMIN2") { field(DESC, "MPS tol #2") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "LGPS:UNDS:2:MPSLIMITS.VALD") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "LGPS:UNDS:2:INTOL_BRANGE") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "LGPS:UNDS:2: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, "LGPS:UNDS:2:CHCKITOL") { field(DESC, "Absolute Check I Tolerance") field(EGU, "A") field(FLNK, "LGPS:UNDS:2:TRIMITOL") field(CALC, "ABS(A*B)") field(INPA, "LGPS:UNDS:2:CHCKBTOL") field(INPB, "LGPS:UNDS:2:POLYCOEF.B") field(PREC, "9") } record(calc, "LGPS:UNDS:2:TRIMBTOL") { field(EGU, "Volts") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(DESC, "Absolute Trim Tolerance") field(CALC, "ABS(A)/2") field(INPA, "LGPS:UNDS:2:CHCKBTOL") field(FLNK, "LGPS:UNDS:2:CHCKITOL") } record(calc, "LGPS:UNDS:2:CHCKBTOL") { field(DESC, "Check absolute tolerance") field(EGU, "A") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(FLNK, "LGPS:UNDS:2:TRIMBTOL") field(CALC, "MAX(ABS(A),ABS(C))*(B/1000000)") field(INPA, "LGPS:UNDS:2:BDES.HOPR") field(INPB, "LGPS:UNDS:2:STABILITY") field(INPC, "LGPS:UNDS:2:BDES.LOPR") } record(longout, "LGPS:UNDS:2:STABILITY") { field(DESC, "Long Term Stability") field(PINI, "YES") field(VAL, "1000") field(EGU, "ppm") field(DRVH, "20000") field(DRVL, "100") field(HOPR, "20000") field(LOPR, "100") field(FLNK, "LGPS:UNDS:2:CHCKBTOL") } record(calc, "LGPS:UNDS:2:TRIMITOL") { field(DESC, "Absolute Trim I Tolerance") field(EGU, "Volts") field(CALC, "ABS(A*B)") field(INPA, "LGPS:UNDS:2:POLYCOEF.B") field(INPB, "LGPS:UNDS:2:TRIMBTOL") field(PREC, "9") } record(ai, "LGPS:UNDS:2:TRIMBTOLR") { field(DESC, "Relative trim tol") field(PREC, "4") field(EGU, "%") field(HOPR, "1.0") field(LOPR, "0.0") field(PINI, "YES") } record(ai, "LGPS:UNDS:2: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.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "LGPS:UNDS:2: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, "LGPS:UNDS:2:PSTYPE.RVAL") field(INPC, "LGPS:UNDS:2:TURNEDOFF.RVAL") field(INPD, "LGPS:UNDS:2:CONFIG.RVAL") field(INPE, "LGPS:UNDS:2:PSCATEGORY.RVAL") field(INPF, "LGPS:UNDS:2:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "LGPS:UNDS:2:AUTOCTRL.RVAL") field(INPJ, "LGPS:UNDS:2:OUTOFSERVICE.RVAL") field(INPL, "LGPS:UNDS:2:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "LGPS:UNDS:2:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "LGPS:UNDS:2:PAU") field(INPP, "LGPS:UNDS:2:CALBDISABLE.RVAL") field(INPQ, "LGPS:UNDS:2:PTRBDISABLE.RVAL") field(INPR, "LGPS:UNDS:2:TRIMDISABLE.RVAL") field(INPS, "LGPS:UNDS:2:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "LGPS:UNDS:2:FBCK") field(INPU, "LGPS:UNDS:2:TRIMTYPE.RVAL") field(INPV, "LGPS:UNDS:2:STDZDIRECT.RVAL") field(INPW, "LGPS:UNDS:2:DEGAUSENABLE.RVAL") field(FLNK, "LGPS:UNDS:2:HSTA") } record(longin, "LGPS:UNDS:2:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "LGPS:UNDS:2:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "LGPS:UNDS:2: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, "LGPS:UNDS:2: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, "LGPS:UNDS:2: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, "LGPS:UNDS:2: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, "LGPS:UNDS:2: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, "LGPS:UNDS:2: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 LGPS:UNDS:2:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses LGPS:UNDS:2:FBCK. # This PV should be replaced by LGPS:UNDS:2: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, "LGPS:UNDS:2: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, "LGPS:UNDS:2: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, "LGPS:UNDS:2: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, "") field(OMSL, "supervisory") field(FLNK, "LGPS:UNDS:2:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"LGPS:UNDS:2:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "LGPS:UNDS:2:OUTOFSERVICE NPP NMS") field(OUT, "LGPS:UNDS:2:ONLINE PP") } record(bo, "LGPS:UNDS:2:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "PS:UNDS:2:CommLink PP") } record(bo, "LGPS:UNDS:2: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, "1") } record(bo, "LGPS:UNDS:2: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, "1") } record(bo, "LGPS:UNDS:2: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, "1") } # This PV is modified by :STATSUB.U record(bo, "LGPS:UNDS:2: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, "LGPS:UNDS:2: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, "LGPS:UNDS:2: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, "LGPS:UNDS:2: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, "LGPS:UNDS:2: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, "1") field(ASG, "NOWRITE") } record(mbbo, "LGPS:UNDS:2: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, "2") field(ASG, "NOWRITE") } record(mbbo, "LGPS:UNDS:2: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, "5") field(ASG, "NOWRITE") } record(mbbo, "LGPS:UNDS:2: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, "0") field(ASG, "NOWRITE") field(FLNK, "LGPS:UNDS:2:TRIMTYPE") } record(stringout, "LGPS:UNDS:2:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "LGPS:UNDS:2:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "LGPS:UNDS:2:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "LGPS:UNDS:2:STATE.RVAL") field(INPB, "LGPS:UNDS:2:INTLKSUMY.RVAL") field(OUT, "LGPS:UNDS:2:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "LGPS:UNDS:2: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, "LGPS:UNDS:2:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "LGPS:UNDS:2:STATE.RVAL") field(INPB, "LGPS:UNDS:2:INTLKSUMY.RVAL") field(OUT, "LGPS:UNDS:2:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "LGPS:UNDS:2:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "LGPS:UNDS:2:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "LGPS:UNDS:2: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, "LGPS:UNDS:2: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, "LGPS:UNDS:2: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, "LGPS:UNDS:2: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,"LGPS:UNDS:2: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("LGPS:UNDS:2:TURNEDOFF",3140,1907,0,1,"LGPS:UNDS:2:TURNEDOFF") #! 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, "BEND:LTUS:166:IACT") { field(DESC, "Current") field(INP, "PSC:LTUS:MG03:IACT") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "BEND:LTUS:166:BACT") info(autosaveFields,"HYST") } record(bi, "BEND:LTUS:166:STATE") { field(DESC, "PS On/Off Status") field(DTYP, "Raw Soft Channel") field(INP, "PSC:LTUS:MG03:STATE NPP MS") field(ZSV, "MAJOR") field(ZNAM, "OFF") field(ONAM, "ON") } record(ao, "BEND:LTUS:166:IDES") { field(DESC, "Desired Current") field(PREC, "3") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(MDEL, "-1") field(HIHI, "250.0") field(LOLO, "0.0") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "BEND:LTUS:166:BDELTAS") field(DRVH, "250.0") field(DRVL, "0.0") field(DOL, "BEND:LTUS:166: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, "BEND:LTUS:166:ICTRL PP") } # This record is processed by BEND:LTUS:166:ICON") # Note: we are not setting alarms here. record(ao, "BEND:LTUS:166:ICON") { field(DESC, "Config I") field(DTYP, "Soft Channel") field(PREC, "3") field(HOPR, "250.0") field(LOPR, "0.0") field(DRVH, "250.0") field(DRVL, "0.0") field(DOL, "BEND:LTUS:166:B2ICON.K") field(OMSL, "closed_loop") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:166:INOM") { field(DESC, "Nominal Current") field(DOL, "BEND:LTUS:166:BNOM.K") field(OMSL, "closed_loop") field(PREC, "3") field(EGU, "A") field(DRVH, "250.0") field(DRVL, "0.0") field(HOPR, "250.0") field(LOPR, "0.0") } record(ao, "BEND:LTUS:166:ICTRL") { field(DESC, "Set Current") field(PREC, "3") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(DRVH, "250.0") field(DRVL, "0.0") field(MDEL, "-1") field(FLNK, "BEND:LTUS:166:ICTRLGO") field(OMSL, "supervisory") info(autosavefields,"VAL") } record(seq, "BEND:LTUS:166:ICTRLGO") { field(DESC, "Process Current Setpoint") field(PREC, "3") # Set ISETPT to supervisory field(DOL1, "0") field(LNK1, "BEND:LTUS:166:ISETPT.OMSL") field(DOL2, "BEND:LTUS:166:ICTRL") field(LNK2, "BEND:LTUS:166:ISETPT PP") # Set ISETPT to closed loop - get data from BCTRLSUB.K field(DOL3, "1") field(LNK3, "BEND:LTUS:166:ISETPT.OMSL") } record(ao, "BEND:LTUS:166:IMAX") { field(DESC, "Max I") field(DTYP, "Soft Channel") field(DRVH, "250.0") field(DRVL, "0.0") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(PREC, "3") field(PINI, "YES") field(VAL, "250.0") field(FLNK, "BEND:LTUS:166:IMIN") } record(ao, "BEND:LTUS:166:IMIN") { field(DESC, "Min I") field(DTYP, "Soft Channel") field(DRVH, "250.0") field(DRVL, "0.0") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(PREC, "3") field(VAL, "0.0") field(FLNK, "BEND:LTUS:166:IRANGE") } record(sel, "BEND:LTUS:166:IACTPREVOK") { field(DESC, "Last Good Current") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(PREC, "3") field(NVL, "BEND:LTUS:166:BACT.SEVR") field(INPA, "BEND:LTUS:166:IACT NPP MS") field(INPB, "BEND:LTUS:166:IACTPREVOK NPP MS") field(INPC, "BEND:LTUS:166:IACTPREVOK NPP MS") field(INPD, "BEND:LTUS:166:IACTPREVOK NPP MS") } record(sub, "BEND:LTUS:166:IACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "BEND:LTUS:166:IDES") field(INPB, "BEND:LTUS:166:ISETPT.DRVH") field(INPC, "BEND:LTUS:166:ISETPT.DRVL") field(INPD, "BEND:LTUS:166:IDELTAS.I") field(INPE, "BEND:LTUS:166:IDELTAS.J") field(INPG, "BEND:LTUS:166:STATE") field(INPH, "BEND:LTUS:166:HSTA") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(sub, "BEND:LTUS:166:IMONLIMITS") { field(DESC, "Aux Current Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "BEND:LTUS:166:IDES") field(INPB, "BEND:LTUS:166:ISETPT.DRVH") field(INPC, "BEND:LTUS:166:ISETPT.DRVL") field(INPD, "BEND:LTUS:166:IDELTAS.K") field(INPE, "BEND:LTUS:166:IDELTAS.L") field(INPG, "BEND:LTUS:166:STATE") field(INPH, "BEND:LTUS:166:HSTA") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(seq, "BEND:LTUS:166:ILIMITS") { field(DESC, "Set ACT and MON Limits") field(PREC, "3") field(DOL1, "BEND:LTUS:166:BLIMITS") field(LNK1, "BEND:LTUS:166:IACTLIMITS.F PP") field(DOL2, "BEND:LTUS:166:IACTLIMITS.I") field(LNK2, "BEND:LTUS:166:IACT.HIGH") field(DOL3, "BEND:LTUS:166:IACTLIMITS.J") field(LNK3, "BEND:LTUS:166:IACT.LOW") field(DOL4, "BEND:LTUS:166:IACTLIMITS.K") field(LNK4, "BEND:LTUS:166:IACT.HIHI") field(DOL5, "BEND:LTUS:166:IACTLIMITS.L") field(LNK5, "BEND:LTUS:166:IACT.LOLO") field(DOL6, "BEND:LTUS:166:BLIMITS") field(LNK6, "BEND:LTUS:166:IMONLIMITS.F PP") field(DOL7, "BEND:LTUS:166:IMONLIMITS.I") field(LNK7, "BEND:LTUS:166:IMON.HIGH") field(DOL8, "BEND:LTUS:166:IMONLIMITS.J") field(LNK8, "BEND:LTUS:166:IMON.LOW") field(DOL9, "BEND:LTUS:166:IMONLIMITS.K") field(LNK9, "BEND:LTUS:166:IMON.HIHI") field(DOLA, "BEND:LTUS:166:IMONLIMITS.L") field(LNKA, "BEND:LTUS:166: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, "BEND:LTUS:166:IDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntRawDeltas") field(INPD, "BEND:LTUS:166:TRIMBTOL") field(INPE, "BEND:LTUS:166:CHCKBTOL") field(INPF, "BEND:LTUS:166:BDELTAS.K") field(INPG, "BEND:LTUS:166:BDELTAS.L") field(INPH, "BEND:LTUS:166: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, "BEND:LTUS:166:STDZITOLR") field(INPC, "BEND:LTUS:166:STDZITOL") field(FLNK, "") } # All ps controllers with on/off control will set the macro ONOF # as follows: # # ONOF = PSC:LTUS:MG03: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, "BEND:LTUS:166:STATESETPT") { field(DESC, "PS On/Off") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFF") field(ONAM, "ON") field(OUT, "PSC:LTUS:MG03:STATESETPT PP") 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 = PSC:LTUS:MG03:RESET PP # record(bo, "BEND:LTUS:166:RESET") { field(DESC, "Interlock Latch Reset") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFF") field(ONAM, "ON") field(HIGH, "1.0") field(OUT, "PSC:LTUS:MG03:RESET PP") } record(bo, "BEND:LTUS:166:RAMPSTATE") { field(DESC, "PS Ramp Status") field(DTYP, "Soft Channel") field(DOL, "PSC:LTUS:MG03:RAMPSTATE NPP 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, "BEND:LTUS:166: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, "BEND:LTUS:166:TRIMRAMPRATE") field(OUT, "PSC:LTUS:MG03:IRAMPRATE PP") field(FLNK, "BEND:LTUS:166:STDZDLY") } record(ao, "BEND:LTUS:166:ISETPT") { field(DESC, "Current Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(DRVH, "250.0") field(DRVL, "0.0") field(MDEL, "-1") field(OUT, "PSC:LTUS:MG03:ISETPT PP") field(DOL, "BEND:LTUS:166: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, "BEND:LTUS:166:IMON") { field(DESC, "Aux Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(INP, "PSC:LTUS:MG03:IMON") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "BEND:LTUS:166:BMON") } record(ao, "BEND:LTUS:166:IRIPL") { field(DESC, "Ripple Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(DOL, "PSC:LTUS:MG03:IRIPL NPP NMS") field(OMSL, "closed_loop") field(EGU, "A") field(DRVH, "1.0") field(HOPR, "1.0") field(PREC, "3") field(FLNK, "BEND:LTUS:166:IRIPLOK") } record(sub, "BEND:LTUS:166:IRIPLOK") { field(DESC, "Ripple Current Status") field(INAM, "mgntInit") field(SNAM, "mgntRiplOK") field(INPA, "BEND:LTUS:166:IRIPL.VAL") field(INPB, "BEND:LTUS:166: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, "BEND:LTUS:166:R") { field(DESC, "Resistance") field(EGU, "Ohms") field(PREC, "4") field(PINI, "YES") field(DOL, "PSC:LTUS:MG03:R NPP MS") 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, "BEND:LTUS:166:IGND") { field(DESC, "Ground Current") field(EGU, "A") field(PREC, "6") field(PINI, "YES") field(DOL, "PSC:LTUS:MG03:IGND NPP MS") field(OMSL, "closed_loop") } record(bi, "BEND:LTUS:166:INTLKSUMY") { field(DESC, "Interlock Summary") field(INP, "PSC:LTUS:MG03:INTLKSUMY NPP MS") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(ZNAM, "OK") field(ONAM, "FAULT") field(PINI, "NO") } record(mbbo, "BEND:LTUS:166: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, "PSC:LTUS:MG03:COOLING") field(OMSL, "closed_loop") } # The following PV is processed by :BACTFO # which is processed by :BACT record(fanout, "BEND:LTUS:166:IACTFO") { field(DESC, "IACT processing") field(SELM, "All") field(LNK1, "BEND:LTUS:166:IACTPREVOK") field(LNK2, "BEND:LTUS:166:IDIFF") field(LNK3, "BEND:LTUS:166:IADIFF") field(LNK4, "BEND:LTUS:166:IRATIO") field(LNK5, "BEND:LTUS:166:IDIRECT") field(LNK6, "BEND:LTUS:166:IACTPOL_CHECK") } record(calc, "BEND:LTUS:166:IDIFF") { field(DESC, "IDES-IACT") field(CALC, "A-B") field(INPA, "BEND:LTUS:166:IDES") field(INPB, "BEND:LTUS:166:IACT") field(EGU, "A") field(PREC, "9") field(HOPR, "250.0") field(LOPR, "0.0") } record(calc, "BEND:LTUS:166:IADIFF") { field(DESC, "Absolute IDES-IACT") field(CALC, "A<0?ABS(A):A") field(INPA, "BEND:LTUS:166:IDIFF") field(PREC, "9") } record(calc, "BEND:LTUS:166:IRATIO") { field(DESC, "IDES-IACT/IMAX") field(CALC, "B?A/B:0") field(INPA, "BEND:LTUS:166:IDIFF") field(INPB, "BEND:LTUS:166:IDES.DRVH") field(PREC, "9") } record(calcout, "BEND:LTUS:166:IRANGE") { field(DESC, "Current Range") field(PINI, "YES") field(CALC, "ABS(A-B)") field(INPA, "BEND:LTUS:166:IMIN") field(INPB, "BEND:LTUS:166: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, "BEND:LTUS:166: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, "BEND:LTUS:166:IACT") field(FLNK, "BEND:LTUS:166:IACTPOL") } record(bo, "BEND:LTUS:166:IACTPOL") { field(DESC, "Actual I Polarity") field(DTYP, "Raw Soft Channel") field(DOL, "BEND:LTUS:166: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,"BEND:LTUS:166:I*LIMITS:\n Calculate alarm and warning limits based on \n deltas from BEND:LTUS:166:IDELTAS and the\n BEND:LTUS:166: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,"BEND:LTUS:166:IACT: \n Get copy of BEND:LTUS:166:I. \n",null) #! TextBox(TB12,1280,3100,1760,3200,0,"Dialog",12,1,16777215,"BEND:LTUS:166: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,"BEND:LTUS:166:IDES:\n Contains raw value calculated by \nBEND:LTUS:166: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 \nBEND:LTUS:166:BDELTAS.\n",null) #! TextBox(TB10,56,1940,316,2340,0,"Dialog",12,1,16777215,"BEND:LTUS:166: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 BEND:LTUS:166: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 BEND:LTUS:166: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,"BEND:LTUS:166:ISETPT:\n Sets the hardware. When fast feedback is set on, this record is\n set to closed loop mode by BEND:LTUS:166:FBCKSTART sequence. When \n the loop is closed, this record takes input calculated by \n BFBCK only. When fast feedback is set off, BEND:LTUS:166:FBCKSTOP \n will set it back to supervisory so that the value can be set by \n BEND:LTUS:166: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, "BEND:LTUS:166:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:166:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "BEND:LTUS:166:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "BEND:LTUS:166:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "BEND:LTUS:166:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "BEND:LTUS:166:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "1") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "BEND:LTUS:166: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, "BEND:LTUS:166:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "BEND:LTUS:166:TRIMTYPE.RVAL") field(INPB, "BEND:LTUS:166:CONFIG.RVAL") field(OUT, "BEND:LTUS:166:TRIMMAXNUM PP") } record(longout, "BEND:LTUS:166: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, "BEND:LTUS:166: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, "") field(OMSL, "supervisory") field(VAL, "10") field(OUT, "BEND:LTUS:166:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "BEND:LTUS:166: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, "") field(OMSL, "supervisory") field(VAL, "10") } record(bo, "BEND:LTUS:166: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, "BEND:LTUS:166: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, "BEND:LTUS:166: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, "BEND:LTUS:166:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "0") } record(ao, "BEND:LTUS:166: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, "BEND:LTUS:166:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "BEND:LTUS:166: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, "BEND:LTUS:166: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, "BEND:LTUS:166:IMOVE") field(INPB, "BEND:LTUS:166:IACT") field(INPC, "BEND:LTUS:166:IRAMPRATE") field(INPD, "1.577") field(INPE, "BEND:LTUS:166:TRIMDLYPCT") field(INPF, "BEND:LTUS:166:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "BEND:LTUS:166:RAMPTIME_LEFT PP") } record(longout, "BEND:LTUS:166:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "BEND:LTUS:166:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "BEND:LTUS:166:RAMPDONE_CALC") } record(calc, "BEND:LTUS:166:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "BEND:LTUS:166:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "BEND:LTUS:166:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "BEND:LTUS:166: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, "BEND:LTUS:166:RAMPTIME_LEFT") field(OUT, "BEND:LTUS:166:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "BEND:LTUS:166:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "BEND:LTUS:166:RAMPTIME_LEFT NMS") field(OUT, "BEND:LTUS:166:RAMPDONE PP") } record(bo, "BEND:LTUS:166:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "BEND:LTUS:166:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "BEND:LTUS:166: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, "BEND:LTUS:166: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, "BEND:LTUS:166:STDZINIT") { field(DESC, "Proc. Stdz PVs on boot") field(PINI, "YES") field(DOL1, "1") field(DOL2, "1") field(DOL3, "1") field(LNK1, "BEND:LTUS:166:DEBUG.PROC PP") field(LNK2, "BEND:LTUS:166:STDZCYCLENUM.PROC PP") field(LNK3, "BEND:LTUS:166:STDZDISABLE.PROC PP") field(LNK4, "BEND:LTUS:166: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, "BEND:LTUS:166:STDZSUB") { field(DESC, "Stdz subroutine") field(INAM, "mgntStdzInit") field(SNAM, "mgntStdz") field(BRSV, "INVALID") field(INPA, "BEND:LTUS:166:STDZIMIN NPP NMS") field(INPB, "BEND:LTUS:166:STDZIMAX NPP NMS") field(INPC, "BEND:LTUS:166:STDZIFINAL NPP NMS") field(INPD, "BEND:LTUS:166:STDZCYCLENUM NPP NMS") field(INPE, "BEND:LTUS:166:STDZDIRECT.RVAL NPP NMS") field(INPF, "BEND:LTUS:166:STDZDISABLE.RVAL CPP NMS") field(INPG, "BEND:LTUS:166: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, "BEND:LTUS:166:STDZWF PP") field(OUTB, "BEND:LTUS:166: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, "BEND:LTUS:166:STDZWF") } record(mbbo, "BEND:LTUS:166: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, "BEND:LTUS:166: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, "BEND:LTUS:166:STDZMAINPS") { field(DESC, "Stdz by main or self") field(PINI, "YES") field(DTYP, "Soft Channel") field(ZNAM, "SELF") field(ONAM, "MAIN") } record(bo, "BEND:LTUS:166: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, "BEND:LTUS:166: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, "BEND:LTUS:166: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, "BEND:LTUS:166:STDZTOD") { field(DESC, "Successful Standardize Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "BEND:LTUS:166:STDZLOSTTOD") { field(DESC, "Standardize Lost Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(longout, "BEND:LTUS:166:STDZCYCLECNT") { field(DESC, "Cycle Count") field(PINI, "YES") } record(longout, "BEND:LTUS:166:STDZCYCLENUM") { field(DESC, "No. Standardize Cycles") field(VAL, "3") field(HOPR, "10") field(LOPR, "0") field(DRVH, "10") field(DRVL, "0") field(PINI, "YES") field(FLNK, "BEND:LTUS:166:STDZDIRECT") } # The default standardize direction is "UP" for # all LCLS Magnets.. record(bo, "BEND:LTUS:166:STDZDIRECT") { field(DESC, "Standardize Direction ") field(ZNAM, "UP") field(ONAM, "DOWN") field(VAL, "0") field(FLNK, "BEND:LTUS:166:STDZIMIN") } record(ao, "BEND:LTUS:166:STDZIMIN") { field(DESC, "Min-STDZ Current") field(PREC, "1") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(VAL, "0.0") field(FLNK, "BEND:LTUS:166:STDZIMAX") } record(ao, "BEND:LTUS:166:STDZIMAX") { field(DESC, "Max. Standarize Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(VAL, "250.0") field(FLNK, "BEND:LTUS:166:STDZIFINAL") } record(ao, "BEND:LTUS:166:STDZIFINAL") { field(DESC, "Final SDTZ Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(VAL, "0.0") field(FLNK, "BEND:LTUS:166: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, "BEND:LTUS:166: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, "BEND:LTUS:166:STDZITOL") { field(DESC, "Stdz min tolerance") field(PREC, "5") field(CALC, "MAX(ABS(A),ABS(B))*C") field(INPA, "BEND:LTUS:166:STDZIMIN CP NMS") field(INPB, "BEND:LTUS:166:STDZIMAX CP MMS") field(INPC, "0.05") field(INPD, "BEND:LTUS:166:STDZITOLR CP MMS") field(EGU, "A") field(FLNK, "BEND:LTUS:166:IDELTAS") field(PINI, "YES") } # D - factor (3.154/2 = 1.577) for EPSC, otherwise, set to 1.0 record(calc, "BEND:LTUS:166:STDZDLY") { field(DESC, "Ramp time for stdz cycle") field(CALC, "C>0?MAX(1,ABS((A-B)/C)*D):0") field(INPA, "BEND:LTUS:166:STDZIMIN CP NMS") field(INPB, "BEND:LTUS:166:STDZIMAX CP NMS") field(INPC, "BEND:LTUS:166:TRIMRAMPRATE CP NMS") field(INPD, "1.577") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") } record(calc, "BEND:LTUS:166:STDZRAMPDLY") { field(DESC, "Ramp delay total") field(CALC, "MAX(1,((A/100)*B+B))") field(PREC, "5") field(INPA, "BEND:LTUS:166:TRIMDLYPCT CP MS") field(INPB, "BEND:LTUS:166: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, "BEND:LTUS:166:STDZMINIDLY") { field(DESC, "Mini-stdz delay") field(CALC, "A") field(PREC, "5") field(A, "1.0") field(EGU, "sec") field(PINI, "YES") } record(ao, "BEND:LTUS:166: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, "BEND:LTUS:166:STDZMINIDELTA") { field(DESC, "Stdz mini % of IMAX") field(CALC, "(B/100)*(A-C)") field(INPA, "BEND:LTUS:166:IDES.HOPR") field(INPB, "BEND:LTUS:166:STDZMINIPCT CPP NMS") field(INPC, "BEND:LTUS:166:IDES.LOPR") field(PREC, "5") } record(calc, "BEND:LTUS:166:STDZMINISETPT") { field(DESC, "Mini Stdz delta") field(CALC, "C==0?MAX(E-D,B):MIN(E+D,A)") field(INPA, "BEND:LTUS:166:IDES.HOPR") field(INPB, "BEND:LTUS:166:IDES.LOPR") field(INPC, "BEND:LTUS:166:STDZDIRECT.RVAL") field(INPD, "BEND:LTUS:166:STDZMINIDELTA") field(INPE, "BEND:LTUS:166:IDES") field(PREC, "5") field(FLNK, "BEND:LTUS:166: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, "BEND:LTUS:166:STDZMINISETPTOOR") { field(DESC, "Mini Stdz setpoint out of range") field(CALC, "C==0?(E-DA)") field(INPA, "BEND:LTUS:166:IDES.HOPR") field(INPB, "BEND:LTUS:166:IDES.LOPR") field(INPC, "BEND:LTUS:166:STDZDIRECT.RVAL") field(INPD, "BEND:LTUS:166:STDZMINIDELTA") field(INPE, "BEND:LTUS:166: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, "BEND:LTUS:166: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, "BEND:LTUS:166:IADJUST.RVAL") field(INPB, "BEND:LTUS:166:STDZDIRECT.RVAL") field(INPC, "BEND:LTUS:166:STDZOK.RVAL") field(INPD, "BEND:LTUS:166:STDZDISABLE.RVAL") field(INPE, "BEND:LTUS:166:STATE.RVAL CPP NMS") field(INPF, "BEND:LTUS:166:ICTRL.RVAL") field(INPG, "BEND:LTUS:166:STATE.SEVR") field(INPH, "BEND:LTUS:166:BDELTAS.M") field(INPI, "BEND:LTUS:166:IACT.SEVR") field(OUT, "BEND:LTUS:166:STDZLOSTGO.SELN PP NMS") field(OOPT, "Transition To Non-zero") } record(seq, "BEND:LTUS:166:STDZLOSTGO") { field(DESC, "Process lost stdz") field(SELM, "Mask") field(DOL1, "1") field(DOL2, "0") field(LNK1, "BEND:LTUS:166:STDZLOSTTOD.PROC") field(LNK2, "BEND:LTUS:166:STDZOK PP") } # Record maximum current after standardize # Reset to IACT from sequence after trim # Disable processing during (mini-)standardize or trim record(calc, "BEND:LTUS:166:STDZIACTMAX") { field(DESC, "Max act current after stdz") field(CALC, "MAX(A, B)") field(DISV, "0") field(SDIS, "BEND:LTUS:166:CHECKPWRDIP_ENABLE") field(INPA, "BEND:LTUS:166:IACT CP") field(INPB, "BEND:LTUS:166:STDZIACTMAX") field(EGU, "A") field(FLNK, "BEND:LTUS:166:CHECKPWRDIP") } # Detect power dip if STDZOK is YES, STDZ is enabled, and IACT is valid # If IACT drops below STDZIACTMAX by more than the trim tolerance, clear STDZOK # Warning: Take the absolute value of the trim tolerance, or else quads of # negative polarity will always lose STDZ since their IDELTAS.I are negative. # Note: Large quads and bends are prone to losing STDZ even if they are # perturbed toward higher current since their current tends to overshoot # by greater than the trim tolerance before settling down. record(calcout, "BEND:LTUS:166:CHECKPWRDIP") { field(DESC, "Detect power dip") field(CALC, "(A-B>ABS(C))?3:0") field(DISV, "0") field(SDIS, "BEND:LTUS:166:CHECKPWRDIP_ENABLE") field(INPA, "BEND:LTUS:166:STDZIACTMAX") field(INPB, "BEND:LTUS:166:IACT") field(INPC, "BEND:LTUS:166:IDELTAS.I") field(OUT, "BEND:LTUS:166:STDZLOSTGO.SELN PP NMS") field(OOPT, "When Non-zero") } # Enable processing of STDZIACTMAX and CHECKPWRDIP only if # STDZOK = YES, STDZDISABLE = NO, CTRL != Trim (2), and # CTRL != Stdz (4) record(calc, "BEND:LTUS:166:CHECKPWRDIP_ENABLE") { field(CALC, "A&&!B&&(C#2)&&(C#4)") field(INPA, "BEND:LTUS:166:STDZOK.RVAL CP") field(INPB, "BEND:LTUS:166:STDZDISABLE.RVAL CP") field(INPC, "BEND:LTUS:166:CTRL.RVAL CP") } #! 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, "BEND:LTUS:166: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, "BEND:LTUS:166:CALBOK") { field(DESC, "Successful Calibration") field(DTYP, "Raw Soft Channel") field(ZNAM, "NO") field(ONAM, "YES") field(DOL, "PSC:LTUS:MG03:CALBOK.RVAL") field(OMSL, "closed_loop") 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, "BEND:LTUS:166:CALBSET") { field(DESC, "Use DAC Calbration") field(SCAN, "10 second") field(CALC, "A&&(B==0)&&C?31:960") field(INPA, "BEND:LTUS:166:CALBOK") field(INPB, "BEND:LTUS:166:CALBDISABLE") field(INPC, "BEND:LTUS:166:CALBSLOPE") field(OOPT, "On Change") field(OUT, "BEND:LTUS:166: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, "BEND:LTUS:166:CALB_SEQ") { field(DESC, "Output Calib Values") field(SELM, "Mask") field(SELL, "BEND:LTUS:166: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, "BEND:LTUS:166:CALBSLOPE") field(DOL3, "BEND:LTUS:166: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, "BEND:LTUS:166:CALBTOD") { field(DESC, "Calibration Success Time") field(PINI, "YES") field(DOL, "PSC:LTUS:MG03:CALBTOD") field(OMSL, "closed_loop") field(DTYP, "Soft Channel") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:166: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, "BEND:LTUS:166: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, "BEND:LTUS:166: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, "BEND:LTUS:166:CALBOFFSET") { field(DESC, "Calc DAC Offset") field(PREC, "6") field(EGU, "Counts") field(PINI, "YES") } record(bo, "BEND:LTUS:166: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, "BEND:LTUS:166:DACSLOPE") { field(DESC, "V to DAC slope") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "closed_loop") field(PINI, "YES") field(FLNK, "BEND:LTUS:166:DACOFFSET") } # Default Offset used in conversion from Volts to DAC Counts record(ao, "BEND:LTUS:166:DACOFFSET") { field(DESC, "V to DAC offset") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "closed_loop") field(PINI, "YES") field(FLNK, "BEND:LTUS:166: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, "BEND:LTUS:166: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, "BEND:LTUS:166:IACT") field(INPD, "BEND:LTUS:166:DACSLOPE") field(INPE, "BEND:LTUS:166:DACOFFSET") field(EGU, "Counts") field(PREC, "6") } record(ao, "BEND:LTUS:166:DAC") { field(DESC, "DAC Set point") field(EGU, "Counts") field(DOL, "") field(OMSL, "closed_loop") field(PREC, "6") field(PINI, "YES") } record(ao, "BEND:LTUS:166:CALBIMIN") { field(DESC, "Calibration Min Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(DRVH, "250.0") field(HOPR, "250.0") field(DRVL, "0.0") field(LOPR, "0.0") field(PREC, "3") field(EGU, "A") field(VAL, "0.0") field(FLNK, "BEND:LTUS:166:CALBIMAX") } record(ao, "BEND:LTUS:166:CALBIMAX") { field(DESC, "Calibration Max Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(DRVH, "250.0") field(HOPR, "250.0") field(LOPR, "0.0") field(DRVL, "0.0") field(EGU, "A") field(VAL, "250.0") field(FLNK, "BEND:LTUS:166:CALBSTEPNUM") } record(ao, "BEND:LTUS:166:CALBIFINAL") { field(DESC, "Calibration Last Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(PREC, "3") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(VAL, "0") } record(longout, "BEND:LTUS:166: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, "BEND:LTUS:166:CALBIDELTA") } record(calc, "BEND:LTUS:166:CALBIDELTA") { field(DESC, "Step size for CALB") field(CALC, "C=0?0:ABS((A-B)/C)") field(INPA, "BEND:LTUS:166:CALBIMAX") field(INPB, "BEND:LTUS:166:CALBIMIN") field(INPC, "BEND:LTUS:166: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, "BEND:LTUS:166:CALBIMULT") { field(DESC, "IACT vs ISETPT mult") field(CALC, "C#0||A=0?1:ABS(B/A)") field(INPA, "PSC:LTUS:MG03:ISETPT.DRVH") field(INPB, "PSC:LTUS:MG03:IACT.HOPR") field(INPC, "BEND:LTUS:166:PSCONTROLLER.RVAL CPP") field(EGU, "A") field(PINI, "YES") } # SNL dbputs DAC values here. 6-10 steps are possible. record(waveform, "BEND:LTUS:166:CALBICTRLWF") { field(DESC, "ICTRL setpoint array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") } record(waveform, "BEND:LTUS:166:DACWF") { field(DESC, "DAC count array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "BEND:LTUS:166:DACSA") } # Used only for xygraph edm plot record(subArray, "BEND:LTUS:166:DACSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "BEND:LTUS:166: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, "BEND:LTUS:166:CALCDACWF") { field(DESC, "Calc DAC counts array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "BEND:LTUS:166:CALCDACSA") } # Used only for xygraph edm plot record(subArray, "BEND:LTUS:166:CALCDACSA") { field(DESC, "Calc DAC counts") field(DTYP, "Soft Channel") field(INP, "BEND:LTUS:166: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, "BEND:LTUS:166:CALBYWF") { field(DESC, "mx + b") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "BEND:LTUS:166:CALBYSA") } # Used only for xygraph edm plot record(subArray, "BEND:LTUS:166:CALBYSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "BEND:LTUS:166:CALBYWF") field(MALM, "10") field(NELM, "6") field(INDX, "0") field(FTVL, "DOUBLE") } record(waveform, "BEND:LTUS:166:CALBIACTWF") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "BEND:LTUS:166:CALBIACTSA") } # Used only for xygraph edm plot record(subArray, "BEND:LTUS:166:CALBIACTSA") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(MALM, "10") field(NELM, "6") field(INP, "BEND:LTUS:166:CALBIACTWF") field(INDX, "0") field(FTVL, "DOUBLE") field(FLNK, "BEND:LTUS:166:CALBLIMITS") } # Check that measured current during calibration is within # tolerance. record(aSub, "BEND:LTUS:166: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, "BEND:LTUS:166:CALBSTEPNUM") field(INPB, "BEND:LTUS:166:CALBIACTWF") field(INPC, "BEND:LTUS:166: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, "BEND:LTUS:166: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, "BEND:LTUS:166:STDZITOL") field(INPH, "BEND:LTUS:166:DACSLOPE") field(INPI, "BEND:LTUS:166: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, "BEND:LTUS:166: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, "BEND:LTUS:166:CALBSTEPNUM") field(INPB, "BEND:LTUS:166:CALBIACTWF") field(INPC, "BEND:LTUS:166:DACWF") field(INPF, "BEND:LTUS:166: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 BEND:LTUS:166CALBOK 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, "BEND:LTUS:166:DEGAUSINIT") { field(DESC, "Proc. Degauss PVs on boot") field(PINI, "YES") field(DOL, "1") field(OUTA, "BEND:LTUS:166:DEGAUSIMIN.PROC PP") field(OUTB, "BEND:LTUS:166:DEGAUSIMAX.PROC PP") field(OUTC, "BEND:LTUS:166:DEGAUSTYPE.PROC PP") field(OUTD, "BEND:LTUS:166:DEGAUSSTEP.PROC PP") field(OUTE, "BEND:LTUS:166:MADNAME.PROC PP") field(OUTF, "BEND:LTUS:166:PSTYPE.PROC PP") field(OUTG, "BEND:LTUS:166: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, "BEND:LTUS:166:DEGAUSSUB") { field(DESC, "Degauss subroutine") field(INAM, "mgntDegaussInit") field(SNAM, "mgntDegauss") field(BRSV, "INVALID") field(INPA, "BEND:LTUS:166:DEGAUSIMIN NPP NMS") field(INPB, "BEND:LTUS:166:DEGAUSIMAX NPP NMS") field(INPC, "BEND:LTUS:166:DEGAUSTYPE.RVAL NPP NMS") field(INPE, "BEND:LTUS:166:DEGAUSMETHOD.RVAL NPP NMS") field(INPF, "BEND:LTUS:166:PSTYPE NPP NMS") field(INPG, "BEND:LTUS:166:DEBUG.RVAL NPP NMS") field(INPH, "BEND:LTUS:166: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, "BEND:LTUS:166:DEGAUSWF PP") field(OUTB, "BEND:LTUS:166:DEGAUSMSG PP") field(OUTC, "BEND:LTUS:166: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, "BEND:LTUS:166:DEGAUSWF") { field(DESC, "Degauss Setpts") field(NELM, "60") field(FTVL, "DOUBLE") } record(mbbo,"BEND:LTUS:166: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, "BEND:LTUS:166: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, "BEND:LTUS:166: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, "BEND:LTUS:166: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, "BEND:LTUS:166: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, "BEND:LTUS:166:DEGAUSIMIN") { field(DESC, "Min. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "250.0") field(LOPR, "-250.0") field(DRVH, "250.0") field(DRVL, "-250.0") field(VAL, "-250.0") } record(ao, "BEND:LTUS:166:DEGAUSIMAX") { field(DESC, "Max. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "250.0") field(LOPR, "-250.0") field(DRVH, "250.0") field(DRVL, "-250.0") field(VAL, "250.0") } # 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,"BEND:LTUS:166: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, "BEND:LTUS:166: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,"BEND:LTUS:166: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, "BEND:LTUS:166: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, "BEND:LTUS:166: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, "BEND:LTUS:166: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, "BEND:LTUS:166:DEGAUSTOD") { field(DESC, "Successful Degauss Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "BEND:LTUS:166:DEGAUSLOSTTOD") { field(DESC, "Degauss Lost Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:166:DEGAUSTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "BEND:LTUS:166:DEGAUSTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "BEND:LTUS:166: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, "BEND:LTUS:166:DEGAUSGO") { field(DESC, "Set bdes of btrms to zero") field(ASG, "Internal") field(OUTA, "") field(OUTB, "") field(OUTC, "") field(OUTD, "") } # =========== CRYO ONLY =========== record(bo, "BEND:LTUS:166: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, "BEND:LTUS:166:DEGAUS_IMAX_CHECK") { field(DESC, "Check if imax shoud chg") field(CALC, "(C==4)&&(ABS(B)>ABS(A))?1:0") field(INPA, "BEND:LTUS:166:DEGAUS_IMAX") field(INPB, "BEND:LTUS:166:ISETPT") field(INPC, "BEND:LTUS:166:DEGAUSTYPE.RVAL") field(OUT, "BEND:LTUS:166:DEGAUS_IMAX_UPDATE.SELN") field(FLNK, "BEND:LTUS:166:DEGAUS_IMAX_UPDATE") } record(seq, "BEND:LTUS:166:DEGAUS_IMAX_UPDATE") { field(DESC, "Degauss IMAX Update") field(SELM, "Specified") field(DOL1, "BEND:LTUS:166:ISETPT") field(LNK1, "BEND:LTUS:166:DEGAUS_IMAX PP") } # Set the maximum current after a successful # degauss. This pv is updated by the # sequence. record(ao, "BEND:LTUS:166:DEGAUS_IMAX") { field(DESC, "Max I set afer a degauss") field(EGU, "Amps") field(PINI, "YES") field(PREC, "6") field(HOPR, "250.0") field(LOPR, "-250.0") field(DRVH, "250.0") field(DRVL, "-250.0") field(VAL, "250.0") field(FLNK, "BEND:LTUS:166:DEGAUS_IMAXPOL_CHECK") info(autosaveFields,"VAL,RVAL") } # Set the polarity if degauss_imax record(calcout, "BEND:LTUS:166:DEGAUS_IMAXPOL_CHECK") { field(DESC, "Determine polarity of imax") field(CALC, "A>=0?0:1") field(INPA, "BEND:LTUS:166:DEGAUS_IMAX") field(FLNK, "BEND:LTUS:166:DEGAUS_IMAXPOL") } record(bo, "BEND:LTUS:166:DEGAUS_IMAXPOL") { field(DESC, "Polarity of imax I") field(DTYP, "Raw Soft Channel") field(DOL, "BEND:LTUS:166:DEGAUS_IMAXPOL_CHECK") field(OMSL, "closed_loop") field(ZNAM, "Positive") field(ONAM, "Negative") field(FLNK, "BEND:LTUS:166: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, "BEND:LTUS:166:DEGAUS_ABSIMAX") { field(DESC, "Absolute Max. Degauss I") field(CALC, "ABS(A)") field(INPA, "BEND:LTUS:166:DEGAUS_IMAX") field(PREC, "6") field(EGU, "Amps") field(HOPR, "250.0") field(LOPR, "-250.0") info(autosaveFields,"VAL RVAL") } # IACT Polarity record(calcout, "BEND:LTUS:166:IACTPOL_CHECK") { field(DESC, "Determine IACT polarity") field(SCAN, "5 second") field(CALC, "ABS(A-B)>C?(A>=0?0:1):D") field(INPA, "BEND:LTUS:166:IACT") field(INPB, "BEND:LTUS:166:IACTPOL_CHECK.LA") field(INPC, "0.0001") field(INPD, "BEND:LTUS:166:IACTPOL_CHECK.PVAL") field(OOPT, "On Change") field(FLNK, "BEND:LTUS:166:IACTPOL") } record(bo, "BEND:LTUS:166: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,"BEND:LTUS:166: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, "BEND:LTUS:166:DEGAUSENABLE CP") field(INPB, "BEND:LTUS:166:DEGAUSOK") field(INPC, "BEND:LTUS:166:STATE CP") field(INPD, "BEND:LTUS:166:STATE.SEVR") field(OUT, "BEND:LTUS:166:DEGAUS_STATE_SEQ.SELN PP") field(ASG, "Internal") } record(seq, "BEND:LTUS:166:DEGAUS_STATE_SEQ") { field(DESC, "Degauss State Sequence") field(SELM, "Specified") field(SELL, "BEND:LTUS:166:DEGAUS_STATE_CHECK") field(LNK1, "BEND:LTUS:166:DEGAUS_STATE_DISABLE.PROC PP") field(LNK2, "BEND:LTUS:166:DEGAUS_STATE_LOST.PROC PP") field(LNK3, "BEND:LTUS:166:DEGAUS_STATE_GOOD.PROC PP") field(LNK4, "BEND:LTUS:166: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, "BEND:LTUS:166:DEGAUS_STATE_DISABLE") { field(DESC, "Degauss not used") field(LNK1, "BEND:LTUS:166:DEGAUSOK.ZSV") field(LNK2, "BEND:LTUS:166: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, "BEND:LTUS:166:STATMSG.FRSV") field(LNK4, "BEND:LTUS:166: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, "BEND:LTUS:166:DEGAUS_STATE_LOST") { field(DESC, "Degauss lost and ps On") field(DOL1, "1") field(LNK1, "BEND:LTUS:166:DEGAUSOK.ZSV") field(LNK2, "BEND:LTUS:166: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, "BEND:LTUS:166:STATMSG.FRSV") field(LNK4, "BEND:LTUS:166: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, "BEND:LTUS:166:DEGAUS_STATE_OFF") { field(DESC, "Degaused lost and ps Off") field(DOL1, "2") field(LNK1, "BEND:LTUS:166: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, "BEND:LTUS:166:STATMSG.FRSV") field(LNK3, "BEND:LTUS:166: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, "BEND:LTUS:166:DEGAUS_STATE_GOOD") { field(DESC, "Degauss good") field(DOL1, "1") field(LNK1, "BEND:LTUS:166: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, "BEND:LTUS:166:STATMSG.FRSV PP") field(LNK3, "BEND:LTUS:166:STATMSG.FVSV PP") field(LNK4, "") field(ASG, "Internal") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(mbbo, "BEND:LTUS:166:FUNC") { field(DESC, "BEND:LTUS:166 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, "1") field(THVL, "9") field(FRVL, "10") field(FVVL, "0") field(SXVL, "2") field(SVVL, "8") field(EIVL, "11") field(NIVL, "12") field(TEVL, "13") field(ELVL, "5") field(TVVL, "6") field(TTVL, "7") field(FTVL, "4") field(FFVL, "3") field(OUT, "BEND:LTUS:166:CTRL CA") } # :CTRL pv is processed at boot in the # sequence mgntCtrl.st Processed in sequence # record(mbbo, "BEND:LTUS:166:CTRL") { field(DESC, "BEND:LTUS:166 Control") field(PINI, "NO") field(ZRST, "Ready") field(ONST, "TRIM") field(TWST, "PERTURB") field(THST, "BCON_TO_BDES") field(FRST, "BACT_TO_BDES") field(FVST, "SAVE_BDES") field(SXST, "LOAD_BDES") field(SVST, "UNDO_BDES") field(EIST, "DAC_ZERO") field(NIST, "CALB") field(TEST, "STDZ") field(ELST, "RESET") field(TVST, "TURN_ON") field(TTST, "TURN_OFF") field(FTST, "") field(FFST, "") field(ZRVL, "0") field(ONVL, "2") field(TWVL, "6") field(THVL, "15") field(FRVL, "14") field(FVVL, "11") field(SXVL, "12") field(SVVL, "13") field(EIVL, "7") field(NIVL, "3") field(TEVL, "4") field(ELVL, "8") field(TVVL, "9") field(TTVL, "10") field(FTVL, "0") field(FFVL, "0") field(OUT, "BEND:LTUS:166:SELECTEN.A PP") field(SDIS, "0") } # If a function has been selected set this unit to busy record(calcout, "BEND:LTUS:166:SELECTEN") { field(DESC, "Control Select Enable") field(CALC, "A>0?1:A") field(FLNK, "BEND:LTUS:166:BUSY") } # Set to FREE on IOC reboot record(bo, "BEND:LTUS:166:BUSY") { field(DESC, "BEND:LTUS:166 Ctrl Done") field(DOL, "BEND:LTUS:166:SELECTEN") field(ZNAM, "FREE") field(ONAM, "BUSY") field(PINI, "YES") field(FLNK, "BEND:LTUS:166:SELECT") } record(bo, "BEND:LTUS:166:SELECT") { field(ZNAM, "NO") field(ONAM, "YES") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") } record(bo, "BEND:LTUS:166: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, "BEND:LTUS:166:CTRLSTATE") { field(DESC, "BEND:LTUS:166 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("BEND:LTUS:166:CTRL",20,20,0,0,"BEND:LTUS:166:CTRL") #! Field("BEND:LTUS:166:CTRL.OUT",16777215,1,"BEND:LTUS:166:CTRL.OUT") #! Link("BEND:LTUS:166:CTRL.OUT","BEND:LTUS:166:SELECTEN.A") #! Field("BEND:LTUS:166:CTRL.VAL",16777215,1,"BEND:LTUS:166:CTRL.VAL") #! Record("BEND:LTUS:166:SELECTEN",321,381,0,0,"BEND:LTUS:166:SELECTEN") #! Field("BEND:LTUS:166:SELECTEN.A",16777215,0,"BEND:LTUS:166:SELECTEN.A") #! Field("BEND:LTUS:166:SELECTEN.FLNK",16777215,1,"BEND:LTUS:166:SELECTEN.FLNK") #! Link("BEND:LTUS:166:SELECTEN.FLNK","BEND:LTUS:166:BUSY") #! Field("BEND:LTUS:166:SELECTEN.VAL",16777215,1,"BEND:LTUS:166:SELECTEN.VAL") #! Record("BEND:LTUS:166:BUSY",623,274,0,0,"BEND:LTUS:166:BUSY") #! Field("BEND:LTUS:166:BUSY.DOL",16777215,0,"BEND:LTUS:166:BUSY.DOL") #! Link("BEND:LTUS:166:BUSY.DOL","BEND:LTUS:166:SELECTEN.VAL") #! Field("BEND:LTUS:166:BUSY.FLNK",16777215,1,"BEND:LTUS:166:BUSY.FLNK") #! Link("BEND:LTUS:166:BUSY.FLNK","BEND:LTUS:166:SELECT") #! Record("BEND:LTUS:166:SELECT",669,508,0,1,"BEND:LTUS:166:SELECT") #! Record("BEND:LTUS:166:FUNC",940,120,0,0,"BEND:LTUS:166:FUNC") #! Field("BEND:LTUS:166:FUNC.OUT",16777215,0,"BEND:LTUS:166:FUNC.OUT") #! Link("BEND:LTUS:166:FUNC.OUT","BEND:LTUS:166:CTRL.VAL") #! Record("BEND:LTUS:166:ABORT",193,41,0,0,"BEND:LTUS:166:ABORT") #! Record("BEND:LTUS:166:CTRLSTATE",369,34,0,0,"BEND:LTUS:166: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,"BEND:LTUS:166:SELECT is used for Multi-device selection.\nIt is enabled when associated BEND:LTUS:166:CTRL is \"0\" (DONE).\nIt is disabled when associated BEND:LTUS:166: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,"BEND:LTUS:166: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, "BEND:LTUS:166:BCTRL_INIT") { field(DESC, "Process BCTRL on boot") field(PINI, "YES") field(CALC, "A=3?1:0") field(INPA, "BEND:LTUS:166:BCTRL.SEVR") field(OUT, "BEND:LTUS:166: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, "BEND:LTUS:166:BACT") { field(DESC, "Actual B") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "BEND:LTUS:166:BACT") field(INPB, "BEND:LTUS:166:POLYCOEF") field(INPC, "BEND:LTUS:166:POLYCOEF.A") field(INPD, "BEND:LTUS:166:POLYCOEF.B") field(INPE, "BEND:LTUS:166:IACT MS") field(INPF, "BEND:LTUS:166:BDELTAS PP") field(INPG, "100") field(EGU, "kG-m") field(HOPR, "4.5118") field(LOPR, "0.0128") field(HIHI, "4.5118") field(LOLO, "0.0128") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "4.5118") field(LOW, "0.0128") field(FLNK, "BEND:LTUS:166: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, "BEND:LTUS:166:BDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntPhyDeltas") field(EGU, "kG-m") field(HOPR, "1") field(PREC, "7") field(BRSV, "INVALID") field(INPA, "BEND:LTUS:166:BDES") field(INPB, "BEND:LTUS:166:TRIMBTOL") field(INPC, "BEND:LTUS:166:TRIMBTOLR") field(INPD, "BEND:LTUS:166:CHCKBTOL") field(INPE, "BEND:LTUS:166:CHCKBTOLR") field(F, "2.0") field(INPG, "30") field(INPH, "BEND:LTUS:166:BACT.VAL") # # MPS absolute and relative tolerances field(INPP, "BEND:LTUS:166:MPSBTOL") field(INPQ, "BEND:LTUS:166:MPSBTOLR") field(FLNK, "BEND:LTUS:166:BCONLIMITS") info(autosaveFields,"F") } # This record is processed by BDELTAS record(aSub, "BEND:LTUS:166:BCONLIMITS") { field(DESC, "Config B-field Limits") field(INAM, "mgntInit") field(SNAM, "mgntBCONLimits") field(INPA, "BEND:LTUS:166:BDES") field(INPB, "BEND:LTUS:166:BDELTAS.I") field(INPG, "BEND:LTUS:166:DEBUG.RVAL") field(FTA, "DOUBLE") field(FTB, "DOUBLE") field(FTG, "ULONG") field(OUTA, "BEND:LTUS:166:BCON.HIGH") field(OUTB, "BEND:LTUS:166:BCON.LOW") field(OUTC, "BEND:LTUS:166:BCON.HIHI") field(OUTD, "BEND:LTUS:166:BCON.LOLO PP") field(FTVA, "DOUBLE") field(FTVB, "DOUBLE") field(FTVC, "DOUBLE") field(FTVD, "DOUBLE") field(BRSV, "INVALID") field(FLNK, "BEND:LTUS:166:IDELTAS") } # The following PV is processed by :BACT # which is processed by :BACT # record(fanout, "BEND:LTUS:166:BACTFO") { field(DESC, "BACT processing") field(SELM, "All") field(LNK1, "BEND:LTUS:166:BDIFF") field(LNK2, "BEND:LTUS:166:BADIFF") field(LNK3, "BEND:LTUS:166:BRATIO") field(LNK4, "BEND:LTUS:166:MPSLIMITS") field(LNK5, "BEND:LTUS:166:I2BSTATUS") field(LNK6, "BEND:LTUS:166:IACTFO.PROC") } record(calc, "BEND:LTUS:166:BDIFF") { field(DESC, "BDES-BACT") field(CALC, "A-B") field(INPA, "BEND:LTUS:166:BDES") field(INPB, "BEND:LTUS:166:BACT") field(EGU, "kG-m") field(PREC, "7") } record(calc, "BEND:LTUS:166:BADIFF") { field(DESC, "Absolute BDES-BACT") field(INPA, "BEND:LTUS:166:BDIFF") field(EGU, "kG-m") field(PREC, "7") field(CALC, "A<0?ABS(A):A") } record(calc, "BEND:LTUS:166:BRATIO") { field(DESC, "BACT Error") field(CALC, "B?A/B:0") field(INPA, "BEND:LTUS:166:BDIFF") field(INPB, "BEND:LTUS:166:BDES.HOPR") field(EGU, "kG-m") field(PREC, "7") } record(mbbi, "BEND:LTUS:166: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, "BEND:LTUS:166:BACT.J") } # Note: for a string slave set the MONFL # macro to the following: # MONFL=:IMONCALC MS record(sub, "BEND:LTUS:166:BMON") { field(DESC, "Second Transductor") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "BEND:LTUS:166:BMON") field(INPB, "BEND:LTUS:166:POLYCOEF") field(INPC, "BEND:LTUS:166:POLYCOEF.A") field(INPD, "BEND:LTUS:166:POLYCOEF.B") field(INPE, "BEND:LTUS:166:IMON MS") field(INPF, "BEND:LTUS:166:BDELTAS.VAL") field(INPG, "100") field(EGU, "kG-m") field(HOPR, "4.5118") field(LOPR, "0.0128") field(HIHI, "4.5118") field(LOLO, "0.0128") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "4.5118") field(LOW, "0.0128") } # 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=PSC:LTUS:MG03:BDES CP record(ao, "BEND:LTUS:166:BDES") { field(DESC, "Desired B-Field") field(PINI, "YES") field(DRVH, "4.5118") field(DRVL, "0.0128") field(HOPR, "4.5118") field(LOPR, "0.0128") field(PREC, "7") field(EGU, "kG-m") field(MDEL, "-1") field(OMSL, "supervisory") # field(DOL, "") field(OUT, "BEND:LTUS:166:B2IDES PP") info(autosaveFields,"VAL") } record(sub, "BEND:LTUS:166:B2IDES") { field(DESC, "Convert Desired B-Field to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "BEND:LTUS:166:POLYCOEF") field(INPC, "BEND:LTUS:166:POLYCOEF.A") field(INPD, "BEND:LTUS:166:POLYCOEF.B") field(PREC, "7") field(EGU, "kG-m") field(HOPR, "4.5118") field(LOPR, "0.0128") field(MDEL, "-1") field(INPE, "BEND:LTUS:166:BDES.DRVH") field(INPF, "BEND:LTUS:166:BDES.DRVL") field(BRSV, "INVALID") field(FLNK, "BEND:LTUS:166:IDES") } record(sub, "BEND:LTUS:166:BNOM") { field(DESC, "Nominal Field") field(PINI, "YES") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "BEND:LTUS:166:POLYCOEF") field(INPC, "BEND:LTUS:166:POLYCOEF.A") field(INPD, "BEND:LTUS:166:POLYCOEF.B") field(INPE, "BEND:LTUS:166:BDES.DRVH") field(INPF, "BEND:LTUS:166:BDES.DRVL") field(EGU, "kG-m") field(HOPR, "4.5118") field(LOPR, "0.0128") field(PREC, "7") field(VAL, "0.0") field(FLNK, "BEND:LTUS:166:INOM") } record(sub, "BEND:LTUS:166:BACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "BEND:LTUS:166:BDES.VAL") field(INPB, "BEND:LTUS:166:BDES.DRVH") field(INPC, "BEND:LTUS:166:BDES.DRVL") field(INPD, "BEND:LTUS:166:BDELTAS.I") field(INPE, "BEND:LTUS:166:BDELTAS.J") field(INPG, "BEND:LTUS:166:STATE") field(INPH, "BEND:LTUS:166:HSTA") field(EGU, "kG-m") field(HOPR, "4.5118") field(LOPR, "0.0128") field(PREC, "7") field(BRSV, "INVALID") } record(sub, "BEND:LTUS:166:BMONLIMITS") { field(DESC, "MON Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "BEND:LTUS:166:BDES.VAL") field(INPB, "BEND:LTUS:166:BDES.DRVH") field(INPC, "BEND:LTUS:166:BDES.DRVL") field(INPD, "BEND:LTUS:166:BDELTAS.K") field(INPE, "BEND:LTUS:166:BDELTAS.L") field(INPG, "BEND:LTUS:166:STATE") field(INPH, "BEND:LTUS:166:HSTA") field(EGU, "kG-m") field(HOPR, "4.5118") field(LOPR, "0.0128") field(PREC, "7") field(BRSV, "INVALID") } record(seq, "BEND:LTUS:166:BLIMITS") { field(DESC, "ACT Limits") field(PREC, "7") field(DOL1, "BEND:LTUS:166:BLIMITS") field(LNK1, "BEND:LTUS:166:BACTLIMITS.F PP") field(DOL2, "BEND:LTUS:166:BACTLIMITS.I") field(LNK2, "BEND:LTUS:166:BACT.HIGH") field(DOL3, "BEND:LTUS:166:BACTLIMITS.J") field(LNK3, "BEND:LTUS:166:BACT.LOW") field(DOL4, "BEND:LTUS:166:BACTLIMITS.K") field(LNK4, "BEND:LTUS:166:BACT.HIHI") field(DOL5, "BEND:LTUS:166:BACTLIMITS.L") field(LNK5, "BEND:LTUS:166:BACT.LOLO") field(DOL6, "BEND:LTUS:166:BLIMITS") field(LNK6, "BEND:LTUS:166:BMONLIMITS.F PP") field(DOL7, "BEND:LTUS:166:BMONLIMITS.I") field(LNK7, "BEND:LTUS:166:BMON.HIGH") field(DOL8, "BEND:LTUS:166:BMONLIMITS.J") field(LNK8, "BEND:LTUS:166:BMON.LOW") field(DOL9, "BEND:LTUS:166:BMONLIMITS.K") field(LNK9, "BEND:LTUS:166:BMON.HIHI") field(DOLA, "BEND:LTUS:166:BMONLIMITS.L") field(LNKA, "BEND:LTUS:166:BMON.LOLO") field(FLNK, "BEND:LTUS:166:ILIMITS") field(SCAN, "5 second") } record(ao, "BEND:LTUS:166:BCTRL") { field(DESC, "B-Perturb") field(PREC, "7") field(EGU, "kG-m") field(DRVH, "4.5118") field(DRVL, "0.0128") field(HOPR, "4.5118") field(LOPR, "0.0128") # 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, "BEND:LTUS:166: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, "BEND:LTUS:166:BCTRLGO") { field(DESC, "Update DES and perturb") field(PREC, "7") # Disable BACT limits field(DOL1, "1") field(LNK1, "BEND:LTUS:166:BLIMITS.VAL") # Update BDES with the BCTRL (slider) value field(DOL2, "BEND:LTUS:166:BCTRL.VAL") field(LNK2, "BEND:LTUS:166:BDES PP") field(DOL3, "1") field(LNK3, "BEND:LTUS:166:IDIRECT.PROC PP") field(DOL4, "1") field(LNK4, "BEND:LTUS:166:CHECKSTDZLOST.PROC PP") field(DOL5, "BEND:LTUS:166:BCTRL.VAL") field(LNK5, "BEND:LTUS:166:BCTRLSUB PP") # Re-enable BACT limits field(DOL6, "0") field(LNK6, "BEND:LTUS:166:BLIMITS.VAL") } # Convert B-field to Current and output to ISETPT record(sub, "BEND:LTUS:166:BCTRLSUB") { field(DESC, "Feedback") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "BEND:LTUS:166:POLYCOEF") field(INPC, "BEND:LTUS:166:POLYCOEF.A") field(INPD, "BEND:LTUS:166:POLYCOEF.B") field(INPE, "BEND:LTUS:166:BDES.DRVH") field(INPF, "BEND:LTUS:166:BDES.DRVL") field(PREC, "7") field(EGU, "kG-m") field(HOPR, "4.5118") field(LOPR, "0.0128") field(MDEL, "-1") field(BRSV, "INVALID") field(FLNK, "BEND:LTUS:166:ISETPT") } record(ao, "BEND:LTUS:166:BDESPREVTRIM") { field(DESC, "trim bdes for undo") field(DTYP, "Soft Channel") field(DRVH, "4.5118") field(DRVL, "0.0128") field(EGU, "kG-m") field(HOPR, "4.5118") field(LOPR, "0.0128") field(PREC, "7") field(PINI, "YES") info(autosaveFields,"VAL") } record(stringin, "BEND:LTUS:166:MADNAME") { field(DESC, "MAD deck nomenclature") field(PINI, "YES") field(VAL, "BCX31B2") } record(ai, "BEND:LTUS:166: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, "3245.79204") } record(ao, "BEND:LTUS:166:BMAX") { field(DESC, "Max B-Field") field(DTYP, "Soft Channel") field(DRVH, "4.5118") field(DRVL, "0.0128") field(EGU, "kG-m") field(HOPR, "4.5118") field(LOPR, "0.0128") field(PREC, "7") field(PINI, "YES") field(VAL, "4.5118") field(FLNK, "BEND:LTUS:166:BSTEP") } record(ao, "BEND:LTUS:166:BMIN") { field(DESC, "Min B-Field") field(DTYP, "Soft Channel") field(DRVH, "4.5118") field(DRVL, "0.0128") field(EGU, "kG-m") field(HOPR, "4.5118") field(LOPR, "0.0128") field(PREC, "7") field(PINI, "YES") field(VAL, "0.0128") field(FLNK, "BEND:LTUS:166:BSTEP") } record(ao, "BEND:LTUS:166:BDESSAVE") { field(DESC, "bdes for save/load") field(DTYP, "Soft Channel") field(DRVH, "4.5118") field(DRVL, "0.0128") field(EGU, "kG-m") field(HOPR, "4.5118") field(LOPR, "0.0128") field(PINI, "YES") field(PREC, "7") } # This record is processed by BEND:LTUS:166: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, "BEND:LTUS:166:BCON") { field(DESC, "Config B-Field ") field(DTYP, "Soft Channel") field(PREC, "7") field(EGU, "kG-m") field(HOPR, "4.5118") field(LOPR, "0.0128") field(DRVH, "4.5118") field(DRVL, "0.0128") # Set MINOR Alarm as the default, slaves will set NO_ALARM=0. field(HHSV, "MINOR") field(LLSV, "MINOR") field(HSV, "MINOR") field(LSV, "MINOR") # field(DOL , "") field(OMSL, "supervisory") field(OUT, "BEND:LTUS:166:B2ICON PP") info(autosaveFields,"VAL") } record(sub, "BEND:LTUS:166:B2ICON") { field(DESC, "Convert Desired ICon to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "BEND:LTUS:166:POLYCOEF") field(INPC, "BEND:LTUS:166:POLYCOEF.A") field(INPD, "BEND:LTUS:166:POLYCOEF.B") field(PREC, "7") field(EGU, "kG-m") field(HOPR, "4.5118") field(LOPR, "0.0128") field(MDEL, "-1") field(INPE, "BEND:LTUS:166:BCON.DRVH") field(INPF, "BEND:LTUS:166:BCON.DRVL") field(BRSV, "INVALID") field(FLNK, "BEND:LTUS:166: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, "BEND:LTUS:166:BSTEP") { field(DESC, "B-Field step size") field(CALC, "(C==3)||(D==3)?0:ABS(A-B)*0.005") field(INPA, "BEND:LTUS:166:BMAX") field(INPB, "BEND:LTUS:166:BMIN") field(INPC, "BEND:LTUS:166:BMIN.SEVR") field(INPD, "BEND:LTUS:166:BMAX.SEVR") field(EGU, "kG-m") 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,"BEND:LTUS:166:BCTRLDISABLECALC") { field(DESC, "Calc for disabling BCTRL") field(ASG, "Internal") field(CALC, "A?2:1") field(INPA, "BEND:LTUS:166:ONLINE CP") field(OUT, "BEND:LTUS:166:BCTRLDISABLEFOUT PP") } record(fanout, "BEND:LTUS:166:BCTRLDISABLEFOUT") { field(DESC, "Disable BCTRL fanout") field(SELM, "Specified") field(SELL, "BEND:LTUS:166:BCTRLDISABLECALC") field(LNK1, "BEND:LTUS:166:BCTRLDISABLE") field(LNK2, "BEND:LTUS:166:BCTRLENABLE") } record(stringout, "BEND:LTUS:166:BCTRLDISABLE") { field(DESC, "Disable BCTRL") field(DTYP, "Soft Channel") field(OUT, "BEND:LTUS:166:BCTRL.ASG") field(VAL, "NOWRITE") field(FLNK, "BEND:LTUS:166:BCTRLDISV_UPDATE") } record(stringout, "BEND:LTUS:166:BCTRLENABLE") { field(DESC, "Enable BCTRL") field(DTYP, "Soft Channel") field(OUT, "BEND:LTUS:166:BCTRL.ASG") field(VAL, "") field(FLNK, "BEND:LTUS:166:BCTRLDISV_UPDATE") } record(calcout, "BEND:LTUS:166:BCTRLDISV_UPDATE") { field(DESC, "Calc for updating BCTRL.DISV") field(ASG, "Internal") field(CALC, "A") field(INPA, "BEND:LTUS:166:ONLINE") field(OUT, "BEND:LTUS:166: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,"BEND:LTUS:166:BACT and MON\n are processed via links from \n BEND:LTUS:166:IACT (device raw value readback 1)\n and\n BEND:LTUS:166: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 BEND:LTUS:166:POLYCOEF\nC = First polynomial coefficient (offset if linear)\nD = Second polynomial coefficient (slope if linear)\nE = BEND:LTUS:166: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,"BEND:LTUS:166:BDES\n is processed when set by CA users or \n BEND:LTUS:166: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,"BEND:LTUS:166: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 BEND:LTUS:166: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 (BEND:LTUS:166: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,"BEND:LTUS:166:B*LIMITS and BEND:LTUS:166:BLIMITS:\n Calculate alarm and warning limits based on \n deltas from BEND:LTUS:166: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,"BEND:LTUS:166: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,"BEND:LTUS:166: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, "BEND:LTUS:166: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, "BEND:LTUS:166:MPSBTOL") { field(DESC, "Absolute mps tol") field(EGU, "kG-m") field(PREC, "2") field(CALC, "ABS(A)*0.02") field(INPA, "BEND:LTUS:166:BMAX") field(PINI, "YES") } # # 21-Aug-2013: K. Luchini # Set channel access security so that users # cannot easily change values. record(ao, "BEND:LTUS:166:MPSBMAX") { field(DESC, "MPS Max B-field") field(EGU, "kG-m") field(PREC, "7") field(DRVH, "4.5118") field(DRVL, "0.0128") field(PINI, "YES") field(VAL, "4.5118") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:166:MPSBMIN") { field(DESC, "MPS Min B-field") field(EGU, "kG-m") field(PREC, "7") field(DRVH, "4.5118") field(DRVL, "0.0128") field(PINI, "YES") field(VAL, "0.0128") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:166:MPSBLLIM") { field(DESC, "MPS Low Limit B-field") field(EGU, "kG-m") field(PREC, "7") field(DRVH, "4.5118") field(DRVL, "0.0128") field(PINI, "YES") field(VAL, "0.0128") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:166:MPSBLLIM2") { field(DESC, "MPS Low Limit #2 B-field") field(EGU, "kG-m") field(PREC, "7") field(DRVH, "4.5118") field(DRVL, "0.0128") field(PINI, "YES") field(VAL, "0.0128") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } # Set the default to Std record(mbbo, "BEND:LTUS:166: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, "BEND:LTUS:166:MPSLIMITS.E PP") } record(aSub, "BEND:LTUS:166: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, "BEND:LTUS:166:MPS.RVAL") field(INPB, "BEND:LTUS:166:BADIFF") field(INPC, "BEND:LTUS:166:BDELTAS.N") field(INPD, "BEND:LTUS:166:BACT") field(INPE, "BEND:LTUS:166:MPSBITMASK.RVAL") field(INPF, "BEND:LTUS:166:MPSBLLIM") field(INPG, "BEND:LTUS:166:MPSBMIN") field(INPH, "BEND:LTUS:166:MPSBMAX") field(INPI, "BEND:LTUS:166: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, "BEND:LTUS:166:INTOL.RVAL PP") field(OUTB, "BEND:LTUS:166:INTOL_BMIN.RVAL PP") field(OUTC, "BEND:LTUS:166:INTOL_BRANGE.RVAL PP") field(OUTD, "BEND:LTUS:166: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, "BEND:LTUS:166:INTOL") { field(DESC, "BACT within MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "BEND:LTUS:166:MPSLIMITS.VALA") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "BEND:LTUS:166:INTOL_BMIN") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "BEND:LTUS:166:MPSLIMITS.VALB") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "BEND:LTUS:166:INTOL_BMIN2") { field(DESC, "MPS tol #2") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "BEND:LTUS:166:MPSLIMITS.VALD") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "BEND:LTUS:166:INTOL_BRANGE") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "BEND:LTUS:166: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, "BEND:LTUS:166:CHCKITOL") { field(DESC, "Absolute Check I Tolerance") field(EGU, "A") field(FLNK, "BEND:LTUS:166:TRIMITOL") field(CALC, "ABS(A*B)") field(INPA, "BEND:LTUS:166:CHCKBTOL") field(INPB, "BEND:LTUS:166:POLYCOEF.B") field(PREC, "9") } record(calc, "BEND:LTUS:166:TRIMBTOL") { field(EGU, "kG-m") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(DESC, "Absolute Trim Tolerance") field(CALC, "ABS(A)/2") field(INPA, "BEND:LTUS:166:CHCKBTOL") field(FLNK, "BEND:LTUS:166:CHCKITOL") } record(calc, "BEND:LTUS:166:CHCKBTOL") { field(DESC, "Check absolute tolerance") field(EGU, "A") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(FLNK, "BEND:LTUS:166:TRIMBTOL") field(CALC, "MAX(ABS(A),ABS(C))*(B/1000000)") field(INPA, "BEND:LTUS:166:BDES.HOPR") field(INPB, "BEND:LTUS:166:STABILITY") field(INPC, "BEND:LTUS:166:BDES.LOPR") } record(longout, "BEND:LTUS:166: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, "BEND:LTUS:166:CHCKBTOL") } record(calc, "BEND:LTUS:166:TRIMITOL") { field(DESC, "Absolute Trim I Tolerance") field(EGU, "kG-m") field(CALC, "ABS(A*B)") field(INPA, "BEND:LTUS:166:POLYCOEF.B") field(INPB, "BEND:LTUS:166:TRIMBTOL") field(PREC, "9") } record(ai, "BEND:LTUS:166:TRIMBTOLR") { field(DESC, "Relative trim tol") field(PREC, "4") field(EGU, "%") field(HOPR, "1.0") field(LOPR, "0.0") field(PINI, "YES") } record(ai, "BEND:LTUS:166: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, "BEND:LTUS:166:FBCKFCOM") { field(ZNAM, "CA") field(ONAM, "FCOM") field(DESC, "CA Mode") field(PINI, "YES") field(SDIS, "0") } record(bo, "BEND:LTUS:166:PAU") { field(ZNAM, "NotConfigured") field(ONAM, "Configured") field(DESC, "PAU Present") field(PINI, "YES") field(SDIS, "0") field(FLNK, "BEND:LTUS:166:PAUGO") } record(fanout, "BEND:LTUS:166:PAUGO") { field(DESC, "PAU control") field(LNK1, "BEND:LTUS:166:PAUSTOP") field(LNK2, "BEND:LTUS:166: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, "BEND:LTUS:166:PAUSTART") { field(DESC, "Setup for PAU On") field(SDIS, "BEND:LTUS:166: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, "BEND:LTUS:166:PAUSTOP") { field(DESC, "Setup for PAU Off") field(SDIS, "BEND:LTUS:166: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, "BEND:LTUS:166:MCORDEVNAME") { field(DESC, "PS device name") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, "PSC:LTUS:MG03:") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "BEND:LTUS:166: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, "BEND:LTUS:166:PSTYPE.RVAL") field(INPC, "BEND:LTUS:166:TURNEDOFF.RVAL") field(INPD, "BEND:LTUS:166:CONFIG.RVAL") field(INPE, "BEND:LTUS:166:PSCATEGORY.RVAL") field(INPF, "BEND:LTUS:166:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "BEND:LTUS:166:AUTOCTRL.RVAL") field(INPJ, "BEND:LTUS:166:OUTOFSERVICE.RVAL") field(INPL, "BEND:LTUS:166:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "BEND:LTUS:166:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "BEND:LTUS:166:PAU") field(INPP, "BEND:LTUS:166:CALBDISABLE.RVAL") field(INPQ, "BEND:LTUS:166:PTRBDISABLE.RVAL") field(INPR, "BEND:LTUS:166:TRIMDISABLE.RVAL") field(INPS, "BEND:LTUS:166:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "BEND:LTUS:166:FBCK") field(INPU, "BEND:LTUS:166:TRIMTYPE.RVAL") field(INPV, "BEND:LTUS:166:STDZDIRECT.RVAL") field(INPW, "BEND:LTUS:166:DEGAUSENABLE.RVAL") field(FLNK, "BEND:LTUS:166:HSTA") } record(longin, "BEND:LTUS:166:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "BEND:LTUS:166:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "BEND:LTUS:166: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, "BEND:LTUS:166: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, "BEND:LTUS:166:CALBDISABLE") { field(DESC, "DAC Calb Disabled") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "BEND:LTUS:166:PTRBDISABLE") { field(DESC, "Perturb Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "BEND:LTUS:166:TRIMDISABLE") { field(DESC, "Trim Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "BEND:LTUS:166: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 BEND:LTUS:166:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses BEND:LTUS:166:FBCK. # This PV should be replaced by BEND:LTUS:166: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, "BEND:LTUS:166: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, "BEND:LTUS:166: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, "BEND:LTUS:166: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, "") field(OMSL, "supervisory") field(FLNK, "BEND:LTUS:166:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"BEND:LTUS:166:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "BEND:LTUS:166:OUTOFSERVICE NPP NMS") field(OUT, "BEND:LTUS:166:ONLINE PP") } record(bo, "BEND:LTUS:166:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "BEND:LTUS:166: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, "1") } record(bo, "BEND:LTUS:166: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, "1") } record(bo, "BEND:LTUS:166: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, "BEND:LTUS:166: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, "BEND:LTUS:166: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, "BEND:LTUS:166: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, "BEND:LTUS:166: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, "BEND:LTUS:166: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, "1") field(ASG, "NOWRITE") } record(mbbo, "BEND:LTUS:166: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, "1") field(ASG, "NOWRITE") } record(mbbo, "BEND:LTUS:166: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, "2") field(ASG, "NOWRITE") } record(mbbo, "BEND:LTUS:166: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, "0") field(ASG, "NOWRITE") field(FLNK, "BEND:LTUS:166:TRIMTYPE") } record(stringout, "BEND:LTUS:166:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "BEND:LTUS:166:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "BEND:LTUS:166:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "BEND:LTUS:166:STATE.RVAL") field(INPB, "BEND:LTUS:166:INTLKSUMY.RVAL") field(OUT, "BEND:LTUS:166:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "BEND:LTUS:166: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, "BEND:LTUS:166:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "BEND:LTUS:166:STATE.RVAL") field(INPB, "BEND:LTUS:166:INTLKSUMY.RVAL") field(OUT, "BEND:LTUS:166:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "BEND:LTUS:166:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "BEND:LTUS:166:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "BEND:LTUS:166: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, "BEND:LTUS:166:RAMPSTARTDLY") { field(DESC, "Tansition to ramp delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "2") } ######### For PSTYPE=2 Only ############# record(mbbo, "BEND:LTUS:166: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, "BEND:LTUS:166: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,"BEND:LTUS:166: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("BEND:LTUS:166:TURNEDOFF",3140,1907,0,1,"BEND:LTUS:166:TURNEDOFF") #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "BEND:LTUS:166:STATSUB") { field(DESC, "Build STATus ") field(INAM, "mgntInit") field(SNAM, "mgntSlcStat") field(INPA, "BEND:LTUS:166:BACT.STAT") field(INPB, "BEND:LTUS:166:BDES.STAT") field(INPC, "BEND:LTUS:166:IRIPL.STAT") field(INPD, "PSC:LTUS:MG03:ISETPT.STAT") field(INPE, "PSC:LTUS:MG03:IACT.STAT") # 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, "BEND:LTUS:166:BACT.SEVR") field(INPH, "BEND:LTUS:166:BDES.SEVR") field(INPI, "BEND:LTUS:166:IRIPL.SEVR") field(INPJ, "PSC:LTUS:MG03:ISETPT.SEVR") field(INPK, "PSC:LTUS:MG03:IACT.SEVR") # # 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, "BEND:LTUS:166:STATE.RVAL") field(INPN, "BEND:LTUS:166:STDZOK") field(INPO, "BEND:LTUS:166:CALBOK") field(INPP, "BEND:LTUS:166:OUTOFSERVICE.RVAL") field(INPQ, "BEND:LTUS:166:CONFIG.RVAL") field(INPR, "BEND:LTUS:166:HSTA") field(INPS, "BEND:LTUS:166:CTRL.RVAL") field(INPT, "BEND:LTUS:166:DEGAUSOK") field(INPV, "BEND:LTUS:166: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, "BEND:LTUS:166:STAT") } record(longout, "BEND:LTUS:166:STAT") { field(DESC, "STAT sent to SLC") field(SCAN, "Passive") field(FLNK, "BEND:LTUS:166:STATCTRLSUB") field(DOL, "BEND:LTUS:166:STATSUB.VAL") field(OMSL, "closed_loop") } record(sSub, "BEND:LTUS:166:STATCTRLSUB") { field(DESC, "Decode SLC STAT into mbbo") field(INAM, "mgntInit") field(SNAM, "mgntStatDecode") field(INPA, "BEND:LTUS:166:STAT") field(INPB, "BEND:LTUS:166:HSTA") field(INPD, "BEND:LTUS:166:ONOFFCTRL.RVAL") field(FLNK, "BEND:LTUS:166:STATMSG") } record(mbbo, "BEND:LTUS:166: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, "BEND:LTUS:166:UNAVAILGO") field(DOL, "BEND:LTUS:166:STATCTRLSUB.W") } record(seq, "BEND:LTUS:166:UNAVAILGO") { field(DESC, "Process UNAVAIL") field(DOL1, "BEND:LTUS:166:STATSUB.U") field(LNK1, "BEND:LTUS:166:UNAVAIL PP") } record(stringout, "BEND:LTUS:166:SNLSTATMSG") { field(DTYP, "Soft Channel") } #! TextBox(TB0,820,1000,1200,1220,0,"Dialog",12,1,16777215,"BEND:LTUS:166:STATUSSUB - future\nOverall device status - takes input from action snls, record sevrs, master snl(s) and outputs final status\n\nInputs:\nA - BEND:LTUS:166:CTRLSTATUS - snl status\nB - MGNT:CTRLSTATUS - master list status\nC\nD - BEND:LTUS:166: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,"BEND:LTUS:166STATSUB\nformat control bo's into slc STAT\n\nInputs:\nA - BEND:LTUS:166:STATUS\nC - BEND:LTUS:166:ON\nD - BEND:LTUS:166:STDZOK\nE - BEND:LTUS:166:CALBOK\nF - BEND:LTUS:166:BACTDRIFT (future)\nG -\nH- BEND:LTUS:166:DACSTATUS\nI -BEND:LTUS:166:ADCSTATUS\nJ - BEND:LTUS:166:BACTSTATUS\nK - BEND:LTUS:166:BDESSTATUS\nL - BEND:LTUS:166:RIPLSTATUS\n\nOutput:\nP - BEND:LTUS:166: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, "BEND:LTUS:166: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, "BEND:LTUS:166: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, "BEND:LTUS:166: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, "BEND:LTUS:166: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.6 #! DBDSTART #! DBD("../../../../dbd/mgntSoft.dbd") #! DBDEND record(stringout, "BEND:LTUS:166:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:166:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "BEND:LTUS:166:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "BEND:LTUS:166:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "BEND:LTUS:166:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "BEND:LTUS:166:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "1") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "BEND:LTUS:166: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, "BEND:LTUS:166:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "BEND:LTUS:166:TRIMTYPE.RVAL") field(INPB, "BEND:LTUS:166:CONFIG.RVAL") field(OUT, "BEND:LTUS:166:TRIMMAXNUM PP") } record(longout, "BEND:LTUS:166: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, "BEND:LTUS:166: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, "") field(OMSL, "supervisory") field(VAL, "10") field(OUT, "BEND:LTUS:166:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "BEND:LTUS:166: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, "") field(OMSL, "supervisory") field(VAL, "10") } record(bo, "BEND:LTUS:166: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, "BEND:LTUS:166: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, "BEND:LTUS:166: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, "BEND:LTUS:166:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "0") } record(ao, "BEND:LTUS:166: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, "BEND:LTUS:166:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "BEND:LTUS:166: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, "BEND:LTUS:166: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, "BEND:LTUS:166:IMOVE") field(INPB, "BEND:LTUS:166:IACT") field(INPC, "BEND:LTUS:166:IRAMPRATE") field(INPD, "1.577") field(INPE, "BEND:LTUS:166:TRIMDLYPCT") field(INPF, "BEND:LTUS:166:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "BEND:LTUS:166:RAMPTIME_LEFT PP") } record(longout, "BEND:LTUS:166:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "BEND:LTUS:166:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "BEND:LTUS:166:RAMPDONE_CALC") } record(calc, "BEND:LTUS:166:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "BEND:LTUS:166:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "BEND:LTUS:166:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "BEND:LTUS:166: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, "BEND:LTUS:166:RAMPTIME_LEFT") field(OUT, "BEND:LTUS:166:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "BEND:LTUS:166:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "BEND:LTUS:166:RAMPTIME_LEFT NMS") field(OUT, "BEND:LTUS:166:RAMPDONE PP") } record(bo, "BEND:LTUS:166:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "BEND:LTUS:166:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "BEND:LTUS:166: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, "BEND:LTUS:166: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(sSub, "BEND:LTUS:166: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, "BEND:LTUS:166:PSTYPE.RVAL") field(INPC, "BEND:LTUS:166:TURNEDOFF.RVAL") field(INPD, "BEND:LTUS:166:CONFIG.RVAL") field(INPE, "BEND:LTUS:166:PSCATEGORY.RVAL") field(INPF, "BEND:LTUS:166:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "BEND:LTUS:166:AUTOCTRL.RVAL") field(INPJ, "BEND:LTUS:166:OUTOFSERVICE.RVAL") field(INPL, "BEND:LTUS:166:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "BEND:LTUS:166:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "BEND:LTUS:166:PAU") field(INPP, "BEND:LTUS:166:CALBDISABLE.RVAL") field(INPQ, "BEND:LTUS:166:PTRBDISABLE.RVAL") field(INPR, "BEND:LTUS:166:TRIMDISABLE.RVAL") field(INPS, "BEND:LTUS:166:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "BEND:LTUS:166:FBCK") field(INPU, "BEND:LTUS:166:TRIMTYPE.RVAL") field(INPV, "BEND:LTUS:166:STDZDIRECT.RVAL") field(INPW, "BEND:LTUS:166:DEGAUSENABLE.RVAL") field(FLNK, "BEND:LTUS:166:HSTA") } record(longin, "BEND:LTUS:166:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "BEND:LTUS:166:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "BEND:LTUS:166: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, "BEND:LTUS:166: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, "BEND:LTUS:166:CALBDISABLE") { field(DESC, "DAC Calb Disabled") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "BEND:LTUS:166:PTRBDISABLE") { field(DESC, "Perturb Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "BEND:LTUS:166:TRIMDISABLE") { field(DESC, "Trim Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "BEND:LTUS:166:STDZDISABLE") { field(DTYP, "Raw Soft Channel") field(ZNAM, "NO") field(ONAM, "YES") field(DESC, "Standardize Function") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } # This PV has been replaced by BEND:LTUS:166:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses BEND:LTUS:166:FBCK. # This PV should be replaced by BEND:LTUS:166: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, "BEND:LTUS:166: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, "BEND:LTUS:166: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, "BEND:LTUS:166: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, "") field(OMSL, "supervisory") field(FLNK, "BEND:LTUS:166:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"BEND:LTUS:166:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "BEND:LTUS:166:OUTOFSERVICE NPP NMS") field(OUT, "BEND:LTUS:166:ONLINE PP") } record(bo, "BEND:LTUS:166:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "BEND:LTUS:166: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, "1") } record(bo, "BEND:LTUS:166: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, "1") } record(bo, "BEND:LTUS:166: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, "BEND:LTUS:166: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, "BEND:LTUS:166: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, "BEND:LTUS:166: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, "BEND:LTUS:166: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, "BEND:LTUS:166: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, "1") field(ASG, "NOWRITE") } record(mbbo, "BEND:LTUS:166: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, "1") field(ASG, "NOWRITE") } record(mbbo, "BEND:LTUS:166: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, "2") field(ASG, "NOWRITE") } record(mbbo, "BEND:LTUS:166: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, "2") field(ASG, "NOWRITE") field(FLNK, "BEND:LTUS:166:TRIMTYPE") } record(stringout, "BEND:LTUS:166:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "BEND:LTUS:166:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "BEND:LTUS:166:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "BEND:LTUS:166:STATE.RVAL") field(INPB, "BEND:LTUS:166:INTLKSUMY.RVAL") field(OUT, "BEND:LTUS:166:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "BEND:LTUS:166: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, "BEND:LTUS:166:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "BEND:LTUS:166:STATE.RVAL") field(INPB, "BEND:LTUS:166:INTLKSUMY.RVAL") field(OUT, "BEND:LTUS:166:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "BEND:LTUS:166:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "BEND:LTUS:166:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "BEND:LTUS:166: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, "BEND:LTUS:166:RAMPSTARTDLY") { field(DESC, "Tansition to ramp delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "2") } ######### For PSTYPE=2 Only ############# record(mbbo, "BEND:LTUS:166: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, "BEND:LTUS:166: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,"BEND:LTUS:166: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("BEND:LTUS:166:TURNEDOFF",3140,1907,0,1,"BEND:LTUS:166:TURNEDOFF") #! 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, "BEND:LTUS:476:IACT") { field(DESC, "Current") field(INP, "PSC:LTUS:MG26:IACT") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "BEND:LTUS:476:BACT") info(autosaveFields,"HYST") } record(bi, "BEND:LTUS:476:STATE") { field(DESC, "PS On/Off Status") field(DTYP, "Raw Soft Channel") field(INP, "PSC:LTUS:MG26:STATE NPP MS") field(ZSV, "MAJOR") field(ZNAM, "OFF") field(ONAM, "ON") } record(ao, "BEND:LTUS:476:IDES") { field(DESC, "Desired Current") field(PREC, "3") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(MDEL, "-1") field(HIHI, "250.0") field(LOLO, "0.0") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "BEND:LTUS:476:BDELTAS") field(DRVH, "250.0") field(DRVL, "0.0") field(DOL, "BEND:LTUS:476: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, "BEND:LTUS:476:ICTRL PP") } # This record is processed by BEND:LTUS:476:ICON") # Note: we are not setting alarms here. record(ao, "BEND:LTUS:476:ICON") { field(DESC, "Config I") field(DTYP, "Soft Channel") field(PREC, "3") field(HOPR, "250.0") field(LOPR, "0.0") field(DRVH, "250.0") field(DRVL, "0.0") field(DOL, "BEND:LTUS:476:B2ICON.K") field(OMSL, "closed_loop") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:476:INOM") { field(DESC, "Nominal Current") field(DOL, "BEND:LTUS:476:BNOM.K") field(OMSL, "closed_loop") field(PREC, "3") field(EGU, "A") field(DRVH, "250.0") field(DRVL, "0.0") field(HOPR, "250.0") field(LOPR, "0.0") } record(ao, "BEND:LTUS:476:ICTRL") { field(DESC, "Set Current") field(PREC, "3") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(DRVH, "250.0") field(DRVL, "0.0") field(MDEL, "-1") field(FLNK, "BEND:LTUS:476:ICTRLGO") field(OMSL, "supervisory") info(autosavefields,"VAL") } record(seq, "BEND:LTUS:476:ICTRLGO") { field(DESC, "Process Current Setpoint") field(PREC, "3") # Set ISETPT to supervisory field(DOL1, "0") field(LNK1, "BEND:LTUS:476:ISETPT.OMSL") field(DOL2, "BEND:LTUS:476:ICTRL") field(LNK2, "BEND:LTUS:476:ISETPT PP") # Set ISETPT to closed loop - get data from BCTRLSUB.K field(DOL3, "1") field(LNK3, "BEND:LTUS:476:ISETPT.OMSL") } record(ao, "BEND:LTUS:476:IMAX") { field(DESC, "Max I") field(DTYP, "Soft Channel") field(DRVH, "250.0") field(DRVL, "0.0") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(PREC, "3") field(PINI, "YES") field(VAL, "250.0") field(FLNK, "BEND:LTUS:476:IMIN") } record(ao, "BEND:LTUS:476:IMIN") { field(DESC, "Min I") field(DTYP, "Soft Channel") field(DRVH, "250.0") field(DRVL, "0.0") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(PREC, "3") field(VAL, "0.0") field(FLNK, "BEND:LTUS:476:IRANGE") } record(sel, "BEND:LTUS:476:IACTPREVOK") { field(DESC, "Last Good Current") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(PREC, "3") field(NVL, "BEND:LTUS:476:BACT.SEVR") field(INPA, "BEND:LTUS:476:IACT NPP MS") field(INPB, "BEND:LTUS:476:IACTPREVOK NPP MS") field(INPC, "BEND:LTUS:476:IACTPREVOK NPP MS") field(INPD, "BEND:LTUS:476:IACTPREVOK NPP MS") } record(sub, "BEND:LTUS:476:IACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "BEND:LTUS:476:IDES") field(INPB, "BEND:LTUS:476:ISETPT.DRVH") field(INPC, "BEND:LTUS:476:ISETPT.DRVL") field(INPD, "BEND:LTUS:476:IDELTAS.I") field(INPE, "BEND:LTUS:476:IDELTAS.J") field(INPG, "BEND:LTUS:476:STATE") field(INPH, "BEND:LTUS:476:HSTA") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(sub, "BEND:LTUS:476:IMONLIMITS") { field(DESC, "Aux Current Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "BEND:LTUS:476:IDES") field(INPB, "BEND:LTUS:476:ISETPT.DRVH") field(INPC, "BEND:LTUS:476:ISETPT.DRVL") field(INPD, "BEND:LTUS:476:IDELTAS.K") field(INPE, "BEND:LTUS:476:IDELTAS.L") field(INPG, "BEND:LTUS:476:STATE") field(INPH, "BEND:LTUS:476:HSTA") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(seq, "BEND:LTUS:476:ILIMITS") { field(DESC, "Set ACT and MON Limits") field(PREC, "3") field(DOL1, "BEND:LTUS:476:BLIMITS") field(LNK1, "BEND:LTUS:476:IACTLIMITS.F PP") field(DOL2, "BEND:LTUS:476:IACTLIMITS.I") field(LNK2, "BEND:LTUS:476:IACT.HIGH") field(DOL3, "BEND:LTUS:476:IACTLIMITS.J") field(LNK3, "BEND:LTUS:476:IACT.LOW") field(DOL4, "BEND:LTUS:476:IACTLIMITS.K") field(LNK4, "BEND:LTUS:476:IACT.HIHI") field(DOL5, "BEND:LTUS:476:IACTLIMITS.L") field(LNK5, "BEND:LTUS:476:IACT.LOLO") field(DOL6, "BEND:LTUS:476:BLIMITS") field(LNK6, "BEND:LTUS:476:IMONLIMITS.F PP") field(DOL7, "BEND:LTUS:476:IMONLIMITS.I") field(LNK7, "BEND:LTUS:476:IMON.HIGH") field(DOL8, "BEND:LTUS:476:IMONLIMITS.J") field(LNK8, "BEND:LTUS:476:IMON.LOW") field(DOL9, "BEND:LTUS:476:IMONLIMITS.K") field(LNK9, "BEND:LTUS:476:IMON.HIHI") field(DOLA, "BEND:LTUS:476:IMONLIMITS.L") field(LNKA, "BEND:LTUS:476: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, "BEND:LTUS:476:IDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntRawDeltas") field(INPD, "BEND:LTUS:476:TRIMBTOL") field(INPE, "BEND:LTUS:476:CHCKBTOL") field(INPF, "BEND:LTUS:476:BDELTAS.K") field(INPG, "BEND:LTUS:476:BDELTAS.L") field(INPH, "BEND:LTUS:476: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, "BEND:LTUS:476:STDZITOLR") field(INPC, "BEND:LTUS:476:STDZITOL") field(FLNK, "") } # All ps controllers with on/off control will set the macro ONOF # as follows: # # ONOF = PSC:LTUS:MG26: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, "BEND:LTUS:476:STATESETPT") { field(DESC, "PS On/Off") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFF") field(ONAM, "ON") field(OUT, "PSC:LTUS:MG26:STATESETPT PP") 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 = PSC:LTUS:MG26:RESET PP # record(bo, "BEND:LTUS:476:RESET") { field(DESC, "Interlock Latch Reset") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFF") field(ONAM, "ON") field(HIGH, "1.0") field(OUT, "PSC:LTUS:MG26:RESET PP") } record(bo, "BEND:LTUS:476:RAMPSTATE") { field(DESC, "PS Ramp Status") field(DTYP, "Soft Channel") field(DOL, "PSC:LTUS:MG26:RAMPSTATE NPP 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, "BEND:LTUS:476: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, "BEND:LTUS:476:TRIMRAMPRATE") field(OUT, "PSC:LTUS:MG26:IRAMPRATE PP") field(FLNK, "BEND:LTUS:476:STDZDLY") } record(ao, "BEND:LTUS:476:ISETPT") { field(DESC, "Current Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(DRVH, "250.0") field(DRVL, "0.0") field(MDEL, "-1") field(OUT, "PSC:LTUS:MG26:ISETPT PP") field(DOL, "BEND:LTUS:476: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, "BEND:LTUS:476:IMON") { field(DESC, "Aux Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(INP, "PSC:LTUS:MG26:IMON") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "BEND:LTUS:476:BMON") } record(ao, "BEND:LTUS:476:IRIPL") { field(DESC, "Ripple Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(DOL, "PSC:LTUS:MG26:IRIPL NPP NMS") field(OMSL, "closed_loop") field(EGU, "A") field(DRVH, "1.0") field(HOPR, "1.0") field(PREC, "3") field(FLNK, "BEND:LTUS:476:IRIPLOK") } record(sub, "BEND:LTUS:476:IRIPLOK") { field(DESC, "Ripple Current Status") field(INAM, "mgntInit") field(SNAM, "mgntRiplOK") field(INPA, "BEND:LTUS:476:IRIPL.VAL") field(INPB, "BEND:LTUS:476: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, "BEND:LTUS:476:R") { field(DESC, "Resistance") field(EGU, "Ohms") field(PREC, "4") field(PINI, "YES") field(DOL, "PSC:LTUS:MG26:R NPP MS") 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, "BEND:LTUS:476:IGND") { field(DESC, "Ground Current") field(EGU, "A") field(PREC, "6") field(PINI, "YES") field(DOL, "PSC:LTUS:MG26:IGND NPP MS") field(OMSL, "closed_loop") } record(bi, "BEND:LTUS:476:INTLKSUMY") { field(DESC, "Interlock Summary") field(INP, "PSC:LTUS:MG26:INTLKSUMY NPP MS") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(ZNAM, "OK") field(ONAM, "FAULT") field(PINI, "NO") } record(mbbo, "BEND:LTUS:476: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, "PSC:LTUS:MG26:COOLING") field(OMSL, "closed_loop") } # The following PV is processed by :BACTFO # which is processed by :BACT record(fanout, "BEND:LTUS:476:IACTFO") { field(DESC, "IACT processing") field(SELM, "All") field(LNK1, "BEND:LTUS:476:IACTPREVOK") field(LNK2, "BEND:LTUS:476:IDIFF") field(LNK3, "BEND:LTUS:476:IADIFF") field(LNK4, "BEND:LTUS:476:IRATIO") field(LNK5, "BEND:LTUS:476:IDIRECT") field(LNK6, "BEND:LTUS:476:IACTPOL_CHECK") } record(calc, "BEND:LTUS:476:IDIFF") { field(DESC, "IDES-IACT") field(CALC, "A-B") field(INPA, "BEND:LTUS:476:IDES") field(INPB, "BEND:LTUS:476:IACT") field(EGU, "A") field(PREC, "9") field(HOPR, "250.0") field(LOPR, "0.0") } record(calc, "BEND:LTUS:476:IADIFF") { field(DESC, "Absolute IDES-IACT") field(CALC, "A<0?ABS(A):A") field(INPA, "BEND:LTUS:476:IDIFF") field(PREC, "9") } record(calc, "BEND:LTUS:476:IRATIO") { field(DESC, "IDES-IACT/IMAX") field(CALC, "B?A/B:0") field(INPA, "BEND:LTUS:476:IDIFF") field(INPB, "BEND:LTUS:476:IDES.DRVH") field(PREC, "9") } record(calcout, "BEND:LTUS:476:IRANGE") { field(DESC, "Current Range") field(PINI, "YES") field(CALC, "ABS(A-B)") field(INPA, "BEND:LTUS:476:IMIN") field(INPB, "BEND:LTUS:476: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, "BEND:LTUS:476: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, "BEND:LTUS:476:IACT") field(FLNK, "BEND:LTUS:476:IACTPOL") } record(bo, "BEND:LTUS:476:IACTPOL") { field(DESC, "Actual I Polarity") field(DTYP, "Raw Soft Channel") field(DOL, "BEND:LTUS:476: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,"BEND:LTUS:476:I*LIMITS:\n Calculate alarm and warning limits based on \n deltas from BEND:LTUS:476:IDELTAS and the\n BEND:LTUS:476: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,"BEND:LTUS:476:IACT: \n Get copy of BEND:LTUS:476:I. \n",null) #! TextBox(TB12,1280,3100,1760,3200,0,"Dialog",12,1,16777215,"BEND:LTUS:476: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,"BEND:LTUS:476:IDES:\n Contains raw value calculated by \nBEND:LTUS:476: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 \nBEND:LTUS:476:BDELTAS.\n",null) #! TextBox(TB10,56,1940,316,2340,0,"Dialog",12,1,16777215,"BEND:LTUS:476: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 BEND:LTUS:476: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 BEND:LTUS:476: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,"BEND:LTUS:476:ISETPT:\n Sets the hardware. When fast feedback is set on, this record is\n set to closed loop mode by BEND:LTUS:476:FBCKSTART sequence. When \n the loop is closed, this record takes input calculated by \n BFBCK only. When fast feedback is set off, BEND:LTUS:476:FBCKSTOP \n will set it back to supervisory so that the value can be set by \n BEND:LTUS:476: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, "BEND:LTUS:476:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:476:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "BEND:LTUS:476:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "BEND:LTUS:476:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "BEND:LTUS:476:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "BEND:LTUS:476:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "1") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "BEND:LTUS:476: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, "BEND:LTUS:476:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "BEND:LTUS:476:TRIMTYPE.RVAL") field(INPB, "BEND:LTUS:476:CONFIG.RVAL") field(OUT, "BEND:LTUS:476:TRIMMAXNUM PP") } record(longout, "BEND:LTUS:476: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, "BEND:LTUS:476: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, "") field(OMSL, "supervisory") field(VAL, "10") field(OUT, "BEND:LTUS:476:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "BEND:LTUS:476: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, "") field(OMSL, "supervisory") field(VAL, "10") } record(bo, "BEND:LTUS:476: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, "BEND:LTUS:476: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, "BEND:LTUS:476: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, "BEND:LTUS:476:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "0") } record(ao, "BEND:LTUS:476: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, "BEND:LTUS:476:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "BEND:LTUS:476: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, "BEND:LTUS:476: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, "BEND:LTUS:476:IMOVE") field(INPB, "BEND:LTUS:476:IACT") field(INPC, "BEND:LTUS:476:IRAMPRATE") field(INPD, "1.577") field(INPE, "BEND:LTUS:476:TRIMDLYPCT") field(INPF, "BEND:LTUS:476:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "BEND:LTUS:476:RAMPTIME_LEFT PP") } record(longout, "BEND:LTUS:476:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "BEND:LTUS:476:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "BEND:LTUS:476:RAMPDONE_CALC") } record(calc, "BEND:LTUS:476:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "BEND:LTUS:476:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "BEND:LTUS:476:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "BEND:LTUS:476: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, "BEND:LTUS:476:RAMPTIME_LEFT") field(OUT, "BEND:LTUS:476:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "BEND:LTUS:476:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "BEND:LTUS:476:RAMPTIME_LEFT NMS") field(OUT, "BEND:LTUS:476:RAMPDONE PP") } record(bo, "BEND:LTUS:476:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "BEND:LTUS:476:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "BEND:LTUS:476: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, "BEND:LTUS:476: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, "BEND:LTUS:476:STDZINIT") { field(DESC, "Proc. Stdz PVs on boot") field(PINI, "YES") field(DOL1, "1") field(DOL2, "1") field(DOL3, "1") field(LNK1, "BEND:LTUS:476:DEBUG.PROC PP") field(LNK2, "BEND:LTUS:476:STDZCYCLENUM.PROC PP") field(LNK3, "BEND:LTUS:476:STDZDISABLE.PROC PP") field(LNK4, "BEND:LTUS:476: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, "BEND:LTUS:476:STDZSUB") { field(DESC, "Stdz subroutine") field(INAM, "mgntStdzInit") field(SNAM, "mgntStdz") field(BRSV, "INVALID") field(INPA, "BEND:LTUS:476:STDZIMIN NPP NMS") field(INPB, "BEND:LTUS:476:STDZIMAX NPP NMS") field(INPC, "BEND:LTUS:476:STDZIFINAL NPP NMS") field(INPD, "BEND:LTUS:476:STDZCYCLENUM NPP NMS") field(INPE, "BEND:LTUS:476:STDZDIRECT.RVAL NPP NMS") field(INPF, "BEND:LTUS:476:STDZDISABLE.RVAL CPP NMS") field(INPG, "BEND:LTUS:476: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, "BEND:LTUS:476:STDZWF PP") field(OUTB, "BEND:LTUS:476: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, "BEND:LTUS:476:STDZWF") } record(mbbo, "BEND:LTUS:476: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, "BEND:LTUS:476: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, "BEND:LTUS:476:STDZMAINPS") { field(DESC, "Stdz by main or self") field(PINI, "YES") field(DTYP, "Soft Channel") field(ZNAM, "SELF") field(ONAM, "MAIN") } record(bo, "BEND:LTUS:476: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, "BEND:LTUS:476: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, "BEND:LTUS:476: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, "BEND:LTUS:476:STDZTOD") { field(DESC, "Successful Standardize Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "BEND:LTUS:476:STDZLOSTTOD") { field(DESC, "Standardize Lost Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(longout, "BEND:LTUS:476:STDZCYCLECNT") { field(DESC, "Cycle Count") field(PINI, "YES") } record(longout, "BEND:LTUS:476:STDZCYCLENUM") { field(DESC, "No. Standardize Cycles") field(VAL, "3") field(HOPR, "10") field(LOPR, "0") field(DRVH, "10") field(DRVL, "0") field(PINI, "YES") field(FLNK, "BEND:LTUS:476:STDZDIRECT") } # The default standardize direction is "UP" for # all LCLS Magnets.. record(bo, "BEND:LTUS:476:STDZDIRECT") { field(DESC, "Standardize Direction ") field(ZNAM, "UP") field(ONAM, "DOWN") field(VAL, "0") field(FLNK, "BEND:LTUS:476:STDZIMIN") } record(ao, "BEND:LTUS:476:STDZIMIN") { field(DESC, "Min-STDZ Current") field(PREC, "1") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(VAL, "0.0") field(FLNK, "BEND:LTUS:476:STDZIMAX") } record(ao, "BEND:LTUS:476:STDZIMAX") { field(DESC, "Max. Standarize Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(VAL, "250.0") field(FLNK, "BEND:LTUS:476:STDZIFINAL") } record(ao, "BEND:LTUS:476:STDZIFINAL") { field(DESC, "Final SDTZ Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(VAL, "0.0") field(FLNK, "BEND:LTUS:476: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, "BEND:LTUS:476: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, "BEND:LTUS:476:STDZITOL") { field(DESC, "Stdz min tolerance") field(PREC, "5") field(CALC, "MAX(ABS(A),ABS(B))*C") field(INPA, "BEND:LTUS:476:STDZIMIN CP NMS") field(INPB, "BEND:LTUS:476:STDZIMAX CP MMS") field(INPC, "0.05") field(INPD, "BEND:LTUS:476:STDZITOLR CP MMS") field(EGU, "A") field(FLNK, "BEND:LTUS:476:IDELTAS") field(PINI, "YES") } # D - factor (3.154/2 = 1.577) for EPSC, otherwise, set to 1.0 record(calc, "BEND:LTUS:476:STDZDLY") { field(DESC, "Ramp time for stdz cycle") field(CALC, "C>0?MAX(1,ABS((A-B)/C)*D):0") field(INPA, "BEND:LTUS:476:STDZIMIN CP NMS") field(INPB, "BEND:LTUS:476:STDZIMAX CP NMS") field(INPC, "BEND:LTUS:476:TRIMRAMPRATE CP NMS") field(INPD, "1.577") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") } record(calc, "BEND:LTUS:476:STDZRAMPDLY") { field(DESC, "Ramp delay total") field(CALC, "MAX(1,((A/100)*B+B))") field(PREC, "5") field(INPA, "BEND:LTUS:476:TRIMDLYPCT CP MS") field(INPB, "BEND:LTUS:476: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, "BEND:LTUS:476:STDZMINIDLY") { field(DESC, "Mini-stdz delay") field(CALC, "A") field(PREC, "5") field(A, "1.0") field(EGU, "sec") field(PINI, "YES") } record(ao, "BEND:LTUS:476: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, "BEND:LTUS:476:STDZMINIDELTA") { field(DESC, "Stdz mini % of IMAX") field(CALC, "(B/100)*(A-C)") field(INPA, "BEND:LTUS:476:IDES.HOPR") field(INPB, "BEND:LTUS:476:STDZMINIPCT CPP NMS") field(INPC, "BEND:LTUS:476:IDES.LOPR") field(PREC, "5") } record(calc, "BEND:LTUS:476:STDZMINISETPT") { field(DESC, "Mini Stdz delta") field(CALC, "C==0?MAX(E-D,B):MIN(E+D,A)") field(INPA, "BEND:LTUS:476:IDES.HOPR") field(INPB, "BEND:LTUS:476:IDES.LOPR") field(INPC, "BEND:LTUS:476:STDZDIRECT.RVAL") field(INPD, "BEND:LTUS:476:STDZMINIDELTA") field(INPE, "BEND:LTUS:476:IDES") field(PREC, "5") field(FLNK, "BEND:LTUS:476: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, "BEND:LTUS:476:STDZMINISETPTOOR") { field(DESC, "Mini Stdz setpoint out of range") field(CALC, "C==0?(E-DA)") field(INPA, "BEND:LTUS:476:IDES.HOPR") field(INPB, "BEND:LTUS:476:IDES.LOPR") field(INPC, "BEND:LTUS:476:STDZDIRECT.RVAL") field(INPD, "BEND:LTUS:476:STDZMINIDELTA") field(INPE, "BEND:LTUS:476: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, "BEND:LTUS:476: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, "BEND:LTUS:476:IADJUST.RVAL") field(INPB, "BEND:LTUS:476:STDZDIRECT.RVAL") field(INPC, "BEND:LTUS:476:STDZOK.RVAL") field(INPD, "BEND:LTUS:476:STDZDISABLE.RVAL") field(INPE, "BEND:LTUS:476:STATE.RVAL CPP NMS") field(INPF, "BEND:LTUS:476:ICTRL.RVAL") field(INPG, "BEND:LTUS:476:STATE.SEVR") field(INPH, "BEND:LTUS:476:BDELTAS.M") field(INPI, "BEND:LTUS:476:IACT.SEVR") field(OUT, "BEND:LTUS:476:STDZLOSTGO.SELN PP NMS") field(OOPT, "Transition To Non-zero") } record(seq, "BEND:LTUS:476:STDZLOSTGO") { field(DESC, "Process lost stdz") field(SELM, "Mask") field(DOL1, "1") field(DOL2, "0") field(LNK1, "BEND:LTUS:476:STDZLOSTTOD.PROC") field(LNK2, "BEND:LTUS:476:STDZOK PP") } # Record maximum current after standardize # Reset to IACT from sequence after trim # Disable processing during (mini-)standardize or trim record(calc, "BEND:LTUS:476:STDZIACTMAX") { field(DESC, "Max act current after stdz") field(CALC, "MAX(A, B)") field(DISV, "0") field(SDIS, "BEND:LTUS:476:CHECKPWRDIP_ENABLE") field(INPA, "BEND:LTUS:476:IACT CP") field(INPB, "BEND:LTUS:476:STDZIACTMAX") field(EGU, "A") field(FLNK, "BEND:LTUS:476:CHECKPWRDIP") } # Detect power dip if STDZOK is YES, STDZ is enabled, and IACT is valid # If IACT drops below STDZIACTMAX by more than the trim tolerance, clear STDZOK # Warning: Take the absolute value of the trim tolerance, or else quads of # negative polarity will always lose STDZ since their IDELTAS.I are negative. # Note: Large quads and bends are prone to losing STDZ even if they are # perturbed toward higher current since their current tends to overshoot # by greater than the trim tolerance before settling down. record(calcout, "BEND:LTUS:476:CHECKPWRDIP") { field(DESC, "Detect power dip") field(CALC, "(A-B>ABS(C))?3:0") field(DISV, "0") field(SDIS, "BEND:LTUS:476:CHECKPWRDIP_ENABLE") field(INPA, "BEND:LTUS:476:STDZIACTMAX") field(INPB, "BEND:LTUS:476:IACT") field(INPC, "BEND:LTUS:476:IDELTAS.I") field(OUT, "BEND:LTUS:476:STDZLOSTGO.SELN PP NMS") field(OOPT, "When Non-zero") } # Enable processing of STDZIACTMAX and CHECKPWRDIP only if # STDZOK = YES, STDZDISABLE = NO, CTRL != Trim (2), and # CTRL != Stdz (4) record(calc, "BEND:LTUS:476:CHECKPWRDIP_ENABLE") { field(CALC, "A&&!B&&(C#2)&&(C#4)") field(INPA, "BEND:LTUS:476:STDZOK.RVAL CP") field(INPB, "BEND:LTUS:476:STDZDISABLE.RVAL CP") field(INPC, "BEND:LTUS:476:CTRL.RVAL CP") } #! 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, "BEND:LTUS:476: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, "BEND:LTUS:476:CALBOK") { field(DESC, "Successful Calibration") field(DTYP, "Raw Soft Channel") field(ZNAM, "NO") field(ONAM, "YES") field(DOL, "PSC:LTUS:MG26:CALBOK.RVAL") field(OMSL, "closed_loop") 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, "BEND:LTUS:476:CALBSET") { field(DESC, "Use DAC Calbration") field(SCAN, "10 second") field(CALC, "A&&(B==0)&&C?31:960") field(INPA, "BEND:LTUS:476:CALBOK") field(INPB, "BEND:LTUS:476:CALBDISABLE") field(INPC, "BEND:LTUS:476:CALBSLOPE") field(OOPT, "On Change") field(OUT, "BEND:LTUS:476: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, "BEND:LTUS:476:CALB_SEQ") { field(DESC, "Output Calib Values") field(SELM, "Mask") field(SELL, "BEND:LTUS:476: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, "BEND:LTUS:476:CALBSLOPE") field(DOL3, "BEND:LTUS:476: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, "BEND:LTUS:476:CALBTOD") { field(DESC, "Calibration Success Time") field(PINI, "YES") field(DOL, "PSC:LTUS:MG26:CALBTOD") field(OMSL, "closed_loop") field(DTYP, "Soft Channel") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:476: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, "BEND:LTUS:476: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, "BEND:LTUS:476: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, "BEND:LTUS:476:CALBOFFSET") { field(DESC, "Calc DAC Offset") field(PREC, "6") field(EGU, "Counts") field(PINI, "YES") } record(bo, "BEND:LTUS:476: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, "BEND:LTUS:476:DACSLOPE") { field(DESC, "V to DAC slope") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "closed_loop") field(PINI, "YES") field(FLNK, "BEND:LTUS:476:DACOFFSET") } # Default Offset used in conversion from Volts to DAC Counts record(ao, "BEND:LTUS:476:DACOFFSET") { field(DESC, "V to DAC offset") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "closed_loop") field(PINI, "YES") field(FLNK, "BEND:LTUS:476: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, "BEND:LTUS:476: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, "BEND:LTUS:476:IACT") field(INPD, "BEND:LTUS:476:DACSLOPE") field(INPE, "BEND:LTUS:476:DACOFFSET") field(EGU, "Counts") field(PREC, "6") } record(ao, "BEND:LTUS:476:DAC") { field(DESC, "DAC Set point") field(EGU, "Counts") field(DOL, "") field(OMSL, "closed_loop") field(PREC, "6") field(PINI, "YES") } record(ao, "BEND:LTUS:476:CALBIMIN") { field(DESC, "Calibration Min Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(DRVH, "250.0") field(HOPR, "250.0") field(DRVL, "0.0") field(LOPR, "0.0") field(PREC, "3") field(EGU, "A") field(VAL, "0.0") field(FLNK, "BEND:LTUS:476:CALBIMAX") } record(ao, "BEND:LTUS:476:CALBIMAX") { field(DESC, "Calibration Max Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(DRVH, "250.0") field(HOPR, "250.0") field(LOPR, "0.0") field(DRVL, "0.0") field(EGU, "A") field(VAL, "250.0") field(FLNK, "BEND:LTUS:476:CALBSTEPNUM") } record(ao, "BEND:LTUS:476:CALBIFINAL") { field(DESC, "Calibration Last Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(PREC, "3") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(VAL, "0") } record(longout, "BEND:LTUS:476: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, "BEND:LTUS:476:CALBIDELTA") } record(calc, "BEND:LTUS:476:CALBIDELTA") { field(DESC, "Step size for CALB") field(CALC, "C=0?0:ABS((A-B)/C)") field(INPA, "BEND:LTUS:476:CALBIMAX") field(INPB, "BEND:LTUS:476:CALBIMIN") field(INPC, "BEND:LTUS:476: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, "BEND:LTUS:476:CALBIMULT") { field(DESC, "IACT vs ISETPT mult") field(CALC, "C#0||A=0?1:ABS(B/A)") field(INPA, "PSC:LTUS:MG26:ISETPT.DRVH") field(INPB, "PSC:LTUS:MG26:IACT.HOPR") field(INPC, "BEND:LTUS:476:PSCONTROLLER.RVAL CPP") field(EGU, "A") field(PINI, "YES") } # SNL dbputs DAC values here. 6-10 steps are possible. record(waveform, "BEND:LTUS:476:CALBICTRLWF") { field(DESC, "ICTRL setpoint array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") } record(waveform, "BEND:LTUS:476:DACWF") { field(DESC, "DAC count array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "BEND:LTUS:476:DACSA") } # Used only for xygraph edm plot record(subArray, "BEND:LTUS:476:DACSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "BEND:LTUS:476: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, "BEND:LTUS:476:CALCDACWF") { field(DESC, "Calc DAC counts array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "BEND:LTUS:476:CALCDACSA") } # Used only for xygraph edm plot record(subArray, "BEND:LTUS:476:CALCDACSA") { field(DESC, "Calc DAC counts") field(DTYP, "Soft Channel") field(INP, "BEND:LTUS:476: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, "BEND:LTUS:476:CALBYWF") { field(DESC, "mx + b") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "BEND:LTUS:476:CALBYSA") } # Used only for xygraph edm plot record(subArray, "BEND:LTUS:476:CALBYSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "BEND:LTUS:476:CALBYWF") field(MALM, "10") field(NELM, "6") field(INDX, "0") field(FTVL, "DOUBLE") } record(waveform, "BEND:LTUS:476:CALBIACTWF") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "BEND:LTUS:476:CALBIACTSA") } # Used only for xygraph edm plot record(subArray, "BEND:LTUS:476:CALBIACTSA") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(MALM, "10") field(NELM, "6") field(INP, "BEND:LTUS:476:CALBIACTWF") field(INDX, "0") field(FTVL, "DOUBLE") field(FLNK, "BEND:LTUS:476:CALBLIMITS") } # Check that measured current during calibration is within # tolerance. record(aSub, "BEND:LTUS:476: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, "BEND:LTUS:476:CALBSTEPNUM") field(INPB, "BEND:LTUS:476:CALBIACTWF") field(INPC, "BEND:LTUS:476: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, "BEND:LTUS:476: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, "BEND:LTUS:476:STDZITOL") field(INPH, "BEND:LTUS:476:DACSLOPE") field(INPI, "BEND:LTUS:476: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, "BEND:LTUS:476: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, "BEND:LTUS:476:CALBSTEPNUM") field(INPB, "BEND:LTUS:476:CALBIACTWF") field(INPC, "BEND:LTUS:476:DACWF") field(INPF, "BEND:LTUS:476: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 BEND:LTUS:476CALBOK 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, "BEND:LTUS:476:DEGAUSINIT") { field(DESC, "Proc. Degauss PVs on boot") field(PINI, "YES") field(DOL, "1") field(OUTA, "BEND:LTUS:476:DEGAUSIMIN.PROC PP") field(OUTB, "BEND:LTUS:476:DEGAUSIMAX.PROC PP") field(OUTC, "BEND:LTUS:476:DEGAUSTYPE.PROC PP") field(OUTD, "BEND:LTUS:476:DEGAUSSTEP.PROC PP") field(OUTE, "BEND:LTUS:476:MADNAME.PROC PP") field(OUTF, "BEND:LTUS:476:PSTYPE.PROC PP") field(OUTG, "BEND:LTUS:476: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, "BEND:LTUS:476:DEGAUSSUB") { field(DESC, "Degauss subroutine") field(INAM, "mgntDegaussInit") field(SNAM, "mgntDegauss") field(BRSV, "INVALID") field(INPA, "BEND:LTUS:476:DEGAUSIMIN NPP NMS") field(INPB, "BEND:LTUS:476:DEGAUSIMAX NPP NMS") field(INPC, "BEND:LTUS:476:DEGAUSTYPE.RVAL NPP NMS") field(INPE, "BEND:LTUS:476:DEGAUSMETHOD.RVAL NPP NMS") field(INPF, "BEND:LTUS:476:PSTYPE NPP NMS") field(INPG, "BEND:LTUS:476:DEBUG.RVAL NPP NMS") field(INPH, "BEND:LTUS:476: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, "BEND:LTUS:476:DEGAUSWF PP") field(OUTB, "BEND:LTUS:476:DEGAUSMSG PP") field(OUTC, "BEND:LTUS:476: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, "BEND:LTUS:476:DEGAUSWF") { field(DESC, "Degauss Setpts") field(NELM, "60") field(FTVL, "DOUBLE") } record(mbbo,"BEND:LTUS:476: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, "BEND:LTUS:476: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, "BEND:LTUS:476: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, "BEND:LTUS:476: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, "BEND:LTUS:476: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, "BEND:LTUS:476:DEGAUSIMIN") { field(DESC, "Min. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "250.0") field(LOPR, "-250.0") field(DRVH, "250.0") field(DRVL, "-250.0") field(VAL, "-250.0") } record(ao, "BEND:LTUS:476:DEGAUSIMAX") { field(DESC, "Max. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "250.0") field(LOPR, "-250.0") field(DRVH, "250.0") field(DRVL, "-250.0") field(VAL, "250.0") } # 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,"BEND:LTUS:476: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, "BEND:LTUS:476: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,"BEND:LTUS:476: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, "BEND:LTUS:476: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, "BEND:LTUS:476: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, "BEND:LTUS:476: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, "BEND:LTUS:476:DEGAUSTOD") { field(DESC, "Successful Degauss Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "BEND:LTUS:476:DEGAUSLOSTTOD") { field(DESC, "Degauss Lost Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:476:DEGAUSTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "BEND:LTUS:476:DEGAUSTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "BEND:LTUS:476: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, "BEND:LTUS:476:DEGAUSGO") { field(DESC, "Set bdes of btrms to zero") field(ASG, "Internal") field(OUTA, "") field(OUTB, "") field(OUTC, "") field(OUTD, "") } # =========== CRYO ONLY =========== record(bo, "BEND:LTUS:476: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, "BEND:LTUS:476:DEGAUS_IMAX_CHECK") { field(DESC, "Check if imax shoud chg") field(CALC, "(C==4)&&(ABS(B)>ABS(A))?1:0") field(INPA, "BEND:LTUS:476:DEGAUS_IMAX") field(INPB, "BEND:LTUS:476:ISETPT") field(INPC, "BEND:LTUS:476:DEGAUSTYPE.RVAL") field(OUT, "BEND:LTUS:476:DEGAUS_IMAX_UPDATE.SELN") field(FLNK, "BEND:LTUS:476:DEGAUS_IMAX_UPDATE") } record(seq, "BEND:LTUS:476:DEGAUS_IMAX_UPDATE") { field(DESC, "Degauss IMAX Update") field(SELM, "Specified") field(DOL1, "BEND:LTUS:476:ISETPT") field(LNK1, "BEND:LTUS:476:DEGAUS_IMAX PP") } # Set the maximum current after a successful # degauss. This pv is updated by the # sequence. record(ao, "BEND:LTUS:476:DEGAUS_IMAX") { field(DESC, "Max I set afer a degauss") field(EGU, "Amps") field(PINI, "YES") field(PREC, "6") field(HOPR, "250.0") field(LOPR, "-250.0") field(DRVH, "250.0") field(DRVL, "-250.0") field(VAL, "250.0") field(FLNK, "BEND:LTUS:476:DEGAUS_IMAXPOL_CHECK") info(autosaveFields,"VAL,RVAL") } # Set the polarity if degauss_imax record(calcout, "BEND:LTUS:476:DEGAUS_IMAXPOL_CHECK") { field(DESC, "Determine polarity of imax") field(CALC, "A>=0?0:1") field(INPA, "BEND:LTUS:476:DEGAUS_IMAX") field(FLNK, "BEND:LTUS:476:DEGAUS_IMAXPOL") } record(bo, "BEND:LTUS:476:DEGAUS_IMAXPOL") { field(DESC, "Polarity of imax I") field(DTYP, "Raw Soft Channel") field(DOL, "BEND:LTUS:476:DEGAUS_IMAXPOL_CHECK") field(OMSL, "closed_loop") field(ZNAM, "Positive") field(ONAM, "Negative") field(FLNK, "BEND:LTUS:476: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, "BEND:LTUS:476:DEGAUS_ABSIMAX") { field(DESC, "Absolute Max. Degauss I") field(CALC, "ABS(A)") field(INPA, "BEND:LTUS:476:DEGAUS_IMAX") field(PREC, "6") field(EGU, "Amps") field(HOPR, "250.0") field(LOPR, "-250.0") info(autosaveFields,"VAL RVAL") } # IACT Polarity record(calcout, "BEND:LTUS:476:IACTPOL_CHECK") { field(DESC, "Determine IACT polarity") field(SCAN, "5 second") field(CALC, "ABS(A-B)>C?(A>=0?0:1):D") field(INPA, "BEND:LTUS:476:IACT") field(INPB, "BEND:LTUS:476:IACTPOL_CHECK.LA") field(INPC, "0.0001") field(INPD, "BEND:LTUS:476:IACTPOL_CHECK.PVAL") field(OOPT, "On Change") field(FLNK, "BEND:LTUS:476:IACTPOL") } record(bo, "BEND:LTUS:476: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,"BEND:LTUS:476: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, "BEND:LTUS:476:DEGAUSENABLE CP") field(INPB, "BEND:LTUS:476:DEGAUSOK") field(INPC, "BEND:LTUS:476:STATE CP") field(INPD, "BEND:LTUS:476:STATE.SEVR") field(OUT, "BEND:LTUS:476:DEGAUS_STATE_SEQ.SELN PP") field(ASG, "Internal") } record(seq, "BEND:LTUS:476:DEGAUS_STATE_SEQ") { field(DESC, "Degauss State Sequence") field(SELM, "Specified") field(SELL, "BEND:LTUS:476:DEGAUS_STATE_CHECK") field(LNK1, "BEND:LTUS:476:DEGAUS_STATE_DISABLE.PROC PP") field(LNK2, "BEND:LTUS:476:DEGAUS_STATE_LOST.PROC PP") field(LNK3, "BEND:LTUS:476:DEGAUS_STATE_GOOD.PROC PP") field(LNK4, "BEND:LTUS:476: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, "BEND:LTUS:476:DEGAUS_STATE_DISABLE") { field(DESC, "Degauss not used") field(LNK1, "BEND:LTUS:476:DEGAUSOK.ZSV") field(LNK2, "BEND:LTUS:476: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, "BEND:LTUS:476:STATMSG.FRSV") field(LNK4, "BEND:LTUS:476: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, "BEND:LTUS:476:DEGAUS_STATE_LOST") { field(DESC, "Degauss lost and ps On") field(DOL1, "1") field(LNK1, "BEND:LTUS:476:DEGAUSOK.ZSV") field(LNK2, "BEND:LTUS:476: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, "BEND:LTUS:476:STATMSG.FRSV") field(LNK4, "BEND:LTUS:476: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, "BEND:LTUS:476:DEGAUS_STATE_OFF") { field(DESC, "Degaused lost and ps Off") field(DOL1, "2") field(LNK1, "BEND:LTUS:476: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, "BEND:LTUS:476:STATMSG.FRSV") field(LNK3, "BEND:LTUS:476: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, "BEND:LTUS:476:DEGAUS_STATE_GOOD") { field(DESC, "Degauss good") field(DOL1, "1") field(LNK1, "BEND:LTUS:476: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, "BEND:LTUS:476:STATMSG.FRSV PP") field(LNK3, "BEND:LTUS:476:STATMSG.FVSV PP") field(LNK4, "") field(ASG, "Internal") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(mbbo, "BEND:LTUS:476:FUNC") { field(DESC, "BEND:LTUS:476 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, "1") field(THVL, "9") field(FRVL, "10") field(FVVL, "0") field(SXVL, "2") field(SVVL, "8") field(EIVL, "11") field(NIVL, "12") field(TEVL, "13") field(ELVL, "5") field(TVVL, "6") field(TTVL, "7") field(FTVL, "4") field(FFVL, "3") field(OUT, "BEND:LTUS:476:CTRL CA") } # :CTRL pv is processed at boot in the # sequence mgntCtrl.st Processed in sequence # record(mbbo, "BEND:LTUS:476:CTRL") { field(DESC, "BEND:LTUS:476 Control") field(PINI, "NO") field(ZRST, "Ready") field(ONST, "TRIM") field(TWST, "PERTURB") field(THST, "BCON_TO_BDES") field(FRST, "BACT_TO_BDES") field(FVST, "SAVE_BDES") field(SXST, "LOAD_BDES") field(SVST, "UNDO_BDES") field(EIST, "DAC_ZERO") field(NIST, "CALB") field(TEST, "STDZ") field(ELST, "RESET") field(TVST, "TURN_ON") field(TTST, "TURN_OFF") field(FTST, "") field(FFST, "") field(ZRVL, "0") field(ONVL, "2") field(TWVL, "6") field(THVL, "15") field(FRVL, "14") field(FVVL, "11") field(SXVL, "12") field(SVVL, "13") field(EIVL, "7") field(NIVL, "3") field(TEVL, "4") field(ELVL, "8") field(TVVL, "9") field(TTVL, "10") field(FTVL, "0") field(FFVL, "0") field(OUT, "BEND:LTUS:476:SELECTEN.A PP") field(SDIS, "0") } # If a function has been selected set this unit to busy record(calcout, "BEND:LTUS:476:SELECTEN") { field(DESC, "Control Select Enable") field(CALC, "A>0?1:A") field(FLNK, "BEND:LTUS:476:BUSY") } # Set to FREE on IOC reboot record(bo, "BEND:LTUS:476:BUSY") { field(DESC, "BEND:LTUS:476 Ctrl Done") field(DOL, "BEND:LTUS:476:SELECTEN") field(ZNAM, "FREE") field(ONAM, "BUSY") field(PINI, "YES") field(FLNK, "BEND:LTUS:476:SELECT") } record(bo, "BEND:LTUS:476:SELECT") { field(ZNAM, "NO") field(ONAM, "YES") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") } record(bo, "BEND:LTUS:476: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, "BEND:LTUS:476:CTRLSTATE") { field(DESC, "BEND:LTUS:476 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("BEND:LTUS:476:CTRL",20,20,0,0,"BEND:LTUS:476:CTRL") #! Field("BEND:LTUS:476:CTRL.OUT",16777215,1,"BEND:LTUS:476:CTRL.OUT") #! Link("BEND:LTUS:476:CTRL.OUT","BEND:LTUS:476:SELECTEN.A") #! Field("BEND:LTUS:476:CTRL.VAL",16777215,1,"BEND:LTUS:476:CTRL.VAL") #! Record("BEND:LTUS:476:SELECTEN",321,381,0,0,"BEND:LTUS:476:SELECTEN") #! Field("BEND:LTUS:476:SELECTEN.A",16777215,0,"BEND:LTUS:476:SELECTEN.A") #! Field("BEND:LTUS:476:SELECTEN.FLNK",16777215,1,"BEND:LTUS:476:SELECTEN.FLNK") #! Link("BEND:LTUS:476:SELECTEN.FLNK","BEND:LTUS:476:BUSY") #! Field("BEND:LTUS:476:SELECTEN.VAL",16777215,1,"BEND:LTUS:476:SELECTEN.VAL") #! Record("BEND:LTUS:476:BUSY",623,274,0,0,"BEND:LTUS:476:BUSY") #! Field("BEND:LTUS:476:BUSY.DOL",16777215,0,"BEND:LTUS:476:BUSY.DOL") #! Link("BEND:LTUS:476:BUSY.DOL","BEND:LTUS:476:SELECTEN.VAL") #! Field("BEND:LTUS:476:BUSY.FLNK",16777215,1,"BEND:LTUS:476:BUSY.FLNK") #! Link("BEND:LTUS:476:BUSY.FLNK","BEND:LTUS:476:SELECT") #! Record("BEND:LTUS:476:SELECT",669,508,0,1,"BEND:LTUS:476:SELECT") #! Record("BEND:LTUS:476:FUNC",940,120,0,0,"BEND:LTUS:476:FUNC") #! Field("BEND:LTUS:476:FUNC.OUT",16777215,0,"BEND:LTUS:476:FUNC.OUT") #! Link("BEND:LTUS:476:FUNC.OUT","BEND:LTUS:476:CTRL.VAL") #! Record("BEND:LTUS:476:ABORT",193,41,0,0,"BEND:LTUS:476:ABORT") #! Record("BEND:LTUS:476:CTRLSTATE",369,34,0,0,"BEND:LTUS:476: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,"BEND:LTUS:476:SELECT is used for Multi-device selection.\nIt is enabled when associated BEND:LTUS:476:CTRL is \"0\" (DONE).\nIt is disabled when associated BEND:LTUS:476: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,"BEND:LTUS:476: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, "BEND:LTUS:476:BCTRL_INIT") { field(DESC, "Process BCTRL on boot") field(PINI, "YES") field(CALC, "A=3?1:0") field(INPA, "BEND:LTUS:476:BCTRL.SEVR") field(OUT, "BEND:LTUS:476: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, "BEND:LTUS:476:BACT") { field(DESC, "Actual B") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "BEND:LTUS:476:BACT") field(INPB, "BEND:LTUS:476:POLYCOEF") field(INPC, "BEND:LTUS:476:POLYCOEF.A") field(INPD, "BEND:LTUS:476:POLYCOEF.B") field(INPE, "BEND:LTUS:476:IACT MS") field(INPF, "BEND:LTUS:476:BDELTAS PP") field(INPG, "100") field(EGU, "kG-m") field(HOPR, "4.5427") field(LOPR, "0.0141") field(HIHI, "4.5427") field(LOLO, "0.0141") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "4.5427") field(LOW, "0.0141") field(FLNK, "BEND:LTUS:476: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, "BEND:LTUS:476:BDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntPhyDeltas") field(EGU, "kG-m") field(HOPR, "1") field(PREC, "7") field(BRSV, "INVALID") field(INPA, "BEND:LTUS:476:BDES") field(INPB, "BEND:LTUS:476:TRIMBTOL") field(INPC, "BEND:LTUS:476:TRIMBTOLR") field(INPD, "BEND:LTUS:476:CHCKBTOL") field(INPE, "BEND:LTUS:476:CHCKBTOLR") field(F, "2.0") field(INPG, "30") field(INPH, "BEND:LTUS:476:BACT.VAL") # # MPS absolute and relative tolerances field(INPP, "BEND:LTUS:476:MPSBTOL") field(INPQ, "BEND:LTUS:476:MPSBTOLR") field(FLNK, "BEND:LTUS:476:BCONLIMITS") info(autosaveFields,"F") } # This record is processed by BDELTAS record(aSub, "BEND:LTUS:476:BCONLIMITS") { field(DESC, "Config B-field Limits") field(INAM, "mgntInit") field(SNAM, "mgntBCONLimits") field(INPA, "BEND:LTUS:476:BDES") field(INPB, "BEND:LTUS:476:BDELTAS.I") field(INPG, "BEND:LTUS:476:DEBUG.RVAL") field(FTA, "DOUBLE") field(FTB, "DOUBLE") field(FTG, "ULONG") field(OUTA, "BEND:LTUS:476:BCON.HIGH") field(OUTB, "BEND:LTUS:476:BCON.LOW") field(OUTC, "BEND:LTUS:476:BCON.HIHI") field(OUTD, "BEND:LTUS:476:BCON.LOLO PP") field(FTVA, "DOUBLE") field(FTVB, "DOUBLE") field(FTVC, "DOUBLE") field(FTVD, "DOUBLE") field(BRSV, "INVALID") field(FLNK, "BEND:LTUS:476:IDELTAS") } # The following PV is processed by :BACT # which is processed by :BACT # record(fanout, "BEND:LTUS:476:BACTFO") { field(DESC, "BACT processing") field(SELM, "All") field(LNK1, "BEND:LTUS:476:BDIFF") field(LNK2, "BEND:LTUS:476:BADIFF") field(LNK3, "BEND:LTUS:476:BRATIO") field(LNK4, "BEND:LTUS:476:MPSLIMITS") field(LNK5, "BEND:LTUS:476:I2BSTATUS") field(LNK6, "BEND:LTUS:476:IACTFO.PROC") } record(calc, "BEND:LTUS:476:BDIFF") { field(DESC, "BDES-BACT") field(CALC, "A-B") field(INPA, "BEND:LTUS:476:BDES") field(INPB, "BEND:LTUS:476:BACT") field(EGU, "kG-m") field(PREC, "7") } record(calc, "BEND:LTUS:476:BADIFF") { field(DESC, "Absolute BDES-BACT") field(INPA, "BEND:LTUS:476:BDIFF") field(EGU, "kG-m") field(PREC, "7") field(CALC, "A<0?ABS(A):A") } record(calc, "BEND:LTUS:476:BRATIO") { field(DESC, "BACT Error") field(CALC, "B?A/B:0") field(INPA, "BEND:LTUS:476:BDIFF") field(INPB, "BEND:LTUS:476:BDES.HOPR") field(EGU, "kG-m") field(PREC, "7") } record(mbbi, "BEND:LTUS:476: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, "BEND:LTUS:476:BACT.J") } # Note: for a string slave set the MONFL # macro to the following: # MONFL=:IMONCALC MS record(sub, "BEND:LTUS:476:BMON") { field(DESC, "Second Transductor") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "BEND:LTUS:476:BMON") field(INPB, "BEND:LTUS:476:POLYCOEF") field(INPC, "BEND:LTUS:476:POLYCOEF.A") field(INPD, "BEND:LTUS:476:POLYCOEF.B") field(INPE, "BEND:LTUS:476:IMON MS") field(INPF, "BEND:LTUS:476:BDELTAS.VAL") field(INPG, "100") field(EGU, "kG-m") field(HOPR, "4.5427") field(LOPR, "0.0141") field(HIHI, "4.5427") field(LOLO, "0.0141") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "4.5427") field(LOW, "0.0141") } # 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=PSC:LTUS:MG26:BDES CP record(ao, "BEND:LTUS:476:BDES") { field(DESC, "Desired B-Field") field(PINI, "YES") field(DRVH, "4.5427") field(DRVL, "0.0141") field(HOPR, "4.5427") field(LOPR, "0.0141") field(PREC, "7") field(EGU, "kG-m") field(MDEL, "-1") field(OMSL, "supervisory") # field(DOL, "") field(OUT, "BEND:LTUS:476:B2IDES PP") info(autosaveFields,"VAL") } record(sub, "BEND:LTUS:476:B2IDES") { field(DESC, "Convert Desired B-Field to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "BEND:LTUS:476:POLYCOEF") field(INPC, "BEND:LTUS:476:POLYCOEF.A") field(INPD, "BEND:LTUS:476:POLYCOEF.B") field(PREC, "7") field(EGU, "kG-m") field(HOPR, "4.5427") field(LOPR, "0.0141") field(MDEL, "-1") field(INPE, "BEND:LTUS:476:BDES.DRVH") field(INPF, "BEND:LTUS:476:BDES.DRVL") field(BRSV, "INVALID") field(FLNK, "BEND:LTUS:476:IDES") } record(sub, "BEND:LTUS:476:BNOM") { field(DESC, "Nominal Field") field(PINI, "YES") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "BEND:LTUS:476:POLYCOEF") field(INPC, "BEND:LTUS:476:POLYCOEF.A") field(INPD, "BEND:LTUS:476:POLYCOEF.B") field(INPE, "BEND:LTUS:476:BDES.DRVH") field(INPF, "BEND:LTUS:476:BDES.DRVL") field(EGU, "kG-m") field(HOPR, "4.5427") field(LOPR, "0.0141") field(PREC, "7") field(VAL, "0.0") field(FLNK, "BEND:LTUS:476:INOM") } record(sub, "BEND:LTUS:476:BACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "BEND:LTUS:476:BDES.VAL") field(INPB, "BEND:LTUS:476:BDES.DRVH") field(INPC, "BEND:LTUS:476:BDES.DRVL") field(INPD, "BEND:LTUS:476:BDELTAS.I") field(INPE, "BEND:LTUS:476:BDELTAS.J") field(INPG, "BEND:LTUS:476:STATE") field(INPH, "BEND:LTUS:476:HSTA") field(EGU, "kG-m") field(HOPR, "4.5427") field(LOPR, "0.0141") field(PREC, "7") field(BRSV, "INVALID") } record(sub, "BEND:LTUS:476:BMONLIMITS") { field(DESC, "MON Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "BEND:LTUS:476:BDES.VAL") field(INPB, "BEND:LTUS:476:BDES.DRVH") field(INPC, "BEND:LTUS:476:BDES.DRVL") field(INPD, "BEND:LTUS:476:BDELTAS.K") field(INPE, "BEND:LTUS:476:BDELTAS.L") field(INPG, "BEND:LTUS:476:STATE") field(INPH, "BEND:LTUS:476:HSTA") field(EGU, "kG-m") field(HOPR, "4.5427") field(LOPR, "0.0141") field(PREC, "7") field(BRSV, "INVALID") } record(seq, "BEND:LTUS:476:BLIMITS") { field(DESC, "ACT Limits") field(PREC, "7") field(DOL1, "BEND:LTUS:476:BLIMITS") field(LNK1, "BEND:LTUS:476:BACTLIMITS.F PP") field(DOL2, "BEND:LTUS:476:BACTLIMITS.I") field(LNK2, "BEND:LTUS:476:BACT.HIGH") field(DOL3, "BEND:LTUS:476:BACTLIMITS.J") field(LNK3, "BEND:LTUS:476:BACT.LOW") field(DOL4, "BEND:LTUS:476:BACTLIMITS.K") field(LNK4, "BEND:LTUS:476:BACT.HIHI") field(DOL5, "BEND:LTUS:476:BACTLIMITS.L") field(LNK5, "BEND:LTUS:476:BACT.LOLO") field(DOL6, "BEND:LTUS:476:BLIMITS") field(LNK6, "BEND:LTUS:476:BMONLIMITS.F PP") field(DOL7, "BEND:LTUS:476:BMONLIMITS.I") field(LNK7, "BEND:LTUS:476:BMON.HIGH") field(DOL8, "BEND:LTUS:476:BMONLIMITS.J") field(LNK8, "BEND:LTUS:476:BMON.LOW") field(DOL9, "BEND:LTUS:476:BMONLIMITS.K") field(LNK9, "BEND:LTUS:476:BMON.HIHI") field(DOLA, "BEND:LTUS:476:BMONLIMITS.L") field(LNKA, "BEND:LTUS:476:BMON.LOLO") field(FLNK, "BEND:LTUS:476:ILIMITS") field(SCAN, "5 second") } record(ao, "BEND:LTUS:476:BCTRL") { field(DESC, "B-Perturb") field(PREC, "7") field(EGU, "kG-m") field(DRVH, "4.5427") field(DRVL, "0.0141") field(HOPR, "4.5427") field(LOPR, "0.0141") # 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, "BEND:LTUS:476: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, "BEND:LTUS:476:BCTRLGO") { field(DESC, "Update DES and perturb") field(PREC, "7") # Disable BACT limits field(DOL1, "1") field(LNK1, "BEND:LTUS:476:BLIMITS.VAL") # Update BDES with the BCTRL (slider) value field(DOL2, "BEND:LTUS:476:BCTRL.VAL") field(LNK2, "BEND:LTUS:476:BDES PP") field(DOL3, "1") field(LNK3, "BEND:LTUS:476:IDIRECT.PROC PP") field(DOL4, "1") field(LNK4, "BEND:LTUS:476:CHECKSTDZLOST.PROC PP") field(DOL5, "BEND:LTUS:476:BCTRL.VAL") field(LNK5, "BEND:LTUS:476:BCTRLSUB PP") # Re-enable BACT limits field(DOL6, "0") field(LNK6, "BEND:LTUS:476:BLIMITS.VAL") } # Convert B-field to Current and output to ISETPT record(sub, "BEND:LTUS:476:BCTRLSUB") { field(DESC, "Feedback") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "BEND:LTUS:476:POLYCOEF") field(INPC, "BEND:LTUS:476:POLYCOEF.A") field(INPD, "BEND:LTUS:476:POLYCOEF.B") field(INPE, "BEND:LTUS:476:BDES.DRVH") field(INPF, "BEND:LTUS:476:BDES.DRVL") field(PREC, "7") field(EGU, "kG-m") field(HOPR, "4.5427") field(LOPR, "0.0141") field(MDEL, "-1") field(BRSV, "INVALID") field(FLNK, "BEND:LTUS:476:ISETPT") } record(ao, "BEND:LTUS:476:BDESPREVTRIM") { field(DESC, "trim bdes for undo") field(DTYP, "Soft Channel") field(DRVH, "4.5427") field(DRVL, "0.0141") field(EGU, "kG-m") field(HOPR, "4.5427") field(LOPR, "0.0141") field(PREC, "7") field(PINI, "YES") info(autosaveFields,"VAL") } record(stringin, "BEND:LTUS:476:MADNAME") { field(DESC, "MAD deck nomenclature") field(PINI, "YES") field(VAL, "BCX32B2") } record(ai, "BEND:LTUS:476: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, "3354.525579") } record(ao, "BEND:LTUS:476:BMAX") { field(DESC, "Max B-Field") field(DTYP, "Soft Channel") field(DRVH, "4.5427") field(DRVL, "0.0141") field(EGU, "kG-m") field(HOPR, "4.5427") field(LOPR, "0.0141") field(PREC, "7") field(PINI, "YES") field(VAL, "4.5427") field(FLNK, "BEND:LTUS:476:BSTEP") } record(ao, "BEND:LTUS:476:BMIN") { field(DESC, "Min B-Field") field(DTYP, "Soft Channel") field(DRVH, "4.5427") field(DRVL, "0.0141") field(EGU, "kG-m") field(HOPR, "4.5427") field(LOPR, "0.0141") field(PREC, "7") field(PINI, "YES") field(VAL, "0.0141") field(FLNK, "BEND:LTUS:476:BSTEP") } record(ao, "BEND:LTUS:476:BDESSAVE") { field(DESC, "bdes for save/load") field(DTYP, "Soft Channel") field(DRVH, "4.5427") field(DRVL, "0.0141") field(EGU, "kG-m") field(HOPR, "4.5427") field(LOPR, "0.0141") field(PINI, "YES") field(PREC, "7") } # This record is processed by BEND:LTUS:476: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, "BEND:LTUS:476:BCON") { field(DESC, "Config B-Field ") field(DTYP, "Soft Channel") field(PREC, "7") field(EGU, "kG-m") field(HOPR, "4.5427") field(LOPR, "0.0141") field(DRVH, "4.5427") field(DRVL, "0.0141") # Set MINOR Alarm as the default, slaves will set NO_ALARM=0. field(HHSV, "MINOR") field(LLSV, "MINOR") field(HSV, "MINOR") field(LSV, "MINOR") # field(DOL , "") field(OMSL, "supervisory") field(OUT, "BEND:LTUS:476:B2ICON PP") info(autosaveFields,"VAL") } record(sub, "BEND:LTUS:476:B2ICON") { field(DESC, "Convert Desired ICon to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "BEND:LTUS:476:POLYCOEF") field(INPC, "BEND:LTUS:476:POLYCOEF.A") field(INPD, "BEND:LTUS:476:POLYCOEF.B") field(PREC, "7") field(EGU, "kG-m") field(HOPR, "4.5427") field(LOPR, "0.0141") field(MDEL, "-1") field(INPE, "BEND:LTUS:476:BCON.DRVH") field(INPF, "BEND:LTUS:476:BCON.DRVL") field(BRSV, "INVALID") field(FLNK, "BEND:LTUS:476: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, "BEND:LTUS:476:BSTEP") { field(DESC, "B-Field step size") field(CALC, "(C==3)||(D==3)?0:ABS(A-B)*0.005") field(INPA, "BEND:LTUS:476:BMAX") field(INPB, "BEND:LTUS:476:BMIN") field(INPC, "BEND:LTUS:476:BMIN.SEVR") field(INPD, "BEND:LTUS:476:BMAX.SEVR") field(EGU, "kG-m") 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,"BEND:LTUS:476:BCTRLDISABLECALC") { field(DESC, "Calc for disabling BCTRL") field(ASG, "Internal") field(CALC, "A?2:1") field(INPA, "BEND:LTUS:476:ONLINE CP") field(OUT, "BEND:LTUS:476:BCTRLDISABLEFOUT PP") } record(fanout, "BEND:LTUS:476:BCTRLDISABLEFOUT") { field(DESC, "Disable BCTRL fanout") field(SELM, "Specified") field(SELL, "BEND:LTUS:476:BCTRLDISABLECALC") field(LNK1, "BEND:LTUS:476:BCTRLDISABLE") field(LNK2, "BEND:LTUS:476:BCTRLENABLE") } record(stringout, "BEND:LTUS:476:BCTRLDISABLE") { field(DESC, "Disable BCTRL") field(DTYP, "Soft Channel") field(OUT, "BEND:LTUS:476:BCTRL.ASG") field(VAL, "NOWRITE") field(FLNK, "BEND:LTUS:476:BCTRLDISV_UPDATE") } record(stringout, "BEND:LTUS:476:BCTRLENABLE") { field(DESC, "Enable BCTRL") field(DTYP, "Soft Channel") field(OUT, "BEND:LTUS:476:BCTRL.ASG") field(VAL, "") field(FLNK, "BEND:LTUS:476:BCTRLDISV_UPDATE") } record(calcout, "BEND:LTUS:476:BCTRLDISV_UPDATE") { field(DESC, "Calc for updating BCTRL.DISV") field(ASG, "Internal") field(CALC, "A") field(INPA, "BEND:LTUS:476:ONLINE") field(OUT, "BEND:LTUS:476: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,"BEND:LTUS:476:BACT and MON\n are processed via links from \n BEND:LTUS:476:IACT (device raw value readback 1)\n and\n BEND:LTUS:476: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 BEND:LTUS:476:POLYCOEF\nC = First polynomial coefficient (offset if linear)\nD = Second polynomial coefficient (slope if linear)\nE = BEND:LTUS:476: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,"BEND:LTUS:476:BDES\n is processed when set by CA users or \n BEND:LTUS:476: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,"BEND:LTUS:476: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 BEND:LTUS:476: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 (BEND:LTUS:476: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,"BEND:LTUS:476:B*LIMITS and BEND:LTUS:476:BLIMITS:\n Calculate alarm and warning limits based on \n deltas from BEND:LTUS:476: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,"BEND:LTUS:476: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,"BEND:LTUS:476: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, "BEND:LTUS:476: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, "BEND:LTUS:476:MPSBTOL") { field(DESC, "Absolute mps tol") field(EGU, "kG-m") field(PREC, "2") field(CALC, "ABS(A)*0.02") field(INPA, "BEND:LTUS:476:BMAX") field(PINI, "YES") } # # 21-Aug-2013: K. Luchini # Set channel access security so that users # cannot easily change values. record(ao, "BEND:LTUS:476:MPSBMAX") { field(DESC, "MPS Max B-field") field(EGU, "kG-m") field(PREC, "7") field(DRVH, "4.5427") field(DRVL, "0.0141") field(PINI, "YES") field(VAL, "4.5427") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:476:MPSBMIN") { field(DESC, "MPS Min B-field") field(EGU, "kG-m") field(PREC, "7") field(DRVH, "4.5427") field(DRVL, "0.0141") field(PINI, "YES") field(VAL, "0.0141") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:476:MPSBLLIM") { field(DESC, "MPS Low Limit B-field") field(EGU, "kG-m") field(PREC, "7") field(DRVH, "4.5427") field(DRVL, "0.0141") field(PINI, "YES") field(VAL, "0.0141") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:476:MPSBLLIM2") { field(DESC, "MPS Low Limit #2 B-field") field(EGU, "kG-m") field(PREC, "7") field(DRVH, "4.5427") field(DRVL, "0.0141") field(PINI, "YES") field(VAL, "0.0141") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } # Set the default to Std record(mbbo, "BEND:LTUS:476: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, "BEND:LTUS:476:MPSLIMITS.E PP") } record(aSub, "BEND:LTUS:476: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, "BEND:LTUS:476:MPS.RVAL") field(INPB, "BEND:LTUS:476:BADIFF") field(INPC, "BEND:LTUS:476:BDELTAS.N") field(INPD, "BEND:LTUS:476:BACT") field(INPE, "BEND:LTUS:476:MPSBITMASK.RVAL") field(INPF, "BEND:LTUS:476:MPSBLLIM") field(INPG, "BEND:LTUS:476:MPSBMIN") field(INPH, "BEND:LTUS:476:MPSBMAX") field(INPI, "BEND:LTUS:476: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, "BEND:LTUS:476:INTOL.RVAL PP") field(OUTB, "BEND:LTUS:476:INTOL_BMIN.RVAL PP") field(OUTC, "BEND:LTUS:476:INTOL_BRANGE.RVAL PP") field(OUTD, "BEND:LTUS:476: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, "BEND:LTUS:476:INTOL") { field(DESC, "BACT within MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "BEND:LTUS:476:MPSLIMITS.VALA") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "BEND:LTUS:476:INTOL_BMIN") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "BEND:LTUS:476:MPSLIMITS.VALB") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "BEND:LTUS:476:INTOL_BMIN2") { field(DESC, "MPS tol #2") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "BEND:LTUS:476:MPSLIMITS.VALD") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "BEND:LTUS:476:INTOL_BRANGE") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "BEND:LTUS:476: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, "BEND:LTUS:476:CHCKITOL") { field(DESC, "Absolute Check I Tolerance") field(EGU, "A") field(FLNK, "BEND:LTUS:476:TRIMITOL") field(CALC, "ABS(A*B)") field(INPA, "BEND:LTUS:476:CHCKBTOL") field(INPB, "BEND:LTUS:476:POLYCOEF.B") field(PREC, "9") } record(calc, "BEND:LTUS:476:TRIMBTOL") { field(EGU, "kG-m") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(DESC, "Absolute Trim Tolerance") field(CALC, "ABS(A)/2") field(INPA, "BEND:LTUS:476:CHCKBTOL") field(FLNK, "BEND:LTUS:476:CHCKITOL") } record(calc, "BEND:LTUS:476:CHCKBTOL") { field(DESC, "Check absolute tolerance") field(EGU, "A") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(FLNK, "BEND:LTUS:476:TRIMBTOL") field(CALC, "MAX(ABS(A),ABS(C))*(B/1000000)") field(INPA, "BEND:LTUS:476:BDES.HOPR") field(INPB, "BEND:LTUS:476:STABILITY") field(INPC, "BEND:LTUS:476:BDES.LOPR") } record(longout, "BEND:LTUS:476: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, "BEND:LTUS:476:CHCKBTOL") } record(calc, "BEND:LTUS:476:TRIMITOL") { field(DESC, "Absolute Trim I Tolerance") field(EGU, "kG-m") field(CALC, "ABS(A*B)") field(INPA, "BEND:LTUS:476:POLYCOEF.B") field(INPB, "BEND:LTUS:476:TRIMBTOL") field(PREC, "9") } record(ai, "BEND:LTUS:476:TRIMBTOLR") { field(DESC, "Relative trim tol") field(PREC, "4") field(EGU, "%") field(HOPR, "1.0") field(LOPR, "0.0") field(PINI, "YES") } record(ai, "BEND:LTUS:476: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, "BEND:LTUS:476:FBCKFCOM") { field(ZNAM, "CA") field(ONAM, "FCOM") field(DESC, "CA Mode") field(PINI, "YES") field(SDIS, "0") } record(bo, "BEND:LTUS:476:PAU") { field(ZNAM, "NotConfigured") field(ONAM, "Configured") field(DESC, "PAU Present") field(PINI, "YES") field(SDIS, "0") field(FLNK, "BEND:LTUS:476:PAUGO") } record(fanout, "BEND:LTUS:476:PAUGO") { field(DESC, "PAU control") field(LNK1, "BEND:LTUS:476:PAUSTOP") field(LNK2, "BEND:LTUS:476: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, "BEND:LTUS:476:PAUSTART") { field(DESC, "Setup for PAU On") field(SDIS, "BEND:LTUS:476: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, "BEND:LTUS:476:PAUSTOP") { field(DESC, "Setup for PAU Off") field(SDIS, "BEND:LTUS:476: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, "BEND:LTUS:476:MCORDEVNAME") { field(DESC, "PS device name") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, "PSC:LTUS:MG26:") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "BEND:LTUS:476: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, "BEND:LTUS:476:PSTYPE.RVAL") field(INPC, "BEND:LTUS:476:TURNEDOFF.RVAL") field(INPD, "BEND:LTUS:476:CONFIG.RVAL") field(INPE, "BEND:LTUS:476:PSCATEGORY.RVAL") field(INPF, "BEND:LTUS:476:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "BEND:LTUS:476:AUTOCTRL.RVAL") field(INPJ, "BEND:LTUS:476:OUTOFSERVICE.RVAL") field(INPL, "BEND:LTUS:476:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "BEND:LTUS:476:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "BEND:LTUS:476:PAU") field(INPP, "BEND:LTUS:476:CALBDISABLE.RVAL") field(INPQ, "BEND:LTUS:476:PTRBDISABLE.RVAL") field(INPR, "BEND:LTUS:476:TRIMDISABLE.RVAL") field(INPS, "BEND:LTUS:476:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "BEND:LTUS:476:FBCK") field(INPU, "BEND:LTUS:476:TRIMTYPE.RVAL") field(INPV, "BEND:LTUS:476:STDZDIRECT.RVAL") field(INPW, "BEND:LTUS:476:DEGAUSENABLE.RVAL") field(FLNK, "BEND:LTUS:476:HSTA") } record(longin, "BEND:LTUS:476:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "BEND:LTUS:476:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "BEND:LTUS:476: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, "BEND:LTUS:476: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, "BEND:LTUS:476:CALBDISABLE") { field(DESC, "DAC Calb Disabled") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "BEND:LTUS:476:PTRBDISABLE") { field(DESC, "Perturb Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "BEND:LTUS:476:TRIMDISABLE") { field(DESC, "Trim Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "BEND:LTUS:476: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 BEND:LTUS:476:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses BEND:LTUS:476:FBCK. # This PV should be replaced by BEND:LTUS:476: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, "BEND:LTUS:476: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, "BEND:LTUS:476: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, "BEND:LTUS:476: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, "") field(OMSL, "supervisory") field(FLNK, "BEND:LTUS:476:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"BEND:LTUS:476:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "BEND:LTUS:476:OUTOFSERVICE NPP NMS") field(OUT, "BEND:LTUS:476:ONLINE PP") } record(bo, "BEND:LTUS:476:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "BEND:LTUS:476: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, "1") } record(bo, "BEND:LTUS:476: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, "1") } record(bo, "BEND:LTUS:476: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, "BEND:LTUS:476: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, "BEND:LTUS:476: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, "BEND:LTUS:476: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, "BEND:LTUS:476: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, "BEND:LTUS:476: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, "1") field(ASG, "NOWRITE") } record(mbbo, "BEND:LTUS:476: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, "1") field(ASG, "NOWRITE") } record(mbbo, "BEND:LTUS:476: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, "2") field(ASG, "NOWRITE") } record(mbbo, "BEND:LTUS:476: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, "0") field(ASG, "NOWRITE") field(FLNK, "BEND:LTUS:476:TRIMTYPE") } record(stringout, "BEND:LTUS:476:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "BEND:LTUS:476:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "BEND:LTUS:476:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "BEND:LTUS:476:STATE.RVAL") field(INPB, "BEND:LTUS:476:INTLKSUMY.RVAL") field(OUT, "BEND:LTUS:476:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "BEND:LTUS:476: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, "BEND:LTUS:476:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "BEND:LTUS:476:STATE.RVAL") field(INPB, "BEND:LTUS:476:INTLKSUMY.RVAL") field(OUT, "BEND:LTUS:476:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "BEND:LTUS:476:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "BEND:LTUS:476:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "BEND:LTUS:476: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, "BEND:LTUS:476:RAMPSTARTDLY") { field(DESC, "Tansition to ramp delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "2") } ######### For PSTYPE=2 Only ############# record(mbbo, "BEND:LTUS:476: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, "BEND:LTUS:476: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,"BEND:LTUS:476: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("BEND:LTUS:476:TURNEDOFF",3140,1907,0,1,"BEND:LTUS:476:TURNEDOFF") #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "BEND:LTUS:476:STATSUB") { field(DESC, "Build STATus ") field(INAM, "mgntInit") field(SNAM, "mgntSlcStat") field(INPA, "BEND:LTUS:476:BACT.STAT") field(INPB, "BEND:LTUS:476:BDES.STAT") field(INPC, "BEND:LTUS:476:IRIPL.STAT") field(INPD, "PSC:LTUS:MG26:ISETPT.STAT") field(INPE, "PSC:LTUS:MG26:IACT.STAT") # 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, "BEND:LTUS:476:BACT.SEVR") field(INPH, "BEND:LTUS:476:BDES.SEVR") field(INPI, "BEND:LTUS:476:IRIPL.SEVR") field(INPJ, "PSC:LTUS:MG26:ISETPT.SEVR") field(INPK, "PSC:LTUS:MG26:IACT.SEVR") # # 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, "BEND:LTUS:476:STATE.RVAL") field(INPN, "BEND:LTUS:476:STDZOK") field(INPO, "BEND:LTUS:476:CALBOK") field(INPP, "BEND:LTUS:476:OUTOFSERVICE.RVAL") field(INPQ, "BEND:LTUS:476:CONFIG.RVAL") field(INPR, "BEND:LTUS:476:HSTA") field(INPS, "BEND:LTUS:476:CTRL.RVAL") field(INPT, "BEND:LTUS:476:DEGAUSOK") field(INPV, "BEND:LTUS:476: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, "BEND:LTUS:476:STAT") } record(longout, "BEND:LTUS:476:STAT") { field(DESC, "STAT sent to SLC") field(SCAN, "Passive") field(FLNK, "BEND:LTUS:476:STATCTRLSUB") field(DOL, "BEND:LTUS:476:STATSUB.VAL") field(OMSL, "closed_loop") } record(sSub, "BEND:LTUS:476:STATCTRLSUB") { field(DESC, "Decode SLC STAT into mbbo") field(INAM, "mgntInit") field(SNAM, "mgntStatDecode") field(INPA, "BEND:LTUS:476:STAT") field(INPB, "BEND:LTUS:476:HSTA") field(INPD, "BEND:LTUS:476:ONOFFCTRL.RVAL") field(FLNK, "BEND:LTUS:476:STATMSG") } record(mbbo, "BEND:LTUS:476: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, "BEND:LTUS:476:UNAVAILGO") field(DOL, "BEND:LTUS:476:STATCTRLSUB.W") } record(seq, "BEND:LTUS:476:UNAVAILGO") { field(DESC, "Process UNAVAIL") field(DOL1, "BEND:LTUS:476:STATSUB.U") field(LNK1, "BEND:LTUS:476:UNAVAIL PP") } record(stringout, "BEND:LTUS:476:SNLSTATMSG") { field(DTYP, "Soft Channel") } #! TextBox(TB0,820,1000,1200,1220,0,"Dialog",12,1,16777215,"BEND:LTUS:476:STATUSSUB - future\nOverall device status - takes input from action snls, record sevrs, master snl(s) and outputs final status\n\nInputs:\nA - BEND:LTUS:476:CTRLSTATUS - snl status\nB - MGNT:CTRLSTATUS - master list status\nC\nD - BEND:LTUS:476: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,"BEND:LTUS:476STATSUB\nformat control bo's into slc STAT\n\nInputs:\nA - BEND:LTUS:476:STATUS\nC - BEND:LTUS:476:ON\nD - BEND:LTUS:476:STDZOK\nE - BEND:LTUS:476:CALBOK\nF - BEND:LTUS:476:BACTDRIFT (future)\nG -\nH- BEND:LTUS:476:DACSTATUS\nI -BEND:LTUS:476:ADCSTATUS\nJ - BEND:LTUS:476:BACTSTATUS\nK - BEND:LTUS:476:BDESSTATUS\nL - BEND:LTUS:476:RIPLSTATUS\n\nOutput:\nP - BEND:LTUS:476: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, "BEND:LTUS:476: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, "BEND:LTUS:476: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, "BEND:LTUS:476: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, "BEND:LTUS:476: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.6 #! DBDSTART #! DBD("../../../../dbd/mgntSoft.dbd") #! DBDEND record(stringout, "BEND:LTUS:476:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:476:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "BEND:LTUS:476:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "BEND:LTUS:476:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "BEND:LTUS:476:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "BEND:LTUS:476:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "1") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "BEND:LTUS:476: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, "BEND:LTUS:476:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "BEND:LTUS:476:TRIMTYPE.RVAL") field(INPB, "BEND:LTUS:476:CONFIG.RVAL") field(OUT, "BEND:LTUS:476:TRIMMAXNUM PP") } record(longout, "BEND:LTUS:476: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, "BEND:LTUS:476: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, "") field(OMSL, "supervisory") field(VAL, "10") field(OUT, "BEND:LTUS:476:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "BEND:LTUS:476: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, "") field(OMSL, "supervisory") field(VAL, "10") } record(bo, "BEND:LTUS:476: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, "BEND:LTUS:476: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, "BEND:LTUS:476: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, "BEND:LTUS:476:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "0") } record(ao, "BEND:LTUS:476: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, "BEND:LTUS:476:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "BEND:LTUS:476: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, "BEND:LTUS:476: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, "BEND:LTUS:476:IMOVE") field(INPB, "BEND:LTUS:476:IACT") field(INPC, "BEND:LTUS:476:IRAMPRATE") field(INPD, "1.577") field(INPE, "BEND:LTUS:476:TRIMDLYPCT") field(INPF, "BEND:LTUS:476:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "BEND:LTUS:476:RAMPTIME_LEFT PP") } record(longout, "BEND:LTUS:476:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "BEND:LTUS:476:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "BEND:LTUS:476:RAMPDONE_CALC") } record(calc, "BEND:LTUS:476:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "BEND:LTUS:476:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "BEND:LTUS:476:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "BEND:LTUS:476: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, "BEND:LTUS:476:RAMPTIME_LEFT") field(OUT, "BEND:LTUS:476:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "BEND:LTUS:476:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "BEND:LTUS:476:RAMPTIME_LEFT NMS") field(OUT, "BEND:LTUS:476:RAMPDONE PP") } record(bo, "BEND:LTUS:476:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "BEND:LTUS:476:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "BEND:LTUS:476: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, "BEND:LTUS:476: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(sSub, "BEND:LTUS:476: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, "BEND:LTUS:476:PSTYPE.RVAL") field(INPC, "BEND:LTUS:476:TURNEDOFF.RVAL") field(INPD, "BEND:LTUS:476:CONFIG.RVAL") field(INPE, "BEND:LTUS:476:PSCATEGORY.RVAL") field(INPF, "BEND:LTUS:476:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "BEND:LTUS:476:AUTOCTRL.RVAL") field(INPJ, "BEND:LTUS:476:OUTOFSERVICE.RVAL") field(INPL, "BEND:LTUS:476:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "BEND:LTUS:476:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "BEND:LTUS:476:PAU") field(INPP, "BEND:LTUS:476:CALBDISABLE.RVAL") field(INPQ, "BEND:LTUS:476:PTRBDISABLE.RVAL") field(INPR, "BEND:LTUS:476:TRIMDISABLE.RVAL") field(INPS, "BEND:LTUS:476:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "BEND:LTUS:476:FBCK") field(INPU, "BEND:LTUS:476:TRIMTYPE.RVAL") field(INPV, "BEND:LTUS:476:STDZDIRECT.RVAL") field(INPW, "BEND:LTUS:476:DEGAUSENABLE.RVAL") field(FLNK, "BEND:LTUS:476:HSTA") } record(longin, "BEND:LTUS:476:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "BEND:LTUS:476:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "BEND:LTUS:476: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, "BEND:LTUS:476: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, "BEND:LTUS:476:CALBDISABLE") { field(DESC, "DAC Calb Disabled") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "BEND:LTUS:476:PTRBDISABLE") { field(DESC, "Perturb Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "BEND:LTUS:476:TRIMDISABLE") { field(DESC, "Trim Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "BEND:LTUS:476:STDZDISABLE") { field(DTYP, "Raw Soft Channel") field(ZNAM, "NO") field(ONAM, "YES") field(DESC, "Standardize Function") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } # This PV has been replaced by BEND:LTUS:476:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses BEND:LTUS:476:FBCK. # This PV should be replaced by BEND:LTUS:476: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, "BEND:LTUS:476: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, "BEND:LTUS:476: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, "BEND:LTUS:476: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, "") field(OMSL, "supervisory") field(FLNK, "BEND:LTUS:476:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"BEND:LTUS:476:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "BEND:LTUS:476:OUTOFSERVICE NPP NMS") field(OUT, "BEND:LTUS:476:ONLINE PP") } record(bo, "BEND:LTUS:476:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "BEND:LTUS:476: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, "1") } record(bo, "BEND:LTUS:476: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, "1") } record(bo, "BEND:LTUS:476: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, "BEND:LTUS:476: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, "BEND:LTUS:476: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, "BEND:LTUS:476: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, "BEND:LTUS:476: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, "BEND:LTUS:476: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, "1") field(ASG, "NOWRITE") } record(mbbo, "BEND:LTUS:476: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, "1") field(ASG, "NOWRITE") } record(mbbo, "BEND:LTUS:476: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, "2") field(ASG, "NOWRITE") } record(mbbo, "BEND:LTUS:476: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, "2") field(ASG, "NOWRITE") field(FLNK, "BEND:LTUS:476:TRIMTYPE") } record(stringout, "BEND:LTUS:476:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "BEND:LTUS:476:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "BEND:LTUS:476:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "BEND:LTUS:476:STATE.RVAL") field(INPB, "BEND:LTUS:476:INTLKSUMY.RVAL") field(OUT, "BEND:LTUS:476:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "BEND:LTUS:476: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, "BEND:LTUS:476:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "BEND:LTUS:476:STATE.RVAL") field(INPB, "BEND:LTUS:476:INTLKSUMY.RVAL") field(OUT, "BEND:LTUS:476:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "BEND:LTUS:476:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "BEND:LTUS:476:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "BEND:LTUS:476: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, "BEND:LTUS:476:RAMPSTARTDLY") { field(DESC, "Tansition to ramp delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "2") } ######### For PSTYPE=2 Only ############# record(mbbo, "BEND:LTUS:476: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, "BEND:LTUS:476: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,"BEND:LTUS:476: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("BEND:LTUS:476:TURNEDOFF",3140,1907,0,1,"BEND:LTUS:476:TURNEDOFF") #! 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, "BEND:LTUS:525:IACT") { field(DESC, "Current") field(INP, "PSC:LTUS:MG05:IACT") field(EGU, "A") field(HOPR, "10.0") field(LOPR, "0.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "BEND:LTUS:525:BACT") info(autosaveFields,"HYST") } record(bi, "BEND:LTUS:525:STATE") { field(DESC, "PS On/Off Status") field(DTYP, "Raw Soft Channel") field(INP, "PSC:LTUS:MG05:STATE NPP MS") field(ZSV, "MAJOR") field(ZNAM, "OFF") field(ONAM, "ON") } record(ao, "BEND:LTUS:525:IDES") { field(DESC, "Desired Current") field(PREC, "3") field(EGU, "A") field(HOPR, "10.0") field(LOPR, "0.0") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(MDEL, "-1") field(HIHI, "10.0") field(LOLO, "0.0") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "BEND:LTUS:525:BDELTAS") field(DRVH, "10.0") field(DRVL, "0.0") field(DOL, "BEND:LTUS:525: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, "BEND:LTUS:525:ICTRL PP") } # This record is processed by BEND:LTUS:525:ICON") # Note: we are not setting alarms here. record(ao, "BEND:LTUS:525:ICON") { field(DESC, "Config I") field(DTYP, "Soft Channel") field(PREC, "3") field(HOPR, "10.0") field(LOPR, "0.0") field(DRVH, "10.0") field(DRVL, "0.0") field(DOL, "BEND:LTUS:525:B2ICON.K") field(OMSL, "closed_loop") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:525:INOM") { field(DESC, "Nominal Current") field(DOL, "BEND:LTUS:525:BNOM.K") field(OMSL, "closed_loop") field(PREC, "3") field(EGU, "A") field(DRVH, "10.0") field(DRVL, "0.0") field(HOPR, "10.0") field(LOPR, "0.0") } record(ao, "BEND:LTUS:525:ICTRL") { field(DESC, "Set Current") field(PREC, "3") field(EGU, "A") field(HOPR, "10.0") field(LOPR, "0.0") field(DRVH, "10.0") field(DRVL, "0.0") field(MDEL, "-1") field(FLNK, "BEND:LTUS:525:ICTRLGO") field(OMSL, "supervisory") info(autosavefields,"VAL") } record(seq, "BEND:LTUS:525:ICTRLGO") { field(DESC, "Process Current Setpoint") field(PREC, "3") # Set ISETPT to supervisory field(DOL1, "0") field(LNK1, "BEND:LTUS:525:ISETPT.OMSL") field(DOL2, "BEND:LTUS:525:ICTRL") field(LNK2, "BEND:LTUS:525:ISETPT PP") # Set ISETPT to closed loop - get data from BCTRLSUB.K field(DOL3, "1") field(LNK3, "BEND:LTUS:525:ISETPT.OMSL") } record(ao, "BEND:LTUS:525:IMAX") { field(DESC, "Max I") field(DTYP, "Soft Channel") field(DRVH, "10.0") field(DRVL, "0.0") field(EGU, "A") field(HOPR, "10.0") field(LOPR, "0.0") field(PREC, "3") field(PINI, "YES") field(VAL, "10.0") field(FLNK, "BEND:LTUS:525:IMIN") } record(ao, "BEND:LTUS:525:IMIN") { field(DESC, "Min I") field(DTYP, "Soft Channel") field(DRVH, "10.0") field(DRVL, "0.0") field(EGU, "A") field(HOPR, "10.0") field(LOPR, "0.0") field(PREC, "3") field(VAL, "0.0") field(FLNK, "BEND:LTUS:525:IRANGE") } record(sel, "BEND:LTUS:525:IACTPREVOK") { field(DESC, "Last Good Current") field(EGU, "A") field(HOPR, "10.0") field(LOPR, "0.0") field(PREC, "3") field(NVL, "BEND:LTUS:525:BACT.SEVR") field(INPA, "BEND:LTUS:525:IACT NPP MS") field(INPB, "BEND:LTUS:525:IACTPREVOK NPP MS") field(INPC, "BEND:LTUS:525:IACTPREVOK NPP MS") field(INPD, "BEND:LTUS:525:IACTPREVOK NPP MS") } record(sub, "BEND:LTUS:525:IACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "BEND:LTUS:525:IDES") field(INPB, "BEND:LTUS:525:ISETPT.DRVH") field(INPC, "BEND:LTUS:525:ISETPT.DRVL") field(INPD, "BEND:LTUS:525:IDELTAS.I") field(INPE, "BEND:LTUS:525:IDELTAS.J") field(INPG, "BEND:LTUS:525:STATE") field(INPH, "BEND:LTUS:525:HSTA") field(EGU, "A") field(HOPR, "10.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(sub, "BEND:LTUS:525:IMONLIMITS") { field(DESC, "Aux Current Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "BEND:LTUS:525:IDES") field(INPB, "BEND:LTUS:525:ISETPT.DRVH") field(INPC, "BEND:LTUS:525:ISETPT.DRVL") field(INPD, "BEND:LTUS:525:IDELTAS.K") field(INPE, "BEND:LTUS:525:IDELTAS.L") field(INPG, "BEND:LTUS:525:STATE") field(INPH, "BEND:LTUS:525:HSTA") field(EGU, "A") field(HOPR, "10.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(seq, "BEND:LTUS:525:ILIMITS") { field(DESC, "Set ACT and MON Limits") field(PREC, "3") field(DOL1, "BEND:LTUS:525:BLIMITS") field(LNK1, "BEND:LTUS:525:IACTLIMITS.F PP") field(DOL2, "BEND:LTUS:525:IACTLIMITS.I") field(LNK2, "BEND:LTUS:525:IACT.HIGH") field(DOL3, "BEND:LTUS:525:IACTLIMITS.J") field(LNK3, "BEND:LTUS:525:IACT.LOW") field(DOL4, "BEND:LTUS:525:IACTLIMITS.K") field(LNK4, "BEND:LTUS:525:IACT.HIHI") field(DOL5, "BEND:LTUS:525:IACTLIMITS.L") field(LNK5, "BEND:LTUS:525:IACT.LOLO") field(DOL6, "BEND:LTUS:525:BLIMITS") field(LNK6, "BEND:LTUS:525:IMONLIMITS.F PP") field(DOL7, "BEND:LTUS:525:IMONLIMITS.I") field(LNK7, "BEND:LTUS:525:IMON.HIGH") field(DOL8, "BEND:LTUS:525:IMONLIMITS.J") field(LNK8, "BEND:LTUS:525:IMON.LOW") field(DOL9, "BEND:LTUS:525:IMONLIMITS.K") field(LNK9, "BEND:LTUS:525:IMON.HIHI") field(DOLA, "BEND:LTUS:525:IMONLIMITS.L") field(LNKA, "BEND:LTUS:525: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, "BEND:LTUS:525:IDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntRawDeltas") field(INPD, "BEND:LTUS:525:TRIMBTOL") field(INPE, "BEND:LTUS:525:CHCKBTOL") field(INPF, "BEND:LTUS:525:BDELTAS.K") field(INPG, "BEND:LTUS:525:BDELTAS.L") field(INPH, "BEND:LTUS:525: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, "BEND:LTUS:525:STDZITOLR") field(INPC, "BEND:LTUS:525:STDZITOL") field(FLNK, "") } # All ps controllers with on/off control will set the macro ONOF # as follows: # # ONOF = PSC:LTUS:MG05: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, "BEND:LTUS:525:STATESETPT") { field(DESC, "PS On/Off") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFF") field(ONAM, "ON") field(OUT, "PSC:LTUS:MG05:STATESETPT PP") 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 = PSC:LTUS:MG05:RESET PP # record(bo, "BEND:LTUS:525:RESET") { field(DESC, "Interlock Latch Reset") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFF") field(ONAM, "ON") field(HIGH, "1.0") field(OUT, "PSC:LTUS:MG05:RESET PP") } record(bo, "BEND:LTUS:525:RAMPSTATE") { field(DESC, "PS Ramp Status") field(DTYP, "Soft Channel") field(DOL, "PSC:LTUS:MG05:RAMPSTATE NPP 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, "BEND:LTUS:525: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, "BEND:LTUS:525:TRIMRAMPRATE") field(OUT, "PSC:LTUS:MG05:IRAMPRATE PP") field(FLNK, "BEND:LTUS:525:STDZDLY") } record(ao, "BEND:LTUS:525:ISETPT") { field(DESC, "Current Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(EGU, "A") field(HOPR, "10.0") field(LOPR, "0.0") field(DRVH, "10.0") field(DRVL, "0.0") field(MDEL, "-1") field(OUT, "PSC:LTUS:MG05:ISETPT PP") field(DOL, "BEND:LTUS:525: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, "BEND:LTUS:525:IMON") { field(DESC, "Aux Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(INP, "PSC:LTUS:MG05:IMON") field(EGU, "A") field(HOPR, "10.0") field(LOPR, "0.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "BEND:LTUS:525:BMON") } record(ao, "BEND:LTUS:525:IRIPL") { field(DESC, "Ripple Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(DOL, "PSC:LTUS:MG05:IRIPL NPP NMS") field(OMSL, "closed_loop") field(EGU, "A") field(DRVH, "1.0") field(HOPR, "1.0") field(PREC, "3") field(FLNK, "BEND:LTUS:525:IRIPLOK") } record(sub, "BEND:LTUS:525:IRIPLOK") { field(DESC, "Ripple Current Status") field(INAM, "mgntInit") field(SNAM, "mgntRiplOK") field(INPA, "BEND:LTUS:525:IRIPL.VAL") field(INPB, "BEND:LTUS:525: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, "BEND:LTUS:525:R") { field(DESC, "Resistance") field(EGU, "Ohms") field(PREC, "4") field(PINI, "YES") field(DOL, "PSC:LTUS:MG05:R NPP MS") 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, "BEND:LTUS:525:IGND") { field(DESC, "Ground Current") field(EGU, "A") field(PREC, "6") field(PINI, "YES") field(DOL, "PSC:LTUS:MG05:IGND NPP MS") field(OMSL, "closed_loop") } record(bi, "BEND:LTUS:525:INTLKSUMY") { field(DESC, "Interlock Summary") field(INP, "PSC:LTUS:MG05:INTLKSUMY NPP MS") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(ZNAM, "OK") field(ONAM, "FAULT") field(PINI, "NO") } record(mbbo, "BEND:LTUS:525: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, "PSC:LTUS:MG05:COOLING") field(OMSL, "closed_loop") } # The following PV is processed by :BACTFO # which is processed by :BACT record(fanout, "BEND:LTUS:525:IACTFO") { field(DESC, "IACT processing") field(SELM, "All") field(LNK1, "BEND:LTUS:525:IACTPREVOK") field(LNK2, "BEND:LTUS:525:IDIFF") field(LNK3, "BEND:LTUS:525:IADIFF") field(LNK4, "BEND:LTUS:525:IRATIO") field(LNK5, "BEND:LTUS:525:IDIRECT") field(LNK6, "BEND:LTUS:525:IACTPOL_CHECK") } record(calc, "BEND:LTUS:525:IDIFF") { field(DESC, "IDES-IACT") field(CALC, "A-B") field(INPA, "BEND:LTUS:525:IDES") field(INPB, "BEND:LTUS:525:IACT") field(EGU, "A") field(PREC, "9") field(HOPR, "10.0") field(LOPR, "0.0") } record(calc, "BEND:LTUS:525:IADIFF") { field(DESC, "Absolute IDES-IACT") field(CALC, "A<0?ABS(A):A") field(INPA, "BEND:LTUS:525:IDIFF") field(PREC, "9") } record(calc, "BEND:LTUS:525:IRATIO") { field(DESC, "IDES-IACT/IMAX") field(CALC, "B?A/B:0") field(INPA, "BEND:LTUS:525:IDIFF") field(INPB, "BEND:LTUS:525:IDES.DRVH") field(PREC, "9") } record(calcout, "BEND:LTUS:525:IRANGE") { field(DESC, "Current Range") field(PINI, "YES") field(CALC, "ABS(A-B)") field(INPA, "BEND:LTUS:525:IMIN") field(INPB, "BEND:LTUS:525: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, "BEND:LTUS:525: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, "BEND:LTUS:525:IACT") field(FLNK, "BEND:LTUS:525:IACTPOL") } record(bo, "BEND:LTUS:525:IACTPOL") { field(DESC, "Actual I Polarity") field(DTYP, "Raw Soft Channel") field(DOL, "BEND:LTUS:525: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,"BEND:LTUS:525:I*LIMITS:\n Calculate alarm and warning limits based on \n deltas from BEND:LTUS:525:IDELTAS and the\n BEND:LTUS:525: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,"BEND:LTUS:525:IACT: \n Get copy of BEND:LTUS:525:I. \n",null) #! TextBox(TB12,1280,3100,1760,3200,0,"Dialog",12,1,16777215,"BEND:LTUS:525: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,"BEND:LTUS:525:IDES:\n Contains raw value calculated by \nBEND:LTUS:525: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 \nBEND:LTUS:525:BDELTAS.\n",null) #! TextBox(TB10,56,1940,316,2340,0,"Dialog",12,1,16777215,"BEND:LTUS:525: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 BEND:LTUS:525: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 BEND:LTUS:525: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,"BEND:LTUS:525:ISETPT:\n Sets the hardware. When fast feedback is set on, this record is\n set to closed loop mode by BEND:LTUS:525:FBCKSTART sequence. When \n the loop is closed, this record takes input calculated by \n BFBCK only. When fast feedback is set off, BEND:LTUS:525:FBCKSTOP \n will set it back to supervisory so that the value can be set by \n BEND:LTUS:525: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, "BEND:LTUS:525:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:525:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "BEND:LTUS:525:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "BEND:LTUS:525:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "BEND:LTUS:525:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "BEND:LTUS:525:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "1") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "BEND:LTUS:525: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, "BEND:LTUS:525:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "BEND:LTUS:525:TRIMTYPE.RVAL") field(INPB, "BEND:LTUS:525:CONFIG.RVAL") field(OUT, "BEND:LTUS:525:TRIMMAXNUM PP") } record(longout, "BEND:LTUS:525: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, "BEND:LTUS:525: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, "") field(OMSL, "supervisory") field(VAL, "10") field(OUT, "BEND:LTUS:525:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "BEND:LTUS:525: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, "") field(OMSL, "supervisory") field(VAL, "10") } record(bo, "BEND:LTUS:525: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, "BEND:LTUS:525: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, "BEND:LTUS:525: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, "BEND:LTUS:525:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "0") } record(ao, "BEND:LTUS:525: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, "BEND:LTUS:525:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "BEND:LTUS:525: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, "BEND:LTUS:525: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, "BEND:LTUS:525:IMOVE") field(INPB, "BEND:LTUS:525:IACT") field(INPC, "BEND:LTUS:525:IRAMPRATE") field(INPD, "1.577") field(INPE, "BEND:LTUS:525:TRIMDLYPCT") field(INPF, "BEND:LTUS:525:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "BEND:LTUS:525:RAMPTIME_LEFT PP") } record(longout, "BEND:LTUS:525:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "BEND:LTUS:525:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "BEND:LTUS:525:RAMPDONE_CALC") } record(calc, "BEND:LTUS:525:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "BEND:LTUS:525:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "BEND:LTUS:525:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "BEND:LTUS:525: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, "BEND:LTUS:525:RAMPTIME_LEFT") field(OUT, "BEND:LTUS:525:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "BEND:LTUS:525:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "BEND:LTUS:525:RAMPTIME_LEFT NMS") field(OUT, "BEND:LTUS:525:RAMPDONE PP") } record(bo, "BEND:LTUS:525:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "BEND:LTUS:525:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "BEND:LTUS:525: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, "BEND:LTUS:525: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, "BEND:LTUS:525:STDZINIT") { field(DESC, "Proc. Stdz PVs on boot") field(PINI, "YES") field(DOL1, "1") field(DOL2, "1") field(DOL3, "1") field(LNK1, "BEND:LTUS:525:DEBUG.PROC PP") field(LNK2, "BEND:LTUS:525:STDZCYCLENUM.PROC PP") field(LNK3, "BEND:LTUS:525:STDZDISABLE.PROC PP") field(LNK4, "BEND:LTUS:525: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, "BEND:LTUS:525:STDZSUB") { field(DESC, "Stdz subroutine") field(INAM, "mgntStdzInit") field(SNAM, "mgntStdz") field(BRSV, "INVALID") field(INPA, "BEND:LTUS:525:STDZIMIN NPP NMS") field(INPB, "BEND:LTUS:525:STDZIMAX NPP NMS") field(INPC, "BEND:LTUS:525:STDZIFINAL NPP NMS") field(INPD, "BEND:LTUS:525:STDZCYCLENUM NPP NMS") field(INPE, "BEND:LTUS:525:STDZDIRECT.RVAL NPP NMS") field(INPF, "BEND:LTUS:525:STDZDISABLE.RVAL CPP NMS") field(INPG, "BEND:LTUS:525: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, "BEND:LTUS:525:STDZWF PP") field(OUTB, "BEND:LTUS:525: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, "BEND:LTUS:525:STDZWF") } record(mbbo, "BEND:LTUS:525: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, "BEND:LTUS:525: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, "BEND:LTUS:525:STDZMAINPS") { field(DESC, "Stdz by main or self") field(PINI, "YES") field(DTYP, "Soft Channel") field(ZNAM, "SELF") field(ONAM, "MAIN") } record(bo, "BEND:LTUS:525: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, "BEND:LTUS:525: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, "BEND:LTUS:525: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, "BEND:LTUS:525:STDZTOD") { field(DESC, "Successful Standardize Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "BEND:LTUS:525:STDZLOSTTOD") { field(DESC, "Standardize Lost Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(longout, "BEND:LTUS:525:STDZCYCLECNT") { field(DESC, "Cycle Count") field(PINI, "YES") } record(longout, "BEND:LTUS:525:STDZCYCLENUM") { field(DESC, "No. Standardize Cycles") field(VAL, "3") field(HOPR, "10") field(LOPR, "0") field(DRVH, "10") field(DRVL, "0") field(PINI, "YES") field(FLNK, "BEND:LTUS:525:STDZDIRECT") } # The default standardize direction is "UP" for # all LCLS Magnets.. record(bo, "BEND:LTUS:525:STDZDIRECT") { field(DESC, "Standardize Direction ") field(ZNAM, "UP") field(ONAM, "DOWN") field(VAL, "0") field(FLNK, "BEND:LTUS:525:STDZIMIN") } record(ao, "BEND:LTUS:525:STDZIMIN") { field(DESC, "Min-STDZ Current") field(PREC, "1") field(EGU, "A") field(HOPR, "10.0") field(LOPR, "0.0") field(VAL, "0.0") field(FLNK, "BEND:LTUS:525:STDZIMAX") } record(ao, "BEND:LTUS:525:STDZIMAX") { field(DESC, "Max. Standarize Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "10.0") field(LOPR, "0.0") field(VAL, "10.0") field(FLNK, "BEND:LTUS:525:STDZIFINAL") } record(ao, "BEND:LTUS:525:STDZIFINAL") { field(DESC, "Final SDTZ Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "10.0") field(LOPR, "0.0") field(VAL, "0.0") field(FLNK, "BEND:LTUS:525: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, "BEND:LTUS:525: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, "BEND:LTUS:525:STDZITOL") { field(DESC, "Stdz min tolerance") field(PREC, "5") field(CALC, "MAX(ABS(A),ABS(B))*C") field(INPA, "BEND:LTUS:525:STDZIMIN CP NMS") field(INPB, "BEND:LTUS:525:STDZIMAX CP MMS") field(INPC, "0.05") field(INPD, "BEND:LTUS:525:STDZITOLR CP MMS") field(EGU, "A") field(FLNK, "BEND:LTUS:525:IDELTAS") field(PINI, "YES") } # D - factor (3.154/2 = 1.577) for EPSC, otherwise, set to 1.0 record(calc, "BEND:LTUS:525:STDZDLY") { field(DESC, "Ramp time for stdz cycle") field(CALC, "C>0?MAX(1,ABS((A-B)/C)*D):0") field(INPA, "BEND:LTUS:525:STDZIMIN CP NMS") field(INPB, "BEND:LTUS:525:STDZIMAX CP NMS") field(INPC, "BEND:LTUS:525:TRIMRAMPRATE CP NMS") field(INPD, "1.577") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") } record(calc, "BEND:LTUS:525:STDZRAMPDLY") { field(DESC, "Ramp delay total") field(CALC, "MAX(1,((A/100)*B+B))") field(PREC, "5") field(INPA, "BEND:LTUS:525:TRIMDLYPCT CP MS") field(INPB, "BEND:LTUS:525: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, "BEND:LTUS:525:STDZMINIDLY") { field(DESC, "Mini-stdz delay") field(CALC, "A") field(PREC, "5") field(A, "1.0") field(EGU, "sec") field(PINI, "YES") } record(ao, "BEND:LTUS:525: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, "BEND:LTUS:525:STDZMINIDELTA") { field(DESC, "Stdz mini % of IMAX") field(CALC, "(B/100)*(A-C)") field(INPA, "BEND:LTUS:525:IDES.HOPR") field(INPB, "BEND:LTUS:525:STDZMINIPCT CPP NMS") field(INPC, "BEND:LTUS:525:IDES.LOPR") field(PREC, "5") } record(calc, "BEND:LTUS:525:STDZMINISETPT") { field(DESC, "Mini Stdz delta") field(CALC, "C==0?MAX(E-D,B):MIN(E+D,A)") field(INPA, "BEND:LTUS:525:IDES.HOPR") field(INPB, "BEND:LTUS:525:IDES.LOPR") field(INPC, "BEND:LTUS:525:STDZDIRECT.RVAL") field(INPD, "BEND:LTUS:525:STDZMINIDELTA") field(INPE, "BEND:LTUS:525:IDES") field(PREC, "5") field(FLNK, "BEND:LTUS:525: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, "BEND:LTUS:525:STDZMINISETPTOOR") { field(DESC, "Mini Stdz setpoint out of range") field(CALC, "C==0?(E-DA)") field(INPA, "BEND:LTUS:525:IDES.HOPR") field(INPB, "BEND:LTUS:525:IDES.LOPR") field(INPC, "BEND:LTUS:525:STDZDIRECT.RVAL") field(INPD, "BEND:LTUS:525:STDZMINIDELTA") field(INPE, "BEND:LTUS:525: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, "BEND:LTUS:525: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, "BEND:LTUS:525:IADJUST.RVAL") field(INPB, "BEND:LTUS:525:STDZDIRECT.RVAL") field(INPC, "BEND:LTUS:525:STDZOK.RVAL") field(INPD, "BEND:LTUS:525:STDZDISABLE.RVAL") field(INPE, "BEND:LTUS:525:STATE.RVAL CPP NMS") field(INPF, "BEND:LTUS:525:ICTRL.RVAL") field(INPG, "BEND:LTUS:525:STATE.SEVR") field(INPH, "BEND:LTUS:525:BDELTAS.M") field(INPI, "BEND:LTUS:525:IACT.SEVR") field(OUT, "BEND:LTUS:525:STDZLOSTGO.SELN PP NMS") field(OOPT, "Transition To Non-zero") } record(seq, "BEND:LTUS:525:STDZLOSTGO") { field(DESC, "Process lost stdz") field(SELM, "Mask") field(DOL1, "1") field(DOL2, "0") field(LNK1, "BEND:LTUS:525:STDZLOSTTOD.PROC") field(LNK2, "BEND:LTUS:525:STDZOK PP") } # Record maximum current after standardize # Reset to IACT from sequence after trim # Disable processing during (mini-)standardize or trim record(calc, "BEND:LTUS:525:STDZIACTMAX") { field(DESC, "Max act current after stdz") field(CALC, "MAX(A, B)") field(DISV, "0") field(SDIS, "BEND:LTUS:525:CHECKPWRDIP_ENABLE") field(INPA, "BEND:LTUS:525:IACT CP") field(INPB, "BEND:LTUS:525:STDZIACTMAX") field(EGU, "A") field(FLNK, "BEND:LTUS:525:CHECKPWRDIP") } # Detect power dip if STDZOK is YES, STDZ is enabled, and IACT is valid # If IACT drops below STDZIACTMAX by more than the trim tolerance, clear STDZOK # Warning: Take the absolute value of the trim tolerance, or else quads of # negative polarity will always lose STDZ since their IDELTAS.I are negative. # Note: Large quads and bends are prone to losing STDZ even if they are # perturbed toward higher current since their current tends to overshoot # by greater than the trim tolerance before settling down. record(calcout, "BEND:LTUS:525:CHECKPWRDIP") { field(DESC, "Detect power dip") field(CALC, "(A-B>ABS(C))?3:0") field(DISV, "0") field(SDIS, "BEND:LTUS:525:CHECKPWRDIP_ENABLE") field(INPA, "BEND:LTUS:525:STDZIACTMAX") field(INPB, "BEND:LTUS:525:IACT") field(INPC, "BEND:LTUS:525:IDELTAS.I") field(OUT, "BEND:LTUS:525:STDZLOSTGO.SELN PP NMS") field(OOPT, "When Non-zero") } # Enable processing of STDZIACTMAX and CHECKPWRDIP only if # STDZOK = YES, STDZDISABLE = NO, CTRL != Trim (2), and # CTRL != Stdz (4) record(calc, "BEND:LTUS:525:CHECKPWRDIP_ENABLE") { field(CALC, "A&&!B&&(C#2)&&(C#4)") field(INPA, "BEND:LTUS:525:STDZOK.RVAL CP") field(INPB, "BEND:LTUS:525:STDZDISABLE.RVAL CP") field(INPC, "BEND:LTUS:525:CTRL.RVAL CP") } #! 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, "BEND:LTUS:525: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, "BEND:LTUS:525:CALBOK") { field(DESC, "Successful Calibration") field(DTYP, "Raw Soft Channel") field(ZNAM, "NO") field(ONAM, "YES") field(DOL, "PSC:LTUS:MG05:CALBOK.RVAL") field(OMSL, "closed_loop") 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, "BEND:LTUS:525:CALBSET") { field(DESC, "Use DAC Calbration") field(SCAN, "10 second") field(CALC, "A&&(B==0)&&C?31:960") field(INPA, "BEND:LTUS:525:CALBOK") field(INPB, "BEND:LTUS:525:CALBDISABLE") field(INPC, "BEND:LTUS:525:CALBSLOPE") field(OOPT, "On Change") field(OUT, "BEND:LTUS:525: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, "BEND:LTUS:525:CALB_SEQ") { field(DESC, "Output Calib Values") field(SELM, "Mask") field(SELL, "BEND:LTUS:525: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, "BEND:LTUS:525:CALBSLOPE") field(DOL3, "BEND:LTUS:525: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, "BEND:LTUS:525:CALBTOD") { field(DESC, "Calibration Success Time") field(PINI, "YES") field(DOL, "PSC:LTUS:MG05:CALBTOD") field(OMSL, "closed_loop") field(DTYP, "Soft Channel") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:525: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, "BEND:LTUS:525: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, "BEND:LTUS:525: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, "BEND:LTUS:525:CALBOFFSET") { field(DESC, "Calc DAC Offset") field(PREC, "6") field(EGU, "Counts") field(PINI, "YES") } record(bo, "BEND:LTUS:525: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, "BEND:LTUS:525:DACSLOPE") { field(DESC, "V to DAC slope") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "closed_loop") field(PINI, "YES") field(FLNK, "BEND:LTUS:525:DACOFFSET") } # Default Offset used in conversion from Volts to DAC Counts record(ao, "BEND:LTUS:525:DACOFFSET") { field(DESC, "V to DAC offset") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "closed_loop") field(PINI, "YES") field(FLNK, "BEND:LTUS:525: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, "BEND:LTUS:525: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, "BEND:LTUS:525:IACT") field(INPD, "BEND:LTUS:525:DACSLOPE") field(INPE, "BEND:LTUS:525:DACOFFSET") field(EGU, "Counts") field(PREC, "6") } record(ao, "BEND:LTUS:525:DAC") { field(DESC, "DAC Set point") field(EGU, "Counts") field(DOL, "") field(OMSL, "closed_loop") field(PREC, "6") field(PINI, "YES") } record(ao, "BEND:LTUS:525:CALBIMIN") { field(DESC, "Calibration Min Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(DRVH, "10.0") field(HOPR, "10.0") field(DRVL, "0.0") field(LOPR, "0.0") field(PREC, "3") field(EGU, "A") field(VAL, "0.0") field(FLNK, "BEND:LTUS:525:CALBIMAX") } record(ao, "BEND:LTUS:525:CALBIMAX") { field(DESC, "Calibration Max Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(DRVH, "10.0") field(HOPR, "10.0") field(LOPR, "0.0") field(DRVL, "0.0") field(EGU, "A") field(VAL, "10.0") field(FLNK, "BEND:LTUS:525:CALBSTEPNUM") } record(ao, "BEND:LTUS:525:CALBIFINAL") { field(DESC, "Calibration Last Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(PREC, "3") field(EGU, "A") field(HOPR, "10.0") field(LOPR, "0.0") field(VAL, "0") } record(longout, "BEND:LTUS:525: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, "BEND:LTUS:525:CALBIDELTA") } record(calc, "BEND:LTUS:525:CALBIDELTA") { field(DESC, "Step size for CALB") field(CALC, "C=0?0:ABS((A-B)/C)") field(INPA, "BEND:LTUS:525:CALBIMAX") field(INPB, "BEND:LTUS:525:CALBIMIN") field(INPC, "BEND:LTUS:525: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, "BEND:LTUS:525:CALBIMULT") { field(DESC, "IACT vs ISETPT mult") field(CALC, "C#0||A=0?1:ABS(B/A)") field(INPA, "PSC:LTUS:MG05:ISETPT.DRVH") field(INPB, "PSC:LTUS:MG05:IACT.HOPR") field(INPC, "BEND:LTUS:525:PSCONTROLLER.RVAL CPP") field(EGU, "A") field(PINI, "YES") } # SNL dbputs DAC values here. 6-10 steps are possible. record(waveform, "BEND:LTUS:525:CALBICTRLWF") { field(DESC, "ICTRL setpoint array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") } record(waveform, "BEND:LTUS:525:DACWF") { field(DESC, "DAC count array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "BEND:LTUS:525:DACSA") } # Used only for xygraph edm plot record(subArray, "BEND:LTUS:525:DACSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "BEND:LTUS:525: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, "BEND:LTUS:525:CALCDACWF") { field(DESC, "Calc DAC counts array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "BEND:LTUS:525:CALCDACSA") } # Used only for xygraph edm plot record(subArray, "BEND:LTUS:525:CALCDACSA") { field(DESC, "Calc DAC counts") field(DTYP, "Soft Channel") field(INP, "BEND:LTUS:525: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, "BEND:LTUS:525:CALBYWF") { field(DESC, "mx + b") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "BEND:LTUS:525:CALBYSA") } # Used only for xygraph edm plot record(subArray, "BEND:LTUS:525:CALBYSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "BEND:LTUS:525:CALBYWF") field(MALM, "10") field(NELM, "6") field(INDX, "0") field(FTVL, "DOUBLE") } record(waveform, "BEND:LTUS:525:CALBIACTWF") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "BEND:LTUS:525:CALBIACTSA") } # Used only for xygraph edm plot record(subArray, "BEND:LTUS:525:CALBIACTSA") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(MALM, "10") field(NELM, "6") field(INP, "BEND:LTUS:525:CALBIACTWF") field(INDX, "0") field(FTVL, "DOUBLE") field(FLNK, "BEND:LTUS:525:CALBLIMITS") } # Check that measured current during calibration is within # tolerance. record(aSub, "BEND:LTUS:525: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, "BEND:LTUS:525:CALBSTEPNUM") field(INPB, "BEND:LTUS:525:CALBIACTWF") field(INPC, "BEND:LTUS:525: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, "BEND:LTUS:525: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, "BEND:LTUS:525:STDZITOL") field(INPH, "BEND:LTUS:525:DACSLOPE") field(INPI, "BEND:LTUS:525: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, "BEND:LTUS:525: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, "BEND:LTUS:525:CALBSTEPNUM") field(INPB, "BEND:LTUS:525:CALBIACTWF") field(INPC, "BEND:LTUS:525:DACWF") field(INPF, "BEND:LTUS:525: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 BEND:LTUS:525CALBOK 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, "BEND:LTUS:525:DEGAUSINIT") { field(DESC, "Proc. Degauss PVs on boot") field(PINI, "YES") field(DOL, "1") field(OUTA, "BEND:LTUS:525:DEGAUSIMIN.PROC PP") field(OUTB, "BEND:LTUS:525:DEGAUSIMAX.PROC PP") field(OUTC, "BEND:LTUS:525:DEGAUSTYPE.PROC PP") field(OUTD, "BEND:LTUS:525:DEGAUSSTEP.PROC PP") field(OUTE, "BEND:LTUS:525:MADNAME.PROC PP") field(OUTF, "BEND:LTUS:525:PSTYPE.PROC PP") field(OUTG, "BEND:LTUS:525: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, "BEND:LTUS:525:DEGAUSSUB") { field(DESC, "Degauss subroutine") field(INAM, "mgntDegaussInit") field(SNAM, "mgntDegauss") field(BRSV, "INVALID") field(INPA, "BEND:LTUS:525:DEGAUSIMIN NPP NMS") field(INPB, "BEND:LTUS:525:DEGAUSIMAX NPP NMS") field(INPC, "BEND:LTUS:525:DEGAUSTYPE.RVAL NPP NMS") field(INPE, "BEND:LTUS:525:DEGAUSMETHOD.RVAL NPP NMS") field(INPF, "BEND:LTUS:525:PSTYPE NPP NMS") field(INPG, "BEND:LTUS:525:DEBUG.RVAL NPP NMS") field(INPH, "BEND:LTUS:525: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, "BEND:LTUS:525:DEGAUSWF PP") field(OUTB, "BEND:LTUS:525:DEGAUSMSG PP") field(OUTC, "BEND:LTUS:525: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, "BEND:LTUS:525:DEGAUSWF") { field(DESC, "Degauss Setpts") field(NELM, "60") field(FTVL, "DOUBLE") } record(mbbo,"BEND:LTUS:525: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, "BEND:LTUS:525: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, "BEND:LTUS:525: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, "BEND:LTUS:525: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, "BEND:LTUS:525: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, "BEND:LTUS:525:DEGAUSIMIN") { field(DESC, "Min. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "10.0") field(LOPR, "-10.0") field(DRVH, "10.0") field(DRVL, "-10.0") field(VAL, "-10.0") } record(ao, "BEND:LTUS:525:DEGAUSIMAX") { field(DESC, "Max. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "10.0") field(LOPR, "-10.0") field(DRVH, "10.0") field(DRVL, "-10.0") field(VAL, "10.0") } # 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,"BEND:LTUS:525: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, "BEND:LTUS:525: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,"BEND:LTUS:525: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, "BEND:LTUS:525: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, "BEND:LTUS:525: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, "BEND:LTUS:525: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, "BEND:LTUS:525:DEGAUSTOD") { field(DESC, "Successful Degauss Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "BEND:LTUS:525:DEGAUSLOSTTOD") { field(DESC, "Degauss Lost Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:525:DEGAUSTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "BEND:LTUS:525:DEGAUSTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "BEND:LTUS:525: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, "BEND:LTUS:525:DEGAUSGO") { field(DESC, "Set bdes of btrms to zero") field(ASG, "Internal") field(OUTA, "") field(OUTB, "") field(OUTC, "") field(OUTD, "") } # =========== CRYO ONLY =========== record(bo, "BEND:LTUS:525: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, "BEND:LTUS:525:DEGAUS_IMAX_CHECK") { field(DESC, "Check if imax shoud chg") field(CALC, "(C==4)&&(ABS(B)>ABS(A))?1:0") field(INPA, "BEND:LTUS:525:DEGAUS_IMAX") field(INPB, "BEND:LTUS:525:ISETPT") field(INPC, "BEND:LTUS:525:DEGAUSTYPE.RVAL") field(OUT, "BEND:LTUS:525:DEGAUS_IMAX_UPDATE.SELN") field(FLNK, "BEND:LTUS:525:DEGAUS_IMAX_UPDATE") } record(seq, "BEND:LTUS:525:DEGAUS_IMAX_UPDATE") { field(DESC, "Degauss IMAX Update") field(SELM, "Specified") field(DOL1, "BEND:LTUS:525:ISETPT") field(LNK1, "BEND:LTUS:525:DEGAUS_IMAX PP") } # Set the maximum current after a successful # degauss. This pv is updated by the # sequence. record(ao, "BEND:LTUS:525:DEGAUS_IMAX") { field(DESC, "Max I set afer a degauss") field(EGU, "Amps") field(PINI, "YES") field(PREC, "6") field(HOPR, "10.0") field(LOPR, "-10.0") field(DRVH, "10.0") field(DRVL, "-10.0") field(VAL, "10.0") field(FLNK, "BEND:LTUS:525:DEGAUS_IMAXPOL_CHECK") info(autosaveFields,"VAL,RVAL") } # Set the polarity if degauss_imax record(calcout, "BEND:LTUS:525:DEGAUS_IMAXPOL_CHECK") { field(DESC, "Determine polarity of imax") field(CALC, "A>=0?0:1") field(INPA, "BEND:LTUS:525:DEGAUS_IMAX") field(FLNK, "BEND:LTUS:525:DEGAUS_IMAXPOL") } record(bo, "BEND:LTUS:525:DEGAUS_IMAXPOL") { field(DESC, "Polarity of imax I") field(DTYP, "Raw Soft Channel") field(DOL, "BEND:LTUS:525:DEGAUS_IMAXPOL_CHECK") field(OMSL, "closed_loop") field(ZNAM, "Positive") field(ONAM, "Negative") field(FLNK, "BEND:LTUS:525: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, "BEND:LTUS:525:DEGAUS_ABSIMAX") { field(DESC, "Absolute Max. Degauss I") field(CALC, "ABS(A)") field(INPA, "BEND:LTUS:525:DEGAUS_IMAX") field(PREC, "6") field(EGU, "Amps") field(HOPR, "10.0") field(LOPR, "-10.0") info(autosaveFields,"VAL RVAL") } # IACT Polarity record(calcout, "BEND:LTUS:525:IACTPOL_CHECK") { field(DESC, "Determine IACT polarity") field(SCAN, "5 second") field(CALC, "ABS(A-B)>C?(A>=0?0:1):D") field(INPA, "BEND:LTUS:525:IACT") field(INPB, "BEND:LTUS:525:IACTPOL_CHECK.LA") field(INPC, "0.0001") field(INPD, "BEND:LTUS:525:IACTPOL_CHECK.PVAL") field(OOPT, "On Change") field(FLNK, "BEND:LTUS:525:IACTPOL") } record(bo, "BEND:LTUS:525: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,"BEND:LTUS:525: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, "BEND:LTUS:525:DEGAUSENABLE CP") field(INPB, "BEND:LTUS:525:DEGAUSOK") field(INPC, "BEND:LTUS:525:STATE CP") field(INPD, "BEND:LTUS:525:STATE.SEVR") field(OUT, "BEND:LTUS:525:DEGAUS_STATE_SEQ.SELN PP") field(ASG, "Internal") } record(seq, "BEND:LTUS:525:DEGAUS_STATE_SEQ") { field(DESC, "Degauss State Sequence") field(SELM, "Specified") field(SELL, "BEND:LTUS:525:DEGAUS_STATE_CHECK") field(LNK1, "BEND:LTUS:525:DEGAUS_STATE_DISABLE.PROC PP") field(LNK2, "BEND:LTUS:525:DEGAUS_STATE_LOST.PROC PP") field(LNK3, "BEND:LTUS:525:DEGAUS_STATE_GOOD.PROC PP") field(LNK4, "BEND:LTUS:525: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, "BEND:LTUS:525:DEGAUS_STATE_DISABLE") { field(DESC, "Degauss not used") field(LNK1, "BEND:LTUS:525:DEGAUSOK.ZSV") field(LNK2, "BEND:LTUS:525: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, "BEND:LTUS:525:STATMSG.FRSV") field(LNK4, "BEND:LTUS:525: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, "BEND:LTUS:525:DEGAUS_STATE_LOST") { field(DESC, "Degauss lost and ps On") field(DOL1, "1") field(LNK1, "BEND:LTUS:525:DEGAUSOK.ZSV") field(LNK2, "BEND:LTUS:525: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, "BEND:LTUS:525:STATMSG.FRSV") field(LNK4, "BEND:LTUS:525: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, "BEND:LTUS:525:DEGAUS_STATE_OFF") { field(DESC, "Degaused lost and ps Off") field(DOL1, "2") field(LNK1, "BEND:LTUS:525: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, "BEND:LTUS:525:STATMSG.FRSV") field(LNK3, "BEND:LTUS:525: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, "BEND:LTUS:525:DEGAUS_STATE_GOOD") { field(DESC, "Degauss good") field(DOL1, "1") field(LNK1, "BEND:LTUS:525: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, "BEND:LTUS:525:STATMSG.FRSV PP") field(LNK3, "BEND:LTUS:525:STATMSG.FVSV PP") field(LNK4, "") field(ASG, "Internal") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(mbbo, "BEND:LTUS:525:FUNC") { field(DESC, "BEND:LTUS:525 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, "1") field(THVL, "9") field(FRVL, "10") field(FVVL, "0") field(SXVL, "2") field(SVVL, "8") field(EIVL, "11") field(NIVL, "12") field(TEVL, "13") field(ELVL, "5") field(TVVL, "6") field(TTVL, "7") field(FTVL, "4") field(FFVL, "3") field(OUT, "BEND:LTUS:525:CTRL CA") } # :CTRL pv is processed at boot in the # sequence mgntCtrl.st Processed in sequence # record(mbbo, "BEND:LTUS:525:CTRL") { field(DESC, "BEND:LTUS:525 Control") field(PINI, "NO") field(ZRST, "Ready") field(ONST, "TRIM") field(TWST, "PERTURB") field(THST, "BCON_TO_BDES") field(FRST, "BACT_TO_BDES") field(FVST, "SAVE_BDES") field(SXST, "LOAD_BDES") field(SVST, "UNDO_BDES") field(EIST, "DAC_ZERO") field(NIST, "CALB") field(TEST, "STDZ") field(ELST, "RESET") field(TVST, "TURN_ON") field(TTST, "TURN_OFF") field(FTST, "") field(FFST, "") field(ZRVL, "0") field(ONVL, "2") field(TWVL, "6") field(THVL, "15") field(FRVL, "14") field(FVVL, "11") field(SXVL, "12") field(SVVL, "13") field(EIVL, "7") field(NIVL, "3") field(TEVL, "4") field(ELVL, "8") field(TVVL, "9") field(TTVL, "10") field(FTVL, "0") field(FFVL, "0") field(OUT, "BEND:LTUS:525:SELECTEN.A PP") field(SDIS, "0") } # If a function has been selected set this unit to busy record(calcout, "BEND:LTUS:525:SELECTEN") { field(DESC, "Control Select Enable") field(CALC, "A>0?1:A") field(FLNK, "BEND:LTUS:525:BUSY") } # Set to FREE on IOC reboot record(bo, "BEND:LTUS:525:BUSY") { field(DESC, "BEND:LTUS:525 Ctrl Done") field(DOL, "BEND:LTUS:525:SELECTEN") field(ZNAM, "FREE") field(ONAM, "BUSY") field(PINI, "YES") field(FLNK, "BEND:LTUS:525:SELECT") } record(bo, "BEND:LTUS:525:SELECT") { field(ZNAM, "NO") field(ONAM, "YES") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") } record(bo, "BEND:LTUS:525: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, "BEND:LTUS:525:CTRLSTATE") { field(DESC, "BEND:LTUS:525 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("BEND:LTUS:525:CTRL",20,20,0,0,"BEND:LTUS:525:CTRL") #! Field("BEND:LTUS:525:CTRL.OUT",16777215,1,"BEND:LTUS:525:CTRL.OUT") #! Link("BEND:LTUS:525:CTRL.OUT","BEND:LTUS:525:SELECTEN.A") #! Field("BEND:LTUS:525:CTRL.VAL",16777215,1,"BEND:LTUS:525:CTRL.VAL") #! Record("BEND:LTUS:525:SELECTEN",321,381,0,0,"BEND:LTUS:525:SELECTEN") #! Field("BEND:LTUS:525:SELECTEN.A",16777215,0,"BEND:LTUS:525:SELECTEN.A") #! Field("BEND:LTUS:525:SELECTEN.FLNK",16777215,1,"BEND:LTUS:525:SELECTEN.FLNK") #! Link("BEND:LTUS:525:SELECTEN.FLNK","BEND:LTUS:525:BUSY") #! Field("BEND:LTUS:525:SELECTEN.VAL",16777215,1,"BEND:LTUS:525:SELECTEN.VAL") #! Record("BEND:LTUS:525:BUSY",623,274,0,0,"BEND:LTUS:525:BUSY") #! Field("BEND:LTUS:525:BUSY.DOL",16777215,0,"BEND:LTUS:525:BUSY.DOL") #! Link("BEND:LTUS:525:BUSY.DOL","BEND:LTUS:525:SELECTEN.VAL") #! Field("BEND:LTUS:525:BUSY.FLNK",16777215,1,"BEND:LTUS:525:BUSY.FLNK") #! Link("BEND:LTUS:525:BUSY.FLNK","BEND:LTUS:525:SELECT") #! Record("BEND:LTUS:525:SELECT",669,508,0,1,"BEND:LTUS:525:SELECT") #! Record("BEND:LTUS:525:FUNC",940,120,0,0,"BEND:LTUS:525:FUNC") #! Field("BEND:LTUS:525:FUNC.OUT",16777215,0,"BEND:LTUS:525:FUNC.OUT") #! Link("BEND:LTUS:525:FUNC.OUT","BEND:LTUS:525:CTRL.VAL") #! Record("BEND:LTUS:525:ABORT",193,41,0,0,"BEND:LTUS:525:ABORT") #! Record("BEND:LTUS:525:CTRLSTATE",369,34,0,0,"BEND:LTUS:525: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,"BEND:LTUS:525:SELECT is used for Multi-device selection.\nIt is enabled when associated BEND:LTUS:525:CTRL is \"0\" (DONE).\nIt is disabled when associated BEND:LTUS:525: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,"BEND:LTUS:525: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, "BEND:LTUS:525:BCTRL_INIT") { field(DESC, "Process BCTRL on boot") field(PINI, "YES") field(CALC, "A=3?1:0") field(INPA, "BEND:LTUS:525:BCTRL.SEVR") field(OUT, "BEND:LTUS:525: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, "BEND:LTUS:525:BACT") { field(DESC, "Actual B") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "BEND:LTUS:525:BACT") field(INPB, "BEND:LTUS:525:POLYCOEF") field(INPC, "BEND:LTUS:525:POLYCOEF.A") field(INPD, "BEND:LTUS:525:POLYCOEF.B") field(INPE, "BEND:LTUS:525:IACT MS") field(INPF, "BEND:LTUS:525:BDELTAS PP") field(INPG, "100") field(EGU, "GeV/c") field(HOPR, "19.6686") field(LOPR, "0.1154") field(HIHI, "19.6686") field(LOLO, "0.1154") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "19.6686") field(LOW, "0.1154") field(FLNK, "BEND:LTUS:525: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, "BEND:LTUS:525:BDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntPhyDeltas") field(EGU, "GeV/c") field(HOPR, "1") field(PREC, "7") field(BRSV, "INVALID") field(INPA, "BEND:LTUS:525:BDES") field(INPB, "BEND:LTUS:525:TRIMBTOL") field(INPC, "BEND:LTUS:525:TRIMBTOLR") field(INPD, "BEND:LTUS:525:CHCKBTOL") field(INPE, "BEND:LTUS:525:CHCKBTOLR") field(F, "2.0") field(INPG, "30") field(INPH, "BEND:LTUS:525:BACT.VAL") # # MPS absolute and relative tolerances field(INPP, "BEND:LTUS:525:MPSBTOL") field(INPQ, "BEND:LTUS:525:MPSBTOLR") field(FLNK, "BEND:LTUS:525:BCONLIMITS") info(autosaveFields,"F") } # This record is processed by BDELTAS record(aSub, "BEND:LTUS:525:BCONLIMITS") { field(DESC, "Config B-field Limits") field(INAM, "mgntInit") field(SNAM, "mgntBCONLimits") field(INPA, "BEND:LTUS:525:BDES") field(INPB, "BEND:LTUS:525:BDELTAS.I") field(INPG, "BEND:LTUS:525:DEBUG.RVAL") field(FTA, "DOUBLE") field(FTB, "DOUBLE") field(FTG, "ULONG") field(OUTA, "BEND:LTUS:525:BCON.HIGH") field(OUTB, "BEND:LTUS:525:BCON.LOW") field(OUTC, "BEND:LTUS:525:BCON.HIHI") field(OUTD, "BEND:LTUS:525:BCON.LOLO PP") field(FTVA, "DOUBLE") field(FTVB, "DOUBLE") field(FTVC, "DOUBLE") field(FTVD, "DOUBLE") field(BRSV, "INVALID") field(FLNK, "BEND:LTUS:525:IDELTAS") } # The following PV is processed by :BACT # which is processed by :BACT # record(fanout, "BEND:LTUS:525:BACTFO") { field(DESC, "BACT processing") field(SELM, "All") field(LNK1, "BEND:LTUS:525:BDIFF") field(LNK2, "BEND:LTUS:525:BADIFF") field(LNK3, "BEND:LTUS:525:BRATIO") field(LNK4, "BEND:LTUS:525:MPSLIMITS") field(LNK5, "BEND:LTUS:525:I2BSTATUS") field(LNK6, "BEND:LTUS:525:IACTFO.PROC") } record(calc, "BEND:LTUS:525:BDIFF") { field(DESC, "BDES-BACT") field(CALC, "A-B") field(INPA, "BEND:LTUS:525:BDES") field(INPB, "BEND:LTUS:525:BACT") field(EGU, "GeV/c") field(PREC, "7") } record(calc, "BEND:LTUS:525:BADIFF") { field(DESC, "Absolute BDES-BACT") field(INPA, "BEND:LTUS:525:BDIFF") field(EGU, "GeV/c") field(PREC, "7") field(CALC, "A<0?ABS(A):A") } record(calc, "BEND:LTUS:525:BRATIO") { field(DESC, "BACT Error") field(CALC, "B?A/B:0") field(INPA, "BEND:LTUS:525:BDIFF") field(INPB, "BEND:LTUS:525:BDES.HOPR") field(EGU, "GeV/c") field(PREC, "7") } record(mbbi, "BEND:LTUS:525: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, "BEND:LTUS:525:BACT.J") } # Note: for a string slave set the MONFL # macro to the following: # MONFL=:IMONCALC MS record(sub, "BEND:LTUS:525:BMON") { field(DESC, "Second Transductor") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "BEND:LTUS:525:BMON") field(INPB, "BEND:LTUS:525:POLYCOEF") field(INPC, "BEND:LTUS:525:POLYCOEF.A") field(INPD, "BEND:LTUS:525:POLYCOEF.B") field(INPE, "BEND:LTUS:525:IMON MS") field(INPF, "BEND:LTUS:525:BDELTAS.VAL") field(INPG, "100") field(EGU, "GeV/c") field(HOPR, "19.6686") field(LOPR, "0.1154") field(HIHI, "19.6686") field(LOLO, "0.1154") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "19.6686") field(LOW, "0.1154") } # 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=PSC:LTUS:MG05:BDES CP record(ao, "BEND:LTUS:525:BDES") { field(DESC, "Desired B-Field") field(PINI, "YES") field(DRVH, "19.6686") field(DRVL, "0.1154") field(HOPR, "19.6686") field(LOPR, "0.1154") field(PREC, "7") field(EGU, "GeV/c") field(MDEL, "-1") field(OMSL, "supervisory") # field(DOL, "") field(OUT, "BEND:LTUS:525:B2IDES PP") info(autosaveFields,"VAL") } record(sub, "BEND:LTUS:525:B2IDES") { field(DESC, "Convert Desired B-Field to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "BEND:LTUS:525:POLYCOEF") field(INPC, "BEND:LTUS:525:POLYCOEF.A") field(INPD, "BEND:LTUS:525:POLYCOEF.B") field(PREC, "7") field(EGU, "GeV/c") field(HOPR, "19.6686") field(LOPR, "0.1154") field(MDEL, "-1") field(INPE, "BEND:LTUS:525:BDES.DRVH") field(INPF, "BEND:LTUS:525:BDES.DRVL") field(BRSV, "INVALID") field(FLNK, "BEND:LTUS:525:IDES") } record(sub, "BEND:LTUS:525:BNOM") { field(DESC, "Nominal Field") field(PINI, "YES") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "BEND:LTUS:525:POLYCOEF") field(INPC, "BEND:LTUS:525:POLYCOEF.A") field(INPD, "BEND:LTUS:525:POLYCOEF.B") field(INPE, "BEND:LTUS:525:BDES.DRVH") field(INPF, "BEND:LTUS:525:BDES.DRVL") field(EGU, "GeV/c") field(HOPR, "19.6686") field(LOPR, "0.1154") field(PREC, "7") field(VAL, "0.0") field(FLNK, "BEND:LTUS:525:INOM") } record(sub, "BEND:LTUS:525:BACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "BEND:LTUS:525:BDES.VAL") field(INPB, "BEND:LTUS:525:BDES.DRVH") field(INPC, "BEND:LTUS:525:BDES.DRVL") field(INPD, "BEND:LTUS:525:BDELTAS.I") field(INPE, "BEND:LTUS:525:BDELTAS.J") field(INPG, "BEND:LTUS:525:STATE") field(INPH, "BEND:LTUS:525:HSTA") field(EGU, "GeV/c") field(HOPR, "19.6686") field(LOPR, "0.1154") field(PREC, "7") field(BRSV, "INVALID") } record(sub, "BEND:LTUS:525:BMONLIMITS") { field(DESC, "MON Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "BEND:LTUS:525:BDES.VAL") field(INPB, "BEND:LTUS:525:BDES.DRVH") field(INPC, "BEND:LTUS:525:BDES.DRVL") field(INPD, "BEND:LTUS:525:BDELTAS.K") field(INPE, "BEND:LTUS:525:BDELTAS.L") field(INPG, "BEND:LTUS:525:STATE") field(INPH, "BEND:LTUS:525:HSTA") field(EGU, "GeV/c") field(HOPR, "19.6686") field(LOPR, "0.1154") field(PREC, "7") field(BRSV, "INVALID") } record(seq, "BEND:LTUS:525:BLIMITS") { field(DESC, "ACT Limits") field(PREC, "7") field(DOL1, "BEND:LTUS:525:BLIMITS") field(LNK1, "BEND:LTUS:525:BACTLIMITS.F PP") field(DOL2, "BEND:LTUS:525:BACTLIMITS.I") field(LNK2, "BEND:LTUS:525:BACT.HIGH") field(DOL3, "BEND:LTUS:525:BACTLIMITS.J") field(LNK3, "BEND:LTUS:525:BACT.LOW") field(DOL4, "BEND:LTUS:525:BACTLIMITS.K") field(LNK4, "BEND:LTUS:525:BACT.HIHI") field(DOL5, "BEND:LTUS:525:BACTLIMITS.L") field(LNK5, "BEND:LTUS:525:BACT.LOLO") field(DOL6, "BEND:LTUS:525:BLIMITS") field(LNK6, "BEND:LTUS:525:BMONLIMITS.F PP") field(DOL7, "BEND:LTUS:525:BMONLIMITS.I") field(LNK7, "BEND:LTUS:525:BMON.HIGH") field(DOL8, "BEND:LTUS:525:BMONLIMITS.J") field(LNK8, "BEND:LTUS:525:BMON.LOW") field(DOL9, "BEND:LTUS:525:BMONLIMITS.K") field(LNK9, "BEND:LTUS:525:BMON.HIHI") field(DOLA, "BEND:LTUS:525:BMONLIMITS.L") field(LNKA, "BEND:LTUS:525:BMON.LOLO") field(FLNK, "BEND:LTUS:525:ILIMITS") field(SCAN, "5 second") } record(ao, "BEND:LTUS:525:BCTRL") { field(DESC, "B-Perturb") field(PREC, "7") field(EGU, "GeV/c") field(DRVH, "19.6686") field(DRVL, "0.1154") field(HOPR, "19.6686") field(LOPR, "0.1154") # 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, "BEND:LTUS:525: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, "BEND:LTUS:525:BCTRLGO") { field(DESC, "Update DES and perturb") field(PREC, "7") # Disable BACT limits field(DOL1, "1") field(LNK1, "BEND:LTUS:525:BLIMITS.VAL") # Update BDES with the BCTRL (slider) value field(DOL2, "BEND:LTUS:525:BCTRL.VAL") field(LNK2, "BEND:LTUS:525:BDES PP") field(DOL3, "1") field(LNK3, "BEND:LTUS:525:IDIRECT.PROC PP") field(DOL4, "1") field(LNK4, "BEND:LTUS:525:CHECKSTDZLOST.PROC PP") field(DOL5, "BEND:LTUS:525:BCTRL.VAL") field(LNK5, "BEND:LTUS:525:BCTRLSUB PP") # Re-enable BACT limits field(DOL6, "0") field(LNK6, "BEND:LTUS:525:BLIMITS.VAL") } # Convert B-field to Current and output to ISETPT record(sub, "BEND:LTUS:525:BCTRLSUB") { field(DESC, "Feedback") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "BEND:LTUS:525:POLYCOEF") field(INPC, "BEND:LTUS:525:POLYCOEF.A") field(INPD, "BEND:LTUS:525:POLYCOEF.B") field(INPE, "BEND:LTUS:525:BDES.DRVH") field(INPF, "BEND:LTUS:525:BDES.DRVL") field(PREC, "7") field(EGU, "GeV/c") field(HOPR, "19.6686") field(LOPR, "0.1154") field(MDEL, "-1") field(BRSV, "INVALID") field(FLNK, "BEND:LTUS:525:ISETPT") } record(ao, "BEND:LTUS:525:BDESPREVTRIM") { field(DESC, "trim bdes for undo") field(DTYP, "Soft Channel") field(DRVH, "19.6686") field(DRVL, "0.1154") field(EGU, "GeV/c") field(HOPR, "19.6686") field(LOPR, "0.1154") field(PREC, "7") field(PINI, "YES") info(autosaveFields,"VAL") } record(stringin, "BEND:LTUS:525:MADNAME") { field(DESC, "MAD deck nomenclature") field(PINI, "YES") field(VAL, "BY1B") } record(ai, "BEND:LTUS:525: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, "3370.429519") } record(ao, "BEND:LTUS:525:BMAX") { field(DESC, "Max B-Field") field(DTYP, "Soft Channel") field(DRVH, "19.6686") field(DRVL, "0.1154") field(EGU, "GeV/c") field(HOPR, "19.6686") field(LOPR, "0.1154") field(PREC, "7") field(PINI, "YES") field(VAL, "19.6686") field(FLNK, "BEND:LTUS:525:BSTEP") } record(ao, "BEND:LTUS:525:BMIN") { field(DESC, "Min B-Field") field(DTYP, "Soft Channel") field(DRVH, "19.6686") field(DRVL, "0.1154") field(EGU, "GeV/c") field(HOPR, "19.6686") field(LOPR, "0.1154") field(PREC, "7") field(PINI, "YES") field(VAL, "0.1154") field(FLNK, "BEND:LTUS:525:BSTEP") } record(ao, "BEND:LTUS:525:BDESSAVE") { field(DESC, "bdes for save/load") field(DTYP, "Soft Channel") field(DRVH, "19.6686") field(DRVL, "0.1154") field(EGU, "GeV/c") field(HOPR, "19.6686") field(LOPR, "0.1154") field(PINI, "YES") field(PREC, "7") } # This record is processed by BEND:LTUS:525: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, "BEND:LTUS:525:BCON") { field(DESC, "Config B-Field ") field(DTYP, "Soft Channel") field(PREC, "7") field(EGU, "GeV/c") field(HOPR, "19.6686") field(LOPR, "0.1154") field(DRVH, "19.6686") field(DRVL, "0.1154") # Set MINOR Alarm as the default, slaves will set NO_ALARM=0. field(HHSV, "MINOR") field(LLSV, "MINOR") field(HSV, "MINOR") field(LSV, "MINOR") # field(DOL , "") field(OMSL, "supervisory") field(OUT, "BEND:LTUS:525:B2ICON PP") info(autosaveFields,"VAL") } record(sub, "BEND:LTUS:525:B2ICON") { field(DESC, "Convert Desired ICon to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "BEND:LTUS:525:POLYCOEF") field(INPC, "BEND:LTUS:525:POLYCOEF.A") field(INPD, "BEND:LTUS:525:POLYCOEF.B") field(PREC, "7") field(EGU, "GeV/c") field(HOPR, "19.6686") field(LOPR, "0.1154") field(MDEL, "-1") field(INPE, "BEND:LTUS:525:BCON.DRVH") field(INPF, "BEND:LTUS:525:BCON.DRVL") field(BRSV, "INVALID") field(FLNK, "BEND:LTUS:525: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, "BEND:LTUS:525:BSTEP") { field(DESC, "B-Field step size") field(CALC, "(C==3)||(D==3)?0:ABS(A-B)*0.005") field(INPA, "BEND:LTUS:525:BMAX") field(INPB, "BEND:LTUS:525:BMIN") field(INPC, "BEND:LTUS:525:BMIN.SEVR") field(INPD, "BEND:LTUS:525:BMAX.SEVR") field(EGU, "GeV/c") 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,"BEND:LTUS:525:BCTRLDISABLECALC") { field(DESC, "Calc for disabling BCTRL") field(ASG, "Internal") field(CALC, "A?2:1") field(INPA, "BEND:LTUS:525:ONLINE CP") field(OUT, "BEND:LTUS:525:BCTRLDISABLEFOUT PP") } record(fanout, "BEND:LTUS:525:BCTRLDISABLEFOUT") { field(DESC, "Disable BCTRL fanout") field(SELM, "Specified") field(SELL, "BEND:LTUS:525:BCTRLDISABLECALC") field(LNK1, "BEND:LTUS:525:BCTRLDISABLE") field(LNK2, "BEND:LTUS:525:BCTRLENABLE") } record(stringout, "BEND:LTUS:525:BCTRLDISABLE") { field(DESC, "Disable BCTRL") field(DTYP, "Soft Channel") field(OUT, "BEND:LTUS:525:BCTRL.ASG") field(VAL, "NOWRITE") field(FLNK, "BEND:LTUS:525:BCTRLDISV_UPDATE") } record(stringout, "BEND:LTUS:525:BCTRLENABLE") { field(DESC, "Enable BCTRL") field(DTYP, "Soft Channel") field(OUT, "BEND:LTUS:525:BCTRL.ASG") field(VAL, "") field(FLNK, "BEND:LTUS:525:BCTRLDISV_UPDATE") } record(calcout, "BEND:LTUS:525:BCTRLDISV_UPDATE") { field(DESC, "Calc for updating BCTRL.DISV") field(ASG, "Internal") field(CALC, "A") field(INPA, "BEND:LTUS:525:ONLINE") field(OUT, "BEND:LTUS:525: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,"BEND:LTUS:525:BACT and MON\n are processed via links from \n BEND:LTUS:525:IACT (device raw value readback 1)\n and\n BEND:LTUS:525: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 BEND:LTUS:525:POLYCOEF\nC = First polynomial coefficient (offset if linear)\nD = Second polynomial coefficient (slope if linear)\nE = BEND:LTUS:525: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,"BEND:LTUS:525:BDES\n is processed when set by CA users or \n BEND:LTUS:525: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,"BEND:LTUS:525: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 BEND:LTUS:525: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 (BEND:LTUS:525: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,"BEND:LTUS:525:B*LIMITS and BEND:LTUS:525:BLIMITS:\n Calculate alarm and warning limits based on \n deltas from BEND:LTUS:525: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,"BEND:LTUS:525: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,"BEND:LTUS:525: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, "BEND:LTUS:525: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, "BEND:LTUS:525:MPSBTOL") { field(DESC, "Absolute mps tol") field(EGU, "GeV/c") field(PREC, "2") field(CALC, "ABS(A)*0.02") field(INPA, "BEND:LTUS:525:BMAX") field(PINI, "YES") } # # 21-Aug-2013: K. Luchini # Set channel access security so that users # cannot easily change values. record(ao, "BEND:LTUS:525:MPSBMAX") { field(DESC, "MPS Max B-field") field(EGU, "GeV/c") field(PREC, "7") field(DRVH, "19.6686") field(DRVL, "0.1154") field(PINI, "YES") field(VAL, "19.6686") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:525:MPSBMIN") { field(DESC, "MPS Min B-field") field(EGU, "GeV/c") field(PREC, "7") field(DRVH, "19.6686") field(DRVL, "0.1154") field(PINI, "YES") field(VAL, "0.1154") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:525:MPSBLLIM") { field(DESC, "MPS Low Limit B-field") field(EGU, "GeV/c") field(PREC, "7") field(DRVH, "19.6686") field(DRVL, "0.1154") field(PINI, "YES") field(VAL, "0.1154") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:525:MPSBLLIM2") { field(DESC, "MPS Low Limit #2 B-field") field(EGU, "GeV/c") field(PREC, "7") field(DRVH, "19.6686") field(DRVL, "0.1154") field(PINI, "YES") field(VAL, "0.1154") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } # Set the default to Std record(mbbo, "BEND:LTUS:525: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, "BEND:LTUS:525:MPSLIMITS.E PP") } record(aSub, "BEND:LTUS:525: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, "BEND:LTUS:525:MPS.RVAL") field(INPB, "BEND:LTUS:525:BADIFF") field(INPC, "BEND:LTUS:525:BDELTAS.N") field(INPD, "BEND:LTUS:525:BACT") field(INPE, "BEND:LTUS:525:MPSBITMASK.RVAL") field(INPF, "BEND:LTUS:525:MPSBLLIM") field(INPG, "BEND:LTUS:525:MPSBMIN") field(INPH, "BEND:LTUS:525:MPSBMAX") field(INPI, "BEND:LTUS:525: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, "BEND:LTUS:525:INTOL.RVAL PP") field(OUTB, "BEND:LTUS:525:INTOL_BMIN.RVAL PP") field(OUTC, "BEND:LTUS:525:INTOL_BRANGE.RVAL PP") field(OUTD, "BEND:LTUS:525: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, "BEND:LTUS:525:INTOL") { field(DESC, "BACT within MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "BEND:LTUS:525:MPSLIMITS.VALA") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "BEND:LTUS:525:INTOL_BMIN") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "BEND:LTUS:525:MPSLIMITS.VALB") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "BEND:LTUS:525:INTOL_BMIN2") { field(DESC, "MPS tol #2") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "BEND:LTUS:525:MPSLIMITS.VALD") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "BEND:LTUS:525:INTOL_BRANGE") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "BEND:LTUS:525: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, "BEND:LTUS:525:CHCKITOL") { field(DESC, "Absolute Check I Tolerance") field(EGU, "A") field(FLNK, "BEND:LTUS:525:TRIMITOL") field(CALC, "ABS(A*B)") field(INPA, "BEND:LTUS:525:CHCKBTOL") field(INPB, "BEND:LTUS:525:POLYCOEF.B") field(PREC, "9") } record(calc, "BEND:LTUS:525:TRIMBTOL") { field(EGU, "GeV/c") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(DESC, "Absolute Trim Tolerance") field(CALC, "ABS(A)/2") field(INPA, "BEND:LTUS:525:CHCKBTOL") field(FLNK, "BEND:LTUS:525:CHCKITOL") } record(calc, "BEND:LTUS:525:CHCKBTOL") { field(DESC, "Check absolute tolerance") field(EGU, "A") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(FLNK, "BEND:LTUS:525:TRIMBTOL") field(CALC, "MAX(ABS(A),ABS(C))*(B/1000000)") field(INPA, "BEND:LTUS:525:BDES.HOPR") field(INPB, "BEND:LTUS:525:STABILITY") field(INPC, "BEND:LTUS:525:BDES.LOPR") } record(longout, "BEND:LTUS:525: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, "BEND:LTUS:525:CHCKBTOL") } record(calc, "BEND:LTUS:525:TRIMITOL") { field(DESC, "Absolute Trim I Tolerance") field(EGU, "GeV/c") field(CALC, "ABS(A*B)") field(INPA, "BEND:LTUS:525:POLYCOEF.B") field(INPB, "BEND:LTUS:525:TRIMBTOL") field(PREC, "9") } record(ai, "BEND:LTUS:525:TRIMBTOLR") { field(DESC, "Relative trim tol") field(PREC, "4") field(EGU, "%") field(HOPR, "1.0") field(LOPR, "0.0") field(PINI, "YES") } record(ai, "BEND:LTUS:525: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, "BEND:LTUS:525:FBCKFCOM") { field(ZNAM, "CA") field(ONAM, "FCOM") field(DESC, "CA Mode") field(PINI, "YES") field(SDIS, "0") } record(bo, "BEND:LTUS:525:PAU") { field(ZNAM, "NotConfigured") field(ONAM, "Configured") field(DESC, "PAU Present") field(PINI, "YES") field(SDIS, "0") field(FLNK, "BEND:LTUS:525:PAUGO") } record(fanout, "BEND:LTUS:525:PAUGO") { field(DESC, "PAU control") field(LNK1, "BEND:LTUS:525:PAUSTOP") field(LNK2, "BEND:LTUS:525: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, "BEND:LTUS:525:PAUSTART") { field(DESC, "Setup for PAU On") field(SDIS, "BEND:LTUS:525: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, "BEND:LTUS:525:PAUSTOP") { field(DESC, "Setup for PAU Off") field(SDIS, "BEND:LTUS:525: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, "BEND:LTUS:525:MCORDEVNAME") { field(DESC, "PS device name") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, "PSC:LTUS:MG05:") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "BEND:LTUS:525: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, "BEND:LTUS:525:PSTYPE.RVAL") field(INPC, "BEND:LTUS:525:TURNEDOFF.RVAL") field(INPD, "BEND:LTUS:525:CONFIG.RVAL") field(INPE, "BEND:LTUS:525:PSCATEGORY.RVAL") field(INPF, "BEND:LTUS:525:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "BEND:LTUS:525:AUTOCTRL.RVAL") field(INPJ, "BEND:LTUS:525:OUTOFSERVICE.RVAL") field(INPL, "BEND:LTUS:525:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "BEND:LTUS:525:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "BEND:LTUS:525:PAU") field(INPP, "BEND:LTUS:525:CALBDISABLE.RVAL") field(INPQ, "BEND:LTUS:525:PTRBDISABLE.RVAL") field(INPR, "BEND:LTUS:525:TRIMDISABLE.RVAL") field(INPS, "BEND:LTUS:525:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "BEND:LTUS:525:FBCK") field(INPU, "BEND:LTUS:525:TRIMTYPE.RVAL") field(INPV, "BEND:LTUS:525:STDZDIRECT.RVAL") field(INPW, "BEND:LTUS:525:DEGAUSENABLE.RVAL") field(FLNK, "BEND:LTUS:525:HSTA") } record(longin, "BEND:LTUS:525:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "BEND:LTUS:525:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "BEND:LTUS:525: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, "BEND:LTUS:525: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, "BEND:LTUS:525:CALBDISABLE") { field(DESC, "DAC Calb Disabled") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "BEND:LTUS:525:PTRBDISABLE") { field(DESC, "Perturb Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "BEND:LTUS:525:TRIMDISABLE") { field(DESC, "Trim Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "BEND:LTUS:525: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 BEND:LTUS:525:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses BEND:LTUS:525:FBCK. # This PV should be replaced by BEND:LTUS:525: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, "BEND:LTUS:525: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, "BEND:LTUS:525: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, "BEND:LTUS:525: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, "") field(OMSL, "supervisory") field(FLNK, "BEND:LTUS:525:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"BEND:LTUS:525:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "BEND:LTUS:525:OUTOFSERVICE NPP NMS") field(OUT, "BEND:LTUS:525:ONLINE PP") } record(bo, "BEND:LTUS:525:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "BEND:LTUS:525: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, "1") } record(bo, "BEND:LTUS:525: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, "1") } record(bo, "BEND:LTUS:525: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, "BEND:LTUS:525: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, "BEND:LTUS:525: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, "BEND:LTUS:525: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, "BEND:LTUS:525: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, "BEND:LTUS:525: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, "1") field(ASG, "NOWRITE") } record(mbbo, "BEND:LTUS:525: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, "1") field(ASG, "NOWRITE") } record(mbbo, "BEND:LTUS:525: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, "2") field(ASG, "NOWRITE") } record(mbbo, "BEND:LTUS:525: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, "0") field(ASG, "NOWRITE") field(FLNK, "BEND:LTUS:525:TRIMTYPE") } record(stringout, "BEND:LTUS:525:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "BEND:LTUS:525:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "BEND:LTUS:525:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "BEND:LTUS:525:STATE.RVAL") field(INPB, "BEND:LTUS:525:INTLKSUMY.RVAL") field(OUT, "BEND:LTUS:525:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "BEND:LTUS:525: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, "BEND:LTUS:525:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "BEND:LTUS:525:STATE.RVAL") field(INPB, "BEND:LTUS:525:INTLKSUMY.RVAL") field(OUT, "BEND:LTUS:525:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "BEND:LTUS:525:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "BEND:LTUS:525:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "BEND:LTUS:525: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, "BEND:LTUS:525:RAMPSTARTDLY") { field(DESC, "Tansition to ramp delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "2") } ######### For PSTYPE=2 Only ############# record(mbbo, "BEND:LTUS:525: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, "BEND:LTUS:525: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,"BEND:LTUS:525: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("BEND:LTUS:525:TURNEDOFF",3140,1907,0,1,"BEND:LTUS:525:TURNEDOFF") #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "BEND:LTUS:525:STATSUB") { field(DESC, "Build STATus ") field(INAM, "mgntInit") field(SNAM, "mgntSlcStat") field(INPA, "BEND:LTUS:525:BACT.STAT") field(INPB, "BEND:LTUS:525:BDES.STAT") field(INPC, "BEND:LTUS:525:IRIPL.STAT") field(INPD, "PSC:LTUS:MG05:ISETPT.STAT") field(INPE, "PSC:LTUS:MG05:IACT.STAT") # 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, "BEND:LTUS:525:BACT.SEVR") field(INPH, "BEND:LTUS:525:BDES.SEVR") field(INPI, "BEND:LTUS:525:IRIPL.SEVR") field(INPJ, "PSC:LTUS:MG05:ISETPT.SEVR") field(INPK, "PSC:LTUS:MG05:IACT.SEVR") # # 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, "BEND:LTUS:525:STATE.RVAL") field(INPN, "BEND:LTUS:525:STDZOK") field(INPO, "BEND:LTUS:525:CALBOK") field(INPP, "BEND:LTUS:525:OUTOFSERVICE.RVAL") field(INPQ, "BEND:LTUS:525:CONFIG.RVAL") field(INPR, "BEND:LTUS:525:HSTA") field(INPS, "BEND:LTUS:525:CTRL.RVAL") field(INPT, "BEND:LTUS:525:DEGAUSOK") field(INPV, "BEND:LTUS:525: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, "BEND:LTUS:525:STAT") } record(longout, "BEND:LTUS:525:STAT") { field(DESC, "STAT sent to SLC") field(SCAN, "Passive") field(FLNK, "BEND:LTUS:525:STATCTRLSUB") field(DOL, "BEND:LTUS:525:STATSUB.VAL") field(OMSL, "closed_loop") } record(sSub, "BEND:LTUS:525:STATCTRLSUB") { field(DESC, "Decode SLC STAT into mbbo") field(INAM, "mgntInit") field(SNAM, "mgntStatDecode") field(INPA, "BEND:LTUS:525:STAT") field(INPB, "BEND:LTUS:525:HSTA") field(INPD, "BEND:LTUS:525:ONOFFCTRL.RVAL") field(FLNK, "BEND:LTUS:525:STATMSG") } record(mbbo, "BEND:LTUS:525: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, "BEND:LTUS:525:UNAVAILGO") field(DOL, "BEND:LTUS:525:STATCTRLSUB.W") } record(seq, "BEND:LTUS:525:UNAVAILGO") { field(DESC, "Process UNAVAIL") field(DOL1, "BEND:LTUS:525:STATSUB.U") field(LNK1, "BEND:LTUS:525:UNAVAIL PP") } record(stringout, "BEND:LTUS:525:SNLSTATMSG") { field(DTYP, "Soft Channel") } #! TextBox(TB0,820,1000,1200,1220,0,"Dialog",12,1,16777215,"BEND:LTUS:525:STATUSSUB - future\nOverall device status - takes input from action snls, record sevrs, master snl(s) and outputs final status\n\nInputs:\nA - BEND:LTUS:525:CTRLSTATUS - snl status\nB - MGNT:CTRLSTATUS - master list status\nC\nD - BEND:LTUS:525: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,"BEND:LTUS:525STATSUB\nformat control bo's into slc STAT\n\nInputs:\nA - BEND:LTUS:525:STATUS\nC - BEND:LTUS:525:ON\nD - BEND:LTUS:525:STDZOK\nE - BEND:LTUS:525:CALBOK\nF - BEND:LTUS:525:BACTDRIFT (future)\nG -\nH- BEND:LTUS:525:DACSTATUS\nI -BEND:LTUS:525:ADCSTATUS\nJ - BEND:LTUS:525:BACTSTATUS\nK - BEND:LTUS:525:BDESSTATUS\nL - BEND:LTUS:525:RIPLSTATUS\n\nOutput:\nP - BEND:LTUS:525: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, "BEND:LTUS:525: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, "BEND:LTUS:525: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, "BEND:LTUS:525: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, "BEND:LTUS:525: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.6 #! DBDSTART #! DBD("../../../../dbd/mgntSoft.dbd") #! DBDEND record(stringout, "BEND:LTUS:525:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:525:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "BEND:LTUS:525:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "BEND:LTUS:525:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "BEND:LTUS:525:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "BEND:LTUS:525:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "1") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "BEND:LTUS:525: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, "BEND:LTUS:525:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "BEND:LTUS:525:TRIMTYPE.RVAL") field(INPB, "BEND:LTUS:525:CONFIG.RVAL") field(OUT, "BEND:LTUS:525:TRIMMAXNUM PP") } record(longout, "BEND:LTUS:525: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, "BEND:LTUS:525: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, "") field(OMSL, "supervisory") field(VAL, "5") field(OUT, "BEND:LTUS:525:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "BEND:LTUS:525: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, "") field(OMSL, "supervisory") field(VAL, "10") } record(bo, "BEND:LTUS:525: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, "BEND:LTUS:525: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, "BEND:LTUS:525: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, "BEND:LTUS:525:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "0") } record(ao, "BEND:LTUS:525: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, "BEND:LTUS:525:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "BEND:LTUS:525: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, "BEND:LTUS:525: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, "BEND:LTUS:525:IMOVE") field(INPB, "BEND:LTUS:525:IACT") field(INPC, "BEND:LTUS:525:IRAMPRATE") field(INPD, "1.577") field(INPE, "BEND:LTUS:525:TRIMDLYPCT") field(INPF, "BEND:LTUS:525:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "BEND:LTUS:525:RAMPTIME_LEFT PP") } record(longout, "BEND:LTUS:525:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "BEND:LTUS:525:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "BEND:LTUS:525:RAMPDONE_CALC") } record(calc, "BEND:LTUS:525:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "BEND:LTUS:525:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "BEND:LTUS:525:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "BEND:LTUS:525: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, "BEND:LTUS:525:RAMPTIME_LEFT") field(OUT, "BEND:LTUS:525:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "BEND:LTUS:525:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "BEND:LTUS:525:RAMPTIME_LEFT NMS") field(OUT, "BEND:LTUS:525:RAMPDONE PP") } record(bo, "BEND:LTUS:525:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "BEND:LTUS:525:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "BEND:LTUS:525: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, "BEND:LTUS:525: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(sSub, "BEND:LTUS:525: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, "BEND:LTUS:525:PSTYPE.RVAL") field(INPC, "BEND:LTUS:525:TURNEDOFF.RVAL") field(INPD, "BEND:LTUS:525:CONFIG.RVAL") field(INPE, "BEND:LTUS:525:PSCATEGORY.RVAL") field(INPF, "BEND:LTUS:525:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "BEND:LTUS:525:AUTOCTRL.RVAL") field(INPJ, "BEND:LTUS:525:OUTOFSERVICE.RVAL") field(INPL, "BEND:LTUS:525:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "BEND:LTUS:525:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "BEND:LTUS:525:PAU") field(INPP, "BEND:LTUS:525:CALBDISABLE.RVAL") field(INPQ, "BEND:LTUS:525:PTRBDISABLE.RVAL") field(INPR, "BEND:LTUS:525:TRIMDISABLE.RVAL") field(INPS, "BEND:LTUS:525:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "BEND:LTUS:525:FBCK") field(INPU, "BEND:LTUS:525:TRIMTYPE.RVAL") field(INPV, "BEND:LTUS:525:STDZDIRECT.RVAL") field(INPW, "BEND:LTUS:525:DEGAUSENABLE.RVAL") field(FLNK, "BEND:LTUS:525:HSTA") } record(longin, "BEND:LTUS:525:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "BEND:LTUS:525:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "BEND:LTUS:525: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, "BEND:LTUS:525: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, "BEND:LTUS:525:CALBDISABLE") { field(DESC, "DAC Calb Disabled") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "BEND:LTUS:525:PTRBDISABLE") { field(DESC, "Perturb Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "BEND:LTUS:525:TRIMDISABLE") { field(DESC, "Trim Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "BEND:LTUS:525:STDZDISABLE") { field(DTYP, "Raw Soft Channel") field(ZNAM, "NO") field(ONAM, "YES") field(DESC, "Standardize Function") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } # This PV has been replaced by BEND:LTUS:525:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses BEND:LTUS:525:FBCK. # This PV should be replaced by BEND:LTUS:525: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, "BEND:LTUS:525: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, "BEND:LTUS:525: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, "BEND:LTUS:525: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, "") field(OMSL, "supervisory") field(FLNK, "BEND:LTUS:525:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"BEND:LTUS:525:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "BEND:LTUS:525:OUTOFSERVICE NPP NMS") field(OUT, "BEND:LTUS:525:ONLINE PP") } record(bo, "BEND:LTUS:525:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "BEND:LTUS:525: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, "1") } record(bo, "BEND:LTUS:525: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, "1") } record(bo, "BEND:LTUS:525: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, "BEND:LTUS:525: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, "BEND:LTUS:525: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, "BEND:LTUS:525: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, "BEND:LTUS:525: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, "BEND:LTUS:525: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, "1") field(ASG, "NOWRITE") } record(mbbo, "BEND:LTUS:525: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, "1") field(ASG, "NOWRITE") } record(mbbo, "BEND:LTUS:525: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, "2") field(ASG, "NOWRITE") } record(mbbo, "BEND:LTUS:525: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, "2") field(ASG, "NOWRITE") field(FLNK, "BEND:LTUS:525:TRIMTYPE") } record(stringout, "BEND:LTUS:525:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "BEND:LTUS:525:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "BEND:LTUS:525:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "BEND:LTUS:525:STATE.RVAL") field(INPB, "BEND:LTUS:525:INTLKSUMY.RVAL") field(OUT, "BEND:LTUS:525:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "BEND:LTUS:525: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, "BEND:LTUS:525:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "BEND:LTUS:525:STATE.RVAL") field(INPB, "BEND:LTUS:525:INTLKSUMY.RVAL") field(OUT, "BEND:LTUS:525:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "BEND:LTUS:525:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "BEND:LTUS:525:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "BEND:LTUS:525: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, "BEND:LTUS:525:RAMPSTARTDLY") { field(DESC, "Tansition to ramp delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "2") } ######### For PSTYPE=2 Only ############# record(mbbo, "BEND:LTUS:525: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, "BEND:LTUS:525: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,"BEND:LTUS:525: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("BEND:LTUS:525:TURNEDOFF",3140,1907,0,1,"BEND:LTUS:525:TURNEDOFF") #! 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, "BEND:LTUS:764:IACT") { field(DESC, "Current") field(INP, "PSC:LTUS:MG22:IACT") field(EGU, "A") field(HOPR, "17.5") field(LOPR, "-17.5") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "BEND:LTUS:764:BACT") info(autosaveFields,"HYST") } record(bi, "BEND:LTUS:764:STATE") { field(DESC, "PS On/Off Status") field(DTYP, "Raw Soft Channel") field(INP, "PSC:LTUS:MG22:STATE NPP MS") field(ZSV, "MAJOR") field(ZNAM, "OFF") field(ONAM, "ON") } record(ao, "BEND:LTUS:764:IDES") { field(DESC, "Desired Current") field(PREC, "3") field(EGU, "A") field(HOPR, "17.5") field(LOPR, "-17.5") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(MDEL, "-1") field(HIHI, "17.5") field(LOLO, "-17.5") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "BEND:LTUS:764:BDELTAS") field(DRVH, "17.5") field(DRVL, "-17.5") field(DOL, "BEND:LTUS:764: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, "BEND:LTUS:764:ICTRL PP") } # This record is processed by BEND:LTUS:764:ICON") # Note: we are not setting alarms here. record(ao, "BEND:LTUS:764:ICON") { field(DESC, "Config I") field(DTYP, "Soft Channel") field(PREC, "3") field(HOPR, "17.5") field(LOPR, "-17.5") field(DRVH, "17.5") field(DRVL, "-17.5") field(DOL, "BEND:LTUS:764:B2ICON.K") field(OMSL, "closed_loop") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:764:INOM") { field(DESC, "Nominal Current") field(DOL, "BEND:LTUS:764:BNOM.K") field(OMSL, "closed_loop") field(PREC, "3") field(EGU, "A") field(DRVH, "17.5") field(DRVL, "-17.5") field(HOPR, "17.5") field(LOPR, "-17.5") } record(ao, "BEND:LTUS:764:ICTRL") { field(DESC, "Set Current") field(PREC, "3") field(EGU, "A") field(HOPR, "17.5") field(LOPR, "-17.5") field(DRVH, "17.5") field(DRVL, "-17.5") field(MDEL, "-1") field(FLNK, "BEND:LTUS:764:ICTRLGO") field(OMSL, "supervisory") info(autosavefields,"VAL") } record(seq, "BEND:LTUS:764:ICTRLGO") { field(DESC, "Process Current Setpoint") field(PREC, "3") # Set ISETPT to supervisory field(DOL1, "0") field(LNK1, "BEND:LTUS:764:ISETPT.OMSL") field(DOL2, "BEND:LTUS:764:ICTRL") field(LNK2, "BEND:LTUS:764:ISETPT PP") # Set ISETPT to closed loop - get data from BCTRLSUB.K field(DOL3, "1") field(LNK3, "BEND:LTUS:764:ISETPT.OMSL") } record(ao, "BEND:LTUS:764:IMAX") { field(DESC, "Max I") field(DTYP, "Soft Channel") field(DRVH, "17.5") field(DRVL, "-17.5") field(EGU, "A") field(HOPR, "17.5") field(LOPR, "-17.5") field(PREC, "3") field(PINI, "YES") field(VAL, "17.5") field(FLNK, "BEND:LTUS:764:IMIN") } record(ao, "BEND:LTUS:764:IMIN") { field(DESC, "Min I") field(DTYP, "Soft Channel") field(DRVH, "17.5") field(DRVL, "-17.5") field(EGU, "A") field(HOPR, "17.5") field(LOPR, "-17.5") field(PREC, "3") field(VAL, "-17.5") field(FLNK, "BEND:LTUS:764:IRANGE") } record(sel, "BEND:LTUS:764:IACTPREVOK") { field(DESC, "Last Good Current") field(EGU, "A") field(HOPR, "17.5") field(LOPR, "-17.5") field(PREC, "3") field(NVL, "BEND:LTUS:764:BACT.SEVR") field(INPA, "BEND:LTUS:764:IACT NPP MS") field(INPB, "BEND:LTUS:764:IACTPREVOK NPP MS") field(INPC, "BEND:LTUS:764:IACTPREVOK NPP MS") field(INPD, "BEND:LTUS:764:IACTPREVOK NPP MS") } record(sub, "BEND:LTUS:764:IACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "BEND:LTUS:764:IDES") field(INPB, "BEND:LTUS:764:ISETPT.DRVH") field(INPC, "BEND:LTUS:764:ISETPT.DRVL") field(INPD, "BEND:LTUS:764:IDELTAS.I") field(INPE, "BEND:LTUS:764:IDELTAS.J") field(INPG, "BEND:LTUS:764:STATE") field(INPH, "BEND:LTUS:764:HSTA") field(EGU, "A") field(HOPR, "17.5") field(LOPR, "-17.5") field(PREC, "3") field(BRSV, "INVALID") } record(sub, "BEND:LTUS:764:IMONLIMITS") { field(DESC, "Aux Current Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "BEND:LTUS:764:IDES") field(INPB, "BEND:LTUS:764:ISETPT.DRVH") field(INPC, "BEND:LTUS:764:ISETPT.DRVL") field(INPD, "BEND:LTUS:764:IDELTAS.K") field(INPE, "BEND:LTUS:764:IDELTAS.L") field(INPG, "BEND:LTUS:764:STATE") field(INPH, "BEND:LTUS:764:HSTA") field(EGU, "A") field(HOPR, "17.5") field(LOPR, "-17.5") field(PREC, "3") field(BRSV, "INVALID") } record(seq, "BEND:LTUS:764:ILIMITS") { field(DESC, "Set ACT and MON Limits") field(PREC, "3") field(DOL1, "BEND:LTUS:764:BLIMITS") field(LNK1, "BEND:LTUS:764:IACTLIMITS.F PP") field(DOL2, "BEND:LTUS:764:IACTLIMITS.I") field(LNK2, "BEND:LTUS:764:IACT.HIGH") field(DOL3, "BEND:LTUS:764:IACTLIMITS.J") field(LNK3, "BEND:LTUS:764:IACT.LOW") field(DOL4, "BEND:LTUS:764:IACTLIMITS.K") field(LNK4, "BEND:LTUS:764:IACT.HIHI") field(DOL5, "BEND:LTUS:764:IACTLIMITS.L") field(LNK5, "BEND:LTUS:764:IACT.LOLO") field(DOL6, "BEND:LTUS:764:BLIMITS") field(LNK6, "BEND:LTUS:764:IMONLIMITS.F PP") field(DOL7, "BEND:LTUS:764:IMONLIMITS.I") field(LNK7, "BEND:LTUS:764:IMON.HIGH") field(DOL8, "BEND:LTUS:764:IMONLIMITS.J") field(LNK8, "BEND:LTUS:764:IMON.LOW") field(DOL9, "BEND:LTUS:764:IMONLIMITS.K") field(LNK9, "BEND:LTUS:764:IMON.HIHI") field(DOLA, "BEND:LTUS:764:IMONLIMITS.L") field(LNKA, "BEND:LTUS:764: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, "BEND:LTUS:764:IDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntRawDeltas") field(INPD, "BEND:LTUS:764:TRIMBTOL") field(INPE, "BEND:LTUS:764:CHCKBTOL") field(INPF, "BEND:LTUS:764:BDELTAS.K") field(INPG, "BEND:LTUS:764:BDELTAS.L") field(INPH, "BEND:LTUS:764: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, "BEND:LTUS:764:STDZITOLR") field(INPC, "BEND:LTUS:764:STDZITOL") field(FLNK, "") } # All ps controllers with on/off control will set the macro ONOF # as follows: # # ONOF = PSC:LTUS:MG22: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, "BEND:LTUS:764:STATESETPT") { field(DESC, "PS On/Off") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFF") field(ONAM, "ON") field(OUT, "PSC:LTUS:MG22:STATESETPT PP") 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 = PSC:LTUS:MG22:RESET PP # record(bo, "BEND:LTUS:764:RESET") { field(DESC, "Interlock Latch Reset") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFF") field(ONAM, "ON") field(HIGH, "1.0") field(OUT, "PSC:LTUS:MG22:RESET PP") } record(bo, "BEND:LTUS:764:RAMPSTATE") { field(DESC, "PS Ramp Status") field(DTYP, "Soft Channel") field(DOL, "PSC:LTUS:MG22:RAMPSTATE NPP 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, "BEND:LTUS:764: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, "BEND:LTUS:764:TRIMRAMPRATE") field(OUT, "PSC:LTUS:MG22:IRAMPRATE PP") field(FLNK, "BEND:LTUS:764:STDZDLY") } record(ao, "BEND:LTUS:764:ISETPT") { field(DESC, "Current Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(EGU, "A") field(HOPR, "17.5") field(LOPR, "-17.5") field(DRVH, "17.5") field(DRVL, "-17.5") field(MDEL, "-1") field(OUT, "PSC:LTUS:MG22:ISETPT PP") field(DOL, "BEND:LTUS:764: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, "BEND:LTUS:764:IMON") { field(DESC, "Aux Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(INP, "PSC:LTUS:MG22:IMON") field(EGU, "A") field(HOPR, "17.5") field(LOPR, "-17.5") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "BEND:LTUS:764:BMON") } record(ao, "BEND:LTUS:764:IRIPL") { field(DESC, "Ripple Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(DOL, "PSC:LTUS:MG22:IRIPL NPP NMS") field(OMSL, "closed_loop") field(EGU, "A") field(DRVH, "1.0") field(HOPR, "1.0") field(PREC, "3") field(FLNK, "BEND:LTUS:764:IRIPLOK") } record(sub, "BEND:LTUS:764:IRIPLOK") { field(DESC, "Ripple Current Status") field(INAM, "mgntInit") field(SNAM, "mgntRiplOK") field(INPA, "BEND:LTUS:764:IRIPL.VAL") field(INPB, "BEND:LTUS:764: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, "BEND:LTUS:764:R") { field(DESC, "Resistance") field(EGU, "Ohms") field(PREC, "4") field(PINI, "YES") field(DOL, "PSC:LTUS:MG22:R NPP MS") 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, "BEND:LTUS:764:IGND") { field(DESC, "Ground Current") field(EGU, "A") field(PREC, "6") field(PINI, "YES") field(DOL, "PSC:LTUS:MG22:IGND NPP MS") field(OMSL, "closed_loop") } record(bi, "BEND:LTUS:764:INTLKSUMY") { field(DESC, "Interlock Summary") field(INP, "PSC:LTUS:MG22:INTLKSUMY NPP MS") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(ZNAM, "OK") field(ONAM, "FAULT") field(PINI, "NO") } record(mbbo, "BEND:LTUS:764: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, "PSC:LTUS:MG22:COOLING") field(OMSL, "closed_loop") } # The following PV is processed by :BACTFO # which is processed by :BACT record(fanout, "BEND:LTUS:764:IACTFO") { field(DESC, "IACT processing") field(SELM, "All") field(LNK1, "BEND:LTUS:764:IACTPREVOK") field(LNK2, "BEND:LTUS:764:IDIFF") field(LNK3, "BEND:LTUS:764:IADIFF") field(LNK4, "BEND:LTUS:764:IRATIO") field(LNK5, "BEND:LTUS:764:IDIRECT") field(LNK6, "BEND:LTUS:764:IACTPOL_CHECK") } record(calc, "BEND:LTUS:764:IDIFF") { field(DESC, "IDES-IACT") field(CALC, "A-B") field(INPA, "BEND:LTUS:764:IDES") field(INPB, "BEND:LTUS:764:IACT") field(EGU, "A") field(PREC, "9") field(HOPR, "17.5") field(LOPR, "-17.5") } record(calc, "BEND:LTUS:764:IADIFF") { field(DESC, "Absolute IDES-IACT") field(CALC, "A<0?ABS(A):A") field(INPA, "BEND:LTUS:764:IDIFF") field(PREC, "9") } record(calc, "BEND:LTUS:764:IRATIO") { field(DESC, "IDES-IACT/IMAX") field(CALC, "B?A/B:0") field(INPA, "BEND:LTUS:764:IDIFF") field(INPB, "BEND:LTUS:764:IDES.DRVH") field(PREC, "9") } record(calcout, "BEND:LTUS:764:IRANGE") { field(DESC, "Current Range") field(PINI, "YES") field(CALC, "ABS(A-B)") field(INPA, "BEND:LTUS:764:IMIN") field(INPB, "BEND:LTUS:764: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, "BEND:LTUS:764: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, "BEND:LTUS:764:IACT") field(FLNK, "BEND:LTUS:764:IACTPOL") } record(bo, "BEND:LTUS:764:IACTPOL") { field(DESC, "Actual I Polarity") field(DTYP, "Raw Soft Channel") field(DOL, "BEND:LTUS:764: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,"BEND:LTUS:764:I*LIMITS:\n Calculate alarm and warning limits based on \n deltas from BEND:LTUS:764:IDELTAS and the\n BEND:LTUS:764: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,"BEND:LTUS:764:IACT: \n Get copy of BEND:LTUS:764:I. \n",null) #! TextBox(TB12,1280,3100,1760,3200,0,"Dialog",12,1,16777215,"BEND:LTUS:764: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,"BEND:LTUS:764:IDES:\n Contains raw value calculated by \nBEND:LTUS:764: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 \nBEND:LTUS:764:BDELTAS.\n",null) #! TextBox(TB10,56,1940,316,2340,0,"Dialog",12,1,16777215,"BEND:LTUS:764: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 BEND:LTUS:764: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 BEND:LTUS:764: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,"BEND:LTUS:764:ISETPT:\n Sets the hardware. When fast feedback is set on, this record is\n set to closed loop mode by BEND:LTUS:764:FBCKSTART sequence. When \n the loop is closed, this record takes input calculated by \n BFBCK only. When fast feedback is set off, BEND:LTUS:764:FBCKSTOP \n will set it back to supervisory so that the value can be set by \n BEND:LTUS:764: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, "BEND:LTUS:764:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:764:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "BEND:LTUS:764:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "BEND:LTUS:764:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "BEND:LTUS:764:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "BEND:LTUS:764:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "1") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "BEND:LTUS:764: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, "BEND:LTUS:764:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "BEND:LTUS:764:TRIMTYPE.RVAL") field(INPB, "BEND:LTUS:764:CONFIG.RVAL") field(OUT, "BEND:LTUS:764:TRIMMAXNUM PP") } record(longout, "BEND:LTUS:764: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, "BEND:LTUS:764: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, "") field(OMSL, "supervisory") field(VAL, "10") field(OUT, "BEND:LTUS:764:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "BEND:LTUS:764: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, "") field(OMSL, "supervisory") field(VAL, "10") } record(bo, "BEND:LTUS:764: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, "BEND:LTUS:764: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, "BEND:LTUS:764: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, "BEND:LTUS:764:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "0") } record(ao, "BEND:LTUS:764: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, "BEND:LTUS:764:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "BEND:LTUS:764: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, "BEND:LTUS:764: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, "BEND:LTUS:764:IMOVE") field(INPB, "BEND:LTUS:764:IACT") field(INPC, "BEND:LTUS:764:IRAMPRATE") field(INPD, "1.577") field(INPE, "BEND:LTUS:764:TRIMDLYPCT") field(INPF, "BEND:LTUS:764:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "BEND:LTUS:764:RAMPTIME_LEFT PP") } record(longout, "BEND:LTUS:764:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "BEND:LTUS:764:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "BEND:LTUS:764:RAMPDONE_CALC") } record(calc, "BEND:LTUS:764:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "BEND:LTUS:764:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "BEND:LTUS:764:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "BEND:LTUS:764: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, "BEND:LTUS:764:RAMPTIME_LEFT") field(OUT, "BEND:LTUS:764:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "BEND:LTUS:764:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "BEND:LTUS:764:RAMPTIME_LEFT NMS") field(OUT, "BEND:LTUS:764:RAMPDONE PP") } record(bo, "BEND:LTUS:764:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "BEND:LTUS:764:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "BEND:LTUS:764: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, "BEND:LTUS:764: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, "BEND:LTUS:764:STDZINIT") { field(DESC, "Proc. Stdz PVs on boot") field(PINI, "YES") field(DOL1, "1") field(DOL2, "1") field(DOL3, "1") field(LNK1, "BEND:LTUS:764:DEBUG.PROC PP") field(LNK2, "BEND:LTUS:764:STDZCYCLENUM.PROC PP") field(LNK3, "BEND:LTUS:764:STDZDISABLE.PROC PP") field(LNK4, "BEND:LTUS:764: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, "BEND:LTUS:764:STDZSUB") { field(DESC, "Stdz subroutine") field(INAM, "mgntStdzInit") field(SNAM, "mgntStdz") field(BRSV, "INVALID") field(INPA, "BEND:LTUS:764:STDZIMIN NPP NMS") field(INPB, "BEND:LTUS:764:STDZIMAX NPP NMS") field(INPC, "BEND:LTUS:764:STDZIFINAL NPP NMS") field(INPD, "BEND:LTUS:764:STDZCYCLENUM NPP NMS") field(INPE, "BEND:LTUS:764:STDZDIRECT.RVAL NPP NMS") field(INPF, "BEND:LTUS:764:STDZDISABLE.RVAL CPP NMS") field(INPG, "BEND:LTUS:764: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, "BEND:LTUS:764:STDZWF PP") field(OUTB, "BEND:LTUS:764: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, "BEND:LTUS:764:STDZWF") } record(mbbo, "BEND:LTUS:764: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, "BEND:LTUS:764: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, "BEND:LTUS:764:STDZMAINPS") { field(DESC, "Stdz by main or self") field(PINI, "YES") field(DTYP, "Soft Channel") field(ZNAM, "SELF") field(ONAM, "MAIN") } record(bo, "BEND:LTUS:764: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, "BEND:LTUS:764: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, "BEND:LTUS:764: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, "BEND:LTUS:764:STDZTOD") { field(DESC, "Successful Standardize Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "BEND:LTUS:764:STDZLOSTTOD") { field(DESC, "Standardize Lost Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(longout, "BEND:LTUS:764:STDZCYCLECNT") { field(DESC, "Cycle Count") field(PINI, "YES") } record(longout, "BEND:LTUS:764:STDZCYCLENUM") { field(DESC, "No. Standardize Cycles") field(VAL, "3") field(HOPR, "10") field(LOPR, "0") field(DRVH, "10") field(DRVL, "0") field(PINI, "YES") field(FLNK, "BEND:LTUS:764:STDZDIRECT") } # The default standardize direction is "UP" for # all LCLS Magnets.. record(bo, "BEND:LTUS:764:STDZDIRECT") { field(DESC, "Standardize Direction ") field(ZNAM, "UP") field(ONAM, "DOWN") field(VAL, "0") field(FLNK, "BEND:LTUS:764:STDZIMIN") } record(ao, "BEND:LTUS:764:STDZIMIN") { field(DESC, "Min-STDZ Current") field(PREC, "1") field(EGU, "A") field(HOPR, "17.5") field(LOPR, "-17.5") field(VAL, "-17.5") field(FLNK, "BEND:LTUS:764:STDZIMAX") } record(ao, "BEND:LTUS:764:STDZIMAX") { field(DESC, "Max. Standarize Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "17.5") field(LOPR, "-17.5") field(VAL, "17.5") field(FLNK, "BEND:LTUS:764:STDZIFINAL") } record(ao, "BEND:LTUS:764:STDZIFINAL") { field(DESC, "Final SDTZ Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "17.5") field(LOPR, "-17.5") field(VAL, "-17.5") field(FLNK, "BEND:LTUS:764: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, "BEND:LTUS:764: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, "BEND:LTUS:764:STDZITOL") { field(DESC, "Stdz min tolerance") field(PREC, "5") field(CALC, "MAX(ABS(A),ABS(B))*C") field(INPA, "BEND:LTUS:764:STDZIMIN CP NMS") field(INPB, "BEND:LTUS:764:STDZIMAX CP MMS") field(INPC, "0.05") field(INPD, "BEND:LTUS:764:STDZITOLR CP MMS") field(EGU, "A") field(FLNK, "BEND:LTUS:764:IDELTAS") field(PINI, "YES") } # D - factor (3.154/2 = 1.577) for EPSC, otherwise, set to 1.0 record(calc, "BEND:LTUS:764:STDZDLY") { field(DESC, "Ramp time for stdz cycle") field(CALC, "C>0?MAX(1,ABS((A-B)/C)*D):0") field(INPA, "BEND:LTUS:764:STDZIMIN CP NMS") field(INPB, "BEND:LTUS:764:STDZIMAX CP NMS") field(INPC, "BEND:LTUS:764:TRIMRAMPRATE CP NMS") field(INPD, "1.577") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") } record(calc, "BEND:LTUS:764:STDZRAMPDLY") { field(DESC, "Ramp delay total") field(CALC, "MAX(1,((A/100)*B+B))") field(PREC, "5") field(INPA, "BEND:LTUS:764:TRIMDLYPCT CP MS") field(INPB, "BEND:LTUS:764: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, "BEND:LTUS:764:STDZMINIDLY") { field(DESC, "Mini-stdz delay") field(CALC, "A") field(PREC, "5") field(A, "1.0") field(EGU, "sec") field(PINI, "YES") } record(ao, "BEND:LTUS:764: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, "BEND:LTUS:764:STDZMINIDELTA") { field(DESC, "Stdz mini % of IMAX") field(CALC, "(B/100)*(A-C)") field(INPA, "BEND:LTUS:764:IDES.HOPR") field(INPB, "BEND:LTUS:764:STDZMINIPCT CPP NMS") field(INPC, "BEND:LTUS:764:IDES.LOPR") field(PREC, "5") } record(calc, "BEND:LTUS:764:STDZMINISETPT") { field(DESC, "Mini Stdz delta") field(CALC, "C==0?MAX(E-D,B):MIN(E+D,A)") field(INPA, "BEND:LTUS:764:IDES.HOPR") field(INPB, "BEND:LTUS:764:IDES.LOPR") field(INPC, "BEND:LTUS:764:STDZDIRECT.RVAL") field(INPD, "BEND:LTUS:764:STDZMINIDELTA") field(INPE, "BEND:LTUS:764:IDES") field(PREC, "5") field(FLNK, "BEND:LTUS:764: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, "BEND:LTUS:764:STDZMINISETPTOOR") { field(DESC, "Mini Stdz setpoint out of range") field(CALC, "C==0?(E-DA)") field(INPA, "BEND:LTUS:764:IDES.HOPR") field(INPB, "BEND:LTUS:764:IDES.LOPR") field(INPC, "BEND:LTUS:764:STDZDIRECT.RVAL") field(INPD, "BEND:LTUS:764:STDZMINIDELTA") field(INPE, "BEND:LTUS:764: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, "BEND:LTUS:764: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, "BEND:LTUS:764:IADJUST.RVAL") field(INPB, "BEND:LTUS:764:STDZDIRECT.RVAL") field(INPC, "BEND:LTUS:764:STDZOK.RVAL") field(INPD, "BEND:LTUS:764:STDZDISABLE.RVAL") field(INPE, "BEND:LTUS:764:STATE.RVAL CPP NMS") field(INPF, "BEND:LTUS:764:ICTRL.RVAL") field(INPG, "BEND:LTUS:764:STATE.SEVR") field(INPH, "BEND:LTUS:764:BDELTAS.M") field(INPI, "BEND:LTUS:764:IACT.SEVR") field(OUT, "BEND:LTUS:764:STDZLOSTGO.SELN PP NMS") field(OOPT, "Transition To Non-zero") } record(seq, "BEND:LTUS:764:STDZLOSTGO") { field(DESC, "Process lost stdz") field(SELM, "Mask") field(DOL1, "1") field(DOL2, "0") field(LNK1, "BEND:LTUS:764:STDZLOSTTOD.PROC") field(LNK2, "BEND:LTUS:764:STDZOK PP") } # Record maximum current after standardize # Reset to IACT from sequence after trim # Disable processing during (mini-)standardize or trim record(calc, "BEND:LTUS:764:STDZIACTMAX") { field(DESC, "Max act current after stdz") field(CALC, "MAX(A, B)") field(DISV, "0") field(SDIS, "BEND:LTUS:764:CHECKPWRDIP_ENABLE") field(INPA, "BEND:LTUS:764:IACT CP") field(INPB, "BEND:LTUS:764:STDZIACTMAX") field(EGU, "A") field(FLNK, "BEND:LTUS:764:CHECKPWRDIP") } # Detect power dip if STDZOK is YES, STDZ is enabled, and IACT is valid # If IACT drops below STDZIACTMAX by more than the trim tolerance, clear STDZOK # Warning: Take the absolute value of the trim tolerance, or else quads of # negative polarity will always lose STDZ since their IDELTAS.I are negative. # Note: Large quads and bends are prone to losing STDZ even if they are # perturbed toward higher current since their current tends to overshoot # by greater than the trim tolerance before settling down. record(calcout, "BEND:LTUS:764:CHECKPWRDIP") { field(DESC, "Detect power dip") field(CALC, "(A-B>ABS(C))?3:0") field(DISV, "0") field(SDIS, "BEND:LTUS:764:CHECKPWRDIP_ENABLE") field(INPA, "BEND:LTUS:764:STDZIACTMAX") field(INPB, "BEND:LTUS:764:IACT") field(INPC, "BEND:LTUS:764:IDELTAS.I") field(OUT, "BEND:LTUS:764:STDZLOSTGO.SELN PP NMS") field(OOPT, "When Non-zero") } # Enable processing of STDZIACTMAX and CHECKPWRDIP only if # STDZOK = YES, STDZDISABLE = NO, CTRL != Trim (2), and # CTRL != Stdz (4) record(calc, "BEND:LTUS:764:CHECKPWRDIP_ENABLE") { field(CALC, "A&&!B&&(C#2)&&(C#4)") field(INPA, "BEND:LTUS:764:STDZOK.RVAL CP") field(INPB, "BEND:LTUS:764:STDZDISABLE.RVAL CP") field(INPC, "BEND:LTUS:764:CTRL.RVAL CP") } #! 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, "BEND:LTUS:764: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, "BEND:LTUS:764:CALBOK") { field(DESC, "Successful Calibration") field(DTYP, "Raw Soft Channel") field(ZNAM, "NO") field(ONAM, "YES") field(DOL, "PSC:LTUS:MG22:CALBOK.RVAL") field(OMSL, "closed_loop") 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, "BEND:LTUS:764:CALBSET") { field(DESC, "Use DAC Calbration") field(SCAN, "10 second") field(CALC, "A&&(B==0)&&C?31:960") field(INPA, "BEND:LTUS:764:CALBOK") field(INPB, "BEND:LTUS:764:CALBDISABLE") field(INPC, "BEND:LTUS:764:CALBSLOPE") field(OOPT, "On Change") field(OUT, "BEND:LTUS:764: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, "BEND:LTUS:764:CALB_SEQ") { field(DESC, "Output Calib Values") field(SELM, "Mask") field(SELL, "BEND:LTUS:764: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, "BEND:LTUS:764:CALBSLOPE") field(DOL3, "BEND:LTUS:764: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, "BEND:LTUS:764:CALBTOD") { field(DESC, "Calibration Success Time") field(PINI, "YES") field(DOL, "PSC:LTUS:MG22:CALBTOD") field(OMSL, "closed_loop") field(DTYP, "Soft Channel") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:764: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, "BEND:LTUS:764: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, "BEND:LTUS:764: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, "BEND:LTUS:764:CALBOFFSET") { field(DESC, "Calc DAC Offset") field(PREC, "6") field(EGU, "Counts") field(PINI, "YES") } record(bo, "BEND:LTUS:764: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, "BEND:LTUS:764:DACSLOPE") { field(DESC, "V to DAC slope") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "closed_loop") field(PINI, "YES") field(FLNK, "BEND:LTUS:764:DACOFFSET") } # Default Offset used in conversion from Volts to DAC Counts record(ao, "BEND:LTUS:764:DACOFFSET") { field(DESC, "V to DAC offset") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "closed_loop") field(PINI, "YES") field(FLNK, "BEND:LTUS:764: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, "BEND:LTUS:764: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, "BEND:LTUS:764:IACT") field(INPD, "BEND:LTUS:764:DACSLOPE") field(INPE, "BEND:LTUS:764:DACOFFSET") field(EGU, "Counts") field(PREC, "6") } record(ao, "BEND:LTUS:764:DAC") { field(DESC, "DAC Set point") field(EGU, "Counts") field(DOL, "") field(OMSL, "closed_loop") field(PREC, "6") field(PINI, "YES") } record(ao, "BEND:LTUS:764:CALBIMIN") { field(DESC, "Calibration Min Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(DRVH, "17.5") field(HOPR, "17.5") field(DRVL, "-17.5") field(LOPR, "-17.5") field(PREC, "3") field(EGU, "A") field(VAL, "0.0") field(FLNK, "BEND:LTUS:764:CALBIMAX") } record(ao, "BEND:LTUS:764:CALBIMAX") { field(DESC, "Calibration Max Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(DRVH, "17.5") field(HOPR, "17.5") field(LOPR, "-17.5") field(DRVL, "-17.5") field(EGU, "A") field(VAL, "17.5") field(FLNK, "BEND:LTUS:764:CALBSTEPNUM") } record(ao, "BEND:LTUS:764:CALBIFINAL") { field(DESC, "Calibration Last Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(PREC, "3") field(EGU, "A") field(HOPR, "17.5") field(LOPR, "-17.5") field(VAL, "0") } record(longout, "BEND:LTUS:764: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, "BEND:LTUS:764:CALBIDELTA") } record(calc, "BEND:LTUS:764:CALBIDELTA") { field(DESC, "Step size for CALB") field(CALC, "C=0?0:ABS((A-B)/C)") field(INPA, "BEND:LTUS:764:CALBIMAX") field(INPB, "BEND:LTUS:764:CALBIMIN") field(INPC, "BEND:LTUS:764: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, "BEND:LTUS:764:CALBIMULT") { field(DESC, "IACT vs ISETPT mult") field(CALC, "C#0||A=0?1:ABS(B/A)") field(INPA, "PSC:LTUS:MG22:ISETPT.DRVH") field(INPB, "PSC:LTUS:MG22:IACT.HOPR") field(INPC, "BEND:LTUS:764:PSCONTROLLER.RVAL CPP") field(EGU, "A") field(PINI, "YES") } # SNL dbputs DAC values here. 6-10 steps are possible. record(waveform, "BEND:LTUS:764:CALBICTRLWF") { field(DESC, "ICTRL setpoint array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") } record(waveform, "BEND:LTUS:764:DACWF") { field(DESC, "DAC count array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "BEND:LTUS:764:DACSA") } # Used only for xygraph edm plot record(subArray, "BEND:LTUS:764:DACSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "BEND:LTUS:764: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, "BEND:LTUS:764:CALCDACWF") { field(DESC, "Calc DAC counts array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "BEND:LTUS:764:CALCDACSA") } # Used only for xygraph edm plot record(subArray, "BEND:LTUS:764:CALCDACSA") { field(DESC, "Calc DAC counts") field(DTYP, "Soft Channel") field(INP, "BEND:LTUS:764: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, "BEND:LTUS:764:CALBYWF") { field(DESC, "mx + b") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "BEND:LTUS:764:CALBYSA") } # Used only for xygraph edm plot record(subArray, "BEND:LTUS:764:CALBYSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "BEND:LTUS:764:CALBYWF") field(MALM, "10") field(NELM, "6") field(INDX, "0") field(FTVL, "DOUBLE") } record(waveform, "BEND:LTUS:764:CALBIACTWF") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "BEND:LTUS:764:CALBIACTSA") } # Used only for xygraph edm plot record(subArray, "BEND:LTUS:764:CALBIACTSA") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(MALM, "10") field(NELM, "6") field(INP, "BEND:LTUS:764:CALBIACTWF") field(INDX, "0") field(FTVL, "DOUBLE") field(FLNK, "BEND:LTUS:764:CALBLIMITS") } # Check that measured current during calibration is within # tolerance. record(aSub, "BEND:LTUS:764: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, "BEND:LTUS:764:CALBSTEPNUM") field(INPB, "BEND:LTUS:764:CALBIACTWF") field(INPC, "BEND:LTUS:764: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, "BEND:LTUS:764: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, "BEND:LTUS:764:STDZITOL") field(INPH, "BEND:LTUS:764:DACSLOPE") field(INPI, "BEND:LTUS:764: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, "BEND:LTUS:764: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, "BEND:LTUS:764:CALBSTEPNUM") field(INPB, "BEND:LTUS:764:CALBIACTWF") field(INPC, "BEND:LTUS:764:DACWF") field(INPF, "BEND:LTUS:764: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 BEND:LTUS:764CALBOK 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, "BEND:LTUS:764:DEGAUSINIT") { field(DESC, "Proc. Degauss PVs on boot") field(PINI, "YES") field(DOL, "1") field(OUTA, "BEND:LTUS:764:DEGAUSIMIN.PROC PP") field(OUTB, "BEND:LTUS:764:DEGAUSIMAX.PROC PP") field(OUTC, "BEND:LTUS:764:DEGAUSTYPE.PROC PP") field(OUTD, "BEND:LTUS:764:DEGAUSSTEP.PROC PP") field(OUTE, "BEND:LTUS:764:MADNAME.PROC PP") field(OUTF, "BEND:LTUS:764:PSTYPE.PROC PP") field(OUTG, "BEND:LTUS:764: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, "BEND:LTUS:764:DEGAUSSUB") { field(DESC, "Degauss subroutine") field(INAM, "mgntDegaussInit") field(SNAM, "mgntDegauss") field(BRSV, "INVALID") field(INPA, "BEND:LTUS:764:DEGAUSIMIN NPP NMS") field(INPB, "BEND:LTUS:764:DEGAUSIMAX NPP NMS") field(INPC, "BEND:LTUS:764:DEGAUSTYPE.RVAL NPP NMS") field(INPE, "BEND:LTUS:764:DEGAUSMETHOD.RVAL NPP NMS") field(INPF, "BEND:LTUS:764:PSTYPE NPP NMS") field(INPG, "BEND:LTUS:764:DEBUG.RVAL NPP NMS") field(INPH, "BEND:LTUS:764: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, "BEND:LTUS:764:DEGAUSWF PP") field(OUTB, "BEND:LTUS:764:DEGAUSMSG PP") field(OUTC, "BEND:LTUS:764: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, "BEND:LTUS:764:DEGAUSWF") { field(DESC, "Degauss Setpts") field(NELM, "60") field(FTVL, "DOUBLE") } record(mbbo,"BEND:LTUS:764: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, "BEND:LTUS:764: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, "BEND:LTUS:764: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, "BEND:LTUS:764: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, "BEND:LTUS:764: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, "BEND:LTUS:764:DEGAUSIMIN") { field(DESC, "Min. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "17.5") field(LOPR, "-17.5") field(DRVH, "17.5") field(DRVL, "-17.5") field(VAL, "-17.5") } record(ao, "BEND:LTUS:764:DEGAUSIMAX") { field(DESC, "Max. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "17.5") field(LOPR, "-17.5") field(DRVH, "17.5") field(DRVL, "-17.5") field(VAL, "17.5") } # 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,"BEND:LTUS:764: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, "BEND:LTUS:764: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,"BEND:LTUS:764: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, "BEND:LTUS:764: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, "BEND:LTUS:764: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, "BEND:LTUS:764: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, "BEND:LTUS:764:DEGAUSTOD") { field(DESC, "Successful Degauss Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "BEND:LTUS:764:DEGAUSLOSTTOD") { field(DESC, "Degauss Lost Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:764:DEGAUSTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "BEND:LTUS:764:DEGAUSTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "BEND:LTUS:764: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, "BEND:LTUS:764:DEGAUSGO") { field(DESC, "Set bdes of btrms to zero") field(ASG, "Internal") field(OUTA, "") field(OUTB, "") field(OUTC, "") field(OUTD, "") } # =========== CRYO ONLY =========== record(bo, "BEND:LTUS:764: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, "BEND:LTUS:764:DEGAUS_IMAX_CHECK") { field(DESC, "Check if imax shoud chg") field(CALC, "(C==4)&&(ABS(B)>ABS(A))?1:0") field(INPA, "BEND:LTUS:764:DEGAUS_IMAX") field(INPB, "BEND:LTUS:764:ISETPT") field(INPC, "BEND:LTUS:764:DEGAUSTYPE.RVAL") field(OUT, "BEND:LTUS:764:DEGAUS_IMAX_UPDATE.SELN") field(FLNK, "BEND:LTUS:764:DEGAUS_IMAX_UPDATE") } record(seq, "BEND:LTUS:764:DEGAUS_IMAX_UPDATE") { field(DESC, "Degauss IMAX Update") field(SELM, "Specified") field(DOL1, "BEND:LTUS:764:ISETPT") field(LNK1, "BEND:LTUS:764:DEGAUS_IMAX PP") } # Set the maximum current after a successful # degauss. This pv is updated by the # sequence. record(ao, "BEND:LTUS:764:DEGAUS_IMAX") { field(DESC, "Max I set afer a degauss") field(EGU, "Amps") field(PINI, "YES") field(PREC, "6") field(HOPR, "17.5") field(LOPR, "-17.5") field(DRVH, "17.5") field(DRVL, "-17.5") field(VAL, "17.5") field(FLNK, "BEND:LTUS:764:DEGAUS_IMAXPOL_CHECK") info(autosaveFields,"VAL,RVAL") } # Set the polarity if degauss_imax record(calcout, "BEND:LTUS:764:DEGAUS_IMAXPOL_CHECK") { field(DESC, "Determine polarity of imax") field(CALC, "A>=0?0:1") field(INPA, "BEND:LTUS:764:DEGAUS_IMAX") field(FLNK, "BEND:LTUS:764:DEGAUS_IMAXPOL") } record(bo, "BEND:LTUS:764:DEGAUS_IMAXPOL") { field(DESC, "Polarity of imax I") field(DTYP, "Raw Soft Channel") field(DOL, "BEND:LTUS:764:DEGAUS_IMAXPOL_CHECK") field(OMSL, "closed_loop") field(ZNAM, "Positive") field(ONAM, "Negative") field(FLNK, "BEND:LTUS:764: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, "BEND:LTUS:764:DEGAUS_ABSIMAX") { field(DESC, "Absolute Max. Degauss I") field(CALC, "ABS(A)") field(INPA, "BEND:LTUS:764:DEGAUS_IMAX") field(PREC, "6") field(EGU, "Amps") field(HOPR, "17.5") field(LOPR, "-17.5") info(autosaveFields,"VAL RVAL") } # IACT Polarity record(calcout, "BEND:LTUS:764:IACTPOL_CHECK") { field(DESC, "Determine IACT polarity") field(SCAN, "5 second") field(CALC, "ABS(A-B)>C?(A>=0?0:1):D") field(INPA, "BEND:LTUS:764:IACT") field(INPB, "BEND:LTUS:764:IACTPOL_CHECK.LA") field(INPC, "0.0001") field(INPD, "BEND:LTUS:764:IACTPOL_CHECK.PVAL") field(OOPT, "On Change") field(FLNK, "BEND:LTUS:764:IACTPOL") } record(bo, "BEND:LTUS:764: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,"BEND:LTUS:764: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, "BEND:LTUS:764:DEGAUSENABLE CP") field(INPB, "BEND:LTUS:764:DEGAUSOK") field(INPC, "BEND:LTUS:764:STATE CP") field(INPD, "BEND:LTUS:764:STATE.SEVR") field(OUT, "BEND:LTUS:764:DEGAUS_STATE_SEQ.SELN PP") field(ASG, "Internal") } record(seq, "BEND:LTUS:764:DEGAUS_STATE_SEQ") { field(DESC, "Degauss State Sequence") field(SELM, "Specified") field(SELL, "BEND:LTUS:764:DEGAUS_STATE_CHECK") field(LNK1, "BEND:LTUS:764:DEGAUS_STATE_DISABLE.PROC PP") field(LNK2, "BEND:LTUS:764:DEGAUS_STATE_LOST.PROC PP") field(LNK3, "BEND:LTUS:764:DEGAUS_STATE_GOOD.PROC PP") field(LNK4, "BEND:LTUS:764: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, "BEND:LTUS:764:DEGAUS_STATE_DISABLE") { field(DESC, "Degauss not used") field(LNK1, "BEND:LTUS:764:DEGAUSOK.ZSV") field(LNK2, "BEND:LTUS:764: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, "BEND:LTUS:764:STATMSG.FRSV") field(LNK4, "BEND:LTUS:764: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, "BEND:LTUS:764:DEGAUS_STATE_LOST") { field(DESC, "Degauss lost and ps On") field(DOL1, "1") field(LNK1, "BEND:LTUS:764:DEGAUSOK.ZSV") field(LNK2, "BEND:LTUS:764: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, "BEND:LTUS:764:STATMSG.FRSV") field(LNK4, "BEND:LTUS:764: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, "BEND:LTUS:764:DEGAUS_STATE_OFF") { field(DESC, "Degaused lost and ps Off") field(DOL1, "2") field(LNK1, "BEND:LTUS:764: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, "BEND:LTUS:764:STATMSG.FRSV") field(LNK3, "BEND:LTUS:764: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, "BEND:LTUS:764:DEGAUS_STATE_GOOD") { field(DESC, "Degauss good") field(DOL1, "1") field(LNK1, "BEND:LTUS:764: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, "BEND:LTUS:764:STATMSG.FRSV PP") field(LNK3, "BEND:LTUS:764:STATMSG.FVSV PP") field(LNK4, "") field(ASG, "Internal") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(mbbo, "BEND:LTUS:764:FUNC") { field(DESC, "BEND:LTUS:764 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, "1") field(THVL, "9") field(FRVL, "10") field(FVVL, "0") field(SXVL, "2") field(SVVL, "8") field(EIVL, "11") field(NIVL, "12") field(TEVL, "13") field(ELVL, "5") field(TVVL, "6") field(TTVL, "7") field(FTVL, "4") field(FFVL, "3") field(OUT, "BEND:LTUS:764:CTRL CA") } # :CTRL pv is processed at boot in the # sequence mgntCtrl.st Processed in sequence # record(mbbo, "BEND:LTUS:764:CTRL") { field(DESC, "BEND:LTUS:764 Control") field(PINI, "NO") field(ZRST, "Ready") field(ONST, "TRIM") field(TWST, "PERTURB") field(THST, "BCON_TO_BDES") field(FRST, "BACT_TO_BDES") field(FVST, "SAVE_BDES") field(SXST, "LOAD_BDES") field(SVST, "UNDO_BDES") field(EIST, "DAC_ZERO") field(NIST, "CALB") field(TEST, "STDZ") field(ELST, "RESET") field(TVST, "TURN_ON") field(TTST, "TURN_OFF") field(FTST, "") field(FFST, "") field(ZRVL, "0") field(ONVL, "2") field(TWVL, "6") field(THVL, "15") field(FRVL, "14") field(FVVL, "11") field(SXVL, "12") field(SVVL, "13") field(EIVL, "7") field(NIVL, "3") field(TEVL, "4") field(ELVL, "8") field(TVVL, "9") field(TTVL, "10") field(FTVL, "0") field(FFVL, "0") field(OUT, "BEND:LTUS:764:SELECTEN.A PP") field(SDIS, "0") } # If a function has been selected set this unit to busy record(calcout, "BEND:LTUS:764:SELECTEN") { field(DESC, "Control Select Enable") field(CALC, "A>0?1:A") field(FLNK, "BEND:LTUS:764:BUSY") } # Set to FREE on IOC reboot record(bo, "BEND:LTUS:764:BUSY") { field(DESC, "BEND:LTUS:764 Ctrl Done") field(DOL, "BEND:LTUS:764:SELECTEN") field(ZNAM, "FREE") field(ONAM, "BUSY") field(PINI, "YES") field(FLNK, "BEND:LTUS:764:SELECT") } record(bo, "BEND:LTUS:764:SELECT") { field(ZNAM, "NO") field(ONAM, "YES") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") } record(bo, "BEND:LTUS:764: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, "BEND:LTUS:764:CTRLSTATE") { field(DESC, "BEND:LTUS:764 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("BEND:LTUS:764:CTRL",20,20,0,0,"BEND:LTUS:764:CTRL") #! Field("BEND:LTUS:764:CTRL.OUT",16777215,1,"BEND:LTUS:764:CTRL.OUT") #! Link("BEND:LTUS:764:CTRL.OUT","BEND:LTUS:764:SELECTEN.A") #! Field("BEND:LTUS:764:CTRL.VAL",16777215,1,"BEND:LTUS:764:CTRL.VAL") #! Record("BEND:LTUS:764:SELECTEN",321,381,0,0,"BEND:LTUS:764:SELECTEN") #! Field("BEND:LTUS:764:SELECTEN.A",16777215,0,"BEND:LTUS:764:SELECTEN.A") #! Field("BEND:LTUS:764:SELECTEN.FLNK",16777215,1,"BEND:LTUS:764:SELECTEN.FLNK") #! Link("BEND:LTUS:764:SELECTEN.FLNK","BEND:LTUS:764:BUSY") #! Field("BEND:LTUS:764:SELECTEN.VAL",16777215,1,"BEND:LTUS:764:SELECTEN.VAL") #! Record("BEND:LTUS:764:BUSY",623,274,0,0,"BEND:LTUS:764:BUSY") #! Field("BEND:LTUS:764:BUSY.DOL",16777215,0,"BEND:LTUS:764:BUSY.DOL") #! Link("BEND:LTUS:764:BUSY.DOL","BEND:LTUS:764:SELECTEN.VAL") #! Field("BEND:LTUS:764:BUSY.FLNK",16777215,1,"BEND:LTUS:764:BUSY.FLNK") #! Link("BEND:LTUS:764:BUSY.FLNK","BEND:LTUS:764:SELECT") #! Record("BEND:LTUS:764:SELECT",669,508,0,1,"BEND:LTUS:764:SELECT") #! Record("BEND:LTUS:764:FUNC",940,120,0,0,"BEND:LTUS:764:FUNC") #! Field("BEND:LTUS:764:FUNC.OUT",16777215,0,"BEND:LTUS:764:FUNC.OUT") #! Link("BEND:LTUS:764:FUNC.OUT","BEND:LTUS:764:CTRL.VAL") #! Record("BEND:LTUS:764:ABORT",193,41,0,0,"BEND:LTUS:764:ABORT") #! Record("BEND:LTUS:764:CTRLSTATE",369,34,0,0,"BEND:LTUS:764: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,"BEND:LTUS:764:SELECT is used for Multi-device selection.\nIt is enabled when associated BEND:LTUS:764:CTRL is \"0\" (DONE).\nIt is disabled when associated BEND:LTUS:764: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,"BEND:LTUS:764: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, "BEND:LTUS:764:BCTRL_INIT") { field(DESC, "Process BCTRL on boot") field(PINI, "YES") field(CALC, "A=3?1:0") field(INPA, "BEND:LTUS:764:BCTRL.SEVR") field(OUT, "BEND:LTUS:764: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, "BEND:LTUS:764:BACT") { field(DESC, "Actual B") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "BEND:LTUS:764:BACT") field(INPB, "BEND:LTUS:764:POLYCOEF") field(INPC, "BEND:LTUS:764:POLYCOEF.A") field(INPD, "BEND:LTUS:764:POLYCOEF.B") field(INPE, "BEND:LTUS:764:IACT MS") field(INPF, "BEND:LTUS:764:BDELTAS PP") field(INPG, "100") field(EGU, "kG-m") field(HOPR, "2.7773") field(LOPR, "-2.7495") field(HIHI, "2.7773") field(LOLO, "-2.7495") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "2.7773") field(LOW, "-2.7495") field(FLNK, "BEND:LTUS:764: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, "BEND:LTUS:764:BDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntPhyDeltas") field(EGU, "kG-m") field(HOPR, "1") field(PREC, "7") field(BRSV, "INVALID") field(INPA, "BEND:LTUS:764:BDES") field(INPB, "BEND:LTUS:764:TRIMBTOL") field(INPC, "BEND:LTUS:764:TRIMBTOLR") field(INPD, "BEND:LTUS:764:CHCKBTOL") field(INPE, "BEND:LTUS:764:CHCKBTOLR") field(F, "2.0") field(INPG, "30") field(INPH, "BEND:LTUS:764:BACT.VAL") # # MPS absolute and relative tolerances field(INPP, "BEND:LTUS:764:MPSBTOL") field(INPQ, "BEND:LTUS:764:MPSBTOLR") field(FLNK, "BEND:LTUS:764:BCONLIMITS") info(autosaveFields,"F") } # This record is processed by BDELTAS record(aSub, "BEND:LTUS:764:BCONLIMITS") { field(DESC, "Config B-field Limits") field(INAM, "mgntInit") field(SNAM, "mgntBCONLimits") field(INPA, "BEND:LTUS:764:BDES") field(INPB, "BEND:LTUS:764:BDELTAS.I") field(INPG, "BEND:LTUS:764:DEBUG.RVAL") field(FTA, "DOUBLE") field(FTB, "DOUBLE") field(FTG, "ULONG") field(OUTA, "BEND:LTUS:764:BCON.HIGH") field(OUTB, "BEND:LTUS:764:BCON.LOW") field(OUTC, "BEND:LTUS:764:BCON.HIHI") field(OUTD, "BEND:LTUS:764:BCON.LOLO PP") field(FTVA, "DOUBLE") field(FTVB, "DOUBLE") field(FTVC, "DOUBLE") field(FTVD, "DOUBLE") field(BRSV, "INVALID") field(FLNK, "BEND:LTUS:764:IDELTAS") } # The following PV is processed by :BACT # which is processed by :BACT # record(fanout, "BEND:LTUS:764:BACTFO") { field(DESC, "BACT processing") field(SELM, "All") field(LNK1, "BEND:LTUS:764:BDIFF") field(LNK2, "BEND:LTUS:764:BADIFF") field(LNK3, "BEND:LTUS:764:BRATIO") field(LNK4, "BEND:LTUS:764:MPSLIMITS") field(LNK5, "BEND:LTUS:764:I2BSTATUS") field(LNK6, "BEND:LTUS:764:IACTFO.PROC") } record(calc, "BEND:LTUS:764:BDIFF") { field(DESC, "BDES-BACT") field(CALC, "A-B") field(INPA, "BEND:LTUS:764:BDES") field(INPB, "BEND:LTUS:764:BACT") field(EGU, "kG-m") field(PREC, "7") } record(calc, "BEND:LTUS:764:BADIFF") { field(DESC, "Absolute BDES-BACT") field(INPA, "BEND:LTUS:764:BDIFF") field(EGU, "kG-m") field(PREC, "7") field(CALC, "A<0?ABS(A):A") } record(calc, "BEND:LTUS:764:BRATIO") { field(DESC, "BACT Error") field(CALC, "B?A/B:0") field(INPA, "BEND:LTUS:764:BDIFF") field(INPB, "BEND:LTUS:764:BDES.HOPR") field(EGU, "kG-m") field(PREC, "7") } record(mbbi, "BEND:LTUS:764: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, "BEND:LTUS:764:BACT.J") } # Note: for a string slave set the MONFL # macro to the following: # MONFL=:IMONCALC MS record(sub, "BEND:LTUS:764:BMON") { field(DESC, "Second Transductor") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "BEND:LTUS:764:BMON") field(INPB, "BEND:LTUS:764:POLYCOEF") field(INPC, "BEND:LTUS:764:POLYCOEF.A") field(INPD, "BEND:LTUS:764:POLYCOEF.B") field(INPE, "BEND:LTUS:764:IMON MS") field(INPF, "BEND:LTUS:764:BDELTAS.VAL") field(INPG, "100") field(EGU, "kG-m") field(HOPR, "2.7773") field(LOPR, "-2.7495") field(HIHI, "2.7773") field(LOLO, "-2.7495") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "2.7773") field(LOW, "-2.7495") } # 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=PSC:LTUS:MG22:BDES CP record(ao, "BEND:LTUS:764:BDES") { field(DESC, "Desired B-Field") field(PINI, "YES") field(DRVH, "2.7773") field(DRVL, "-2.7495") field(HOPR, "2.7773") field(LOPR, "-2.7495") field(PREC, "7") field(EGU, "kG-m") field(MDEL, "-1") field(OMSL, "supervisory") # field(DOL, "") field(OUT, "BEND:LTUS:764:B2IDES PP") info(autosaveFields,"VAL") } record(sub, "BEND:LTUS:764:B2IDES") { field(DESC, "Convert Desired B-Field to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "BEND:LTUS:764:POLYCOEF") field(INPC, "BEND:LTUS:764:POLYCOEF.A") field(INPD, "BEND:LTUS:764:POLYCOEF.B") field(PREC, "7") field(EGU, "kG-m") field(HOPR, "2.7773") field(LOPR, "-2.7495") field(MDEL, "-1") field(INPE, "BEND:LTUS:764:BDES.DRVH") field(INPF, "BEND:LTUS:764:BDES.DRVL") field(BRSV, "INVALID") field(FLNK, "BEND:LTUS:764:IDES") } record(sub, "BEND:LTUS:764:BNOM") { field(DESC, "Nominal Field") field(PINI, "YES") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "BEND:LTUS:764:POLYCOEF") field(INPC, "BEND:LTUS:764:POLYCOEF.A") field(INPD, "BEND:LTUS:764:POLYCOEF.B") field(INPE, "BEND:LTUS:764:BDES.DRVH") field(INPF, "BEND:LTUS:764:BDES.DRVL") field(EGU, "kG-m") field(HOPR, "2.7773") field(LOPR, "-2.7495") field(PREC, "7") field(VAL, "0.0") field(FLNK, "BEND:LTUS:764:INOM") } record(sub, "BEND:LTUS:764:BACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "BEND:LTUS:764:BDES.VAL") field(INPB, "BEND:LTUS:764:BDES.DRVH") field(INPC, "BEND:LTUS:764:BDES.DRVL") field(INPD, "BEND:LTUS:764:BDELTAS.I") field(INPE, "BEND:LTUS:764:BDELTAS.J") field(INPG, "BEND:LTUS:764:STATE") field(INPH, "BEND:LTUS:764:HSTA") field(EGU, "kG-m") field(HOPR, "2.7773") field(LOPR, "-2.7495") field(PREC, "7") field(BRSV, "INVALID") } record(sub, "BEND:LTUS:764:BMONLIMITS") { field(DESC, "MON Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "BEND:LTUS:764:BDES.VAL") field(INPB, "BEND:LTUS:764:BDES.DRVH") field(INPC, "BEND:LTUS:764:BDES.DRVL") field(INPD, "BEND:LTUS:764:BDELTAS.K") field(INPE, "BEND:LTUS:764:BDELTAS.L") field(INPG, "BEND:LTUS:764:STATE") field(INPH, "BEND:LTUS:764:HSTA") field(EGU, "kG-m") field(HOPR, "2.7773") field(LOPR, "-2.7495") field(PREC, "7") field(BRSV, "INVALID") } record(seq, "BEND:LTUS:764:BLIMITS") { field(DESC, "ACT Limits") field(PREC, "7") field(DOL1, "BEND:LTUS:764:BLIMITS") field(LNK1, "BEND:LTUS:764:BACTLIMITS.F PP") field(DOL2, "BEND:LTUS:764:BACTLIMITS.I") field(LNK2, "BEND:LTUS:764:BACT.HIGH") field(DOL3, "BEND:LTUS:764:BACTLIMITS.J") field(LNK3, "BEND:LTUS:764:BACT.LOW") field(DOL4, "BEND:LTUS:764:BACTLIMITS.K") field(LNK4, "BEND:LTUS:764:BACT.HIHI") field(DOL5, "BEND:LTUS:764:BACTLIMITS.L") field(LNK5, "BEND:LTUS:764:BACT.LOLO") field(DOL6, "BEND:LTUS:764:BLIMITS") field(LNK6, "BEND:LTUS:764:BMONLIMITS.F PP") field(DOL7, "BEND:LTUS:764:BMONLIMITS.I") field(LNK7, "BEND:LTUS:764:BMON.HIGH") field(DOL8, "BEND:LTUS:764:BMONLIMITS.J") field(LNK8, "BEND:LTUS:764:BMON.LOW") field(DOL9, "BEND:LTUS:764:BMONLIMITS.K") field(LNK9, "BEND:LTUS:764:BMON.HIHI") field(DOLA, "BEND:LTUS:764:BMONLIMITS.L") field(LNKA, "BEND:LTUS:764:BMON.LOLO") field(FLNK, "BEND:LTUS:764:ILIMITS") field(SCAN, "5 second") } record(ao, "BEND:LTUS:764:BCTRL") { field(DESC, "B-Perturb") field(PREC, "7") field(EGU, "kG-m") field(DRVH, "2.7773") field(DRVL, "-2.7495") field(HOPR, "2.7773") field(LOPR, "-2.7495") # 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, "BEND:LTUS:764: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, "BEND:LTUS:764:BCTRLGO") { field(DESC, "Update DES and perturb") field(PREC, "7") # Disable BACT limits field(DOL1, "1") field(LNK1, "BEND:LTUS:764:BLIMITS.VAL") # Update BDES with the BCTRL (slider) value field(DOL2, "BEND:LTUS:764:BCTRL.VAL") field(LNK2, "BEND:LTUS:764:BDES PP") field(DOL3, "1") field(LNK3, "BEND:LTUS:764:IDIRECT.PROC PP") field(DOL4, "1") field(LNK4, "BEND:LTUS:764:CHECKSTDZLOST.PROC PP") field(DOL5, "BEND:LTUS:764:BCTRL.VAL") field(LNK5, "BEND:LTUS:764:BCTRLSUB PP") # Re-enable BACT limits field(DOL6, "0") field(LNK6, "BEND:LTUS:764:BLIMITS.VAL") } # Convert B-field to Current and output to ISETPT record(sub, "BEND:LTUS:764:BCTRLSUB") { field(DESC, "Feedback") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "BEND:LTUS:764:POLYCOEF") field(INPC, "BEND:LTUS:764:POLYCOEF.A") field(INPD, "BEND:LTUS:764:POLYCOEF.B") field(INPE, "BEND:LTUS:764:BDES.DRVH") field(INPF, "BEND:LTUS:764:BDES.DRVL") field(PREC, "7") field(EGU, "kG-m") field(HOPR, "2.7773") field(LOPR, "-2.7495") field(MDEL, "-1") field(BRSV, "INVALID") field(FLNK, "BEND:LTUS:764:ISETPT") } record(ao, "BEND:LTUS:764:BDESPREVTRIM") { field(DESC, "trim bdes for undo") field(DTYP, "Soft Channel") field(DRVH, "2.7773") field(DRVL, "-2.7495") field(EGU, "kG-m") field(HOPR, "2.7773") field(LOPR, "-2.7495") field(PREC, "7") field(PINI, "YES") info(autosaveFields,"VAL") } record(stringin, "BEND:LTUS:764:MADNAME") { field(DESC, "MAD deck nomenclature") field(PINI, "YES") field(VAL, "BCXXL2") } record(ai, "BEND:LTUS:764: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, "3508.490441") } record(ao, "BEND:LTUS:764:BMAX") { field(DESC, "Max B-Field") field(DTYP, "Soft Channel") field(DRVH, "2.7773") field(DRVL, "-2.7495") field(EGU, "kG-m") field(HOPR, "2.7773") field(LOPR, "-2.7495") field(PREC, "7") field(PINI, "YES") field(VAL, "2.7773") field(FLNK, "BEND:LTUS:764:BSTEP") } record(ao, "BEND:LTUS:764:BMIN") { field(DESC, "Min B-Field") field(DTYP, "Soft Channel") field(DRVH, "2.7773") field(DRVL, "-2.7495") field(EGU, "kG-m") field(HOPR, "2.7773") field(LOPR, "-2.7495") field(PREC, "7") field(PINI, "YES") field(VAL, "-2.7495") field(FLNK, "BEND:LTUS:764:BSTEP") } record(ao, "BEND:LTUS:764:BDESSAVE") { field(DESC, "bdes for save/load") field(DTYP, "Soft Channel") field(DRVH, "2.7773") field(DRVL, "-2.7495") field(EGU, "kG-m") field(HOPR, "2.7773") field(LOPR, "-2.7495") field(PINI, "YES") field(PREC, "7") } # This record is processed by BEND:LTUS:764: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, "BEND:LTUS:764:BCON") { field(DESC, "Config B-Field ") field(DTYP, "Soft Channel") field(PREC, "7") field(EGU, "kG-m") field(HOPR, "2.7773") field(LOPR, "-2.7495") field(DRVH, "2.7773") field(DRVL, "-2.7495") # Set MINOR Alarm as the default, slaves will set NO_ALARM=0. field(HHSV, "MINOR") field(LLSV, "MINOR") field(HSV, "MINOR") field(LSV, "MINOR") # field(DOL , "") field(OMSL, "supervisory") field(OUT, "BEND:LTUS:764:B2ICON PP") info(autosaveFields,"VAL") } record(sub, "BEND:LTUS:764:B2ICON") { field(DESC, "Convert Desired ICon to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "BEND:LTUS:764:POLYCOEF") field(INPC, "BEND:LTUS:764:POLYCOEF.A") field(INPD, "BEND:LTUS:764:POLYCOEF.B") field(PREC, "7") field(EGU, "kG-m") field(HOPR, "2.7773") field(LOPR, "-2.7495") field(MDEL, "-1") field(INPE, "BEND:LTUS:764:BCON.DRVH") field(INPF, "BEND:LTUS:764:BCON.DRVL") field(BRSV, "INVALID") field(FLNK, "BEND:LTUS:764: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, "BEND:LTUS:764:BSTEP") { field(DESC, "B-Field step size") field(CALC, "(C==3)||(D==3)?0:ABS(A-B)*0.005") field(INPA, "BEND:LTUS:764:BMAX") field(INPB, "BEND:LTUS:764:BMIN") field(INPC, "BEND:LTUS:764:BMIN.SEVR") field(INPD, "BEND:LTUS:764:BMAX.SEVR") field(EGU, "kG-m") 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,"BEND:LTUS:764:BCTRLDISABLECALC") { field(DESC, "Calc for disabling BCTRL") field(ASG, "Internal") field(CALC, "A?2:1") field(INPA, "BEND:LTUS:764:ONLINE CP") field(OUT, "BEND:LTUS:764:BCTRLDISABLEFOUT PP") } record(fanout, "BEND:LTUS:764:BCTRLDISABLEFOUT") { field(DESC, "Disable BCTRL fanout") field(SELM, "Specified") field(SELL, "BEND:LTUS:764:BCTRLDISABLECALC") field(LNK1, "BEND:LTUS:764:BCTRLDISABLE") field(LNK2, "BEND:LTUS:764:BCTRLENABLE") } record(stringout, "BEND:LTUS:764:BCTRLDISABLE") { field(DESC, "Disable BCTRL") field(DTYP, "Soft Channel") field(OUT, "BEND:LTUS:764:BCTRL.ASG") field(VAL, "NOWRITE") field(FLNK, "BEND:LTUS:764:BCTRLDISV_UPDATE") } record(stringout, "BEND:LTUS:764:BCTRLENABLE") { field(DESC, "Enable BCTRL") field(DTYP, "Soft Channel") field(OUT, "BEND:LTUS:764:BCTRL.ASG") field(VAL, "") field(FLNK, "BEND:LTUS:764:BCTRLDISV_UPDATE") } record(calcout, "BEND:LTUS:764:BCTRLDISV_UPDATE") { field(DESC, "Calc for updating BCTRL.DISV") field(ASG, "Internal") field(CALC, "A") field(INPA, "BEND:LTUS:764:ONLINE") field(OUT, "BEND:LTUS:764: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,"BEND:LTUS:764:BACT and MON\n are processed via links from \n BEND:LTUS:764:IACT (device raw value readback 1)\n and\n BEND:LTUS:764: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 BEND:LTUS:764:POLYCOEF\nC = First polynomial coefficient (offset if linear)\nD = Second polynomial coefficient (slope if linear)\nE = BEND:LTUS:764: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,"BEND:LTUS:764:BDES\n is processed when set by CA users or \n BEND:LTUS:764: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,"BEND:LTUS:764: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 BEND:LTUS:764: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 (BEND:LTUS:764: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,"BEND:LTUS:764:B*LIMITS and BEND:LTUS:764:BLIMITS:\n Calculate alarm and warning limits based on \n deltas from BEND:LTUS:764: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,"BEND:LTUS:764: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,"BEND:LTUS:764: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, "BEND:LTUS:764: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, "BEND:LTUS:764:MPSBTOL") { field(DESC, "Absolute mps tol") field(EGU, "kG-m") field(PREC, "2") field(CALC, "ABS(A)*0.02") field(INPA, "BEND:LTUS:764:BMAX") field(PINI, "YES") } # # 21-Aug-2013: K. Luchini # Set channel access security so that users # cannot easily change values. record(ao, "BEND:LTUS:764:MPSBMAX") { field(DESC, "MPS Max B-field") field(EGU, "kG-m") field(PREC, "7") field(DRVH, "2.7773") field(DRVL, "-2.7495") field(PINI, "YES") field(VAL, "2.7773") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:764:MPSBMIN") { field(DESC, "MPS Min B-field") field(EGU, "kG-m") field(PREC, "7") field(DRVH, "2.7773") field(DRVL, "-2.7495") field(PINI, "YES") field(VAL, "-2.7495") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:764:MPSBLLIM") { field(DESC, "MPS Low Limit B-field") field(EGU, "kG-m") field(PREC, "7") field(DRVH, "2.7773") field(DRVL, "-2.7495") field(PINI, "YES") field(VAL, "-2.7495") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:764:MPSBLLIM2") { field(DESC, "MPS Low Limit #2 B-field") field(EGU, "kG-m") field(PREC, "7") field(DRVH, "2.7773") field(DRVL, "-2.7495") field(PINI, "YES") field(VAL, "-2.7495") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } # Set the default to Std record(mbbo, "BEND:LTUS:764: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, "BEND:LTUS:764:MPSLIMITS.E PP") } record(aSub, "BEND:LTUS:764: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, "BEND:LTUS:764:MPS.RVAL") field(INPB, "BEND:LTUS:764:BADIFF") field(INPC, "BEND:LTUS:764:BDELTAS.N") field(INPD, "BEND:LTUS:764:BACT") field(INPE, "BEND:LTUS:764:MPSBITMASK.RVAL") field(INPF, "BEND:LTUS:764:MPSBLLIM") field(INPG, "BEND:LTUS:764:MPSBMIN") field(INPH, "BEND:LTUS:764:MPSBMAX") field(INPI, "BEND:LTUS:764: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, "BEND:LTUS:764:INTOL.RVAL PP") field(OUTB, "BEND:LTUS:764:INTOL_BMIN.RVAL PP") field(OUTC, "BEND:LTUS:764:INTOL_BRANGE.RVAL PP") field(OUTD, "BEND:LTUS:764: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, "BEND:LTUS:764:INTOL") { field(DESC, "BACT within MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "BEND:LTUS:764:MPSLIMITS.VALA") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "BEND:LTUS:764:INTOL_BMIN") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "BEND:LTUS:764:MPSLIMITS.VALB") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "BEND:LTUS:764:INTOL_BMIN2") { field(DESC, "MPS tol #2") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "BEND:LTUS:764:MPSLIMITS.VALD") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "BEND:LTUS:764:INTOL_BRANGE") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "BEND:LTUS:764: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, "BEND:LTUS:764:CHCKITOL") { field(DESC, "Absolute Check I Tolerance") field(EGU, "A") field(FLNK, "BEND:LTUS:764:TRIMITOL") field(CALC, "ABS(A*B)") field(INPA, "BEND:LTUS:764:CHCKBTOL") field(INPB, "BEND:LTUS:764:POLYCOEF.B") field(PREC, "9") } record(calc, "BEND:LTUS:764:TRIMBTOL") { field(EGU, "kG-m") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(DESC, "Absolute Trim Tolerance") field(CALC, "ABS(A)/2") field(INPA, "BEND:LTUS:764:CHCKBTOL") field(FLNK, "BEND:LTUS:764:CHCKITOL") } record(calc, "BEND:LTUS:764:CHCKBTOL") { field(DESC, "Check absolute tolerance") field(EGU, "A") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(FLNK, "BEND:LTUS:764:TRIMBTOL") field(CALC, "MAX(ABS(A),ABS(C))*(B/1000000)") field(INPA, "BEND:LTUS:764:BDES.HOPR") field(INPB, "BEND:LTUS:764:STABILITY") field(INPC, "BEND:LTUS:764:BDES.LOPR") } record(longout, "BEND:LTUS:764: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, "BEND:LTUS:764:CHCKBTOL") } record(calc, "BEND:LTUS:764:TRIMITOL") { field(DESC, "Absolute Trim I Tolerance") field(EGU, "kG-m") field(CALC, "ABS(A*B)") field(INPA, "BEND:LTUS:764:POLYCOEF.B") field(INPB, "BEND:LTUS:764:TRIMBTOL") field(PREC, "9") } record(ai, "BEND:LTUS:764:TRIMBTOLR") { field(DESC, "Relative trim tol") field(PREC, "4") field(EGU, "%") field(HOPR, "1.0") field(LOPR, "0.0") field(PINI, "YES") } record(ai, "BEND:LTUS:764: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, "BEND:LTUS:764:FBCKFCOM") { field(ZNAM, "CA") field(ONAM, "FCOM") field(DESC, "CA Mode") field(PINI, "YES") field(SDIS, "0") } record(bo, "BEND:LTUS:764:PAU") { field(ZNAM, "NotConfigured") field(ONAM, "Configured") field(DESC, "PAU Present") field(PINI, "YES") field(SDIS, "0") field(FLNK, "BEND:LTUS:764:PAUGO") } record(fanout, "BEND:LTUS:764:PAUGO") { field(DESC, "PAU control") field(LNK1, "BEND:LTUS:764:PAUSTOP") field(LNK2, "BEND:LTUS:764: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, "BEND:LTUS:764:PAUSTART") { field(DESC, "Setup for PAU On") field(SDIS, "BEND:LTUS:764: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, "BEND:LTUS:764:PAUSTOP") { field(DESC, "Setup for PAU Off") field(SDIS, "BEND:LTUS:764: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, "BEND:LTUS:764:MCORDEVNAME") { field(DESC, "PS device name") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, "PSC:LTUS:MG22:") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "BEND:LTUS:764: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, "BEND:LTUS:764:PSTYPE.RVAL") field(INPC, "BEND:LTUS:764:TURNEDOFF.RVAL") field(INPD, "BEND:LTUS:764:CONFIG.RVAL") field(INPE, "BEND:LTUS:764:PSCATEGORY.RVAL") field(INPF, "BEND:LTUS:764:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "BEND:LTUS:764:AUTOCTRL.RVAL") field(INPJ, "BEND:LTUS:764:OUTOFSERVICE.RVAL") field(INPL, "BEND:LTUS:764:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "BEND:LTUS:764:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "BEND:LTUS:764:PAU") field(INPP, "BEND:LTUS:764:CALBDISABLE.RVAL") field(INPQ, "BEND:LTUS:764:PTRBDISABLE.RVAL") field(INPR, "BEND:LTUS:764:TRIMDISABLE.RVAL") field(INPS, "BEND:LTUS:764:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "BEND:LTUS:764:FBCK") field(INPU, "BEND:LTUS:764:TRIMTYPE.RVAL") field(INPV, "BEND:LTUS:764:STDZDIRECT.RVAL") field(INPW, "BEND:LTUS:764:DEGAUSENABLE.RVAL") field(FLNK, "BEND:LTUS:764:HSTA") } record(longin, "BEND:LTUS:764:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "BEND:LTUS:764:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "BEND:LTUS:764: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, "BEND:LTUS:764: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, "BEND:LTUS:764:CALBDISABLE") { field(DESC, "DAC Calb Disabled") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "BEND:LTUS:764:PTRBDISABLE") { field(DESC, "Perturb Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "BEND:LTUS:764:TRIMDISABLE") { field(DESC, "Trim Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "BEND:LTUS:764: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 BEND:LTUS:764:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses BEND:LTUS:764:FBCK. # This PV should be replaced by BEND:LTUS:764: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, "BEND:LTUS:764: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, "BEND:LTUS:764: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, "BEND:LTUS:764: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, "") field(OMSL, "supervisory") field(FLNK, "BEND:LTUS:764:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"BEND:LTUS:764:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "BEND:LTUS:764:OUTOFSERVICE NPP NMS") field(OUT, "BEND:LTUS:764:ONLINE PP") } record(bo, "BEND:LTUS:764:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "BEND:LTUS:764: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, "1") } record(bo, "BEND:LTUS:764: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, "1") } record(bo, "BEND:LTUS:764: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, "BEND:LTUS:764: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, "BEND:LTUS:764: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, "BEND:LTUS:764: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, "BEND:LTUS:764: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, "BEND:LTUS:764: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, "1") field(ASG, "NOWRITE") } record(mbbo, "BEND:LTUS:764: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, "1") field(ASG, "NOWRITE") } record(mbbo, "BEND:LTUS:764: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, "2") field(ASG, "NOWRITE") } record(mbbo, "BEND:LTUS:764: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, "0") field(ASG, "NOWRITE") field(FLNK, "BEND:LTUS:764:TRIMTYPE") } record(stringout, "BEND:LTUS:764:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "BEND:LTUS:764:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "BEND:LTUS:764:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "BEND:LTUS:764:STATE.RVAL") field(INPB, "BEND:LTUS:764:INTLKSUMY.RVAL") field(OUT, "BEND:LTUS:764:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "BEND:LTUS:764: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, "BEND:LTUS:764:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "BEND:LTUS:764:STATE.RVAL") field(INPB, "BEND:LTUS:764:INTLKSUMY.RVAL") field(OUT, "BEND:LTUS:764:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "BEND:LTUS:764:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "BEND:LTUS:764:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "BEND:LTUS:764: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, "BEND:LTUS:764:RAMPSTARTDLY") { field(DESC, "Tansition to ramp delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "2") } ######### For PSTYPE=2 Only ############# record(mbbo, "BEND:LTUS:764: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, "BEND:LTUS:764: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,"BEND:LTUS:764: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("BEND:LTUS:764:TURNEDOFF",3140,1907,0,1,"BEND:LTUS:764:TURNEDOFF") #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "BEND:LTUS:764:STATSUB") { field(DESC, "Build STATus ") field(INAM, "mgntInit") field(SNAM, "mgntSlcStat") field(INPA, "BEND:LTUS:764:BACT.STAT") field(INPB, "BEND:LTUS:764:BDES.STAT") field(INPC, "BEND:LTUS:764:IRIPL.STAT") field(INPD, "PSC:LTUS:MG22:ISETPT.STAT") field(INPE, "PSC:LTUS:MG22:IACT.STAT") # 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, "BEND:LTUS:764:BACT.SEVR") field(INPH, "BEND:LTUS:764:BDES.SEVR") field(INPI, "BEND:LTUS:764:IRIPL.SEVR") field(INPJ, "PSC:LTUS:MG22:ISETPT.SEVR") field(INPK, "PSC:LTUS:MG22:IACT.SEVR") # # 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, "BEND:LTUS:764:STATE.RVAL") field(INPN, "BEND:LTUS:764:STDZOK") field(INPO, "BEND:LTUS:764:CALBOK") field(INPP, "BEND:LTUS:764:OUTOFSERVICE.RVAL") field(INPQ, "BEND:LTUS:764:CONFIG.RVAL") field(INPR, "BEND:LTUS:764:HSTA") field(INPS, "BEND:LTUS:764:CTRL.RVAL") field(INPT, "BEND:LTUS:764:DEGAUSOK") field(INPV, "BEND:LTUS:764: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, "BEND:LTUS:764:STAT") } record(longout, "BEND:LTUS:764:STAT") { field(DESC, "STAT sent to SLC") field(SCAN, "Passive") field(FLNK, "BEND:LTUS:764:STATCTRLSUB") field(DOL, "BEND:LTUS:764:STATSUB.VAL") field(OMSL, "closed_loop") } record(sSub, "BEND:LTUS:764:STATCTRLSUB") { field(DESC, "Decode SLC STAT into mbbo") field(INAM, "mgntInit") field(SNAM, "mgntStatDecode") field(INPA, "BEND:LTUS:764:STAT") field(INPB, "BEND:LTUS:764:HSTA") field(INPD, "BEND:LTUS:764:ONOFFCTRL.RVAL") field(FLNK, "BEND:LTUS:764:STATMSG") } record(mbbo, "BEND:LTUS:764: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, "BEND:LTUS:764:UNAVAILGO") field(DOL, "BEND:LTUS:764:STATCTRLSUB.W") } record(seq, "BEND:LTUS:764:UNAVAILGO") { field(DESC, "Process UNAVAIL") field(DOL1, "BEND:LTUS:764:STATSUB.U") field(LNK1, "BEND:LTUS:764:UNAVAIL PP") } record(stringout, "BEND:LTUS:764:SNLSTATMSG") { field(DTYP, "Soft Channel") } #! TextBox(TB0,820,1000,1200,1220,0,"Dialog",12,1,16777215,"BEND:LTUS:764:STATUSSUB - future\nOverall device status - takes input from action snls, record sevrs, master snl(s) and outputs final status\n\nInputs:\nA - BEND:LTUS:764:CTRLSTATUS - snl status\nB - MGNT:CTRLSTATUS - master list status\nC\nD - BEND:LTUS:764: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,"BEND:LTUS:764STATSUB\nformat control bo's into slc STAT\n\nInputs:\nA - BEND:LTUS:764:STATUS\nC - BEND:LTUS:764:ON\nD - BEND:LTUS:764:STDZOK\nE - BEND:LTUS:764:CALBOK\nF - BEND:LTUS:764:BACTDRIFT (future)\nG -\nH- BEND:LTUS:764:DACSTATUS\nI -BEND:LTUS:764:ADCSTATUS\nJ - BEND:LTUS:764:BACTSTATUS\nK - BEND:LTUS:764:BDESSTATUS\nL - BEND:LTUS:764:RIPLSTATUS\n\nOutput:\nP - BEND:LTUS:764: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, "BEND:LTUS:764: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, "BEND:LTUS:764: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, "BEND:LTUS:764: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, "BEND:LTUS:764: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.6 #! DBDSTART #! DBD("../../../../dbd/mgntSoft.dbd") #! DBDEND record(stringout, "BEND:LTUS:764:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:764:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "BEND:LTUS:764:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "BEND:LTUS:764:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "BEND:LTUS:764:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "BEND:LTUS:764:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "1") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "BEND:LTUS:764: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, "BEND:LTUS:764:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "BEND:LTUS:764:TRIMTYPE.RVAL") field(INPB, "BEND:LTUS:764:CONFIG.RVAL") field(OUT, "BEND:LTUS:764:TRIMMAXNUM PP") } record(longout, "BEND:LTUS:764: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, "BEND:LTUS:764: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, "") field(OMSL, "supervisory") field(VAL, "2") field(OUT, "BEND:LTUS:764:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "BEND:LTUS:764: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, "") field(OMSL, "supervisory") field(VAL, "5") } record(bo, "BEND:LTUS:764: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, "BEND:LTUS:764: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, "BEND:LTUS:764: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, "BEND:LTUS:764:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "0") } record(ao, "BEND:LTUS:764: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, "BEND:LTUS:764:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "BEND:LTUS:764: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, "BEND:LTUS:764: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, "BEND:LTUS:764:IMOVE") field(INPB, "BEND:LTUS:764:IACT") field(INPC, "BEND:LTUS:764:IRAMPRATE") field(INPD, "1.577") field(INPE, "BEND:LTUS:764:TRIMDLYPCT") field(INPF, "BEND:LTUS:764:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "BEND:LTUS:764:RAMPTIME_LEFT PP") } record(longout, "BEND:LTUS:764:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "BEND:LTUS:764:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "BEND:LTUS:764:RAMPDONE_CALC") } record(calc, "BEND:LTUS:764:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "BEND:LTUS:764:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "BEND:LTUS:764:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "BEND:LTUS:764: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, "BEND:LTUS:764:RAMPTIME_LEFT") field(OUT, "BEND:LTUS:764:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "BEND:LTUS:764:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "BEND:LTUS:764:RAMPTIME_LEFT NMS") field(OUT, "BEND:LTUS:764:RAMPDONE PP") } record(bo, "BEND:LTUS:764:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "BEND:LTUS:764:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "BEND:LTUS:764: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, "BEND:LTUS:764: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(sSub, "BEND:LTUS:764: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, "BEND:LTUS:764:PSTYPE.RVAL") field(INPC, "BEND:LTUS:764:TURNEDOFF.RVAL") field(INPD, "BEND:LTUS:764:CONFIG.RVAL") field(INPE, "BEND:LTUS:764:PSCATEGORY.RVAL") field(INPF, "BEND:LTUS:764:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "BEND:LTUS:764:AUTOCTRL.RVAL") field(INPJ, "BEND:LTUS:764:OUTOFSERVICE.RVAL") field(INPL, "BEND:LTUS:764:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "BEND:LTUS:764:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "BEND:LTUS:764:PAU") field(INPP, "BEND:LTUS:764:CALBDISABLE.RVAL") field(INPQ, "BEND:LTUS:764:PTRBDISABLE.RVAL") field(INPR, "BEND:LTUS:764:TRIMDISABLE.RVAL") field(INPS, "BEND:LTUS:764:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "BEND:LTUS:764:FBCK") field(INPU, "BEND:LTUS:764:TRIMTYPE.RVAL") field(INPV, "BEND:LTUS:764:STDZDIRECT.RVAL") field(INPW, "BEND:LTUS:764:DEGAUSENABLE.RVAL") field(FLNK, "BEND:LTUS:764:HSTA") } record(longin, "BEND:LTUS:764:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "BEND:LTUS:764:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "BEND:LTUS:764: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, "BEND:LTUS:764: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, "BEND:LTUS:764:CALBDISABLE") { field(DESC, "DAC Calb Disabled") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "BEND:LTUS:764:PTRBDISABLE") { field(DESC, "Perturb Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "BEND:LTUS:764:TRIMDISABLE") { field(DESC, "Trim Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "BEND:LTUS:764:STDZDISABLE") { field(DTYP, "Raw Soft Channel") field(ZNAM, "NO") field(ONAM, "YES") field(DESC, "Standardize Function") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } # This PV has been replaced by BEND:LTUS:764:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses BEND:LTUS:764:FBCK. # This PV should be replaced by BEND:LTUS:764: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, "BEND:LTUS:764: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, "BEND:LTUS:764: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, "BEND:LTUS:764: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, "") field(OMSL, "supervisory") field(FLNK, "BEND:LTUS:764:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"BEND:LTUS:764:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "BEND:LTUS:764:OUTOFSERVICE NPP NMS") field(OUT, "BEND:LTUS:764:ONLINE PP") } record(bo, "BEND:LTUS:764:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "BEND:LTUS:764: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, "1") } record(bo, "BEND:LTUS:764: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, "1") } record(bo, "BEND:LTUS:764: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, "BEND:LTUS:764: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, "BEND:LTUS:764: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, "BEND:LTUS:764: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, "BEND:LTUS:764: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, "BEND:LTUS:764: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, "1") field(ASG, "NOWRITE") } record(mbbo, "BEND:LTUS:764: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, "1") field(ASG, "NOWRITE") } record(mbbo, "BEND:LTUS:764: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, "2") field(ASG, "NOWRITE") } record(mbbo, "BEND:LTUS:764: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, "2") field(ASG, "NOWRITE") field(FLNK, "BEND:LTUS:764:TRIMTYPE") } record(stringout, "BEND:LTUS:764:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "BEND:LTUS:764:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "BEND:LTUS:764:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "BEND:LTUS:764:STATE.RVAL") field(INPB, "BEND:LTUS:764:INTLKSUMY.RVAL") field(OUT, "BEND:LTUS:764:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "BEND:LTUS:764: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, "BEND:LTUS:764:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "BEND:LTUS:764:STATE.RVAL") field(INPB, "BEND:LTUS:764:INTLKSUMY.RVAL") field(OUT, "BEND:LTUS:764:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "BEND:LTUS:764:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "BEND:LTUS:764:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "BEND:LTUS:764: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, "BEND:LTUS:764:RAMPSTARTDLY") { field(DESC, "Tansition to ramp delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "2") } ######### For PSTYPE=2 Only ############# record(mbbo, "BEND:LTUS:764: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, "BEND:LTUS:764: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,"BEND:LTUS:764: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("BEND:LTUS:764:TURNEDOFF",3140,1907,0,1,"BEND:LTUS:764:TURNEDOFF") #! 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, "QUAD:LTUS:110:IACT") { field(DESC, "Current") field(INP, "PSC:LTUS:MG01:IACT") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "QUAD:LTUS:110:BACT") info(autosaveFields,"HYST") } record(bi, "QUAD:LTUS:110:STATE") { field(DESC, "PS On/Off Status") field(DTYP, "Raw Soft Channel") field(INP, "PSC:LTUS:MG01:STATE NPP MS") field(ZSV, "MAJOR") field(ZNAM, "OFF") field(ONAM, "ON") } record(ao, "QUAD:LTUS:110:IDES") { field(DESC, "Desired Current") field(PREC, "3") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(MDEL, "-1") field(HIHI, "120.0") field(LOLO, "-120.0") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "QUAD:LTUS:110:BDELTAS") field(DRVH, "120.0") field(DRVL, "-120.0") field(DOL, "QUAD:LTUS:110: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, "QUAD:LTUS:110:ICTRL PP") } # This record is processed by QUAD:LTUS:110:ICON") # Note: we are not setting alarms here. record(ao, "QUAD:LTUS:110:ICON") { field(DESC, "Config I") field(DTYP, "Soft Channel") field(PREC, "3") field(HOPR, "120.0") field(LOPR, "-120.0") field(DRVH, "120.0") field(DRVL, "-120.0") field(DOL, "QUAD:LTUS:110:B2ICON.K") field(OMSL, "closed_loop") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:110:INOM") { field(DESC, "Nominal Current") field(DOL, "QUAD:LTUS:110:BNOM.K") field(OMSL, "closed_loop") field(PREC, "3") field(EGU, "A") field(DRVH, "120.0") field(DRVL, "-120.0") field(HOPR, "120.0") field(LOPR, "-120.0") } record(ao, "QUAD:LTUS:110:ICTRL") { field(DESC, "Set Current") field(PREC, "3") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(DRVH, "120.0") field(DRVL, "-120.0") field(MDEL, "-1") field(FLNK, "QUAD:LTUS:110:ICTRLGO") field(OMSL, "supervisory") info(autosavefields,"VAL") } record(seq, "QUAD:LTUS:110:ICTRLGO") { field(DESC, "Process Current Setpoint") field(PREC, "3") # Set ISETPT to supervisory field(DOL1, "0") field(LNK1, "QUAD:LTUS:110:ISETPT.OMSL") field(DOL2, "QUAD:LTUS:110:ICTRL") field(LNK2, "QUAD:LTUS:110:ISETPT PP") # Set ISETPT to closed loop - get data from BCTRLSUB.K field(DOL3, "1") field(LNK3, "QUAD:LTUS:110:ISETPT.OMSL") } record(ao, "QUAD:LTUS:110:IMAX") { field(DESC, "Max I") field(DTYP, "Soft Channel") field(DRVH, "120.0") field(DRVL, "-120.0") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(PREC, "3") field(PINI, "YES") field(VAL, "120.0") field(FLNK, "QUAD:LTUS:110:IMIN") } record(ao, "QUAD:LTUS:110:IMIN") { field(DESC, "Min I") field(DTYP, "Soft Channel") field(DRVH, "120.0") field(DRVL, "-120.0") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(PREC, "3") field(VAL, "-120.0") field(FLNK, "QUAD:LTUS:110:IRANGE") } record(sel, "QUAD:LTUS:110:IACTPREVOK") { field(DESC, "Last Good Current") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(PREC, "3") field(NVL, "QUAD:LTUS:110:BACT.SEVR") field(INPA, "QUAD:LTUS:110:IACT NPP MS") field(INPB, "QUAD:LTUS:110:IACTPREVOK NPP MS") field(INPC, "QUAD:LTUS:110:IACTPREVOK NPP MS") field(INPD, "QUAD:LTUS:110:IACTPREVOK NPP MS") } record(sub, "QUAD:LTUS:110:IACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:110:IDES") field(INPB, "QUAD:LTUS:110:ISETPT.DRVH") field(INPC, "QUAD:LTUS:110:ISETPT.DRVL") field(INPD, "QUAD:LTUS:110:IDELTAS.I") field(INPE, "QUAD:LTUS:110:IDELTAS.J") field(INPG, "QUAD:LTUS:110:STATE") field(INPH, "QUAD:LTUS:110:HSTA") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(PREC, "3") field(BRSV, "INVALID") } record(sub, "QUAD:LTUS:110:IMONLIMITS") { field(DESC, "Aux Current Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:110:IDES") field(INPB, "QUAD:LTUS:110:ISETPT.DRVH") field(INPC, "QUAD:LTUS:110:ISETPT.DRVL") field(INPD, "QUAD:LTUS:110:IDELTAS.K") field(INPE, "QUAD:LTUS:110:IDELTAS.L") field(INPG, "QUAD:LTUS:110:STATE") field(INPH, "QUAD:LTUS:110:HSTA") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(PREC, "3") field(BRSV, "INVALID") } record(seq, "QUAD:LTUS:110:ILIMITS") { field(DESC, "Set ACT and MON Limits") field(PREC, "3") field(DOL1, "QUAD:LTUS:110:BLIMITS") field(LNK1, "QUAD:LTUS:110:IACTLIMITS.F PP") field(DOL2, "QUAD:LTUS:110:IACTLIMITS.I") field(LNK2, "QUAD:LTUS:110:IACT.HIGH") field(DOL3, "QUAD:LTUS:110:IACTLIMITS.J") field(LNK3, "QUAD:LTUS:110:IACT.LOW") field(DOL4, "QUAD:LTUS:110:IACTLIMITS.K") field(LNK4, "QUAD:LTUS:110:IACT.HIHI") field(DOL5, "QUAD:LTUS:110:IACTLIMITS.L") field(LNK5, "QUAD:LTUS:110:IACT.LOLO") field(DOL6, "QUAD:LTUS:110:BLIMITS") field(LNK6, "QUAD:LTUS:110:IMONLIMITS.F PP") field(DOL7, "QUAD:LTUS:110:IMONLIMITS.I") field(LNK7, "QUAD:LTUS:110:IMON.HIGH") field(DOL8, "QUAD:LTUS:110:IMONLIMITS.J") field(LNK8, "QUAD:LTUS:110:IMON.LOW") field(DOL9, "QUAD:LTUS:110:IMONLIMITS.K") field(LNK9, "QUAD:LTUS:110:IMON.HIHI") field(DOLA, "QUAD:LTUS:110:IMONLIMITS.L") field(LNKA, "QUAD:LTUS:110: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, "QUAD:LTUS:110:IDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntRawDeltas") field(INPD, "QUAD:LTUS:110:TRIMBTOL") field(INPE, "QUAD:LTUS:110:CHCKBTOL") field(INPF, "QUAD:LTUS:110:BDELTAS.K") field(INPG, "QUAD:LTUS:110:BDELTAS.L") field(INPH, "QUAD:LTUS:110: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, "QUAD:LTUS:110:STDZITOLR") field(INPC, "QUAD:LTUS:110:STDZITOL") field(FLNK, "") } # All ps controllers with on/off control will set the macro ONOF # as follows: # # ONOF = PSC:LTUS:MG01: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, "QUAD:LTUS:110:STATESETPT") { field(DESC, "PS On/Off") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFF") field(ONAM, "ON") field(OUT, "PSC:LTUS:MG01:STATESETPT PP") 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 = PSC:LTUS:MG01:RESET PP # record(bo, "QUAD:LTUS:110:RESET") { field(DESC, "Interlock Latch Reset") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFF") field(ONAM, "ON") field(HIGH, "1.0") field(OUT, "PSC:LTUS:MG01:RESET PP") } record(bo, "QUAD:LTUS:110:RAMPSTATE") { field(DESC, "PS Ramp Status") field(DTYP, "Soft Channel") field(DOL, "PSC:LTUS:MG01:RAMPSTATE NPP 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, "QUAD:LTUS:110: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, "QUAD:LTUS:110:TRIMRAMPRATE") field(OUT, "PSC:LTUS:MG01:IRAMPRATE PP") field(FLNK, "QUAD:LTUS:110:STDZDLY") } record(ao, "QUAD:LTUS:110:ISETPT") { field(DESC, "Current Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(DRVH, "120.0") field(DRVL, "-120.0") field(MDEL, "-1") field(OUT, "PSC:LTUS:MG01:ISETPT PP") field(DOL, "QUAD:LTUS:110: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, "QUAD:LTUS:110:IMON") { field(DESC, "Aux Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(INP, "PSC:LTUS:MG01:IMON") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "QUAD:LTUS:110:BMON") } record(ao, "QUAD:LTUS:110:IRIPL") { field(DESC, "Ripple Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(DOL, "PSC:LTUS:MG01:IRIPL NPP NMS") field(OMSL, "closed_loop") field(EGU, "A") field(DRVH, "1.0") field(HOPR, "1.0") field(PREC, "3") field(FLNK, "QUAD:LTUS:110:IRIPLOK") } record(sub, "QUAD:LTUS:110:IRIPLOK") { field(DESC, "Ripple Current Status") field(INAM, "mgntInit") field(SNAM, "mgntRiplOK") field(INPA, "QUAD:LTUS:110:IRIPL.VAL") field(INPB, "QUAD:LTUS:110: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, "QUAD:LTUS:110:R") { field(DESC, "Resistance") field(EGU, "Ohms") field(PREC, "4") field(PINI, "YES") field(DOL, "PSC:LTUS:MG01:R NPP MS") 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, "QUAD:LTUS:110:IGND") { field(DESC, "Ground Current") field(EGU, "A") field(PREC, "6") field(PINI, "YES") field(DOL, "PSC:LTUS:MG01:IGND NPP MS") field(OMSL, "closed_loop") } record(bi, "QUAD:LTUS:110:INTLKSUMY") { field(DESC, "Interlock Summary") field(INP, "PSC:LTUS:MG01:INTLKSUMY NPP MS") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(ZNAM, "OK") field(ONAM, "FAULT") field(PINI, "NO") } record(mbbo, "QUAD:LTUS:110: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, "PSC:LTUS:MG01:COOLING") field(OMSL, "closed_loop") } # The following PV is processed by :BACTFO # which is processed by :BACT record(fanout, "QUAD:LTUS:110:IACTFO") { field(DESC, "IACT processing") field(SELM, "All") field(LNK1, "QUAD:LTUS:110:IACTPREVOK") field(LNK2, "QUAD:LTUS:110:IDIFF") field(LNK3, "QUAD:LTUS:110:IADIFF") field(LNK4, "QUAD:LTUS:110:IRATIO") field(LNK5, "QUAD:LTUS:110:IDIRECT") field(LNK6, "QUAD:LTUS:110:IACTPOL_CHECK") } record(calc, "QUAD:LTUS:110:IDIFF") { field(DESC, "IDES-IACT") field(CALC, "A-B") field(INPA, "QUAD:LTUS:110:IDES") field(INPB, "QUAD:LTUS:110:IACT") field(EGU, "A") field(PREC, "9") field(HOPR, "120.0") field(LOPR, "-120.0") } record(calc, "QUAD:LTUS:110:IADIFF") { field(DESC, "Absolute IDES-IACT") field(CALC, "A<0?ABS(A):A") field(INPA, "QUAD:LTUS:110:IDIFF") field(PREC, "9") } record(calc, "QUAD:LTUS:110:IRATIO") { field(DESC, "IDES-IACT/IMAX") field(CALC, "B?A/B:0") field(INPA, "QUAD:LTUS:110:IDIFF") field(INPB, "QUAD:LTUS:110:IDES.DRVH") field(PREC, "9") } record(calcout, "QUAD:LTUS:110:IRANGE") { field(DESC, "Current Range") field(PINI, "YES") field(CALC, "ABS(A-B)") field(INPA, "QUAD:LTUS:110:IMIN") field(INPB, "QUAD:LTUS:110: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, "QUAD:LTUS:110: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, "QUAD:LTUS:110:IACT") field(FLNK, "QUAD:LTUS:110:IACTPOL") } record(bo, "QUAD:LTUS:110:IACTPOL") { field(DESC, "Actual I Polarity") field(DTYP, "Raw Soft Channel") field(DOL, "QUAD:LTUS:110: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,"QUAD:LTUS:110:I*LIMITS:\n Calculate alarm and warning limits based on \n deltas from QUAD:LTUS:110:IDELTAS and the\n QUAD:LTUS:110: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,"QUAD:LTUS:110:IACT: \n Get copy of QUAD:LTUS:110:I. \n",null) #! TextBox(TB12,1280,3100,1760,3200,0,"Dialog",12,1,16777215,"QUAD:LTUS:110: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,"QUAD:LTUS:110:IDES:\n Contains raw value calculated by \nQUAD:LTUS:110: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 \nQUAD:LTUS:110:BDELTAS.\n",null) #! TextBox(TB10,56,1940,316,2340,0,"Dialog",12,1,16777215,"QUAD:LTUS:110: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 QUAD:LTUS:110: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 QUAD:LTUS:110: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,"QUAD:LTUS:110:ISETPT:\n Sets the hardware. When fast feedback is set on, this record is\n set to closed loop mode by QUAD:LTUS:110:FBCKSTART sequence. When \n the loop is closed, this record takes input calculated by \n BFBCK only. When fast feedback is set off, QUAD:LTUS:110:FBCKSTOP \n will set it back to supervisory so that the value can be set by \n QUAD:LTUS:110: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, "QUAD:LTUS:110:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:110:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "QUAD:LTUS:110:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "QUAD:LTUS:110:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "QUAD:LTUS:110:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "QUAD:LTUS:110:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "1") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "QUAD:LTUS:110: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, "QUAD:LTUS:110:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "QUAD:LTUS:110:TRIMTYPE.RVAL") field(INPB, "QUAD:LTUS:110:CONFIG.RVAL") field(OUT, "QUAD:LTUS:110:TRIMMAXNUM PP") } record(longout, "QUAD:LTUS:110: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, "QUAD:LTUS:110: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, "") field(OMSL, "supervisory") field(VAL, "10") field(OUT, "QUAD:LTUS:110:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "QUAD:LTUS:110: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, "") field(OMSL, "supervisory") field(VAL, "10") } record(bo, "QUAD:LTUS:110: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, "QUAD:LTUS:110: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, "QUAD:LTUS:110: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, "QUAD:LTUS:110:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "0") } record(ao, "QUAD:LTUS:110: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, "QUAD:LTUS:110:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "QUAD:LTUS:110: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, "QUAD:LTUS:110: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, "QUAD:LTUS:110:IMOVE") field(INPB, "QUAD:LTUS:110:IACT") field(INPC, "QUAD:LTUS:110:IRAMPRATE") field(INPD, "1.577") field(INPE, "QUAD:LTUS:110:TRIMDLYPCT") field(INPF, "QUAD:LTUS:110:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "QUAD:LTUS:110:RAMPTIME_LEFT PP") } record(longout, "QUAD:LTUS:110:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "QUAD:LTUS:110:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "QUAD:LTUS:110:RAMPDONE_CALC") } record(calc, "QUAD:LTUS:110:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "QUAD:LTUS:110:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "QUAD:LTUS:110:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "QUAD:LTUS:110: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, "QUAD:LTUS:110:RAMPTIME_LEFT") field(OUT, "QUAD:LTUS:110:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "QUAD:LTUS:110:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "QUAD:LTUS:110:RAMPTIME_LEFT NMS") field(OUT, "QUAD:LTUS:110:RAMPDONE PP") } record(bo, "QUAD:LTUS:110:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "QUAD:LTUS:110:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "QUAD:LTUS:110: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, "QUAD:LTUS:110: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, "QUAD:LTUS:110:STDZINIT") { field(DESC, "Proc. Stdz PVs on boot") field(PINI, "YES") field(DOL1, "1") field(DOL2, "1") field(DOL3, "1") field(LNK1, "QUAD:LTUS:110:DEBUG.PROC PP") field(LNK2, "QUAD:LTUS:110:STDZCYCLENUM.PROC PP") field(LNK3, "QUAD:LTUS:110:STDZDISABLE.PROC PP") field(LNK4, "QUAD:LTUS:110: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, "QUAD:LTUS:110:STDZSUB") { field(DESC, "Stdz subroutine") field(INAM, "mgntStdzInit") field(SNAM, "mgntStdz") field(BRSV, "INVALID") field(INPA, "QUAD:LTUS:110:STDZIMIN NPP NMS") field(INPB, "QUAD:LTUS:110:STDZIMAX NPP NMS") field(INPC, "QUAD:LTUS:110:STDZIFINAL NPP NMS") field(INPD, "QUAD:LTUS:110:STDZCYCLENUM NPP NMS") field(INPE, "QUAD:LTUS:110:STDZDIRECT.RVAL NPP NMS") field(INPF, "QUAD:LTUS:110:STDZDISABLE.RVAL CPP NMS") field(INPG, "QUAD:LTUS:110: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, "QUAD:LTUS:110:STDZWF PP") field(OUTB, "QUAD:LTUS:110: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, "QUAD:LTUS:110:STDZWF") } record(mbbo, "QUAD:LTUS:110: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, "QUAD:LTUS:110: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, "QUAD:LTUS:110:STDZMAINPS") { field(DESC, "Stdz by main or self") field(PINI, "YES") field(DTYP, "Soft Channel") field(ZNAM, "SELF") field(ONAM, "MAIN") } record(bo, "QUAD:LTUS:110: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, "QUAD:LTUS:110: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, "QUAD:LTUS:110: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, "QUAD:LTUS:110:STDZTOD") { field(DESC, "Successful Standardize Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "QUAD:LTUS:110:STDZLOSTTOD") { field(DESC, "Standardize Lost Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(longout, "QUAD:LTUS:110:STDZCYCLECNT") { field(DESC, "Cycle Count") field(PINI, "YES") } record(longout, "QUAD:LTUS:110:STDZCYCLENUM") { field(DESC, "No. Standardize Cycles") field(VAL, "3") field(HOPR, "10") field(LOPR, "0") field(DRVH, "10") field(DRVL, "0") field(PINI, "YES") field(FLNK, "QUAD:LTUS:110:STDZDIRECT") } # The default standardize direction is "UP" for # all LCLS Magnets.. record(bo, "QUAD:LTUS:110:STDZDIRECT") { field(DESC, "Standardize Direction ") field(ZNAM, "UP") field(ONAM, "DOWN") field(VAL, "0") field(FLNK, "QUAD:LTUS:110:STDZIMIN") } record(ao, "QUAD:LTUS:110:STDZIMIN") { field(DESC, "Min-STDZ Current") field(PREC, "1") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(VAL, "-120.0") field(FLNK, "QUAD:LTUS:110:STDZIMAX") } record(ao, "QUAD:LTUS:110:STDZIMAX") { field(DESC, "Max. Standarize Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(VAL, "120.0") field(FLNK, "QUAD:LTUS:110:STDZIFINAL") } record(ao, "QUAD:LTUS:110:STDZIFINAL") { field(DESC, "Final SDTZ Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(VAL, "-120.0") field(FLNK, "QUAD:LTUS:110: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, "QUAD:LTUS:110: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, "QUAD:LTUS:110:STDZITOL") { field(DESC, "Stdz min tolerance") field(PREC, "5") field(CALC, "MAX(ABS(A),ABS(B))*C") field(INPA, "QUAD:LTUS:110:STDZIMIN CP NMS") field(INPB, "QUAD:LTUS:110:STDZIMAX CP MMS") field(INPC, "0.05") field(INPD, "QUAD:LTUS:110:STDZITOLR CP MMS") field(EGU, "A") field(FLNK, "QUAD:LTUS:110:IDELTAS") field(PINI, "YES") } # D - factor (3.154/2 = 1.577) for EPSC, otherwise, set to 1.0 record(calc, "QUAD:LTUS:110:STDZDLY") { field(DESC, "Ramp time for stdz cycle") field(CALC, "C>0?MAX(1,ABS((A-B)/C)*D):0") field(INPA, "QUAD:LTUS:110:STDZIMIN CP NMS") field(INPB, "QUAD:LTUS:110:STDZIMAX CP NMS") field(INPC, "QUAD:LTUS:110:TRIMRAMPRATE CP NMS") field(INPD, "1.577") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") } record(calc, "QUAD:LTUS:110:STDZRAMPDLY") { field(DESC, "Ramp delay total") field(CALC, "MAX(1,((A/100)*B+B))") field(PREC, "5") field(INPA, "QUAD:LTUS:110:TRIMDLYPCT CP MS") field(INPB, "QUAD:LTUS:110: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, "QUAD:LTUS:110:STDZMINIDLY") { field(DESC, "Mini-stdz delay") field(CALC, "A") field(PREC, "5") field(A, "1.0") field(EGU, "sec") field(PINI, "YES") } record(ao, "QUAD:LTUS:110: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, "QUAD:LTUS:110:STDZMINIDELTA") { field(DESC, "Stdz mini % of IMAX") field(CALC, "(B/100)*(A-C)") field(INPA, "QUAD:LTUS:110:IDES.HOPR") field(INPB, "QUAD:LTUS:110:STDZMINIPCT CPP NMS") field(INPC, "QUAD:LTUS:110:IDES.LOPR") field(PREC, "5") } record(calc, "QUAD:LTUS:110:STDZMINISETPT") { field(DESC, "Mini Stdz delta") field(CALC, "C==0?MAX(E-D,B):MIN(E+D,A)") field(INPA, "QUAD:LTUS:110:IDES.HOPR") field(INPB, "QUAD:LTUS:110:IDES.LOPR") field(INPC, "QUAD:LTUS:110:STDZDIRECT.RVAL") field(INPD, "QUAD:LTUS:110:STDZMINIDELTA") field(INPE, "QUAD:LTUS:110:IDES") field(PREC, "5") field(FLNK, "QUAD:LTUS:110: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, "QUAD:LTUS:110:STDZMINISETPTOOR") { field(DESC, "Mini Stdz setpoint out of range") field(CALC, "C==0?(E-DA)") field(INPA, "QUAD:LTUS:110:IDES.HOPR") field(INPB, "QUAD:LTUS:110:IDES.LOPR") field(INPC, "QUAD:LTUS:110:STDZDIRECT.RVAL") field(INPD, "QUAD:LTUS:110:STDZMINIDELTA") field(INPE, "QUAD:LTUS:110: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, "QUAD:LTUS:110: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, "QUAD:LTUS:110:IADJUST.RVAL") field(INPB, "QUAD:LTUS:110:STDZDIRECT.RVAL") field(INPC, "QUAD:LTUS:110:STDZOK.RVAL") field(INPD, "QUAD:LTUS:110:STDZDISABLE.RVAL") field(INPE, "QUAD:LTUS:110:STATE.RVAL CPP NMS") field(INPF, "QUAD:LTUS:110:ICTRL.RVAL") field(INPG, "QUAD:LTUS:110:STATE.SEVR") field(INPH, "QUAD:LTUS:110:BDELTAS.M") field(INPI, "QUAD:LTUS:110:IACT.SEVR") field(OUT, "QUAD:LTUS:110:STDZLOSTGO.SELN PP NMS") field(OOPT, "Transition To Non-zero") } record(seq, "QUAD:LTUS:110:STDZLOSTGO") { field(DESC, "Process lost stdz") field(SELM, "Mask") field(DOL1, "1") field(DOL2, "0") field(LNK1, "QUAD:LTUS:110:STDZLOSTTOD.PROC") field(LNK2, "QUAD:LTUS:110:STDZOK PP") } # Record maximum current after standardize # Reset to IACT from sequence after trim # Disable processing during (mini-)standardize or trim record(calc, "QUAD:LTUS:110:STDZIACTMAX") { field(DESC, "Max act current after stdz") field(CALC, "MAX(A, B)") field(DISV, "0") field(SDIS, "QUAD:LTUS:110:CHECKPWRDIP_ENABLE") field(INPA, "QUAD:LTUS:110:IACT CP") field(INPB, "QUAD:LTUS:110:STDZIACTMAX") field(EGU, "A") field(FLNK, "QUAD:LTUS:110:CHECKPWRDIP") } # Detect power dip if STDZOK is YES, STDZ is enabled, and IACT is valid # If IACT drops below STDZIACTMAX by more than the trim tolerance, clear STDZOK # Warning: Take the absolute value of the trim tolerance, or else quads of # negative polarity will always lose STDZ since their IDELTAS.I are negative. # Note: Large quads and bends are prone to losing STDZ even if they are # perturbed toward higher current since their current tends to overshoot # by greater than the trim tolerance before settling down. record(calcout, "QUAD:LTUS:110:CHECKPWRDIP") { field(DESC, "Detect power dip") field(CALC, "(A-B>ABS(C))?3:0") field(DISV, "0") field(SDIS, "QUAD:LTUS:110:CHECKPWRDIP_ENABLE") field(INPA, "QUAD:LTUS:110:STDZIACTMAX") field(INPB, "QUAD:LTUS:110:IACT") field(INPC, "QUAD:LTUS:110:IDELTAS.I") field(OUT, "QUAD:LTUS:110:STDZLOSTGO.SELN PP NMS") field(OOPT, "When Non-zero") } # Enable processing of STDZIACTMAX and CHECKPWRDIP only if # STDZOK = YES, STDZDISABLE = NO, CTRL != Trim (2), and # CTRL != Stdz (4) record(calc, "QUAD:LTUS:110:CHECKPWRDIP_ENABLE") { field(CALC, "A&&!B&&(C#2)&&(C#4)") field(INPA, "QUAD:LTUS:110:STDZOK.RVAL CP") field(INPB, "QUAD:LTUS:110:STDZDISABLE.RVAL CP") field(INPC, "QUAD:LTUS:110:CTRL.RVAL CP") } #! 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, "QUAD:LTUS:110: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, "QUAD:LTUS:110:CALBOK") { field(DESC, "Successful Calibration") field(DTYP, "Raw Soft Channel") field(ZNAM, "NO") field(ONAM, "YES") field(DOL, "PSC:LTUS:MG01:CALBOK.RVAL") field(OMSL, "closed_loop") 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, "QUAD:LTUS:110:CALBSET") { field(DESC, "Use DAC Calbration") field(SCAN, "10 second") field(CALC, "A&&(B==0)&&C?31:960") field(INPA, "QUAD:LTUS:110:CALBOK") field(INPB, "QUAD:LTUS:110:CALBDISABLE") field(INPC, "QUAD:LTUS:110:CALBSLOPE") field(OOPT, "On Change") field(OUT, "QUAD:LTUS:110: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, "QUAD:LTUS:110:CALB_SEQ") { field(DESC, "Output Calib Values") field(SELM, "Mask") field(SELL, "QUAD:LTUS:110: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, "QUAD:LTUS:110:CALBSLOPE") field(DOL3, "QUAD:LTUS:110: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, "QUAD:LTUS:110:CALBTOD") { field(DESC, "Calibration Success Time") field(PINI, "YES") field(DOL, "PSC:LTUS:MG01:CALBTOD") field(OMSL, "closed_loop") field(DTYP, "Soft Channel") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:110: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, "QUAD:LTUS:110: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, "QUAD:LTUS:110: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, "QUAD:LTUS:110:CALBOFFSET") { field(DESC, "Calc DAC Offset") field(PREC, "6") field(EGU, "Counts") field(PINI, "YES") } record(bo, "QUAD:LTUS:110: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, "QUAD:LTUS:110:DACSLOPE") { field(DESC, "V to DAC slope") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "closed_loop") field(PINI, "YES") field(FLNK, "QUAD:LTUS:110:DACOFFSET") } # Default Offset used in conversion from Volts to DAC Counts record(ao, "QUAD:LTUS:110:DACOFFSET") { field(DESC, "V to DAC offset") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "closed_loop") field(PINI, "YES") field(FLNK, "QUAD:LTUS:110: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, "QUAD:LTUS:110: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, "QUAD:LTUS:110:IACT") field(INPD, "QUAD:LTUS:110:DACSLOPE") field(INPE, "QUAD:LTUS:110:DACOFFSET") field(EGU, "Counts") field(PREC, "6") } record(ao, "QUAD:LTUS:110:DAC") { field(DESC, "DAC Set point") field(EGU, "Counts") field(DOL, "") field(OMSL, "closed_loop") field(PREC, "6") field(PINI, "YES") } record(ao, "QUAD:LTUS:110:CALBIMIN") { field(DESC, "Calibration Min Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(DRVH, "120.0") field(HOPR, "120.0") field(DRVL, "-120.0") field(LOPR, "-120.0") field(PREC, "3") field(EGU, "A") field(VAL, "0.0") field(FLNK, "QUAD:LTUS:110:CALBIMAX") } record(ao, "QUAD:LTUS:110:CALBIMAX") { field(DESC, "Calibration Max Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(DRVH, "120.0") field(HOPR, "120.0") field(LOPR, "-120.0") field(DRVL, "-120.0") field(EGU, "A") field(VAL, "120.0") field(FLNK, "QUAD:LTUS:110:CALBSTEPNUM") } record(ao, "QUAD:LTUS:110:CALBIFINAL") { field(DESC, "Calibration Last Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(PREC, "3") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(VAL, "0") } record(longout, "QUAD:LTUS:110: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, "QUAD:LTUS:110:CALBIDELTA") } record(calc, "QUAD:LTUS:110:CALBIDELTA") { field(DESC, "Step size for CALB") field(CALC, "C=0?0:ABS((A-B)/C)") field(INPA, "QUAD:LTUS:110:CALBIMAX") field(INPB, "QUAD:LTUS:110:CALBIMIN") field(INPC, "QUAD:LTUS:110: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, "QUAD:LTUS:110:CALBIMULT") { field(DESC, "IACT vs ISETPT mult") field(CALC, "C#0||A=0?1:ABS(B/A)") field(INPA, "PSC:LTUS:MG01:ISETPT.DRVH") field(INPB, "PSC:LTUS:MG01:IACT.HOPR") field(INPC, "QUAD:LTUS:110:PSCONTROLLER.RVAL CPP") field(EGU, "A") field(PINI, "YES") } # SNL dbputs DAC values here. 6-10 steps are possible. record(waveform, "QUAD:LTUS:110:CALBICTRLWF") { field(DESC, "ICTRL setpoint array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") } record(waveform, "QUAD:LTUS:110:DACWF") { field(DESC, "DAC count array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:110:DACSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:110:DACSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "QUAD:LTUS:110: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, "QUAD:LTUS:110:CALCDACWF") { field(DESC, "Calc DAC counts array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:110:CALCDACSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:110:CALCDACSA") { field(DESC, "Calc DAC counts") field(DTYP, "Soft Channel") field(INP, "QUAD:LTUS:110: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, "QUAD:LTUS:110:CALBYWF") { field(DESC, "mx + b") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:110:CALBYSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:110:CALBYSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "QUAD:LTUS:110:CALBYWF") field(MALM, "10") field(NELM, "6") field(INDX, "0") field(FTVL, "DOUBLE") } record(waveform, "QUAD:LTUS:110:CALBIACTWF") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:110:CALBIACTSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:110:CALBIACTSA") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(MALM, "10") field(NELM, "6") field(INP, "QUAD:LTUS:110:CALBIACTWF") field(INDX, "0") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:110:CALBLIMITS") } # Check that measured current during calibration is within # tolerance. record(aSub, "QUAD:LTUS:110: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, "QUAD:LTUS:110:CALBSTEPNUM") field(INPB, "QUAD:LTUS:110:CALBIACTWF") field(INPC, "QUAD:LTUS:110: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, "QUAD:LTUS:110: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, "QUAD:LTUS:110:STDZITOL") field(INPH, "QUAD:LTUS:110:DACSLOPE") field(INPI, "QUAD:LTUS:110: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, "QUAD:LTUS:110: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, "QUAD:LTUS:110:CALBSTEPNUM") field(INPB, "QUAD:LTUS:110:CALBIACTWF") field(INPC, "QUAD:LTUS:110:DACWF") field(INPF, "QUAD:LTUS:110: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 QUAD:LTUS:110CALBOK 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, "QUAD:LTUS:110:DEGAUSINIT") { field(DESC, "Proc. Degauss PVs on boot") field(PINI, "YES") field(DOL, "1") field(OUTA, "QUAD:LTUS:110:DEGAUSIMIN.PROC PP") field(OUTB, "QUAD:LTUS:110:DEGAUSIMAX.PROC PP") field(OUTC, "QUAD:LTUS:110:DEGAUSTYPE.PROC PP") field(OUTD, "QUAD:LTUS:110:DEGAUSSTEP.PROC PP") field(OUTE, "QUAD:LTUS:110:MADNAME.PROC PP") field(OUTF, "QUAD:LTUS:110:PSTYPE.PROC PP") field(OUTG, "QUAD:LTUS:110: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, "QUAD:LTUS:110:DEGAUSSUB") { field(DESC, "Degauss subroutine") field(INAM, "mgntDegaussInit") field(SNAM, "mgntDegauss") field(BRSV, "INVALID") field(INPA, "QUAD:LTUS:110:DEGAUSIMIN NPP NMS") field(INPB, "QUAD:LTUS:110:DEGAUSIMAX NPP NMS") field(INPC, "QUAD:LTUS:110:DEGAUSTYPE.RVAL NPP NMS") field(INPE, "QUAD:LTUS:110:DEGAUSMETHOD.RVAL NPP NMS") field(INPF, "QUAD:LTUS:110:PSTYPE NPP NMS") field(INPG, "QUAD:LTUS:110:DEBUG.RVAL NPP NMS") field(INPH, "QUAD:LTUS:110: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, "QUAD:LTUS:110:DEGAUSWF PP") field(OUTB, "QUAD:LTUS:110:DEGAUSMSG PP") field(OUTC, "QUAD:LTUS:110: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, "QUAD:LTUS:110:DEGAUSWF") { field(DESC, "Degauss Setpts") field(NELM, "60") field(FTVL, "DOUBLE") } record(mbbo,"QUAD:LTUS:110: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, "QUAD:LTUS:110: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, "QUAD:LTUS:110: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, "QUAD:LTUS:110: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, "QUAD:LTUS:110: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, "QUAD:LTUS:110:DEGAUSIMIN") { field(DESC, "Min. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "120.0") field(LOPR, "-120.0") field(DRVH, "120.0") field(DRVL, "-120.0") field(VAL, "-120.0") } record(ao, "QUAD:LTUS:110:DEGAUSIMAX") { field(DESC, "Max. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "120.0") field(LOPR, "-120.0") field(DRVH, "120.0") field(DRVL, "-120.0") field(VAL, "120.0") } # 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,"QUAD:LTUS:110: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, "QUAD:LTUS:110: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,"QUAD:LTUS:110: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, "QUAD:LTUS:110: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, "QUAD:LTUS:110: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, "QUAD:LTUS:110: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, "QUAD:LTUS:110:DEGAUSTOD") { field(DESC, "Successful Degauss Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "QUAD:LTUS:110:DEGAUSLOSTTOD") { field(DESC, "Degauss Lost Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:110:DEGAUSTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "QUAD:LTUS:110:DEGAUSTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "QUAD:LTUS:110: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, "QUAD:LTUS:110:DEGAUSGO") { field(DESC, "Set bdes of btrms to zero") field(ASG, "Internal") field(OUTA, "") field(OUTB, "") field(OUTC, "") field(OUTD, "") } # =========== CRYO ONLY =========== record(bo, "QUAD:LTUS:110: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, "QUAD:LTUS:110:DEGAUS_IMAX_CHECK") { field(DESC, "Check if imax shoud chg") field(CALC, "(C==4)&&(ABS(B)>ABS(A))?1:0") field(INPA, "QUAD:LTUS:110:DEGAUS_IMAX") field(INPB, "QUAD:LTUS:110:ISETPT") field(INPC, "QUAD:LTUS:110:DEGAUSTYPE.RVAL") field(OUT, "QUAD:LTUS:110:DEGAUS_IMAX_UPDATE.SELN") field(FLNK, "QUAD:LTUS:110:DEGAUS_IMAX_UPDATE") } record(seq, "QUAD:LTUS:110:DEGAUS_IMAX_UPDATE") { field(DESC, "Degauss IMAX Update") field(SELM, "Specified") field(DOL1, "QUAD:LTUS:110:ISETPT") field(LNK1, "QUAD:LTUS:110:DEGAUS_IMAX PP") } # Set the maximum current after a successful # degauss. This pv is updated by the # sequence. record(ao, "QUAD:LTUS:110:DEGAUS_IMAX") { field(DESC, "Max I set afer a degauss") field(EGU, "Amps") field(PINI, "YES") field(PREC, "6") field(HOPR, "120.0") field(LOPR, "-120.0") field(DRVH, "120.0") field(DRVL, "-120.0") field(VAL, "120.0") field(FLNK, "QUAD:LTUS:110:DEGAUS_IMAXPOL_CHECK") info(autosaveFields,"VAL,RVAL") } # Set the polarity if degauss_imax record(calcout, "QUAD:LTUS:110:DEGAUS_IMAXPOL_CHECK") { field(DESC, "Determine polarity of imax") field(CALC, "A>=0?0:1") field(INPA, "QUAD:LTUS:110:DEGAUS_IMAX") field(FLNK, "QUAD:LTUS:110:DEGAUS_IMAXPOL") } record(bo, "QUAD:LTUS:110:DEGAUS_IMAXPOL") { field(DESC, "Polarity of imax I") field(DTYP, "Raw Soft Channel") field(DOL, "QUAD:LTUS:110:DEGAUS_IMAXPOL_CHECK") field(OMSL, "closed_loop") field(ZNAM, "Positive") field(ONAM, "Negative") field(FLNK, "QUAD:LTUS:110: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, "QUAD:LTUS:110:DEGAUS_ABSIMAX") { field(DESC, "Absolute Max. Degauss I") field(CALC, "ABS(A)") field(INPA, "QUAD:LTUS:110:DEGAUS_IMAX") field(PREC, "6") field(EGU, "Amps") field(HOPR, "120.0") field(LOPR, "-120.0") info(autosaveFields,"VAL RVAL") } # IACT Polarity record(calcout, "QUAD:LTUS:110:IACTPOL_CHECK") { field(DESC, "Determine IACT polarity") field(SCAN, "5 second") field(CALC, "ABS(A-B)>C?(A>=0?0:1):D") field(INPA, "QUAD:LTUS:110:IACT") field(INPB, "QUAD:LTUS:110:IACTPOL_CHECK.LA") field(INPC, "0.0001") field(INPD, "QUAD:LTUS:110:IACTPOL_CHECK.PVAL") field(OOPT, "On Change") field(FLNK, "QUAD:LTUS:110:IACTPOL") } record(bo, "QUAD:LTUS:110: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,"QUAD:LTUS:110: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, "QUAD:LTUS:110:DEGAUSENABLE CP") field(INPB, "QUAD:LTUS:110:DEGAUSOK") field(INPC, "QUAD:LTUS:110:STATE CP") field(INPD, "QUAD:LTUS:110:STATE.SEVR") field(OUT, "QUAD:LTUS:110:DEGAUS_STATE_SEQ.SELN PP") field(ASG, "Internal") } record(seq, "QUAD:LTUS:110:DEGAUS_STATE_SEQ") { field(DESC, "Degauss State Sequence") field(SELM, "Specified") field(SELL, "QUAD:LTUS:110:DEGAUS_STATE_CHECK") field(LNK1, "QUAD:LTUS:110:DEGAUS_STATE_DISABLE.PROC PP") field(LNK2, "QUAD:LTUS:110:DEGAUS_STATE_LOST.PROC PP") field(LNK3, "QUAD:LTUS:110:DEGAUS_STATE_GOOD.PROC PP") field(LNK4, "QUAD:LTUS:110: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, "QUAD:LTUS:110:DEGAUS_STATE_DISABLE") { field(DESC, "Degauss not used") field(LNK1, "QUAD:LTUS:110:DEGAUSOK.ZSV") field(LNK2, "QUAD:LTUS:110: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, "QUAD:LTUS:110:STATMSG.FRSV") field(LNK4, "QUAD:LTUS:110: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, "QUAD:LTUS:110:DEGAUS_STATE_LOST") { field(DESC, "Degauss lost and ps On") field(DOL1, "1") field(LNK1, "QUAD:LTUS:110:DEGAUSOK.ZSV") field(LNK2, "QUAD:LTUS:110: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, "QUAD:LTUS:110:STATMSG.FRSV") field(LNK4, "QUAD:LTUS:110: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, "QUAD:LTUS:110:DEGAUS_STATE_OFF") { field(DESC, "Degaused lost and ps Off") field(DOL1, "2") field(LNK1, "QUAD:LTUS:110: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, "QUAD:LTUS:110:STATMSG.FRSV") field(LNK3, "QUAD:LTUS:110: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, "QUAD:LTUS:110:DEGAUS_STATE_GOOD") { field(DESC, "Degauss good") field(DOL1, "1") field(LNK1, "QUAD:LTUS:110: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, "QUAD:LTUS:110:STATMSG.FRSV PP") field(LNK3, "QUAD:LTUS:110:STATMSG.FVSV PP") field(LNK4, "") field(ASG, "Internal") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(mbbo, "QUAD:LTUS:110:FUNC") { field(DESC, "QUAD:LTUS:110 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, "1") field(THVL, "9") field(FRVL, "10") field(FVVL, "0") field(SXVL, "2") field(SVVL, "8") field(EIVL, "11") field(NIVL, "12") field(TEVL, "13") field(ELVL, "5") field(TVVL, "6") field(TTVL, "7") field(FTVL, "4") field(FFVL, "3") field(OUT, "QUAD:LTUS:110:CTRL CA") } # :CTRL pv is processed at boot in the # sequence mgntCtrl.st Processed in sequence # record(mbbo, "QUAD:LTUS:110:CTRL") { field(DESC, "QUAD:LTUS:110 Control") field(PINI, "NO") field(ZRST, "Ready") field(ONST, "TRIM") field(TWST, "PERTURB") field(THST, "BCON_TO_BDES") field(FRST, "BACT_TO_BDES") field(FVST, "SAVE_BDES") field(SXST, "LOAD_BDES") field(SVST, "UNDO_BDES") field(EIST, "DAC_ZERO") field(NIST, "CALB") field(TEST, "STDZ") field(ELST, "RESET") field(TVST, "TURN_ON") field(TTST, "TURN_OFF") field(FTST, "") field(FFST, "") field(ZRVL, "0") field(ONVL, "2") field(TWVL, "6") field(THVL, "15") field(FRVL, "14") field(FVVL, "11") field(SXVL, "12") field(SVVL, "13") field(EIVL, "7") field(NIVL, "3") field(TEVL, "4") field(ELVL, "8") field(TVVL, "9") field(TTVL, "10") field(FTVL, "0") field(FFVL, "0") field(OUT, "QUAD:LTUS:110:SELECTEN.A PP") field(SDIS, "0") } # If a function has been selected set this unit to busy record(calcout, "QUAD:LTUS:110:SELECTEN") { field(DESC, "Control Select Enable") field(CALC, "A>0?1:A") field(FLNK, "QUAD:LTUS:110:BUSY") } # Set to FREE on IOC reboot record(bo, "QUAD:LTUS:110:BUSY") { field(DESC, "QUAD:LTUS:110 Ctrl Done") field(DOL, "QUAD:LTUS:110:SELECTEN") field(ZNAM, "FREE") field(ONAM, "BUSY") field(PINI, "YES") field(FLNK, "QUAD:LTUS:110:SELECT") } record(bo, "QUAD:LTUS:110:SELECT") { field(ZNAM, "NO") field(ONAM, "YES") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") } record(bo, "QUAD:LTUS:110: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, "QUAD:LTUS:110:CTRLSTATE") { field(DESC, "QUAD:LTUS:110 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("QUAD:LTUS:110:CTRL",20,20,0,0,"QUAD:LTUS:110:CTRL") #! Field("QUAD:LTUS:110:CTRL.OUT",16777215,1,"QUAD:LTUS:110:CTRL.OUT") #! Link("QUAD:LTUS:110:CTRL.OUT","QUAD:LTUS:110:SELECTEN.A") #! Field("QUAD:LTUS:110:CTRL.VAL",16777215,1,"QUAD:LTUS:110:CTRL.VAL") #! Record("QUAD:LTUS:110:SELECTEN",321,381,0,0,"QUAD:LTUS:110:SELECTEN") #! Field("QUAD:LTUS:110:SELECTEN.A",16777215,0,"QUAD:LTUS:110:SELECTEN.A") #! Field("QUAD:LTUS:110:SELECTEN.FLNK",16777215,1,"QUAD:LTUS:110:SELECTEN.FLNK") #! Link("QUAD:LTUS:110:SELECTEN.FLNK","QUAD:LTUS:110:BUSY") #! Field("QUAD:LTUS:110:SELECTEN.VAL",16777215,1,"QUAD:LTUS:110:SELECTEN.VAL") #! Record("QUAD:LTUS:110:BUSY",623,274,0,0,"QUAD:LTUS:110:BUSY") #! Field("QUAD:LTUS:110:BUSY.DOL",16777215,0,"QUAD:LTUS:110:BUSY.DOL") #! Link("QUAD:LTUS:110:BUSY.DOL","QUAD:LTUS:110:SELECTEN.VAL") #! Field("QUAD:LTUS:110:BUSY.FLNK",16777215,1,"QUAD:LTUS:110:BUSY.FLNK") #! Link("QUAD:LTUS:110:BUSY.FLNK","QUAD:LTUS:110:SELECT") #! Record("QUAD:LTUS:110:SELECT",669,508,0,1,"QUAD:LTUS:110:SELECT") #! Record("QUAD:LTUS:110:FUNC",940,120,0,0,"QUAD:LTUS:110:FUNC") #! Field("QUAD:LTUS:110:FUNC.OUT",16777215,0,"QUAD:LTUS:110:FUNC.OUT") #! Link("QUAD:LTUS:110:FUNC.OUT","QUAD:LTUS:110:CTRL.VAL") #! Record("QUAD:LTUS:110:ABORT",193,41,0,0,"QUAD:LTUS:110:ABORT") #! Record("QUAD:LTUS:110:CTRLSTATE",369,34,0,0,"QUAD:LTUS:110: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,"QUAD:LTUS:110:SELECT is used for Multi-device selection.\nIt is enabled when associated QUAD:LTUS:110:CTRL is \"0\" (DONE).\nIt is disabled when associated QUAD:LTUS:110: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,"QUAD:LTUS:110: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, "QUAD:LTUS:110:BCTRL_INIT") { field(DESC, "Process BCTRL on boot") field(PINI, "YES") field(CALC, "A=3?1:0") field(INPA, "QUAD:LTUS:110:BCTRL.SEVR") field(OUT, "QUAD:LTUS:110: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, "QUAD:LTUS:110:BACT") { field(DESC, "Actual B") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "QUAD:LTUS:110:BACT") field(INPB, "QUAD:LTUS:110:POLYCOEF") field(INPC, "QUAD:LTUS:110:POLYCOEF.A") field(INPD, "QUAD:LTUS:110:POLYCOEF.B") field(INPE, "QUAD:LTUS:110:IACT MS") field(INPF, "QUAD:LTUS:110:BDELTAS PP") field(INPG, "100") field(EGU, "kG") field(HOPR, "67.432") field(LOPR, "-67.6998") field(HIHI, "67.432") field(LOLO, "-67.6998") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "67.432") field(LOW, "-67.6998") field(FLNK, "QUAD:LTUS:110: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, "QUAD:LTUS:110:BDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntPhyDeltas") field(EGU, "kG") field(HOPR, "1") field(PREC, "7") field(BRSV, "INVALID") field(INPA, "QUAD:LTUS:110:BDES") field(INPB, "QUAD:LTUS:110:TRIMBTOL") field(INPC, "QUAD:LTUS:110:TRIMBTOLR") field(INPD, "QUAD:LTUS:110:CHCKBTOL") field(INPE, "QUAD:LTUS:110:CHCKBTOLR") field(F, "2.0") field(INPG, "30") field(INPH, "QUAD:LTUS:110:BACT.VAL") # # MPS absolute and relative tolerances field(INPP, "QUAD:LTUS:110:MPSBTOL") field(INPQ, "QUAD:LTUS:110:MPSBTOLR") field(FLNK, "QUAD:LTUS:110:BCONLIMITS") info(autosaveFields,"F") } # This record is processed by BDELTAS record(aSub, "QUAD:LTUS:110:BCONLIMITS") { field(DESC, "Config B-field Limits") field(INAM, "mgntInit") field(SNAM, "mgntBCONLimits") field(INPA, "QUAD:LTUS:110:BDES") field(INPB, "QUAD:LTUS:110:BDELTAS.I") field(INPG, "QUAD:LTUS:110:DEBUG.RVAL") field(FTA, "DOUBLE") field(FTB, "DOUBLE") field(FTG, "ULONG") field(OUTA, "QUAD:LTUS:110:BCON.HIGH") field(OUTB, "QUAD:LTUS:110:BCON.LOW") field(OUTC, "QUAD:LTUS:110:BCON.HIHI") field(OUTD, "QUAD:LTUS:110:BCON.LOLO PP") field(FTVA, "DOUBLE") field(FTVB, "DOUBLE") field(FTVC, "DOUBLE") field(FTVD, "DOUBLE") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:110:IDELTAS") } # The following PV is processed by :BACT # which is processed by :BACT # record(fanout, "QUAD:LTUS:110:BACTFO") { field(DESC, "BACT processing") field(SELM, "All") field(LNK1, "QUAD:LTUS:110:BDIFF") field(LNK2, "QUAD:LTUS:110:BADIFF") field(LNK3, "QUAD:LTUS:110:BRATIO") field(LNK4, "QUAD:LTUS:110:MPSLIMITS") field(LNK5, "QUAD:LTUS:110:I2BSTATUS") field(LNK6, "QUAD:LTUS:110:IACTFO.PROC") } record(calc, "QUAD:LTUS:110:BDIFF") { field(DESC, "BDES-BACT") field(CALC, "A-B") field(INPA, "QUAD:LTUS:110:BDES") field(INPB, "QUAD:LTUS:110:BACT") field(EGU, "kG") field(PREC, "7") } record(calc, "QUAD:LTUS:110:BADIFF") { field(DESC, "Absolute BDES-BACT") field(INPA, "QUAD:LTUS:110:BDIFF") field(EGU, "kG") field(PREC, "7") field(CALC, "A<0?ABS(A):A") } record(calc, "QUAD:LTUS:110:BRATIO") { field(DESC, "BACT Error") field(CALC, "B?A/B:0") field(INPA, "QUAD:LTUS:110:BDIFF") field(INPB, "QUAD:LTUS:110:BDES.HOPR") field(EGU, "kG") field(PREC, "7") } record(mbbi, "QUAD:LTUS:110: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, "QUAD:LTUS:110:BACT.J") } # Note: for a string slave set the MONFL # macro to the following: # MONFL=:IMONCALC MS record(sub, "QUAD:LTUS:110:BMON") { field(DESC, "Second Transductor") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "QUAD:LTUS:110:BMON") field(INPB, "QUAD:LTUS:110:POLYCOEF") field(INPC, "QUAD:LTUS:110:POLYCOEF.A") field(INPD, "QUAD:LTUS:110:POLYCOEF.B") field(INPE, "QUAD:LTUS:110:IMON MS") field(INPF, "QUAD:LTUS:110:BDELTAS.VAL") field(INPG, "100") field(EGU, "kG") field(HOPR, "67.432") field(LOPR, "-67.6998") field(HIHI, "67.432") field(LOLO, "-67.6998") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "67.432") field(LOW, "-67.6998") } # 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=PSC:LTUS:MG01:BDES CP record(ao, "QUAD:LTUS:110:BDES") { field(DESC, "Desired B-Field") field(PINI, "YES") field(DRVH, "67.432") field(DRVL, "-67.6998") field(HOPR, "67.432") field(LOPR, "-67.6998") field(PREC, "7") field(EGU, "kG") field(MDEL, "-1") field(OMSL, "supervisory") # field(DOL, "") field(OUT, "QUAD:LTUS:110:B2IDES PP") info(autosaveFields,"VAL") } record(sub, "QUAD:LTUS:110:B2IDES") { field(DESC, "Convert Desired B-Field to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:110:POLYCOEF") field(INPC, "QUAD:LTUS:110:POLYCOEF.A") field(INPD, "QUAD:LTUS:110:POLYCOEF.B") field(PREC, "7") field(EGU, "kG") field(HOPR, "67.432") field(LOPR, "-67.6998") field(MDEL, "-1") field(INPE, "QUAD:LTUS:110:BDES.DRVH") field(INPF, "QUAD:LTUS:110:BDES.DRVL") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:110:IDES") } record(sub, "QUAD:LTUS:110:BNOM") { field(DESC, "Nominal Field") field(PINI, "YES") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:110:POLYCOEF") field(INPC, "QUAD:LTUS:110:POLYCOEF.A") field(INPD, "QUAD:LTUS:110:POLYCOEF.B") field(INPE, "QUAD:LTUS:110:BDES.DRVH") field(INPF, "QUAD:LTUS:110:BDES.DRVL") field(EGU, "kG") field(HOPR, "67.432") field(LOPR, "-67.6998") field(PREC, "7") field(VAL, "0.0") field(FLNK, "QUAD:LTUS:110:INOM") } record(sub, "QUAD:LTUS:110:BACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:110:BDES.VAL") field(INPB, "QUAD:LTUS:110:BDES.DRVH") field(INPC, "QUAD:LTUS:110:BDES.DRVL") field(INPD, "QUAD:LTUS:110:BDELTAS.I") field(INPE, "QUAD:LTUS:110:BDELTAS.J") field(INPG, "QUAD:LTUS:110:STATE") field(INPH, "QUAD:LTUS:110:HSTA") field(EGU, "kG") field(HOPR, "67.432") field(LOPR, "-67.6998") field(PREC, "7") field(BRSV, "INVALID") } record(sub, "QUAD:LTUS:110:BMONLIMITS") { field(DESC, "MON Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:110:BDES.VAL") field(INPB, "QUAD:LTUS:110:BDES.DRVH") field(INPC, "QUAD:LTUS:110:BDES.DRVL") field(INPD, "QUAD:LTUS:110:BDELTAS.K") field(INPE, "QUAD:LTUS:110:BDELTAS.L") field(INPG, "QUAD:LTUS:110:STATE") field(INPH, "QUAD:LTUS:110:HSTA") field(EGU, "kG") field(HOPR, "67.432") field(LOPR, "-67.6998") field(PREC, "7") field(BRSV, "INVALID") } record(seq, "QUAD:LTUS:110:BLIMITS") { field(DESC, "ACT Limits") field(PREC, "7") field(DOL1, "QUAD:LTUS:110:BLIMITS") field(LNK1, "QUAD:LTUS:110:BACTLIMITS.F PP") field(DOL2, "QUAD:LTUS:110:BACTLIMITS.I") field(LNK2, "QUAD:LTUS:110:BACT.HIGH") field(DOL3, "QUAD:LTUS:110:BACTLIMITS.J") field(LNK3, "QUAD:LTUS:110:BACT.LOW") field(DOL4, "QUAD:LTUS:110:BACTLIMITS.K") field(LNK4, "QUAD:LTUS:110:BACT.HIHI") field(DOL5, "QUAD:LTUS:110:BACTLIMITS.L") field(LNK5, "QUAD:LTUS:110:BACT.LOLO") field(DOL6, "QUAD:LTUS:110:BLIMITS") field(LNK6, "QUAD:LTUS:110:BMONLIMITS.F PP") field(DOL7, "QUAD:LTUS:110:BMONLIMITS.I") field(LNK7, "QUAD:LTUS:110:BMON.HIGH") field(DOL8, "QUAD:LTUS:110:BMONLIMITS.J") field(LNK8, "QUAD:LTUS:110:BMON.LOW") field(DOL9, "QUAD:LTUS:110:BMONLIMITS.K") field(LNK9, "QUAD:LTUS:110:BMON.HIHI") field(DOLA, "QUAD:LTUS:110:BMONLIMITS.L") field(LNKA, "QUAD:LTUS:110:BMON.LOLO") field(FLNK, "QUAD:LTUS:110:ILIMITS") field(SCAN, "5 second") } record(ao, "QUAD:LTUS:110:BCTRL") { field(DESC, "B-Perturb") field(PREC, "7") field(EGU, "kG") field(DRVH, "67.432") field(DRVL, "-67.6998") field(HOPR, "67.432") field(LOPR, "-67.6998") # 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, "QUAD:LTUS:110: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, "QUAD:LTUS:110:BCTRLGO") { field(DESC, "Update DES and perturb") field(PREC, "7") # Disable BACT limits field(DOL1, "1") field(LNK1, "QUAD:LTUS:110:BLIMITS.VAL") # Update BDES with the BCTRL (slider) value field(DOL2, "QUAD:LTUS:110:BCTRL.VAL") field(LNK2, "QUAD:LTUS:110:BDES PP") field(DOL3, "1") field(LNK3, "QUAD:LTUS:110:IDIRECT.PROC PP") field(DOL4, "1") field(LNK4, "QUAD:LTUS:110:CHECKSTDZLOST.PROC PP") field(DOL5, "QUAD:LTUS:110:BCTRL.VAL") field(LNK5, "QUAD:LTUS:110:BCTRLSUB PP") # Re-enable BACT limits field(DOL6, "0") field(LNK6, "QUAD:LTUS:110:BLIMITS.VAL") } # Convert B-field to Current and output to ISETPT record(sub, "QUAD:LTUS:110:BCTRLSUB") { field(DESC, "Feedback") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:110:POLYCOEF") field(INPC, "QUAD:LTUS:110:POLYCOEF.A") field(INPD, "QUAD:LTUS:110:POLYCOEF.B") field(INPE, "QUAD:LTUS:110:BDES.DRVH") field(INPF, "QUAD:LTUS:110:BDES.DRVL") field(PREC, "7") field(EGU, "kG") field(HOPR, "67.432") field(LOPR, "-67.6998") field(MDEL, "-1") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:110:ISETPT") } record(ao, "QUAD:LTUS:110:BDESPREVTRIM") { field(DESC, "trim bdes for undo") field(DTYP, "Soft Channel") field(DRVH, "67.432") field(DRVL, "-67.6998") field(EGU, "kG") field(HOPR, "67.432") field(LOPR, "-67.6998") field(PREC, "7") field(PINI, "YES") info(autosaveFields,"VAL") } record(stringin, "QUAD:LTUS:110:MADNAME") { field(DESC, "MAD deck nomenclature") field(PINI, "YES") field(VAL, "QDBL1") } record(ai, "QUAD:LTUS:110: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, "3224.682425") } record(ao, "QUAD:LTUS:110:BMAX") { field(DESC, "Max B-Field") field(DTYP, "Soft Channel") field(DRVH, "67.432") field(DRVL, "-67.6998") field(EGU, "kG") field(HOPR, "67.432") field(LOPR, "-67.6998") field(PREC, "7") field(PINI, "YES") field(VAL, "67.432") field(FLNK, "QUAD:LTUS:110:BSTEP") } record(ao, "QUAD:LTUS:110:BMIN") { field(DESC, "Min B-Field") field(DTYP, "Soft Channel") field(DRVH, "67.432") field(DRVL, "-67.6998") field(EGU, "kG") field(HOPR, "67.432") field(LOPR, "-67.6998") field(PREC, "7") field(PINI, "YES") field(VAL, "-67.6998") field(FLNK, "QUAD:LTUS:110:BSTEP") } record(ao, "QUAD:LTUS:110:BDESSAVE") { field(DESC, "bdes for save/load") field(DTYP, "Soft Channel") field(DRVH, "67.432") field(DRVL, "-67.6998") field(EGU, "kG") field(HOPR, "67.432") field(LOPR, "-67.6998") field(PINI, "YES") field(PREC, "7") } # This record is processed by QUAD:LTUS:110: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, "QUAD:LTUS:110:BCON") { field(DESC, "Config B-Field ") field(DTYP, "Soft Channel") field(PREC, "7") field(EGU, "kG") field(HOPR, "67.432") field(LOPR, "-67.6998") field(DRVH, "67.432") field(DRVL, "-67.6998") # Set MINOR Alarm as the default, slaves will set NO_ALARM=0. field(HHSV, "MINOR") field(LLSV, "MINOR") field(HSV, "MINOR") field(LSV, "MINOR") # field(DOL , "") field(OMSL, "supervisory") field(OUT, "QUAD:LTUS:110:B2ICON PP") info(autosaveFields,"VAL") } record(sub, "QUAD:LTUS:110:B2ICON") { field(DESC, "Convert Desired ICon to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:110:POLYCOEF") field(INPC, "QUAD:LTUS:110:POLYCOEF.A") field(INPD, "QUAD:LTUS:110:POLYCOEF.B") field(PREC, "7") field(EGU, "kG") field(HOPR, "67.432") field(LOPR, "-67.6998") field(MDEL, "-1") field(INPE, "QUAD:LTUS:110:BCON.DRVH") field(INPF, "QUAD:LTUS:110:BCON.DRVL") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:110: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, "QUAD:LTUS:110:BSTEP") { field(DESC, "B-Field step size") field(CALC, "(C==3)||(D==3)?0:ABS(A-B)*0.005") field(INPA, "QUAD:LTUS:110:BMAX") field(INPB, "QUAD:LTUS:110:BMIN") field(INPC, "QUAD:LTUS:110:BMIN.SEVR") field(INPD, "QUAD:LTUS:110:BMAX.SEVR") field(EGU, "kG") 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,"QUAD:LTUS:110:BCTRLDISABLECALC") { field(DESC, "Calc for disabling BCTRL") field(ASG, "Internal") field(CALC, "A?2:1") field(INPA, "QUAD:LTUS:110:ONLINE CP") field(OUT, "QUAD:LTUS:110:BCTRLDISABLEFOUT PP") } record(fanout, "QUAD:LTUS:110:BCTRLDISABLEFOUT") { field(DESC, "Disable BCTRL fanout") field(SELM, "Specified") field(SELL, "QUAD:LTUS:110:BCTRLDISABLECALC") field(LNK1, "QUAD:LTUS:110:BCTRLDISABLE") field(LNK2, "QUAD:LTUS:110:BCTRLENABLE") } record(stringout, "QUAD:LTUS:110:BCTRLDISABLE") { field(DESC, "Disable BCTRL") field(DTYP, "Soft Channel") field(OUT, "QUAD:LTUS:110:BCTRL.ASG") field(VAL, "NOWRITE") field(FLNK, "QUAD:LTUS:110:BCTRLDISV_UPDATE") } record(stringout, "QUAD:LTUS:110:BCTRLENABLE") { field(DESC, "Enable BCTRL") field(DTYP, "Soft Channel") field(OUT, "QUAD:LTUS:110:BCTRL.ASG") field(VAL, "") field(FLNK, "QUAD:LTUS:110:BCTRLDISV_UPDATE") } record(calcout, "QUAD:LTUS:110:BCTRLDISV_UPDATE") { field(DESC, "Calc for updating BCTRL.DISV") field(ASG, "Internal") field(CALC, "A") field(INPA, "QUAD:LTUS:110:ONLINE") field(OUT, "QUAD:LTUS:110: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,"QUAD:LTUS:110:BACT and MON\n are processed via links from \n QUAD:LTUS:110:IACT (device raw value readback 1)\n and\n QUAD:LTUS:110: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 QUAD:LTUS:110:POLYCOEF\nC = First polynomial coefficient (offset if linear)\nD = Second polynomial coefficient (slope if linear)\nE = QUAD:LTUS:110: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,"QUAD:LTUS:110:BDES\n is processed when set by CA users or \n QUAD:LTUS:110: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,"QUAD:LTUS:110: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 QUAD:LTUS:110: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 (QUAD:LTUS:110: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,"QUAD:LTUS:110:B*LIMITS and QUAD:LTUS:110:BLIMITS:\n Calculate alarm and warning limits based on \n deltas from QUAD:LTUS:110: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,"QUAD:LTUS:110: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,"QUAD:LTUS:110: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, "QUAD:LTUS:110: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, "QUAD:LTUS:110:MPSBTOL") { field(DESC, "Absolute mps tol") field(EGU, "kG") field(PREC, "2") field(CALC, "ABS(A)*0.02") field(INPA, "QUAD:LTUS:110:BMAX") field(PINI, "YES") } # # 21-Aug-2013: K. Luchini # Set channel access security so that users # cannot easily change values. record(ao, "QUAD:LTUS:110:MPSBMAX") { field(DESC, "MPS Max B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "67.432") field(DRVL, "-67.6998") field(PINI, "YES") field(VAL, "67.432") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:110:MPSBMIN") { field(DESC, "MPS Min B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "67.432") field(DRVL, "-67.6998") field(PINI, "YES") field(VAL, "-67.6998") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:110:MPSBLLIM") { field(DESC, "MPS Low Limit B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "67.432") field(DRVL, "-67.6998") field(PINI, "YES") field(VAL, "-67.6998") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:110:MPSBLLIM2") { field(DESC, "MPS Low Limit #2 B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "67.432") field(DRVL, "-67.6998") field(PINI, "YES") field(VAL, "-67.6998") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } # Set the default to Std record(mbbo, "QUAD:LTUS:110: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, "QUAD:LTUS:110:MPSLIMITS.E PP") } record(aSub, "QUAD:LTUS:110: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, "QUAD:LTUS:110:MPS.RVAL") field(INPB, "QUAD:LTUS:110:BADIFF") field(INPC, "QUAD:LTUS:110:BDELTAS.N") field(INPD, "QUAD:LTUS:110:BACT") field(INPE, "QUAD:LTUS:110:MPSBITMASK.RVAL") field(INPF, "QUAD:LTUS:110:MPSBLLIM") field(INPG, "QUAD:LTUS:110:MPSBMIN") field(INPH, "QUAD:LTUS:110:MPSBMAX") field(INPI, "QUAD:LTUS:110: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, "QUAD:LTUS:110:INTOL.RVAL PP") field(OUTB, "QUAD:LTUS:110:INTOL_BMIN.RVAL PP") field(OUTC, "QUAD:LTUS:110:INTOL_BRANGE.RVAL PP") field(OUTD, "QUAD:LTUS:110: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, "QUAD:LTUS:110:INTOL") { field(DESC, "BACT within MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:110:MPSLIMITS.VALA") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "QUAD:LTUS:110:INTOL_BMIN") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:110:MPSLIMITS.VALB") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "QUAD:LTUS:110:INTOL_BMIN2") { field(DESC, "MPS tol #2") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:110:MPSLIMITS.VALD") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "QUAD:LTUS:110:INTOL_BRANGE") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:110: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, "QUAD:LTUS:110:CHCKITOL") { field(DESC, "Absolute Check I Tolerance") field(EGU, "A") field(FLNK, "QUAD:LTUS:110:TRIMITOL") field(CALC, "ABS(A*B)") field(INPA, "QUAD:LTUS:110:CHCKBTOL") field(INPB, "QUAD:LTUS:110:POLYCOEF.B") field(PREC, "9") } record(calc, "QUAD:LTUS:110:TRIMBTOL") { field(EGU, "kG") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(DESC, "Absolute Trim Tolerance") field(CALC, "ABS(A)/2") field(INPA, "QUAD:LTUS:110:CHCKBTOL") field(FLNK, "QUAD:LTUS:110:CHCKITOL") } record(calc, "QUAD:LTUS:110:CHCKBTOL") { field(DESC, "Check absolute tolerance") field(EGU, "A") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(FLNK, "QUAD:LTUS:110:TRIMBTOL") field(CALC, "MAX(ABS(A),ABS(C))*(B/1000000)") field(INPA, "QUAD:LTUS:110:BDES.HOPR") field(INPB, "QUAD:LTUS:110:STABILITY") field(INPC, "QUAD:LTUS:110:BDES.LOPR") } record(longout, "QUAD:LTUS:110: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, "QUAD:LTUS:110:CHCKBTOL") } record(calc, "QUAD:LTUS:110:TRIMITOL") { field(DESC, "Absolute Trim I Tolerance") field(EGU, "kG") field(CALC, "ABS(A*B)") field(INPA, "QUAD:LTUS:110:POLYCOEF.B") field(INPB, "QUAD:LTUS:110:TRIMBTOL") field(PREC, "9") } record(ai, "QUAD:LTUS:110:TRIMBTOLR") { field(DESC, "Relative trim tol") field(PREC, "4") field(EGU, "%") field(HOPR, "1.0") field(LOPR, "0.0") field(PINI, "YES") } record(ai, "QUAD:LTUS:110: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, "QUAD:LTUS:110:FBCKFCOM") { field(ZNAM, "CA") field(ONAM, "FCOM") field(DESC, "CA Mode") field(PINI, "YES") field(SDIS, "0") } record(bo, "QUAD:LTUS:110:PAU") { field(ZNAM, "NotConfigured") field(ONAM, "Configured") field(DESC, "PAU Present") field(PINI, "YES") field(SDIS, "0") field(FLNK, "QUAD:LTUS:110:PAUGO") } record(fanout, "QUAD:LTUS:110:PAUGO") { field(DESC, "PAU control") field(LNK1, "QUAD:LTUS:110:PAUSTOP") field(LNK2, "QUAD:LTUS:110: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, "QUAD:LTUS:110:PAUSTART") { field(DESC, "Setup for PAU On") field(SDIS, "QUAD:LTUS:110: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, "QUAD:LTUS:110:PAUSTOP") { field(DESC, "Setup for PAU Off") field(SDIS, "QUAD:LTUS:110: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, "QUAD:LTUS:110:MCORDEVNAME") { field(DESC, "PS device name") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, "PSC:LTUS:MG01:") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "QUAD:LTUS:110: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, "QUAD:LTUS:110:PSTYPE.RVAL") field(INPC, "QUAD:LTUS:110:TURNEDOFF.RVAL") field(INPD, "QUAD:LTUS:110:CONFIG.RVAL") field(INPE, "QUAD:LTUS:110:PSCATEGORY.RVAL") field(INPF, "QUAD:LTUS:110:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "QUAD:LTUS:110:AUTOCTRL.RVAL") field(INPJ, "QUAD:LTUS:110:OUTOFSERVICE.RVAL") field(INPL, "QUAD:LTUS:110:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "QUAD:LTUS:110:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "QUAD:LTUS:110:PAU") field(INPP, "QUAD:LTUS:110:CALBDISABLE.RVAL") field(INPQ, "QUAD:LTUS:110:PTRBDISABLE.RVAL") field(INPR, "QUAD:LTUS:110:TRIMDISABLE.RVAL") field(INPS, "QUAD:LTUS:110:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "QUAD:LTUS:110:FBCK") field(INPU, "QUAD:LTUS:110:TRIMTYPE.RVAL") field(INPV, "QUAD:LTUS:110:STDZDIRECT.RVAL") field(INPW, "QUAD:LTUS:110:DEGAUSENABLE.RVAL") field(FLNK, "QUAD:LTUS:110:HSTA") } record(longin, "QUAD:LTUS:110:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "QUAD:LTUS:110:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "QUAD:LTUS:110: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, "QUAD:LTUS:110: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, "QUAD:LTUS:110:CALBDISABLE") { field(DESC, "DAC Calb Disabled") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:110:PTRBDISABLE") { field(DESC, "Perturb Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:110:TRIMDISABLE") { field(DESC, "Trim Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:110: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 QUAD:LTUS:110:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses QUAD:LTUS:110:FBCK. # This PV should be replaced by QUAD:LTUS:110: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, "QUAD:LTUS:110: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, "QUAD:LTUS:110: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, "QUAD:LTUS:110: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, "") field(OMSL, "supervisory") field(FLNK, "QUAD:LTUS:110:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"QUAD:LTUS:110:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "QUAD:LTUS:110:OUTOFSERVICE NPP NMS") field(OUT, "QUAD:LTUS:110:ONLINE PP") } record(bo, "QUAD:LTUS:110:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "QUAD:LTUS:110: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, "1") } record(bo, "QUAD:LTUS:110: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, "1") } record(bo, "QUAD:LTUS:110: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, "QUAD:LTUS:110: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, "QUAD:LTUS:110: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, "QUAD:LTUS:110: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, "QUAD:LTUS:110: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, "QUAD:LTUS:110: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, "1") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:110: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, "1") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:110: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, "2") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:110: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, "0") field(ASG, "NOWRITE") field(FLNK, "QUAD:LTUS:110:TRIMTYPE") } record(stringout, "QUAD:LTUS:110:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "QUAD:LTUS:110:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "QUAD:LTUS:110:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "QUAD:LTUS:110:STATE.RVAL") field(INPB, "QUAD:LTUS:110:INTLKSUMY.RVAL") field(OUT, "QUAD:LTUS:110:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:LTUS:110: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, "QUAD:LTUS:110:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "QUAD:LTUS:110:STATE.RVAL") field(INPB, "QUAD:LTUS:110:INTLKSUMY.RVAL") field(OUT, "QUAD:LTUS:110:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:LTUS:110:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "QUAD:LTUS:110:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "QUAD:LTUS:110: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, "QUAD:LTUS:110:RAMPSTARTDLY") { field(DESC, "Tansition to ramp delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "2") } ######### For PSTYPE=2 Only ############# record(mbbo, "QUAD:LTUS:110: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, "QUAD:LTUS:110: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,"QUAD:LTUS:110: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("QUAD:LTUS:110:TURNEDOFF",3140,1907,0,1,"QUAD:LTUS:110:TURNEDOFF") #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "QUAD:LTUS:110:STATSUB") { field(DESC, "Build STATus ") field(INAM, "mgntInit") field(SNAM, "mgntSlcStat") field(INPA, "QUAD:LTUS:110:BACT.STAT") field(INPB, "QUAD:LTUS:110:BDES.STAT") field(INPC, "QUAD:LTUS:110:IRIPL.STAT") field(INPD, "PSC:LTUS:MG01:ISETPT.STAT") field(INPE, "PSC:LTUS:MG01:IACT.STAT") # 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, "QUAD:LTUS:110:BACT.SEVR") field(INPH, "QUAD:LTUS:110:BDES.SEVR") field(INPI, "QUAD:LTUS:110:IRIPL.SEVR") field(INPJ, "PSC:LTUS:MG01:ISETPT.SEVR") field(INPK, "PSC:LTUS:MG01:IACT.SEVR") # # 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, "QUAD:LTUS:110:STATE.RVAL") field(INPN, "QUAD:LTUS:110:STDZOK") field(INPO, "QUAD:LTUS:110:CALBOK") field(INPP, "QUAD:LTUS:110:OUTOFSERVICE.RVAL") field(INPQ, "QUAD:LTUS:110:CONFIG.RVAL") field(INPR, "QUAD:LTUS:110:HSTA") field(INPS, "QUAD:LTUS:110:CTRL.RVAL") field(INPT, "QUAD:LTUS:110:DEGAUSOK") field(INPV, "QUAD:LTUS:110: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, "QUAD:LTUS:110:STAT") } record(longout, "QUAD:LTUS:110:STAT") { field(DESC, "STAT sent to SLC") field(SCAN, "Passive") field(FLNK, "QUAD:LTUS:110:STATCTRLSUB") field(DOL, "QUAD:LTUS:110:STATSUB.VAL") field(OMSL, "closed_loop") } record(sSub, "QUAD:LTUS:110:STATCTRLSUB") { field(DESC, "Decode SLC STAT into mbbo") field(INAM, "mgntInit") field(SNAM, "mgntStatDecode") field(INPA, "QUAD:LTUS:110:STAT") field(INPB, "QUAD:LTUS:110:HSTA") field(INPD, "QUAD:LTUS:110:ONOFFCTRL.RVAL") field(FLNK, "QUAD:LTUS:110:STATMSG") } record(mbbo, "QUAD:LTUS:110: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, "QUAD:LTUS:110:UNAVAILGO") field(DOL, "QUAD:LTUS:110:STATCTRLSUB.W") } record(seq, "QUAD:LTUS:110:UNAVAILGO") { field(DESC, "Process UNAVAIL") field(DOL1, "QUAD:LTUS:110:STATSUB.U") field(LNK1, "QUAD:LTUS:110:UNAVAIL PP") } record(stringout, "QUAD:LTUS:110:SNLSTATMSG") { field(DTYP, "Soft Channel") } #! TextBox(TB0,820,1000,1200,1220,0,"Dialog",12,1,16777215,"QUAD:LTUS:110:STATUSSUB - future\nOverall device status - takes input from action snls, record sevrs, master snl(s) and outputs final status\n\nInputs:\nA - QUAD:LTUS:110:CTRLSTATUS - snl status\nB - MGNT:CTRLSTATUS - master list status\nC\nD - QUAD:LTUS:110: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,"QUAD:LTUS:110STATSUB\nformat control bo's into slc STAT\n\nInputs:\nA - QUAD:LTUS:110:STATUS\nC - QUAD:LTUS:110:ON\nD - QUAD:LTUS:110:STDZOK\nE - QUAD:LTUS:110:CALBOK\nF - QUAD:LTUS:110:BACTDRIFT (future)\nG -\nH- QUAD:LTUS:110:DACSTATUS\nI -QUAD:LTUS:110:ADCSTATUS\nJ - QUAD:LTUS:110:BACTSTATUS\nK - QUAD:LTUS:110:BDESSTATUS\nL - QUAD:LTUS:110:RIPLSTATUS\n\nOutput:\nP - QUAD:LTUS:110: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, "QUAD:LTUS:110: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, "QUAD:LTUS:110: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, "QUAD:LTUS:110: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, "QUAD:LTUS:110: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.6 #! DBDSTART #! DBD("../../../../dbd/mgntSoft.dbd") #! DBDEND record(stringout, "QUAD:LTUS:110:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:110:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "QUAD:LTUS:110:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "QUAD:LTUS:110:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "QUAD:LTUS:110:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "QUAD:LTUS:110:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "1") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "QUAD:LTUS:110: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, "QUAD:LTUS:110:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "QUAD:LTUS:110:TRIMTYPE.RVAL") field(INPB, "QUAD:LTUS:110:CONFIG.RVAL") field(OUT, "QUAD:LTUS:110:TRIMMAXNUM PP") } record(longout, "QUAD:LTUS:110: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, "QUAD:LTUS:110: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, "") field(OMSL, "supervisory") field(VAL, "20") field(OUT, "QUAD:LTUS:110:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "QUAD:LTUS:110: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, "") field(OMSL, "supervisory") field(VAL, "10") } record(bo, "QUAD:LTUS:110: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, "QUAD:LTUS:110: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, "QUAD:LTUS:110: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, "QUAD:LTUS:110:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "0") } record(ao, "QUAD:LTUS:110: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, "QUAD:LTUS:110:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "QUAD:LTUS:110: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, "QUAD:LTUS:110: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, "QUAD:LTUS:110:IMOVE") field(INPB, "QUAD:LTUS:110:IACT") field(INPC, "QUAD:LTUS:110:IRAMPRATE") field(INPD, "1.577") field(INPE, "QUAD:LTUS:110:TRIMDLYPCT") field(INPF, "QUAD:LTUS:110:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "QUAD:LTUS:110:RAMPTIME_LEFT PP") } record(longout, "QUAD:LTUS:110:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "QUAD:LTUS:110:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "QUAD:LTUS:110:RAMPDONE_CALC") } record(calc, "QUAD:LTUS:110:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "QUAD:LTUS:110:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "QUAD:LTUS:110:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "QUAD:LTUS:110: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, "QUAD:LTUS:110:RAMPTIME_LEFT") field(OUT, "QUAD:LTUS:110:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "QUAD:LTUS:110:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "QUAD:LTUS:110:RAMPTIME_LEFT NMS") field(OUT, "QUAD:LTUS:110:RAMPDONE PP") } record(bo, "QUAD:LTUS:110:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "QUAD:LTUS:110:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "QUAD:LTUS:110: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, "QUAD:LTUS:110: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(sSub, "QUAD:LTUS:110: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, "QUAD:LTUS:110:PSTYPE.RVAL") field(INPC, "QUAD:LTUS:110:TURNEDOFF.RVAL") field(INPD, "QUAD:LTUS:110:CONFIG.RVAL") field(INPE, "QUAD:LTUS:110:PSCATEGORY.RVAL") field(INPF, "QUAD:LTUS:110:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "QUAD:LTUS:110:AUTOCTRL.RVAL") field(INPJ, "QUAD:LTUS:110:OUTOFSERVICE.RVAL") field(INPL, "QUAD:LTUS:110:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "QUAD:LTUS:110:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "QUAD:LTUS:110:PAU") field(INPP, "QUAD:LTUS:110:CALBDISABLE.RVAL") field(INPQ, "QUAD:LTUS:110:PTRBDISABLE.RVAL") field(INPR, "QUAD:LTUS:110:TRIMDISABLE.RVAL") field(INPS, "QUAD:LTUS:110:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "QUAD:LTUS:110:FBCK") field(INPU, "QUAD:LTUS:110:TRIMTYPE.RVAL") field(INPV, "QUAD:LTUS:110:STDZDIRECT.RVAL") field(INPW, "QUAD:LTUS:110:DEGAUSENABLE.RVAL") field(FLNK, "QUAD:LTUS:110:HSTA") } record(longin, "QUAD:LTUS:110:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "QUAD:LTUS:110:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "QUAD:LTUS:110: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, "QUAD:LTUS:110: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, "QUAD:LTUS:110:CALBDISABLE") { field(DESC, "DAC Calb Disabled") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:110:PTRBDISABLE") { field(DESC, "Perturb Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:110:TRIMDISABLE") { field(DESC, "Trim Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:110:STDZDISABLE") { field(DTYP, "Raw Soft Channel") field(ZNAM, "NO") field(ONAM, "YES") field(DESC, "Standardize Function") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } # This PV has been replaced by QUAD:LTUS:110:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses QUAD:LTUS:110:FBCK. # This PV should be replaced by QUAD:LTUS:110: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, "QUAD:LTUS:110: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, "QUAD:LTUS:110: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, "QUAD:LTUS:110: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, "") field(OMSL, "supervisory") field(FLNK, "QUAD:LTUS:110:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"QUAD:LTUS:110:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "QUAD:LTUS:110:OUTOFSERVICE NPP NMS") field(OUT, "QUAD:LTUS:110:ONLINE PP") } record(bo, "QUAD:LTUS:110:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "QUAD:LTUS:110: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, "1") } record(bo, "QUAD:LTUS:110: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, "1") } record(bo, "QUAD:LTUS:110: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, "QUAD:LTUS:110: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, "QUAD:LTUS:110: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, "QUAD:LTUS:110: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, "QUAD:LTUS:110: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, "QUAD:LTUS:110: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, "1") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:110: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, "1") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:110: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, "2") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:110: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, "0") field(ASG, "NOWRITE") field(FLNK, "QUAD:LTUS:110:TRIMTYPE") } record(stringout, "QUAD:LTUS:110:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "QUAD:LTUS:110:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "QUAD:LTUS:110:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "QUAD:LTUS:110:STATE.RVAL") field(INPB, "QUAD:LTUS:110:INTLKSUMY.RVAL") field(OUT, "QUAD:LTUS:110:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:LTUS:110: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, "QUAD:LTUS:110:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "QUAD:LTUS:110:STATE.RVAL") field(INPB, "QUAD:LTUS:110:INTLKSUMY.RVAL") field(OUT, "QUAD:LTUS:110:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:LTUS:110:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "QUAD:LTUS:110:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "QUAD:LTUS:110: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, "QUAD:LTUS:110:RAMPSTARTDLY") { field(DESC, "Tansition to ramp delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "2") } ######### For PSTYPE=2 Only ############# record(mbbo, "QUAD:LTUS:110: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, "QUAD:LTUS:110: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,"QUAD:LTUS:110: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("QUAD:LTUS:110:TURNEDOFF",3140,1907,0,1,"QUAD:LTUS:110:TURNEDOFF") #! 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, "QUAD:LTUS:120:IACT") { field(DESC, "Current") field(INP, "PSC:LTUS:MG02:IACT") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "QUAD:LTUS:120:BACT") info(autosaveFields,"HYST") } record(bi, "QUAD:LTUS:120:STATE") { field(DESC, "PS On/Off Status") field(DTYP, "Raw Soft Channel") field(INP, "PSC:LTUS:MG02:STATE NPP MS") field(ZSV, "MAJOR") field(ZNAM, "OFF") field(ONAM, "ON") } record(ao, "QUAD:LTUS:120:IDES") { field(DESC, "Desired Current") field(PREC, "3") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(MDEL, "-1") field(HIHI, "120.0") field(LOLO, "-120.0") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "QUAD:LTUS:120:BDELTAS") field(DRVH, "120.0") field(DRVL, "-120.0") field(DOL, "QUAD:LTUS:120: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, "QUAD:LTUS:120:ICTRL PP") } # This record is processed by QUAD:LTUS:120:ICON") # Note: we are not setting alarms here. record(ao, "QUAD:LTUS:120:ICON") { field(DESC, "Config I") field(DTYP, "Soft Channel") field(PREC, "3") field(HOPR, "120.0") field(LOPR, "-120.0") field(DRVH, "120.0") field(DRVL, "-120.0") field(DOL, "QUAD:LTUS:120:B2ICON.K") field(OMSL, "closed_loop") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:120:INOM") { field(DESC, "Nominal Current") field(DOL, "QUAD:LTUS:120:BNOM.K") field(OMSL, "closed_loop") field(PREC, "3") field(EGU, "A") field(DRVH, "120.0") field(DRVL, "-120.0") field(HOPR, "120.0") field(LOPR, "-120.0") } record(ao, "QUAD:LTUS:120:ICTRL") { field(DESC, "Set Current") field(PREC, "3") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(DRVH, "120.0") field(DRVL, "-120.0") field(MDEL, "-1") field(FLNK, "QUAD:LTUS:120:ICTRLGO") field(OMSL, "supervisory") info(autosavefields,"VAL") } record(seq, "QUAD:LTUS:120:ICTRLGO") { field(DESC, "Process Current Setpoint") field(PREC, "3") # Set ISETPT to supervisory field(DOL1, "0") field(LNK1, "QUAD:LTUS:120:ISETPT.OMSL") field(DOL2, "QUAD:LTUS:120:ICTRL") field(LNK2, "QUAD:LTUS:120:ISETPT PP") # Set ISETPT to closed loop - get data from BCTRLSUB.K field(DOL3, "1") field(LNK3, "QUAD:LTUS:120:ISETPT.OMSL") } record(ao, "QUAD:LTUS:120:IMAX") { field(DESC, "Max I") field(DTYP, "Soft Channel") field(DRVH, "120.0") field(DRVL, "-120.0") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(PREC, "3") field(PINI, "YES") field(VAL, "120.0") field(FLNK, "QUAD:LTUS:120:IMIN") } record(ao, "QUAD:LTUS:120:IMIN") { field(DESC, "Min I") field(DTYP, "Soft Channel") field(DRVH, "120.0") field(DRVL, "-120.0") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(PREC, "3") field(VAL, "-120.0") field(FLNK, "QUAD:LTUS:120:IRANGE") } record(sel, "QUAD:LTUS:120:IACTPREVOK") { field(DESC, "Last Good Current") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(PREC, "3") field(NVL, "QUAD:LTUS:120:BACT.SEVR") field(INPA, "QUAD:LTUS:120:IACT NPP MS") field(INPB, "QUAD:LTUS:120:IACTPREVOK NPP MS") field(INPC, "QUAD:LTUS:120:IACTPREVOK NPP MS") field(INPD, "QUAD:LTUS:120:IACTPREVOK NPP MS") } record(sub, "QUAD:LTUS:120:IACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:120:IDES") field(INPB, "QUAD:LTUS:120:ISETPT.DRVH") field(INPC, "QUAD:LTUS:120:ISETPT.DRVL") field(INPD, "QUAD:LTUS:120:IDELTAS.I") field(INPE, "QUAD:LTUS:120:IDELTAS.J") field(INPG, "QUAD:LTUS:120:STATE") field(INPH, "QUAD:LTUS:120:HSTA") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(PREC, "3") field(BRSV, "INVALID") } record(sub, "QUAD:LTUS:120:IMONLIMITS") { field(DESC, "Aux Current Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:120:IDES") field(INPB, "QUAD:LTUS:120:ISETPT.DRVH") field(INPC, "QUAD:LTUS:120:ISETPT.DRVL") field(INPD, "QUAD:LTUS:120:IDELTAS.K") field(INPE, "QUAD:LTUS:120:IDELTAS.L") field(INPG, "QUAD:LTUS:120:STATE") field(INPH, "QUAD:LTUS:120:HSTA") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(PREC, "3") field(BRSV, "INVALID") } record(seq, "QUAD:LTUS:120:ILIMITS") { field(DESC, "Set ACT and MON Limits") field(PREC, "3") field(DOL1, "QUAD:LTUS:120:BLIMITS") field(LNK1, "QUAD:LTUS:120:IACTLIMITS.F PP") field(DOL2, "QUAD:LTUS:120:IACTLIMITS.I") field(LNK2, "QUAD:LTUS:120:IACT.HIGH") field(DOL3, "QUAD:LTUS:120:IACTLIMITS.J") field(LNK3, "QUAD:LTUS:120:IACT.LOW") field(DOL4, "QUAD:LTUS:120:IACTLIMITS.K") field(LNK4, "QUAD:LTUS:120:IACT.HIHI") field(DOL5, "QUAD:LTUS:120:IACTLIMITS.L") field(LNK5, "QUAD:LTUS:120:IACT.LOLO") field(DOL6, "QUAD:LTUS:120:BLIMITS") field(LNK6, "QUAD:LTUS:120:IMONLIMITS.F PP") field(DOL7, "QUAD:LTUS:120:IMONLIMITS.I") field(LNK7, "QUAD:LTUS:120:IMON.HIGH") field(DOL8, "QUAD:LTUS:120:IMONLIMITS.J") field(LNK8, "QUAD:LTUS:120:IMON.LOW") field(DOL9, "QUAD:LTUS:120:IMONLIMITS.K") field(LNK9, "QUAD:LTUS:120:IMON.HIHI") field(DOLA, "QUAD:LTUS:120:IMONLIMITS.L") field(LNKA, "QUAD:LTUS:120: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, "QUAD:LTUS:120:IDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntRawDeltas") field(INPD, "QUAD:LTUS:120:TRIMBTOL") field(INPE, "QUAD:LTUS:120:CHCKBTOL") field(INPF, "QUAD:LTUS:120:BDELTAS.K") field(INPG, "QUAD:LTUS:120:BDELTAS.L") field(INPH, "QUAD:LTUS:120: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, "QUAD:LTUS:120:STDZITOLR") field(INPC, "QUAD:LTUS:120:STDZITOL") field(FLNK, "") } # All ps controllers with on/off control will set the macro ONOF # as follows: # # ONOF = PSC:LTUS:MG02: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, "QUAD:LTUS:120:STATESETPT") { field(DESC, "PS On/Off") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFF") field(ONAM, "ON") field(OUT, "PSC:LTUS:MG02:STATESETPT PP") 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 = PSC:LTUS:MG02:RESET PP # record(bo, "QUAD:LTUS:120:RESET") { field(DESC, "Interlock Latch Reset") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFF") field(ONAM, "ON") field(HIGH, "1.0") field(OUT, "PSC:LTUS:MG02:RESET PP") } record(bo, "QUAD:LTUS:120:RAMPSTATE") { field(DESC, "PS Ramp Status") field(DTYP, "Soft Channel") field(DOL, "PSC:LTUS:MG02:RAMPSTATE NPP 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, "QUAD:LTUS:120: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, "QUAD:LTUS:120:TRIMRAMPRATE") field(OUT, "PSC:LTUS:MG02:IRAMPRATE PP") field(FLNK, "QUAD:LTUS:120:STDZDLY") } record(ao, "QUAD:LTUS:120:ISETPT") { field(DESC, "Current Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(DRVH, "120.0") field(DRVL, "-120.0") field(MDEL, "-1") field(OUT, "PSC:LTUS:MG02:ISETPT PP") field(DOL, "QUAD:LTUS:120: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, "QUAD:LTUS:120:IMON") { field(DESC, "Aux Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(INP, "PSC:LTUS:MG02:IMON") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "QUAD:LTUS:120:BMON") } record(ao, "QUAD:LTUS:120:IRIPL") { field(DESC, "Ripple Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(DOL, "PSC:LTUS:MG02:IRIPL NPP NMS") field(OMSL, "closed_loop") field(EGU, "A") field(DRVH, "1.0") field(HOPR, "1.0") field(PREC, "3") field(FLNK, "QUAD:LTUS:120:IRIPLOK") } record(sub, "QUAD:LTUS:120:IRIPLOK") { field(DESC, "Ripple Current Status") field(INAM, "mgntInit") field(SNAM, "mgntRiplOK") field(INPA, "QUAD:LTUS:120:IRIPL.VAL") field(INPB, "QUAD:LTUS:120: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, "QUAD:LTUS:120:R") { field(DESC, "Resistance") field(EGU, "Ohms") field(PREC, "4") field(PINI, "YES") field(DOL, "PSC:LTUS:MG02:R NPP MS") 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, "QUAD:LTUS:120:IGND") { field(DESC, "Ground Current") field(EGU, "A") field(PREC, "6") field(PINI, "YES") field(DOL, "PSC:LTUS:MG02:IGND NPP MS") field(OMSL, "closed_loop") } record(bi, "QUAD:LTUS:120:INTLKSUMY") { field(DESC, "Interlock Summary") field(INP, "PSC:LTUS:MG02:INTLKSUMY NPP MS") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(ZNAM, "OK") field(ONAM, "FAULT") field(PINI, "NO") } record(mbbo, "QUAD:LTUS:120: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, "PSC:LTUS:MG02:COOLING") field(OMSL, "closed_loop") } # The following PV is processed by :BACTFO # which is processed by :BACT record(fanout, "QUAD:LTUS:120:IACTFO") { field(DESC, "IACT processing") field(SELM, "All") field(LNK1, "QUAD:LTUS:120:IACTPREVOK") field(LNK2, "QUAD:LTUS:120:IDIFF") field(LNK3, "QUAD:LTUS:120:IADIFF") field(LNK4, "QUAD:LTUS:120:IRATIO") field(LNK5, "QUAD:LTUS:120:IDIRECT") field(LNK6, "QUAD:LTUS:120:IACTPOL_CHECK") } record(calc, "QUAD:LTUS:120:IDIFF") { field(DESC, "IDES-IACT") field(CALC, "A-B") field(INPA, "QUAD:LTUS:120:IDES") field(INPB, "QUAD:LTUS:120:IACT") field(EGU, "A") field(PREC, "9") field(HOPR, "120.0") field(LOPR, "-120.0") } record(calc, "QUAD:LTUS:120:IADIFF") { field(DESC, "Absolute IDES-IACT") field(CALC, "A<0?ABS(A):A") field(INPA, "QUAD:LTUS:120:IDIFF") field(PREC, "9") } record(calc, "QUAD:LTUS:120:IRATIO") { field(DESC, "IDES-IACT/IMAX") field(CALC, "B?A/B:0") field(INPA, "QUAD:LTUS:120:IDIFF") field(INPB, "QUAD:LTUS:120:IDES.DRVH") field(PREC, "9") } record(calcout, "QUAD:LTUS:120:IRANGE") { field(DESC, "Current Range") field(PINI, "YES") field(CALC, "ABS(A-B)") field(INPA, "QUAD:LTUS:120:IMIN") field(INPB, "QUAD:LTUS:120: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, "QUAD:LTUS:120: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, "QUAD:LTUS:120:IACT") field(FLNK, "QUAD:LTUS:120:IACTPOL") } record(bo, "QUAD:LTUS:120:IACTPOL") { field(DESC, "Actual I Polarity") field(DTYP, "Raw Soft Channel") field(DOL, "QUAD:LTUS:120: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,"QUAD:LTUS:120:I*LIMITS:\n Calculate alarm and warning limits based on \n deltas from QUAD:LTUS:120:IDELTAS and the\n QUAD:LTUS:120: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,"QUAD:LTUS:120:IACT: \n Get copy of QUAD:LTUS:120:I. \n",null) #! TextBox(TB12,1280,3100,1760,3200,0,"Dialog",12,1,16777215,"QUAD:LTUS:120: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,"QUAD:LTUS:120:IDES:\n Contains raw value calculated by \nQUAD:LTUS:120: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 \nQUAD:LTUS:120:BDELTAS.\n",null) #! TextBox(TB10,56,1940,316,2340,0,"Dialog",12,1,16777215,"QUAD:LTUS:120: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 QUAD:LTUS:120: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 QUAD:LTUS:120: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,"QUAD:LTUS:120:ISETPT:\n Sets the hardware. When fast feedback is set on, this record is\n set to closed loop mode by QUAD:LTUS:120:FBCKSTART sequence. When \n the loop is closed, this record takes input calculated by \n BFBCK only. When fast feedback is set off, QUAD:LTUS:120:FBCKSTOP \n will set it back to supervisory so that the value can be set by \n QUAD:LTUS:120: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, "QUAD:LTUS:120:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:120:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "QUAD:LTUS:120:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "QUAD:LTUS:120:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "QUAD:LTUS:120:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "QUAD:LTUS:120:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "1") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "QUAD:LTUS:120: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, "QUAD:LTUS:120:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "QUAD:LTUS:120:TRIMTYPE.RVAL") field(INPB, "QUAD:LTUS:120:CONFIG.RVAL") field(OUT, "QUAD:LTUS:120:TRIMMAXNUM PP") } record(longout, "QUAD:LTUS:120: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, "QUAD:LTUS:120: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, "") field(OMSL, "supervisory") field(VAL, "10") field(OUT, "QUAD:LTUS:120:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "QUAD:LTUS:120: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, "") field(OMSL, "supervisory") field(VAL, "10") } record(bo, "QUAD:LTUS:120: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, "QUAD:LTUS:120: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, "QUAD:LTUS:120: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, "QUAD:LTUS:120:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "0") } record(ao, "QUAD:LTUS:120: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, "QUAD:LTUS:120:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "QUAD:LTUS:120: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, "QUAD:LTUS:120: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, "QUAD:LTUS:120:IMOVE") field(INPB, "QUAD:LTUS:120:IACT") field(INPC, "QUAD:LTUS:120:IRAMPRATE") field(INPD, "1.577") field(INPE, "QUAD:LTUS:120:TRIMDLYPCT") field(INPF, "QUAD:LTUS:120:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "QUAD:LTUS:120:RAMPTIME_LEFT PP") } record(longout, "QUAD:LTUS:120:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "QUAD:LTUS:120:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "QUAD:LTUS:120:RAMPDONE_CALC") } record(calc, "QUAD:LTUS:120:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "QUAD:LTUS:120:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "QUAD:LTUS:120:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "QUAD:LTUS:120: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, "QUAD:LTUS:120:RAMPTIME_LEFT") field(OUT, "QUAD:LTUS:120:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "QUAD:LTUS:120:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "QUAD:LTUS:120:RAMPTIME_LEFT NMS") field(OUT, "QUAD:LTUS:120:RAMPDONE PP") } record(bo, "QUAD:LTUS:120:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "QUAD:LTUS:120:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "QUAD:LTUS:120: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, "QUAD:LTUS:120: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, "QUAD:LTUS:120:STDZINIT") { field(DESC, "Proc. Stdz PVs on boot") field(PINI, "YES") field(DOL1, "1") field(DOL2, "1") field(DOL3, "1") field(LNK1, "QUAD:LTUS:120:DEBUG.PROC PP") field(LNK2, "QUAD:LTUS:120:STDZCYCLENUM.PROC PP") field(LNK3, "QUAD:LTUS:120:STDZDISABLE.PROC PP") field(LNK4, "QUAD:LTUS:120: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, "QUAD:LTUS:120:STDZSUB") { field(DESC, "Stdz subroutine") field(INAM, "mgntStdzInit") field(SNAM, "mgntStdz") field(BRSV, "INVALID") field(INPA, "QUAD:LTUS:120:STDZIMIN NPP NMS") field(INPB, "QUAD:LTUS:120:STDZIMAX NPP NMS") field(INPC, "QUAD:LTUS:120:STDZIFINAL NPP NMS") field(INPD, "QUAD:LTUS:120:STDZCYCLENUM NPP NMS") field(INPE, "QUAD:LTUS:120:STDZDIRECT.RVAL NPP NMS") field(INPF, "QUAD:LTUS:120:STDZDISABLE.RVAL CPP NMS") field(INPG, "QUAD:LTUS:120: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, "QUAD:LTUS:120:STDZWF PP") field(OUTB, "QUAD:LTUS:120: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, "QUAD:LTUS:120:STDZWF") } record(mbbo, "QUAD:LTUS:120: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, "QUAD:LTUS:120: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, "QUAD:LTUS:120:STDZMAINPS") { field(DESC, "Stdz by main or self") field(PINI, "YES") field(DTYP, "Soft Channel") field(ZNAM, "SELF") field(ONAM, "MAIN") } record(bo, "QUAD:LTUS:120: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, "QUAD:LTUS:120: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, "QUAD:LTUS:120: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, "QUAD:LTUS:120:STDZTOD") { field(DESC, "Successful Standardize Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "QUAD:LTUS:120:STDZLOSTTOD") { field(DESC, "Standardize Lost Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(longout, "QUAD:LTUS:120:STDZCYCLECNT") { field(DESC, "Cycle Count") field(PINI, "YES") } record(longout, "QUAD:LTUS:120:STDZCYCLENUM") { field(DESC, "No. Standardize Cycles") field(VAL, "3") field(HOPR, "10") field(LOPR, "0") field(DRVH, "10") field(DRVL, "0") field(PINI, "YES") field(FLNK, "QUAD:LTUS:120:STDZDIRECT") } # The default standardize direction is "UP" for # all LCLS Magnets.. record(bo, "QUAD:LTUS:120:STDZDIRECT") { field(DESC, "Standardize Direction ") field(ZNAM, "UP") field(ONAM, "DOWN") field(VAL, "0") field(FLNK, "QUAD:LTUS:120:STDZIMIN") } record(ao, "QUAD:LTUS:120:STDZIMIN") { field(DESC, "Min-STDZ Current") field(PREC, "1") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(VAL, "-120.0") field(FLNK, "QUAD:LTUS:120:STDZIMAX") } record(ao, "QUAD:LTUS:120:STDZIMAX") { field(DESC, "Max. Standarize Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(VAL, "120.0") field(FLNK, "QUAD:LTUS:120:STDZIFINAL") } record(ao, "QUAD:LTUS:120:STDZIFINAL") { field(DESC, "Final SDTZ Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(VAL, "-120.0") field(FLNK, "QUAD:LTUS:120: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, "QUAD:LTUS:120: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, "QUAD:LTUS:120:STDZITOL") { field(DESC, "Stdz min tolerance") field(PREC, "5") field(CALC, "MAX(ABS(A),ABS(B))*C") field(INPA, "QUAD:LTUS:120:STDZIMIN CP NMS") field(INPB, "QUAD:LTUS:120:STDZIMAX CP MMS") field(INPC, "0.05") field(INPD, "QUAD:LTUS:120:STDZITOLR CP MMS") field(EGU, "A") field(FLNK, "QUAD:LTUS:120:IDELTAS") field(PINI, "YES") } # D - factor (3.154/2 = 1.577) for EPSC, otherwise, set to 1.0 record(calc, "QUAD:LTUS:120:STDZDLY") { field(DESC, "Ramp time for stdz cycle") field(CALC, "C>0?MAX(1,ABS((A-B)/C)*D):0") field(INPA, "QUAD:LTUS:120:STDZIMIN CP NMS") field(INPB, "QUAD:LTUS:120:STDZIMAX CP NMS") field(INPC, "QUAD:LTUS:120:TRIMRAMPRATE CP NMS") field(INPD, "1.577") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") } record(calc, "QUAD:LTUS:120:STDZRAMPDLY") { field(DESC, "Ramp delay total") field(CALC, "MAX(1,((A/100)*B+B))") field(PREC, "5") field(INPA, "QUAD:LTUS:120:TRIMDLYPCT CP MS") field(INPB, "QUAD:LTUS:120: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, "QUAD:LTUS:120:STDZMINIDLY") { field(DESC, "Mini-stdz delay") field(CALC, "A") field(PREC, "5") field(A, "1.0") field(EGU, "sec") field(PINI, "YES") } record(ao, "QUAD:LTUS:120: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, "QUAD:LTUS:120:STDZMINIDELTA") { field(DESC, "Stdz mini % of IMAX") field(CALC, "(B/100)*(A-C)") field(INPA, "QUAD:LTUS:120:IDES.HOPR") field(INPB, "QUAD:LTUS:120:STDZMINIPCT CPP NMS") field(INPC, "QUAD:LTUS:120:IDES.LOPR") field(PREC, "5") } record(calc, "QUAD:LTUS:120:STDZMINISETPT") { field(DESC, "Mini Stdz delta") field(CALC, "C==0?MAX(E-D,B):MIN(E+D,A)") field(INPA, "QUAD:LTUS:120:IDES.HOPR") field(INPB, "QUAD:LTUS:120:IDES.LOPR") field(INPC, "QUAD:LTUS:120:STDZDIRECT.RVAL") field(INPD, "QUAD:LTUS:120:STDZMINIDELTA") field(INPE, "QUAD:LTUS:120:IDES") field(PREC, "5") field(FLNK, "QUAD:LTUS:120: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, "QUAD:LTUS:120:STDZMINISETPTOOR") { field(DESC, "Mini Stdz setpoint out of range") field(CALC, "C==0?(E-DA)") field(INPA, "QUAD:LTUS:120:IDES.HOPR") field(INPB, "QUAD:LTUS:120:IDES.LOPR") field(INPC, "QUAD:LTUS:120:STDZDIRECT.RVAL") field(INPD, "QUAD:LTUS:120:STDZMINIDELTA") field(INPE, "QUAD:LTUS:120: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, "QUAD:LTUS:120: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, "QUAD:LTUS:120:IADJUST.RVAL") field(INPB, "QUAD:LTUS:120:STDZDIRECT.RVAL") field(INPC, "QUAD:LTUS:120:STDZOK.RVAL") field(INPD, "QUAD:LTUS:120:STDZDISABLE.RVAL") field(INPE, "QUAD:LTUS:120:STATE.RVAL CPP NMS") field(INPF, "QUAD:LTUS:120:ICTRL.RVAL") field(INPG, "QUAD:LTUS:120:STATE.SEVR") field(INPH, "QUAD:LTUS:120:BDELTAS.M") field(INPI, "QUAD:LTUS:120:IACT.SEVR") field(OUT, "QUAD:LTUS:120:STDZLOSTGO.SELN PP NMS") field(OOPT, "Transition To Non-zero") } record(seq, "QUAD:LTUS:120:STDZLOSTGO") { field(DESC, "Process lost stdz") field(SELM, "Mask") field(DOL1, "1") field(DOL2, "0") field(LNK1, "QUAD:LTUS:120:STDZLOSTTOD.PROC") field(LNK2, "QUAD:LTUS:120:STDZOK PP") } # Record maximum current after standardize # Reset to IACT from sequence after trim # Disable processing during (mini-)standardize or trim record(calc, "QUAD:LTUS:120:STDZIACTMAX") { field(DESC, "Max act current after stdz") field(CALC, "MAX(A, B)") field(DISV, "0") field(SDIS, "QUAD:LTUS:120:CHECKPWRDIP_ENABLE") field(INPA, "QUAD:LTUS:120:IACT CP") field(INPB, "QUAD:LTUS:120:STDZIACTMAX") field(EGU, "A") field(FLNK, "QUAD:LTUS:120:CHECKPWRDIP") } # Detect power dip if STDZOK is YES, STDZ is enabled, and IACT is valid # If IACT drops below STDZIACTMAX by more than the trim tolerance, clear STDZOK # Warning: Take the absolute value of the trim tolerance, or else quads of # negative polarity will always lose STDZ since their IDELTAS.I are negative. # Note: Large quads and bends are prone to losing STDZ even if they are # perturbed toward higher current since their current tends to overshoot # by greater than the trim tolerance before settling down. record(calcout, "QUAD:LTUS:120:CHECKPWRDIP") { field(DESC, "Detect power dip") field(CALC, "(A-B>ABS(C))?3:0") field(DISV, "0") field(SDIS, "QUAD:LTUS:120:CHECKPWRDIP_ENABLE") field(INPA, "QUAD:LTUS:120:STDZIACTMAX") field(INPB, "QUAD:LTUS:120:IACT") field(INPC, "QUAD:LTUS:120:IDELTAS.I") field(OUT, "QUAD:LTUS:120:STDZLOSTGO.SELN PP NMS") field(OOPT, "When Non-zero") } # Enable processing of STDZIACTMAX and CHECKPWRDIP only if # STDZOK = YES, STDZDISABLE = NO, CTRL != Trim (2), and # CTRL != Stdz (4) record(calc, "QUAD:LTUS:120:CHECKPWRDIP_ENABLE") { field(CALC, "A&&!B&&(C#2)&&(C#4)") field(INPA, "QUAD:LTUS:120:STDZOK.RVAL CP") field(INPB, "QUAD:LTUS:120:STDZDISABLE.RVAL CP") field(INPC, "QUAD:LTUS:120:CTRL.RVAL CP") } #! 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, "QUAD:LTUS:120: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, "QUAD:LTUS:120:CALBOK") { field(DESC, "Successful Calibration") field(DTYP, "Raw Soft Channel") field(ZNAM, "NO") field(ONAM, "YES") field(DOL, "PSC:LTUS:MG02:CALBOK.RVAL") field(OMSL, "closed_loop") 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, "QUAD:LTUS:120:CALBSET") { field(DESC, "Use DAC Calbration") field(SCAN, "10 second") field(CALC, "A&&(B==0)&&C?31:960") field(INPA, "QUAD:LTUS:120:CALBOK") field(INPB, "QUAD:LTUS:120:CALBDISABLE") field(INPC, "QUAD:LTUS:120:CALBSLOPE") field(OOPT, "On Change") field(OUT, "QUAD:LTUS:120: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, "QUAD:LTUS:120:CALB_SEQ") { field(DESC, "Output Calib Values") field(SELM, "Mask") field(SELL, "QUAD:LTUS:120: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, "QUAD:LTUS:120:CALBSLOPE") field(DOL3, "QUAD:LTUS:120: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, "QUAD:LTUS:120:CALBTOD") { field(DESC, "Calibration Success Time") field(PINI, "YES") field(DOL, "PSC:LTUS:MG02:CALBTOD") field(OMSL, "closed_loop") field(DTYP, "Soft Channel") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:120: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, "QUAD:LTUS:120: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, "QUAD:LTUS:120: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, "QUAD:LTUS:120:CALBOFFSET") { field(DESC, "Calc DAC Offset") field(PREC, "6") field(EGU, "Counts") field(PINI, "YES") } record(bo, "QUAD:LTUS:120: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, "QUAD:LTUS:120:DACSLOPE") { field(DESC, "V to DAC slope") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "closed_loop") field(PINI, "YES") field(FLNK, "QUAD:LTUS:120:DACOFFSET") } # Default Offset used in conversion from Volts to DAC Counts record(ao, "QUAD:LTUS:120:DACOFFSET") { field(DESC, "V to DAC offset") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "closed_loop") field(PINI, "YES") field(FLNK, "QUAD:LTUS:120: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, "QUAD:LTUS:120: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, "QUAD:LTUS:120:IACT") field(INPD, "QUAD:LTUS:120:DACSLOPE") field(INPE, "QUAD:LTUS:120:DACOFFSET") field(EGU, "Counts") field(PREC, "6") } record(ao, "QUAD:LTUS:120:DAC") { field(DESC, "DAC Set point") field(EGU, "Counts") field(DOL, "") field(OMSL, "closed_loop") field(PREC, "6") field(PINI, "YES") } record(ao, "QUAD:LTUS:120:CALBIMIN") { field(DESC, "Calibration Min Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(DRVH, "120.0") field(HOPR, "120.0") field(DRVL, "-120.0") field(LOPR, "-120.0") field(PREC, "3") field(EGU, "A") field(VAL, "0.0") field(FLNK, "QUAD:LTUS:120:CALBIMAX") } record(ao, "QUAD:LTUS:120:CALBIMAX") { field(DESC, "Calibration Max Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(DRVH, "120.0") field(HOPR, "120.0") field(LOPR, "-120.0") field(DRVL, "-120.0") field(EGU, "A") field(VAL, "120.0") field(FLNK, "QUAD:LTUS:120:CALBSTEPNUM") } record(ao, "QUAD:LTUS:120:CALBIFINAL") { field(DESC, "Calibration Last Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(PREC, "3") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(VAL, "0") } record(longout, "QUAD:LTUS:120: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, "QUAD:LTUS:120:CALBIDELTA") } record(calc, "QUAD:LTUS:120:CALBIDELTA") { field(DESC, "Step size for CALB") field(CALC, "C=0?0:ABS((A-B)/C)") field(INPA, "QUAD:LTUS:120:CALBIMAX") field(INPB, "QUAD:LTUS:120:CALBIMIN") field(INPC, "QUAD:LTUS:120: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, "QUAD:LTUS:120:CALBIMULT") { field(DESC, "IACT vs ISETPT mult") field(CALC, "C#0||A=0?1:ABS(B/A)") field(INPA, "PSC:LTUS:MG02:ISETPT.DRVH") field(INPB, "PSC:LTUS:MG02:IACT.HOPR") field(INPC, "QUAD:LTUS:120:PSCONTROLLER.RVAL CPP") field(EGU, "A") field(PINI, "YES") } # SNL dbputs DAC values here. 6-10 steps are possible. record(waveform, "QUAD:LTUS:120:CALBICTRLWF") { field(DESC, "ICTRL setpoint array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") } record(waveform, "QUAD:LTUS:120:DACWF") { field(DESC, "DAC count array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:120:DACSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:120:DACSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "QUAD:LTUS:120: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, "QUAD:LTUS:120:CALCDACWF") { field(DESC, "Calc DAC counts array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:120:CALCDACSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:120:CALCDACSA") { field(DESC, "Calc DAC counts") field(DTYP, "Soft Channel") field(INP, "QUAD:LTUS:120: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, "QUAD:LTUS:120:CALBYWF") { field(DESC, "mx + b") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:120:CALBYSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:120:CALBYSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "QUAD:LTUS:120:CALBYWF") field(MALM, "10") field(NELM, "6") field(INDX, "0") field(FTVL, "DOUBLE") } record(waveform, "QUAD:LTUS:120:CALBIACTWF") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:120:CALBIACTSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:120:CALBIACTSA") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(MALM, "10") field(NELM, "6") field(INP, "QUAD:LTUS:120:CALBIACTWF") field(INDX, "0") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:120:CALBLIMITS") } # Check that measured current during calibration is within # tolerance. record(aSub, "QUAD:LTUS:120: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, "QUAD:LTUS:120:CALBSTEPNUM") field(INPB, "QUAD:LTUS:120:CALBIACTWF") field(INPC, "QUAD:LTUS:120: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, "QUAD:LTUS:120: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, "QUAD:LTUS:120:STDZITOL") field(INPH, "QUAD:LTUS:120:DACSLOPE") field(INPI, "QUAD:LTUS:120: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, "QUAD:LTUS:120: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, "QUAD:LTUS:120:CALBSTEPNUM") field(INPB, "QUAD:LTUS:120:CALBIACTWF") field(INPC, "QUAD:LTUS:120:DACWF") field(INPF, "QUAD:LTUS:120: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 QUAD:LTUS:120CALBOK 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, "QUAD:LTUS:120:DEGAUSINIT") { field(DESC, "Proc. Degauss PVs on boot") field(PINI, "YES") field(DOL, "1") field(OUTA, "QUAD:LTUS:120:DEGAUSIMIN.PROC PP") field(OUTB, "QUAD:LTUS:120:DEGAUSIMAX.PROC PP") field(OUTC, "QUAD:LTUS:120:DEGAUSTYPE.PROC PP") field(OUTD, "QUAD:LTUS:120:DEGAUSSTEP.PROC PP") field(OUTE, "QUAD:LTUS:120:MADNAME.PROC PP") field(OUTF, "QUAD:LTUS:120:PSTYPE.PROC PP") field(OUTG, "QUAD:LTUS:120: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, "QUAD:LTUS:120:DEGAUSSUB") { field(DESC, "Degauss subroutine") field(INAM, "mgntDegaussInit") field(SNAM, "mgntDegauss") field(BRSV, "INVALID") field(INPA, "QUAD:LTUS:120:DEGAUSIMIN NPP NMS") field(INPB, "QUAD:LTUS:120:DEGAUSIMAX NPP NMS") field(INPC, "QUAD:LTUS:120:DEGAUSTYPE.RVAL NPP NMS") field(INPE, "QUAD:LTUS:120:DEGAUSMETHOD.RVAL NPP NMS") field(INPF, "QUAD:LTUS:120:PSTYPE NPP NMS") field(INPG, "QUAD:LTUS:120:DEBUG.RVAL NPP NMS") field(INPH, "QUAD:LTUS:120: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, "QUAD:LTUS:120:DEGAUSWF PP") field(OUTB, "QUAD:LTUS:120:DEGAUSMSG PP") field(OUTC, "QUAD:LTUS:120: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, "QUAD:LTUS:120:DEGAUSWF") { field(DESC, "Degauss Setpts") field(NELM, "60") field(FTVL, "DOUBLE") } record(mbbo,"QUAD:LTUS:120: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, "QUAD:LTUS:120: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, "QUAD:LTUS:120: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, "QUAD:LTUS:120: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, "QUAD:LTUS:120: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, "QUAD:LTUS:120:DEGAUSIMIN") { field(DESC, "Min. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "120.0") field(LOPR, "-120.0") field(DRVH, "120.0") field(DRVL, "-120.0") field(VAL, "-120.0") } record(ao, "QUAD:LTUS:120:DEGAUSIMAX") { field(DESC, "Max. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "120.0") field(LOPR, "-120.0") field(DRVH, "120.0") field(DRVL, "-120.0") field(VAL, "120.0") } # 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,"QUAD:LTUS:120: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, "QUAD:LTUS:120: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,"QUAD:LTUS:120: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, "QUAD:LTUS:120: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, "QUAD:LTUS:120: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, "QUAD:LTUS:120: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, "QUAD:LTUS:120:DEGAUSTOD") { field(DESC, "Successful Degauss Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "QUAD:LTUS:120:DEGAUSLOSTTOD") { field(DESC, "Degauss Lost Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:120:DEGAUSTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "QUAD:LTUS:120:DEGAUSTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "QUAD:LTUS:120: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, "QUAD:LTUS:120:DEGAUSGO") { field(DESC, "Set bdes of btrms to zero") field(ASG, "Internal") field(OUTA, "") field(OUTB, "") field(OUTC, "") field(OUTD, "") } # =========== CRYO ONLY =========== record(bo, "QUAD:LTUS:120: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, "QUAD:LTUS:120:DEGAUS_IMAX_CHECK") { field(DESC, "Check if imax shoud chg") field(CALC, "(C==4)&&(ABS(B)>ABS(A))?1:0") field(INPA, "QUAD:LTUS:120:DEGAUS_IMAX") field(INPB, "QUAD:LTUS:120:ISETPT") field(INPC, "QUAD:LTUS:120:DEGAUSTYPE.RVAL") field(OUT, "QUAD:LTUS:120:DEGAUS_IMAX_UPDATE.SELN") field(FLNK, "QUAD:LTUS:120:DEGAUS_IMAX_UPDATE") } record(seq, "QUAD:LTUS:120:DEGAUS_IMAX_UPDATE") { field(DESC, "Degauss IMAX Update") field(SELM, "Specified") field(DOL1, "QUAD:LTUS:120:ISETPT") field(LNK1, "QUAD:LTUS:120:DEGAUS_IMAX PP") } # Set the maximum current after a successful # degauss. This pv is updated by the # sequence. record(ao, "QUAD:LTUS:120:DEGAUS_IMAX") { field(DESC, "Max I set afer a degauss") field(EGU, "Amps") field(PINI, "YES") field(PREC, "6") field(HOPR, "120.0") field(LOPR, "-120.0") field(DRVH, "120.0") field(DRVL, "-120.0") field(VAL, "120.0") field(FLNK, "QUAD:LTUS:120:DEGAUS_IMAXPOL_CHECK") info(autosaveFields,"VAL,RVAL") } # Set the polarity if degauss_imax record(calcout, "QUAD:LTUS:120:DEGAUS_IMAXPOL_CHECK") { field(DESC, "Determine polarity of imax") field(CALC, "A>=0?0:1") field(INPA, "QUAD:LTUS:120:DEGAUS_IMAX") field(FLNK, "QUAD:LTUS:120:DEGAUS_IMAXPOL") } record(bo, "QUAD:LTUS:120:DEGAUS_IMAXPOL") { field(DESC, "Polarity of imax I") field(DTYP, "Raw Soft Channel") field(DOL, "QUAD:LTUS:120:DEGAUS_IMAXPOL_CHECK") field(OMSL, "closed_loop") field(ZNAM, "Positive") field(ONAM, "Negative") field(FLNK, "QUAD:LTUS:120: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, "QUAD:LTUS:120:DEGAUS_ABSIMAX") { field(DESC, "Absolute Max. Degauss I") field(CALC, "ABS(A)") field(INPA, "QUAD:LTUS:120:DEGAUS_IMAX") field(PREC, "6") field(EGU, "Amps") field(HOPR, "120.0") field(LOPR, "-120.0") info(autosaveFields,"VAL RVAL") } # IACT Polarity record(calcout, "QUAD:LTUS:120:IACTPOL_CHECK") { field(DESC, "Determine IACT polarity") field(SCAN, "5 second") field(CALC, "ABS(A-B)>C?(A>=0?0:1):D") field(INPA, "QUAD:LTUS:120:IACT") field(INPB, "QUAD:LTUS:120:IACTPOL_CHECK.LA") field(INPC, "0.0001") field(INPD, "QUAD:LTUS:120:IACTPOL_CHECK.PVAL") field(OOPT, "On Change") field(FLNK, "QUAD:LTUS:120:IACTPOL") } record(bo, "QUAD:LTUS:120: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,"QUAD:LTUS:120: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, "QUAD:LTUS:120:DEGAUSENABLE CP") field(INPB, "QUAD:LTUS:120:DEGAUSOK") field(INPC, "QUAD:LTUS:120:STATE CP") field(INPD, "QUAD:LTUS:120:STATE.SEVR") field(OUT, "QUAD:LTUS:120:DEGAUS_STATE_SEQ.SELN PP") field(ASG, "Internal") } record(seq, "QUAD:LTUS:120:DEGAUS_STATE_SEQ") { field(DESC, "Degauss State Sequence") field(SELM, "Specified") field(SELL, "QUAD:LTUS:120:DEGAUS_STATE_CHECK") field(LNK1, "QUAD:LTUS:120:DEGAUS_STATE_DISABLE.PROC PP") field(LNK2, "QUAD:LTUS:120:DEGAUS_STATE_LOST.PROC PP") field(LNK3, "QUAD:LTUS:120:DEGAUS_STATE_GOOD.PROC PP") field(LNK4, "QUAD:LTUS:120: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, "QUAD:LTUS:120:DEGAUS_STATE_DISABLE") { field(DESC, "Degauss not used") field(LNK1, "QUAD:LTUS:120:DEGAUSOK.ZSV") field(LNK2, "QUAD:LTUS:120: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, "QUAD:LTUS:120:STATMSG.FRSV") field(LNK4, "QUAD:LTUS:120: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, "QUAD:LTUS:120:DEGAUS_STATE_LOST") { field(DESC, "Degauss lost and ps On") field(DOL1, "1") field(LNK1, "QUAD:LTUS:120:DEGAUSOK.ZSV") field(LNK2, "QUAD:LTUS:120: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, "QUAD:LTUS:120:STATMSG.FRSV") field(LNK4, "QUAD:LTUS:120: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, "QUAD:LTUS:120:DEGAUS_STATE_OFF") { field(DESC, "Degaused lost and ps Off") field(DOL1, "2") field(LNK1, "QUAD:LTUS:120: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, "QUAD:LTUS:120:STATMSG.FRSV") field(LNK3, "QUAD:LTUS:120: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, "QUAD:LTUS:120:DEGAUS_STATE_GOOD") { field(DESC, "Degauss good") field(DOL1, "1") field(LNK1, "QUAD:LTUS:120: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, "QUAD:LTUS:120:STATMSG.FRSV PP") field(LNK3, "QUAD:LTUS:120:STATMSG.FVSV PP") field(LNK4, "") field(ASG, "Internal") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(mbbo, "QUAD:LTUS:120:FUNC") { field(DESC, "QUAD:LTUS:120 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, "1") field(THVL, "9") field(FRVL, "10") field(FVVL, "0") field(SXVL, "2") field(SVVL, "8") field(EIVL, "11") field(NIVL, "12") field(TEVL, "13") field(ELVL, "5") field(TVVL, "6") field(TTVL, "7") field(FTVL, "4") field(FFVL, "3") field(OUT, "QUAD:LTUS:120:CTRL CA") } # :CTRL pv is processed at boot in the # sequence mgntCtrl.st Processed in sequence # record(mbbo, "QUAD:LTUS:120:CTRL") { field(DESC, "QUAD:LTUS:120 Control") field(PINI, "NO") field(ZRST, "Ready") field(ONST, "TRIM") field(TWST, "PERTURB") field(THST, "BCON_TO_BDES") field(FRST, "BACT_TO_BDES") field(FVST, "SAVE_BDES") field(SXST, "LOAD_BDES") field(SVST, "UNDO_BDES") field(EIST, "DAC_ZERO") field(NIST, "CALB") field(TEST, "STDZ") field(ELST, "RESET") field(TVST, "TURN_ON") field(TTST, "TURN_OFF") field(FTST, "") field(FFST, "") field(ZRVL, "0") field(ONVL, "2") field(TWVL, "6") field(THVL, "15") field(FRVL, "14") field(FVVL, "11") field(SXVL, "12") field(SVVL, "13") field(EIVL, "7") field(NIVL, "3") field(TEVL, "4") field(ELVL, "8") field(TVVL, "9") field(TTVL, "10") field(FTVL, "0") field(FFVL, "0") field(OUT, "QUAD:LTUS:120:SELECTEN.A PP") field(SDIS, "0") } # If a function has been selected set this unit to busy record(calcout, "QUAD:LTUS:120:SELECTEN") { field(DESC, "Control Select Enable") field(CALC, "A>0?1:A") field(FLNK, "QUAD:LTUS:120:BUSY") } # Set to FREE on IOC reboot record(bo, "QUAD:LTUS:120:BUSY") { field(DESC, "QUAD:LTUS:120 Ctrl Done") field(DOL, "QUAD:LTUS:120:SELECTEN") field(ZNAM, "FREE") field(ONAM, "BUSY") field(PINI, "YES") field(FLNK, "QUAD:LTUS:120:SELECT") } record(bo, "QUAD:LTUS:120:SELECT") { field(ZNAM, "NO") field(ONAM, "YES") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") } record(bo, "QUAD:LTUS:120: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, "QUAD:LTUS:120:CTRLSTATE") { field(DESC, "QUAD:LTUS:120 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("QUAD:LTUS:120:CTRL",20,20,0,0,"QUAD:LTUS:120:CTRL") #! Field("QUAD:LTUS:120:CTRL.OUT",16777215,1,"QUAD:LTUS:120:CTRL.OUT") #! Link("QUAD:LTUS:120:CTRL.OUT","QUAD:LTUS:120:SELECTEN.A") #! Field("QUAD:LTUS:120:CTRL.VAL",16777215,1,"QUAD:LTUS:120:CTRL.VAL") #! Record("QUAD:LTUS:120:SELECTEN",321,381,0,0,"QUAD:LTUS:120:SELECTEN") #! Field("QUAD:LTUS:120:SELECTEN.A",16777215,0,"QUAD:LTUS:120:SELECTEN.A") #! Field("QUAD:LTUS:120:SELECTEN.FLNK",16777215,1,"QUAD:LTUS:120:SELECTEN.FLNK") #! Link("QUAD:LTUS:120:SELECTEN.FLNK","QUAD:LTUS:120:BUSY") #! Field("QUAD:LTUS:120:SELECTEN.VAL",16777215,1,"QUAD:LTUS:120:SELECTEN.VAL") #! Record("QUAD:LTUS:120:BUSY",623,274,0,0,"QUAD:LTUS:120:BUSY") #! Field("QUAD:LTUS:120:BUSY.DOL",16777215,0,"QUAD:LTUS:120:BUSY.DOL") #! Link("QUAD:LTUS:120:BUSY.DOL","QUAD:LTUS:120:SELECTEN.VAL") #! Field("QUAD:LTUS:120:BUSY.FLNK",16777215,1,"QUAD:LTUS:120:BUSY.FLNK") #! Link("QUAD:LTUS:120:BUSY.FLNK","QUAD:LTUS:120:SELECT") #! Record("QUAD:LTUS:120:SELECT",669,508,0,1,"QUAD:LTUS:120:SELECT") #! Record("QUAD:LTUS:120:FUNC",940,120,0,0,"QUAD:LTUS:120:FUNC") #! Field("QUAD:LTUS:120:FUNC.OUT",16777215,0,"QUAD:LTUS:120:FUNC.OUT") #! Link("QUAD:LTUS:120:FUNC.OUT","QUAD:LTUS:120:CTRL.VAL") #! Record("QUAD:LTUS:120:ABORT",193,41,0,0,"QUAD:LTUS:120:ABORT") #! Record("QUAD:LTUS:120:CTRLSTATE",369,34,0,0,"QUAD:LTUS:120: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,"QUAD:LTUS:120:SELECT is used for Multi-device selection.\nIt is enabled when associated QUAD:LTUS:120:CTRL is \"0\" (DONE).\nIt is disabled when associated QUAD:LTUS:120: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,"QUAD:LTUS:120: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, "QUAD:LTUS:120:BCTRL_INIT") { field(DESC, "Process BCTRL on boot") field(PINI, "YES") field(CALC, "A=3?1:0") field(INPA, "QUAD:LTUS:120:BCTRL.SEVR") field(OUT, "QUAD:LTUS:120: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, "QUAD:LTUS:120:BACT") { field(DESC, "Actual B") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "QUAD:LTUS:120:BACT") field(INPB, "QUAD:LTUS:120:POLYCOEF") field(INPC, "QUAD:LTUS:120:POLYCOEF.A") field(INPD, "QUAD:LTUS:120:POLYCOEF.B") field(INPE, "QUAD:LTUS:120:IACT MS") field(INPF, "QUAD:LTUS:120:BDELTAS PP") field(INPG, "100") field(EGU, "kG") field(HOPR, "67.8") field(LOPR, "-68.0244") field(HIHI, "67.8") field(LOLO, "-68.0244") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "67.8") field(LOW, "-68.0244") field(FLNK, "QUAD:LTUS:120: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, "QUAD:LTUS:120:BDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntPhyDeltas") field(EGU, "kG") field(HOPR, "1") field(PREC, "7") field(BRSV, "INVALID") field(INPA, "QUAD:LTUS:120:BDES") field(INPB, "QUAD:LTUS:120:TRIMBTOL") field(INPC, "QUAD:LTUS:120:TRIMBTOLR") field(INPD, "QUAD:LTUS:120:CHCKBTOL") field(INPE, "QUAD:LTUS:120:CHCKBTOLR") field(F, "2.0") field(INPG, "30") field(INPH, "QUAD:LTUS:120:BACT.VAL") # # MPS absolute and relative tolerances field(INPP, "QUAD:LTUS:120:MPSBTOL") field(INPQ, "QUAD:LTUS:120:MPSBTOLR") field(FLNK, "QUAD:LTUS:120:BCONLIMITS") info(autosaveFields,"F") } # This record is processed by BDELTAS record(aSub, "QUAD:LTUS:120:BCONLIMITS") { field(DESC, "Config B-field Limits") field(INAM, "mgntInit") field(SNAM, "mgntBCONLimits") field(INPA, "QUAD:LTUS:120:BDES") field(INPB, "QUAD:LTUS:120:BDELTAS.I") field(INPG, "QUAD:LTUS:120:DEBUG.RVAL") field(FTA, "DOUBLE") field(FTB, "DOUBLE") field(FTG, "ULONG") field(OUTA, "QUAD:LTUS:120:BCON.HIGH") field(OUTB, "QUAD:LTUS:120:BCON.LOW") field(OUTC, "QUAD:LTUS:120:BCON.HIHI") field(OUTD, "QUAD:LTUS:120:BCON.LOLO PP") field(FTVA, "DOUBLE") field(FTVB, "DOUBLE") field(FTVC, "DOUBLE") field(FTVD, "DOUBLE") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:120:IDELTAS") } # The following PV is processed by :BACT # which is processed by :BACT # record(fanout, "QUAD:LTUS:120:BACTFO") { field(DESC, "BACT processing") field(SELM, "All") field(LNK1, "QUAD:LTUS:120:BDIFF") field(LNK2, "QUAD:LTUS:120:BADIFF") field(LNK3, "QUAD:LTUS:120:BRATIO") field(LNK4, "QUAD:LTUS:120:MPSLIMITS") field(LNK5, "QUAD:LTUS:120:I2BSTATUS") field(LNK6, "QUAD:LTUS:120:IACTFO.PROC") } record(calc, "QUAD:LTUS:120:BDIFF") { field(DESC, "BDES-BACT") field(CALC, "A-B") field(INPA, "QUAD:LTUS:120:BDES") field(INPB, "QUAD:LTUS:120:BACT") field(EGU, "kG") field(PREC, "7") } record(calc, "QUAD:LTUS:120:BADIFF") { field(DESC, "Absolute BDES-BACT") field(INPA, "QUAD:LTUS:120:BDIFF") field(EGU, "kG") field(PREC, "7") field(CALC, "A<0?ABS(A):A") } record(calc, "QUAD:LTUS:120:BRATIO") { field(DESC, "BACT Error") field(CALC, "B?A/B:0") field(INPA, "QUAD:LTUS:120:BDIFF") field(INPB, "QUAD:LTUS:120:BDES.HOPR") field(EGU, "kG") field(PREC, "7") } record(mbbi, "QUAD:LTUS:120: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, "QUAD:LTUS:120:BACT.J") } # Note: for a string slave set the MONFL # macro to the following: # MONFL=:IMONCALC MS record(sub, "QUAD:LTUS:120:BMON") { field(DESC, "Second Transductor") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "QUAD:LTUS:120:BMON") field(INPB, "QUAD:LTUS:120:POLYCOEF") field(INPC, "QUAD:LTUS:120:POLYCOEF.A") field(INPD, "QUAD:LTUS:120:POLYCOEF.B") field(INPE, "QUAD:LTUS:120:IMON MS") field(INPF, "QUAD:LTUS:120:BDELTAS.VAL") field(INPG, "100") field(EGU, "kG") field(HOPR, "67.8") field(LOPR, "-68.0244") field(HIHI, "67.8") field(LOLO, "-68.0244") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "67.8") field(LOW, "-68.0244") } # 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=PSC:LTUS:MG02:BDES CP record(ao, "QUAD:LTUS:120:BDES") { field(DESC, "Desired B-Field") field(PINI, "YES") field(DRVH, "67.8") field(DRVL, "-68.0244") field(HOPR, "67.8") field(LOPR, "-68.0244") field(PREC, "7") field(EGU, "kG") field(MDEL, "-1") field(OMSL, "supervisory") # field(DOL, "") field(OUT, "QUAD:LTUS:120:B2IDES PP") info(autosaveFields,"VAL") } record(sub, "QUAD:LTUS:120:B2IDES") { field(DESC, "Convert Desired B-Field to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:120:POLYCOEF") field(INPC, "QUAD:LTUS:120:POLYCOEF.A") field(INPD, "QUAD:LTUS:120:POLYCOEF.B") field(PREC, "7") field(EGU, "kG") field(HOPR, "67.8") field(LOPR, "-68.0244") field(MDEL, "-1") field(INPE, "QUAD:LTUS:120:BDES.DRVH") field(INPF, "QUAD:LTUS:120:BDES.DRVL") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:120:IDES") } record(sub, "QUAD:LTUS:120:BNOM") { field(DESC, "Nominal Field") field(PINI, "YES") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:120:POLYCOEF") field(INPC, "QUAD:LTUS:120:POLYCOEF.A") field(INPD, "QUAD:LTUS:120:POLYCOEF.B") field(INPE, "QUAD:LTUS:120:BDES.DRVH") field(INPF, "QUAD:LTUS:120:BDES.DRVL") field(EGU, "kG") field(HOPR, "67.8") field(LOPR, "-68.0244") field(PREC, "7") field(VAL, "0.0") field(FLNK, "QUAD:LTUS:120:INOM") } record(sub, "QUAD:LTUS:120:BACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:120:BDES.VAL") field(INPB, "QUAD:LTUS:120:BDES.DRVH") field(INPC, "QUAD:LTUS:120:BDES.DRVL") field(INPD, "QUAD:LTUS:120:BDELTAS.I") field(INPE, "QUAD:LTUS:120:BDELTAS.J") field(INPG, "QUAD:LTUS:120:STATE") field(INPH, "QUAD:LTUS:120:HSTA") field(EGU, "kG") field(HOPR, "67.8") field(LOPR, "-68.0244") field(PREC, "7") field(BRSV, "INVALID") } record(sub, "QUAD:LTUS:120:BMONLIMITS") { field(DESC, "MON Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:120:BDES.VAL") field(INPB, "QUAD:LTUS:120:BDES.DRVH") field(INPC, "QUAD:LTUS:120:BDES.DRVL") field(INPD, "QUAD:LTUS:120:BDELTAS.K") field(INPE, "QUAD:LTUS:120:BDELTAS.L") field(INPG, "QUAD:LTUS:120:STATE") field(INPH, "QUAD:LTUS:120:HSTA") field(EGU, "kG") field(HOPR, "67.8") field(LOPR, "-68.0244") field(PREC, "7") field(BRSV, "INVALID") } record(seq, "QUAD:LTUS:120:BLIMITS") { field(DESC, "ACT Limits") field(PREC, "7") field(DOL1, "QUAD:LTUS:120:BLIMITS") field(LNK1, "QUAD:LTUS:120:BACTLIMITS.F PP") field(DOL2, "QUAD:LTUS:120:BACTLIMITS.I") field(LNK2, "QUAD:LTUS:120:BACT.HIGH") field(DOL3, "QUAD:LTUS:120:BACTLIMITS.J") field(LNK3, "QUAD:LTUS:120:BACT.LOW") field(DOL4, "QUAD:LTUS:120:BACTLIMITS.K") field(LNK4, "QUAD:LTUS:120:BACT.HIHI") field(DOL5, "QUAD:LTUS:120:BACTLIMITS.L") field(LNK5, "QUAD:LTUS:120:BACT.LOLO") field(DOL6, "QUAD:LTUS:120:BLIMITS") field(LNK6, "QUAD:LTUS:120:BMONLIMITS.F PP") field(DOL7, "QUAD:LTUS:120:BMONLIMITS.I") field(LNK7, "QUAD:LTUS:120:BMON.HIGH") field(DOL8, "QUAD:LTUS:120:BMONLIMITS.J") field(LNK8, "QUAD:LTUS:120:BMON.LOW") field(DOL9, "QUAD:LTUS:120:BMONLIMITS.K") field(LNK9, "QUAD:LTUS:120:BMON.HIHI") field(DOLA, "QUAD:LTUS:120:BMONLIMITS.L") field(LNKA, "QUAD:LTUS:120:BMON.LOLO") field(FLNK, "QUAD:LTUS:120:ILIMITS") field(SCAN, "5 second") } record(ao, "QUAD:LTUS:120:BCTRL") { field(DESC, "B-Perturb") field(PREC, "7") field(EGU, "kG") field(DRVH, "67.8") field(DRVL, "-68.0244") field(HOPR, "67.8") field(LOPR, "-68.0244") # 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, "QUAD:LTUS:120: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, "QUAD:LTUS:120:BCTRLGO") { field(DESC, "Update DES and perturb") field(PREC, "7") # Disable BACT limits field(DOL1, "1") field(LNK1, "QUAD:LTUS:120:BLIMITS.VAL") # Update BDES with the BCTRL (slider) value field(DOL2, "QUAD:LTUS:120:BCTRL.VAL") field(LNK2, "QUAD:LTUS:120:BDES PP") field(DOL3, "1") field(LNK3, "QUAD:LTUS:120:IDIRECT.PROC PP") field(DOL4, "1") field(LNK4, "QUAD:LTUS:120:CHECKSTDZLOST.PROC PP") field(DOL5, "QUAD:LTUS:120:BCTRL.VAL") field(LNK5, "QUAD:LTUS:120:BCTRLSUB PP") # Re-enable BACT limits field(DOL6, "0") field(LNK6, "QUAD:LTUS:120:BLIMITS.VAL") } # Convert B-field to Current and output to ISETPT record(sub, "QUAD:LTUS:120:BCTRLSUB") { field(DESC, "Feedback") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:120:POLYCOEF") field(INPC, "QUAD:LTUS:120:POLYCOEF.A") field(INPD, "QUAD:LTUS:120:POLYCOEF.B") field(INPE, "QUAD:LTUS:120:BDES.DRVH") field(INPF, "QUAD:LTUS:120:BDES.DRVL") field(PREC, "7") field(EGU, "kG") field(HOPR, "67.8") field(LOPR, "-68.0244") field(MDEL, "-1") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:120:ISETPT") } record(ao, "QUAD:LTUS:120:BDESPREVTRIM") { field(DESC, "trim bdes for undo") field(DTYP, "Soft Channel") field(DRVH, "67.8") field(DRVL, "-68.0244") field(EGU, "kG") field(HOPR, "67.8") field(LOPR, "-68.0244") field(PREC, "7") field(PINI, "YES") info(autosaveFields,"VAL") } record(stringin, "QUAD:LTUS:120:MADNAME") { field(DESC, "MAD deck nomenclature") field(PINI, "YES") field(VAL, "QDBL2") } record(ai, "QUAD:LTUS:120: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, "3226.862425") } record(ao, "QUAD:LTUS:120:BMAX") { field(DESC, "Max B-Field") field(DTYP, "Soft Channel") field(DRVH, "67.8") field(DRVL, "-68.0244") field(EGU, "kG") field(HOPR, "67.8") field(LOPR, "-68.0244") field(PREC, "7") field(PINI, "YES") field(VAL, "67.8") field(FLNK, "QUAD:LTUS:120:BSTEP") } record(ao, "QUAD:LTUS:120:BMIN") { field(DESC, "Min B-Field") field(DTYP, "Soft Channel") field(DRVH, "67.8") field(DRVL, "-68.0244") field(EGU, "kG") field(HOPR, "67.8") field(LOPR, "-68.0244") field(PREC, "7") field(PINI, "YES") field(VAL, "-68.0244") field(FLNK, "QUAD:LTUS:120:BSTEP") } record(ao, "QUAD:LTUS:120:BDESSAVE") { field(DESC, "bdes for save/load") field(DTYP, "Soft Channel") field(DRVH, "67.8") field(DRVL, "-68.0244") field(EGU, "kG") field(HOPR, "67.8") field(LOPR, "-68.0244") field(PINI, "YES") field(PREC, "7") } # This record is processed by QUAD:LTUS:120: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, "QUAD:LTUS:120:BCON") { field(DESC, "Config B-Field ") field(DTYP, "Soft Channel") field(PREC, "7") field(EGU, "kG") field(HOPR, "67.8") field(LOPR, "-68.0244") field(DRVH, "67.8") field(DRVL, "-68.0244") # Set MINOR Alarm as the default, slaves will set NO_ALARM=0. field(HHSV, "MINOR") field(LLSV, "MINOR") field(HSV, "MINOR") field(LSV, "MINOR") # field(DOL , "") field(OMSL, "supervisory") field(OUT, "QUAD:LTUS:120:B2ICON PP") info(autosaveFields,"VAL") } record(sub, "QUAD:LTUS:120:B2ICON") { field(DESC, "Convert Desired ICon to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:120:POLYCOEF") field(INPC, "QUAD:LTUS:120:POLYCOEF.A") field(INPD, "QUAD:LTUS:120:POLYCOEF.B") field(PREC, "7") field(EGU, "kG") field(HOPR, "67.8") field(LOPR, "-68.0244") field(MDEL, "-1") field(INPE, "QUAD:LTUS:120:BCON.DRVH") field(INPF, "QUAD:LTUS:120:BCON.DRVL") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:120: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, "QUAD:LTUS:120:BSTEP") { field(DESC, "B-Field step size") field(CALC, "(C==3)||(D==3)?0:ABS(A-B)*0.005") field(INPA, "QUAD:LTUS:120:BMAX") field(INPB, "QUAD:LTUS:120:BMIN") field(INPC, "QUAD:LTUS:120:BMIN.SEVR") field(INPD, "QUAD:LTUS:120:BMAX.SEVR") field(EGU, "kG") 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,"QUAD:LTUS:120:BCTRLDISABLECALC") { field(DESC, "Calc for disabling BCTRL") field(ASG, "Internal") field(CALC, "A?2:1") field(INPA, "QUAD:LTUS:120:ONLINE CP") field(OUT, "QUAD:LTUS:120:BCTRLDISABLEFOUT PP") } record(fanout, "QUAD:LTUS:120:BCTRLDISABLEFOUT") { field(DESC, "Disable BCTRL fanout") field(SELM, "Specified") field(SELL, "QUAD:LTUS:120:BCTRLDISABLECALC") field(LNK1, "QUAD:LTUS:120:BCTRLDISABLE") field(LNK2, "QUAD:LTUS:120:BCTRLENABLE") } record(stringout, "QUAD:LTUS:120:BCTRLDISABLE") { field(DESC, "Disable BCTRL") field(DTYP, "Soft Channel") field(OUT, "QUAD:LTUS:120:BCTRL.ASG") field(VAL, "NOWRITE") field(FLNK, "QUAD:LTUS:120:BCTRLDISV_UPDATE") } record(stringout, "QUAD:LTUS:120:BCTRLENABLE") { field(DESC, "Enable BCTRL") field(DTYP, "Soft Channel") field(OUT, "QUAD:LTUS:120:BCTRL.ASG") field(VAL, "") field(FLNK, "QUAD:LTUS:120:BCTRLDISV_UPDATE") } record(calcout, "QUAD:LTUS:120:BCTRLDISV_UPDATE") { field(DESC, "Calc for updating BCTRL.DISV") field(ASG, "Internal") field(CALC, "A") field(INPA, "QUAD:LTUS:120:ONLINE") field(OUT, "QUAD:LTUS:120: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,"QUAD:LTUS:120:BACT and MON\n are processed via links from \n QUAD:LTUS:120:IACT (device raw value readback 1)\n and\n QUAD:LTUS:120: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 QUAD:LTUS:120:POLYCOEF\nC = First polynomial coefficient (offset if linear)\nD = Second polynomial coefficient (slope if linear)\nE = QUAD:LTUS:120: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,"QUAD:LTUS:120:BDES\n is processed when set by CA users or \n QUAD:LTUS:120: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,"QUAD:LTUS:120: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 QUAD:LTUS:120: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 (QUAD:LTUS:120: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,"QUAD:LTUS:120:B*LIMITS and QUAD:LTUS:120:BLIMITS:\n Calculate alarm and warning limits based on \n deltas from QUAD:LTUS:120: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,"QUAD:LTUS:120: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,"QUAD:LTUS:120: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, "QUAD:LTUS:120: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, "QUAD:LTUS:120:MPSBTOL") { field(DESC, "Absolute mps tol") field(EGU, "kG") field(PREC, "2") field(CALC, "ABS(A)*0.02") field(INPA, "QUAD:LTUS:120:BMAX") field(PINI, "YES") } # # 21-Aug-2013: K. Luchini # Set channel access security so that users # cannot easily change values. record(ao, "QUAD:LTUS:120:MPSBMAX") { field(DESC, "MPS Max B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "67.8") field(DRVL, "-68.0244") field(PINI, "YES") field(VAL, "67.8") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:120:MPSBMIN") { field(DESC, "MPS Min B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "67.8") field(DRVL, "-68.0244") field(PINI, "YES") field(VAL, "-68.0244") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:120:MPSBLLIM") { field(DESC, "MPS Low Limit B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "67.8") field(DRVL, "-68.0244") field(PINI, "YES") field(VAL, "-68.0244") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:120:MPSBLLIM2") { field(DESC, "MPS Low Limit #2 B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "67.8") field(DRVL, "-68.0244") field(PINI, "YES") field(VAL, "-68.0244") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } # Set the default to Std record(mbbo, "QUAD:LTUS:120: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, "QUAD:LTUS:120:MPSLIMITS.E PP") } record(aSub, "QUAD:LTUS:120: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, "QUAD:LTUS:120:MPS.RVAL") field(INPB, "QUAD:LTUS:120:BADIFF") field(INPC, "QUAD:LTUS:120:BDELTAS.N") field(INPD, "QUAD:LTUS:120:BACT") field(INPE, "QUAD:LTUS:120:MPSBITMASK.RVAL") field(INPF, "QUAD:LTUS:120:MPSBLLIM") field(INPG, "QUAD:LTUS:120:MPSBMIN") field(INPH, "QUAD:LTUS:120:MPSBMAX") field(INPI, "QUAD:LTUS:120: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, "QUAD:LTUS:120:INTOL.RVAL PP") field(OUTB, "QUAD:LTUS:120:INTOL_BMIN.RVAL PP") field(OUTC, "QUAD:LTUS:120:INTOL_BRANGE.RVAL PP") field(OUTD, "QUAD:LTUS:120: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, "QUAD:LTUS:120:INTOL") { field(DESC, "BACT within MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:120:MPSLIMITS.VALA") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "QUAD:LTUS:120:INTOL_BMIN") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:120:MPSLIMITS.VALB") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "QUAD:LTUS:120:INTOL_BMIN2") { field(DESC, "MPS tol #2") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:120:MPSLIMITS.VALD") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "QUAD:LTUS:120:INTOL_BRANGE") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:120: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, "QUAD:LTUS:120:CHCKITOL") { field(DESC, "Absolute Check I Tolerance") field(EGU, "A") field(FLNK, "QUAD:LTUS:120:TRIMITOL") field(CALC, "ABS(A*B)") field(INPA, "QUAD:LTUS:120:CHCKBTOL") field(INPB, "QUAD:LTUS:120:POLYCOEF.B") field(PREC, "9") } record(calc, "QUAD:LTUS:120:TRIMBTOL") { field(EGU, "kG") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(DESC, "Absolute Trim Tolerance") field(CALC, "ABS(A)/2") field(INPA, "QUAD:LTUS:120:CHCKBTOL") field(FLNK, "QUAD:LTUS:120:CHCKITOL") } record(calc, "QUAD:LTUS:120:CHCKBTOL") { field(DESC, "Check absolute tolerance") field(EGU, "A") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(FLNK, "QUAD:LTUS:120:TRIMBTOL") field(CALC, "MAX(ABS(A),ABS(C))*(B/1000000)") field(INPA, "QUAD:LTUS:120:BDES.HOPR") field(INPB, "QUAD:LTUS:120:STABILITY") field(INPC, "QUAD:LTUS:120:BDES.LOPR") } record(longout, "QUAD:LTUS:120: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, "QUAD:LTUS:120:CHCKBTOL") } record(calc, "QUAD:LTUS:120:TRIMITOL") { field(DESC, "Absolute Trim I Tolerance") field(EGU, "kG") field(CALC, "ABS(A*B)") field(INPA, "QUAD:LTUS:120:POLYCOEF.B") field(INPB, "QUAD:LTUS:120:TRIMBTOL") field(PREC, "9") } record(ai, "QUAD:LTUS:120:TRIMBTOLR") { field(DESC, "Relative trim tol") field(PREC, "4") field(EGU, "%") field(HOPR, "1.0") field(LOPR, "0.0") field(PINI, "YES") } record(ai, "QUAD:LTUS:120: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, "QUAD:LTUS:120:FBCKFCOM") { field(ZNAM, "CA") field(ONAM, "FCOM") field(DESC, "CA Mode") field(PINI, "YES") field(SDIS, "0") } record(bo, "QUAD:LTUS:120:PAU") { field(ZNAM, "NotConfigured") field(ONAM, "Configured") field(DESC, "PAU Present") field(PINI, "YES") field(SDIS, "0") field(FLNK, "QUAD:LTUS:120:PAUGO") } record(fanout, "QUAD:LTUS:120:PAUGO") { field(DESC, "PAU control") field(LNK1, "QUAD:LTUS:120:PAUSTOP") field(LNK2, "QUAD:LTUS:120: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, "QUAD:LTUS:120:PAUSTART") { field(DESC, "Setup for PAU On") field(SDIS, "QUAD:LTUS:120: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, "QUAD:LTUS:120:PAUSTOP") { field(DESC, "Setup for PAU Off") field(SDIS, "QUAD:LTUS:120: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, "QUAD:LTUS:120:MCORDEVNAME") { field(DESC, "PS device name") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, "PSC:LTUS:MG02:") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "QUAD:LTUS:120: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, "QUAD:LTUS:120:PSTYPE.RVAL") field(INPC, "QUAD:LTUS:120:TURNEDOFF.RVAL") field(INPD, "QUAD:LTUS:120:CONFIG.RVAL") field(INPE, "QUAD:LTUS:120:PSCATEGORY.RVAL") field(INPF, "QUAD:LTUS:120:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "QUAD:LTUS:120:AUTOCTRL.RVAL") field(INPJ, "QUAD:LTUS:120:OUTOFSERVICE.RVAL") field(INPL, "QUAD:LTUS:120:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "QUAD:LTUS:120:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "QUAD:LTUS:120:PAU") field(INPP, "QUAD:LTUS:120:CALBDISABLE.RVAL") field(INPQ, "QUAD:LTUS:120:PTRBDISABLE.RVAL") field(INPR, "QUAD:LTUS:120:TRIMDISABLE.RVAL") field(INPS, "QUAD:LTUS:120:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "QUAD:LTUS:120:FBCK") field(INPU, "QUAD:LTUS:120:TRIMTYPE.RVAL") field(INPV, "QUAD:LTUS:120:STDZDIRECT.RVAL") field(INPW, "QUAD:LTUS:120:DEGAUSENABLE.RVAL") field(FLNK, "QUAD:LTUS:120:HSTA") } record(longin, "QUAD:LTUS:120:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "QUAD:LTUS:120:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "QUAD:LTUS:120: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, "QUAD:LTUS:120: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, "QUAD:LTUS:120:CALBDISABLE") { field(DESC, "DAC Calb Disabled") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:120:PTRBDISABLE") { field(DESC, "Perturb Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:120:TRIMDISABLE") { field(DESC, "Trim Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:120: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 QUAD:LTUS:120:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses QUAD:LTUS:120:FBCK. # This PV should be replaced by QUAD:LTUS:120: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, "QUAD:LTUS:120: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, "QUAD:LTUS:120: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, "QUAD:LTUS:120: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, "") field(OMSL, "supervisory") field(FLNK, "QUAD:LTUS:120:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"QUAD:LTUS:120:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "QUAD:LTUS:120:OUTOFSERVICE NPP NMS") field(OUT, "QUAD:LTUS:120:ONLINE PP") } record(bo, "QUAD:LTUS:120:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "QUAD:LTUS:120: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, "1") } record(bo, "QUAD:LTUS:120: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, "1") } record(bo, "QUAD:LTUS:120: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, "QUAD:LTUS:120: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, "QUAD:LTUS:120: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, "QUAD:LTUS:120: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, "QUAD:LTUS:120: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, "QUAD:LTUS:120: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, "1") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:120: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, "1") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:120: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, "2") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:120: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, "0") field(ASG, "NOWRITE") field(FLNK, "QUAD:LTUS:120:TRIMTYPE") } record(stringout, "QUAD:LTUS:120:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "QUAD:LTUS:120:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "QUAD:LTUS:120:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "QUAD:LTUS:120:STATE.RVAL") field(INPB, "QUAD:LTUS:120:INTLKSUMY.RVAL") field(OUT, "QUAD:LTUS:120:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:LTUS:120: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, "QUAD:LTUS:120:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "QUAD:LTUS:120:STATE.RVAL") field(INPB, "QUAD:LTUS:120:INTLKSUMY.RVAL") field(OUT, "QUAD:LTUS:120:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:LTUS:120:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "QUAD:LTUS:120:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "QUAD:LTUS:120: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, "QUAD:LTUS:120:RAMPSTARTDLY") { field(DESC, "Tansition to ramp delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "2") } ######### For PSTYPE=2 Only ############# record(mbbo, "QUAD:LTUS:120: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, "QUAD:LTUS:120: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,"QUAD:LTUS:120: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("QUAD:LTUS:120:TURNEDOFF",3140,1907,0,1,"QUAD:LTUS:120:TURNEDOFF") #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "QUAD:LTUS:120:STATSUB") { field(DESC, "Build STATus ") field(INAM, "mgntInit") field(SNAM, "mgntSlcStat") field(INPA, "QUAD:LTUS:120:BACT.STAT") field(INPB, "QUAD:LTUS:120:BDES.STAT") field(INPC, "QUAD:LTUS:120:IRIPL.STAT") field(INPD, "PSC:LTUS:MG02:ISETPT.STAT") field(INPE, "PSC:LTUS:MG02:IACT.STAT") # 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, "QUAD:LTUS:120:BACT.SEVR") field(INPH, "QUAD:LTUS:120:BDES.SEVR") field(INPI, "QUAD:LTUS:120:IRIPL.SEVR") field(INPJ, "PSC:LTUS:MG02:ISETPT.SEVR") field(INPK, "PSC:LTUS:MG02:IACT.SEVR") # # 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, "QUAD:LTUS:120:STATE.RVAL") field(INPN, "QUAD:LTUS:120:STDZOK") field(INPO, "QUAD:LTUS:120:CALBOK") field(INPP, "QUAD:LTUS:120:OUTOFSERVICE.RVAL") field(INPQ, "QUAD:LTUS:120:CONFIG.RVAL") field(INPR, "QUAD:LTUS:120:HSTA") field(INPS, "QUAD:LTUS:120:CTRL.RVAL") field(INPT, "QUAD:LTUS:120:DEGAUSOK") field(INPV, "QUAD:LTUS:120: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, "QUAD:LTUS:120:STAT") } record(longout, "QUAD:LTUS:120:STAT") { field(DESC, "STAT sent to SLC") field(SCAN, "Passive") field(FLNK, "QUAD:LTUS:120:STATCTRLSUB") field(DOL, "QUAD:LTUS:120:STATSUB.VAL") field(OMSL, "closed_loop") } record(sSub, "QUAD:LTUS:120:STATCTRLSUB") { field(DESC, "Decode SLC STAT into mbbo") field(INAM, "mgntInit") field(SNAM, "mgntStatDecode") field(INPA, "QUAD:LTUS:120:STAT") field(INPB, "QUAD:LTUS:120:HSTA") field(INPD, "QUAD:LTUS:120:ONOFFCTRL.RVAL") field(FLNK, "QUAD:LTUS:120:STATMSG") } record(mbbo, "QUAD:LTUS:120: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, "QUAD:LTUS:120:UNAVAILGO") field(DOL, "QUAD:LTUS:120:STATCTRLSUB.W") } record(seq, "QUAD:LTUS:120:UNAVAILGO") { field(DESC, "Process UNAVAIL") field(DOL1, "QUAD:LTUS:120:STATSUB.U") field(LNK1, "QUAD:LTUS:120:UNAVAIL PP") } record(stringout, "QUAD:LTUS:120:SNLSTATMSG") { field(DTYP, "Soft Channel") } #! TextBox(TB0,820,1000,1200,1220,0,"Dialog",12,1,16777215,"QUAD:LTUS:120:STATUSSUB - future\nOverall device status - takes input from action snls, record sevrs, master snl(s) and outputs final status\n\nInputs:\nA - QUAD:LTUS:120:CTRLSTATUS - snl status\nB - MGNT:CTRLSTATUS - master list status\nC\nD - QUAD:LTUS:120: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,"QUAD:LTUS:120STATSUB\nformat control bo's into slc STAT\n\nInputs:\nA - QUAD:LTUS:120:STATUS\nC - QUAD:LTUS:120:ON\nD - QUAD:LTUS:120:STDZOK\nE - QUAD:LTUS:120:CALBOK\nF - QUAD:LTUS:120:BACTDRIFT (future)\nG -\nH- QUAD:LTUS:120:DACSTATUS\nI -QUAD:LTUS:120:ADCSTATUS\nJ - QUAD:LTUS:120:BACTSTATUS\nK - QUAD:LTUS:120:BDESSTATUS\nL - QUAD:LTUS:120:RIPLSTATUS\n\nOutput:\nP - QUAD:LTUS:120: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, "QUAD:LTUS:120: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, "QUAD:LTUS:120: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, "QUAD:LTUS:120: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, "QUAD:LTUS:120: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.6 #! DBDSTART #! DBD("../../../../dbd/mgntSoft.dbd") #! DBDEND record(stringout, "QUAD:LTUS:120:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:120:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "QUAD:LTUS:120:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "QUAD:LTUS:120:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "QUAD:LTUS:120:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "QUAD:LTUS:120:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "1") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "QUAD:LTUS:120: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, "QUAD:LTUS:120:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "QUAD:LTUS:120:TRIMTYPE.RVAL") field(INPB, "QUAD:LTUS:120:CONFIG.RVAL") field(OUT, "QUAD:LTUS:120:TRIMMAXNUM PP") } record(longout, "QUAD:LTUS:120: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, "QUAD:LTUS:120: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, "") field(OMSL, "supervisory") field(VAL, "20") field(OUT, "QUAD:LTUS:120:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "QUAD:LTUS:120: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, "") field(OMSL, "supervisory") field(VAL, "10") } record(bo, "QUAD:LTUS:120: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, "QUAD:LTUS:120: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, "QUAD:LTUS:120: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, "QUAD:LTUS:120:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "0") } record(ao, "QUAD:LTUS:120: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, "QUAD:LTUS:120:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "QUAD:LTUS:120: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, "QUAD:LTUS:120: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, "QUAD:LTUS:120:IMOVE") field(INPB, "QUAD:LTUS:120:IACT") field(INPC, "QUAD:LTUS:120:IRAMPRATE") field(INPD, "1.577") field(INPE, "QUAD:LTUS:120:TRIMDLYPCT") field(INPF, "QUAD:LTUS:120:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "QUAD:LTUS:120:RAMPTIME_LEFT PP") } record(longout, "QUAD:LTUS:120:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "QUAD:LTUS:120:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "QUAD:LTUS:120:RAMPDONE_CALC") } record(calc, "QUAD:LTUS:120:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "QUAD:LTUS:120:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "QUAD:LTUS:120:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "QUAD:LTUS:120: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, "QUAD:LTUS:120:RAMPTIME_LEFT") field(OUT, "QUAD:LTUS:120:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "QUAD:LTUS:120:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "QUAD:LTUS:120:RAMPTIME_LEFT NMS") field(OUT, "QUAD:LTUS:120:RAMPDONE PP") } record(bo, "QUAD:LTUS:120:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "QUAD:LTUS:120:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "QUAD:LTUS:120: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, "QUAD:LTUS:120: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(sSub, "QUAD:LTUS:120: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, "QUAD:LTUS:120:PSTYPE.RVAL") field(INPC, "QUAD:LTUS:120:TURNEDOFF.RVAL") field(INPD, "QUAD:LTUS:120:CONFIG.RVAL") field(INPE, "QUAD:LTUS:120:PSCATEGORY.RVAL") field(INPF, "QUAD:LTUS:120:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "QUAD:LTUS:120:AUTOCTRL.RVAL") field(INPJ, "QUAD:LTUS:120:OUTOFSERVICE.RVAL") field(INPL, "QUAD:LTUS:120:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "QUAD:LTUS:120:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "QUAD:LTUS:120:PAU") field(INPP, "QUAD:LTUS:120:CALBDISABLE.RVAL") field(INPQ, "QUAD:LTUS:120:PTRBDISABLE.RVAL") field(INPR, "QUAD:LTUS:120:TRIMDISABLE.RVAL") field(INPS, "QUAD:LTUS:120:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "QUAD:LTUS:120:FBCK") field(INPU, "QUAD:LTUS:120:TRIMTYPE.RVAL") field(INPV, "QUAD:LTUS:120:STDZDIRECT.RVAL") field(INPW, "QUAD:LTUS:120:DEGAUSENABLE.RVAL") field(FLNK, "QUAD:LTUS:120:HSTA") } record(longin, "QUAD:LTUS:120:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "QUAD:LTUS:120:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "QUAD:LTUS:120: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, "QUAD:LTUS:120: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, "QUAD:LTUS:120:CALBDISABLE") { field(DESC, "DAC Calb Disabled") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:120:PTRBDISABLE") { field(DESC, "Perturb Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:120:TRIMDISABLE") { field(DESC, "Trim Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:120:STDZDISABLE") { field(DTYP, "Raw Soft Channel") field(ZNAM, "NO") field(ONAM, "YES") field(DESC, "Standardize Function") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } # This PV has been replaced by QUAD:LTUS:120:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses QUAD:LTUS:120:FBCK. # This PV should be replaced by QUAD:LTUS:120: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, "QUAD:LTUS:120: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, "QUAD:LTUS:120: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, "QUAD:LTUS:120: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, "") field(OMSL, "supervisory") field(FLNK, "QUAD:LTUS:120:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"QUAD:LTUS:120:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "QUAD:LTUS:120:OUTOFSERVICE NPP NMS") field(OUT, "QUAD:LTUS:120:ONLINE PP") } record(bo, "QUAD:LTUS:120:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "QUAD:LTUS:120: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, "1") } record(bo, "QUAD:LTUS:120: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, "1") } record(bo, "QUAD:LTUS:120: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, "QUAD:LTUS:120: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, "QUAD:LTUS:120: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, "QUAD:LTUS:120: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, "QUAD:LTUS:120: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, "QUAD:LTUS:120: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, "1") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:120: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, "1") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:120: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, "2") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:120: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, "0") field(ASG, "NOWRITE") field(FLNK, "QUAD:LTUS:120:TRIMTYPE") } record(stringout, "QUAD:LTUS:120:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "QUAD:LTUS:120:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "QUAD:LTUS:120:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "QUAD:LTUS:120:STATE.RVAL") field(INPB, "QUAD:LTUS:120:INTLKSUMY.RVAL") field(OUT, "QUAD:LTUS:120:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:LTUS:120: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, "QUAD:LTUS:120:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "QUAD:LTUS:120:STATE.RVAL") field(INPB, "QUAD:LTUS:120:INTLKSUMY.RVAL") field(OUT, "QUAD:LTUS:120:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:LTUS:120:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "QUAD:LTUS:120:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "QUAD:LTUS:120: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, "QUAD:LTUS:120:RAMPSTARTDLY") { field(DESC, "Tansition to ramp delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "2") } ######### For PSTYPE=2 Only ############# record(mbbo, "QUAD:LTUS:120: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, "QUAD:LTUS:120: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,"QUAD:LTUS:120: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("QUAD:LTUS:120:TURNEDOFF",3140,1907,0,1,"QUAD:LTUS:120:TURNEDOFF") #! 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, "QUAD:LTUS:150:IACT") { field(DESC, "Current") field(INP, "PSC:LTUS:MG06:IACT") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "QUAD:LTUS:150:BACT") info(autosaveFields,"HYST") } record(bi, "QUAD:LTUS:150:STATE") { field(DESC, "PS On/Off Status") field(DTYP, "Raw Soft Channel") field(INP, "PSC:LTUS:MG06:STATE NPP MS") field(ZSV, "MAJOR") field(ZNAM, "OFF") field(ONAM, "ON") } record(ao, "QUAD:LTUS:150:IDES") { field(DESC, "Desired Current") field(PREC, "3") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(MDEL, "-1") field(HIHI, "165.0") field(LOLO, "0.0") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "QUAD:LTUS:150:BDELTAS") field(DRVH, "165.0") field(DRVL, "0.0") field(DOL, "QUAD:LTUS:150: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, "QUAD:LTUS:150:ICTRL PP") } # This record is processed by QUAD:LTUS:150:ICON") # Note: we are not setting alarms here. record(ao, "QUAD:LTUS:150:ICON") { field(DESC, "Config I") field(DTYP, "Soft Channel") field(PREC, "3") field(HOPR, "165.0") field(LOPR, "0.0") field(DRVH, "165.0") field(DRVL, "0.0") field(DOL, "QUAD:LTUS:150:B2ICON.K") field(OMSL, "closed_loop") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:150:INOM") { field(DESC, "Nominal Current") field(DOL, "QUAD:LTUS:150:BNOM.K") field(OMSL, "closed_loop") field(PREC, "3") field(EGU, "A") field(DRVH, "165.0") field(DRVL, "0.0") field(HOPR, "165.0") field(LOPR, "0.0") } record(ao, "QUAD:LTUS:150:ICTRL") { field(DESC, "Set Current") field(PREC, "3") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(DRVH, "165.0") field(DRVL, "0.0") field(MDEL, "-1") field(FLNK, "QUAD:LTUS:150:ICTRLGO") field(OMSL, "supervisory") info(autosavefields,"VAL") } record(seq, "QUAD:LTUS:150:ICTRLGO") { field(DESC, "Process Current Setpoint") field(PREC, "3") # Set ISETPT to supervisory field(DOL1, "0") field(LNK1, "QUAD:LTUS:150:ISETPT.OMSL") field(DOL2, "QUAD:LTUS:150:ICTRL") field(LNK2, "QUAD:LTUS:150:ISETPT PP") # Set ISETPT to closed loop - get data from BCTRLSUB.K field(DOL3, "1") field(LNK3, "QUAD:LTUS:150:ISETPT.OMSL") } record(ao, "QUAD:LTUS:150:IMAX") { field(DESC, "Max I") field(DTYP, "Soft Channel") field(DRVH, "165.0") field(DRVL, "0.0") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(PREC, "3") field(PINI, "YES") field(VAL, "165.0") field(FLNK, "QUAD:LTUS:150:IMIN") } record(ao, "QUAD:LTUS:150:IMIN") { field(DESC, "Min I") field(DTYP, "Soft Channel") field(DRVH, "165.0") field(DRVL, "0.0") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(PREC, "3") field(VAL, "0.0") field(FLNK, "QUAD:LTUS:150:IRANGE") } record(sel, "QUAD:LTUS:150:IACTPREVOK") { field(DESC, "Last Good Current") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(PREC, "3") field(NVL, "QUAD:LTUS:150:BACT.SEVR") field(INPA, "QUAD:LTUS:150:IACT NPP MS") field(INPB, "QUAD:LTUS:150:IACTPREVOK NPP MS") field(INPC, "QUAD:LTUS:150:IACTPREVOK NPP MS") field(INPD, "QUAD:LTUS:150:IACTPREVOK NPP MS") } record(sub, "QUAD:LTUS:150:IACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:150:IDES") field(INPB, "QUAD:LTUS:150:ISETPT.DRVH") field(INPC, "QUAD:LTUS:150:ISETPT.DRVL") field(INPD, "QUAD:LTUS:150:IDELTAS.I") field(INPE, "QUAD:LTUS:150:IDELTAS.J") field(INPG, "QUAD:LTUS:150:STATE") field(INPH, "QUAD:LTUS:150:HSTA") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(sub, "QUAD:LTUS:150:IMONLIMITS") { field(DESC, "Aux Current Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:150:IDES") field(INPB, "QUAD:LTUS:150:ISETPT.DRVH") field(INPC, "QUAD:LTUS:150:ISETPT.DRVL") field(INPD, "QUAD:LTUS:150:IDELTAS.K") field(INPE, "QUAD:LTUS:150:IDELTAS.L") field(INPG, "QUAD:LTUS:150:STATE") field(INPH, "QUAD:LTUS:150:HSTA") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(seq, "QUAD:LTUS:150:ILIMITS") { field(DESC, "Set ACT and MON Limits") field(PREC, "3") field(DOL1, "QUAD:LTUS:150:BLIMITS") field(LNK1, "QUAD:LTUS:150:IACTLIMITS.F PP") field(DOL2, "QUAD:LTUS:150:IACTLIMITS.I") field(LNK2, "QUAD:LTUS:150:IACT.HIGH") field(DOL3, "QUAD:LTUS:150:IACTLIMITS.J") field(LNK3, "QUAD:LTUS:150:IACT.LOW") field(DOL4, "QUAD:LTUS:150:IACTLIMITS.K") field(LNK4, "QUAD:LTUS:150:IACT.HIHI") field(DOL5, "QUAD:LTUS:150:IACTLIMITS.L") field(LNK5, "QUAD:LTUS:150:IACT.LOLO") field(DOL6, "QUAD:LTUS:150:BLIMITS") field(LNK6, "QUAD:LTUS:150:IMONLIMITS.F PP") field(DOL7, "QUAD:LTUS:150:IMONLIMITS.I") field(LNK7, "QUAD:LTUS:150:IMON.HIGH") field(DOL8, "QUAD:LTUS:150:IMONLIMITS.J") field(LNK8, "QUAD:LTUS:150:IMON.LOW") field(DOL9, "QUAD:LTUS:150:IMONLIMITS.K") field(LNK9, "QUAD:LTUS:150:IMON.HIHI") field(DOLA, "QUAD:LTUS:150:IMONLIMITS.L") field(LNKA, "QUAD:LTUS:150: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, "QUAD:LTUS:150:IDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntRawDeltas") field(INPD, "QUAD:LTUS:150:TRIMBTOL") field(INPE, "QUAD:LTUS:150:CHCKBTOL") field(INPF, "QUAD:LTUS:150:BDELTAS.K") field(INPG, "QUAD:LTUS:150:BDELTAS.L") field(INPH, "QUAD:LTUS:150: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, "QUAD:LTUS:150:STDZITOLR") field(INPC, "QUAD:LTUS:150:STDZITOL") field(FLNK, "") } # All ps controllers with on/off control will set the macro ONOF # as follows: # # ONOF = PSC:LTUS:MG06: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, "QUAD:LTUS:150:STATESETPT") { field(DESC, "PS On/Off") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFF") field(ONAM, "ON") field(OUT, "PSC:LTUS:MG06:STATESETPT PP") 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 = PSC:LTUS:MG06:RESET PP # record(bo, "QUAD:LTUS:150:RESET") { field(DESC, "Interlock Latch Reset") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFF") field(ONAM, "ON") field(HIGH, "1.0") field(OUT, "PSC:LTUS:MG06:RESET PP") } record(bo, "QUAD:LTUS:150:RAMPSTATE") { field(DESC, "PS Ramp Status") field(DTYP, "Soft Channel") field(DOL, "PSC:LTUS:MG06:RAMPSTATE NPP 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, "QUAD:LTUS:150: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, "QUAD:LTUS:150:TRIMRAMPRATE") field(OUT, "PSC:LTUS:MG06:IRAMPRATE PP") field(FLNK, "QUAD:LTUS:150:STDZDLY") } record(ao, "QUAD:LTUS:150:ISETPT") { field(DESC, "Current Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(DRVH, "165.0") field(DRVL, "0.0") field(MDEL, "-1") field(OUT, "PSC:LTUS:MG06:ISETPT PP") field(DOL, "QUAD:LTUS:150: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, "QUAD:LTUS:150:IMON") { field(DESC, "Aux Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(INP, "PSC:LTUS:MG06:IMON") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "QUAD:LTUS:150:BMON") } record(ao, "QUAD:LTUS:150:IRIPL") { field(DESC, "Ripple Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(DOL, "PSC:LTUS:MG06:IRIPL NPP NMS") field(OMSL, "closed_loop") field(EGU, "A") field(DRVH, "1.0") field(HOPR, "1.0") field(PREC, "3") field(FLNK, "QUAD:LTUS:150:IRIPLOK") } record(sub, "QUAD:LTUS:150:IRIPLOK") { field(DESC, "Ripple Current Status") field(INAM, "mgntInit") field(SNAM, "mgntRiplOK") field(INPA, "QUAD:LTUS:150:IRIPL.VAL") field(INPB, "QUAD:LTUS:150: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, "QUAD:LTUS:150:R") { field(DESC, "Resistance") field(EGU, "Ohms") field(PREC, "4") field(PINI, "YES") field(DOL, "PSC:LTUS:MG06:R NPP MS") 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, "QUAD:LTUS:150:IGND") { field(DESC, "Ground Current") field(EGU, "A") field(PREC, "6") field(PINI, "YES") field(DOL, "PSC:LTUS:MG06:IGND NPP MS") field(OMSL, "closed_loop") } record(bi, "QUAD:LTUS:150:INTLKSUMY") { field(DESC, "Interlock Summary") field(INP, "PSC:LTUS:MG06:INTLKSUMY NPP MS") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(ZNAM, "OK") field(ONAM, "FAULT") field(PINI, "NO") } record(mbbo, "QUAD:LTUS:150: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, "PSC:LTUS:MG06:COOLING") field(OMSL, "closed_loop") } # The following PV is processed by :BACTFO # which is processed by :BACT record(fanout, "QUAD:LTUS:150:IACTFO") { field(DESC, "IACT processing") field(SELM, "All") field(LNK1, "QUAD:LTUS:150:IACTPREVOK") field(LNK2, "QUAD:LTUS:150:IDIFF") field(LNK3, "QUAD:LTUS:150:IADIFF") field(LNK4, "QUAD:LTUS:150:IRATIO") field(LNK5, "QUAD:LTUS:150:IDIRECT") field(LNK6, "QUAD:LTUS:150:IACTPOL_CHECK") } record(calc, "QUAD:LTUS:150:IDIFF") { field(DESC, "IDES-IACT") field(CALC, "A-B") field(INPA, "QUAD:LTUS:150:IDES") field(INPB, "QUAD:LTUS:150:IACT") field(EGU, "A") field(PREC, "9") field(HOPR, "165.0") field(LOPR, "0.0") } record(calc, "QUAD:LTUS:150:IADIFF") { field(DESC, "Absolute IDES-IACT") field(CALC, "A<0?ABS(A):A") field(INPA, "QUAD:LTUS:150:IDIFF") field(PREC, "9") } record(calc, "QUAD:LTUS:150:IRATIO") { field(DESC, "IDES-IACT/IMAX") field(CALC, "B?A/B:0") field(INPA, "QUAD:LTUS:150:IDIFF") field(INPB, "QUAD:LTUS:150:IDES.DRVH") field(PREC, "9") } record(calcout, "QUAD:LTUS:150:IRANGE") { field(DESC, "Current Range") field(PINI, "YES") field(CALC, "ABS(A-B)") field(INPA, "QUAD:LTUS:150:IMIN") field(INPB, "QUAD:LTUS:150: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, "QUAD:LTUS:150: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, "QUAD:LTUS:150:IACT") field(FLNK, "QUAD:LTUS:150:IACTPOL") } record(bo, "QUAD:LTUS:150:IACTPOL") { field(DESC, "Actual I Polarity") field(DTYP, "Raw Soft Channel") field(DOL, "QUAD:LTUS:150: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,"QUAD:LTUS:150:I*LIMITS:\n Calculate alarm and warning limits based on \n deltas from QUAD:LTUS:150:IDELTAS and the\n QUAD:LTUS:150: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,"QUAD:LTUS:150:IACT: \n Get copy of QUAD:LTUS:150:I. \n",null) #! TextBox(TB12,1280,3100,1760,3200,0,"Dialog",12,1,16777215,"QUAD:LTUS:150: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,"QUAD:LTUS:150:IDES:\n Contains raw value calculated by \nQUAD:LTUS:150: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 \nQUAD:LTUS:150:BDELTAS.\n",null) #! TextBox(TB10,56,1940,316,2340,0,"Dialog",12,1,16777215,"QUAD:LTUS:150: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 QUAD:LTUS:150: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 QUAD:LTUS:150: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,"QUAD:LTUS:150:ISETPT:\n Sets the hardware. When fast feedback is set on, this record is\n set to closed loop mode by QUAD:LTUS:150:FBCKSTART sequence. When \n the loop is closed, this record takes input calculated by \n BFBCK only. When fast feedback is set off, QUAD:LTUS:150:FBCKSTOP \n will set it back to supervisory so that the value can be set by \n QUAD:LTUS:150: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, "QUAD:LTUS:150:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:150:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "QUAD:LTUS:150:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "QUAD:LTUS:150:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "QUAD:LTUS:150:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "QUAD:LTUS:150:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "1") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "QUAD:LTUS:150: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, "QUAD:LTUS:150:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "QUAD:LTUS:150:TRIMTYPE.RVAL") field(INPB, "QUAD:LTUS:150:CONFIG.RVAL") field(OUT, "QUAD:LTUS:150:TRIMMAXNUM PP") } record(longout, "QUAD:LTUS:150: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, "QUAD:LTUS:150: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, "") field(OMSL, "supervisory") field(VAL, "10") field(OUT, "QUAD:LTUS:150:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "QUAD:LTUS:150: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, "") field(OMSL, "supervisory") field(VAL, "10") } record(bo, "QUAD:LTUS:150: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, "QUAD:LTUS:150: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, "QUAD:LTUS:150: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, "QUAD:LTUS:150:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "0") } record(ao, "QUAD:LTUS:150: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, "QUAD:LTUS:150:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "QUAD:LTUS:150: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, "QUAD:LTUS:150: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, "QUAD:LTUS:150:IMOVE") field(INPB, "QUAD:LTUS:150:IACT") field(INPC, "QUAD:LTUS:150:IRAMPRATE") field(INPD, "1.577") field(INPE, "QUAD:LTUS:150:TRIMDLYPCT") field(INPF, "QUAD:LTUS:150:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "QUAD:LTUS:150:RAMPTIME_LEFT PP") } record(longout, "QUAD:LTUS:150:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "QUAD:LTUS:150:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "QUAD:LTUS:150:RAMPDONE_CALC") } record(calc, "QUAD:LTUS:150:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "QUAD:LTUS:150:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "QUAD:LTUS:150:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "QUAD:LTUS:150: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, "QUAD:LTUS:150:RAMPTIME_LEFT") field(OUT, "QUAD:LTUS:150:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "QUAD:LTUS:150:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "QUAD:LTUS:150:RAMPTIME_LEFT NMS") field(OUT, "QUAD:LTUS:150:RAMPDONE PP") } record(bo, "QUAD:LTUS:150:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "QUAD:LTUS:150:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "QUAD:LTUS:150: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, "QUAD:LTUS:150: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, "QUAD:LTUS:150:STDZINIT") { field(DESC, "Proc. Stdz PVs on boot") field(PINI, "YES") field(DOL1, "1") field(DOL2, "1") field(DOL3, "1") field(LNK1, "QUAD:LTUS:150:DEBUG.PROC PP") field(LNK2, "QUAD:LTUS:150:STDZCYCLENUM.PROC PP") field(LNK3, "QUAD:LTUS:150:STDZDISABLE.PROC PP") field(LNK4, "QUAD:LTUS:150: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, "QUAD:LTUS:150:STDZSUB") { field(DESC, "Stdz subroutine") field(INAM, "mgntStdzInit") field(SNAM, "mgntStdz") field(BRSV, "INVALID") field(INPA, "QUAD:LTUS:150:STDZIMIN NPP NMS") field(INPB, "QUAD:LTUS:150:STDZIMAX NPP NMS") field(INPC, "QUAD:LTUS:150:STDZIFINAL NPP NMS") field(INPD, "QUAD:LTUS:150:STDZCYCLENUM NPP NMS") field(INPE, "QUAD:LTUS:150:STDZDIRECT.RVAL NPP NMS") field(INPF, "QUAD:LTUS:150:STDZDISABLE.RVAL CPP NMS") field(INPG, "QUAD:LTUS:150: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, "QUAD:LTUS:150:STDZWF PP") field(OUTB, "QUAD:LTUS:150: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, "QUAD:LTUS:150:STDZWF") } record(mbbo, "QUAD:LTUS:150: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, "QUAD:LTUS:150: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, "QUAD:LTUS:150:STDZMAINPS") { field(DESC, "Stdz by main or self") field(PINI, "YES") field(DTYP, "Soft Channel") field(ZNAM, "SELF") field(ONAM, "MAIN") } record(bo, "QUAD:LTUS:150: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, "QUAD:LTUS:150: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, "QUAD:LTUS:150: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, "QUAD:LTUS:150:STDZTOD") { field(DESC, "Successful Standardize Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "QUAD:LTUS:150:STDZLOSTTOD") { field(DESC, "Standardize Lost Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(longout, "QUAD:LTUS:150:STDZCYCLECNT") { field(DESC, "Cycle Count") field(PINI, "YES") } record(longout, "QUAD:LTUS:150:STDZCYCLENUM") { field(DESC, "No. Standardize Cycles") field(VAL, "3") field(HOPR, "10") field(LOPR, "0") field(DRVH, "10") field(DRVL, "0") field(PINI, "YES") field(FLNK, "QUAD:LTUS:150:STDZDIRECT") } # The default standardize direction is "UP" for # all LCLS Magnets.. record(bo, "QUAD:LTUS:150:STDZDIRECT") { field(DESC, "Standardize Direction ") field(ZNAM, "UP") field(ONAM, "DOWN") field(VAL, "0") field(FLNK, "QUAD:LTUS:150:STDZIMIN") } record(ao, "QUAD:LTUS:150:STDZIMIN") { field(DESC, "Min-STDZ Current") field(PREC, "1") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(VAL, "0.0") field(FLNK, "QUAD:LTUS:150:STDZIMAX") } record(ao, "QUAD:LTUS:150:STDZIMAX") { field(DESC, "Max. Standarize Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(VAL, "165.0") field(FLNK, "QUAD:LTUS:150:STDZIFINAL") } record(ao, "QUAD:LTUS:150:STDZIFINAL") { field(DESC, "Final SDTZ Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(VAL, "0.0") field(FLNK, "QUAD:LTUS:150: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, "QUAD:LTUS:150: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, "QUAD:LTUS:150:STDZITOL") { field(DESC, "Stdz min tolerance") field(PREC, "5") field(CALC, "MAX(ABS(A),ABS(B))*C") field(INPA, "QUAD:LTUS:150:STDZIMIN CP NMS") field(INPB, "QUAD:LTUS:150:STDZIMAX CP MMS") field(INPC, "0.05") field(INPD, "QUAD:LTUS:150:STDZITOLR CP MMS") field(EGU, "A") field(FLNK, "QUAD:LTUS:150:IDELTAS") field(PINI, "YES") } # D - factor (3.154/2 = 1.577) for EPSC, otherwise, set to 1.0 record(calc, "QUAD:LTUS:150:STDZDLY") { field(DESC, "Ramp time for stdz cycle") field(CALC, "C>0?MAX(1,ABS((A-B)/C)*D):0") field(INPA, "QUAD:LTUS:150:STDZIMIN CP NMS") field(INPB, "QUAD:LTUS:150:STDZIMAX CP NMS") field(INPC, "QUAD:LTUS:150:TRIMRAMPRATE CP NMS") field(INPD, "1.577") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") } record(calc, "QUAD:LTUS:150:STDZRAMPDLY") { field(DESC, "Ramp delay total") field(CALC, "MAX(1,((A/100)*B+B))") field(PREC, "5") field(INPA, "QUAD:LTUS:150:TRIMDLYPCT CP MS") field(INPB, "QUAD:LTUS:150: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, "QUAD:LTUS:150:STDZMINIDLY") { field(DESC, "Mini-stdz delay") field(CALC, "A") field(PREC, "5") field(A, "1.0") field(EGU, "sec") field(PINI, "YES") } record(ao, "QUAD:LTUS:150: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, "QUAD:LTUS:150:STDZMINIDELTA") { field(DESC, "Stdz mini % of IMAX") field(CALC, "(B/100)*(A-C)") field(INPA, "QUAD:LTUS:150:IDES.HOPR") field(INPB, "QUAD:LTUS:150:STDZMINIPCT CPP NMS") field(INPC, "QUAD:LTUS:150:IDES.LOPR") field(PREC, "5") } record(calc, "QUAD:LTUS:150:STDZMINISETPT") { field(DESC, "Mini Stdz delta") field(CALC, "C==0?MAX(E-D,B):MIN(E+D,A)") field(INPA, "QUAD:LTUS:150:IDES.HOPR") field(INPB, "QUAD:LTUS:150:IDES.LOPR") field(INPC, "QUAD:LTUS:150:STDZDIRECT.RVAL") field(INPD, "QUAD:LTUS:150:STDZMINIDELTA") field(INPE, "QUAD:LTUS:150:IDES") field(PREC, "5") field(FLNK, "QUAD:LTUS:150: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, "QUAD:LTUS:150:STDZMINISETPTOOR") { field(DESC, "Mini Stdz setpoint out of range") field(CALC, "C==0?(E-DA)") field(INPA, "QUAD:LTUS:150:IDES.HOPR") field(INPB, "QUAD:LTUS:150:IDES.LOPR") field(INPC, "QUAD:LTUS:150:STDZDIRECT.RVAL") field(INPD, "QUAD:LTUS:150:STDZMINIDELTA") field(INPE, "QUAD:LTUS:150: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, "QUAD:LTUS:150: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, "QUAD:LTUS:150:IADJUST.RVAL") field(INPB, "QUAD:LTUS:150:STDZDIRECT.RVAL") field(INPC, "QUAD:LTUS:150:STDZOK.RVAL") field(INPD, "QUAD:LTUS:150:STDZDISABLE.RVAL") field(INPE, "QUAD:LTUS:150:STATE.RVAL CPP NMS") field(INPF, "QUAD:LTUS:150:ICTRL.RVAL") field(INPG, "QUAD:LTUS:150:STATE.SEVR") field(INPH, "QUAD:LTUS:150:BDELTAS.M") field(INPI, "QUAD:LTUS:150:IACT.SEVR") field(OUT, "QUAD:LTUS:150:STDZLOSTGO.SELN PP NMS") field(OOPT, "Transition To Non-zero") } record(seq, "QUAD:LTUS:150:STDZLOSTGO") { field(DESC, "Process lost stdz") field(SELM, "Mask") field(DOL1, "1") field(DOL2, "0") field(LNK1, "QUAD:LTUS:150:STDZLOSTTOD.PROC") field(LNK2, "QUAD:LTUS:150:STDZOK PP") } # Record maximum current after standardize # Reset to IACT from sequence after trim # Disable processing during (mini-)standardize or trim record(calc, "QUAD:LTUS:150:STDZIACTMAX") { field(DESC, "Max act current after stdz") field(CALC, "MAX(A, B)") field(DISV, "0") field(SDIS, "QUAD:LTUS:150:CHECKPWRDIP_ENABLE") field(INPA, "QUAD:LTUS:150:IACT CP") field(INPB, "QUAD:LTUS:150:STDZIACTMAX") field(EGU, "A") field(FLNK, "QUAD:LTUS:150:CHECKPWRDIP") } # Detect power dip if STDZOK is YES, STDZ is enabled, and IACT is valid # If IACT drops below STDZIACTMAX by more than the trim tolerance, clear STDZOK # Warning: Take the absolute value of the trim tolerance, or else quads of # negative polarity will always lose STDZ since their IDELTAS.I are negative. # Note: Large quads and bends are prone to losing STDZ even if they are # perturbed toward higher current since their current tends to overshoot # by greater than the trim tolerance before settling down. record(calcout, "QUAD:LTUS:150:CHECKPWRDIP") { field(DESC, "Detect power dip") field(CALC, "(A-B>ABS(C))?3:0") field(DISV, "0") field(SDIS, "QUAD:LTUS:150:CHECKPWRDIP_ENABLE") field(INPA, "QUAD:LTUS:150:STDZIACTMAX") field(INPB, "QUAD:LTUS:150:IACT") field(INPC, "QUAD:LTUS:150:IDELTAS.I") field(OUT, "QUAD:LTUS:150:STDZLOSTGO.SELN PP NMS") field(OOPT, "When Non-zero") } # Enable processing of STDZIACTMAX and CHECKPWRDIP only if # STDZOK = YES, STDZDISABLE = NO, CTRL != Trim (2), and # CTRL != Stdz (4) record(calc, "QUAD:LTUS:150:CHECKPWRDIP_ENABLE") { field(CALC, "A&&!B&&(C#2)&&(C#4)") field(INPA, "QUAD:LTUS:150:STDZOK.RVAL CP") field(INPB, "QUAD:LTUS:150:STDZDISABLE.RVAL CP") field(INPC, "QUAD:LTUS:150:CTRL.RVAL CP") } #! 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, "QUAD:LTUS:150: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, "QUAD:LTUS:150:CALBOK") { field(DESC, "Successful Calibration") field(DTYP, "Raw Soft Channel") field(ZNAM, "NO") field(ONAM, "YES") field(DOL, "PSC:LTUS:MG06:CALBOK.RVAL") field(OMSL, "closed_loop") 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, "QUAD:LTUS:150:CALBSET") { field(DESC, "Use DAC Calbration") field(SCAN, "10 second") field(CALC, "A&&(B==0)&&C?31:960") field(INPA, "QUAD:LTUS:150:CALBOK") field(INPB, "QUAD:LTUS:150:CALBDISABLE") field(INPC, "QUAD:LTUS:150:CALBSLOPE") field(OOPT, "On Change") field(OUT, "QUAD:LTUS:150: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, "QUAD:LTUS:150:CALB_SEQ") { field(DESC, "Output Calib Values") field(SELM, "Mask") field(SELL, "QUAD:LTUS:150: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, "QUAD:LTUS:150:CALBSLOPE") field(DOL3, "QUAD:LTUS:150: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, "QUAD:LTUS:150:CALBTOD") { field(DESC, "Calibration Success Time") field(PINI, "YES") field(DOL, "PSC:LTUS:MG06:CALBTOD") field(OMSL, "closed_loop") field(DTYP, "Soft Channel") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:150: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, "QUAD:LTUS:150: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, "QUAD:LTUS:150: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, "QUAD:LTUS:150:CALBOFFSET") { field(DESC, "Calc DAC Offset") field(PREC, "6") field(EGU, "Counts") field(PINI, "YES") } record(bo, "QUAD:LTUS:150: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, "QUAD:LTUS:150:DACSLOPE") { field(DESC, "V to DAC slope") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "closed_loop") field(PINI, "YES") field(FLNK, "QUAD:LTUS:150:DACOFFSET") } # Default Offset used in conversion from Volts to DAC Counts record(ao, "QUAD:LTUS:150:DACOFFSET") { field(DESC, "V to DAC offset") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "closed_loop") field(PINI, "YES") field(FLNK, "QUAD:LTUS:150: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, "QUAD:LTUS:150: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, "QUAD:LTUS:150:IACT") field(INPD, "QUAD:LTUS:150:DACSLOPE") field(INPE, "QUAD:LTUS:150:DACOFFSET") field(EGU, "Counts") field(PREC, "6") } record(ao, "QUAD:LTUS:150:DAC") { field(DESC, "DAC Set point") field(EGU, "Counts") field(DOL, "") field(OMSL, "closed_loop") field(PREC, "6") field(PINI, "YES") } record(ao, "QUAD:LTUS:150:CALBIMIN") { field(DESC, "Calibration Min Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(DRVH, "165.0") field(HOPR, "165.0") field(DRVL, "0.0") field(LOPR, "0.0") field(PREC, "3") field(EGU, "A") field(VAL, "0.0") field(FLNK, "QUAD:LTUS:150:CALBIMAX") } record(ao, "QUAD:LTUS:150:CALBIMAX") { field(DESC, "Calibration Max Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(DRVH, "165.0") field(HOPR, "165.0") field(LOPR, "0.0") field(DRVL, "0.0") field(EGU, "A") field(VAL, "165.0") field(FLNK, "QUAD:LTUS:150:CALBSTEPNUM") } record(ao, "QUAD:LTUS:150:CALBIFINAL") { field(DESC, "Calibration Last Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(PREC, "3") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(VAL, "0") } record(longout, "QUAD:LTUS:150: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, "QUAD:LTUS:150:CALBIDELTA") } record(calc, "QUAD:LTUS:150:CALBIDELTA") { field(DESC, "Step size for CALB") field(CALC, "C=0?0:ABS((A-B)/C)") field(INPA, "QUAD:LTUS:150:CALBIMAX") field(INPB, "QUAD:LTUS:150:CALBIMIN") field(INPC, "QUAD:LTUS:150: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, "QUAD:LTUS:150:CALBIMULT") { field(DESC, "IACT vs ISETPT mult") field(CALC, "C#0||A=0?1:ABS(B/A)") field(INPA, "PSC:LTUS:MG06:ISETPT.DRVH") field(INPB, "PSC:LTUS:MG06:IACT.HOPR") field(INPC, "QUAD:LTUS:150:PSCONTROLLER.RVAL CPP") field(EGU, "A") field(PINI, "YES") } # SNL dbputs DAC values here. 6-10 steps are possible. record(waveform, "QUAD:LTUS:150:CALBICTRLWF") { field(DESC, "ICTRL setpoint array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") } record(waveform, "QUAD:LTUS:150:DACWF") { field(DESC, "DAC count array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:150:DACSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:150:DACSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "QUAD:LTUS:150: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, "QUAD:LTUS:150:CALCDACWF") { field(DESC, "Calc DAC counts array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:150:CALCDACSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:150:CALCDACSA") { field(DESC, "Calc DAC counts") field(DTYP, "Soft Channel") field(INP, "QUAD:LTUS:150: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, "QUAD:LTUS:150:CALBYWF") { field(DESC, "mx + b") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:150:CALBYSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:150:CALBYSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "QUAD:LTUS:150:CALBYWF") field(MALM, "10") field(NELM, "6") field(INDX, "0") field(FTVL, "DOUBLE") } record(waveform, "QUAD:LTUS:150:CALBIACTWF") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:150:CALBIACTSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:150:CALBIACTSA") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(MALM, "10") field(NELM, "6") field(INP, "QUAD:LTUS:150:CALBIACTWF") field(INDX, "0") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:150:CALBLIMITS") } # Check that measured current during calibration is within # tolerance. record(aSub, "QUAD:LTUS:150: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, "QUAD:LTUS:150:CALBSTEPNUM") field(INPB, "QUAD:LTUS:150:CALBIACTWF") field(INPC, "QUAD:LTUS:150: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, "QUAD:LTUS:150: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, "QUAD:LTUS:150:STDZITOL") field(INPH, "QUAD:LTUS:150:DACSLOPE") field(INPI, "QUAD:LTUS:150: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, "QUAD:LTUS:150: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, "QUAD:LTUS:150:CALBSTEPNUM") field(INPB, "QUAD:LTUS:150:CALBIACTWF") field(INPC, "QUAD:LTUS:150:DACWF") field(INPF, "QUAD:LTUS:150: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 QUAD:LTUS:150CALBOK 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, "QUAD:LTUS:150:DEGAUSINIT") { field(DESC, "Proc. Degauss PVs on boot") field(PINI, "YES") field(DOL, "1") field(OUTA, "QUAD:LTUS:150:DEGAUSIMIN.PROC PP") field(OUTB, "QUAD:LTUS:150:DEGAUSIMAX.PROC PP") field(OUTC, "QUAD:LTUS:150:DEGAUSTYPE.PROC PP") field(OUTD, "QUAD:LTUS:150:DEGAUSSTEP.PROC PP") field(OUTE, "QUAD:LTUS:150:MADNAME.PROC PP") field(OUTF, "QUAD:LTUS:150:PSTYPE.PROC PP") field(OUTG, "QUAD:LTUS:150: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, "QUAD:LTUS:150:DEGAUSSUB") { field(DESC, "Degauss subroutine") field(INAM, "mgntDegaussInit") field(SNAM, "mgntDegauss") field(BRSV, "INVALID") field(INPA, "QUAD:LTUS:150:DEGAUSIMIN NPP NMS") field(INPB, "QUAD:LTUS:150:DEGAUSIMAX NPP NMS") field(INPC, "QUAD:LTUS:150:DEGAUSTYPE.RVAL NPP NMS") field(INPE, "QUAD:LTUS:150:DEGAUSMETHOD.RVAL NPP NMS") field(INPF, "QUAD:LTUS:150:PSTYPE NPP NMS") field(INPG, "QUAD:LTUS:150:DEBUG.RVAL NPP NMS") field(INPH, "QUAD:LTUS:150: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, "QUAD:LTUS:150:DEGAUSWF PP") field(OUTB, "QUAD:LTUS:150:DEGAUSMSG PP") field(OUTC, "QUAD:LTUS:150: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, "QUAD:LTUS:150:DEGAUSWF") { field(DESC, "Degauss Setpts") field(NELM, "60") field(FTVL, "DOUBLE") } record(mbbo,"QUAD:LTUS:150: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, "QUAD:LTUS:150: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, "QUAD:LTUS:150: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, "QUAD:LTUS:150: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, "QUAD:LTUS:150: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, "QUAD:LTUS:150:DEGAUSIMIN") { field(DESC, "Min. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "165.0") field(LOPR, "-165.0") field(DRVH, "165.0") field(DRVL, "-165.0") field(VAL, "-165.0") } record(ao, "QUAD:LTUS:150:DEGAUSIMAX") { field(DESC, "Max. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "165.0") field(LOPR, "-165.0") field(DRVH, "165.0") field(DRVL, "-165.0") field(VAL, "165.0") } # 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,"QUAD:LTUS:150: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, "QUAD:LTUS:150: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,"QUAD:LTUS:150: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, "QUAD:LTUS:150: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, "QUAD:LTUS:150: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, "QUAD:LTUS:150: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, "QUAD:LTUS:150:DEGAUSTOD") { field(DESC, "Successful Degauss Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "QUAD:LTUS:150:DEGAUSLOSTTOD") { field(DESC, "Degauss Lost Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:150:DEGAUSTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "QUAD:LTUS:150:DEGAUSTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "QUAD:LTUS:150: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, "QUAD:LTUS:150:DEGAUSGO") { field(DESC, "Set bdes of btrms to zero") field(ASG, "Internal") field(OUTA, "") field(OUTB, "") field(OUTC, "") field(OUTD, "") } # =========== CRYO ONLY =========== record(bo, "QUAD:LTUS:150: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, "QUAD:LTUS:150:DEGAUS_IMAX_CHECK") { field(DESC, "Check if imax shoud chg") field(CALC, "(C==4)&&(ABS(B)>ABS(A))?1:0") field(INPA, "QUAD:LTUS:150:DEGAUS_IMAX") field(INPB, "QUAD:LTUS:150:ISETPT") field(INPC, "QUAD:LTUS:150:DEGAUSTYPE.RVAL") field(OUT, "QUAD:LTUS:150:DEGAUS_IMAX_UPDATE.SELN") field(FLNK, "QUAD:LTUS:150:DEGAUS_IMAX_UPDATE") } record(seq, "QUAD:LTUS:150:DEGAUS_IMAX_UPDATE") { field(DESC, "Degauss IMAX Update") field(SELM, "Specified") field(DOL1, "QUAD:LTUS:150:ISETPT") field(LNK1, "QUAD:LTUS:150:DEGAUS_IMAX PP") } # Set the maximum current after a successful # degauss. This pv is updated by the # sequence. record(ao, "QUAD:LTUS:150:DEGAUS_IMAX") { field(DESC, "Max I set afer a degauss") field(EGU, "Amps") field(PINI, "YES") field(PREC, "6") field(HOPR, "165.0") field(LOPR, "-165.0") field(DRVH, "165.0") field(DRVL, "-165.0") field(VAL, "165.0") field(FLNK, "QUAD:LTUS:150:DEGAUS_IMAXPOL_CHECK") info(autosaveFields,"VAL,RVAL") } # Set the polarity if degauss_imax record(calcout, "QUAD:LTUS:150:DEGAUS_IMAXPOL_CHECK") { field(DESC, "Determine polarity of imax") field(CALC, "A>=0?0:1") field(INPA, "QUAD:LTUS:150:DEGAUS_IMAX") field(FLNK, "QUAD:LTUS:150:DEGAUS_IMAXPOL") } record(bo, "QUAD:LTUS:150:DEGAUS_IMAXPOL") { field(DESC, "Polarity of imax I") field(DTYP, "Raw Soft Channel") field(DOL, "QUAD:LTUS:150:DEGAUS_IMAXPOL_CHECK") field(OMSL, "closed_loop") field(ZNAM, "Positive") field(ONAM, "Negative") field(FLNK, "QUAD:LTUS:150: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, "QUAD:LTUS:150:DEGAUS_ABSIMAX") { field(DESC, "Absolute Max. Degauss I") field(CALC, "ABS(A)") field(INPA, "QUAD:LTUS:150:DEGAUS_IMAX") field(PREC, "6") field(EGU, "Amps") field(HOPR, "165.0") field(LOPR, "-165.0") info(autosaveFields,"VAL RVAL") } # IACT Polarity record(calcout, "QUAD:LTUS:150:IACTPOL_CHECK") { field(DESC, "Determine IACT polarity") field(SCAN, "5 second") field(CALC, "ABS(A-B)>C?(A>=0?0:1):D") field(INPA, "QUAD:LTUS:150:IACT") field(INPB, "QUAD:LTUS:150:IACTPOL_CHECK.LA") field(INPC, "0.0001") field(INPD, "QUAD:LTUS:150:IACTPOL_CHECK.PVAL") field(OOPT, "On Change") field(FLNK, "QUAD:LTUS:150:IACTPOL") } record(bo, "QUAD:LTUS:150: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,"QUAD:LTUS:150: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, "QUAD:LTUS:150:DEGAUSENABLE CP") field(INPB, "QUAD:LTUS:150:DEGAUSOK") field(INPC, "QUAD:LTUS:150:STATE CP") field(INPD, "QUAD:LTUS:150:STATE.SEVR") field(OUT, "QUAD:LTUS:150:DEGAUS_STATE_SEQ.SELN PP") field(ASG, "Internal") } record(seq, "QUAD:LTUS:150:DEGAUS_STATE_SEQ") { field(DESC, "Degauss State Sequence") field(SELM, "Specified") field(SELL, "QUAD:LTUS:150:DEGAUS_STATE_CHECK") field(LNK1, "QUAD:LTUS:150:DEGAUS_STATE_DISABLE.PROC PP") field(LNK2, "QUAD:LTUS:150:DEGAUS_STATE_LOST.PROC PP") field(LNK3, "QUAD:LTUS:150:DEGAUS_STATE_GOOD.PROC PP") field(LNK4, "QUAD:LTUS:150: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, "QUAD:LTUS:150:DEGAUS_STATE_DISABLE") { field(DESC, "Degauss not used") field(LNK1, "QUAD:LTUS:150:DEGAUSOK.ZSV") field(LNK2, "QUAD:LTUS:150: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, "QUAD:LTUS:150:STATMSG.FRSV") field(LNK4, "QUAD:LTUS:150: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, "QUAD:LTUS:150:DEGAUS_STATE_LOST") { field(DESC, "Degauss lost and ps On") field(DOL1, "1") field(LNK1, "QUAD:LTUS:150:DEGAUSOK.ZSV") field(LNK2, "QUAD:LTUS:150: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, "QUAD:LTUS:150:STATMSG.FRSV") field(LNK4, "QUAD:LTUS:150: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, "QUAD:LTUS:150:DEGAUS_STATE_OFF") { field(DESC, "Degaused lost and ps Off") field(DOL1, "2") field(LNK1, "QUAD:LTUS:150: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, "QUAD:LTUS:150:STATMSG.FRSV") field(LNK3, "QUAD:LTUS:150: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, "QUAD:LTUS:150:DEGAUS_STATE_GOOD") { field(DESC, "Degauss good") field(DOL1, "1") field(LNK1, "QUAD:LTUS:150: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, "QUAD:LTUS:150:STATMSG.FRSV PP") field(LNK3, "QUAD:LTUS:150:STATMSG.FVSV PP") field(LNK4, "") field(ASG, "Internal") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(mbbo, "QUAD:LTUS:150:FUNC") { field(DESC, "QUAD:LTUS:150 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, "1") field(THVL, "9") field(FRVL, "10") field(FVVL, "0") field(SXVL, "2") field(SVVL, "8") field(EIVL, "11") field(NIVL, "12") field(TEVL, "13") field(ELVL, "5") field(TVVL, "6") field(TTVL, "7") field(FTVL, "4") field(FFVL, "3") field(OUT, "QUAD:LTUS:150:CTRL CA") } # :CTRL pv is processed at boot in the # sequence mgntCtrl.st Processed in sequence # record(mbbo, "QUAD:LTUS:150:CTRL") { field(DESC, "QUAD:LTUS:150 Control") field(PINI, "NO") field(ZRST, "Ready") field(ONST, "TRIM") field(TWST, "PERTURB") field(THST, "BCON_TO_BDES") field(FRST, "BACT_TO_BDES") field(FVST, "SAVE_BDES") field(SXST, "LOAD_BDES") field(SVST, "UNDO_BDES") field(EIST, "DAC_ZERO") field(NIST, "CALB") field(TEST, "STDZ") field(ELST, "RESET") field(TVST, "TURN_ON") field(TTST, "TURN_OFF") field(FTST, "") field(FFST, "") field(ZRVL, "0") field(ONVL, "2") field(TWVL, "6") field(THVL, "15") field(FRVL, "14") field(FVVL, "11") field(SXVL, "12") field(SVVL, "13") field(EIVL, "7") field(NIVL, "3") field(TEVL, "4") field(ELVL, "8") field(TVVL, "9") field(TTVL, "10") field(FTVL, "0") field(FFVL, "0") field(OUT, "QUAD:LTUS:150:SELECTEN.A PP") field(SDIS, "0") } # If a function has been selected set this unit to busy record(calcout, "QUAD:LTUS:150:SELECTEN") { field(DESC, "Control Select Enable") field(CALC, "A>0?1:A") field(FLNK, "QUAD:LTUS:150:BUSY") } # Set to FREE on IOC reboot record(bo, "QUAD:LTUS:150:BUSY") { field(DESC, "QUAD:LTUS:150 Ctrl Done") field(DOL, "QUAD:LTUS:150:SELECTEN") field(ZNAM, "FREE") field(ONAM, "BUSY") field(PINI, "YES") field(FLNK, "QUAD:LTUS:150:SELECT") } record(bo, "QUAD:LTUS:150:SELECT") { field(ZNAM, "NO") field(ONAM, "YES") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") } record(bo, "QUAD:LTUS:150: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, "QUAD:LTUS:150:CTRLSTATE") { field(DESC, "QUAD:LTUS:150 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("QUAD:LTUS:150:CTRL",20,20,0,0,"QUAD:LTUS:150:CTRL") #! Field("QUAD:LTUS:150:CTRL.OUT",16777215,1,"QUAD:LTUS:150:CTRL.OUT") #! Link("QUAD:LTUS:150:CTRL.OUT","QUAD:LTUS:150:SELECTEN.A") #! Field("QUAD:LTUS:150:CTRL.VAL",16777215,1,"QUAD:LTUS:150:CTRL.VAL") #! Record("QUAD:LTUS:150:SELECTEN",321,381,0,0,"QUAD:LTUS:150:SELECTEN") #! Field("QUAD:LTUS:150:SELECTEN.A",16777215,0,"QUAD:LTUS:150:SELECTEN.A") #! Field("QUAD:LTUS:150:SELECTEN.FLNK",16777215,1,"QUAD:LTUS:150:SELECTEN.FLNK") #! Link("QUAD:LTUS:150:SELECTEN.FLNK","QUAD:LTUS:150:BUSY") #! Field("QUAD:LTUS:150:SELECTEN.VAL",16777215,1,"QUAD:LTUS:150:SELECTEN.VAL") #! Record("QUAD:LTUS:150:BUSY",623,274,0,0,"QUAD:LTUS:150:BUSY") #! Field("QUAD:LTUS:150:BUSY.DOL",16777215,0,"QUAD:LTUS:150:BUSY.DOL") #! Link("QUAD:LTUS:150:BUSY.DOL","QUAD:LTUS:150:SELECTEN.VAL") #! Field("QUAD:LTUS:150:BUSY.FLNK",16777215,1,"QUAD:LTUS:150:BUSY.FLNK") #! Link("QUAD:LTUS:150:BUSY.FLNK","QUAD:LTUS:150:SELECT") #! Record("QUAD:LTUS:150:SELECT",669,508,0,1,"QUAD:LTUS:150:SELECT") #! Record("QUAD:LTUS:150:FUNC",940,120,0,0,"QUAD:LTUS:150:FUNC") #! Field("QUAD:LTUS:150:FUNC.OUT",16777215,0,"QUAD:LTUS:150:FUNC.OUT") #! Link("QUAD:LTUS:150:FUNC.OUT","QUAD:LTUS:150:CTRL.VAL") #! Record("QUAD:LTUS:150:ABORT",193,41,0,0,"QUAD:LTUS:150:ABORT") #! Record("QUAD:LTUS:150:CTRLSTATE",369,34,0,0,"QUAD:LTUS:150: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,"QUAD:LTUS:150:SELECT is used for Multi-device selection.\nIt is enabled when associated QUAD:LTUS:150:CTRL is \"0\" (DONE).\nIt is disabled when associated QUAD:LTUS:150: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,"QUAD:LTUS:150: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, "QUAD:LTUS:150:BCTRL_INIT") { field(DESC, "Process BCTRL on boot") field(PINI, "YES") field(CALC, "A=3?1:0") field(INPA, "QUAD:LTUS:150:BCTRL.SEVR") field(OUT, "QUAD:LTUS:150: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, "QUAD:LTUS:150:BACT") { field(DESC, "Actual B") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "QUAD:LTUS:150:BACT") field(INPB, "QUAD:LTUS:150:POLYCOEF") field(INPC, "QUAD:LTUS:150:POLYCOEF.A") field(INPD, "QUAD:LTUS:150:POLYCOEF.B") field(INPE, "QUAD:LTUS:150:IACT MS") field(INPF, "QUAD:LTUS:150:BDELTAS PP") field(INPG, "100") field(EGU, "kG") field(HOPR, "52.2485") field(LOPR, "0.2518") field(HIHI, "52.2485") field(LOLO, "0.2518") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "52.2485") field(LOW, "0.2518") field(FLNK, "QUAD:LTUS:150: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, "QUAD:LTUS:150:BDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntPhyDeltas") field(EGU, "kG") field(HOPR, "1") field(PREC, "7") field(BRSV, "INVALID") field(INPA, "QUAD:LTUS:150:BDES") field(INPB, "QUAD:LTUS:150:TRIMBTOL") field(INPC, "QUAD:LTUS:150:TRIMBTOLR") field(INPD, "QUAD:LTUS:150:CHCKBTOL") field(INPE, "QUAD:LTUS:150:CHCKBTOLR") field(F, "2.0") field(INPG, "30") field(INPH, "QUAD:LTUS:150:BACT.VAL") # # MPS absolute and relative tolerances field(INPP, "QUAD:LTUS:150:MPSBTOL") field(INPQ, "QUAD:LTUS:150:MPSBTOLR") field(FLNK, "QUAD:LTUS:150:BCONLIMITS") info(autosaveFields,"F") } # This record is processed by BDELTAS record(aSub, "QUAD:LTUS:150:BCONLIMITS") { field(DESC, "Config B-field Limits") field(INAM, "mgntInit") field(SNAM, "mgntBCONLimits") field(INPA, "QUAD:LTUS:150:BDES") field(INPB, "QUAD:LTUS:150:BDELTAS.I") field(INPG, "QUAD:LTUS:150:DEBUG.RVAL") field(FTA, "DOUBLE") field(FTB, "DOUBLE") field(FTG, "ULONG") field(OUTA, "QUAD:LTUS:150:BCON.HIGH") field(OUTB, "QUAD:LTUS:150:BCON.LOW") field(OUTC, "QUAD:LTUS:150:BCON.HIHI") field(OUTD, "QUAD:LTUS:150:BCON.LOLO PP") field(FTVA, "DOUBLE") field(FTVB, "DOUBLE") field(FTVC, "DOUBLE") field(FTVD, "DOUBLE") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:150:IDELTAS") } # The following PV is processed by :BACT # which is processed by :BACT # record(fanout, "QUAD:LTUS:150:BACTFO") { field(DESC, "BACT processing") field(SELM, "All") field(LNK1, "QUAD:LTUS:150:BDIFF") field(LNK2, "QUAD:LTUS:150:BADIFF") field(LNK3, "QUAD:LTUS:150:BRATIO") field(LNK4, "QUAD:LTUS:150:MPSLIMITS") field(LNK5, "QUAD:LTUS:150:I2BSTATUS") field(LNK6, "QUAD:LTUS:150:IACTFO.PROC") } record(calc, "QUAD:LTUS:150:BDIFF") { field(DESC, "BDES-BACT") field(CALC, "A-B") field(INPA, "QUAD:LTUS:150:BDES") field(INPB, "QUAD:LTUS:150:BACT") field(EGU, "kG") field(PREC, "7") } record(calc, "QUAD:LTUS:150:BADIFF") { field(DESC, "Absolute BDES-BACT") field(INPA, "QUAD:LTUS:150:BDIFF") field(EGU, "kG") field(PREC, "7") field(CALC, "A<0?ABS(A):A") } record(calc, "QUAD:LTUS:150:BRATIO") { field(DESC, "BACT Error") field(CALC, "B?A/B:0") field(INPA, "QUAD:LTUS:150:BDIFF") field(INPB, "QUAD:LTUS:150:BDES.HOPR") field(EGU, "kG") field(PREC, "7") } record(mbbi, "QUAD:LTUS:150: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, "QUAD:LTUS:150:BACT.J") } # Note: for a string slave set the MONFL # macro to the following: # MONFL=:IMONCALC MS record(sub, "QUAD:LTUS:150:BMON") { field(DESC, "Second Transductor") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "QUAD:LTUS:150:BMON") field(INPB, "QUAD:LTUS:150:POLYCOEF") field(INPC, "QUAD:LTUS:150:POLYCOEF.A") field(INPD, "QUAD:LTUS:150:POLYCOEF.B") field(INPE, "QUAD:LTUS:150:IMON MS") field(INPF, "QUAD:LTUS:150:BDELTAS.VAL") field(INPG, "100") field(EGU, "kG") field(HOPR, "52.2485") field(LOPR, "0.2518") field(HIHI, "52.2485") field(LOLO, "0.2518") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "52.2485") field(LOW, "0.2518") } # 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=PSC:LTUS:MG06:BDES CP record(ao, "QUAD:LTUS:150:BDES") { field(DESC, "Desired B-Field") field(PINI, "YES") field(DRVH, "52.2485") field(DRVL, "0.2518") field(HOPR, "52.2485") field(LOPR, "0.2518") field(PREC, "7") field(EGU, "kG") field(MDEL, "-1") field(OMSL, "supervisory") # field(DOL, "") field(OUT, "QUAD:LTUS:150:B2IDES PP") info(autosaveFields,"VAL") } record(sub, "QUAD:LTUS:150:B2IDES") { field(DESC, "Convert Desired B-Field to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:150:POLYCOEF") field(INPC, "QUAD:LTUS:150:POLYCOEF.A") field(INPD, "QUAD:LTUS:150:POLYCOEF.B") field(PREC, "7") field(EGU, "kG") field(HOPR, "52.2485") field(LOPR, "0.2518") field(MDEL, "-1") field(INPE, "QUAD:LTUS:150:BDES.DRVH") field(INPF, "QUAD:LTUS:150:BDES.DRVL") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:150:IDES") } record(sub, "QUAD:LTUS:150:BNOM") { field(DESC, "Nominal Field") field(PINI, "YES") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:150:POLYCOEF") field(INPC, "QUAD:LTUS:150:POLYCOEF.A") field(INPD, "QUAD:LTUS:150:POLYCOEF.B") field(INPE, "QUAD:LTUS:150:BDES.DRVH") field(INPF, "QUAD:LTUS:150:BDES.DRVL") field(EGU, "kG") field(HOPR, "52.2485") field(LOPR, "0.2518") field(PREC, "7") field(VAL, "0.0") field(FLNK, "QUAD:LTUS:150:INOM") } record(sub, "QUAD:LTUS:150:BACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:150:BDES.VAL") field(INPB, "QUAD:LTUS:150:BDES.DRVH") field(INPC, "QUAD:LTUS:150:BDES.DRVL") field(INPD, "QUAD:LTUS:150:BDELTAS.I") field(INPE, "QUAD:LTUS:150:BDELTAS.J") field(INPG, "QUAD:LTUS:150:STATE") field(INPH, "QUAD:LTUS:150:HSTA") field(EGU, "kG") field(HOPR, "52.2485") field(LOPR, "0.2518") field(PREC, "7") field(BRSV, "INVALID") } record(sub, "QUAD:LTUS:150:BMONLIMITS") { field(DESC, "MON Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:150:BDES.VAL") field(INPB, "QUAD:LTUS:150:BDES.DRVH") field(INPC, "QUAD:LTUS:150:BDES.DRVL") field(INPD, "QUAD:LTUS:150:BDELTAS.K") field(INPE, "QUAD:LTUS:150:BDELTAS.L") field(INPG, "QUAD:LTUS:150:STATE") field(INPH, "QUAD:LTUS:150:HSTA") field(EGU, "kG") field(HOPR, "52.2485") field(LOPR, "0.2518") field(PREC, "7") field(BRSV, "INVALID") } record(seq, "QUAD:LTUS:150:BLIMITS") { field(DESC, "ACT Limits") field(PREC, "7") field(DOL1, "QUAD:LTUS:150:BLIMITS") field(LNK1, "QUAD:LTUS:150:BACTLIMITS.F PP") field(DOL2, "QUAD:LTUS:150:BACTLIMITS.I") field(LNK2, "QUAD:LTUS:150:BACT.HIGH") field(DOL3, "QUAD:LTUS:150:BACTLIMITS.J") field(LNK3, "QUAD:LTUS:150:BACT.LOW") field(DOL4, "QUAD:LTUS:150:BACTLIMITS.K") field(LNK4, "QUAD:LTUS:150:BACT.HIHI") field(DOL5, "QUAD:LTUS:150:BACTLIMITS.L") field(LNK5, "QUAD:LTUS:150:BACT.LOLO") field(DOL6, "QUAD:LTUS:150:BLIMITS") field(LNK6, "QUAD:LTUS:150:BMONLIMITS.F PP") field(DOL7, "QUAD:LTUS:150:BMONLIMITS.I") field(LNK7, "QUAD:LTUS:150:BMON.HIGH") field(DOL8, "QUAD:LTUS:150:BMONLIMITS.J") field(LNK8, "QUAD:LTUS:150:BMON.LOW") field(DOL9, "QUAD:LTUS:150:BMONLIMITS.K") field(LNK9, "QUAD:LTUS:150:BMON.HIHI") field(DOLA, "QUAD:LTUS:150:BMONLIMITS.L") field(LNKA, "QUAD:LTUS:150:BMON.LOLO") field(FLNK, "QUAD:LTUS:150:ILIMITS") field(SCAN, "5 second") } record(ao, "QUAD:LTUS:150:BCTRL") { field(DESC, "B-Perturb") field(PREC, "7") field(EGU, "kG") field(DRVH, "52.2485") field(DRVL, "0.2518") field(HOPR, "52.2485") field(LOPR, "0.2518") # 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, "QUAD:LTUS:150: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, "QUAD:LTUS:150:BCTRLGO") { field(DESC, "Update DES and perturb") field(PREC, "7") # Disable BACT limits field(DOL1, "1") field(LNK1, "QUAD:LTUS:150:BLIMITS.VAL") # Update BDES with the BCTRL (slider) value field(DOL2, "QUAD:LTUS:150:BCTRL.VAL") field(LNK2, "QUAD:LTUS:150:BDES PP") field(DOL3, "1") field(LNK3, "QUAD:LTUS:150:IDIRECT.PROC PP") field(DOL4, "1") field(LNK4, "QUAD:LTUS:150:CHECKSTDZLOST.PROC PP") field(DOL5, "QUAD:LTUS:150:BCTRL.VAL") field(LNK5, "QUAD:LTUS:150:BCTRLSUB PP") # Re-enable BACT limits field(DOL6, "0") field(LNK6, "QUAD:LTUS:150:BLIMITS.VAL") } # Convert B-field to Current and output to ISETPT record(sub, "QUAD:LTUS:150:BCTRLSUB") { field(DESC, "Feedback") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:150:POLYCOEF") field(INPC, "QUAD:LTUS:150:POLYCOEF.A") field(INPD, "QUAD:LTUS:150:POLYCOEF.B") field(INPE, "QUAD:LTUS:150:BDES.DRVH") field(INPF, "QUAD:LTUS:150:BDES.DRVL") field(PREC, "7") field(EGU, "kG") field(HOPR, "52.2485") field(LOPR, "0.2518") field(MDEL, "-1") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:150:ISETPT") } record(ao, "QUAD:LTUS:150:BDESPREVTRIM") { field(DESC, "trim bdes for undo") field(DTYP, "Soft Channel") field(DRVH, "52.2485") field(DRVL, "0.2518") field(EGU, "kG") field(HOPR, "52.2485") field(LOPR, "0.2518") field(PREC, "7") field(PINI, "YES") info(autosaveFields,"VAL") } record(stringin, "QUAD:LTUS:150:MADNAME") { field(DESC, "MAD deck nomenclature") field(PINI, "YES") field(VAL, "QDL11") } record(ai, "QUAD:LTUS:150: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, "3240.614425") } record(ao, "QUAD:LTUS:150:BMAX") { field(DESC, "Max B-Field") field(DTYP, "Soft Channel") field(DRVH, "52.2485") field(DRVL, "0.2518") field(EGU, "kG") field(HOPR, "52.2485") field(LOPR, "0.2518") field(PREC, "7") field(PINI, "YES") field(VAL, "52.2485") field(FLNK, "QUAD:LTUS:150:BSTEP") } record(ao, "QUAD:LTUS:150:BMIN") { field(DESC, "Min B-Field") field(DTYP, "Soft Channel") field(DRVH, "52.2485") field(DRVL, "0.2518") field(EGU, "kG") field(HOPR, "52.2485") field(LOPR, "0.2518") field(PREC, "7") field(PINI, "YES") field(VAL, "0.2518") field(FLNK, "QUAD:LTUS:150:BSTEP") } record(ao, "QUAD:LTUS:150:BDESSAVE") { field(DESC, "bdes for save/load") field(DTYP, "Soft Channel") field(DRVH, "52.2485") field(DRVL, "0.2518") field(EGU, "kG") field(HOPR, "52.2485") field(LOPR, "0.2518") field(PINI, "YES") field(PREC, "7") } # This record is processed by QUAD:LTUS:150: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, "QUAD:LTUS:150:BCON") { field(DESC, "Config B-Field ") field(DTYP, "Soft Channel") field(PREC, "7") field(EGU, "kG") field(HOPR, "52.2485") field(LOPR, "0.2518") field(DRVH, "52.2485") field(DRVL, "0.2518") # Set MINOR Alarm as the default, slaves will set NO_ALARM=0. field(HHSV, "MINOR") field(LLSV, "MINOR") field(HSV, "MINOR") field(LSV, "MINOR") # field(DOL , "") field(OMSL, "supervisory") field(OUT, "QUAD:LTUS:150:B2ICON PP") info(autosaveFields,"VAL") } record(sub, "QUAD:LTUS:150:B2ICON") { field(DESC, "Convert Desired ICon to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:150:POLYCOEF") field(INPC, "QUAD:LTUS:150:POLYCOEF.A") field(INPD, "QUAD:LTUS:150:POLYCOEF.B") field(PREC, "7") field(EGU, "kG") field(HOPR, "52.2485") field(LOPR, "0.2518") field(MDEL, "-1") field(INPE, "QUAD:LTUS:150:BCON.DRVH") field(INPF, "QUAD:LTUS:150:BCON.DRVL") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:150: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, "QUAD:LTUS:150:BSTEP") { field(DESC, "B-Field step size") field(CALC, "(C==3)||(D==3)?0:ABS(A-B)*0.005") field(INPA, "QUAD:LTUS:150:BMAX") field(INPB, "QUAD:LTUS:150:BMIN") field(INPC, "QUAD:LTUS:150:BMIN.SEVR") field(INPD, "QUAD:LTUS:150:BMAX.SEVR") field(EGU, "kG") 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,"QUAD:LTUS:150:BCTRLDISABLECALC") { field(DESC, "Calc for disabling BCTRL") field(ASG, "Internal") field(CALC, "A?2:1") field(INPA, "QUAD:LTUS:150:ONLINE CP") field(OUT, "QUAD:LTUS:150:BCTRLDISABLEFOUT PP") } record(fanout, "QUAD:LTUS:150:BCTRLDISABLEFOUT") { field(DESC, "Disable BCTRL fanout") field(SELM, "Specified") field(SELL, "QUAD:LTUS:150:BCTRLDISABLECALC") field(LNK1, "QUAD:LTUS:150:BCTRLDISABLE") field(LNK2, "QUAD:LTUS:150:BCTRLENABLE") } record(stringout, "QUAD:LTUS:150:BCTRLDISABLE") { field(DESC, "Disable BCTRL") field(DTYP, "Soft Channel") field(OUT, "QUAD:LTUS:150:BCTRL.ASG") field(VAL, "NOWRITE") field(FLNK, "QUAD:LTUS:150:BCTRLDISV_UPDATE") } record(stringout, "QUAD:LTUS:150:BCTRLENABLE") { field(DESC, "Enable BCTRL") field(DTYP, "Soft Channel") field(OUT, "QUAD:LTUS:150:BCTRL.ASG") field(VAL, "") field(FLNK, "QUAD:LTUS:150:BCTRLDISV_UPDATE") } record(calcout, "QUAD:LTUS:150:BCTRLDISV_UPDATE") { field(DESC, "Calc for updating BCTRL.DISV") field(ASG, "Internal") field(CALC, "A") field(INPA, "QUAD:LTUS:150:ONLINE") field(OUT, "QUAD:LTUS:150: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,"QUAD:LTUS:150:BACT and MON\n are processed via links from \n QUAD:LTUS:150:IACT (device raw value readback 1)\n and\n QUAD:LTUS:150: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 QUAD:LTUS:150:POLYCOEF\nC = First polynomial coefficient (offset if linear)\nD = Second polynomial coefficient (slope if linear)\nE = QUAD:LTUS:150: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,"QUAD:LTUS:150:BDES\n is processed when set by CA users or \n QUAD:LTUS:150: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,"QUAD:LTUS:150: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 QUAD:LTUS:150: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 (QUAD:LTUS:150: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,"QUAD:LTUS:150:B*LIMITS and QUAD:LTUS:150:BLIMITS:\n Calculate alarm and warning limits based on \n deltas from QUAD:LTUS:150: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,"QUAD:LTUS:150: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,"QUAD:LTUS:150: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, "QUAD:LTUS:150: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, "QUAD:LTUS:150:MPSBTOL") { field(DESC, "Absolute mps tol") field(EGU, "kG") field(PREC, "2") field(CALC, "ABS(A)*0.02") field(INPA, "QUAD:LTUS:150:BMAX") field(PINI, "YES") } # # 21-Aug-2013: K. Luchini # Set channel access security so that users # cannot easily change values. record(ao, "QUAD:LTUS:150:MPSBMAX") { field(DESC, "MPS Max B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "52.2485") field(DRVL, "0.2518") field(PINI, "YES") field(VAL, "52.2485") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:150:MPSBMIN") { field(DESC, "MPS Min B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "52.2485") field(DRVL, "0.2518") field(PINI, "YES") field(VAL, "0.2518") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:150:MPSBLLIM") { field(DESC, "MPS Low Limit B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "52.2485") field(DRVL, "0.2518") field(PINI, "YES") field(VAL, "0.2518") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:150:MPSBLLIM2") { field(DESC, "MPS Low Limit #2 B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "52.2485") field(DRVL, "0.2518") field(PINI, "YES") field(VAL, "0.2518") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } # Set the default to Std record(mbbo, "QUAD:LTUS:150: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, "QUAD:LTUS:150:MPSLIMITS.E PP") } record(aSub, "QUAD:LTUS:150: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, "QUAD:LTUS:150:MPS.RVAL") field(INPB, "QUAD:LTUS:150:BADIFF") field(INPC, "QUAD:LTUS:150:BDELTAS.N") field(INPD, "QUAD:LTUS:150:BACT") field(INPE, "QUAD:LTUS:150:MPSBITMASK.RVAL") field(INPF, "QUAD:LTUS:150:MPSBLLIM") field(INPG, "QUAD:LTUS:150:MPSBMIN") field(INPH, "QUAD:LTUS:150:MPSBMAX") field(INPI, "QUAD:LTUS:150: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, "QUAD:LTUS:150:INTOL.RVAL PP") field(OUTB, "QUAD:LTUS:150:INTOL_BMIN.RVAL PP") field(OUTC, "QUAD:LTUS:150:INTOL_BRANGE.RVAL PP") field(OUTD, "QUAD:LTUS:150: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, "QUAD:LTUS:150:INTOL") { field(DESC, "BACT within MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:150:MPSLIMITS.VALA") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "QUAD:LTUS:150:INTOL_BMIN") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:150:MPSLIMITS.VALB") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "QUAD:LTUS:150:INTOL_BMIN2") { field(DESC, "MPS tol #2") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:150:MPSLIMITS.VALD") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "QUAD:LTUS:150:INTOL_BRANGE") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:150: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, "QUAD:LTUS:150:CHCKITOL") { field(DESC, "Absolute Check I Tolerance") field(EGU, "A") field(FLNK, "QUAD:LTUS:150:TRIMITOL") field(CALC, "ABS(A*B)") field(INPA, "QUAD:LTUS:150:CHCKBTOL") field(INPB, "QUAD:LTUS:150:POLYCOEF.B") field(PREC, "9") } record(calc, "QUAD:LTUS:150:TRIMBTOL") { field(EGU, "kG") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(DESC, "Absolute Trim Tolerance") field(CALC, "ABS(A)/2") field(INPA, "QUAD:LTUS:150:CHCKBTOL") field(FLNK, "QUAD:LTUS:150:CHCKITOL") } record(calc, "QUAD:LTUS:150:CHCKBTOL") { field(DESC, "Check absolute tolerance") field(EGU, "A") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(FLNK, "QUAD:LTUS:150:TRIMBTOL") field(CALC, "MAX(ABS(A),ABS(C))*(B/1000000)") field(INPA, "QUAD:LTUS:150:BDES.HOPR") field(INPB, "QUAD:LTUS:150:STABILITY") field(INPC, "QUAD:LTUS:150:BDES.LOPR") } record(longout, "QUAD:LTUS:150: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, "QUAD:LTUS:150:CHCKBTOL") } record(calc, "QUAD:LTUS:150:TRIMITOL") { field(DESC, "Absolute Trim I Tolerance") field(EGU, "kG") field(CALC, "ABS(A*B)") field(INPA, "QUAD:LTUS:150:POLYCOEF.B") field(INPB, "QUAD:LTUS:150:TRIMBTOL") field(PREC, "9") } record(ai, "QUAD:LTUS:150:TRIMBTOLR") { field(DESC, "Relative trim tol") field(PREC, "4") field(EGU, "%") field(HOPR, "1.0") field(LOPR, "0.0") field(PINI, "YES") } record(ai, "QUAD:LTUS:150: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, "QUAD:LTUS:150:FBCKFCOM") { field(ZNAM, "CA") field(ONAM, "FCOM") field(DESC, "CA Mode") field(PINI, "YES") field(SDIS, "0") } record(bo, "QUAD:LTUS:150:PAU") { field(ZNAM, "NotConfigured") field(ONAM, "Configured") field(DESC, "PAU Present") field(PINI, "YES") field(SDIS, "0") field(FLNK, "QUAD:LTUS:150:PAUGO") } record(fanout, "QUAD:LTUS:150:PAUGO") { field(DESC, "PAU control") field(LNK1, "QUAD:LTUS:150:PAUSTOP") field(LNK2, "QUAD:LTUS:150: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, "QUAD:LTUS:150:PAUSTART") { field(DESC, "Setup for PAU On") field(SDIS, "QUAD:LTUS:150: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, "QUAD:LTUS:150:PAUSTOP") { field(DESC, "Setup for PAU Off") field(SDIS, "QUAD:LTUS:150: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, "QUAD:LTUS:150:MCORDEVNAME") { field(DESC, "PS device name") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, "PSC:LTUS:MG06:") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "QUAD:LTUS:150: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, "QUAD:LTUS:150:PSTYPE.RVAL") field(INPC, "QUAD:LTUS:150:TURNEDOFF.RVAL") field(INPD, "QUAD:LTUS:150:CONFIG.RVAL") field(INPE, "QUAD:LTUS:150:PSCATEGORY.RVAL") field(INPF, "QUAD:LTUS:150:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "QUAD:LTUS:150:AUTOCTRL.RVAL") field(INPJ, "QUAD:LTUS:150:OUTOFSERVICE.RVAL") field(INPL, "QUAD:LTUS:150:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "QUAD:LTUS:150:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "QUAD:LTUS:150:PAU") field(INPP, "QUAD:LTUS:150:CALBDISABLE.RVAL") field(INPQ, "QUAD:LTUS:150:PTRBDISABLE.RVAL") field(INPR, "QUAD:LTUS:150:TRIMDISABLE.RVAL") field(INPS, "QUAD:LTUS:150:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "QUAD:LTUS:150:FBCK") field(INPU, "QUAD:LTUS:150:TRIMTYPE.RVAL") field(INPV, "QUAD:LTUS:150:STDZDIRECT.RVAL") field(INPW, "QUAD:LTUS:150:DEGAUSENABLE.RVAL") field(FLNK, "QUAD:LTUS:150:HSTA") } record(longin, "QUAD:LTUS:150:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "QUAD:LTUS:150:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "QUAD:LTUS:150: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, "QUAD:LTUS:150: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, "QUAD:LTUS:150:CALBDISABLE") { field(DESC, "DAC Calb Disabled") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:150:PTRBDISABLE") { field(DESC, "Perturb Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:150:TRIMDISABLE") { field(DESC, "Trim Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:150: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 QUAD:LTUS:150:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses QUAD:LTUS:150:FBCK. # This PV should be replaced by QUAD:LTUS:150: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, "QUAD:LTUS:150: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, "QUAD:LTUS:150: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, "QUAD:LTUS:150: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, "") field(OMSL, "supervisory") field(FLNK, "QUAD:LTUS:150:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"QUAD:LTUS:150:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "QUAD:LTUS:150:OUTOFSERVICE NPP NMS") field(OUT, "QUAD:LTUS:150:ONLINE PP") } record(bo, "QUAD:LTUS:150:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "QUAD:LTUS:150: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, "1") } record(bo, "QUAD:LTUS:150: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, "1") } record(bo, "QUAD:LTUS:150: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, "QUAD:LTUS:150: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, "QUAD:LTUS:150: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, "QUAD:LTUS:150: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, "QUAD:LTUS:150: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, "QUAD:LTUS:150: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, "1") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:150: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, "1") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:150: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, "2") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:150: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, "0") field(ASG, "NOWRITE") field(FLNK, "QUAD:LTUS:150:TRIMTYPE") } record(stringout, "QUAD:LTUS:150:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "QUAD:LTUS:150:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "QUAD:LTUS:150:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "QUAD:LTUS:150:STATE.RVAL") field(INPB, "QUAD:LTUS:150:INTLKSUMY.RVAL") field(OUT, "QUAD:LTUS:150:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:LTUS:150: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, "QUAD:LTUS:150:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "QUAD:LTUS:150:STATE.RVAL") field(INPB, "QUAD:LTUS:150:INTLKSUMY.RVAL") field(OUT, "QUAD:LTUS:150:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:LTUS:150:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "QUAD:LTUS:150:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "QUAD:LTUS:150: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, "QUAD:LTUS:150:RAMPSTARTDLY") { field(DESC, "Tansition to ramp delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "2") } ######### For PSTYPE=2 Only ############# record(mbbo, "QUAD:LTUS:150: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, "QUAD:LTUS:150: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,"QUAD:LTUS:150: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("QUAD:LTUS:150:TURNEDOFF",3140,1907,0,1,"QUAD:LTUS:150:TURNEDOFF") #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "QUAD:LTUS:150:STATSUB") { field(DESC, "Build STATus ") field(INAM, "mgntInit") field(SNAM, "mgntSlcStat") field(INPA, "QUAD:LTUS:150:BACT.STAT") field(INPB, "QUAD:LTUS:150:BDES.STAT") field(INPC, "QUAD:LTUS:150:IRIPL.STAT") field(INPD, "PSC:LTUS:MG06:ISETPT.STAT") field(INPE, "PSC:LTUS:MG06:IACT.STAT") # 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, "QUAD:LTUS:150:BACT.SEVR") field(INPH, "QUAD:LTUS:150:BDES.SEVR") field(INPI, "QUAD:LTUS:150:IRIPL.SEVR") field(INPJ, "PSC:LTUS:MG06:ISETPT.SEVR") field(INPK, "PSC:LTUS:MG06:IACT.SEVR") # # 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, "QUAD:LTUS:150:STATE.RVAL") field(INPN, "QUAD:LTUS:150:STDZOK") field(INPO, "QUAD:LTUS:150:CALBOK") field(INPP, "QUAD:LTUS:150:OUTOFSERVICE.RVAL") field(INPQ, "QUAD:LTUS:150:CONFIG.RVAL") field(INPR, "QUAD:LTUS:150:HSTA") field(INPS, "QUAD:LTUS:150:CTRL.RVAL") field(INPT, "QUAD:LTUS:150:DEGAUSOK") field(INPV, "QUAD:LTUS:150: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, "QUAD:LTUS:150:STAT") } record(longout, "QUAD:LTUS:150:STAT") { field(DESC, "STAT sent to SLC") field(SCAN, "Passive") field(FLNK, "QUAD:LTUS:150:STATCTRLSUB") field(DOL, "QUAD:LTUS:150:STATSUB.VAL") field(OMSL, "closed_loop") } record(sSub, "QUAD:LTUS:150:STATCTRLSUB") { field(DESC, "Decode SLC STAT into mbbo") field(INAM, "mgntInit") field(SNAM, "mgntStatDecode") field(INPA, "QUAD:LTUS:150:STAT") field(INPB, "QUAD:LTUS:150:HSTA") field(INPD, "QUAD:LTUS:150:ONOFFCTRL.RVAL") field(FLNK, "QUAD:LTUS:150:STATMSG") } record(mbbo, "QUAD:LTUS:150: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, "QUAD:LTUS:150:UNAVAILGO") field(DOL, "QUAD:LTUS:150:STATCTRLSUB.W") } record(seq, "QUAD:LTUS:150:UNAVAILGO") { field(DESC, "Process UNAVAIL") field(DOL1, "QUAD:LTUS:150:STATSUB.U") field(LNK1, "QUAD:LTUS:150:UNAVAIL PP") } record(stringout, "QUAD:LTUS:150:SNLSTATMSG") { field(DTYP, "Soft Channel") } #! TextBox(TB0,820,1000,1200,1220,0,"Dialog",12,1,16777215,"QUAD:LTUS:150:STATUSSUB - future\nOverall device status - takes input from action snls, record sevrs, master snl(s) and outputs final status\n\nInputs:\nA - QUAD:LTUS:150:CTRLSTATUS - snl status\nB - MGNT:CTRLSTATUS - master list status\nC\nD - QUAD:LTUS:150: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,"QUAD:LTUS:150STATSUB\nformat control bo's into slc STAT\n\nInputs:\nA - QUAD:LTUS:150:STATUS\nC - QUAD:LTUS:150:ON\nD - QUAD:LTUS:150:STDZOK\nE - QUAD:LTUS:150:CALBOK\nF - QUAD:LTUS:150:BACTDRIFT (future)\nG -\nH- QUAD:LTUS:150:DACSTATUS\nI -QUAD:LTUS:150:ADCSTATUS\nJ - QUAD:LTUS:150:BACTSTATUS\nK - QUAD:LTUS:150:BDESSTATUS\nL - QUAD:LTUS:150:RIPLSTATUS\n\nOutput:\nP - QUAD:LTUS:150: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, "QUAD:LTUS:150: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, "QUAD:LTUS:150: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, "QUAD:LTUS:150: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, "QUAD:LTUS:150: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.6 #! DBDSTART #! DBD("../../../../dbd/mgntSoft.dbd") #! DBDEND record(stringout, "QUAD:LTUS:150:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:150:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "QUAD:LTUS:150:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "QUAD:LTUS:150:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "QUAD:LTUS:150:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "QUAD:LTUS:150:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "1") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "QUAD:LTUS:150: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, "QUAD:LTUS:150:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "QUAD:LTUS:150:TRIMTYPE.RVAL") field(INPB, "QUAD:LTUS:150:CONFIG.RVAL") field(OUT, "QUAD:LTUS:150:TRIMMAXNUM PP") } record(longout, "QUAD:LTUS:150: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, "QUAD:LTUS:150: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, "") field(OMSL, "supervisory") field(VAL, "20") field(OUT, "QUAD:LTUS:150:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "QUAD:LTUS:150: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, "") field(OMSL, "supervisory") field(VAL, "10") } record(bo, "QUAD:LTUS:150: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, "QUAD:LTUS:150: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, "QUAD:LTUS:150: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, "QUAD:LTUS:150:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "0") } record(ao, "QUAD:LTUS:150: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, "QUAD:LTUS:150:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "QUAD:LTUS:150: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, "QUAD:LTUS:150: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, "QUAD:LTUS:150:IMOVE") field(INPB, "QUAD:LTUS:150:IACT") field(INPC, "QUAD:LTUS:150:IRAMPRATE") field(INPD, "1.577") field(INPE, "QUAD:LTUS:150:TRIMDLYPCT") field(INPF, "QUAD:LTUS:150:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "QUAD:LTUS:150:RAMPTIME_LEFT PP") } record(longout, "QUAD:LTUS:150:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "QUAD:LTUS:150:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "QUAD:LTUS:150:RAMPDONE_CALC") } record(calc, "QUAD:LTUS:150:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "QUAD:LTUS:150:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "QUAD:LTUS:150:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "QUAD:LTUS:150: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, "QUAD:LTUS:150:RAMPTIME_LEFT") field(OUT, "QUAD:LTUS:150:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "QUAD:LTUS:150:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "QUAD:LTUS:150:RAMPTIME_LEFT NMS") field(OUT, "QUAD:LTUS:150:RAMPDONE PP") } record(bo, "QUAD:LTUS:150:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "QUAD:LTUS:150:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "QUAD:LTUS:150: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, "QUAD:LTUS:150: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(sSub, "QUAD:LTUS:150: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, "QUAD:LTUS:150:PSTYPE.RVAL") field(INPC, "QUAD:LTUS:150:TURNEDOFF.RVAL") field(INPD, "QUAD:LTUS:150:CONFIG.RVAL") field(INPE, "QUAD:LTUS:150:PSCATEGORY.RVAL") field(INPF, "QUAD:LTUS:150:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "QUAD:LTUS:150:AUTOCTRL.RVAL") field(INPJ, "QUAD:LTUS:150:OUTOFSERVICE.RVAL") field(INPL, "QUAD:LTUS:150:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "QUAD:LTUS:150:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "QUAD:LTUS:150:PAU") field(INPP, "QUAD:LTUS:150:CALBDISABLE.RVAL") field(INPQ, "QUAD:LTUS:150:PTRBDISABLE.RVAL") field(INPR, "QUAD:LTUS:150:TRIMDISABLE.RVAL") field(INPS, "QUAD:LTUS:150:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "QUAD:LTUS:150:FBCK") field(INPU, "QUAD:LTUS:150:TRIMTYPE.RVAL") field(INPV, "QUAD:LTUS:150:STDZDIRECT.RVAL") field(INPW, "QUAD:LTUS:150:DEGAUSENABLE.RVAL") field(FLNK, "QUAD:LTUS:150:HSTA") } record(longin, "QUAD:LTUS:150:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "QUAD:LTUS:150:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "QUAD:LTUS:150: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, "QUAD:LTUS:150: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, "QUAD:LTUS:150:CALBDISABLE") { field(DESC, "DAC Calb Disabled") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:150:PTRBDISABLE") { field(DESC, "Perturb Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:150:TRIMDISABLE") { field(DESC, "Trim Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:150:STDZDISABLE") { field(DTYP, "Raw Soft Channel") field(ZNAM, "NO") field(ONAM, "YES") field(DESC, "Standardize Function") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } # This PV has been replaced by QUAD:LTUS:150:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses QUAD:LTUS:150:FBCK. # This PV should be replaced by QUAD:LTUS:150: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, "QUAD:LTUS:150: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, "QUAD:LTUS:150: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, "QUAD:LTUS:150: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, "") field(OMSL, "supervisory") field(FLNK, "QUAD:LTUS:150:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"QUAD:LTUS:150:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "QUAD:LTUS:150:OUTOFSERVICE NPP NMS") field(OUT, "QUAD:LTUS:150:ONLINE PP") } record(bo, "QUAD:LTUS:150:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "QUAD:LTUS:150: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, "1") } record(bo, "QUAD:LTUS:150: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, "1") } record(bo, "QUAD:LTUS:150: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, "QUAD:LTUS:150: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, "QUAD:LTUS:150: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, "QUAD:LTUS:150: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, "QUAD:LTUS:150: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, "QUAD:LTUS:150: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, "1") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:150: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, "1") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:150: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, "2") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:150: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, "0") field(ASG, "NOWRITE") field(FLNK, "QUAD:LTUS:150:TRIMTYPE") } record(stringout, "QUAD:LTUS:150:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "QUAD:LTUS:150:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "QUAD:LTUS:150:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "QUAD:LTUS:150:STATE.RVAL") field(INPB, "QUAD:LTUS:150:INTLKSUMY.RVAL") field(OUT, "QUAD:LTUS:150:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:LTUS:150: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, "QUAD:LTUS:150:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "QUAD:LTUS:150:STATE.RVAL") field(INPB, "QUAD:LTUS:150:INTLKSUMY.RVAL") field(OUT, "QUAD:LTUS:150:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:LTUS:150:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "QUAD:LTUS:150:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "QUAD:LTUS:150: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, "QUAD:LTUS:150:RAMPSTARTDLY") { field(DESC, "Tansition to ramp delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "2") } ######### For PSTYPE=2 Only ############# record(mbbo, "QUAD:LTUS:150: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, "QUAD:LTUS:150: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,"QUAD:LTUS:150: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("QUAD:LTUS:150:TURNEDOFF",3140,1907,0,1,"QUAD:LTUS:150:TURNEDOFF") #! 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, "QUAD:LTUS:180:IACT") { field(DESC, "Current") field(INP, "PSC:LTUS:MG07:IACT") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "QUAD:LTUS:180:BACT") info(autosaveFields,"HYST") } record(bi, "QUAD:LTUS:180:STATE") { field(DESC, "PS On/Off Status") field(DTYP, "Raw Soft Channel") field(INP, "PSC:LTUS:MG07:STATE NPP MS") field(ZSV, "MAJOR") field(ZNAM, "OFF") field(ONAM, "ON") } record(ao, "QUAD:LTUS:180:IDES") { field(DESC, "Desired Current") field(PREC, "3") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(MDEL, "-1") field(HIHI, "165.0") field(LOLO, "0.0") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "QUAD:LTUS:180:BDELTAS") field(DRVH, "165.0") field(DRVL, "0.0") field(DOL, "QUAD:LTUS:180: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, "QUAD:LTUS:180:ICTRL PP") } # This record is processed by QUAD:LTUS:180:ICON") # Note: we are not setting alarms here. record(ao, "QUAD:LTUS:180:ICON") { field(DESC, "Config I") field(DTYP, "Soft Channel") field(PREC, "3") field(HOPR, "165.0") field(LOPR, "0.0") field(DRVH, "165.0") field(DRVL, "0.0") field(DOL, "QUAD:LTUS:180:B2ICON.K") field(OMSL, "closed_loop") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:180:INOM") { field(DESC, "Nominal Current") field(DOL, "QUAD:LTUS:180:BNOM.K") field(OMSL, "closed_loop") field(PREC, "3") field(EGU, "A") field(DRVH, "165.0") field(DRVL, "0.0") field(HOPR, "165.0") field(LOPR, "0.0") } record(ao, "QUAD:LTUS:180:ICTRL") { field(DESC, "Set Current") field(PREC, "3") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(DRVH, "165.0") field(DRVL, "0.0") field(MDEL, "-1") field(FLNK, "QUAD:LTUS:180:ICTRLGO") field(OMSL, "supervisory") info(autosavefields,"VAL") } record(seq, "QUAD:LTUS:180:ICTRLGO") { field(DESC, "Process Current Setpoint") field(PREC, "3") # Set ISETPT to supervisory field(DOL1, "0") field(LNK1, "QUAD:LTUS:180:ISETPT.OMSL") field(DOL2, "QUAD:LTUS:180:ICTRL") field(LNK2, "QUAD:LTUS:180:ISETPT PP") # Set ISETPT to closed loop - get data from BCTRLSUB.K field(DOL3, "1") field(LNK3, "QUAD:LTUS:180:ISETPT.OMSL") } record(ao, "QUAD:LTUS:180:IMAX") { field(DESC, "Max I") field(DTYP, "Soft Channel") field(DRVH, "165.0") field(DRVL, "0.0") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(PREC, "3") field(PINI, "YES") field(VAL, "165.0") field(FLNK, "QUAD:LTUS:180:IMIN") } record(ao, "QUAD:LTUS:180:IMIN") { field(DESC, "Min I") field(DTYP, "Soft Channel") field(DRVH, "165.0") field(DRVL, "0.0") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(PREC, "3") field(VAL, "0.0") field(FLNK, "QUAD:LTUS:180:IRANGE") } record(sel, "QUAD:LTUS:180:IACTPREVOK") { field(DESC, "Last Good Current") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(PREC, "3") field(NVL, "QUAD:LTUS:180:BACT.SEVR") field(INPA, "QUAD:LTUS:180:IACT NPP MS") field(INPB, "QUAD:LTUS:180:IACTPREVOK NPP MS") field(INPC, "QUAD:LTUS:180:IACTPREVOK NPP MS") field(INPD, "QUAD:LTUS:180:IACTPREVOK NPP MS") } record(sub, "QUAD:LTUS:180:IACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:180:IDES") field(INPB, "QUAD:LTUS:180:ISETPT.DRVH") field(INPC, "QUAD:LTUS:180:ISETPT.DRVL") field(INPD, "QUAD:LTUS:180:IDELTAS.I") field(INPE, "QUAD:LTUS:180:IDELTAS.J") field(INPG, "QUAD:LTUS:180:STATE") field(INPH, "QUAD:LTUS:180:HSTA") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(sub, "QUAD:LTUS:180:IMONLIMITS") { field(DESC, "Aux Current Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:180:IDES") field(INPB, "QUAD:LTUS:180:ISETPT.DRVH") field(INPC, "QUAD:LTUS:180:ISETPT.DRVL") field(INPD, "QUAD:LTUS:180:IDELTAS.K") field(INPE, "QUAD:LTUS:180:IDELTAS.L") field(INPG, "QUAD:LTUS:180:STATE") field(INPH, "QUAD:LTUS:180:HSTA") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(seq, "QUAD:LTUS:180:ILIMITS") { field(DESC, "Set ACT and MON Limits") field(PREC, "3") field(DOL1, "QUAD:LTUS:180:BLIMITS") field(LNK1, "QUAD:LTUS:180:IACTLIMITS.F PP") field(DOL2, "QUAD:LTUS:180:IACTLIMITS.I") field(LNK2, "QUAD:LTUS:180:IACT.HIGH") field(DOL3, "QUAD:LTUS:180:IACTLIMITS.J") field(LNK3, "QUAD:LTUS:180:IACT.LOW") field(DOL4, "QUAD:LTUS:180:IACTLIMITS.K") field(LNK4, "QUAD:LTUS:180:IACT.HIHI") field(DOL5, "QUAD:LTUS:180:IACTLIMITS.L") field(LNK5, "QUAD:LTUS:180:IACT.LOLO") field(DOL6, "QUAD:LTUS:180:BLIMITS") field(LNK6, "QUAD:LTUS:180:IMONLIMITS.F PP") field(DOL7, "QUAD:LTUS:180:IMONLIMITS.I") field(LNK7, "QUAD:LTUS:180:IMON.HIGH") field(DOL8, "QUAD:LTUS:180:IMONLIMITS.J") field(LNK8, "QUAD:LTUS:180:IMON.LOW") field(DOL9, "QUAD:LTUS:180:IMONLIMITS.K") field(LNK9, "QUAD:LTUS:180:IMON.HIHI") field(DOLA, "QUAD:LTUS:180:IMONLIMITS.L") field(LNKA, "QUAD:LTUS:180: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, "QUAD:LTUS:180:IDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntRawDeltas") field(INPD, "QUAD:LTUS:180:TRIMBTOL") field(INPE, "QUAD:LTUS:180:CHCKBTOL") field(INPF, "QUAD:LTUS:180:BDELTAS.K") field(INPG, "QUAD:LTUS:180:BDELTAS.L") field(INPH, "QUAD:LTUS:180: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, "QUAD:LTUS:180:STDZITOLR") field(INPC, "QUAD:LTUS:180:STDZITOL") field(FLNK, "") } # All ps controllers with on/off control will set the macro ONOF # as follows: # # ONOF = PSC:LTUS:MG07: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, "QUAD:LTUS:180:STATESETPT") { field(DESC, "PS On/Off") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFF") field(ONAM, "ON") field(OUT, "PSC:LTUS:MG07:STATESETPT PP") 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 = PSC:LTUS:MG07:RESET PP # record(bo, "QUAD:LTUS:180:RESET") { field(DESC, "Interlock Latch Reset") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFF") field(ONAM, "ON") field(HIGH, "1.0") field(OUT, "PSC:LTUS:MG07:RESET PP") } record(bo, "QUAD:LTUS:180:RAMPSTATE") { field(DESC, "PS Ramp Status") field(DTYP, "Soft Channel") field(DOL, "PSC:LTUS:MG07:RAMPSTATE NPP 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, "QUAD:LTUS:180: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, "QUAD:LTUS:180:TRIMRAMPRATE") field(OUT, "PSC:LTUS:MG07:IRAMPRATE PP") field(FLNK, "QUAD:LTUS:180:STDZDLY") } record(ao, "QUAD:LTUS:180:ISETPT") { field(DESC, "Current Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(DRVH, "165.0") field(DRVL, "0.0") field(MDEL, "-1") field(OUT, "PSC:LTUS:MG07:ISETPT PP") field(DOL, "QUAD:LTUS:180: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, "QUAD:LTUS:180:IMON") { field(DESC, "Aux Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(INP, "PSC:LTUS:MG07:IMON") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "QUAD:LTUS:180:BMON") } record(ao, "QUAD:LTUS:180:IRIPL") { field(DESC, "Ripple Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(DOL, "PSC:LTUS:MG07:IRIPL NPP NMS") field(OMSL, "closed_loop") field(EGU, "A") field(DRVH, "1.0") field(HOPR, "1.0") field(PREC, "3") field(FLNK, "QUAD:LTUS:180:IRIPLOK") } record(sub, "QUAD:LTUS:180:IRIPLOK") { field(DESC, "Ripple Current Status") field(INAM, "mgntInit") field(SNAM, "mgntRiplOK") field(INPA, "QUAD:LTUS:180:IRIPL.VAL") field(INPB, "QUAD:LTUS:180: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, "QUAD:LTUS:180:R") { field(DESC, "Resistance") field(EGU, "Ohms") field(PREC, "4") field(PINI, "YES") field(DOL, "PSC:LTUS:MG07:R NPP MS") 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, "QUAD:LTUS:180:IGND") { field(DESC, "Ground Current") field(EGU, "A") field(PREC, "6") field(PINI, "YES") field(DOL, "PSC:LTUS:MG07:IGND NPP MS") field(OMSL, "closed_loop") } record(bi, "QUAD:LTUS:180:INTLKSUMY") { field(DESC, "Interlock Summary") field(INP, "PSC:LTUS:MG07:INTLKSUMY NPP MS") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(ZNAM, "OK") field(ONAM, "FAULT") field(PINI, "NO") } record(mbbo, "QUAD:LTUS:180: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, "PSC:LTUS:MG07:COOLING") field(OMSL, "closed_loop") } # The following PV is processed by :BACTFO # which is processed by :BACT record(fanout, "QUAD:LTUS:180:IACTFO") { field(DESC, "IACT processing") field(SELM, "All") field(LNK1, "QUAD:LTUS:180:IACTPREVOK") field(LNK2, "QUAD:LTUS:180:IDIFF") field(LNK3, "QUAD:LTUS:180:IADIFF") field(LNK4, "QUAD:LTUS:180:IRATIO") field(LNK5, "QUAD:LTUS:180:IDIRECT") field(LNK6, "QUAD:LTUS:180:IACTPOL_CHECK") } record(calc, "QUAD:LTUS:180:IDIFF") { field(DESC, "IDES-IACT") field(CALC, "A-B") field(INPA, "QUAD:LTUS:180:IDES") field(INPB, "QUAD:LTUS:180:IACT") field(EGU, "A") field(PREC, "9") field(HOPR, "165.0") field(LOPR, "0.0") } record(calc, "QUAD:LTUS:180:IADIFF") { field(DESC, "Absolute IDES-IACT") field(CALC, "A<0?ABS(A):A") field(INPA, "QUAD:LTUS:180:IDIFF") field(PREC, "9") } record(calc, "QUAD:LTUS:180:IRATIO") { field(DESC, "IDES-IACT/IMAX") field(CALC, "B?A/B:0") field(INPA, "QUAD:LTUS:180:IDIFF") field(INPB, "QUAD:LTUS:180:IDES.DRVH") field(PREC, "9") } record(calcout, "QUAD:LTUS:180:IRANGE") { field(DESC, "Current Range") field(PINI, "YES") field(CALC, "ABS(A-B)") field(INPA, "QUAD:LTUS:180:IMIN") field(INPB, "QUAD:LTUS:180: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, "QUAD:LTUS:180: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, "QUAD:LTUS:180:IACT") field(FLNK, "QUAD:LTUS:180:IACTPOL") } record(bo, "QUAD:LTUS:180:IACTPOL") { field(DESC, "Actual I Polarity") field(DTYP, "Raw Soft Channel") field(DOL, "QUAD:LTUS:180: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,"QUAD:LTUS:180:I*LIMITS:\n Calculate alarm and warning limits based on \n deltas from QUAD:LTUS:180:IDELTAS and the\n QUAD:LTUS:180: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,"QUAD:LTUS:180:IACT: \n Get copy of QUAD:LTUS:180:I. \n",null) #! TextBox(TB12,1280,3100,1760,3200,0,"Dialog",12,1,16777215,"QUAD:LTUS:180: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,"QUAD:LTUS:180:IDES:\n Contains raw value calculated by \nQUAD:LTUS:180: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 \nQUAD:LTUS:180:BDELTAS.\n",null) #! TextBox(TB10,56,1940,316,2340,0,"Dialog",12,1,16777215,"QUAD:LTUS:180: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 QUAD:LTUS:180: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 QUAD:LTUS:180: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,"QUAD:LTUS:180:ISETPT:\n Sets the hardware. When fast feedback is set on, this record is\n set to closed loop mode by QUAD:LTUS:180:FBCKSTART sequence. When \n the loop is closed, this record takes input calculated by \n BFBCK only. When fast feedback is set off, QUAD:LTUS:180:FBCKSTOP \n will set it back to supervisory so that the value can be set by \n QUAD:LTUS:180: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, "QUAD:LTUS:180:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:180:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "QUAD:LTUS:180:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "QUAD:LTUS:180:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "QUAD:LTUS:180:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "QUAD:LTUS:180:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "1") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "QUAD:LTUS:180: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, "QUAD:LTUS:180:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "QUAD:LTUS:180:TRIMTYPE.RVAL") field(INPB, "QUAD:LTUS:180:CONFIG.RVAL") field(OUT, "QUAD:LTUS:180:TRIMMAXNUM PP") } record(longout, "QUAD:LTUS:180: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, "QUAD:LTUS:180: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, "") field(OMSL, "supervisory") field(VAL, "10") field(OUT, "QUAD:LTUS:180:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "QUAD:LTUS:180: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, "") field(OMSL, "supervisory") field(VAL, "10") } record(bo, "QUAD:LTUS:180: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, "QUAD:LTUS:180: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, "QUAD:LTUS:180: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, "QUAD:LTUS:180:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "0") } record(ao, "QUAD:LTUS:180: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, "QUAD:LTUS:180:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "QUAD:LTUS:180: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, "QUAD:LTUS:180: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, "QUAD:LTUS:180:IMOVE") field(INPB, "QUAD:LTUS:180:IACT") field(INPC, "QUAD:LTUS:180:IRAMPRATE") field(INPD, "1.577") field(INPE, "QUAD:LTUS:180:TRIMDLYPCT") field(INPF, "QUAD:LTUS:180:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "QUAD:LTUS:180:RAMPTIME_LEFT PP") } record(longout, "QUAD:LTUS:180:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "QUAD:LTUS:180:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "QUAD:LTUS:180:RAMPDONE_CALC") } record(calc, "QUAD:LTUS:180:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "QUAD:LTUS:180:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "QUAD:LTUS:180:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "QUAD:LTUS:180: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, "QUAD:LTUS:180:RAMPTIME_LEFT") field(OUT, "QUAD:LTUS:180:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "QUAD:LTUS:180:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "QUAD:LTUS:180:RAMPTIME_LEFT NMS") field(OUT, "QUAD:LTUS:180:RAMPDONE PP") } record(bo, "QUAD:LTUS:180:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "QUAD:LTUS:180:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "QUAD:LTUS:180: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, "QUAD:LTUS:180: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, "QUAD:LTUS:180:STDZINIT") { field(DESC, "Proc. Stdz PVs on boot") field(PINI, "YES") field(DOL1, "1") field(DOL2, "1") field(DOL3, "1") field(LNK1, "QUAD:LTUS:180:DEBUG.PROC PP") field(LNK2, "QUAD:LTUS:180:STDZCYCLENUM.PROC PP") field(LNK3, "QUAD:LTUS:180:STDZDISABLE.PROC PP") field(LNK4, "QUAD:LTUS:180: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, "QUAD:LTUS:180:STDZSUB") { field(DESC, "Stdz subroutine") field(INAM, "mgntStdzInit") field(SNAM, "mgntStdz") field(BRSV, "INVALID") field(INPA, "QUAD:LTUS:180:STDZIMIN NPP NMS") field(INPB, "QUAD:LTUS:180:STDZIMAX NPP NMS") field(INPC, "QUAD:LTUS:180:STDZIFINAL NPP NMS") field(INPD, "QUAD:LTUS:180:STDZCYCLENUM NPP NMS") field(INPE, "QUAD:LTUS:180:STDZDIRECT.RVAL NPP NMS") field(INPF, "QUAD:LTUS:180:STDZDISABLE.RVAL CPP NMS") field(INPG, "QUAD:LTUS:180: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, "QUAD:LTUS:180:STDZWF PP") field(OUTB, "QUAD:LTUS:180: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, "QUAD:LTUS:180:STDZWF") } record(mbbo, "QUAD:LTUS:180: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, "QUAD:LTUS:180: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, "QUAD:LTUS:180:STDZMAINPS") { field(DESC, "Stdz by main or self") field(PINI, "YES") field(DTYP, "Soft Channel") field(ZNAM, "SELF") field(ONAM, "MAIN") } record(bo, "QUAD:LTUS:180: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, "QUAD:LTUS:180: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, "QUAD:LTUS:180: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, "QUAD:LTUS:180:STDZTOD") { field(DESC, "Successful Standardize Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "QUAD:LTUS:180:STDZLOSTTOD") { field(DESC, "Standardize Lost Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(longout, "QUAD:LTUS:180:STDZCYCLECNT") { field(DESC, "Cycle Count") field(PINI, "YES") } record(longout, "QUAD:LTUS:180:STDZCYCLENUM") { field(DESC, "No. Standardize Cycles") field(VAL, "3") field(HOPR, "10") field(LOPR, "0") field(DRVH, "10") field(DRVL, "0") field(PINI, "YES") field(FLNK, "QUAD:LTUS:180:STDZDIRECT") } # The default standardize direction is "UP" for # all LCLS Magnets.. record(bo, "QUAD:LTUS:180:STDZDIRECT") { field(DESC, "Standardize Direction ") field(ZNAM, "UP") field(ONAM, "DOWN") field(VAL, "0") field(FLNK, "QUAD:LTUS:180:STDZIMIN") } record(ao, "QUAD:LTUS:180:STDZIMIN") { field(DESC, "Min-STDZ Current") field(PREC, "1") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(VAL, "0.0") field(FLNK, "QUAD:LTUS:180:STDZIMAX") } record(ao, "QUAD:LTUS:180:STDZIMAX") { field(DESC, "Max. Standarize Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(VAL, "165.0") field(FLNK, "QUAD:LTUS:180:STDZIFINAL") } record(ao, "QUAD:LTUS:180:STDZIFINAL") { field(DESC, "Final SDTZ Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(VAL, "0.0") field(FLNK, "QUAD:LTUS:180: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, "QUAD:LTUS:180: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, "QUAD:LTUS:180:STDZITOL") { field(DESC, "Stdz min tolerance") field(PREC, "5") field(CALC, "MAX(ABS(A),ABS(B))*C") field(INPA, "QUAD:LTUS:180:STDZIMIN CP NMS") field(INPB, "QUAD:LTUS:180:STDZIMAX CP MMS") field(INPC, "0.05") field(INPD, "QUAD:LTUS:180:STDZITOLR CP MMS") field(EGU, "A") field(FLNK, "QUAD:LTUS:180:IDELTAS") field(PINI, "YES") } # D - factor (3.154/2 = 1.577) for EPSC, otherwise, set to 1.0 record(calc, "QUAD:LTUS:180:STDZDLY") { field(DESC, "Ramp time for stdz cycle") field(CALC, "C>0?MAX(1,ABS((A-B)/C)*D):0") field(INPA, "QUAD:LTUS:180:STDZIMIN CP NMS") field(INPB, "QUAD:LTUS:180:STDZIMAX CP NMS") field(INPC, "QUAD:LTUS:180:TRIMRAMPRATE CP NMS") field(INPD, "1.577") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") } record(calc, "QUAD:LTUS:180:STDZRAMPDLY") { field(DESC, "Ramp delay total") field(CALC, "MAX(1,((A/100)*B+B))") field(PREC, "5") field(INPA, "QUAD:LTUS:180:TRIMDLYPCT CP MS") field(INPB, "QUAD:LTUS:180: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, "QUAD:LTUS:180:STDZMINIDLY") { field(DESC, "Mini-stdz delay") field(CALC, "A") field(PREC, "5") field(A, "1.0") field(EGU, "sec") field(PINI, "YES") } record(ao, "QUAD:LTUS:180: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, "QUAD:LTUS:180:STDZMINIDELTA") { field(DESC, "Stdz mini % of IMAX") field(CALC, "(B/100)*(A-C)") field(INPA, "QUAD:LTUS:180:IDES.HOPR") field(INPB, "QUAD:LTUS:180:STDZMINIPCT CPP NMS") field(INPC, "QUAD:LTUS:180:IDES.LOPR") field(PREC, "5") } record(calc, "QUAD:LTUS:180:STDZMINISETPT") { field(DESC, "Mini Stdz delta") field(CALC, "C==0?MAX(E-D,B):MIN(E+D,A)") field(INPA, "QUAD:LTUS:180:IDES.HOPR") field(INPB, "QUAD:LTUS:180:IDES.LOPR") field(INPC, "QUAD:LTUS:180:STDZDIRECT.RVAL") field(INPD, "QUAD:LTUS:180:STDZMINIDELTA") field(INPE, "QUAD:LTUS:180:IDES") field(PREC, "5") field(FLNK, "QUAD:LTUS:180: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, "QUAD:LTUS:180:STDZMINISETPTOOR") { field(DESC, "Mini Stdz setpoint out of range") field(CALC, "C==0?(E-DA)") field(INPA, "QUAD:LTUS:180:IDES.HOPR") field(INPB, "QUAD:LTUS:180:IDES.LOPR") field(INPC, "QUAD:LTUS:180:STDZDIRECT.RVAL") field(INPD, "QUAD:LTUS:180:STDZMINIDELTA") field(INPE, "QUAD:LTUS:180: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, "QUAD:LTUS:180: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, "QUAD:LTUS:180:IADJUST.RVAL") field(INPB, "QUAD:LTUS:180:STDZDIRECT.RVAL") field(INPC, "QUAD:LTUS:180:STDZOK.RVAL") field(INPD, "QUAD:LTUS:180:STDZDISABLE.RVAL") field(INPE, "QUAD:LTUS:180:STATE.RVAL CPP NMS") field(INPF, "QUAD:LTUS:180:ICTRL.RVAL") field(INPG, "QUAD:LTUS:180:STATE.SEVR") field(INPH, "QUAD:LTUS:180:BDELTAS.M") field(INPI, "QUAD:LTUS:180:IACT.SEVR") field(OUT, "QUAD:LTUS:180:STDZLOSTGO.SELN PP NMS") field(OOPT, "Transition To Non-zero") } record(seq, "QUAD:LTUS:180:STDZLOSTGO") { field(DESC, "Process lost stdz") field(SELM, "Mask") field(DOL1, "1") field(DOL2, "0") field(LNK1, "QUAD:LTUS:180:STDZLOSTTOD.PROC") field(LNK2, "QUAD:LTUS:180:STDZOK PP") } # Record maximum current after standardize # Reset to IACT from sequence after trim # Disable processing during (mini-)standardize or trim record(calc, "QUAD:LTUS:180:STDZIACTMAX") { field(DESC, "Max act current after stdz") field(CALC, "MAX(A, B)") field(DISV, "0") field(SDIS, "QUAD:LTUS:180:CHECKPWRDIP_ENABLE") field(INPA, "QUAD:LTUS:180:IACT CP") field(INPB, "QUAD:LTUS:180:STDZIACTMAX") field(EGU, "A") field(FLNK, "QUAD:LTUS:180:CHECKPWRDIP") } # Detect power dip if STDZOK is YES, STDZ is enabled, and IACT is valid # If IACT drops below STDZIACTMAX by more than the trim tolerance, clear STDZOK # Warning: Take the absolute value of the trim tolerance, or else quads of # negative polarity will always lose STDZ since their IDELTAS.I are negative. # Note: Large quads and bends are prone to losing STDZ even if they are # perturbed toward higher current since their current tends to overshoot # by greater than the trim tolerance before settling down. record(calcout, "QUAD:LTUS:180:CHECKPWRDIP") { field(DESC, "Detect power dip") field(CALC, "(A-B>ABS(C))?3:0") field(DISV, "0") field(SDIS, "QUAD:LTUS:180:CHECKPWRDIP_ENABLE") field(INPA, "QUAD:LTUS:180:STDZIACTMAX") field(INPB, "QUAD:LTUS:180:IACT") field(INPC, "QUAD:LTUS:180:IDELTAS.I") field(OUT, "QUAD:LTUS:180:STDZLOSTGO.SELN PP NMS") field(OOPT, "When Non-zero") } # Enable processing of STDZIACTMAX and CHECKPWRDIP only if # STDZOK = YES, STDZDISABLE = NO, CTRL != Trim (2), and # CTRL != Stdz (4) record(calc, "QUAD:LTUS:180:CHECKPWRDIP_ENABLE") { field(CALC, "A&&!B&&(C#2)&&(C#4)") field(INPA, "QUAD:LTUS:180:STDZOK.RVAL CP") field(INPB, "QUAD:LTUS:180:STDZDISABLE.RVAL CP") field(INPC, "QUAD:LTUS:180:CTRL.RVAL CP") } #! 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, "QUAD:LTUS:180: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, "QUAD:LTUS:180:CALBOK") { field(DESC, "Successful Calibration") field(DTYP, "Raw Soft Channel") field(ZNAM, "NO") field(ONAM, "YES") field(DOL, "PSC:LTUS:MG07:CALBOK.RVAL") field(OMSL, "closed_loop") 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, "QUAD:LTUS:180:CALBSET") { field(DESC, "Use DAC Calbration") field(SCAN, "10 second") field(CALC, "A&&(B==0)&&C?31:960") field(INPA, "QUAD:LTUS:180:CALBOK") field(INPB, "QUAD:LTUS:180:CALBDISABLE") field(INPC, "QUAD:LTUS:180:CALBSLOPE") field(OOPT, "On Change") field(OUT, "QUAD:LTUS:180: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, "QUAD:LTUS:180:CALB_SEQ") { field(DESC, "Output Calib Values") field(SELM, "Mask") field(SELL, "QUAD:LTUS:180: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, "QUAD:LTUS:180:CALBSLOPE") field(DOL3, "QUAD:LTUS:180: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, "QUAD:LTUS:180:CALBTOD") { field(DESC, "Calibration Success Time") field(PINI, "YES") field(DOL, "PSC:LTUS:MG07:CALBTOD") field(OMSL, "closed_loop") field(DTYP, "Soft Channel") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:180: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, "QUAD:LTUS:180: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, "QUAD:LTUS:180: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, "QUAD:LTUS:180:CALBOFFSET") { field(DESC, "Calc DAC Offset") field(PREC, "6") field(EGU, "Counts") field(PINI, "YES") } record(bo, "QUAD:LTUS:180: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, "QUAD:LTUS:180:DACSLOPE") { field(DESC, "V to DAC slope") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "closed_loop") field(PINI, "YES") field(FLNK, "QUAD:LTUS:180:DACOFFSET") } # Default Offset used in conversion from Volts to DAC Counts record(ao, "QUAD:LTUS:180:DACOFFSET") { field(DESC, "V to DAC offset") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "closed_loop") field(PINI, "YES") field(FLNK, "QUAD:LTUS:180: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, "QUAD:LTUS:180: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, "QUAD:LTUS:180:IACT") field(INPD, "QUAD:LTUS:180:DACSLOPE") field(INPE, "QUAD:LTUS:180:DACOFFSET") field(EGU, "Counts") field(PREC, "6") } record(ao, "QUAD:LTUS:180:DAC") { field(DESC, "DAC Set point") field(EGU, "Counts") field(DOL, "") field(OMSL, "closed_loop") field(PREC, "6") field(PINI, "YES") } record(ao, "QUAD:LTUS:180:CALBIMIN") { field(DESC, "Calibration Min Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(DRVH, "165.0") field(HOPR, "165.0") field(DRVL, "0.0") field(LOPR, "0.0") field(PREC, "3") field(EGU, "A") field(VAL, "0.0") field(FLNK, "QUAD:LTUS:180:CALBIMAX") } record(ao, "QUAD:LTUS:180:CALBIMAX") { field(DESC, "Calibration Max Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(DRVH, "165.0") field(HOPR, "165.0") field(LOPR, "0.0") field(DRVL, "0.0") field(EGU, "A") field(VAL, "165.0") field(FLNK, "QUAD:LTUS:180:CALBSTEPNUM") } record(ao, "QUAD:LTUS:180:CALBIFINAL") { field(DESC, "Calibration Last Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(PREC, "3") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(VAL, "0") } record(longout, "QUAD:LTUS:180: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, "QUAD:LTUS:180:CALBIDELTA") } record(calc, "QUAD:LTUS:180:CALBIDELTA") { field(DESC, "Step size for CALB") field(CALC, "C=0?0:ABS((A-B)/C)") field(INPA, "QUAD:LTUS:180:CALBIMAX") field(INPB, "QUAD:LTUS:180:CALBIMIN") field(INPC, "QUAD:LTUS:180: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, "QUAD:LTUS:180:CALBIMULT") { field(DESC, "IACT vs ISETPT mult") field(CALC, "C#0||A=0?1:ABS(B/A)") field(INPA, "PSC:LTUS:MG07:ISETPT.DRVH") field(INPB, "PSC:LTUS:MG07:IACT.HOPR") field(INPC, "QUAD:LTUS:180:PSCONTROLLER.RVAL CPP") field(EGU, "A") field(PINI, "YES") } # SNL dbputs DAC values here. 6-10 steps are possible. record(waveform, "QUAD:LTUS:180:CALBICTRLWF") { field(DESC, "ICTRL setpoint array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") } record(waveform, "QUAD:LTUS:180:DACWF") { field(DESC, "DAC count array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:180:DACSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:180:DACSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "QUAD:LTUS:180: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, "QUAD:LTUS:180:CALCDACWF") { field(DESC, "Calc DAC counts array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:180:CALCDACSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:180:CALCDACSA") { field(DESC, "Calc DAC counts") field(DTYP, "Soft Channel") field(INP, "QUAD:LTUS:180: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, "QUAD:LTUS:180:CALBYWF") { field(DESC, "mx + b") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:180:CALBYSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:180:CALBYSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "QUAD:LTUS:180:CALBYWF") field(MALM, "10") field(NELM, "6") field(INDX, "0") field(FTVL, "DOUBLE") } record(waveform, "QUAD:LTUS:180:CALBIACTWF") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:180:CALBIACTSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:180:CALBIACTSA") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(MALM, "10") field(NELM, "6") field(INP, "QUAD:LTUS:180:CALBIACTWF") field(INDX, "0") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:180:CALBLIMITS") } # Check that measured current during calibration is within # tolerance. record(aSub, "QUAD:LTUS:180: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, "QUAD:LTUS:180:CALBSTEPNUM") field(INPB, "QUAD:LTUS:180:CALBIACTWF") field(INPC, "QUAD:LTUS:180: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, "QUAD:LTUS:180: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, "QUAD:LTUS:180:STDZITOL") field(INPH, "QUAD:LTUS:180:DACSLOPE") field(INPI, "QUAD:LTUS:180: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, "QUAD:LTUS:180: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, "QUAD:LTUS:180:CALBSTEPNUM") field(INPB, "QUAD:LTUS:180:CALBIACTWF") field(INPC, "QUAD:LTUS:180:DACWF") field(INPF, "QUAD:LTUS:180: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 QUAD:LTUS:180CALBOK 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, "QUAD:LTUS:180:DEGAUSINIT") { field(DESC, "Proc. Degauss PVs on boot") field(PINI, "YES") field(DOL, "1") field(OUTA, "QUAD:LTUS:180:DEGAUSIMIN.PROC PP") field(OUTB, "QUAD:LTUS:180:DEGAUSIMAX.PROC PP") field(OUTC, "QUAD:LTUS:180:DEGAUSTYPE.PROC PP") field(OUTD, "QUAD:LTUS:180:DEGAUSSTEP.PROC PP") field(OUTE, "QUAD:LTUS:180:MADNAME.PROC PP") field(OUTF, "QUAD:LTUS:180:PSTYPE.PROC PP") field(OUTG, "QUAD:LTUS:180: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, "QUAD:LTUS:180:DEGAUSSUB") { field(DESC, "Degauss subroutine") field(INAM, "mgntDegaussInit") field(SNAM, "mgntDegauss") field(BRSV, "INVALID") field(INPA, "QUAD:LTUS:180:DEGAUSIMIN NPP NMS") field(INPB, "QUAD:LTUS:180:DEGAUSIMAX NPP NMS") field(INPC, "QUAD:LTUS:180:DEGAUSTYPE.RVAL NPP NMS") field(INPE, "QUAD:LTUS:180:DEGAUSMETHOD.RVAL NPP NMS") field(INPF, "QUAD:LTUS:180:PSTYPE NPP NMS") field(INPG, "QUAD:LTUS:180:DEBUG.RVAL NPP NMS") field(INPH, "QUAD:LTUS:180: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, "QUAD:LTUS:180:DEGAUSWF PP") field(OUTB, "QUAD:LTUS:180:DEGAUSMSG PP") field(OUTC, "QUAD:LTUS:180: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, "QUAD:LTUS:180:DEGAUSWF") { field(DESC, "Degauss Setpts") field(NELM, "60") field(FTVL, "DOUBLE") } record(mbbo,"QUAD:LTUS:180: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, "QUAD:LTUS:180: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, "QUAD:LTUS:180: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, "QUAD:LTUS:180: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, "QUAD:LTUS:180: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, "QUAD:LTUS:180:DEGAUSIMIN") { field(DESC, "Min. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "165.0") field(LOPR, "-165.0") field(DRVH, "165.0") field(DRVL, "-165.0") field(VAL, "-165.0") } record(ao, "QUAD:LTUS:180:DEGAUSIMAX") { field(DESC, "Max. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "165.0") field(LOPR, "-165.0") field(DRVH, "165.0") field(DRVL, "-165.0") field(VAL, "165.0") } # 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,"QUAD:LTUS:180: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, "QUAD:LTUS:180: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,"QUAD:LTUS:180: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, "QUAD:LTUS:180: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, "QUAD:LTUS:180: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, "QUAD:LTUS:180: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, "QUAD:LTUS:180:DEGAUSTOD") { field(DESC, "Successful Degauss Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "QUAD:LTUS:180:DEGAUSLOSTTOD") { field(DESC, "Degauss Lost Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:180:DEGAUSTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "QUAD:LTUS:180:DEGAUSTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "QUAD:LTUS:180: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, "QUAD:LTUS:180:DEGAUSGO") { field(DESC, "Set bdes of btrms to zero") field(ASG, "Internal") field(OUTA, "") field(OUTB, "") field(OUTC, "") field(OUTD, "") } # =========== CRYO ONLY =========== record(bo, "QUAD:LTUS:180: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, "QUAD:LTUS:180:DEGAUS_IMAX_CHECK") { field(DESC, "Check if imax shoud chg") field(CALC, "(C==4)&&(ABS(B)>ABS(A))?1:0") field(INPA, "QUAD:LTUS:180:DEGAUS_IMAX") field(INPB, "QUAD:LTUS:180:ISETPT") field(INPC, "QUAD:LTUS:180:DEGAUSTYPE.RVAL") field(OUT, "QUAD:LTUS:180:DEGAUS_IMAX_UPDATE.SELN") field(FLNK, "QUAD:LTUS:180:DEGAUS_IMAX_UPDATE") } record(seq, "QUAD:LTUS:180:DEGAUS_IMAX_UPDATE") { field(DESC, "Degauss IMAX Update") field(SELM, "Specified") field(DOL1, "QUAD:LTUS:180:ISETPT") field(LNK1, "QUAD:LTUS:180:DEGAUS_IMAX PP") } # Set the maximum current after a successful # degauss. This pv is updated by the # sequence. record(ao, "QUAD:LTUS:180:DEGAUS_IMAX") { field(DESC, "Max I set afer a degauss") field(EGU, "Amps") field(PINI, "YES") field(PREC, "6") field(HOPR, "165.0") field(LOPR, "-165.0") field(DRVH, "165.0") field(DRVL, "-165.0") field(VAL, "165.0") field(FLNK, "QUAD:LTUS:180:DEGAUS_IMAXPOL_CHECK") info(autosaveFields,"VAL,RVAL") } # Set the polarity if degauss_imax record(calcout, "QUAD:LTUS:180:DEGAUS_IMAXPOL_CHECK") { field(DESC, "Determine polarity of imax") field(CALC, "A>=0?0:1") field(INPA, "QUAD:LTUS:180:DEGAUS_IMAX") field(FLNK, "QUAD:LTUS:180:DEGAUS_IMAXPOL") } record(bo, "QUAD:LTUS:180:DEGAUS_IMAXPOL") { field(DESC, "Polarity of imax I") field(DTYP, "Raw Soft Channel") field(DOL, "QUAD:LTUS:180:DEGAUS_IMAXPOL_CHECK") field(OMSL, "closed_loop") field(ZNAM, "Positive") field(ONAM, "Negative") field(FLNK, "QUAD:LTUS:180: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, "QUAD:LTUS:180:DEGAUS_ABSIMAX") { field(DESC, "Absolute Max. Degauss I") field(CALC, "ABS(A)") field(INPA, "QUAD:LTUS:180:DEGAUS_IMAX") field(PREC, "6") field(EGU, "Amps") field(HOPR, "165.0") field(LOPR, "-165.0") info(autosaveFields,"VAL RVAL") } # IACT Polarity record(calcout, "QUAD:LTUS:180:IACTPOL_CHECK") { field(DESC, "Determine IACT polarity") field(SCAN, "5 second") field(CALC, "ABS(A-B)>C?(A>=0?0:1):D") field(INPA, "QUAD:LTUS:180:IACT") field(INPB, "QUAD:LTUS:180:IACTPOL_CHECK.LA") field(INPC, "0.0001") field(INPD, "QUAD:LTUS:180:IACTPOL_CHECK.PVAL") field(OOPT, "On Change") field(FLNK, "QUAD:LTUS:180:IACTPOL") } record(bo, "QUAD:LTUS:180: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,"QUAD:LTUS:180: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, "QUAD:LTUS:180:DEGAUSENABLE CP") field(INPB, "QUAD:LTUS:180:DEGAUSOK") field(INPC, "QUAD:LTUS:180:STATE CP") field(INPD, "QUAD:LTUS:180:STATE.SEVR") field(OUT, "QUAD:LTUS:180:DEGAUS_STATE_SEQ.SELN PP") field(ASG, "Internal") } record(seq, "QUAD:LTUS:180:DEGAUS_STATE_SEQ") { field(DESC, "Degauss State Sequence") field(SELM, "Specified") field(SELL, "QUAD:LTUS:180:DEGAUS_STATE_CHECK") field(LNK1, "QUAD:LTUS:180:DEGAUS_STATE_DISABLE.PROC PP") field(LNK2, "QUAD:LTUS:180:DEGAUS_STATE_LOST.PROC PP") field(LNK3, "QUAD:LTUS:180:DEGAUS_STATE_GOOD.PROC PP") field(LNK4, "QUAD:LTUS:180: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, "QUAD:LTUS:180:DEGAUS_STATE_DISABLE") { field(DESC, "Degauss not used") field(LNK1, "QUAD:LTUS:180:DEGAUSOK.ZSV") field(LNK2, "QUAD:LTUS:180: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, "QUAD:LTUS:180:STATMSG.FRSV") field(LNK4, "QUAD:LTUS:180: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, "QUAD:LTUS:180:DEGAUS_STATE_LOST") { field(DESC, "Degauss lost and ps On") field(DOL1, "1") field(LNK1, "QUAD:LTUS:180:DEGAUSOK.ZSV") field(LNK2, "QUAD:LTUS:180: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, "QUAD:LTUS:180:STATMSG.FRSV") field(LNK4, "QUAD:LTUS:180: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, "QUAD:LTUS:180:DEGAUS_STATE_OFF") { field(DESC, "Degaused lost and ps Off") field(DOL1, "2") field(LNK1, "QUAD:LTUS:180: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, "QUAD:LTUS:180:STATMSG.FRSV") field(LNK3, "QUAD:LTUS:180: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, "QUAD:LTUS:180:DEGAUS_STATE_GOOD") { field(DESC, "Degauss good") field(DOL1, "1") field(LNK1, "QUAD:LTUS:180: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, "QUAD:LTUS:180:STATMSG.FRSV PP") field(LNK3, "QUAD:LTUS:180:STATMSG.FVSV PP") field(LNK4, "") field(ASG, "Internal") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(mbbo, "QUAD:LTUS:180:FUNC") { field(DESC, "QUAD:LTUS:180 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, "1") field(THVL, "9") field(FRVL, "10") field(FVVL, "0") field(SXVL, "2") field(SVVL, "8") field(EIVL, "11") field(NIVL, "12") field(TEVL, "13") field(ELVL, "5") field(TVVL, "6") field(TTVL, "7") field(FTVL, "4") field(FFVL, "3") field(OUT, "QUAD:LTUS:180:CTRL CA") } # :CTRL pv is processed at boot in the # sequence mgntCtrl.st Processed in sequence # record(mbbo, "QUAD:LTUS:180:CTRL") { field(DESC, "QUAD:LTUS:180 Control") field(PINI, "NO") field(ZRST, "Ready") field(ONST, "TRIM") field(TWST, "PERTURB") field(THST, "BCON_TO_BDES") field(FRST, "BACT_TO_BDES") field(FVST, "SAVE_BDES") field(SXST, "LOAD_BDES") field(SVST, "UNDO_BDES") field(EIST, "DAC_ZERO") field(NIST, "CALB") field(TEST, "STDZ") field(ELST, "RESET") field(TVST, "TURN_ON") field(TTST, "TURN_OFF") field(FTST, "") field(FFST, "") field(ZRVL, "0") field(ONVL, "2") field(TWVL, "6") field(THVL, "15") field(FRVL, "14") field(FVVL, "11") field(SXVL, "12") field(SVVL, "13") field(EIVL, "7") field(NIVL, "3") field(TEVL, "4") field(ELVL, "8") field(TVVL, "9") field(TTVL, "10") field(FTVL, "0") field(FFVL, "0") field(OUT, "QUAD:LTUS:180:SELECTEN.A PP") field(SDIS, "0") } # If a function has been selected set this unit to busy record(calcout, "QUAD:LTUS:180:SELECTEN") { field(DESC, "Control Select Enable") field(CALC, "A>0?1:A") field(FLNK, "QUAD:LTUS:180:BUSY") } # Set to FREE on IOC reboot record(bo, "QUAD:LTUS:180:BUSY") { field(DESC, "QUAD:LTUS:180 Ctrl Done") field(DOL, "QUAD:LTUS:180:SELECTEN") field(ZNAM, "FREE") field(ONAM, "BUSY") field(PINI, "YES") field(FLNK, "QUAD:LTUS:180:SELECT") } record(bo, "QUAD:LTUS:180:SELECT") { field(ZNAM, "NO") field(ONAM, "YES") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") } record(bo, "QUAD:LTUS:180: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, "QUAD:LTUS:180:CTRLSTATE") { field(DESC, "QUAD:LTUS:180 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("QUAD:LTUS:180:CTRL",20,20,0,0,"QUAD:LTUS:180:CTRL") #! Field("QUAD:LTUS:180:CTRL.OUT",16777215,1,"QUAD:LTUS:180:CTRL.OUT") #! Link("QUAD:LTUS:180:CTRL.OUT","QUAD:LTUS:180:SELECTEN.A") #! Field("QUAD:LTUS:180:CTRL.VAL",16777215,1,"QUAD:LTUS:180:CTRL.VAL") #! Record("QUAD:LTUS:180:SELECTEN",321,381,0,0,"QUAD:LTUS:180:SELECTEN") #! Field("QUAD:LTUS:180:SELECTEN.A",16777215,0,"QUAD:LTUS:180:SELECTEN.A") #! Field("QUAD:LTUS:180:SELECTEN.FLNK",16777215,1,"QUAD:LTUS:180:SELECTEN.FLNK") #! Link("QUAD:LTUS:180:SELECTEN.FLNK","QUAD:LTUS:180:BUSY") #! Field("QUAD:LTUS:180:SELECTEN.VAL",16777215,1,"QUAD:LTUS:180:SELECTEN.VAL") #! Record("QUAD:LTUS:180:BUSY",623,274,0,0,"QUAD:LTUS:180:BUSY") #! Field("QUAD:LTUS:180:BUSY.DOL",16777215,0,"QUAD:LTUS:180:BUSY.DOL") #! Link("QUAD:LTUS:180:BUSY.DOL","QUAD:LTUS:180:SELECTEN.VAL") #! Field("QUAD:LTUS:180:BUSY.FLNK",16777215,1,"QUAD:LTUS:180:BUSY.FLNK") #! Link("QUAD:LTUS:180:BUSY.FLNK","QUAD:LTUS:180:SELECT") #! Record("QUAD:LTUS:180:SELECT",669,508,0,1,"QUAD:LTUS:180:SELECT") #! Record("QUAD:LTUS:180:FUNC",940,120,0,0,"QUAD:LTUS:180:FUNC") #! Field("QUAD:LTUS:180:FUNC.OUT",16777215,0,"QUAD:LTUS:180:FUNC.OUT") #! Link("QUAD:LTUS:180:FUNC.OUT","QUAD:LTUS:180:CTRL.VAL") #! Record("QUAD:LTUS:180:ABORT",193,41,0,0,"QUAD:LTUS:180:ABORT") #! Record("QUAD:LTUS:180:CTRLSTATE",369,34,0,0,"QUAD:LTUS:180: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,"QUAD:LTUS:180:SELECT is used for Multi-device selection.\nIt is enabled when associated QUAD:LTUS:180:CTRL is \"0\" (DONE).\nIt is disabled when associated QUAD:LTUS:180: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,"QUAD:LTUS:180: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, "QUAD:LTUS:180:BCTRL_INIT") { field(DESC, "Process BCTRL on boot") field(PINI, "YES") field(CALC, "A=3?1:0") field(INPA, "QUAD:LTUS:180:BCTRL.SEVR") field(OUT, "QUAD:LTUS:180: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, "QUAD:LTUS:180:BACT") { field(DESC, "Actual B") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "QUAD:LTUS:180:BACT") field(INPB, "QUAD:LTUS:180:POLYCOEF") field(INPC, "QUAD:LTUS:180:POLYCOEF.A") field(INPD, "QUAD:LTUS:180:POLYCOEF.B") field(INPE, "QUAD:LTUS:180:IACT MS") field(INPF, "QUAD:LTUS:180:BDELTAS PP") field(INPG, "100") field(EGU, "kG") field(HOPR, "-0.251") field(LOPR, "-52.2428") field(HIHI, "-0.251") field(LOLO, "-52.2428") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "-0.251") field(LOW, "-52.2428") field(FLNK, "QUAD:LTUS:180: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, "QUAD:LTUS:180:BDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntPhyDeltas") field(EGU, "kG") field(HOPR, "1") field(PREC, "7") field(BRSV, "INVALID") field(INPA, "QUAD:LTUS:180:BDES") field(INPB, "QUAD:LTUS:180:TRIMBTOL") field(INPC, "QUAD:LTUS:180:TRIMBTOLR") field(INPD, "QUAD:LTUS:180:CHCKBTOL") field(INPE, "QUAD:LTUS:180:CHCKBTOLR") field(F, "2.0") field(INPG, "30") field(INPH, "QUAD:LTUS:180:BACT.VAL") # # MPS absolute and relative tolerances field(INPP, "QUAD:LTUS:180:MPSBTOL") field(INPQ, "QUAD:LTUS:180:MPSBTOLR") field(FLNK, "QUAD:LTUS:180:BCONLIMITS") info(autosaveFields,"F") } # This record is processed by BDELTAS record(aSub, "QUAD:LTUS:180:BCONLIMITS") { field(DESC, "Config B-field Limits") field(INAM, "mgntInit") field(SNAM, "mgntBCONLimits") field(INPA, "QUAD:LTUS:180:BDES") field(INPB, "QUAD:LTUS:180:BDELTAS.I") field(INPG, "QUAD:LTUS:180:DEBUG.RVAL") field(FTA, "DOUBLE") field(FTB, "DOUBLE") field(FTG, "ULONG") field(OUTA, "QUAD:LTUS:180:BCON.HIGH") field(OUTB, "QUAD:LTUS:180:BCON.LOW") field(OUTC, "QUAD:LTUS:180:BCON.HIHI") field(OUTD, "QUAD:LTUS:180:BCON.LOLO PP") field(FTVA, "DOUBLE") field(FTVB, "DOUBLE") field(FTVC, "DOUBLE") field(FTVD, "DOUBLE") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:180:IDELTAS") } # The following PV is processed by :BACT # which is processed by :BACT # record(fanout, "QUAD:LTUS:180:BACTFO") { field(DESC, "BACT processing") field(SELM, "All") field(LNK1, "QUAD:LTUS:180:BDIFF") field(LNK2, "QUAD:LTUS:180:BADIFF") field(LNK3, "QUAD:LTUS:180:BRATIO") field(LNK4, "QUAD:LTUS:180:MPSLIMITS") field(LNK5, "QUAD:LTUS:180:I2BSTATUS") field(LNK6, "QUAD:LTUS:180:IACTFO.PROC") } record(calc, "QUAD:LTUS:180:BDIFF") { field(DESC, "BDES-BACT") field(CALC, "A-B") field(INPA, "QUAD:LTUS:180:BDES") field(INPB, "QUAD:LTUS:180:BACT") field(EGU, "kG") field(PREC, "7") } record(calc, "QUAD:LTUS:180:BADIFF") { field(DESC, "Absolute BDES-BACT") field(INPA, "QUAD:LTUS:180:BDIFF") field(EGU, "kG") field(PREC, "7") field(CALC, "A<0?ABS(A):A") } record(calc, "QUAD:LTUS:180:BRATIO") { field(DESC, "BACT Error") field(CALC, "B?A/B:0") field(INPA, "QUAD:LTUS:180:BDIFF") field(INPB, "QUAD:LTUS:180:BDES.HOPR") field(EGU, "kG") field(PREC, "7") } record(mbbi, "QUAD:LTUS:180: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, "QUAD:LTUS:180:BACT.J") } # Note: for a string slave set the MONFL # macro to the following: # MONFL=:IMONCALC MS record(sub, "QUAD:LTUS:180:BMON") { field(DESC, "Second Transductor") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "QUAD:LTUS:180:BMON") field(INPB, "QUAD:LTUS:180:POLYCOEF") field(INPC, "QUAD:LTUS:180:POLYCOEF.A") field(INPD, "QUAD:LTUS:180:POLYCOEF.B") field(INPE, "QUAD:LTUS:180:IMON MS") field(INPF, "QUAD:LTUS:180:BDELTAS.VAL") field(INPG, "100") field(EGU, "kG") field(HOPR, "-0.251") field(LOPR, "-52.2428") field(HIHI, "-0.251") field(LOLO, "-52.2428") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "-0.251") field(LOW, "-52.2428") } # 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=PSC:LTUS:MG07:BDES CP record(ao, "QUAD:LTUS:180:BDES") { field(DESC, "Desired B-Field") field(PINI, "YES") field(DRVH, "-0.251") field(DRVL, "-52.2428") field(HOPR, "-0.251") field(LOPR, "-52.2428") field(PREC, "7") field(EGU, "kG") field(MDEL, "-1") field(OMSL, "supervisory") # field(DOL, "") field(OUT, "QUAD:LTUS:180:B2IDES PP") info(autosaveFields,"VAL") } record(sub, "QUAD:LTUS:180:B2IDES") { field(DESC, "Convert Desired B-Field to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:180:POLYCOEF") field(INPC, "QUAD:LTUS:180:POLYCOEF.A") field(INPD, "QUAD:LTUS:180:POLYCOEF.B") field(PREC, "7") field(EGU, "kG") field(HOPR, "-0.251") field(LOPR, "-52.2428") field(MDEL, "-1") field(INPE, "QUAD:LTUS:180:BDES.DRVH") field(INPF, "QUAD:LTUS:180:BDES.DRVL") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:180:IDES") } record(sub, "QUAD:LTUS:180:BNOM") { field(DESC, "Nominal Field") field(PINI, "YES") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:180:POLYCOEF") field(INPC, "QUAD:LTUS:180:POLYCOEF.A") field(INPD, "QUAD:LTUS:180:POLYCOEF.B") field(INPE, "QUAD:LTUS:180:BDES.DRVH") field(INPF, "QUAD:LTUS:180:BDES.DRVL") field(EGU, "kG") field(HOPR, "-0.251") field(LOPR, "-52.2428") field(PREC, "7") field(VAL, "0.0") field(FLNK, "QUAD:LTUS:180:INOM") } record(sub, "QUAD:LTUS:180:BACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:180:BDES.VAL") field(INPB, "QUAD:LTUS:180:BDES.DRVH") field(INPC, "QUAD:LTUS:180:BDES.DRVL") field(INPD, "QUAD:LTUS:180:BDELTAS.I") field(INPE, "QUAD:LTUS:180:BDELTAS.J") field(INPG, "QUAD:LTUS:180:STATE") field(INPH, "QUAD:LTUS:180:HSTA") field(EGU, "kG") field(HOPR, "-0.251") field(LOPR, "-52.2428") field(PREC, "7") field(BRSV, "INVALID") } record(sub, "QUAD:LTUS:180:BMONLIMITS") { field(DESC, "MON Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:180:BDES.VAL") field(INPB, "QUAD:LTUS:180:BDES.DRVH") field(INPC, "QUAD:LTUS:180:BDES.DRVL") field(INPD, "QUAD:LTUS:180:BDELTAS.K") field(INPE, "QUAD:LTUS:180:BDELTAS.L") field(INPG, "QUAD:LTUS:180:STATE") field(INPH, "QUAD:LTUS:180:HSTA") field(EGU, "kG") field(HOPR, "-0.251") field(LOPR, "-52.2428") field(PREC, "7") field(BRSV, "INVALID") } record(seq, "QUAD:LTUS:180:BLIMITS") { field(DESC, "ACT Limits") field(PREC, "7") field(DOL1, "QUAD:LTUS:180:BLIMITS") field(LNK1, "QUAD:LTUS:180:BACTLIMITS.F PP") field(DOL2, "QUAD:LTUS:180:BACTLIMITS.I") field(LNK2, "QUAD:LTUS:180:BACT.HIGH") field(DOL3, "QUAD:LTUS:180:BACTLIMITS.J") field(LNK3, "QUAD:LTUS:180:BACT.LOW") field(DOL4, "QUAD:LTUS:180:BACTLIMITS.K") field(LNK4, "QUAD:LTUS:180:BACT.HIHI") field(DOL5, "QUAD:LTUS:180:BACTLIMITS.L") field(LNK5, "QUAD:LTUS:180:BACT.LOLO") field(DOL6, "QUAD:LTUS:180:BLIMITS") field(LNK6, "QUAD:LTUS:180:BMONLIMITS.F PP") field(DOL7, "QUAD:LTUS:180:BMONLIMITS.I") field(LNK7, "QUAD:LTUS:180:BMON.HIGH") field(DOL8, "QUAD:LTUS:180:BMONLIMITS.J") field(LNK8, "QUAD:LTUS:180:BMON.LOW") field(DOL9, "QUAD:LTUS:180:BMONLIMITS.K") field(LNK9, "QUAD:LTUS:180:BMON.HIHI") field(DOLA, "QUAD:LTUS:180:BMONLIMITS.L") field(LNKA, "QUAD:LTUS:180:BMON.LOLO") field(FLNK, "QUAD:LTUS:180:ILIMITS") field(SCAN, "5 second") } record(ao, "QUAD:LTUS:180:BCTRL") { field(DESC, "B-Perturb") field(PREC, "7") field(EGU, "kG") field(DRVH, "-0.251") field(DRVL, "-52.2428") field(HOPR, "-0.251") field(LOPR, "-52.2428") # 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, "QUAD:LTUS:180: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, "QUAD:LTUS:180:BCTRLGO") { field(DESC, "Update DES and perturb") field(PREC, "7") # Disable BACT limits field(DOL1, "1") field(LNK1, "QUAD:LTUS:180:BLIMITS.VAL") # Update BDES with the BCTRL (slider) value field(DOL2, "QUAD:LTUS:180:BCTRL.VAL") field(LNK2, "QUAD:LTUS:180:BDES PP") field(DOL3, "1") field(LNK3, "QUAD:LTUS:180:IDIRECT.PROC PP") field(DOL4, "1") field(LNK4, "QUAD:LTUS:180:CHECKSTDZLOST.PROC PP") field(DOL5, "QUAD:LTUS:180:BCTRL.VAL") field(LNK5, "QUAD:LTUS:180:BCTRLSUB PP") # Re-enable BACT limits field(DOL6, "0") field(LNK6, "QUAD:LTUS:180:BLIMITS.VAL") } # Convert B-field to Current and output to ISETPT record(sub, "QUAD:LTUS:180:BCTRLSUB") { field(DESC, "Feedback") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:180:POLYCOEF") field(INPC, "QUAD:LTUS:180:POLYCOEF.A") field(INPD, "QUAD:LTUS:180:POLYCOEF.B") field(INPE, "QUAD:LTUS:180:BDES.DRVH") field(INPF, "QUAD:LTUS:180:BDES.DRVL") field(PREC, "7") field(EGU, "kG") field(HOPR, "-0.251") field(LOPR, "-52.2428") field(MDEL, "-1") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:180:ISETPT") } record(ao, "QUAD:LTUS:180:BDESPREVTRIM") { field(DESC, "trim bdes for undo") field(DTYP, "Soft Channel") field(DRVH, "-0.251") field(DRVL, "-52.2428") field(EGU, "kG") field(HOPR, "-0.251") field(LOPR, "-52.2428") field(PREC, "7") field(PINI, "YES") info(autosaveFields,"VAL") } record(stringin, "QUAD:LTUS:180:MADNAME") { field(DESC, "MAD deck nomenclature") field(PINI, "YES") field(VAL, "QDL12") } record(ai, "QUAD:LTUS:180: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, "3253.36388") } record(ao, "QUAD:LTUS:180:BMAX") { field(DESC, "Max B-Field") field(DTYP, "Soft Channel") field(DRVH, "-0.251") field(DRVL, "-52.2428") field(EGU, "kG") field(HOPR, "-0.251") field(LOPR, "-52.2428") field(PREC, "7") field(PINI, "YES") field(VAL, "-0.251") field(FLNK, "QUAD:LTUS:180:BSTEP") } record(ao, "QUAD:LTUS:180:BMIN") { field(DESC, "Min B-Field") field(DTYP, "Soft Channel") field(DRVH, "-0.251") field(DRVL, "-52.2428") field(EGU, "kG") field(HOPR, "-0.251") field(LOPR, "-52.2428") field(PREC, "7") field(PINI, "YES") field(VAL, "-52.2428") field(FLNK, "QUAD:LTUS:180:BSTEP") } record(ao, "QUAD:LTUS:180:BDESSAVE") { field(DESC, "bdes for save/load") field(DTYP, "Soft Channel") field(DRVH, "-0.251") field(DRVL, "-52.2428") field(EGU, "kG") field(HOPR, "-0.251") field(LOPR, "-52.2428") field(PINI, "YES") field(PREC, "7") } # This record is processed by QUAD:LTUS:180: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, "QUAD:LTUS:180:BCON") { field(DESC, "Config B-Field ") field(DTYP, "Soft Channel") field(PREC, "7") field(EGU, "kG") field(HOPR, "-0.251") field(LOPR, "-52.2428") field(DRVH, "-0.251") field(DRVL, "-52.2428") # Set MINOR Alarm as the default, slaves will set NO_ALARM=0. field(HHSV, "MINOR") field(LLSV, "MINOR") field(HSV, "MINOR") field(LSV, "MINOR") # field(DOL , "") field(OMSL, "supervisory") field(OUT, "QUAD:LTUS:180:B2ICON PP") info(autosaveFields,"VAL") } record(sub, "QUAD:LTUS:180:B2ICON") { field(DESC, "Convert Desired ICon to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:180:POLYCOEF") field(INPC, "QUAD:LTUS:180:POLYCOEF.A") field(INPD, "QUAD:LTUS:180:POLYCOEF.B") field(PREC, "7") field(EGU, "kG") field(HOPR, "-0.251") field(LOPR, "-52.2428") field(MDEL, "-1") field(INPE, "QUAD:LTUS:180:BCON.DRVH") field(INPF, "QUAD:LTUS:180:BCON.DRVL") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:180: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, "QUAD:LTUS:180:BSTEP") { field(DESC, "B-Field step size") field(CALC, "(C==3)||(D==3)?0:ABS(A-B)*0.005") field(INPA, "QUAD:LTUS:180:BMAX") field(INPB, "QUAD:LTUS:180:BMIN") field(INPC, "QUAD:LTUS:180:BMIN.SEVR") field(INPD, "QUAD:LTUS:180:BMAX.SEVR") field(EGU, "kG") 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,"QUAD:LTUS:180:BCTRLDISABLECALC") { field(DESC, "Calc for disabling BCTRL") field(ASG, "Internal") field(CALC, "A?2:1") field(INPA, "QUAD:LTUS:180:ONLINE CP") field(OUT, "QUAD:LTUS:180:BCTRLDISABLEFOUT PP") } record(fanout, "QUAD:LTUS:180:BCTRLDISABLEFOUT") { field(DESC, "Disable BCTRL fanout") field(SELM, "Specified") field(SELL, "QUAD:LTUS:180:BCTRLDISABLECALC") field(LNK1, "QUAD:LTUS:180:BCTRLDISABLE") field(LNK2, "QUAD:LTUS:180:BCTRLENABLE") } record(stringout, "QUAD:LTUS:180:BCTRLDISABLE") { field(DESC, "Disable BCTRL") field(DTYP, "Soft Channel") field(OUT, "QUAD:LTUS:180:BCTRL.ASG") field(VAL, "NOWRITE") field(FLNK, "QUAD:LTUS:180:BCTRLDISV_UPDATE") } record(stringout, "QUAD:LTUS:180:BCTRLENABLE") { field(DESC, "Enable BCTRL") field(DTYP, "Soft Channel") field(OUT, "QUAD:LTUS:180:BCTRL.ASG") field(VAL, "") field(FLNK, "QUAD:LTUS:180:BCTRLDISV_UPDATE") } record(calcout, "QUAD:LTUS:180:BCTRLDISV_UPDATE") { field(DESC, "Calc for updating BCTRL.DISV") field(ASG, "Internal") field(CALC, "A") field(INPA, "QUAD:LTUS:180:ONLINE") field(OUT, "QUAD:LTUS:180: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,"QUAD:LTUS:180:BACT and MON\n are processed via links from \n QUAD:LTUS:180:IACT (device raw value readback 1)\n and\n QUAD:LTUS:180: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 QUAD:LTUS:180:POLYCOEF\nC = First polynomial coefficient (offset if linear)\nD = Second polynomial coefficient (slope if linear)\nE = QUAD:LTUS:180: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,"QUAD:LTUS:180:BDES\n is processed when set by CA users or \n QUAD:LTUS:180: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,"QUAD:LTUS:180: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 QUAD:LTUS:180: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 (QUAD:LTUS:180: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,"QUAD:LTUS:180:B*LIMITS and QUAD:LTUS:180:BLIMITS:\n Calculate alarm and warning limits based on \n deltas from QUAD:LTUS:180: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,"QUAD:LTUS:180: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,"QUAD:LTUS:180: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, "QUAD:LTUS:180: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, "QUAD:LTUS:180:MPSBTOL") { field(DESC, "Absolute mps tol") field(EGU, "kG") field(PREC, "2") field(CALC, "ABS(A)*0.02") field(INPA, "QUAD:LTUS:180:BMAX") field(PINI, "YES") } # # 21-Aug-2013: K. Luchini # Set channel access security so that users # cannot easily change values. record(ao, "QUAD:LTUS:180:MPSBMAX") { field(DESC, "MPS Max B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "-0.251") field(DRVL, "-52.2428") field(PINI, "YES") field(VAL, "-0.251") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:180:MPSBMIN") { field(DESC, "MPS Min B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "-0.251") field(DRVL, "-52.2428") field(PINI, "YES") field(VAL, "-52.2428") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:180:MPSBLLIM") { field(DESC, "MPS Low Limit B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "-0.251") field(DRVL, "-52.2428") field(PINI, "YES") field(VAL, "-52.2428") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:180:MPSBLLIM2") { field(DESC, "MPS Low Limit #2 B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "-0.251") field(DRVL, "-52.2428") field(PINI, "YES") field(VAL, "-52.2428") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } # Set the default to Std record(mbbo, "QUAD:LTUS:180: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, "QUAD:LTUS:180:MPSLIMITS.E PP") } record(aSub, "QUAD:LTUS:180: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, "QUAD:LTUS:180:MPS.RVAL") field(INPB, "QUAD:LTUS:180:BADIFF") field(INPC, "QUAD:LTUS:180:BDELTAS.N") field(INPD, "QUAD:LTUS:180:BACT") field(INPE, "QUAD:LTUS:180:MPSBITMASK.RVAL") field(INPF, "QUAD:LTUS:180:MPSBLLIM") field(INPG, "QUAD:LTUS:180:MPSBMIN") field(INPH, "QUAD:LTUS:180:MPSBMAX") field(INPI, "QUAD:LTUS:180: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, "QUAD:LTUS:180:INTOL.RVAL PP") field(OUTB, "QUAD:LTUS:180:INTOL_BMIN.RVAL PP") field(OUTC, "QUAD:LTUS:180:INTOL_BRANGE.RVAL PP") field(OUTD, "QUAD:LTUS:180: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, "QUAD:LTUS:180:INTOL") { field(DESC, "BACT within MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:180:MPSLIMITS.VALA") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "QUAD:LTUS:180:INTOL_BMIN") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:180:MPSLIMITS.VALB") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "QUAD:LTUS:180:INTOL_BMIN2") { field(DESC, "MPS tol #2") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:180:MPSLIMITS.VALD") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "QUAD:LTUS:180:INTOL_BRANGE") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:180: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, "QUAD:LTUS:180:CHCKITOL") { field(DESC, "Absolute Check I Tolerance") field(EGU, "A") field(FLNK, "QUAD:LTUS:180:TRIMITOL") field(CALC, "ABS(A*B)") field(INPA, "QUAD:LTUS:180:CHCKBTOL") field(INPB, "QUAD:LTUS:180:POLYCOEF.B") field(PREC, "9") } record(calc, "QUAD:LTUS:180:TRIMBTOL") { field(EGU, "kG") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(DESC, "Absolute Trim Tolerance") field(CALC, "ABS(A)/2") field(INPA, "QUAD:LTUS:180:CHCKBTOL") field(FLNK, "QUAD:LTUS:180:CHCKITOL") } record(calc, "QUAD:LTUS:180:CHCKBTOL") { field(DESC, "Check absolute tolerance") field(EGU, "A") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(FLNK, "QUAD:LTUS:180:TRIMBTOL") field(CALC, "MAX(ABS(A),ABS(C))*(B/1000000)") field(INPA, "QUAD:LTUS:180:BDES.HOPR") field(INPB, "QUAD:LTUS:180:STABILITY") field(INPC, "QUAD:LTUS:180:BDES.LOPR") } record(longout, "QUAD:LTUS:180: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, "QUAD:LTUS:180:CHCKBTOL") } record(calc, "QUAD:LTUS:180:TRIMITOL") { field(DESC, "Absolute Trim I Tolerance") field(EGU, "kG") field(CALC, "ABS(A*B)") field(INPA, "QUAD:LTUS:180:POLYCOEF.B") field(INPB, "QUAD:LTUS:180:TRIMBTOL") field(PREC, "9") } record(ai, "QUAD:LTUS:180:TRIMBTOLR") { field(DESC, "Relative trim tol") field(PREC, "4") field(EGU, "%") field(HOPR, "1.0") field(LOPR, "0.0") field(PINI, "YES") } record(ai, "QUAD:LTUS:180: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, "QUAD:LTUS:180:FBCKFCOM") { field(ZNAM, "CA") field(ONAM, "FCOM") field(DESC, "CA Mode") field(PINI, "YES") field(SDIS, "0") } record(bo, "QUAD:LTUS:180:PAU") { field(ZNAM, "NotConfigured") field(ONAM, "Configured") field(DESC, "PAU Present") field(PINI, "YES") field(SDIS, "0") field(FLNK, "QUAD:LTUS:180:PAUGO") } record(fanout, "QUAD:LTUS:180:PAUGO") { field(DESC, "PAU control") field(LNK1, "QUAD:LTUS:180:PAUSTOP") field(LNK2, "QUAD:LTUS:180: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, "QUAD:LTUS:180:PAUSTART") { field(DESC, "Setup for PAU On") field(SDIS, "QUAD:LTUS:180: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, "QUAD:LTUS:180:PAUSTOP") { field(DESC, "Setup for PAU Off") field(SDIS, "QUAD:LTUS:180: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, "QUAD:LTUS:180:MCORDEVNAME") { field(DESC, "PS device name") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, "PSC:LTUS:MG07:") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "QUAD:LTUS:180: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, "QUAD:LTUS:180:PSTYPE.RVAL") field(INPC, "QUAD:LTUS:180:TURNEDOFF.RVAL") field(INPD, "QUAD:LTUS:180:CONFIG.RVAL") field(INPE, "QUAD:LTUS:180:PSCATEGORY.RVAL") field(INPF, "QUAD:LTUS:180:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "QUAD:LTUS:180:AUTOCTRL.RVAL") field(INPJ, "QUAD:LTUS:180:OUTOFSERVICE.RVAL") field(INPL, "QUAD:LTUS:180:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "QUAD:LTUS:180:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "QUAD:LTUS:180:PAU") field(INPP, "QUAD:LTUS:180:CALBDISABLE.RVAL") field(INPQ, "QUAD:LTUS:180:PTRBDISABLE.RVAL") field(INPR, "QUAD:LTUS:180:TRIMDISABLE.RVAL") field(INPS, "QUAD:LTUS:180:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "QUAD:LTUS:180:FBCK") field(INPU, "QUAD:LTUS:180:TRIMTYPE.RVAL") field(INPV, "QUAD:LTUS:180:STDZDIRECT.RVAL") field(INPW, "QUAD:LTUS:180:DEGAUSENABLE.RVAL") field(FLNK, "QUAD:LTUS:180:HSTA") } record(longin, "QUAD:LTUS:180:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "QUAD:LTUS:180:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "QUAD:LTUS:180: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, "QUAD:LTUS:180: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, "QUAD:LTUS:180:CALBDISABLE") { field(DESC, "DAC Calb Disabled") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:180:PTRBDISABLE") { field(DESC, "Perturb Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:180:TRIMDISABLE") { field(DESC, "Trim Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:180: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 QUAD:LTUS:180:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses QUAD:LTUS:180:FBCK. # This PV should be replaced by QUAD:LTUS:180: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, "QUAD:LTUS:180: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, "QUAD:LTUS:180: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, "QUAD:LTUS:180: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, "") field(OMSL, "supervisory") field(FLNK, "QUAD:LTUS:180:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"QUAD:LTUS:180:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "QUAD:LTUS:180:OUTOFSERVICE NPP NMS") field(OUT, "QUAD:LTUS:180:ONLINE PP") } record(bo, "QUAD:LTUS:180:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "QUAD:LTUS:180: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, "1") } record(bo, "QUAD:LTUS:180: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, "1") } record(bo, "QUAD:LTUS:180: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, "QUAD:LTUS:180: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, "QUAD:LTUS:180: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, "QUAD:LTUS:180: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, "QUAD:LTUS:180: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, "QUAD:LTUS:180: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, "1") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:180: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, "1") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:180: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, "2") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:180: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, "0") field(ASG, "NOWRITE") field(FLNK, "QUAD:LTUS:180:TRIMTYPE") } record(stringout, "QUAD:LTUS:180:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "QUAD:LTUS:180:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "QUAD:LTUS:180:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "QUAD:LTUS:180:STATE.RVAL") field(INPB, "QUAD:LTUS:180:INTLKSUMY.RVAL") field(OUT, "QUAD:LTUS:180:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:LTUS:180: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, "QUAD:LTUS:180:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "QUAD:LTUS:180:STATE.RVAL") field(INPB, "QUAD:LTUS:180:INTLKSUMY.RVAL") field(OUT, "QUAD:LTUS:180:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:LTUS:180:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "QUAD:LTUS:180:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "QUAD:LTUS:180: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, "QUAD:LTUS:180:RAMPSTARTDLY") { field(DESC, "Tansition to ramp delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "2") } ######### For PSTYPE=2 Only ############# record(mbbo, "QUAD:LTUS:180: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, "QUAD:LTUS:180: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,"QUAD:LTUS:180: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("QUAD:LTUS:180:TURNEDOFF",3140,1907,0,1,"QUAD:LTUS:180:TURNEDOFF") #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "QUAD:LTUS:180:STATSUB") { field(DESC, "Build STATus ") field(INAM, "mgntInit") field(SNAM, "mgntSlcStat") field(INPA, "QUAD:LTUS:180:BACT.STAT") field(INPB, "QUAD:LTUS:180:BDES.STAT") field(INPC, "QUAD:LTUS:180:IRIPL.STAT") field(INPD, "PSC:LTUS:MG07:ISETPT.STAT") field(INPE, "PSC:LTUS:MG07:IACT.STAT") # 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, "QUAD:LTUS:180:BACT.SEVR") field(INPH, "QUAD:LTUS:180:BDES.SEVR") field(INPI, "QUAD:LTUS:180:IRIPL.SEVR") field(INPJ, "PSC:LTUS:MG07:ISETPT.SEVR") field(INPK, "PSC:LTUS:MG07:IACT.SEVR") # # 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, "QUAD:LTUS:180:STATE.RVAL") field(INPN, "QUAD:LTUS:180:STDZOK") field(INPO, "QUAD:LTUS:180:CALBOK") field(INPP, "QUAD:LTUS:180:OUTOFSERVICE.RVAL") field(INPQ, "QUAD:LTUS:180:CONFIG.RVAL") field(INPR, "QUAD:LTUS:180:HSTA") field(INPS, "QUAD:LTUS:180:CTRL.RVAL") field(INPT, "QUAD:LTUS:180:DEGAUSOK") field(INPV, "QUAD:LTUS:180: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, "QUAD:LTUS:180:STAT") } record(longout, "QUAD:LTUS:180:STAT") { field(DESC, "STAT sent to SLC") field(SCAN, "Passive") field(FLNK, "QUAD:LTUS:180:STATCTRLSUB") field(DOL, "QUAD:LTUS:180:STATSUB.VAL") field(OMSL, "closed_loop") } record(sSub, "QUAD:LTUS:180:STATCTRLSUB") { field(DESC, "Decode SLC STAT into mbbo") field(INAM, "mgntInit") field(SNAM, "mgntStatDecode") field(INPA, "QUAD:LTUS:180:STAT") field(INPB, "QUAD:LTUS:180:HSTA") field(INPD, "QUAD:LTUS:180:ONOFFCTRL.RVAL") field(FLNK, "QUAD:LTUS:180:STATMSG") } record(mbbo, "QUAD:LTUS:180: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, "QUAD:LTUS:180:UNAVAILGO") field(DOL, "QUAD:LTUS:180:STATCTRLSUB.W") } record(seq, "QUAD:LTUS:180:UNAVAILGO") { field(DESC, "Process UNAVAIL") field(DOL1, "QUAD:LTUS:180:STATSUB.U") field(LNK1, "QUAD:LTUS:180:UNAVAIL PP") } record(stringout, "QUAD:LTUS:180:SNLSTATMSG") { field(DTYP, "Soft Channel") } #! TextBox(TB0,820,1000,1200,1220,0,"Dialog",12,1,16777215,"QUAD:LTUS:180:STATUSSUB - future\nOverall device status - takes input from action snls, record sevrs, master snl(s) and outputs final status\n\nInputs:\nA - QUAD:LTUS:180:CTRLSTATUS - snl status\nB - MGNT:CTRLSTATUS - master list status\nC\nD - QUAD:LTUS:180: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,"QUAD:LTUS:180STATSUB\nformat control bo's into slc STAT\n\nInputs:\nA - QUAD:LTUS:180:STATUS\nC - QUAD:LTUS:180:ON\nD - QUAD:LTUS:180:STDZOK\nE - QUAD:LTUS:180:CALBOK\nF - QUAD:LTUS:180:BACTDRIFT (future)\nG -\nH- QUAD:LTUS:180:DACSTATUS\nI -QUAD:LTUS:180:ADCSTATUS\nJ - QUAD:LTUS:180:BACTSTATUS\nK - QUAD:LTUS:180:BDESSTATUS\nL - QUAD:LTUS:180:RIPLSTATUS\n\nOutput:\nP - QUAD:LTUS:180: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, "QUAD:LTUS:180: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, "QUAD:LTUS:180: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, "QUAD:LTUS:180: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, "QUAD:LTUS:180: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.6 #! DBDSTART #! DBD("../../../../dbd/mgntSoft.dbd") #! DBDEND record(stringout, "QUAD:LTUS:180:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:180:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "QUAD:LTUS:180:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "QUAD:LTUS:180:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "QUAD:LTUS:180:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "QUAD:LTUS:180:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "1") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "QUAD:LTUS:180: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, "QUAD:LTUS:180:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "QUAD:LTUS:180:TRIMTYPE.RVAL") field(INPB, "QUAD:LTUS:180:CONFIG.RVAL") field(OUT, "QUAD:LTUS:180:TRIMMAXNUM PP") } record(longout, "QUAD:LTUS:180: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, "QUAD:LTUS:180: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, "") field(OMSL, "supervisory") field(VAL, "20") field(OUT, "QUAD:LTUS:180:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "QUAD:LTUS:180: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, "") field(OMSL, "supervisory") field(VAL, "10") } record(bo, "QUAD:LTUS:180: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, "QUAD:LTUS:180: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, "QUAD:LTUS:180: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, "QUAD:LTUS:180:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "0") } record(ao, "QUAD:LTUS:180: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, "QUAD:LTUS:180:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "QUAD:LTUS:180: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, "QUAD:LTUS:180: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, "QUAD:LTUS:180:IMOVE") field(INPB, "QUAD:LTUS:180:IACT") field(INPC, "QUAD:LTUS:180:IRAMPRATE") field(INPD, "1.577") field(INPE, "QUAD:LTUS:180:TRIMDLYPCT") field(INPF, "QUAD:LTUS:180:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "QUAD:LTUS:180:RAMPTIME_LEFT PP") } record(longout, "QUAD:LTUS:180:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "QUAD:LTUS:180:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "QUAD:LTUS:180:RAMPDONE_CALC") } record(calc, "QUAD:LTUS:180:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "QUAD:LTUS:180:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "QUAD:LTUS:180:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "QUAD:LTUS:180: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, "QUAD:LTUS:180:RAMPTIME_LEFT") field(OUT, "QUAD:LTUS:180:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "QUAD:LTUS:180:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "QUAD:LTUS:180:RAMPTIME_LEFT NMS") field(OUT, "QUAD:LTUS:180:RAMPDONE PP") } record(bo, "QUAD:LTUS:180:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "QUAD:LTUS:180:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "QUAD:LTUS:180: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, "QUAD:LTUS:180: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(sSub, "QUAD:LTUS:180: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, "QUAD:LTUS:180:PSTYPE.RVAL") field(INPC, "QUAD:LTUS:180:TURNEDOFF.RVAL") field(INPD, "QUAD:LTUS:180:CONFIG.RVAL") field(INPE, "QUAD:LTUS:180:PSCATEGORY.RVAL") field(INPF, "QUAD:LTUS:180:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "QUAD:LTUS:180:AUTOCTRL.RVAL") field(INPJ, "QUAD:LTUS:180:OUTOFSERVICE.RVAL") field(INPL, "QUAD:LTUS:180:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "QUAD:LTUS:180:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "QUAD:LTUS:180:PAU") field(INPP, "QUAD:LTUS:180:CALBDISABLE.RVAL") field(INPQ, "QUAD:LTUS:180:PTRBDISABLE.RVAL") field(INPR, "QUAD:LTUS:180:TRIMDISABLE.RVAL") field(INPS, "QUAD:LTUS:180:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "QUAD:LTUS:180:FBCK") field(INPU, "QUAD:LTUS:180:TRIMTYPE.RVAL") field(INPV, "QUAD:LTUS:180:STDZDIRECT.RVAL") field(INPW, "QUAD:LTUS:180:DEGAUSENABLE.RVAL") field(FLNK, "QUAD:LTUS:180:HSTA") } record(longin, "QUAD:LTUS:180:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "QUAD:LTUS:180:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "QUAD:LTUS:180: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, "QUAD:LTUS:180: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, "QUAD:LTUS:180:CALBDISABLE") { field(DESC, "DAC Calb Disabled") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:180:PTRBDISABLE") { field(DESC, "Perturb Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:180:TRIMDISABLE") { field(DESC, "Trim Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:180:STDZDISABLE") { field(DTYP, "Raw Soft Channel") field(ZNAM, "NO") field(ONAM, "YES") field(DESC, "Standardize Function") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } # This PV has been replaced by QUAD:LTUS:180:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses QUAD:LTUS:180:FBCK. # This PV should be replaced by QUAD:LTUS:180: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, "QUAD:LTUS:180: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, "QUAD:LTUS:180: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, "QUAD:LTUS:180: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, "") field(OMSL, "supervisory") field(FLNK, "QUAD:LTUS:180:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"QUAD:LTUS:180:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "QUAD:LTUS:180:OUTOFSERVICE NPP NMS") field(OUT, "QUAD:LTUS:180:ONLINE PP") } record(bo, "QUAD:LTUS:180:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "QUAD:LTUS:180: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, "1") } record(bo, "QUAD:LTUS:180: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, "1") } record(bo, "QUAD:LTUS:180: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, "QUAD:LTUS:180: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, "QUAD:LTUS:180: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, "QUAD:LTUS:180: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, "QUAD:LTUS:180: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, "QUAD:LTUS:180: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, "1") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:180: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, "1") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:180: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, "2") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:180: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, "2") field(ASG, "NOWRITE") field(FLNK, "QUAD:LTUS:180:TRIMTYPE") } record(stringout, "QUAD:LTUS:180:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "QUAD:LTUS:180:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "QUAD:LTUS:180:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "QUAD:LTUS:180:STATE.RVAL") field(INPB, "QUAD:LTUS:180:INTLKSUMY.RVAL") field(OUT, "QUAD:LTUS:180:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:LTUS:180: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, "QUAD:LTUS:180:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "QUAD:LTUS:180:STATE.RVAL") field(INPB, "QUAD:LTUS:180:INTLKSUMY.RVAL") field(OUT, "QUAD:LTUS:180:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:LTUS:180:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "QUAD:LTUS:180:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "QUAD:LTUS:180: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, "QUAD:LTUS:180:RAMPSTARTDLY") { field(DESC, "Tansition to ramp delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "2") } ######### For PSTYPE=2 Only ############# record(mbbo, "QUAD:LTUS:180: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, "QUAD:LTUS:180: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,"QUAD:LTUS:180: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("QUAD:LTUS:180:TURNEDOFF",3140,1907,0,1,"QUAD:LTUS:180:TURNEDOFF") #! 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, "QUAD:LTUS:235:IACT") { field(DESC, "Current") field(INP, "PSC:LTUS:MG25:IACT") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "QUAD:LTUS:235:BACT") info(autosaveFields,"HYST") } record(bi, "QUAD:LTUS:235:STATE") { field(DESC, "PS On/Off Status") field(DTYP, "Raw Soft Channel") field(INP, "PSC:LTUS:MG25:STATE NPP MS") field(ZSV, "MAJOR") field(ZNAM, "OFF") field(ONAM, "ON") } record(ao, "QUAD:LTUS:235:IDES") { field(DESC, "Desired Current") field(PREC, "3") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(MDEL, "-1") field(HIHI, "165.0") field(LOLO, "0.0") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "QUAD:LTUS:235:BDELTAS") field(DRVH, "165.0") field(DRVL, "0.0") field(DOL, "QUAD:LTUS:235: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, "QUAD:LTUS:235:ICTRL PP") } # This record is processed by QUAD:LTUS:235:ICON") # Note: we are not setting alarms here. record(ao, "QUAD:LTUS:235:ICON") { field(DESC, "Config I") field(DTYP, "Soft Channel") field(PREC, "3") field(HOPR, "165.0") field(LOPR, "0.0") field(DRVH, "165.0") field(DRVL, "0.0") field(DOL, "QUAD:LTUS:235:B2ICON.K") field(OMSL, "closed_loop") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:235:INOM") { field(DESC, "Nominal Current") field(DOL, "QUAD:LTUS:235:BNOM.K") field(OMSL, "closed_loop") field(PREC, "3") field(EGU, "A") field(DRVH, "165.0") field(DRVL, "0.0") field(HOPR, "165.0") field(LOPR, "0.0") } record(ao, "QUAD:LTUS:235:ICTRL") { field(DESC, "Set Current") field(PREC, "3") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(DRVH, "165.0") field(DRVL, "0.0") field(MDEL, "-1") field(FLNK, "QUAD:LTUS:235:ICTRLGO") field(OMSL, "supervisory") info(autosavefields,"VAL") } record(seq, "QUAD:LTUS:235:ICTRLGO") { field(DESC, "Process Current Setpoint") field(PREC, "3") # Set ISETPT to supervisory field(DOL1, "0") field(LNK1, "QUAD:LTUS:235:ISETPT.OMSL") field(DOL2, "QUAD:LTUS:235:ICTRL") field(LNK2, "QUAD:LTUS:235:ISETPT PP") # Set ISETPT to closed loop - get data from BCTRLSUB.K field(DOL3, "1") field(LNK3, "QUAD:LTUS:235:ISETPT.OMSL") } record(ao, "QUAD:LTUS:235:IMAX") { field(DESC, "Max I") field(DTYP, "Soft Channel") field(DRVH, "165.0") field(DRVL, "0.0") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(PREC, "3") field(PINI, "YES") field(VAL, "165.0") field(FLNK, "QUAD:LTUS:235:IMIN") } record(ao, "QUAD:LTUS:235:IMIN") { field(DESC, "Min I") field(DTYP, "Soft Channel") field(DRVH, "165.0") field(DRVL, "0.0") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(PREC, "3") field(VAL, "0.0") field(FLNK, "QUAD:LTUS:235:IRANGE") } record(sel, "QUAD:LTUS:235:IACTPREVOK") { field(DESC, "Last Good Current") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(PREC, "3") field(NVL, "QUAD:LTUS:235:BACT.SEVR") field(INPA, "QUAD:LTUS:235:IACT NPP MS") field(INPB, "QUAD:LTUS:235:IACTPREVOK NPP MS") field(INPC, "QUAD:LTUS:235:IACTPREVOK NPP MS") field(INPD, "QUAD:LTUS:235:IACTPREVOK NPP MS") } record(sub, "QUAD:LTUS:235:IACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:235:IDES") field(INPB, "QUAD:LTUS:235:ISETPT.DRVH") field(INPC, "QUAD:LTUS:235:ISETPT.DRVL") field(INPD, "QUAD:LTUS:235:IDELTAS.I") field(INPE, "QUAD:LTUS:235:IDELTAS.J") field(INPG, "QUAD:LTUS:235:STATE") field(INPH, "QUAD:LTUS:235:HSTA") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(sub, "QUAD:LTUS:235:IMONLIMITS") { field(DESC, "Aux Current Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:235:IDES") field(INPB, "QUAD:LTUS:235:ISETPT.DRVH") field(INPC, "QUAD:LTUS:235:ISETPT.DRVL") field(INPD, "QUAD:LTUS:235:IDELTAS.K") field(INPE, "QUAD:LTUS:235:IDELTAS.L") field(INPG, "QUAD:LTUS:235:STATE") field(INPH, "QUAD:LTUS:235:HSTA") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(seq, "QUAD:LTUS:235:ILIMITS") { field(DESC, "Set ACT and MON Limits") field(PREC, "3") field(DOL1, "QUAD:LTUS:235:BLIMITS") field(LNK1, "QUAD:LTUS:235:IACTLIMITS.F PP") field(DOL2, "QUAD:LTUS:235:IACTLIMITS.I") field(LNK2, "QUAD:LTUS:235:IACT.HIGH") field(DOL3, "QUAD:LTUS:235:IACTLIMITS.J") field(LNK3, "QUAD:LTUS:235:IACT.LOW") field(DOL4, "QUAD:LTUS:235:IACTLIMITS.K") field(LNK4, "QUAD:LTUS:235:IACT.HIHI") field(DOL5, "QUAD:LTUS:235:IACTLIMITS.L") field(LNK5, "QUAD:LTUS:235:IACT.LOLO") field(DOL6, "QUAD:LTUS:235:BLIMITS") field(LNK6, "QUAD:LTUS:235:IMONLIMITS.F PP") field(DOL7, "QUAD:LTUS:235:IMONLIMITS.I") field(LNK7, "QUAD:LTUS:235:IMON.HIGH") field(DOL8, "QUAD:LTUS:235:IMONLIMITS.J") field(LNK8, "QUAD:LTUS:235:IMON.LOW") field(DOL9, "QUAD:LTUS:235:IMONLIMITS.K") field(LNK9, "QUAD:LTUS:235:IMON.HIHI") field(DOLA, "QUAD:LTUS:235:IMONLIMITS.L") field(LNKA, "QUAD:LTUS:235: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, "QUAD:LTUS:235:IDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntRawDeltas") field(INPD, "QUAD:LTUS:235:TRIMBTOL") field(INPE, "QUAD:LTUS:235:CHCKBTOL") field(INPF, "QUAD:LTUS:235:BDELTAS.K") field(INPG, "QUAD:LTUS:235:BDELTAS.L") field(INPH, "QUAD:LTUS:235: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, "QUAD:LTUS:235:STDZITOLR") field(INPC, "QUAD:LTUS:235:STDZITOL") field(FLNK, "") } # All ps controllers with on/off control will set the macro ONOF # as follows: # # ONOF = PSC:LTUS:MG25: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, "QUAD:LTUS:235:STATESETPT") { field(DESC, "PS On/Off") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFF") field(ONAM, "ON") field(OUT, "PSC:LTUS:MG25:STATESETPT PP") 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 = PSC:LTUS:MG25:RESET PP # record(bo, "QUAD:LTUS:235:RESET") { field(DESC, "Interlock Latch Reset") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFF") field(ONAM, "ON") field(HIGH, "1.0") field(OUT, "PSC:LTUS:MG25:RESET PP") } record(bo, "QUAD:LTUS:235:RAMPSTATE") { field(DESC, "PS Ramp Status") field(DTYP, "Soft Channel") field(DOL, "PSC:LTUS:MG25:RAMPSTATE NPP 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, "QUAD:LTUS:235: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, "QUAD:LTUS:235:TRIMRAMPRATE") field(OUT, "PSC:LTUS:MG25:IRAMPRATE PP") field(FLNK, "QUAD:LTUS:235:STDZDLY") } record(ao, "QUAD:LTUS:235:ISETPT") { field(DESC, "Current Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(DRVH, "165.0") field(DRVL, "0.0") field(MDEL, "-1") field(OUT, "PSC:LTUS:MG25:ISETPT PP") field(DOL, "QUAD:LTUS:235: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, "QUAD:LTUS:235:IMON") { field(DESC, "Aux Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(INP, "PSC:LTUS:MG25:IMON") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "QUAD:LTUS:235:BMON") } record(ao, "QUAD:LTUS:235:IRIPL") { field(DESC, "Ripple Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(DOL, "PSC:LTUS:MG25:IRIPL NPP NMS") field(OMSL, "closed_loop") field(EGU, "A") field(DRVH, "1.0") field(HOPR, "1.0") field(PREC, "3") field(FLNK, "QUAD:LTUS:235:IRIPLOK") } record(sub, "QUAD:LTUS:235:IRIPLOK") { field(DESC, "Ripple Current Status") field(INAM, "mgntInit") field(SNAM, "mgntRiplOK") field(INPA, "QUAD:LTUS:235:IRIPL.VAL") field(INPB, "QUAD:LTUS:235: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, "QUAD:LTUS:235:R") { field(DESC, "Resistance") field(EGU, "Ohms") field(PREC, "4") field(PINI, "YES") field(DOL, "PSC:LTUS:MG25:R NPP MS") 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, "QUAD:LTUS:235:IGND") { field(DESC, "Ground Current") field(EGU, "A") field(PREC, "6") field(PINI, "YES") field(DOL, "PSC:LTUS:MG25:IGND NPP MS") field(OMSL, "closed_loop") } record(bi, "QUAD:LTUS:235:INTLKSUMY") { field(DESC, "Interlock Summary") field(INP, "PSC:LTUS:MG25:INTLKSUMY NPP MS") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(ZNAM, "OK") field(ONAM, "FAULT") field(PINI, "NO") } record(mbbo, "QUAD:LTUS:235: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, "PSC:LTUS:MG25:COOLING") field(OMSL, "closed_loop") } # The following PV is processed by :BACTFO # which is processed by :BACT record(fanout, "QUAD:LTUS:235:IACTFO") { field(DESC, "IACT processing") field(SELM, "All") field(LNK1, "QUAD:LTUS:235:IACTPREVOK") field(LNK2, "QUAD:LTUS:235:IDIFF") field(LNK3, "QUAD:LTUS:235:IADIFF") field(LNK4, "QUAD:LTUS:235:IRATIO") field(LNK5, "QUAD:LTUS:235:IDIRECT") field(LNK6, "QUAD:LTUS:235:IACTPOL_CHECK") } record(calc, "QUAD:LTUS:235:IDIFF") { field(DESC, "IDES-IACT") field(CALC, "A-B") field(INPA, "QUAD:LTUS:235:IDES") field(INPB, "QUAD:LTUS:235:IACT") field(EGU, "A") field(PREC, "9") field(HOPR, "165.0") field(LOPR, "0.0") } record(calc, "QUAD:LTUS:235:IADIFF") { field(DESC, "Absolute IDES-IACT") field(CALC, "A<0?ABS(A):A") field(INPA, "QUAD:LTUS:235:IDIFF") field(PREC, "9") } record(calc, "QUAD:LTUS:235:IRATIO") { field(DESC, "IDES-IACT/IMAX") field(CALC, "B?A/B:0") field(INPA, "QUAD:LTUS:235:IDIFF") field(INPB, "QUAD:LTUS:235:IDES.DRVH") field(PREC, "9") } record(calcout, "QUAD:LTUS:235:IRANGE") { field(DESC, "Current Range") field(PINI, "YES") field(CALC, "ABS(A-B)") field(INPA, "QUAD:LTUS:235:IMIN") field(INPB, "QUAD:LTUS:235: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, "QUAD:LTUS:235: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, "QUAD:LTUS:235:IACT") field(FLNK, "QUAD:LTUS:235:IACTPOL") } record(bo, "QUAD:LTUS:235:IACTPOL") { field(DESC, "Actual I Polarity") field(DTYP, "Raw Soft Channel") field(DOL, "QUAD:LTUS:235: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,"QUAD:LTUS:235:I*LIMITS:\n Calculate alarm and warning limits based on \n deltas from QUAD:LTUS:235:IDELTAS and the\n QUAD:LTUS:235: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,"QUAD:LTUS:235:IACT: \n Get copy of QUAD:LTUS:235:I. \n",null) #! TextBox(TB12,1280,3100,1760,3200,0,"Dialog",12,1,16777215,"QUAD:LTUS:235: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,"QUAD:LTUS:235:IDES:\n Contains raw value calculated by \nQUAD:LTUS:235: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 \nQUAD:LTUS:235:BDELTAS.\n",null) #! TextBox(TB10,56,1940,316,2340,0,"Dialog",12,1,16777215,"QUAD:LTUS:235: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 QUAD:LTUS:235: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 QUAD:LTUS:235: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,"QUAD:LTUS:235:ISETPT:\n Sets the hardware. When fast feedback is set on, this record is\n set to closed loop mode by QUAD:LTUS:235:FBCKSTART sequence. When \n the loop is closed, this record takes input calculated by \n BFBCK only. When fast feedback is set off, QUAD:LTUS:235:FBCKSTOP \n will set it back to supervisory so that the value can be set by \n QUAD:LTUS:235: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, "QUAD:LTUS:235:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:235:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "QUAD:LTUS:235:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "QUAD:LTUS:235:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "QUAD:LTUS:235:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "QUAD:LTUS:235:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "1") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "QUAD:LTUS:235: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, "QUAD:LTUS:235:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "QUAD:LTUS:235:TRIMTYPE.RVAL") field(INPB, "QUAD:LTUS:235:CONFIG.RVAL") field(OUT, "QUAD:LTUS:235:TRIMMAXNUM PP") } record(longout, "QUAD:LTUS:235: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, "QUAD:LTUS:235: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, "") field(OMSL, "supervisory") field(VAL, "10") field(OUT, "QUAD:LTUS:235:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "QUAD:LTUS:235: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, "") field(OMSL, "supervisory") field(VAL, "10") } record(bo, "QUAD:LTUS:235: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, "QUAD:LTUS:235: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, "QUAD:LTUS:235: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, "QUAD:LTUS:235:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "0") } record(ao, "QUAD:LTUS:235: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, "QUAD:LTUS:235:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "QUAD:LTUS:235: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, "QUAD:LTUS:235: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, "QUAD:LTUS:235:IMOVE") field(INPB, "QUAD:LTUS:235:IACT") field(INPC, "QUAD:LTUS:235:IRAMPRATE") field(INPD, "1.577") field(INPE, "QUAD:LTUS:235:TRIMDLYPCT") field(INPF, "QUAD:LTUS:235:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "QUAD:LTUS:235:RAMPTIME_LEFT PP") } record(longout, "QUAD:LTUS:235:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "QUAD:LTUS:235:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "QUAD:LTUS:235:RAMPDONE_CALC") } record(calc, "QUAD:LTUS:235:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "QUAD:LTUS:235:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "QUAD:LTUS:235:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "QUAD:LTUS:235: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, "QUAD:LTUS:235:RAMPTIME_LEFT") field(OUT, "QUAD:LTUS:235:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "QUAD:LTUS:235:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "QUAD:LTUS:235:RAMPTIME_LEFT NMS") field(OUT, "QUAD:LTUS:235:RAMPDONE PP") } record(bo, "QUAD:LTUS:235:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "QUAD:LTUS:235:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "QUAD:LTUS:235: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, "QUAD:LTUS:235: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, "QUAD:LTUS:235:STDZINIT") { field(DESC, "Proc. Stdz PVs on boot") field(PINI, "YES") field(DOL1, "1") field(DOL2, "1") field(DOL3, "1") field(LNK1, "QUAD:LTUS:235:DEBUG.PROC PP") field(LNK2, "QUAD:LTUS:235:STDZCYCLENUM.PROC PP") field(LNK3, "QUAD:LTUS:235:STDZDISABLE.PROC PP") field(LNK4, "QUAD:LTUS:235: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, "QUAD:LTUS:235:STDZSUB") { field(DESC, "Stdz subroutine") field(INAM, "mgntStdzInit") field(SNAM, "mgntStdz") field(BRSV, "INVALID") field(INPA, "QUAD:LTUS:235:STDZIMIN NPP NMS") field(INPB, "QUAD:LTUS:235:STDZIMAX NPP NMS") field(INPC, "QUAD:LTUS:235:STDZIFINAL NPP NMS") field(INPD, "QUAD:LTUS:235:STDZCYCLENUM NPP NMS") field(INPE, "QUAD:LTUS:235:STDZDIRECT.RVAL NPP NMS") field(INPF, "QUAD:LTUS:235:STDZDISABLE.RVAL CPP NMS") field(INPG, "QUAD:LTUS:235: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, "QUAD:LTUS:235:STDZWF PP") field(OUTB, "QUAD:LTUS:235: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, "QUAD:LTUS:235:STDZWF") } record(mbbo, "QUAD:LTUS:235: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, "QUAD:LTUS:235: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, "QUAD:LTUS:235:STDZMAINPS") { field(DESC, "Stdz by main or self") field(PINI, "YES") field(DTYP, "Soft Channel") field(ZNAM, "SELF") field(ONAM, "MAIN") } record(bo, "QUAD:LTUS:235: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, "QUAD:LTUS:235: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, "QUAD:LTUS:235: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, "QUAD:LTUS:235:STDZTOD") { field(DESC, "Successful Standardize Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "QUAD:LTUS:235:STDZLOSTTOD") { field(DESC, "Standardize Lost Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(longout, "QUAD:LTUS:235:STDZCYCLECNT") { field(DESC, "Cycle Count") field(PINI, "YES") } record(longout, "QUAD:LTUS:235:STDZCYCLENUM") { field(DESC, "No. Standardize Cycles") field(VAL, "3") field(HOPR, "10") field(LOPR, "0") field(DRVH, "10") field(DRVL, "0") field(PINI, "YES") field(FLNK, "QUAD:LTUS:235:STDZDIRECT") } # The default standardize direction is "UP" for # all LCLS Magnets.. record(bo, "QUAD:LTUS:235:STDZDIRECT") { field(DESC, "Standardize Direction ") field(ZNAM, "UP") field(ONAM, "DOWN") field(VAL, "0") field(FLNK, "QUAD:LTUS:235:STDZIMIN") } record(ao, "QUAD:LTUS:235:STDZIMIN") { field(DESC, "Min-STDZ Current") field(PREC, "1") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(VAL, "0.0") field(FLNK, "QUAD:LTUS:235:STDZIMAX") } record(ao, "QUAD:LTUS:235:STDZIMAX") { field(DESC, "Max. Standarize Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(VAL, "165.0") field(FLNK, "QUAD:LTUS:235:STDZIFINAL") } record(ao, "QUAD:LTUS:235:STDZIFINAL") { field(DESC, "Final SDTZ Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(VAL, "0.0") field(FLNK, "QUAD:LTUS:235: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, "QUAD:LTUS:235: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, "QUAD:LTUS:235:STDZITOL") { field(DESC, "Stdz min tolerance") field(PREC, "5") field(CALC, "MAX(ABS(A),ABS(B))*C") field(INPA, "QUAD:LTUS:235:STDZIMIN CP NMS") field(INPB, "QUAD:LTUS:235:STDZIMAX CP MMS") field(INPC, "0.05") field(INPD, "QUAD:LTUS:235:STDZITOLR CP MMS") field(EGU, "A") field(FLNK, "QUAD:LTUS:235:IDELTAS") field(PINI, "YES") } # D - factor (3.154/2 = 1.577) for EPSC, otherwise, set to 1.0 record(calc, "QUAD:LTUS:235:STDZDLY") { field(DESC, "Ramp time for stdz cycle") field(CALC, "C>0?MAX(1,ABS((A-B)/C)*D):0") field(INPA, "QUAD:LTUS:235:STDZIMIN CP NMS") field(INPB, "QUAD:LTUS:235:STDZIMAX CP NMS") field(INPC, "QUAD:LTUS:235:TRIMRAMPRATE CP NMS") field(INPD, "1.577") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") } record(calc, "QUAD:LTUS:235:STDZRAMPDLY") { field(DESC, "Ramp delay total") field(CALC, "MAX(1,((A/100)*B+B))") field(PREC, "5") field(INPA, "QUAD:LTUS:235:TRIMDLYPCT CP MS") field(INPB, "QUAD:LTUS:235: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, "QUAD:LTUS:235:STDZMINIDLY") { field(DESC, "Mini-stdz delay") field(CALC, "A") field(PREC, "5") field(A, "1.0") field(EGU, "sec") field(PINI, "YES") } record(ao, "QUAD:LTUS:235: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, "QUAD:LTUS:235:STDZMINIDELTA") { field(DESC, "Stdz mini % of IMAX") field(CALC, "(B/100)*(A-C)") field(INPA, "QUAD:LTUS:235:IDES.HOPR") field(INPB, "QUAD:LTUS:235:STDZMINIPCT CPP NMS") field(INPC, "QUAD:LTUS:235:IDES.LOPR") field(PREC, "5") } record(calc, "QUAD:LTUS:235:STDZMINISETPT") { field(DESC, "Mini Stdz delta") field(CALC, "C==0?MAX(E-D,B):MIN(E+D,A)") field(INPA, "QUAD:LTUS:235:IDES.HOPR") field(INPB, "QUAD:LTUS:235:IDES.LOPR") field(INPC, "QUAD:LTUS:235:STDZDIRECT.RVAL") field(INPD, "QUAD:LTUS:235:STDZMINIDELTA") field(INPE, "QUAD:LTUS:235:IDES") field(PREC, "5") field(FLNK, "QUAD:LTUS:235: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, "QUAD:LTUS:235:STDZMINISETPTOOR") { field(DESC, "Mini Stdz setpoint out of range") field(CALC, "C==0?(E-DA)") field(INPA, "QUAD:LTUS:235:IDES.HOPR") field(INPB, "QUAD:LTUS:235:IDES.LOPR") field(INPC, "QUAD:LTUS:235:STDZDIRECT.RVAL") field(INPD, "QUAD:LTUS:235:STDZMINIDELTA") field(INPE, "QUAD:LTUS:235: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, "QUAD:LTUS:235: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, "QUAD:LTUS:235:IADJUST.RVAL") field(INPB, "QUAD:LTUS:235:STDZDIRECT.RVAL") field(INPC, "QUAD:LTUS:235:STDZOK.RVAL") field(INPD, "QUAD:LTUS:235:STDZDISABLE.RVAL") field(INPE, "QUAD:LTUS:235:STATE.RVAL CPP NMS") field(INPF, "QUAD:LTUS:235:ICTRL.RVAL") field(INPG, "QUAD:LTUS:235:STATE.SEVR") field(INPH, "QUAD:LTUS:235:BDELTAS.M") field(INPI, "QUAD:LTUS:235:IACT.SEVR") field(OUT, "QUAD:LTUS:235:STDZLOSTGO.SELN PP NMS") field(OOPT, "Transition To Non-zero") } record(seq, "QUAD:LTUS:235:STDZLOSTGO") { field(DESC, "Process lost stdz") field(SELM, "Mask") field(DOL1, "1") field(DOL2, "0") field(LNK1, "QUAD:LTUS:235:STDZLOSTTOD.PROC") field(LNK2, "QUAD:LTUS:235:STDZOK PP") } # Record maximum current after standardize # Reset to IACT from sequence after trim # Disable processing during (mini-)standardize or trim record(calc, "QUAD:LTUS:235:STDZIACTMAX") { field(DESC, "Max act current after stdz") field(CALC, "MAX(A, B)") field(DISV, "0") field(SDIS, "QUAD:LTUS:235:CHECKPWRDIP_ENABLE") field(INPA, "QUAD:LTUS:235:IACT CP") field(INPB, "QUAD:LTUS:235:STDZIACTMAX") field(EGU, "A") field(FLNK, "QUAD:LTUS:235:CHECKPWRDIP") } # Detect power dip if STDZOK is YES, STDZ is enabled, and IACT is valid # If IACT drops below STDZIACTMAX by more than the trim tolerance, clear STDZOK # Warning: Take the absolute value of the trim tolerance, or else quads of # negative polarity will always lose STDZ since their IDELTAS.I are negative. # Note: Large quads and bends are prone to losing STDZ even if they are # perturbed toward higher current since their current tends to overshoot # by greater than the trim tolerance before settling down. record(calcout, "QUAD:LTUS:235:CHECKPWRDIP") { field(DESC, "Detect power dip") field(CALC, "(A-B>ABS(C))?3:0") field(DISV, "0") field(SDIS, "QUAD:LTUS:235:CHECKPWRDIP_ENABLE") field(INPA, "QUAD:LTUS:235:STDZIACTMAX") field(INPB, "QUAD:LTUS:235:IACT") field(INPC, "QUAD:LTUS:235:IDELTAS.I") field(OUT, "QUAD:LTUS:235:STDZLOSTGO.SELN PP NMS") field(OOPT, "When Non-zero") } # Enable processing of STDZIACTMAX and CHECKPWRDIP only if # STDZOK = YES, STDZDISABLE = NO, CTRL != Trim (2), and # CTRL != Stdz (4) record(calc, "QUAD:LTUS:235:CHECKPWRDIP_ENABLE") { field(CALC, "A&&!B&&(C#2)&&(C#4)") field(INPA, "QUAD:LTUS:235:STDZOK.RVAL CP") field(INPB, "QUAD:LTUS:235:STDZDISABLE.RVAL CP") field(INPC, "QUAD:LTUS:235:CTRL.RVAL CP") } #! 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, "QUAD:LTUS:235: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, "QUAD:LTUS:235:CALBOK") { field(DESC, "Successful Calibration") field(DTYP, "Raw Soft Channel") field(ZNAM, "NO") field(ONAM, "YES") field(DOL, "PSC:LTUS:MG25:CALBOK.RVAL") field(OMSL, "closed_loop") 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, "QUAD:LTUS:235:CALBSET") { field(DESC, "Use DAC Calbration") field(SCAN, "10 second") field(CALC, "A&&(B==0)&&C?31:960") field(INPA, "QUAD:LTUS:235:CALBOK") field(INPB, "QUAD:LTUS:235:CALBDISABLE") field(INPC, "QUAD:LTUS:235:CALBSLOPE") field(OOPT, "On Change") field(OUT, "QUAD:LTUS:235: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, "QUAD:LTUS:235:CALB_SEQ") { field(DESC, "Output Calib Values") field(SELM, "Mask") field(SELL, "QUAD:LTUS:235: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, "QUAD:LTUS:235:CALBSLOPE") field(DOL3, "QUAD:LTUS:235: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, "QUAD:LTUS:235:CALBTOD") { field(DESC, "Calibration Success Time") field(PINI, "YES") field(DOL, "PSC:LTUS:MG25:CALBTOD") field(OMSL, "closed_loop") field(DTYP, "Soft Channel") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:235: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, "QUAD:LTUS:235: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, "QUAD:LTUS:235: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, "QUAD:LTUS:235:CALBOFFSET") { field(DESC, "Calc DAC Offset") field(PREC, "6") field(EGU, "Counts") field(PINI, "YES") } record(bo, "QUAD:LTUS:235: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, "QUAD:LTUS:235:DACSLOPE") { field(DESC, "V to DAC slope") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "closed_loop") field(PINI, "YES") field(FLNK, "QUAD:LTUS:235:DACOFFSET") } # Default Offset used in conversion from Volts to DAC Counts record(ao, "QUAD:LTUS:235:DACOFFSET") { field(DESC, "V to DAC offset") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "closed_loop") field(PINI, "YES") field(FLNK, "QUAD:LTUS:235: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, "QUAD:LTUS:235: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, "QUAD:LTUS:235:IACT") field(INPD, "QUAD:LTUS:235:DACSLOPE") field(INPE, "QUAD:LTUS:235:DACOFFSET") field(EGU, "Counts") field(PREC, "6") } record(ao, "QUAD:LTUS:235:DAC") { field(DESC, "DAC Set point") field(EGU, "Counts") field(DOL, "") field(OMSL, "closed_loop") field(PREC, "6") field(PINI, "YES") } record(ao, "QUAD:LTUS:235:CALBIMIN") { field(DESC, "Calibration Min Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(DRVH, "165.0") field(HOPR, "165.0") field(DRVL, "0.0") field(LOPR, "0.0") field(PREC, "3") field(EGU, "A") field(VAL, "0.0") field(FLNK, "QUAD:LTUS:235:CALBIMAX") } record(ao, "QUAD:LTUS:235:CALBIMAX") { field(DESC, "Calibration Max Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(DRVH, "165.0") field(HOPR, "165.0") field(LOPR, "0.0") field(DRVL, "0.0") field(EGU, "A") field(VAL, "165.0") field(FLNK, "QUAD:LTUS:235:CALBSTEPNUM") } record(ao, "QUAD:LTUS:235:CALBIFINAL") { field(DESC, "Calibration Last Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(PREC, "3") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(VAL, "0") } record(longout, "QUAD:LTUS:235: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, "QUAD:LTUS:235:CALBIDELTA") } record(calc, "QUAD:LTUS:235:CALBIDELTA") { field(DESC, "Step size for CALB") field(CALC, "C=0?0:ABS((A-B)/C)") field(INPA, "QUAD:LTUS:235:CALBIMAX") field(INPB, "QUAD:LTUS:235:CALBIMIN") field(INPC, "QUAD:LTUS:235: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, "QUAD:LTUS:235:CALBIMULT") { field(DESC, "IACT vs ISETPT mult") field(CALC, "C#0||A=0?1:ABS(B/A)") field(INPA, "PSC:LTUS:MG25:ISETPT.DRVH") field(INPB, "PSC:LTUS:MG25:IACT.HOPR") field(INPC, "QUAD:LTUS:235:PSCONTROLLER.RVAL CPP") field(EGU, "A") field(PINI, "YES") } # SNL dbputs DAC values here. 6-10 steps are possible. record(waveform, "QUAD:LTUS:235:CALBICTRLWF") { field(DESC, "ICTRL setpoint array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") } record(waveform, "QUAD:LTUS:235:DACWF") { field(DESC, "DAC count array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:235:DACSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:235:DACSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "QUAD:LTUS:235: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, "QUAD:LTUS:235:CALCDACWF") { field(DESC, "Calc DAC counts array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:235:CALCDACSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:235:CALCDACSA") { field(DESC, "Calc DAC counts") field(DTYP, "Soft Channel") field(INP, "QUAD:LTUS:235: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, "QUAD:LTUS:235:CALBYWF") { field(DESC, "mx + b") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:235:CALBYSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:235:CALBYSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "QUAD:LTUS:235:CALBYWF") field(MALM, "10") field(NELM, "6") field(INDX, "0") field(FTVL, "DOUBLE") } record(waveform, "QUAD:LTUS:235:CALBIACTWF") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:235:CALBIACTSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:235:CALBIACTSA") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(MALM, "10") field(NELM, "6") field(INP, "QUAD:LTUS:235:CALBIACTWF") field(INDX, "0") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:235:CALBLIMITS") } # Check that measured current during calibration is within # tolerance. record(aSub, "QUAD:LTUS:235: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, "QUAD:LTUS:235:CALBSTEPNUM") field(INPB, "QUAD:LTUS:235:CALBIACTWF") field(INPC, "QUAD:LTUS:235: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, "QUAD:LTUS:235: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, "QUAD:LTUS:235:STDZITOL") field(INPH, "QUAD:LTUS:235:DACSLOPE") field(INPI, "QUAD:LTUS:235: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, "QUAD:LTUS:235: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, "QUAD:LTUS:235:CALBSTEPNUM") field(INPB, "QUAD:LTUS:235:CALBIACTWF") field(INPC, "QUAD:LTUS:235:DACWF") field(INPF, "QUAD:LTUS:235: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 QUAD:LTUS:235CALBOK 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, "QUAD:LTUS:235:DEGAUSINIT") { field(DESC, "Proc. Degauss PVs on boot") field(PINI, "YES") field(DOL, "1") field(OUTA, "QUAD:LTUS:235:DEGAUSIMIN.PROC PP") field(OUTB, "QUAD:LTUS:235:DEGAUSIMAX.PROC PP") field(OUTC, "QUAD:LTUS:235:DEGAUSTYPE.PROC PP") field(OUTD, "QUAD:LTUS:235:DEGAUSSTEP.PROC PP") field(OUTE, "QUAD:LTUS:235:MADNAME.PROC PP") field(OUTF, "QUAD:LTUS:235:PSTYPE.PROC PP") field(OUTG, "QUAD:LTUS:235: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, "QUAD:LTUS:235:DEGAUSSUB") { field(DESC, "Degauss subroutine") field(INAM, "mgntDegaussInit") field(SNAM, "mgntDegauss") field(BRSV, "INVALID") field(INPA, "QUAD:LTUS:235:DEGAUSIMIN NPP NMS") field(INPB, "QUAD:LTUS:235:DEGAUSIMAX NPP NMS") field(INPC, "QUAD:LTUS:235:DEGAUSTYPE.RVAL NPP NMS") field(INPE, "QUAD:LTUS:235:DEGAUSMETHOD.RVAL NPP NMS") field(INPF, "QUAD:LTUS:235:PSTYPE NPP NMS") field(INPG, "QUAD:LTUS:235:DEBUG.RVAL NPP NMS") field(INPH, "QUAD:LTUS:235: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, "QUAD:LTUS:235:DEGAUSWF PP") field(OUTB, "QUAD:LTUS:235:DEGAUSMSG PP") field(OUTC, "QUAD:LTUS:235: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, "QUAD:LTUS:235:DEGAUSWF") { field(DESC, "Degauss Setpts") field(NELM, "60") field(FTVL, "DOUBLE") } record(mbbo,"QUAD:LTUS:235: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, "QUAD:LTUS:235: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, "QUAD:LTUS:235: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, "QUAD:LTUS:235: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, "QUAD:LTUS:235: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, "QUAD:LTUS:235:DEGAUSIMIN") { field(DESC, "Min. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "165.0") field(LOPR, "-165.0") field(DRVH, "165.0") field(DRVL, "-165.0") field(VAL, "-165.0") } record(ao, "QUAD:LTUS:235:DEGAUSIMAX") { field(DESC, "Max. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "165.0") field(LOPR, "-165.0") field(DRVH, "165.0") field(DRVL, "-165.0") field(VAL, "165.0") } # 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,"QUAD:LTUS:235: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, "QUAD:LTUS:235: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,"QUAD:LTUS:235: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, "QUAD:LTUS:235: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, "QUAD:LTUS:235: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, "QUAD:LTUS:235: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, "QUAD:LTUS:235:DEGAUSTOD") { field(DESC, "Successful Degauss Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "QUAD:LTUS:235:DEGAUSLOSTTOD") { field(DESC, "Degauss Lost Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:235:DEGAUSTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "QUAD:LTUS:235:DEGAUSTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "QUAD:LTUS:235: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, "QUAD:LTUS:235:DEGAUSGO") { field(DESC, "Set bdes of btrms to zero") field(ASG, "Internal") field(OUTA, "") field(OUTB, "") field(OUTC, "") field(OUTD, "") } # =========== CRYO ONLY =========== record(bo, "QUAD:LTUS:235: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, "QUAD:LTUS:235:DEGAUS_IMAX_CHECK") { field(DESC, "Check if imax shoud chg") field(CALC, "(C==4)&&(ABS(B)>ABS(A))?1:0") field(INPA, "QUAD:LTUS:235:DEGAUS_IMAX") field(INPB, "QUAD:LTUS:235:ISETPT") field(INPC, "QUAD:LTUS:235:DEGAUSTYPE.RVAL") field(OUT, "QUAD:LTUS:235:DEGAUS_IMAX_UPDATE.SELN") field(FLNK, "QUAD:LTUS:235:DEGAUS_IMAX_UPDATE") } record(seq, "QUAD:LTUS:235:DEGAUS_IMAX_UPDATE") { field(DESC, "Degauss IMAX Update") field(SELM, "Specified") field(DOL1, "QUAD:LTUS:235:ISETPT") field(LNK1, "QUAD:LTUS:235:DEGAUS_IMAX PP") } # Set the maximum current after a successful # degauss. This pv is updated by the # sequence. record(ao, "QUAD:LTUS:235:DEGAUS_IMAX") { field(DESC, "Max I set afer a degauss") field(EGU, "Amps") field(PINI, "YES") field(PREC, "6") field(HOPR, "165.0") field(LOPR, "-165.0") field(DRVH, "165.0") field(DRVL, "-165.0") field(VAL, "165.0") field(FLNK, "QUAD:LTUS:235:DEGAUS_IMAXPOL_CHECK") info(autosaveFields,"VAL,RVAL") } # Set the polarity if degauss_imax record(calcout, "QUAD:LTUS:235:DEGAUS_IMAXPOL_CHECK") { field(DESC, "Determine polarity of imax") field(CALC, "A>=0?0:1") field(INPA, "QUAD:LTUS:235:DEGAUS_IMAX") field(FLNK, "QUAD:LTUS:235:DEGAUS_IMAXPOL") } record(bo, "QUAD:LTUS:235:DEGAUS_IMAXPOL") { field(DESC, "Polarity of imax I") field(DTYP, "Raw Soft Channel") field(DOL, "QUAD:LTUS:235:DEGAUS_IMAXPOL_CHECK") field(OMSL, "closed_loop") field(ZNAM, "Positive") field(ONAM, "Negative") field(FLNK, "QUAD:LTUS:235: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, "QUAD:LTUS:235:DEGAUS_ABSIMAX") { field(DESC, "Absolute Max. Degauss I") field(CALC, "ABS(A)") field(INPA, "QUAD:LTUS:235:DEGAUS_IMAX") field(PREC, "6") field(EGU, "Amps") field(HOPR, "165.0") field(LOPR, "-165.0") info(autosaveFields,"VAL RVAL") } # IACT Polarity record(calcout, "QUAD:LTUS:235:IACTPOL_CHECK") { field(DESC, "Determine IACT polarity") field(SCAN, "5 second") field(CALC, "ABS(A-B)>C?(A>=0?0:1):D") field(INPA, "QUAD:LTUS:235:IACT") field(INPB, "QUAD:LTUS:235:IACTPOL_CHECK.LA") field(INPC, "0.0001") field(INPD, "QUAD:LTUS:235:IACTPOL_CHECK.PVAL") field(OOPT, "On Change") field(FLNK, "QUAD:LTUS:235:IACTPOL") } record(bo, "QUAD:LTUS:235: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,"QUAD:LTUS:235: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, "QUAD:LTUS:235:DEGAUSENABLE CP") field(INPB, "QUAD:LTUS:235:DEGAUSOK") field(INPC, "QUAD:LTUS:235:STATE CP") field(INPD, "QUAD:LTUS:235:STATE.SEVR") field(OUT, "QUAD:LTUS:235:DEGAUS_STATE_SEQ.SELN PP") field(ASG, "Internal") } record(seq, "QUAD:LTUS:235:DEGAUS_STATE_SEQ") { field(DESC, "Degauss State Sequence") field(SELM, "Specified") field(SELL, "QUAD:LTUS:235:DEGAUS_STATE_CHECK") field(LNK1, "QUAD:LTUS:235:DEGAUS_STATE_DISABLE.PROC PP") field(LNK2, "QUAD:LTUS:235:DEGAUS_STATE_LOST.PROC PP") field(LNK3, "QUAD:LTUS:235:DEGAUS_STATE_GOOD.PROC PP") field(LNK4, "QUAD:LTUS:235: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, "QUAD:LTUS:235:DEGAUS_STATE_DISABLE") { field(DESC, "Degauss not used") field(LNK1, "QUAD:LTUS:235:DEGAUSOK.ZSV") field(LNK2, "QUAD:LTUS:235: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, "QUAD:LTUS:235:STATMSG.FRSV") field(LNK4, "QUAD:LTUS:235: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, "QUAD:LTUS:235:DEGAUS_STATE_LOST") { field(DESC, "Degauss lost and ps On") field(DOL1, "1") field(LNK1, "QUAD:LTUS:235:DEGAUSOK.ZSV") field(LNK2, "QUAD:LTUS:235: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, "QUAD:LTUS:235:STATMSG.FRSV") field(LNK4, "QUAD:LTUS:235: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, "QUAD:LTUS:235:DEGAUS_STATE_OFF") { field(DESC, "Degaused lost and ps Off") field(DOL1, "2") field(LNK1, "QUAD:LTUS:235: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, "QUAD:LTUS:235:STATMSG.FRSV") field(LNK3, "QUAD:LTUS:235: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, "QUAD:LTUS:235:DEGAUS_STATE_GOOD") { field(DESC, "Degauss good") field(DOL1, "1") field(LNK1, "QUAD:LTUS:235: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, "QUAD:LTUS:235:STATMSG.FRSV PP") field(LNK3, "QUAD:LTUS:235:STATMSG.FVSV PP") field(LNK4, "") field(ASG, "Internal") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(mbbo, "QUAD:LTUS:235:FUNC") { field(DESC, "QUAD:LTUS:235 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, "1") field(THVL, "9") field(FRVL, "10") field(FVVL, "0") field(SXVL, "2") field(SVVL, "8") field(EIVL, "11") field(NIVL, "12") field(TEVL, "13") field(ELVL, "5") field(TVVL, "6") field(TTVL, "7") field(FTVL, "4") field(FFVL, "3") field(OUT, "QUAD:LTUS:235:CTRL CA") } # :CTRL pv is processed at boot in the # sequence mgntCtrl.st Processed in sequence # record(mbbo, "QUAD:LTUS:235:CTRL") { field(DESC, "QUAD:LTUS:235 Control") field(PINI, "NO") field(ZRST, "Ready") field(ONST, "TRIM") field(TWST, "PERTURB") field(THST, "BCON_TO_BDES") field(FRST, "BACT_TO_BDES") field(FVST, "SAVE_BDES") field(SXST, "LOAD_BDES") field(SVST, "UNDO_BDES") field(EIST, "DAC_ZERO") field(NIST, "CALB") field(TEST, "STDZ") field(ELST, "RESET") field(TVST, "TURN_ON") field(TTST, "TURN_OFF") field(FTST, "") field(FFST, "") field(ZRVL, "0") field(ONVL, "2") field(TWVL, "6") field(THVL, "15") field(FRVL, "14") field(FVVL, "11") field(SXVL, "12") field(SVVL, "13") field(EIVL, "7") field(NIVL, "3") field(TEVL, "4") field(ELVL, "8") field(TVVL, "9") field(TTVL, "10") field(FTVL, "0") field(FFVL, "0") field(OUT, "QUAD:LTUS:235:SELECTEN.A PP") field(SDIS, "0") } # If a function has been selected set this unit to busy record(calcout, "QUAD:LTUS:235:SELECTEN") { field(DESC, "Control Select Enable") field(CALC, "A>0?1:A") field(FLNK, "QUAD:LTUS:235:BUSY") } # Set to FREE on IOC reboot record(bo, "QUAD:LTUS:235:BUSY") { field(DESC, "QUAD:LTUS:235 Ctrl Done") field(DOL, "QUAD:LTUS:235:SELECTEN") field(ZNAM, "FREE") field(ONAM, "BUSY") field(PINI, "YES") field(FLNK, "QUAD:LTUS:235:SELECT") } record(bo, "QUAD:LTUS:235:SELECT") { field(ZNAM, "NO") field(ONAM, "YES") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") } record(bo, "QUAD:LTUS:235: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, "QUAD:LTUS:235:CTRLSTATE") { field(DESC, "QUAD:LTUS:235 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("QUAD:LTUS:235:CTRL",20,20,0,0,"QUAD:LTUS:235:CTRL") #! Field("QUAD:LTUS:235:CTRL.OUT",16777215,1,"QUAD:LTUS:235:CTRL.OUT") #! Link("QUAD:LTUS:235:CTRL.OUT","QUAD:LTUS:235:SELECTEN.A") #! Field("QUAD:LTUS:235:CTRL.VAL",16777215,1,"QUAD:LTUS:235:CTRL.VAL") #! Record("QUAD:LTUS:235:SELECTEN",321,381,0,0,"QUAD:LTUS:235:SELECTEN") #! Field("QUAD:LTUS:235:SELECTEN.A",16777215,0,"QUAD:LTUS:235:SELECTEN.A") #! Field("QUAD:LTUS:235:SELECTEN.FLNK",16777215,1,"QUAD:LTUS:235:SELECTEN.FLNK") #! Link("QUAD:LTUS:235:SELECTEN.FLNK","QUAD:LTUS:235:BUSY") #! Field("QUAD:LTUS:235:SELECTEN.VAL",16777215,1,"QUAD:LTUS:235:SELECTEN.VAL") #! Record("QUAD:LTUS:235:BUSY",623,274,0,0,"QUAD:LTUS:235:BUSY") #! Field("QUAD:LTUS:235:BUSY.DOL",16777215,0,"QUAD:LTUS:235:BUSY.DOL") #! Link("QUAD:LTUS:235:BUSY.DOL","QUAD:LTUS:235:SELECTEN.VAL") #! Field("QUAD:LTUS:235:BUSY.FLNK",16777215,1,"QUAD:LTUS:235:BUSY.FLNK") #! Link("QUAD:LTUS:235:BUSY.FLNK","QUAD:LTUS:235:SELECT") #! Record("QUAD:LTUS:235:SELECT",669,508,0,1,"QUAD:LTUS:235:SELECT") #! Record("QUAD:LTUS:235:FUNC",940,120,0,0,"QUAD:LTUS:235:FUNC") #! Field("QUAD:LTUS:235:FUNC.OUT",16777215,0,"QUAD:LTUS:235:FUNC.OUT") #! Link("QUAD:LTUS:235:FUNC.OUT","QUAD:LTUS:235:CTRL.VAL") #! Record("QUAD:LTUS:235:ABORT",193,41,0,0,"QUAD:LTUS:235:ABORT") #! Record("QUAD:LTUS:235:CTRLSTATE",369,34,0,0,"QUAD:LTUS:235: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,"QUAD:LTUS:235:SELECT is used for Multi-device selection.\nIt is enabled when associated QUAD:LTUS:235:CTRL is \"0\" (DONE).\nIt is disabled when associated QUAD:LTUS:235: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,"QUAD:LTUS:235: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, "QUAD:LTUS:235:BCTRL_INIT") { field(DESC, "Process BCTRL on boot") field(PINI, "YES") field(CALC, "A=3?1:0") field(INPA, "QUAD:LTUS:235:BCTRL.SEVR") field(OUT, "QUAD:LTUS:235: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, "QUAD:LTUS:235:BACT") { field(DESC, "Actual B") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "QUAD:LTUS:235:BACT") field(INPB, "QUAD:LTUS:235:POLYCOEF") field(INPC, "QUAD:LTUS:235:POLYCOEF.A") field(INPD, "QUAD:LTUS:235:POLYCOEF.B") field(INPE, "QUAD:LTUS:235:IACT MS") field(INPF, "QUAD:LTUS:235:BDELTAS PP") field(INPG, "100") field(EGU, "kG") field(HOPR, "51.801") field(LOPR, "0.2713") field(HIHI, "51.801") field(LOLO, "0.2713") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "51.801") field(LOW, "0.2713") field(FLNK, "QUAD:LTUS:235: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, "QUAD:LTUS:235:BDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntPhyDeltas") field(EGU, "kG") field(HOPR, "1") field(PREC, "7") field(BRSV, "INVALID") field(INPA, "QUAD:LTUS:235:BDES") field(INPB, "QUAD:LTUS:235:TRIMBTOL") field(INPC, "QUAD:LTUS:235:TRIMBTOLR") field(INPD, "QUAD:LTUS:235:CHCKBTOL") field(INPE, "QUAD:LTUS:235:CHCKBTOLR") field(F, "2.0") field(INPG, "30") field(INPH, "QUAD:LTUS:235:BACT.VAL") # # MPS absolute and relative tolerances field(INPP, "QUAD:LTUS:235:MPSBTOL") field(INPQ, "QUAD:LTUS:235:MPSBTOLR") field(FLNK, "QUAD:LTUS:235:BCONLIMITS") info(autosaveFields,"F") } # This record is processed by BDELTAS record(aSub, "QUAD:LTUS:235:BCONLIMITS") { field(DESC, "Config B-field Limits") field(INAM, "mgntInit") field(SNAM, "mgntBCONLimits") field(INPA, "QUAD:LTUS:235:BDES") field(INPB, "QUAD:LTUS:235:BDELTAS.I") field(INPG, "QUAD:LTUS:235:DEBUG.RVAL") field(FTA, "DOUBLE") field(FTB, "DOUBLE") field(FTG, "ULONG") field(OUTA, "QUAD:LTUS:235:BCON.HIGH") field(OUTB, "QUAD:LTUS:235:BCON.LOW") field(OUTC, "QUAD:LTUS:235:BCON.HIHI") field(OUTD, "QUAD:LTUS:235:BCON.LOLO PP") field(FTVA, "DOUBLE") field(FTVB, "DOUBLE") field(FTVC, "DOUBLE") field(FTVD, "DOUBLE") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:235:IDELTAS") } # The following PV is processed by :BACT # which is processed by :BACT # record(fanout, "QUAD:LTUS:235:BACTFO") { field(DESC, "BACT processing") field(SELM, "All") field(LNK1, "QUAD:LTUS:235:BDIFF") field(LNK2, "QUAD:LTUS:235:BADIFF") field(LNK3, "QUAD:LTUS:235:BRATIO") field(LNK4, "QUAD:LTUS:235:MPSLIMITS") field(LNK5, "QUAD:LTUS:235:I2BSTATUS") field(LNK6, "QUAD:LTUS:235:IACTFO.PROC") } record(calc, "QUAD:LTUS:235:BDIFF") { field(DESC, "BDES-BACT") field(CALC, "A-B") field(INPA, "QUAD:LTUS:235:BDES") field(INPB, "QUAD:LTUS:235:BACT") field(EGU, "kG") field(PREC, "7") } record(calc, "QUAD:LTUS:235:BADIFF") { field(DESC, "Absolute BDES-BACT") field(INPA, "QUAD:LTUS:235:BDIFF") field(EGU, "kG") field(PREC, "7") field(CALC, "A<0?ABS(A):A") } record(calc, "QUAD:LTUS:235:BRATIO") { field(DESC, "BACT Error") field(CALC, "B?A/B:0") field(INPA, "QUAD:LTUS:235:BDIFF") field(INPB, "QUAD:LTUS:235:BDES.HOPR") field(EGU, "kG") field(PREC, "7") } record(mbbi, "QUAD:LTUS:235: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, "QUAD:LTUS:235:BACT.J") } # Note: for a string slave set the MONFL # macro to the following: # MONFL=:IMONCALC MS record(sub, "QUAD:LTUS:235:BMON") { field(DESC, "Second Transductor") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "QUAD:LTUS:235:BMON") field(INPB, "QUAD:LTUS:235:POLYCOEF") field(INPC, "QUAD:LTUS:235:POLYCOEF.A") field(INPD, "QUAD:LTUS:235:POLYCOEF.B") field(INPE, "QUAD:LTUS:235:IMON MS") field(INPF, "QUAD:LTUS:235:BDELTAS.VAL") field(INPG, "100") field(EGU, "kG") field(HOPR, "51.801") field(LOPR, "0.2713") field(HIHI, "51.801") field(LOLO, "0.2713") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "51.801") field(LOW, "0.2713") } # 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=PSC:LTUS:MG25:BDES CP record(ao, "QUAD:LTUS:235:BDES") { field(DESC, "Desired B-Field") field(PINI, "YES") field(DRVH, "51.801") field(DRVL, "0.2713") field(HOPR, "51.801") field(LOPR, "0.2713") field(PREC, "7") field(EGU, "kG") field(MDEL, "-1") field(OMSL, "supervisory") # field(DOL, "") field(OUT, "QUAD:LTUS:235:B2IDES PP") info(autosaveFields,"VAL") } record(sub, "QUAD:LTUS:235:B2IDES") { field(DESC, "Convert Desired B-Field to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:235:POLYCOEF") field(INPC, "QUAD:LTUS:235:POLYCOEF.A") field(INPD, "QUAD:LTUS:235:POLYCOEF.B") field(PREC, "7") field(EGU, "kG") field(HOPR, "51.801") field(LOPR, "0.2713") field(MDEL, "-1") field(INPE, "QUAD:LTUS:235:BDES.DRVH") field(INPF, "QUAD:LTUS:235:BDES.DRVL") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:235:IDES") } record(sub, "QUAD:LTUS:235:BNOM") { field(DESC, "Nominal Field") field(PINI, "YES") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:235:POLYCOEF") field(INPC, "QUAD:LTUS:235:POLYCOEF.A") field(INPD, "QUAD:LTUS:235:POLYCOEF.B") field(INPE, "QUAD:LTUS:235:BDES.DRVH") field(INPF, "QUAD:LTUS:235:BDES.DRVL") field(EGU, "kG") field(HOPR, "51.801") field(LOPR, "0.2713") field(PREC, "7") field(VAL, "0.0") field(FLNK, "QUAD:LTUS:235:INOM") } record(sub, "QUAD:LTUS:235:BACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:235:BDES.VAL") field(INPB, "QUAD:LTUS:235:BDES.DRVH") field(INPC, "QUAD:LTUS:235:BDES.DRVL") field(INPD, "QUAD:LTUS:235:BDELTAS.I") field(INPE, "QUAD:LTUS:235:BDELTAS.J") field(INPG, "QUAD:LTUS:235:STATE") field(INPH, "QUAD:LTUS:235:HSTA") field(EGU, "kG") field(HOPR, "51.801") field(LOPR, "0.2713") field(PREC, "7") field(BRSV, "INVALID") } record(sub, "QUAD:LTUS:235:BMONLIMITS") { field(DESC, "MON Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:235:BDES.VAL") field(INPB, "QUAD:LTUS:235:BDES.DRVH") field(INPC, "QUAD:LTUS:235:BDES.DRVL") field(INPD, "QUAD:LTUS:235:BDELTAS.K") field(INPE, "QUAD:LTUS:235:BDELTAS.L") field(INPG, "QUAD:LTUS:235:STATE") field(INPH, "QUAD:LTUS:235:HSTA") field(EGU, "kG") field(HOPR, "51.801") field(LOPR, "0.2713") field(PREC, "7") field(BRSV, "INVALID") } record(seq, "QUAD:LTUS:235:BLIMITS") { field(DESC, "ACT Limits") field(PREC, "7") field(DOL1, "QUAD:LTUS:235:BLIMITS") field(LNK1, "QUAD:LTUS:235:BACTLIMITS.F PP") field(DOL2, "QUAD:LTUS:235:BACTLIMITS.I") field(LNK2, "QUAD:LTUS:235:BACT.HIGH") field(DOL3, "QUAD:LTUS:235:BACTLIMITS.J") field(LNK3, "QUAD:LTUS:235:BACT.LOW") field(DOL4, "QUAD:LTUS:235:BACTLIMITS.K") field(LNK4, "QUAD:LTUS:235:BACT.HIHI") field(DOL5, "QUAD:LTUS:235:BACTLIMITS.L") field(LNK5, "QUAD:LTUS:235:BACT.LOLO") field(DOL6, "QUAD:LTUS:235:BLIMITS") field(LNK6, "QUAD:LTUS:235:BMONLIMITS.F PP") field(DOL7, "QUAD:LTUS:235:BMONLIMITS.I") field(LNK7, "QUAD:LTUS:235:BMON.HIGH") field(DOL8, "QUAD:LTUS:235:BMONLIMITS.J") field(LNK8, "QUAD:LTUS:235:BMON.LOW") field(DOL9, "QUAD:LTUS:235:BMONLIMITS.K") field(LNK9, "QUAD:LTUS:235:BMON.HIHI") field(DOLA, "QUAD:LTUS:235:BMONLIMITS.L") field(LNKA, "QUAD:LTUS:235:BMON.LOLO") field(FLNK, "QUAD:LTUS:235:ILIMITS") field(SCAN, "5 second") } record(ao, "QUAD:LTUS:235:BCTRL") { field(DESC, "B-Perturb") field(PREC, "7") field(EGU, "kG") field(DRVH, "51.801") field(DRVL, "0.2713") field(HOPR, "51.801") field(LOPR, "0.2713") # 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, "QUAD:LTUS:235: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, "QUAD:LTUS:235:BCTRLGO") { field(DESC, "Update DES and perturb") field(PREC, "7") # Disable BACT limits field(DOL1, "1") field(LNK1, "QUAD:LTUS:235:BLIMITS.VAL") # Update BDES with the BCTRL (slider) value field(DOL2, "QUAD:LTUS:235:BCTRL.VAL") field(LNK2, "QUAD:LTUS:235:BDES PP") field(DOL3, "1") field(LNK3, "QUAD:LTUS:235:IDIRECT.PROC PP") field(DOL4, "1") field(LNK4, "QUAD:LTUS:235:CHECKSTDZLOST.PROC PP") field(DOL5, "QUAD:LTUS:235:BCTRL.VAL") field(LNK5, "QUAD:LTUS:235:BCTRLSUB PP") # Re-enable BACT limits field(DOL6, "0") field(LNK6, "QUAD:LTUS:235:BLIMITS.VAL") } # Convert B-field to Current and output to ISETPT record(sub, "QUAD:LTUS:235:BCTRLSUB") { field(DESC, "Feedback") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:235:POLYCOEF") field(INPC, "QUAD:LTUS:235:POLYCOEF.A") field(INPD, "QUAD:LTUS:235:POLYCOEF.B") field(INPE, "QUAD:LTUS:235:BDES.DRVH") field(INPF, "QUAD:LTUS:235:BDES.DRVL") field(PREC, "7") field(EGU, "kG") field(HOPR, "51.801") field(LOPR, "0.2713") field(MDEL, "-1") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:235:ISETPT") } record(ao, "QUAD:LTUS:235:BDESPREVTRIM") { field(DESC, "trim bdes for undo") field(DTYP, "Soft Channel") field(DRVH, "51.801") field(DRVL, "0.2713") field(EGU, "kG") field(HOPR, "51.801") field(LOPR, "0.2713") field(PREC, "7") field(PINI, "YES") info(autosaveFields,"VAL") } record(stringin, "QUAD:LTUS:235:MADNAME") { field(DESC, "MAD deck nomenclature") field(PINI, "YES") field(VAL, "QDL13") } record(ai, "QUAD:LTUS:235: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, "3266.111666") } record(ao, "QUAD:LTUS:235:BMAX") { field(DESC, "Max B-Field") field(DTYP, "Soft Channel") field(DRVH, "51.801") field(DRVL, "0.2713") field(EGU, "kG") field(HOPR, "51.801") field(LOPR, "0.2713") field(PREC, "7") field(PINI, "YES") field(VAL, "51.801") field(FLNK, "QUAD:LTUS:235:BSTEP") } record(ao, "QUAD:LTUS:235:BMIN") { field(DESC, "Min B-Field") field(DTYP, "Soft Channel") field(DRVH, "51.801") field(DRVL, "0.2713") field(EGU, "kG") field(HOPR, "51.801") field(LOPR, "0.2713") field(PREC, "7") field(PINI, "YES") field(VAL, "0.2713") field(FLNK, "QUAD:LTUS:235:BSTEP") } record(ao, "QUAD:LTUS:235:BDESSAVE") { field(DESC, "bdes for save/load") field(DTYP, "Soft Channel") field(DRVH, "51.801") field(DRVL, "0.2713") field(EGU, "kG") field(HOPR, "51.801") field(LOPR, "0.2713") field(PINI, "YES") field(PREC, "7") } # This record is processed by QUAD:LTUS:235: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, "QUAD:LTUS:235:BCON") { field(DESC, "Config B-Field ") field(DTYP, "Soft Channel") field(PREC, "7") field(EGU, "kG") field(HOPR, "51.801") field(LOPR, "0.2713") field(DRVH, "51.801") field(DRVL, "0.2713") # Set MINOR Alarm as the default, slaves will set NO_ALARM=0. field(HHSV, "MINOR") field(LLSV, "MINOR") field(HSV, "MINOR") field(LSV, "MINOR") # field(DOL , "") field(OMSL, "supervisory") field(OUT, "QUAD:LTUS:235:B2ICON PP") info(autosaveFields,"VAL") } record(sub, "QUAD:LTUS:235:B2ICON") { field(DESC, "Convert Desired ICon to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:235:POLYCOEF") field(INPC, "QUAD:LTUS:235:POLYCOEF.A") field(INPD, "QUAD:LTUS:235:POLYCOEF.B") field(PREC, "7") field(EGU, "kG") field(HOPR, "51.801") field(LOPR, "0.2713") field(MDEL, "-1") field(INPE, "QUAD:LTUS:235:BCON.DRVH") field(INPF, "QUAD:LTUS:235:BCON.DRVL") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:235: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, "QUAD:LTUS:235:BSTEP") { field(DESC, "B-Field step size") field(CALC, "(C==3)||(D==3)?0:ABS(A-B)*0.005") field(INPA, "QUAD:LTUS:235:BMAX") field(INPB, "QUAD:LTUS:235:BMIN") field(INPC, "QUAD:LTUS:235:BMIN.SEVR") field(INPD, "QUAD:LTUS:235:BMAX.SEVR") field(EGU, "kG") 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,"QUAD:LTUS:235:BCTRLDISABLECALC") { field(DESC, "Calc for disabling BCTRL") field(ASG, "Internal") field(CALC, "A?2:1") field(INPA, "QUAD:LTUS:235:ONLINE CP") field(OUT, "QUAD:LTUS:235:BCTRLDISABLEFOUT PP") } record(fanout, "QUAD:LTUS:235:BCTRLDISABLEFOUT") { field(DESC, "Disable BCTRL fanout") field(SELM, "Specified") field(SELL, "QUAD:LTUS:235:BCTRLDISABLECALC") field(LNK1, "QUAD:LTUS:235:BCTRLDISABLE") field(LNK2, "QUAD:LTUS:235:BCTRLENABLE") } record(stringout, "QUAD:LTUS:235:BCTRLDISABLE") { field(DESC, "Disable BCTRL") field(DTYP, "Soft Channel") field(OUT, "QUAD:LTUS:235:BCTRL.ASG") field(VAL, "NOWRITE") field(FLNK, "QUAD:LTUS:235:BCTRLDISV_UPDATE") } record(stringout, "QUAD:LTUS:235:BCTRLENABLE") { field(DESC, "Enable BCTRL") field(DTYP, "Soft Channel") field(OUT, "QUAD:LTUS:235:BCTRL.ASG") field(VAL, "") field(FLNK, "QUAD:LTUS:235:BCTRLDISV_UPDATE") } record(calcout, "QUAD:LTUS:235:BCTRLDISV_UPDATE") { field(DESC, "Calc for updating BCTRL.DISV") field(ASG, "Internal") field(CALC, "A") field(INPA, "QUAD:LTUS:235:ONLINE") field(OUT, "QUAD:LTUS:235: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,"QUAD:LTUS:235:BACT and MON\n are processed via links from \n QUAD:LTUS:235:IACT (device raw value readback 1)\n and\n QUAD:LTUS:235: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 QUAD:LTUS:235:POLYCOEF\nC = First polynomial coefficient (offset if linear)\nD = Second polynomial coefficient (slope if linear)\nE = QUAD:LTUS:235: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,"QUAD:LTUS:235:BDES\n is processed when set by CA users or \n QUAD:LTUS:235: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,"QUAD:LTUS:235: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 QUAD:LTUS:235: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 (QUAD:LTUS:235: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,"QUAD:LTUS:235:B*LIMITS and QUAD:LTUS:235:BLIMITS:\n Calculate alarm and warning limits based on \n deltas from QUAD:LTUS:235: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,"QUAD:LTUS:235: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,"QUAD:LTUS:235: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, "QUAD:LTUS:235: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, "QUAD:LTUS:235:MPSBTOL") { field(DESC, "Absolute mps tol") field(EGU, "kG") field(PREC, "2") field(CALC, "ABS(A)*0.02") field(INPA, "QUAD:LTUS:235:BMAX") field(PINI, "YES") } # # 21-Aug-2013: K. Luchini # Set channel access security so that users # cannot easily change values. record(ao, "QUAD:LTUS:235:MPSBMAX") { field(DESC, "MPS Max B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "51.801") field(DRVL, "0.2713") field(PINI, "YES") field(VAL, "51.801") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:235:MPSBMIN") { field(DESC, "MPS Min B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "51.801") field(DRVL, "0.2713") field(PINI, "YES") field(VAL, "0.2713") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:235:MPSBLLIM") { field(DESC, "MPS Low Limit B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "51.801") field(DRVL, "0.2713") field(PINI, "YES") field(VAL, "0.2713") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:235:MPSBLLIM2") { field(DESC, "MPS Low Limit #2 B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "51.801") field(DRVL, "0.2713") field(PINI, "YES") field(VAL, "0.2713") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } # Set the default to Std record(mbbo, "QUAD:LTUS:235: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, "QUAD:LTUS:235:MPSLIMITS.E PP") } record(aSub, "QUAD:LTUS:235: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, "QUAD:LTUS:235:MPS.RVAL") field(INPB, "QUAD:LTUS:235:BADIFF") field(INPC, "QUAD:LTUS:235:BDELTAS.N") field(INPD, "QUAD:LTUS:235:BACT") field(INPE, "QUAD:LTUS:235:MPSBITMASK.RVAL") field(INPF, "QUAD:LTUS:235:MPSBLLIM") field(INPG, "QUAD:LTUS:235:MPSBMIN") field(INPH, "QUAD:LTUS:235:MPSBMAX") field(INPI, "QUAD:LTUS:235: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, "QUAD:LTUS:235:INTOL.RVAL PP") field(OUTB, "QUAD:LTUS:235:INTOL_BMIN.RVAL PP") field(OUTC, "QUAD:LTUS:235:INTOL_BRANGE.RVAL PP") field(OUTD, "QUAD:LTUS:235: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, "QUAD:LTUS:235:INTOL") { field(DESC, "BACT within MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:235:MPSLIMITS.VALA") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "QUAD:LTUS:235:INTOL_BMIN") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:235:MPSLIMITS.VALB") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "QUAD:LTUS:235:INTOL_BMIN2") { field(DESC, "MPS tol #2") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:235:MPSLIMITS.VALD") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "QUAD:LTUS:235:INTOL_BRANGE") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:235: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, "QUAD:LTUS:235:CHCKITOL") { field(DESC, "Absolute Check I Tolerance") field(EGU, "A") field(FLNK, "QUAD:LTUS:235:TRIMITOL") field(CALC, "ABS(A*B)") field(INPA, "QUAD:LTUS:235:CHCKBTOL") field(INPB, "QUAD:LTUS:235:POLYCOEF.B") field(PREC, "9") } record(calc, "QUAD:LTUS:235:TRIMBTOL") { field(EGU, "kG") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(DESC, "Absolute Trim Tolerance") field(CALC, "ABS(A)/2") field(INPA, "QUAD:LTUS:235:CHCKBTOL") field(FLNK, "QUAD:LTUS:235:CHCKITOL") } record(calc, "QUAD:LTUS:235:CHCKBTOL") { field(DESC, "Check absolute tolerance") field(EGU, "A") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(FLNK, "QUAD:LTUS:235:TRIMBTOL") field(CALC, "MAX(ABS(A),ABS(C))*(B/1000000)") field(INPA, "QUAD:LTUS:235:BDES.HOPR") field(INPB, "QUAD:LTUS:235:STABILITY") field(INPC, "QUAD:LTUS:235:BDES.LOPR") } record(longout, "QUAD:LTUS:235: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, "QUAD:LTUS:235:CHCKBTOL") } record(calc, "QUAD:LTUS:235:TRIMITOL") { field(DESC, "Absolute Trim I Tolerance") field(EGU, "kG") field(CALC, "ABS(A*B)") field(INPA, "QUAD:LTUS:235:POLYCOEF.B") field(INPB, "QUAD:LTUS:235:TRIMBTOL") field(PREC, "9") } record(ai, "QUAD:LTUS:235:TRIMBTOLR") { field(DESC, "Relative trim tol") field(PREC, "4") field(EGU, "%") field(HOPR, "1.0") field(LOPR, "0.0") field(PINI, "YES") } record(ai, "QUAD:LTUS:235: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, "QUAD:LTUS:235:FBCKFCOM") { field(ZNAM, "CA") field(ONAM, "FCOM") field(DESC, "CA Mode") field(PINI, "YES") field(SDIS, "0") } record(bo, "QUAD:LTUS:235:PAU") { field(ZNAM, "NotConfigured") field(ONAM, "Configured") field(DESC, "PAU Present") field(PINI, "YES") field(SDIS, "0") field(FLNK, "QUAD:LTUS:235:PAUGO") } record(fanout, "QUAD:LTUS:235:PAUGO") { field(DESC, "PAU control") field(LNK1, "QUAD:LTUS:235:PAUSTOP") field(LNK2, "QUAD:LTUS:235: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, "QUAD:LTUS:235:PAUSTART") { field(DESC, "Setup for PAU On") field(SDIS, "QUAD:LTUS:235: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, "QUAD:LTUS:235:PAUSTOP") { field(DESC, "Setup for PAU Off") field(SDIS, "QUAD:LTUS:235: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, "QUAD:LTUS:235:MCORDEVNAME") { field(DESC, "PS device name") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, "PSC:LTUS:MG25:") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "QUAD:LTUS:235: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, "QUAD:LTUS:235:PSTYPE.RVAL") field(INPC, "QUAD:LTUS:235:TURNEDOFF.RVAL") field(INPD, "QUAD:LTUS:235:CONFIG.RVAL") field(INPE, "QUAD:LTUS:235:PSCATEGORY.RVAL") field(INPF, "QUAD:LTUS:235:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "QUAD:LTUS:235:AUTOCTRL.RVAL") field(INPJ, "QUAD:LTUS:235:OUTOFSERVICE.RVAL") field(INPL, "QUAD:LTUS:235:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "QUAD:LTUS:235:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "QUAD:LTUS:235:PAU") field(INPP, "QUAD:LTUS:235:CALBDISABLE.RVAL") field(INPQ, "QUAD:LTUS:235:PTRBDISABLE.RVAL") field(INPR, "QUAD:LTUS:235:TRIMDISABLE.RVAL") field(INPS, "QUAD:LTUS:235:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "QUAD:LTUS:235:FBCK") field(INPU, "QUAD:LTUS:235:TRIMTYPE.RVAL") field(INPV, "QUAD:LTUS:235:STDZDIRECT.RVAL") field(INPW, "QUAD:LTUS:235:DEGAUSENABLE.RVAL") field(FLNK, "QUAD:LTUS:235:HSTA") } record(longin, "QUAD:LTUS:235:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "QUAD:LTUS:235:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "QUAD:LTUS:235: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, "QUAD:LTUS:235: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, "QUAD:LTUS:235:CALBDISABLE") { field(DESC, "DAC Calb Disabled") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:235:PTRBDISABLE") { field(DESC, "Perturb Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:235:TRIMDISABLE") { field(DESC, "Trim Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:235: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 QUAD:LTUS:235:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses QUAD:LTUS:235:FBCK. # This PV should be replaced by QUAD:LTUS:235: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, "QUAD:LTUS:235: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, "QUAD:LTUS:235: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, "QUAD:LTUS:235: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, "") field(OMSL, "supervisory") field(FLNK, "QUAD:LTUS:235:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"QUAD:LTUS:235:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "QUAD:LTUS:235:OUTOFSERVICE NPP NMS") field(OUT, "QUAD:LTUS:235:ONLINE PP") } record(bo, "QUAD:LTUS:235:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "QUAD:LTUS:235: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, "1") } record(bo, "QUAD:LTUS:235: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, "1") } record(bo, "QUAD:LTUS:235: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, "QUAD:LTUS:235: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, "QUAD:LTUS:235: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, "QUAD:LTUS:235: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, "QUAD:LTUS:235: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, "QUAD:LTUS:235: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, "1") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:235: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, "1") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:235: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, "2") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:235: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, "0") field(ASG, "NOWRITE") field(FLNK, "QUAD:LTUS:235:TRIMTYPE") } record(stringout, "QUAD:LTUS:235:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "QUAD:LTUS:235:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "QUAD:LTUS:235:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "QUAD:LTUS:235:STATE.RVAL") field(INPB, "QUAD:LTUS:235:INTLKSUMY.RVAL") field(OUT, "QUAD:LTUS:235:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:LTUS:235: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, "QUAD:LTUS:235:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "QUAD:LTUS:235:STATE.RVAL") field(INPB, "QUAD:LTUS:235:INTLKSUMY.RVAL") field(OUT, "QUAD:LTUS:235:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:LTUS:235:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "QUAD:LTUS:235:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "QUAD:LTUS:235: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, "QUAD:LTUS:235:RAMPSTARTDLY") { field(DESC, "Tansition to ramp delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "2") } ######### For PSTYPE=2 Only ############# record(mbbo, "QUAD:LTUS:235: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, "QUAD:LTUS:235: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,"QUAD:LTUS:235: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("QUAD:LTUS:235:TURNEDOFF",3140,1907,0,1,"QUAD:LTUS:235:TURNEDOFF") #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "QUAD:LTUS:235:STATSUB") { field(DESC, "Build STATus ") field(INAM, "mgntInit") field(SNAM, "mgntSlcStat") field(INPA, "QUAD:LTUS:235:BACT.STAT") field(INPB, "QUAD:LTUS:235:BDES.STAT") field(INPC, "QUAD:LTUS:235:IRIPL.STAT") field(INPD, "PSC:LTUS:MG25:ISETPT.STAT") field(INPE, "PSC:LTUS:MG25:IACT.STAT") # 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, "QUAD:LTUS:235:BACT.SEVR") field(INPH, "QUAD:LTUS:235:BDES.SEVR") field(INPI, "QUAD:LTUS:235:IRIPL.SEVR") field(INPJ, "PSC:LTUS:MG25:ISETPT.SEVR") field(INPK, "PSC:LTUS:MG25:IACT.SEVR") # # 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, "QUAD:LTUS:235:STATE.RVAL") field(INPN, "QUAD:LTUS:235:STDZOK") field(INPO, "QUAD:LTUS:235:CALBOK") field(INPP, "QUAD:LTUS:235:OUTOFSERVICE.RVAL") field(INPQ, "QUAD:LTUS:235:CONFIG.RVAL") field(INPR, "QUAD:LTUS:235:HSTA") field(INPS, "QUAD:LTUS:235:CTRL.RVAL") field(INPT, "QUAD:LTUS:235:DEGAUSOK") field(INPV, "QUAD:LTUS:235: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, "QUAD:LTUS:235:STAT") } record(longout, "QUAD:LTUS:235:STAT") { field(DESC, "STAT sent to SLC") field(SCAN, "Passive") field(FLNK, "QUAD:LTUS:235:STATCTRLSUB") field(DOL, "QUAD:LTUS:235:STATSUB.VAL") field(OMSL, "closed_loop") } record(sSub, "QUAD:LTUS:235:STATCTRLSUB") { field(DESC, "Decode SLC STAT into mbbo") field(INAM, "mgntInit") field(SNAM, "mgntStatDecode") field(INPA, "QUAD:LTUS:235:STAT") field(INPB, "QUAD:LTUS:235:HSTA") field(INPD, "QUAD:LTUS:235:ONOFFCTRL.RVAL") field(FLNK, "QUAD:LTUS:235:STATMSG") } record(mbbo, "QUAD:LTUS:235: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, "QUAD:LTUS:235:UNAVAILGO") field(DOL, "QUAD:LTUS:235:STATCTRLSUB.W") } record(seq, "QUAD:LTUS:235:UNAVAILGO") { field(DESC, "Process UNAVAIL") field(DOL1, "QUAD:LTUS:235:STATSUB.U") field(LNK1, "QUAD:LTUS:235:UNAVAIL PP") } record(stringout, "QUAD:LTUS:235:SNLSTATMSG") { field(DTYP, "Soft Channel") } #! TextBox(TB0,820,1000,1200,1220,0,"Dialog",12,1,16777215,"QUAD:LTUS:235:STATUSSUB - future\nOverall device status - takes input from action snls, record sevrs, master snl(s) and outputs final status\n\nInputs:\nA - QUAD:LTUS:235:CTRLSTATUS - snl status\nB - MGNT:CTRLSTATUS - master list status\nC\nD - QUAD:LTUS:235: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,"QUAD:LTUS:235STATSUB\nformat control bo's into slc STAT\n\nInputs:\nA - QUAD:LTUS:235:STATUS\nC - QUAD:LTUS:235:ON\nD - QUAD:LTUS:235:STDZOK\nE - QUAD:LTUS:235:CALBOK\nF - QUAD:LTUS:235:BACTDRIFT (future)\nG -\nH- QUAD:LTUS:235:DACSTATUS\nI -QUAD:LTUS:235:ADCSTATUS\nJ - QUAD:LTUS:235:BACTSTATUS\nK - QUAD:LTUS:235:BDESSTATUS\nL - QUAD:LTUS:235:RIPLSTATUS\n\nOutput:\nP - QUAD:LTUS:235: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, "QUAD:LTUS:235: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, "QUAD:LTUS:235: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, "QUAD:LTUS:235: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, "QUAD:LTUS:235: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.6 #! DBDSTART #! DBD("../../../../dbd/mgntSoft.dbd") #! DBDEND record(stringout, "QUAD:LTUS:235:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:235:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "QUAD:LTUS:235:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "QUAD:LTUS:235:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "QUAD:LTUS:235:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "QUAD:LTUS:235:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "1") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "QUAD:LTUS:235: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, "QUAD:LTUS:235:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "QUAD:LTUS:235:TRIMTYPE.RVAL") field(INPB, "QUAD:LTUS:235:CONFIG.RVAL") field(OUT, "QUAD:LTUS:235:TRIMMAXNUM PP") } record(longout, "QUAD:LTUS:235: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, "QUAD:LTUS:235: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, "") field(OMSL, "supervisory") field(VAL, "20") field(OUT, "QUAD:LTUS:235:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "QUAD:LTUS:235: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, "") field(OMSL, "supervisory") field(VAL, "10") } record(bo, "QUAD:LTUS:235: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, "QUAD:LTUS:235: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, "QUAD:LTUS:235: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, "QUAD:LTUS:235:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "0") } record(ao, "QUAD:LTUS:235: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, "QUAD:LTUS:235:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "QUAD:LTUS:235: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, "QUAD:LTUS:235: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, "QUAD:LTUS:235:IMOVE") field(INPB, "QUAD:LTUS:235:IACT") field(INPC, "QUAD:LTUS:235:IRAMPRATE") field(INPD, "1.577") field(INPE, "QUAD:LTUS:235:TRIMDLYPCT") field(INPF, "QUAD:LTUS:235:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "QUAD:LTUS:235:RAMPTIME_LEFT PP") } record(longout, "QUAD:LTUS:235:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "QUAD:LTUS:235:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "QUAD:LTUS:235:RAMPDONE_CALC") } record(calc, "QUAD:LTUS:235:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "QUAD:LTUS:235:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "QUAD:LTUS:235:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "QUAD:LTUS:235: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, "QUAD:LTUS:235:RAMPTIME_LEFT") field(OUT, "QUAD:LTUS:235:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "QUAD:LTUS:235:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "QUAD:LTUS:235:RAMPTIME_LEFT NMS") field(OUT, "QUAD:LTUS:235:RAMPDONE PP") } record(bo, "QUAD:LTUS:235:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "QUAD:LTUS:235:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "QUAD:LTUS:235: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, "QUAD:LTUS:235: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(sSub, "QUAD:LTUS:235: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, "QUAD:LTUS:235:PSTYPE.RVAL") field(INPC, "QUAD:LTUS:235:TURNEDOFF.RVAL") field(INPD, "QUAD:LTUS:235:CONFIG.RVAL") field(INPE, "QUAD:LTUS:235:PSCATEGORY.RVAL") field(INPF, "QUAD:LTUS:235:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "QUAD:LTUS:235:AUTOCTRL.RVAL") field(INPJ, "QUAD:LTUS:235:OUTOFSERVICE.RVAL") field(INPL, "QUAD:LTUS:235:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "QUAD:LTUS:235:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "QUAD:LTUS:235:PAU") field(INPP, "QUAD:LTUS:235:CALBDISABLE.RVAL") field(INPQ, "QUAD:LTUS:235:PTRBDISABLE.RVAL") field(INPR, "QUAD:LTUS:235:TRIMDISABLE.RVAL") field(INPS, "QUAD:LTUS:235:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "QUAD:LTUS:235:FBCK") field(INPU, "QUAD:LTUS:235:TRIMTYPE.RVAL") field(INPV, "QUAD:LTUS:235:STDZDIRECT.RVAL") field(INPW, "QUAD:LTUS:235:DEGAUSENABLE.RVAL") field(FLNK, "QUAD:LTUS:235:HSTA") } record(longin, "QUAD:LTUS:235:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "QUAD:LTUS:235:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "QUAD:LTUS:235: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, "QUAD:LTUS:235: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, "QUAD:LTUS:235:CALBDISABLE") { field(DESC, "DAC Calb Disabled") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:235:PTRBDISABLE") { field(DESC, "Perturb Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:235:TRIMDISABLE") { field(DESC, "Trim Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:235:STDZDISABLE") { field(DTYP, "Raw Soft Channel") field(ZNAM, "NO") field(ONAM, "YES") field(DESC, "Standardize Function") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } # This PV has been replaced by QUAD:LTUS:235:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses QUAD:LTUS:235:FBCK. # This PV should be replaced by QUAD:LTUS:235: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, "QUAD:LTUS:235: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, "QUAD:LTUS:235: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, "QUAD:LTUS:235: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, "") field(OMSL, "supervisory") field(FLNK, "QUAD:LTUS:235:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"QUAD:LTUS:235:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "QUAD:LTUS:235:OUTOFSERVICE NPP NMS") field(OUT, "QUAD:LTUS:235:ONLINE PP") } record(bo, "QUAD:LTUS:235:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "QUAD:LTUS:235: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, "1") } record(bo, "QUAD:LTUS:235: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, "1") } record(bo, "QUAD:LTUS:235: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, "QUAD:LTUS:235: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, "QUAD:LTUS:235: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, "QUAD:LTUS:235: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, "QUAD:LTUS:235: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, "QUAD:LTUS:235: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, "1") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:235: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, "1") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:235: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, "2") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:235: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, "2") field(ASG, "NOWRITE") field(FLNK, "QUAD:LTUS:235:TRIMTYPE") } record(stringout, "QUAD:LTUS:235:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "QUAD:LTUS:235:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "QUAD:LTUS:235:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "QUAD:LTUS:235:STATE.RVAL") field(INPB, "QUAD:LTUS:235:INTLKSUMY.RVAL") field(OUT, "QUAD:LTUS:235:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:LTUS:235: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, "QUAD:LTUS:235:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "QUAD:LTUS:235:STATE.RVAL") field(INPB, "QUAD:LTUS:235:INTLKSUMY.RVAL") field(OUT, "QUAD:LTUS:235:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:LTUS:235:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "QUAD:LTUS:235:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "QUAD:LTUS:235: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, "QUAD:LTUS:235:RAMPSTARTDLY") { field(DESC, "Tansition to ramp delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "2") } ######### For PSTYPE=2 Only ############# record(mbbo, "QUAD:LTUS:235: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, "QUAD:LTUS:235: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,"QUAD:LTUS:235: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("QUAD:LTUS:235:TURNEDOFF",3140,1907,0,1,"QUAD:LTUS:235:TURNEDOFF") #! 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, "QUAD:LTUS:470:IACT") { field(DESC, "Current") field(INP, "PSC:LTUS:MG08:IACT") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "QUAD:LTUS:470:BACT") info(autosaveFields,"HYST") } record(bi, "QUAD:LTUS:470:STATE") { field(DESC, "PS On/Off Status") field(DTYP, "Raw Soft Channel") field(INP, "PSC:LTUS:MG08:STATE NPP MS") field(ZSV, "MAJOR") field(ZNAM, "OFF") field(ONAM, "ON") } record(ao, "QUAD:LTUS:470:IDES") { field(DESC, "Desired Current") field(PREC, "3") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(MDEL, "-1") field(HIHI, "200.0") field(LOLO, "0.0") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "QUAD:LTUS:470:BDELTAS") field(DRVH, "200.0") field(DRVL, "0.0") field(DOL, "QUAD:LTUS:470: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, "QUAD:LTUS:470:ICTRL PP") } # This record is processed by QUAD:LTUS:470:ICON") # Note: we are not setting alarms here. record(ao, "QUAD:LTUS:470:ICON") { field(DESC, "Config I") field(DTYP, "Soft Channel") field(PREC, "3") field(HOPR, "200.0") field(LOPR, "0.0") field(DRVH, "200.0") field(DRVL, "0.0") field(DOL, "QUAD:LTUS:470:B2ICON.K") field(OMSL, "closed_loop") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:470:INOM") { field(DESC, "Nominal Current") field(DOL, "QUAD:LTUS:470:BNOM.K") field(OMSL, "closed_loop") field(PREC, "3") field(EGU, "A") field(DRVH, "200.0") field(DRVL, "0.0") field(HOPR, "200.0") field(LOPR, "0.0") } record(ao, "QUAD:LTUS:470:ICTRL") { field(DESC, "Set Current") field(PREC, "3") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(DRVH, "200.0") field(DRVL, "0.0") field(MDEL, "-1") field(FLNK, "QUAD:LTUS:470:ICTRLGO") field(OMSL, "supervisory") info(autosavefields,"VAL") } record(seq, "QUAD:LTUS:470:ICTRLGO") { field(DESC, "Process Current Setpoint") field(PREC, "3") # Set ISETPT to supervisory field(DOL1, "0") field(LNK1, "QUAD:LTUS:470:ISETPT.OMSL") field(DOL2, "QUAD:LTUS:470:ICTRL") field(LNK2, "QUAD:LTUS:470:ISETPT PP") # Set ISETPT to closed loop - get data from BCTRLSUB.K field(DOL3, "1") field(LNK3, "QUAD:LTUS:470:ISETPT.OMSL") } record(ao, "QUAD:LTUS:470:IMAX") { field(DESC, "Max I") field(DTYP, "Soft Channel") field(DRVH, "200.0") field(DRVL, "0.0") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(PREC, "3") field(PINI, "YES") field(VAL, "200.0") field(FLNK, "QUAD:LTUS:470:IMIN") } record(ao, "QUAD:LTUS:470:IMIN") { field(DESC, "Min I") field(DTYP, "Soft Channel") field(DRVH, "200.0") field(DRVL, "0.0") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(PREC, "3") field(VAL, "0.0") field(FLNK, "QUAD:LTUS:470:IRANGE") } record(sel, "QUAD:LTUS:470:IACTPREVOK") { field(DESC, "Last Good Current") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(PREC, "3") field(NVL, "QUAD:LTUS:470:BACT.SEVR") field(INPA, "QUAD:LTUS:470:IACT NPP MS") field(INPB, "QUAD:LTUS:470:IACTPREVOK NPP MS") field(INPC, "QUAD:LTUS:470:IACTPREVOK NPP MS") field(INPD, "QUAD:LTUS:470:IACTPREVOK NPP MS") } record(sub, "QUAD:LTUS:470:IACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:470:IDES") field(INPB, "QUAD:LTUS:470:ISETPT.DRVH") field(INPC, "QUAD:LTUS:470:ISETPT.DRVL") field(INPD, "QUAD:LTUS:470:IDELTAS.I") field(INPE, "QUAD:LTUS:470:IDELTAS.J") field(INPG, "QUAD:LTUS:470:STATE") field(INPH, "QUAD:LTUS:470:HSTA") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(sub, "QUAD:LTUS:470:IMONLIMITS") { field(DESC, "Aux Current Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:470:IDES") field(INPB, "QUAD:LTUS:470:ISETPT.DRVH") field(INPC, "QUAD:LTUS:470:ISETPT.DRVL") field(INPD, "QUAD:LTUS:470:IDELTAS.K") field(INPE, "QUAD:LTUS:470:IDELTAS.L") field(INPG, "QUAD:LTUS:470:STATE") field(INPH, "QUAD:LTUS:470:HSTA") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(seq, "QUAD:LTUS:470:ILIMITS") { field(DESC, "Set ACT and MON Limits") field(PREC, "3") field(DOL1, "QUAD:LTUS:470:BLIMITS") field(LNK1, "QUAD:LTUS:470:IACTLIMITS.F PP") field(DOL2, "QUAD:LTUS:470:IACTLIMITS.I") field(LNK2, "QUAD:LTUS:470:IACT.HIGH") field(DOL3, "QUAD:LTUS:470:IACTLIMITS.J") field(LNK3, "QUAD:LTUS:470:IACT.LOW") field(DOL4, "QUAD:LTUS:470:IACTLIMITS.K") field(LNK4, "QUAD:LTUS:470:IACT.HIHI") field(DOL5, "QUAD:LTUS:470:IACTLIMITS.L") field(LNK5, "QUAD:LTUS:470:IACT.LOLO") field(DOL6, "QUAD:LTUS:470:BLIMITS") field(LNK6, "QUAD:LTUS:470:IMONLIMITS.F PP") field(DOL7, "QUAD:LTUS:470:IMONLIMITS.I") field(LNK7, "QUAD:LTUS:470:IMON.HIGH") field(DOL8, "QUAD:LTUS:470:IMONLIMITS.J") field(LNK8, "QUAD:LTUS:470:IMON.LOW") field(DOL9, "QUAD:LTUS:470:IMONLIMITS.K") field(LNK9, "QUAD:LTUS:470:IMON.HIHI") field(DOLA, "QUAD:LTUS:470:IMONLIMITS.L") field(LNKA, "QUAD:LTUS:470: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, "QUAD:LTUS:470:IDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntRawDeltas") field(INPD, "QUAD:LTUS:470:TRIMBTOL") field(INPE, "QUAD:LTUS:470:CHCKBTOL") field(INPF, "QUAD:LTUS:470:BDELTAS.K") field(INPG, "QUAD:LTUS:470:BDELTAS.L") field(INPH, "QUAD:LTUS:470: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, "QUAD:LTUS:470:STDZITOLR") field(INPC, "QUAD:LTUS:470:STDZITOL") field(FLNK, "") } # All ps controllers with on/off control will set the macro ONOF # as follows: # # ONOF = PSC:LTUS:MG08: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, "QUAD:LTUS:470:STATESETPT") { field(DESC, "PS On/Off") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFF") field(ONAM, "ON") field(OUT, "PSC:LTUS:MG08:STATESETPT PP") 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 = PSC:LTUS:MG08:RESET PP # record(bo, "QUAD:LTUS:470:RESET") { field(DESC, "Interlock Latch Reset") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFF") field(ONAM, "ON") field(HIGH, "1.0") field(OUT, "PSC:LTUS:MG08:RESET PP") } record(bo, "QUAD:LTUS:470:RAMPSTATE") { field(DESC, "PS Ramp Status") field(DTYP, "Soft Channel") field(DOL, "PSC:LTUS:MG08:RAMPSTATE NPP 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, "QUAD:LTUS:470: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, "QUAD:LTUS:470:TRIMRAMPRATE") field(OUT, "PSC:LTUS:MG08:IRAMPRATE PP") field(FLNK, "QUAD:LTUS:470:STDZDLY") } record(ao, "QUAD:LTUS:470:ISETPT") { field(DESC, "Current Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(DRVH, "200.0") field(DRVL, "0.0") field(MDEL, "-1") field(OUT, "PSC:LTUS:MG08:ISETPT PP") field(DOL, "QUAD:LTUS:470: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, "QUAD:LTUS:470:IMON") { field(DESC, "Aux Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(INP, "PSC:LTUS:MG08:IMON") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "QUAD:LTUS:470:BMON") } record(ao, "QUAD:LTUS:470:IRIPL") { field(DESC, "Ripple Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(DOL, "PSC:LTUS:MG08:IRIPL NPP NMS") field(OMSL, "closed_loop") field(EGU, "A") field(DRVH, "1.0") field(HOPR, "1.0") field(PREC, "3") field(FLNK, "QUAD:LTUS:470:IRIPLOK") } record(sub, "QUAD:LTUS:470:IRIPLOK") { field(DESC, "Ripple Current Status") field(INAM, "mgntInit") field(SNAM, "mgntRiplOK") field(INPA, "QUAD:LTUS:470:IRIPL.VAL") field(INPB, "QUAD:LTUS:470: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, "QUAD:LTUS:470:R") { field(DESC, "Resistance") field(EGU, "Ohms") field(PREC, "4") field(PINI, "YES") field(DOL, "PSC:LTUS:MG08:R NPP MS") 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, "QUAD:LTUS:470:IGND") { field(DESC, "Ground Current") field(EGU, "A") field(PREC, "6") field(PINI, "YES") field(DOL, "PSC:LTUS:MG08:IGND NPP MS") field(OMSL, "closed_loop") } record(bi, "QUAD:LTUS:470:INTLKSUMY") { field(DESC, "Interlock Summary") field(INP, "PSC:LTUS:MG08:INTLKSUMY NPP MS") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(ZNAM, "OK") field(ONAM, "FAULT") field(PINI, "NO") } record(mbbo, "QUAD:LTUS:470: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, "PSC:LTUS:MG08:COOLING") field(OMSL, "closed_loop") } # The following PV is processed by :BACTFO # which is processed by :BACT record(fanout, "QUAD:LTUS:470:IACTFO") { field(DESC, "IACT processing") field(SELM, "All") field(LNK1, "QUAD:LTUS:470:IACTPREVOK") field(LNK2, "QUAD:LTUS:470:IDIFF") field(LNK3, "QUAD:LTUS:470:IADIFF") field(LNK4, "QUAD:LTUS:470:IRATIO") field(LNK5, "QUAD:LTUS:470:IDIRECT") field(LNK6, "QUAD:LTUS:470:IACTPOL_CHECK") } record(calc, "QUAD:LTUS:470:IDIFF") { field(DESC, "IDES-IACT") field(CALC, "A-B") field(INPA, "QUAD:LTUS:470:IDES") field(INPB, "QUAD:LTUS:470:IACT") field(EGU, "A") field(PREC, "9") field(HOPR, "200.0") field(LOPR, "0.0") } record(calc, "QUAD:LTUS:470:IADIFF") { field(DESC, "Absolute IDES-IACT") field(CALC, "A<0?ABS(A):A") field(INPA, "QUAD:LTUS:470:IDIFF") field(PREC, "9") } record(calc, "QUAD:LTUS:470:IRATIO") { field(DESC, "IDES-IACT/IMAX") field(CALC, "B?A/B:0") field(INPA, "QUAD:LTUS:470:IDIFF") field(INPB, "QUAD:LTUS:470:IDES.DRVH") field(PREC, "9") } record(calcout, "QUAD:LTUS:470:IRANGE") { field(DESC, "Current Range") field(PINI, "YES") field(CALC, "ABS(A-B)") field(INPA, "QUAD:LTUS:470:IMIN") field(INPB, "QUAD:LTUS:470: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, "QUAD:LTUS:470: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, "QUAD:LTUS:470:IACT") field(FLNK, "QUAD:LTUS:470:IACTPOL") } record(bo, "QUAD:LTUS:470:IACTPOL") { field(DESC, "Actual I Polarity") field(DTYP, "Raw Soft Channel") field(DOL, "QUAD:LTUS:470: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,"QUAD:LTUS:470:I*LIMITS:\n Calculate alarm and warning limits based on \n deltas from QUAD:LTUS:470:IDELTAS and the\n QUAD:LTUS:470: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,"QUAD:LTUS:470:IACT: \n Get copy of QUAD:LTUS:470:I. \n",null) #! TextBox(TB12,1280,3100,1760,3200,0,"Dialog",12,1,16777215,"QUAD:LTUS:470: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,"QUAD:LTUS:470:IDES:\n Contains raw value calculated by \nQUAD:LTUS:470: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 \nQUAD:LTUS:470:BDELTAS.\n",null) #! TextBox(TB10,56,1940,316,2340,0,"Dialog",12,1,16777215,"QUAD:LTUS:470: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 QUAD:LTUS:470: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 QUAD:LTUS:470: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,"QUAD:LTUS:470:ISETPT:\n Sets the hardware. When fast feedback is set on, this record is\n set to closed loop mode by QUAD:LTUS:470:FBCKSTART sequence. When \n the loop is closed, this record takes input calculated by \n BFBCK only. When fast feedback is set off, QUAD:LTUS:470:FBCKSTOP \n will set it back to supervisory so that the value can be set by \n QUAD:LTUS:470: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, "QUAD:LTUS:470:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:470:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "QUAD:LTUS:470:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "QUAD:LTUS:470:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "QUAD:LTUS:470:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "QUAD:LTUS:470:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "1") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "QUAD:LTUS:470: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, "QUAD:LTUS:470:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "QUAD:LTUS:470:TRIMTYPE.RVAL") field(INPB, "QUAD:LTUS:470:CONFIG.RVAL") field(OUT, "QUAD:LTUS:470:TRIMMAXNUM PP") } record(longout, "QUAD:LTUS:470: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, "QUAD:LTUS:470: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, "") field(OMSL, "supervisory") field(VAL, "10") field(OUT, "QUAD:LTUS:470:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "QUAD:LTUS:470: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, "") field(OMSL, "supervisory") field(VAL, "10") } record(bo, "QUAD:LTUS:470: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, "QUAD:LTUS:470: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, "QUAD:LTUS:470: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, "QUAD:LTUS:470:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "0") } record(ao, "QUAD:LTUS:470: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, "QUAD:LTUS:470:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "QUAD:LTUS:470: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, "QUAD:LTUS:470: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, "QUAD:LTUS:470:IMOVE") field(INPB, "QUAD:LTUS:470:IACT") field(INPC, "QUAD:LTUS:470:IRAMPRATE") field(INPD, "1.577") field(INPE, "QUAD:LTUS:470:TRIMDLYPCT") field(INPF, "QUAD:LTUS:470:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "QUAD:LTUS:470:RAMPTIME_LEFT PP") } record(longout, "QUAD:LTUS:470:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "QUAD:LTUS:470:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "QUAD:LTUS:470:RAMPDONE_CALC") } record(calc, "QUAD:LTUS:470:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "QUAD:LTUS:470:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "QUAD:LTUS:470:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "QUAD:LTUS:470: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, "QUAD:LTUS:470:RAMPTIME_LEFT") field(OUT, "QUAD:LTUS:470:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "QUAD:LTUS:470:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "QUAD:LTUS:470:RAMPTIME_LEFT NMS") field(OUT, "QUAD:LTUS:470:RAMPDONE PP") } record(bo, "QUAD:LTUS:470:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "QUAD:LTUS:470:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "QUAD:LTUS:470: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, "QUAD:LTUS:470: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, "QUAD:LTUS:470:STDZINIT") { field(DESC, "Proc. Stdz PVs on boot") field(PINI, "YES") field(DOL1, "1") field(DOL2, "1") field(DOL3, "1") field(LNK1, "QUAD:LTUS:470:DEBUG.PROC PP") field(LNK2, "QUAD:LTUS:470:STDZCYCLENUM.PROC PP") field(LNK3, "QUAD:LTUS:470:STDZDISABLE.PROC PP") field(LNK4, "QUAD:LTUS:470: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, "QUAD:LTUS:470:STDZSUB") { field(DESC, "Stdz subroutine") field(INAM, "mgntStdzInit") field(SNAM, "mgntStdz") field(BRSV, "INVALID") field(INPA, "QUAD:LTUS:470:STDZIMIN NPP NMS") field(INPB, "QUAD:LTUS:470:STDZIMAX NPP NMS") field(INPC, "QUAD:LTUS:470:STDZIFINAL NPP NMS") field(INPD, "QUAD:LTUS:470:STDZCYCLENUM NPP NMS") field(INPE, "QUAD:LTUS:470:STDZDIRECT.RVAL NPP NMS") field(INPF, "QUAD:LTUS:470:STDZDISABLE.RVAL CPP NMS") field(INPG, "QUAD:LTUS:470: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, "QUAD:LTUS:470:STDZWF PP") field(OUTB, "QUAD:LTUS:470: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, "QUAD:LTUS:470:STDZWF") } record(mbbo, "QUAD:LTUS:470: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, "QUAD:LTUS:470: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, "QUAD:LTUS:470:STDZMAINPS") { field(DESC, "Stdz by main or self") field(PINI, "YES") field(DTYP, "Soft Channel") field(ZNAM, "SELF") field(ONAM, "MAIN") } record(bo, "QUAD:LTUS:470: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, "QUAD:LTUS:470: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, "QUAD:LTUS:470: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, "QUAD:LTUS:470:STDZTOD") { field(DESC, "Successful Standardize Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "QUAD:LTUS:470:STDZLOSTTOD") { field(DESC, "Standardize Lost Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(longout, "QUAD:LTUS:470:STDZCYCLECNT") { field(DESC, "Cycle Count") field(PINI, "YES") } record(longout, "QUAD:LTUS:470:STDZCYCLENUM") { field(DESC, "No. Standardize Cycles") field(VAL, "3") field(HOPR, "10") field(LOPR, "0") field(DRVH, "10") field(DRVL, "0") field(PINI, "YES") field(FLNK, "QUAD:LTUS:470:STDZDIRECT") } # The default standardize direction is "UP" for # all LCLS Magnets.. record(bo, "QUAD:LTUS:470:STDZDIRECT") { field(DESC, "Standardize Direction ") field(ZNAM, "UP") field(ONAM, "DOWN") field(VAL, "0") field(FLNK, "QUAD:LTUS:470:STDZIMIN") } record(ao, "QUAD:LTUS:470:STDZIMIN") { field(DESC, "Min-STDZ Current") field(PREC, "1") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(VAL, "0.0") field(FLNK, "QUAD:LTUS:470:STDZIMAX") } record(ao, "QUAD:LTUS:470:STDZIMAX") { field(DESC, "Max. Standarize Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(VAL, "200.0") field(FLNK, "QUAD:LTUS:470:STDZIFINAL") } record(ao, "QUAD:LTUS:470:STDZIFINAL") { field(DESC, "Final SDTZ Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(VAL, "0.0") field(FLNK, "QUAD:LTUS:470: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, "QUAD:LTUS:470: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, "QUAD:LTUS:470:STDZITOL") { field(DESC, "Stdz min tolerance") field(PREC, "5") field(CALC, "MAX(ABS(A),ABS(B))*C") field(INPA, "QUAD:LTUS:470:STDZIMIN CP NMS") field(INPB, "QUAD:LTUS:470:STDZIMAX CP MMS") field(INPC, "0.05") field(INPD, "QUAD:LTUS:470:STDZITOLR CP MMS") field(EGU, "A") field(FLNK, "QUAD:LTUS:470:IDELTAS") field(PINI, "YES") } # D - factor (3.154/2 = 1.577) for EPSC, otherwise, set to 1.0 record(calc, "QUAD:LTUS:470:STDZDLY") { field(DESC, "Ramp time for stdz cycle") field(CALC, "C>0?MAX(1,ABS((A-B)/C)*D):0") field(INPA, "QUAD:LTUS:470:STDZIMIN CP NMS") field(INPB, "QUAD:LTUS:470:STDZIMAX CP NMS") field(INPC, "QUAD:LTUS:470:TRIMRAMPRATE CP NMS") field(INPD, "1.577") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") } record(calc, "QUAD:LTUS:470:STDZRAMPDLY") { field(DESC, "Ramp delay total") field(CALC, "MAX(1,((A/100)*B+B))") field(PREC, "5") field(INPA, "QUAD:LTUS:470:TRIMDLYPCT CP MS") field(INPB, "QUAD:LTUS:470: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, "QUAD:LTUS:470:STDZMINIDLY") { field(DESC, "Mini-stdz delay") field(CALC, "A") field(PREC, "5") field(A, "1.0") field(EGU, "sec") field(PINI, "YES") } record(ao, "QUAD:LTUS:470: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, "QUAD:LTUS:470:STDZMINIDELTA") { field(DESC, "Stdz mini % of IMAX") field(CALC, "(B/100)*(A-C)") field(INPA, "QUAD:LTUS:470:IDES.HOPR") field(INPB, "QUAD:LTUS:470:STDZMINIPCT CPP NMS") field(INPC, "QUAD:LTUS:470:IDES.LOPR") field(PREC, "5") } record(calc, "QUAD:LTUS:470:STDZMINISETPT") { field(DESC, "Mini Stdz delta") field(CALC, "C==0?MAX(E-D,B):MIN(E+D,A)") field(INPA, "QUAD:LTUS:470:IDES.HOPR") field(INPB, "QUAD:LTUS:470:IDES.LOPR") field(INPC, "QUAD:LTUS:470:STDZDIRECT.RVAL") field(INPD, "QUAD:LTUS:470:STDZMINIDELTA") field(INPE, "QUAD:LTUS:470:IDES") field(PREC, "5") field(FLNK, "QUAD:LTUS:470: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, "QUAD:LTUS:470:STDZMINISETPTOOR") { field(DESC, "Mini Stdz setpoint out of range") field(CALC, "C==0?(E-DA)") field(INPA, "QUAD:LTUS:470:IDES.HOPR") field(INPB, "QUAD:LTUS:470:IDES.LOPR") field(INPC, "QUAD:LTUS:470:STDZDIRECT.RVAL") field(INPD, "QUAD:LTUS:470:STDZMINIDELTA") field(INPE, "QUAD:LTUS:470: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, "QUAD:LTUS:470: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, "QUAD:LTUS:470:IADJUST.RVAL") field(INPB, "QUAD:LTUS:470:STDZDIRECT.RVAL") field(INPC, "QUAD:LTUS:470:STDZOK.RVAL") field(INPD, "QUAD:LTUS:470:STDZDISABLE.RVAL") field(INPE, "QUAD:LTUS:470:STATE.RVAL CPP NMS") field(INPF, "QUAD:LTUS:470:ICTRL.RVAL") field(INPG, "QUAD:LTUS:470:STATE.SEVR") field(INPH, "QUAD:LTUS:470:BDELTAS.M") field(INPI, "QUAD:LTUS:470:IACT.SEVR") field(OUT, "QUAD:LTUS:470:STDZLOSTGO.SELN PP NMS") field(OOPT, "Transition To Non-zero") } record(seq, "QUAD:LTUS:470:STDZLOSTGO") { field(DESC, "Process lost stdz") field(SELM, "Mask") field(DOL1, "1") field(DOL2, "0") field(LNK1, "QUAD:LTUS:470:STDZLOSTTOD.PROC") field(LNK2, "QUAD:LTUS:470:STDZOK PP") } # Record maximum current after standardize # Reset to IACT from sequence after trim # Disable processing during (mini-)standardize or trim record(calc, "QUAD:LTUS:470:STDZIACTMAX") { field(DESC, "Max act current after stdz") field(CALC, "MAX(A, B)") field(DISV, "0") field(SDIS, "QUAD:LTUS:470:CHECKPWRDIP_ENABLE") field(INPA, "QUAD:LTUS:470:IACT CP") field(INPB, "QUAD:LTUS:470:STDZIACTMAX") field(EGU, "A") field(FLNK, "QUAD:LTUS:470:CHECKPWRDIP") } # Detect power dip if STDZOK is YES, STDZ is enabled, and IACT is valid # If IACT drops below STDZIACTMAX by more than the trim tolerance, clear STDZOK # Warning: Take the absolute value of the trim tolerance, or else quads of # negative polarity will always lose STDZ since their IDELTAS.I are negative. # Note: Large quads and bends are prone to losing STDZ even if they are # perturbed toward higher current since their current tends to overshoot # by greater than the trim tolerance before settling down. record(calcout, "QUAD:LTUS:470:CHECKPWRDIP") { field(DESC, "Detect power dip") field(CALC, "(A-B>ABS(C))?3:0") field(DISV, "0") field(SDIS, "QUAD:LTUS:470:CHECKPWRDIP_ENABLE") field(INPA, "QUAD:LTUS:470:STDZIACTMAX") field(INPB, "QUAD:LTUS:470:IACT") field(INPC, "QUAD:LTUS:470:IDELTAS.I") field(OUT, "QUAD:LTUS:470:STDZLOSTGO.SELN PP NMS") field(OOPT, "When Non-zero") } # Enable processing of STDZIACTMAX and CHECKPWRDIP only if # STDZOK = YES, STDZDISABLE = NO, CTRL != Trim (2), and # CTRL != Stdz (4) record(calc, "QUAD:LTUS:470:CHECKPWRDIP_ENABLE") { field(CALC, "A&&!B&&(C#2)&&(C#4)") field(INPA, "QUAD:LTUS:470:STDZOK.RVAL CP") field(INPB, "QUAD:LTUS:470:STDZDISABLE.RVAL CP") field(INPC, "QUAD:LTUS:470:CTRL.RVAL CP") } #! 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, "QUAD:LTUS:470: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, "QUAD:LTUS:470:CALBOK") { field(DESC, "Successful Calibration") field(DTYP, "Raw Soft Channel") field(ZNAM, "NO") field(ONAM, "YES") field(DOL, "PSC:LTUS:MG08:CALBOK.RVAL") field(OMSL, "closed_loop") 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, "QUAD:LTUS:470:CALBSET") { field(DESC, "Use DAC Calbration") field(SCAN, "10 second") field(CALC, "A&&(B==0)&&C?31:960") field(INPA, "QUAD:LTUS:470:CALBOK") field(INPB, "QUAD:LTUS:470:CALBDISABLE") field(INPC, "QUAD:LTUS:470:CALBSLOPE") field(OOPT, "On Change") field(OUT, "QUAD:LTUS:470: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, "QUAD:LTUS:470:CALB_SEQ") { field(DESC, "Output Calib Values") field(SELM, "Mask") field(SELL, "QUAD:LTUS:470: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, "QUAD:LTUS:470:CALBSLOPE") field(DOL3, "QUAD:LTUS:470: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, "QUAD:LTUS:470:CALBTOD") { field(DESC, "Calibration Success Time") field(PINI, "YES") field(DOL, "PSC:LTUS:MG08:CALBTOD") field(OMSL, "closed_loop") field(DTYP, "Soft Channel") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:470: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, "QUAD:LTUS:470: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, "QUAD:LTUS:470: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, "QUAD:LTUS:470:CALBOFFSET") { field(DESC, "Calc DAC Offset") field(PREC, "6") field(EGU, "Counts") field(PINI, "YES") } record(bo, "QUAD:LTUS:470: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, "QUAD:LTUS:470:DACSLOPE") { field(DESC, "V to DAC slope") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "closed_loop") field(PINI, "YES") field(FLNK, "QUAD:LTUS:470:DACOFFSET") } # Default Offset used in conversion from Volts to DAC Counts record(ao, "QUAD:LTUS:470:DACOFFSET") { field(DESC, "V to DAC offset") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "closed_loop") field(PINI, "YES") field(FLNK, "QUAD:LTUS:470: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, "QUAD:LTUS:470: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, "QUAD:LTUS:470:IACT") field(INPD, "QUAD:LTUS:470:DACSLOPE") field(INPE, "QUAD:LTUS:470:DACOFFSET") field(EGU, "Counts") field(PREC, "6") } record(ao, "QUAD:LTUS:470:DAC") { field(DESC, "DAC Set point") field(EGU, "Counts") field(DOL, "") field(OMSL, "closed_loop") field(PREC, "6") field(PINI, "YES") } record(ao, "QUAD:LTUS:470:CALBIMIN") { field(DESC, "Calibration Min Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(DRVH, "200.0") field(HOPR, "200.0") field(DRVL, "0.0") field(LOPR, "0.0") field(PREC, "3") field(EGU, "A") field(VAL, "0.0") field(FLNK, "QUAD:LTUS:470:CALBIMAX") } record(ao, "QUAD:LTUS:470:CALBIMAX") { field(DESC, "Calibration Max Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(DRVH, "200.0") field(HOPR, "200.0") field(LOPR, "0.0") field(DRVL, "0.0") field(EGU, "A") field(VAL, "200.0") field(FLNK, "QUAD:LTUS:470:CALBSTEPNUM") } record(ao, "QUAD:LTUS:470:CALBIFINAL") { field(DESC, "Calibration Last Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(PREC, "3") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(VAL, "0") } record(longout, "QUAD:LTUS:470: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, "QUAD:LTUS:470:CALBIDELTA") } record(calc, "QUAD:LTUS:470:CALBIDELTA") { field(DESC, "Step size for CALB") field(CALC, "C=0?0:ABS((A-B)/C)") field(INPA, "QUAD:LTUS:470:CALBIMAX") field(INPB, "QUAD:LTUS:470:CALBIMIN") field(INPC, "QUAD:LTUS:470: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, "QUAD:LTUS:470:CALBIMULT") { field(DESC, "IACT vs ISETPT mult") field(CALC, "C#0||A=0?1:ABS(B/A)") field(INPA, "PSC:LTUS:MG08:ISETPT.DRVH") field(INPB, "PSC:LTUS:MG08:IACT.HOPR") field(INPC, "QUAD:LTUS:470:PSCONTROLLER.RVAL CPP") field(EGU, "A") field(PINI, "YES") } # SNL dbputs DAC values here. 6-10 steps are possible. record(waveform, "QUAD:LTUS:470:CALBICTRLWF") { field(DESC, "ICTRL setpoint array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") } record(waveform, "QUAD:LTUS:470:DACWF") { field(DESC, "DAC count array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:470:DACSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:470:DACSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "QUAD:LTUS:470: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, "QUAD:LTUS:470:CALCDACWF") { field(DESC, "Calc DAC counts array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:470:CALCDACSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:470:CALCDACSA") { field(DESC, "Calc DAC counts") field(DTYP, "Soft Channel") field(INP, "QUAD:LTUS:470: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, "QUAD:LTUS:470:CALBYWF") { field(DESC, "mx + b") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:470:CALBYSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:470:CALBYSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "QUAD:LTUS:470:CALBYWF") field(MALM, "10") field(NELM, "6") field(INDX, "0") field(FTVL, "DOUBLE") } record(waveform, "QUAD:LTUS:470:CALBIACTWF") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:470:CALBIACTSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:470:CALBIACTSA") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(MALM, "10") field(NELM, "6") field(INP, "QUAD:LTUS:470:CALBIACTWF") field(INDX, "0") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:470:CALBLIMITS") } # Check that measured current during calibration is within # tolerance. record(aSub, "QUAD:LTUS:470: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, "QUAD:LTUS:470:CALBSTEPNUM") field(INPB, "QUAD:LTUS:470:CALBIACTWF") field(INPC, "QUAD:LTUS:470: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, "QUAD:LTUS:470: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, "QUAD:LTUS:470:STDZITOL") field(INPH, "QUAD:LTUS:470:DACSLOPE") field(INPI, "QUAD:LTUS:470: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, "QUAD:LTUS:470: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, "QUAD:LTUS:470:CALBSTEPNUM") field(INPB, "QUAD:LTUS:470:CALBIACTWF") field(INPC, "QUAD:LTUS:470:DACWF") field(INPF, "QUAD:LTUS:470: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 QUAD:LTUS:470CALBOK 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, "QUAD:LTUS:470:DEGAUSINIT") { field(DESC, "Proc. Degauss PVs on boot") field(PINI, "YES") field(DOL, "1") field(OUTA, "QUAD:LTUS:470:DEGAUSIMIN.PROC PP") field(OUTB, "QUAD:LTUS:470:DEGAUSIMAX.PROC PP") field(OUTC, "QUAD:LTUS:470:DEGAUSTYPE.PROC PP") field(OUTD, "QUAD:LTUS:470:DEGAUSSTEP.PROC PP") field(OUTE, "QUAD:LTUS:470:MADNAME.PROC PP") field(OUTF, "QUAD:LTUS:470:PSTYPE.PROC PP") field(OUTG, "QUAD:LTUS:470: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, "QUAD:LTUS:470:DEGAUSSUB") { field(DESC, "Degauss subroutine") field(INAM, "mgntDegaussInit") field(SNAM, "mgntDegauss") field(BRSV, "INVALID") field(INPA, "QUAD:LTUS:470:DEGAUSIMIN NPP NMS") field(INPB, "QUAD:LTUS:470:DEGAUSIMAX NPP NMS") field(INPC, "QUAD:LTUS:470:DEGAUSTYPE.RVAL NPP NMS") field(INPE, "QUAD:LTUS:470:DEGAUSMETHOD.RVAL NPP NMS") field(INPF, "QUAD:LTUS:470:PSTYPE NPP NMS") field(INPG, "QUAD:LTUS:470:DEBUG.RVAL NPP NMS") field(INPH, "QUAD:LTUS:470: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, "QUAD:LTUS:470:DEGAUSWF PP") field(OUTB, "QUAD:LTUS:470:DEGAUSMSG PP") field(OUTC, "QUAD:LTUS:470: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, "QUAD:LTUS:470:DEGAUSWF") { field(DESC, "Degauss Setpts") field(NELM, "60") field(FTVL, "DOUBLE") } record(mbbo,"QUAD:LTUS:470: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, "QUAD:LTUS:470: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, "QUAD:LTUS:470: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, "QUAD:LTUS:470: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, "QUAD:LTUS:470: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, "QUAD:LTUS:470:DEGAUSIMIN") { field(DESC, "Min. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "200.0") field(LOPR, "-200.0") field(DRVH, "200.0") field(DRVL, "-200.0") field(VAL, "-200.0") } record(ao, "QUAD:LTUS:470:DEGAUSIMAX") { field(DESC, "Max. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "200.0") field(LOPR, "-200.0") field(DRVH, "200.0") field(DRVL, "-200.0") field(VAL, "200.0") } # 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,"QUAD:LTUS:470: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, "QUAD:LTUS:470: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,"QUAD:LTUS:470: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, "QUAD:LTUS:470: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, "QUAD:LTUS:470: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, "QUAD:LTUS:470: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, "QUAD:LTUS:470:DEGAUSTOD") { field(DESC, "Successful Degauss Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "QUAD:LTUS:470:DEGAUSLOSTTOD") { field(DESC, "Degauss Lost Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:470:DEGAUSTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "QUAD:LTUS:470:DEGAUSTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "QUAD:LTUS:470: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, "QUAD:LTUS:470:DEGAUSGO") { field(DESC, "Set bdes of btrms to zero") field(ASG, "Internal") field(OUTA, "") field(OUTB, "") field(OUTC, "") field(OUTD, "") } # =========== CRYO ONLY =========== record(bo, "QUAD:LTUS:470: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, "QUAD:LTUS:470:DEGAUS_IMAX_CHECK") { field(DESC, "Check if imax shoud chg") field(CALC, "(C==4)&&(ABS(B)>ABS(A))?1:0") field(INPA, "QUAD:LTUS:470:DEGAUS_IMAX") field(INPB, "QUAD:LTUS:470:ISETPT") field(INPC, "QUAD:LTUS:470:DEGAUSTYPE.RVAL") field(OUT, "QUAD:LTUS:470:DEGAUS_IMAX_UPDATE.SELN") field(FLNK, "QUAD:LTUS:470:DEGAUS_IMAX_UPDATE") } record(seq, "QUAD:LTUS:470:DEGAUS_IMAX_UPDATE") { field(DESC, "Degauss IMAX Update") field(SELM, "Specified") field(DOL1, "QUAD:LTUS:470:ISETPT") field(LNK1, "QUAD:LTUS:470:DEGAUS_IMAX PP") } # Set the maximum current after a successful # degauss. This pv is updated by the # sequence. record(ao, "QUAD:LTUS:470:DEGAUS_IMAX") { field(DESC, "Max I set afer a degauss") field(EGU, "Amps") field(PINI, "YES") field(PREC, "6") field(HOPR, "200.0") field(LOPR, "-200.0") field(DRVH, "200.0") field(DRVL, "-200.0") field(VAL, "200.0") field(FLNK, "QUAD:LTUS:470:DEGAUS_IMAXPOL_CHECK") info(autosaveFields,"VAL,RVAL") } # Set the polarity if degauss_imax record(calcout, "QUAD:LTUS:470:DEGAUS_IMAXPOL_CHECK") { field(DESC, "Determine polarity of imax") field(CALC, "A>=0?0:1") field(INPA, "QUAD:LTUS:470:DEGAUS_IMAX") field(FLNK, "QUAD:LTUS:470:DEGAUS_IMAXPOL") } record(bo, "QUAD:LTUS:470:DEGAUS_IMAXPOL") { field(DESC, "Polarity of imax I") field(DTYP, "Raw Soft Channel") field(DOL, "QUAD:LTUS:470:DEGAUS_IMAXPOL_CHECK") field(OMSL, "closed_loop") field(ZNAM, "Positive") field(ONAM, "Negative") field(FLNK, "QUAD:LTUS:470: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, "QUAD:LTUS:470:DEGAUS_ABSIMAX") { field(DESC, "Absolute Max. Degauss I") field(CALC, "ABS(A)") field(INPA, "QUAD:LTUS:470:DEGAUS_IMAX") field(PREC, "6") field(EGU, "Amps") field(HOPR, "200.0") field(LOPR, "-200.0") info(autosaveFields,"VAL RVAL") } # IACT Polarity record(calcout, "QUAD:LTUS:470:IACTPOL_CHECK") { field(DESC, "Determine IACT polarity") field(SCAN, "5 second") field(CALC, "ABS(A-B)>C?(A>=0?0:1):D") field(INPA, "QUAD:LTUS:470:IACT") field(INPB, "QUAD:LTUS:470:IACTPOL_CHECK.LA") field(INPC, "0.0001") field(INPD, "QUAD:LTUS:470:IACTPOL_CHECK.PVAL") field(OOPT, "On Change") field(FLNK, "QUAD:LTUS:470:IACTPOL") } record(bo, "QUAD:LTUS:470: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,"QUAD:LTUS:470: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, "QUAD:LTUS:470:DEGAUSENABLE CP") field(INPB, "QUAD:LTUS:470:DEGAUSOK") field(INPC, "QUAD:LTUS:470:STATE CP") field(INPD, "QUAD:LTUS:470:STATE.SEVR") field(OUT, "QUAD:LTUS:470:DEGAUS_STATE_SEQ.SELN PP") field(ASG, "Internal") } record(seq, "QUAD:LTUS:470:DEGAUS_STATE_SEQ") { field(DESC, "Degauss State Sequence") field(SELM, "Specified") field(SELL, "QUAD:LTUS:470:DEGAUS_STATE_CHECK") field(LNK1, "QUAD:LTUS:470:DEGAUS_STATE_DISABLE.PROC PP") field(LNK2, "QUAD:LTUS:470:DEGAUS_STATE_LOST.PROC PP") field(LNK3, "QUAD:LTUS:470:DEGAUS_STATE_GOOD.PROC PP") field(LNK4, "QUAD:LTUS:470: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, "QUAD:LTUS:470:DEGAUS_STATE_DISABLE") { field(DESC, "Degauss not used") field(LNK1, "QUAD:LTUS:470:DEGAUSOK.ZSV") field(LNK2, "QUAD:LTUS:470: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, "QUAD:LTUS:470:STATMSG.FRSV") field(LNK4, "QUAD:LTUS:470: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, "QUAD:LTUS:470:DEGAUS_STATE_LOST") { field(DESC, "Degauss lost and ps On") field(DOL1, "1") field(LNK1, "QUAD:LTUS:470:DEGAUSOK.ZSV") field(LNK2, "QUAD:LTUS:470: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, "QUAD:LTUS:470:STATMSG.FRSV") field(LNK4, "QUAD:LTUS:470: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, "QUAD:LTUS:470:DEGAUS_STATE_OFF") { field(DESC, "Degaused lost and ps Off") field(DOL1, "2") field(LNK1, "QUAD:LTUS:470: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, "QUAD:LTUS:470:STATMSG.FRSV") field(LNK3, "QUAD:LTUS:470: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, "QUAD:LTUS:470:DEGAUS_STATE_GOOD") { field(DESC, "Degauss good") field(DOL1, "1") field(LNK1, "QUAD:LTUS:470: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, "QUAD:LTUS:470:STATMSG.FRSV PP") field(LNK3, "QUAD:LTUS:470:STATMSG.FVSV PP") field(LNK4, "") field(ASG, "Internal") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(mbbo, "QUAD:LTUS:470:FUNC") { field(DESC, "QUAD:LTUS:470 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, "1") field(THVL, "9") field(FRVL, "10") field(FVVL, "0") field(SXVL, "2") field(SVVL, "8") field(EIVL, "11") field(NIVL, "12") field(TEVL, "13") field(ELVL, "5") field(TVVL, "6") field(TTVL, "7") field(FTVL, "4") field(FFVL, "3") field(OUT, "QUAD:LTUS:470:CTRL CA") } # :CTRL pv is processed at boot in the # sequence mgntCtrl.st Processed in sequence # record(mbbo, "QUAD:LTUS:470:CTRL") { field(DESC, "QUAD:LTUS:470 Control") field(PINI, "NO") field(ZRST, "Ready") field(ONST, "TRIM") field(TWST, "PERTURB") field(THST, "BCON_TO_BDES") field(FRST, "BACT_TO_BDES") field(FVST, "SAVE_BDES") field(SXST, "LOAD_BDES") field(SVST, "UNDO_BDES") field(EIST, "DAC_ZERO") field(NIST, "CALB") field(TEST, "STDZ") field(ELST, "RESET") field(TVST, "TURN_ON") field(TTST, "TURN_OFF") field(FTST, "") field(FFST, "") field(ZRVL, "0") field(ONVL, "2") field(TWVL, "6") field(THVL, "15") field(FRVL, "14") field(FVVL, "11") field(SXVL, "12") field(SVVL, "13") field(EIVL, "7") field(NIVL, "3") field(TEVL, "4") field(ELVL, "8") field(TVVL, "9") field(TTVL, "10") field(FTVL, "0") field(FFVL, "0") field(OUT, "QUAD:LTUS:470:SELECTEN.A PP") field(SDIS, "0") } # If a function has been selected set this unit to busy record(calcout, "QUAD:LTUS:470:SELECTEN") { field(DESC, "Control Select Enable") field(CALC, "A>0?1:A") field(FLNK, "QUAD:LTUS:470:BUSY") } # Set to FREE on IOC reboot record(bo, "QUAD:LTUS:470:BUSY") { field(DESC, "QUAD:LTUS:470 Ctrl Done") field(DOL, "QUAD:LTUS:470:SELECTEN") field(ZNAM, "FREE") field(ONAM, "BUSY") field(PINI, "YES") field(FLNK, "QUAD:LTUS:470:SELECT") } record(bo, "QUAD:LTUS:470:SELECT") { field(ZNAM, "NO") field(ONAM, "YES") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") } record(bo, "QUAD:LTUS:470: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, "QUAD:LTUS:470:CTRLSTATE") { field(DESC, "QUAD:LTUS:470 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("QUAD:LTUS:470:CTRL",20,20,0,0,"QUAD:LTUS:470:CTRL") #! Field("QUAD:LTUS:470:CTRL.OUT",16777215,1,"QUAD:LTUS:470:CTRL.OUT") #! Link("QUAD:LTUS:470:CTRL.OUT","QUAD:LTUS:470:SELECTEN.A") #! Field("QUAD:LTUS:470:CTRL.VAL",16777215,1,"QUAD:LTUS:470:CTRL.VAL") #! Record("QUAD:LTUS:470:SELECTEN",321,381,0,0,"QUAD:LTUS:470:SELECTEN") #! Field("QUAD:LTUS:470:SELECTEN.A",16777215,0,"QUAD:LTUS:470:SELECTEN.A") #! Field("QUAD:LTUS:470:SELECTEN.FLNK",16777215,1,"QUAD:LTUS:470:SELECTEN.FLNK") #! Link("QUAD:LTUS:470:SELECTEN.FLNK","QUAD:LTUS:470:BUSY") #! Field("QUAD:LTUS:470:SELECTEN.VAL",16777215,1,"QUAD:LTUS:470:SELECTEN.VAL") #! Record("QUAD:LTUS:470:BUSY",623,274,0,0,"QUAD:LTUS:470:BUSY") #! Field("QUAD:LTUS:470:BUSY.DOL",16777215,0,"QUAD:LTUS:470:BUSY.DOL") #! Link("QUAD:LTUS:470:BUSY.DOL","QUAD:LTUS:470:SELECTEN.VAL") #! Field("QUAD:LTUS:470:BUSY.FLNK",16777215,1,"QUAD:LTUS:470:BUSY.FLNK") #! Link("QUAD:LTUS:470:BUSY.FLNK","QUAD:LTUS:470:SELECT") #! Record("QUAD:LTUS:470:SELECT",669,508,0,1,"QUAD:LTUS:470:SELECT") #! Record("QUAD:LTUS:470:FUNC",940,120,0,0,"QUAD:LTUS:470:FUNC") #! Field("QUAD:LTUS:470:FUNC.OUT",16777215,0,"QUAD:LTUS:470:FUNC.OUT") #! Link("QUAD:LTUS:470:FUNC.OUT","QUAD:LTUS:470:CTRL.VAL") #! Record("QUAD:LTUS:470:ABORT",193,41,0,0,"QUAD:LTUS:470:ABORT") #! Record("QUAD:LTUS:470:CTRLSTATE",369,34,0,0,"QUAD:LTUS:470: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,"QUAD:LTUS:470:SELECT is used for Multi-device selection.\nIt is enabled when associated QUAD:LTUS:470:CTRL is \"0\" (DONE).\nIt is disabled when associated QUAD:LTUS:470: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,"QUAD:LTUS:470: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, "QUAD:LTUS:470:BCTRL_INIT") { field(DESC, "Process BCTRL on boot") field(PINI, "YES") field(CALC, "A=3?1:0") field(INPA, "QUAD:LTUS:470:BCTRL.SEVR") field(OUT, "QUAD:LTUS:470: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, "QUAD:LTUS:470:BACT") { field(DESC, "Actual B") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "QUAD:LTUS:470:BACT") field(INPB, "QUAD:LTUS:470:POLYCOEF") field(INPC, "QUAD:LTUS:470:POLYCOEF.A") field(INPD, "QUAD:LTUS:470:POLYCOEF.B") field(INPE, "QUAD:LTUS:470:IACT MS") field(INPF, "QUAD:LTUS:470:BDELTAS PP") field(INPG, "100") field(EGU, "kG") field(HOPR, "-0.2558") field(LOPR, "-101.3244") field(HIHI, "-0.2558") field(LOLO, "-101.3244") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "-0.2558") field(LOW, "-101.3244") field(FLNK, "QUAD:LTUS:470: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, "QUAD:LTUS:470:BDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntPhyDeltas") field(EGU, "kG") field(HOPR, "1") field(PREC, "7") field(BRSV, "INVALID") field(INPA, "QUAD:LTUS:470:BDES") field(INPB, "QUAD:LTUS:470:TRIMBTOL") field(INPC, "QUAD:LTUS:470:TRIMBTOLR") field(INPD, "QUAD:LTUS:470:CHCKBTOL") field(INPE, "QUAD:LTUS:470:CHCKBTOLR") field(F, "2.0") field(INPG, "30") field(INPH, "QUAD:LTUS:470:BACT.VAL") # # MPS absolute and relative tolerances field(INPP, "QUAD:LTUS:470:MPSBTOL") field(INPQ, "QUAD:LTUS:470:MPSBTOLR") field(FLNK, "QUAD:LTUS:470:BCONLIMITS") info(autosaveFields,"F") } # This record is processed by BDELTAS record(aSub, "QUAD:LTUS:470:BCONLIMITS") { field(DESC, "Config B-field Limits") field(INAM, "mgntInit") field(SNAM, "mgntBCONLimits") field(INPA, "QUAD:LTUS:470:BDES") field(INPB, "QUAD:LTUS:470:BDELTAS.I") field(INPG, "QUAD:LTUS:470:DEBUG.RVAL") field(FTA, "DOUBLE") field(FTB, "DOUBLE") field(FTG, "ULONG") field(OUTA, "QUAD:LTUS:470:BCON.HIGH") field(OUTB, "QUAD:LTUS:470:BCON.LOW") field(OUTC, "QUAD:LTUS:470:BCON.HIHI") field(OUTD, "QUAD:LTUS:470:BCON.LOLO PP") field(FTVA, "DOUBLE") field(FTVB, "DOUBLE") field(FTVC, "DOUBLE") field(FTVD, "DOUBLE") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:470:IDELTAS") } # The following PV is processed by :BACT # which is processed by :BACT # record(fanout, "QUAD:LTUS:470:BACTFO") { field(DESC, "BACT processing") field(SELM, "All") field(LNK1, "QUAD:LTUS:470:BDIFF") field(LNK2, "QUAD:LTUS:470:BADIFF") field(LNK3, "QUAD:LTUS:470:BRATIO") field(LNK4, "QUAD:LTUS:470:MPSLIMITS") field(LNK5, "QUAD:LTUS:470:I2BSTATUS") field(LNK6, "QUAD:LTUS:470:IACTFO.PROC") } record(calc, "QUAD:LTUS:470:BDIFF") { field(DESC, "BDES-BACT") field(CALC, "A-B") field(INPA, "QUAD:LTUS:470:BDES") field(INPB, "QUAD:LTUS:470:BACT") field(EGU, "kG") field(PREC, "7") } record(calc, "QUAD:LTUS:470:BADIFF") { field(DESC, "Absolute BDES-BACT") field(INPA, "QUAD:LTUS:470:BDIFF") field(EGU, "kG") field(PREC, "7") field(CALC, "A<0?ABS(A):A") } record(calc, "QUAD:LTUS:470:BRATIO") { field(DESC, "BACT Error") field(CALC, "B?A/B:0") field(INPA, "QUAD:LTUS:470:BDIFF") field(INPB, "QUAD:LTUS:470:BDES.HOPR") field(EGU, "kG") field(PREC, "7") } record(mbbi, "QUAD:LTUS:470: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, "QUAD:LTUS:470:BACT.J") } # Note: for a string slave set the MONFL # macro to the following: # MONFL=:IMONCALC MS record(sub, "QUAD:LTUS:470:BMON") { field(DESC, "Second Transductor") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "QUAD:LTUS:470:BMON") field(INPB, "QUAD:LTUS:470:POLYCOEF") field(INPC, "QUAD:LTUS:470:POLYCOEF.A") field(INPD, "QUAD:LTUS:470:POLYCOEF.B") field(INPE, "QUAD:LTUS:470:IMON MS") field(INPF, "QUAD:LTUS:470:BDELTAS.VAL") field(INPG, "100") field(EGU, "kG") field(HOPR, "-0.2558") field(LOPR, "-101.3244") field(HIHI, "-0.2558") field(LOLO, "-101.3244") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "-0.2558") field(LOW, "-101.3244") } # 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=PSC:LTUS:MG08:BDES CP record(ao, "QUAD:LTUS:470:BDES") { field(DESC, "Desired B-Field") field(PINI, "YES") field(DRVH, "-0.2558") field(DRVL, "-101.3244") field(HOPR, "-0.2558") field(LOPR, "-101.3244") field(PREC, "7") field(EGU, "kG") field(MDEL, "-1") field(OMSL, "supervisory") # field(DOL, "") field(OUT, "QUAD:LTUS:470:B2IDES PP") info(autosaveFields,"VAL") } record(sub, "QUAD:LTUS:470:B2IDES") { field(DESC, "Convert Desired B-Field to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:470:POLYCOEF") field(INPC, "QUAD:LTUS:470:POLYCOEF.A") field(INPD, "QUAD:LTUS:470:POLYCOEF.B") field(PREC, "7") field(EGU, "kG") field(HOPR, "-0.2558") field(LOPR, "-101.3244") field(MDEL, "-1") field(INPE, "QUAD:LTUS:470:BDES.DRVH") field(INPF, "QUAD:LTUS:470:BDES.DRVL") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:470:IDES") } record(sub, "QUAD:LTUS:470:BNOM") { field(DESC, "Nominal Field") field(PINI, "YES") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:470:POLYCOEF") field(INPC, "QUAD:LTUS:470:POLYCOEF.A") field(INPD, "QUAD:LTUS:470:POLYCOEF.B") field(INPE, "QUAD:LTUS:470:BDES.DRVH") field(INPF, "QUAD:LTUS:470:BDES.DRVL") field(EGU, "kG") field(HOPR, "-0.2558") field(LOPR, "-101.3244") field(PREC, "7") field(VAL, "0.0") field(FLNK, "QUAD:LTUS:470:INOM") } record(sub, "QUAD:LTUS:470:BACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:470:BDES.VAL") field(INPB, "QUAD:LTUS:470:BDES.DRVH") field(INPC, "QUAD:LTUS:470:BDES.DRVL") field(INPD, "QUAD:LTUS:470:BDELTAS.I") field(INPE, "QUAD:LTUS:470:BDELTAS.J") field(INPG, "QUAD:LTUS:470:STATE") field(INPH, "QUAD:LTUS:470:HSTA") field(EGU, "kG") field(HOPR, "-0.2558") field(LOPR, "-101.3244") field(PREC, "7") field(BRSV, "INVALID") } record(sub, "QUAD:LTUS:470:BMONLIMITS") { field(DESC, "MON Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:470:BDES.VAL") field(INPB, "QUAD:LTUS:470:BDES.DRVH") field(INPC, "QUAD:LTUS:470:BDES.DRVL") field(INPD, "QUAD:LTUS:470:BDELTAS.K") field(INPE, "QUAD:LTUS:470:BDELTAS.L") field(INPG, "QUAD:LTUS:470:STATE") field(INPH, "QUAD:LTUS:470:HSTA") field(EGU, "kG") field(HOPR, "-0.2558") field(LOPR, "-101.3244") field(PREC, "7") field(BRSV, "INVALID") } record(seq, "QUAD:LTUS:470:BLIMITS") { field(DESC, "ACT Limits") field(PREC, "7") field(DOL1, "QUAD:LTUS:470:BLIMITS") field(LNK1, "QUAD:LTUS:470:BACTLIMITS.F PP") field(DOL2, "QUAD:LTUS:470:BACTLIMITS.I") field(LNK2, "QUAD:LTUS:470:BACT.HIGH") field(DOL3, "QUAD:LTUS:470:BACTLIMITS.J") field(LNK3, "QUAD:LTUS:470:BACT.LOW") field(DOL4, "QUAD:LTUS:470:BACTLIMITS.K") field(LNK4, "QUAD:LTUS:470:BACT.HIHI") field(DOL5, "QUAD:LTUS:470:BACTLIMITS.L") field(LNK5, "QUAD:LTUS:470:BACT.LOLO") field(DOL6, "QUAD:LTUS:470:BLIMITS") field(LNK6, "QUAD:LTUS:470:BMONLIMITS.F PP") field(DOL7, "QUAD:LTUS:470:BMONLIMITS.I") field(LNK7, "QUAD:LTUS:470:BMON.HIGH") field(DOL8, "QUAD:LTUS:470:BMONLIMITS.J") field(LNK8, "QUAD:LTUS:470:BMON.LOW") field(DOL9, "QUAD:LTUS:470:BMONLIMITS.K") field(LNK9, "QUAD:LTUS:470:BMON.HIHI") field(DOLA, "QUAD:LTUS:470:BMONLIMITS.L") field(LNKA, "QUAD:LTUS:470:BMON.LOLO") field(FLNK, "QUAD:LTUS:470:ILIMITS") field(SCAN, "5 second") } record(ao, "QUAD:LTUS:470:BCTRL") { field(DESC, "B-Perturb") field(PREC, "7") field(EGU, "kG") field(DRVH, "-0.2558") field(DRVL, "-101.3244") field(HOPR, "-0.2558") field(LOPR, "-101.3244") # 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, "QUAD:LTUS:470: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, "QUAD:LTUS:470:BCTRLGO") { field(DESC, "Update DES and perturb") field(PREC, "7") # Disable BACT limits field(DOL1, "1") field(LNK1, "QUAD:LTUS:470:BLIMITS.VAL") # Update BDES with the BCTRL (slider) value field(DOL2, "QUAD:LTUS:470:BCTRL.VAL") field(LNK2, "QUAD:LTUS:470:BDES PP") field(DOL3, "1") field(LNK3, "QUAD:LTUS:470:IDIRECT.PROC PP") field(DOL4, "1") field(LNK4, "QUAD:LTUS:470:CHECKSTDZLOST.PROC PP") field(DOL5, "QUAD:LTUS:470:BCTRL.VAL") field(LNK5, "QUAD:LTUS:470:BCTRLSUB PP") # Re-enable BACT limits field(DOL6, "0") field(LNK6, "QUAD:LTUS:470:BLIMITS.VAL") } # Convert B-field to Current and output to ISETPT record(sub, "QUAD:LTUS:470:BCTRLSUB") { field(DESC, "Feedback") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:470:POLYCOEF") field(INPC, "QUAD:LTUS:470:POLYCOEF.A") field(INPD, "QUAD:LTUS:470:POLYCOEF.B") field(INPE, "QUAD:LTUS:470:BDES.DRVH") field(INPF, "QUAD:LTUS:470:BDES.DRVL") field(PREC, "7") field(EGU, "kG") field(HOPR, "-0.2558") field(LOPR, "-101.3244") field(MDEL, "-1") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:470:ISETPT") } record(ao, "QUAD:LTUS:470:BDESPREVTRIM") { field(DESC, "trim bdes for undo") field(DTYP, "Soft Channel") field(DRVH, "-0.2558") field(DRVL, "-101.3244") field(EGU, "kG") field(HOPR, "-0.2558") field(LOPR, "-101.3244") field(PREC, "7") field(PINI, "YES") info(autosaveFields,"VAL") } record(stringin, "QUAD:LTUS:470:MADNAME") { field(DESC, "MAD deck nomenclature") field(PINI, "YES") field(VAL, "QDL20") } record(ai, "QUAD:LTUS:470: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, "3352.847179") } record(ao, "QUAD:LTUS:470:BMAX") { field(DESC, "Max B-Field") field(DTYP, "Soft Channel") field(DRVH, "-0.2558") field(DRVL, "-101.3244") field(EGU, "kG") field(HOPR, "-0.2558") field(LOPR, "-101.3244") field(PREC, "7") field(PINI, "YES") field(VAL, "-0.2558") field(FLNK, "QUAD:LTUS:470:BSTEP") } record(ao, "QUAD:LTUS:470:BMIN") { field(DESC, "Min B-Field") field(DTYP, "Soft Channel") field(DRVH, "-0.2558") field(DRVL, "-101.3244") field(EGU, "kG") field(HOPR, "-0.2558") field(LOPR, "-101.3244") field(PREC, "7") field(PINI, "YES") field(VAL, "-101.3244") field(FLNK, "QUAD:LTUS:470:BSTEP") } record(ao, "QUAD:LTUS:470:BDESSAVE") { field(DESC, "bdes for save/load") field(DTYP, "Soft Channel") field(DRVH, "-0.2558") field(DRVL, "-101.3244") field(EGU, "kG") field(HOPR, "-0.2558") field(LOPR, "-101.3244") field(PINI, "YES") field(PREC, "7") } # This record is processed by QUAD:LTUS:470: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, "QUAD:LTUS:470:BCON") { field(DESC, "Config B-Field ") field(DTYP, "Soft Channel") field(PREC, "7") field(EGU, "kG") field(HOPR, "-0.2558") field(LOPR, "-101.3244") field(DRVH, "-0.2558") field(DRVL, "-101.3244") # Set MINOR Alarm as the default, slaves will set NO_ALARM=0. field(HHSV, "MINOR") field(LLSV, "MINOR") field(HSV, "MINOR") field(LSV, "MINOR") # field(DOL , "") field(OMSL, "supervisory") field(OUT, "QUAD:LTUS:470:B2ICON PP") info(autosaveFields,"VAL") } record(sub, "QUAD:LTUS:470:B2ICON") { field(DESC, "Convert Desired ICon to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:470:POLYCOEF") field(INPC, "QUAD:LTUS:470:POLYCOEF.A") field(INPD, "QUAD:LTUS:470:POLYCOEF.B") field(PREC, "7") field(EGU, "kG") field(HOPR, "-0.2558") field(LOPR, "-101.3244") field(MDEL, "-1") field(INPE, "QUAD:LTUS:470:BCON.DRVH") field(INPF, "QUAD:LTUS:470:BCON.DRVL") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:470: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, "QUAD:LTUS:470:BSTEP") { field(DESC, "B-Field step size") field(CALC, "(C==3)||(D==3)?0:ABS(A-B)*0.005") field(INPA, "QUAD:LTUS:470:BMAX") field(INPB, "QUAD:LTUS:470:BMIN") field(INPC, "QUAD:LTUS:470:BMIN.SEVR") field(INPD, "QUAD:LTUS:470:BMAX.SEVR") field(EGU, "kG") 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,"QUAD:LTUS:470:BCTRLDISABLECALC") { field(DESC, "Calc for disabling BCTRL") field(ASG, "Internal") field(CALC, "A?2:1") field(INPA, "QUAD:LTUS:470:ONLINE CP") field(OUT, "QUAD:LTUS:470:BCTRLDISABLEFOUT PP") } record(fanout, "QUAD:LTUS:470:BCTRLDISABLEFOUT") { field(DESC, "Disable BCTRL fanout") field(SELM, "Specified") field(SELL, "QUAD:LTUS:470:BCTRLDISABLECALC") field(LNK1, "QUAD:LTUS:470:BCTRLDISABLE") field(LNK2, "QUAD:LTUS:470:BCTRLENABLE") } record(stringout, "QUAD:LTUS:470:BCTRLDISABLE") { field(DESC, "Disable BCTRL") field(DTYP, "Soft Channel") field(OUT, "QUAD:LTUS:470:BCTRL.ASG") field(VAL, "NOWRITE") field(FLNK, "QUAD:LTUS:470:BCTRLDISV_UPDATE") } record(stringout, "QUAD:LTUS:470:BCTRLENABLE") { field(DESC, "Enable BCTRL") field(DTYP, "Soft Channel") field(OUT, "QUAD:LTUS:470:BCTRL.ASG") field(VAL, "") field(FLNK, "QUAD:LTUS:470:BCTRLDISV_UPDATE") } record(calcout, "QUAD:LTUS:470:BCTRLDISV_UPDATE") { field(DESC, "Calc for updating BCTRL.DISV") field(ASG, "Internal") field(CALC, "A") field(INPA, "QUAD:LTUS:470:ONLINE") field(OUT, "QUAD:LTUS:470: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,"QUAD:LTUS:470:BACT and MON\n are processed via links from \n QUAD:LTUS:470:IACT (device raw value readback 1)\n and\n QUAD:LTUS:470: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 QUAD:LTUS:470:POLYCOEF\nC = First polynomial coefficient (offset if linear)\nD = Second polynomial coefficient (slope if linear)\nE = QUAD:LTUS:470: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,"QUAD:LTUS:470:BDES\n is processed when set by CA users or \n QUAD:LTUS:470: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,"QUAD:LTUS:470: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 QUAD:LTUS:470: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 (QUAD:LTUS:470: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,"QUAD:LTUS:470:B*LIMITS and QUAD:LTUS:470:BLIMITS:\n Calculate alarm and warning limits based on \n deltas from QUAD:LTUS:470: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,"QUAD:LTUS:470: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,"QUAD:LTUS:470: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, "QUAD:LTUS:470: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, "QUAD:LTUS:470:MPSBTOL") { field(DESC, "Absolute mps tol") field(EGU, "kG") field(PREC, "2") field(CALC, "ABS(A)*0.02") field(INPA, "QUAD:LTUS:470:BMAX") field(PINI, "YES") } # # 21-Aug-2013: K. Luchini # Set channel access security so that users # cannot easily change values. record(ao, "QUAD:LTUS:470:MPSBMAX") { field(DESC, "MPS Max B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "-0.2558") field(DRVL, "-101.3244") field(PINI, "YES") field(VAL, "-0.2558") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:470:MPSBMIN") { field(DESC, "MPS Min B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "-0.2558") field(DRVL, "-101.3244") field(PINI, "YES") field(VAL, "-101.3244") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:470:MPSBLLIM") { field(DESC, "MPS Low Limit B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "-0.2558") field(DRVL, "-101.3244") field(PINI, "YES") field(VAL, "-101.3244") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:470:MPSBLLIM2") { field(DESC, "MPS Low Limit #2 B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "-0.2558") field(DRVL, "-101.3244") field(PINI, "YES") field(VAL, "-101.3244") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } # Set the default to Std record(mbbo, "QUAD:LTUS:470: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, "QUAD:LTUS:470:MPSLIMITS.E PP") } record(aSub, "QUAD:LTUS:470: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, "QUAD:LTUS:470:MPS.RVAL") field(INPB, "QUAD:LTUS:470:BADIFF") field(INPC, "QUAD:LTUS:470:BDELTAS.N") field(INPD, "QUAD:LTUS:470:BACT") field(INPE, "QUAD:LTUS:470:MPSBITMASK.RVAL") field(INPF, "QUAD:LTUS:470:MPSBLLIM") field(INPG, "QUAD:LTUS:470:MPSBMIN") field(INPH, "QUAD:LTUS:470:MPSBMAX") field(INPI, "QUAD:LTUS:470: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, "QUAD:LTUS:470:INTOL.RVAL PP") field(OUTB, "QUAD:LTUS:470:INTOL_BMIN.RVAL PP") field(OUTC, "QUAD:LTUS:470:INTOL_BRANGE.RVAL PP") field(OUTD, "QUAD:LTUS:470: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, "QUAD:LTUS:470:INTOL") { field(DESC, "BACT within MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:470:MPSLIMITS.VALA") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "QUAD:LTUS:470:INTOL_BMIN") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:470:MPSLIMITS.VALB") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "QUAD:LTUS:470:INTOL_BMIN2") { field(DESC, "MPS tol #2") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:470:MPSLIMITS.VALD") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "QUAD:LTUS:470:INTOL_BRANGE") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:470: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, "QUAD:LTUS:470:CHCKITOL") { field(DESC, "Absolute Check I Tolerance") field(EGU, "A") field(FLNK, "QUAD:LTUS:470:TRIMITOL") field(CALC, "ABS(A*B)") field(INPA, "QUAD:LTUS:470:CHCKBTOL") field(INPB, "QUAD:LTUS:470:POLYCOEF.B") field(PREC, "9") } record(calc, "QUAD:LTUS:470:TRIMBTOL") { field(EGU, "kG") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(DESC, "Absolute Trim Tolerance") field(CALC, "ABS(A)/2") field(INPA, "QUAD:LTUS:470:CHCKBTOL") field(FLNK, "QUAD:LTUS:470:CHCKITOL") } record(calc, "QUAD:LTUS:470:CHCKBTOL") { field(DESC, "Check absolute tolerance") field(EGU, "A") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(FLNK, "QUAD:LTUS:470:TRIMBTOL") field(CALC, "MAX(ABS(A),ABS(C))*(B/1000000)") field(INPA, "QUAD:LTUS:470:BDES.HOPR") field(INPB, "QUAD:LTUS:470:STABILITY") field(INPC, "QUAD:LTUS:470:BDES.LOPR") } record(longout, "QUAD:LTUS:470: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, "QUAD:LTUS:470:CHCKBTOL") } record(calc, "QUAD:LTUS:470:TRIMITOL") { field(DESC, "Absolute Trim I Tolerance") field(EGU, "kG") field(CALC, "ABS(A*B)") field(INPA, "QUAD:LTUS:470:POLYCOEF.B") field(INPB, "QUAD:LTUS:470:TRIMBTOL") field(PREC, "9") } record(ai, "QUAD:LTUS:470:TRIMBTOLR") { field(DESC, "Relative trim tol") field(PREC, "4") field(EGU, "%") field(HOPR, "1.0") field(LOPR, "0.0") field(PINI, "YES") } record(ai, "QUAD:LTUS:470: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, "QUAD:LTUS:470:FBCKFCOM") { field(ZNAM, "CA") field(ONAM, "FCOM") field(DESC, "CA Mode") field(PINI, "YES") field(SDIS, "0") } record(bo, "QUAD:LTUS:470:PAU") { field(ZNAM, "NotConfigured") field(ONAM, "Configured") field(DESC, "PAU Present") field(PINI, "YES") field(SDIS, "0") field(FLNK, "QUAD:LTUS:470:PAUGO") } record(fanout, "QUAD:LTUS:470:PAUGO") { field(DESC, "PAU control") field(LNK1, "QUAD:LTUS:470:PAUSTOP") field(LNK2, "QUAD:LTUS:470: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, "QUAD:LTUS:470:PAUSTART") { field(DESC, "Setup for PAU On") field(SDIS, "QUAD:LTUS:470: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, "QUAD:LTUS:470:PAUSTOP") { field(DESC, "Setup for PAU Off") field(SDIS, "QUAD:LTUS:470: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, "QUAD:LTUS:470:MCORDEVNAME") { field(DESC, "PS device name") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, "PSC:LTUS:MG08:") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "QUAD:LTUS:470: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, "QUAD:LTUS:470:PSTYPE.RVAL") field(INPC, "QUAD:LTUS:470:TURNEDOFF.RVAL") field(INPD, "QUAD:LTUS:470:CONFIG.RVAL") field(INPE, "QUAD:LTUS:470:PSCATEGORY.RVAL") field(INPF, "QUAD:LTUS:470:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "QUAD:LTUS:470:AUTOCTRL.RVAL") field(INPJ, "QUAD:LTUS:470:OUTOFSERVICE.RVAL") field(INPL, "QUAD:LTUS:470:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "QUAD:LTUS:470:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "QUAD:LTUS:470:PAU") field(INPP, "QUAD:LTUS:470:CALBDISABLE.RVAL") field(INPQ, "QUAD:LTUS:470:PTRBDISABLE.RVAL") field(INPR, "QUAD:LTUS:470:TRIMDISABLE.RVAL") field(INPS, "QUAD:LTUS:470:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "QUAD:LTUS:470:FBCK") field(INPU, "QUAD:LTUS:470:TRIMTYPE.RVAL") field(INPV, "QUAD:LTUS:470:STDZDIRECT.RVAL") field(INPW, "QUAD:LTUS:470:DEGAUSENABLE.RVAL") field(FLNK, "QUAD:LTUS:470:HSTA") } record(longin, "QUAD:LTUS:470:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "QUAD:LTUS:470:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "QUAD:LTUS:470: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, "QUAD:LTUS:470: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, "QUAD:LTUS:470:CALBDISABLE") { field(DESC, "DAC Calb Disabled") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:470:PTRBDISABLE") { field(DESC, "Perturb Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:470:TRIMDISABLE") { field(DESC, "Trim Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:470: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 QUAD:LTUS:470:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses QUAD:LTUS:470:FBCK. # This PV should be replaced by QUAD:LTUS:470: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, "QUAD:LTUS:470: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, "QUAD:LTUS:470: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, "QUAD:LTUS:470: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, "") field(OMSL, "supervisory") field(FLNK, "QUAD:LTUS:470:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"QUAD:LTUS:470:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "QUAD:LTUS:470:OUTOFSERVICE NPP NMS") field(OUT, "QUAD:LTUS:470:ONLINE PP") } record(bo, "QUAD:LTUS:470:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "QUAD:LTUS:470: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, "1") } record(bo, "QUAD:LTUS:470: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, "1") } record(bo, "QUAD:LTUS:470: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, "QUAD:LTUS:470: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, "QUAD:LTUS:470: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, "QUAD:LTUS:470: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, "QUAD:LTUS:470: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, "QUAD:LTUS:470: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, "1") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:470: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, "1") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:470: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, "2") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:470: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, "0") field(ASG, "NOWRITE") field(FLNK, "QUAD:LTUS:470:TRIMTYPE") } record(stringout, "QUAD:LTUS:470:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "QUAD:LTUS:470:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "QUAD:LTUS:470:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "QUAD:LTUS:470:STATE.RVAL") field(INPB, "QUAD:LTUS:470:INTLKSUMY.RVAL") field(OUT, "QUAD:LTUS:470:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:LTUS:470: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, "QUAD:LTUS:470:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "QUAD:LTUS:470:STATE.RVAL") field(INPB, "QUAD:LTUS:470:INTLKSUMY.RVAL") field(OUT, "QUAD:LTUS:470:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:LTUS:470:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "QUAD:LTUS:470:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "QUAD:LTUS:470: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, "QUAD:LTUS:470:RAMPSTARTDLY") { field(DESC, "Tansition to ramp delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "2") } ######### For PSTYPE=2 Only ############# record(mbbo, "QUAD:LTUS:470: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, "QUAD:LTUS:470: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,"QUAD:LTUS:470: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("QUAD:LTUS:470:TURNEDOFF",3140,1907,0,1,"QUAD:LTUS:470:TURNEDOFF") #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "QUAD:LTUS:470:STATSUB") { field(DESC, "Build STATus ") field(INAM, "mgntInit") field(SNAM, "mgntSlcStat") field(INPA, "QUAD:LTUS:470:BACT.STAT") field(INPB, "QUAD:LTUS:470:BDES.STAT") field(INPC, "QUAD:LTUS:470:IRIPL.STAT") field(INPD, "PSC:LTUS:MG08:ISETPT.STAT") field(INPE, "PSC:LTUS:MG08:IACT.STAT") # 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, "QUAD:LTUS:470:BACT.SEVR") field(INPH, "QUAD:LTUS:470:BDES.SEVR") field(INPI, "QUAD:LTUS:470:IRIPL.SEVR") field(INPJ, "PSC:LTUS:MG08:ISETPT.SEVR") field(INPK, "PSC:LTUS:MG08:IACT.SEVR") # # 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, "QUAD:LTUS:470:STATE.RVAL") field(INPN, "QUAD:LTUS:470:STDZOK") field(INPO, "QUAD:LTUS:470:CALBOK") field(INPP, "QUAD:LTUS:470:OUTOFSERVICE.RVAL") field(INPQ, "QUAD:LTUS:470:CONFIG.RVAL") field(INPR, "QUAD:LTUS:470:HSTA") field(INPS, "QUAD:LTUS:470:CTRL.RVAL") field(INPT, "QUAD:LTUS:470:DEGAUSOK") field(INPV, "QUAD:LTUS:470: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, "QUAD:LTUS:470:STAT") } record(longout, "QUAD:LTUS:470:STAT") { field(DESC, "STAT sent to SLC") field(SCAN, "Passive") field(FLNK, "QUAD:LTUS:470:STATCTRLSUB") field(DOL, "QUAD:LTUS:470:STATSUB.VAL") field(OMSL, "closed_loop") } record(sSub, "QUAD:LTUS:470:STATCTRLSUB") { field(DESC, "Decode SLC STAT into mbbo") field(INAM, "mgntInit") field(SNAM, "mgntStatDecode") field(INPA, "QUAD:LTUS:470:STAT") field(INPB, "QUAD:LTUS:470:HSTA") field(INPD, "QUAD:LTUS:470:ONOFFCTRL.RVAL") field(FLNK, "QUAD:LTUS:470:STATMSG") } record(mbbo, "QUAD:LTUS:470: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, "QUAD:LTUS:470:UNAVAILGO") field(DOL, "QUAD:LTUS:470:STATCTRLSUB.W") } record(seq, "QUAD:LTUS:470:UNAVAILGO") { field(DESC, "Process UNAVAIL") field(DOL1, "QUAD:LTUS:470:STATSUB.U") field(LNK1, "QUAD:LTUS:470:UNAVAIL PP") } record(stringout, "QUAD:LTUS:470:SNLSTATMSG") { field(DTYP, "Soft Channel") } #! TextBox(TB0,820,1000,1200,1220,0,"Dialog",12,1,16777215,"QUAD:LTUS:470:STATUSSUB - future\nOverall device status - takes input from action snls, record sevrs, master snl(s) and outputs final status\n\nInputs:\nA - QUAD:LTUS:470:CTRLSTATUS - snl status\nB - MGNT:CTRLSTATUS - master list status\nC\nD - QUAD:LTUS:470: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,"QUAD:LTUS:470STATSUB\nformat control bo's into slc STAT\n\nInputs:\nA - QUAD:LTUS:470:STATUS\nC - QUAD:LTUS:470:ON\nD - QUAD:LTUS:470:STDZOK\nE - QUAD:LTUS:470:CALBOK\nF - QUAD:LTUS:470:BACTDRIFT (future)\nG -\nH- QUAD:LTUS:470:DACSTATUS\nI -QUAD:LTUS:470:ADCSTATUS\nJ - QUAD:LTUS:470:BACTSTATUS\nK - QUAD:LTUS:470:BDESSTATUS\nL - QUAD:LTUS:470:RIPLSTATUS\n\nOutput:\nP - QUAD:LTUS:470: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, "QUAD:LTUS:470: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, "QUAD:LTUS:470: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, "QUAD:LTUS:470: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, "QUAD:LTUS:470: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.6 #! DBDSTART #! DBD("../../../../dbd/mgntSoft.dbd") #! DBDEND record(stringout, "QUAD:LTUS:470:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:470:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "QUAD:LTUS:470:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "QUAD:LTUS:470:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "QUAD:LTUS:470:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "QUAD:LTUS:470:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "1") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "QUAD:LTUS:470: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, "QUAD:LTUS:470:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "QUAD:LTUS:470:TRIMTYPE.RVAL") field(INPB, "QUAD:LTUS:470:CONFIG.RVAL") field(OUT, "QUAD:LTUS:470:TRIMMAXNUM PP") } record(longout, "QUAD:LTUS:470: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, "QUAD:LTUS:470: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, "") field(OMSL, "supervisory") field(VAL, "20") field(OUT, "QUAD:LTUS:470:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "QUAD:LTUS:470: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, "") field(OMSL, "supervisory") field(VAL, "10") } record(bo, "QUAD:LTUS:470: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, "QUAD:LTUS:470: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, "QUAD:LTUS:470: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, "QUAD:LTUS:470:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "0") } record(ao, "QUAD:LTUS:470: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, "QUAD:LTUS:470:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "QUAD:LTUS:470: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, "QUAD:LTUS:470: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, "QUAD:LTUS:470:IMOVE") field(INPB, "QUAD:LTUS:470:IACT") field(INPC, "QUAD:LTUS:470:IRAMPRATE") field(INPD, "1.577") field(INPE, "QUAD:LTUS:470:TRIMDLYPCT") field(INPF, "QUAD:LTUS:470:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "QUAD:LTUS:470:RAMPTIME_LEFT PP") } record(longout, "QUAD:LTUS:470:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "QUAD:LTUS:470:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "QUAD:LTUS:470:RAMPDONE_CALC") } record(calc, "QUAD:LTUS:470:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "QUAD:LTUS:470:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "QUAD:LTUS:470:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "QUAD:LTUS:470: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, "QUAD:LTUS:470:RAMPTIME_LEFT") field(OUT, "QUAD:LTUS:470:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "QUAD:LTUS:470:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "QUAD:LTUS:470:RAMPTIME_LEFT NMS") field(OUT, "QUAD:LTUS:470:RAMPDONE PP") } record(bo, "QUAD:LTUS:470:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "QUAD:LTUS:470:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "QUAD:LTUS:470: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, "QUAD:LTUS:470: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(sSub, "QUAD:LTUS:470: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, "QUAD:LTUS:470:PSTYPE.RVAL") field(INPC, "QUAD:LTUS:470:TURNEDOFF.RVAL") field(INPD, "QUAD:LTUS:470:CONFIG.RVAL") field(INPE, "QUAD:LTUS:470:PSCATEGORY.RVAL") field(INPF, "QUAD:LTUS:470:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "QUAD:LTUS:470:AUTOCTRL.RVAL") field(INPJ, "QUAD:LTUS:470:OUTOFSERVICE.RVAL") field(INPL, "QUAD:LTUS:470:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "QUAD:LTUS:470:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "QUAD:LTUS:470:PAU") field(INPP, "QUAD:LTUS:470:CALBDISABLE.RVAL") field(INPQ, "QUAD:LTUS:470:PTRBDISABLE.RVAL") field(INPR, "QUAD:LTUS:470:TRIMDISABLE.RVAL") field(INPS, "QUAD:LTUS:470:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "QUAD:LTUS:470:FBCK") field(INPU, "QUAD:LTUS:470:TRIMTYPE.RVAL") field(INPV, "QUAD:LTUS:470:STDZDIRECT.RVAL") field(INPW, "QUAD:LTUS:470:DEGAUSENABLE.RVAL") field(FLNK, "QUAD:LTUS:470:HSTA") } record(longin, "QUAD:LTUS:470:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "QUAD:LTUS:470:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "QUAD:LTUS:470: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, "QUAD:LTUS:470: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, "QUAD:LTUS:470:CALBDISABLE") { field(DESC, "DAC Calb Disabled") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:470:PTRBDISABLE") { field(DESC, "Perturb Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:470:TRIMDISABLE") { field(DESC, "Trim Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:470:STDZDISABLE") { field(DTYP, "Raw Soft Channel") field(ZNAM, "NO") field(ONAM, "YES") field(DESC, "Standardize Function") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } # This PV has been replaced by QUAD:LTUS:470:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses QUAD:LTUS:470:FBCK. # This PV should be replaced by QUAD:LTUS:470: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, "QUAD:LTUS:470: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, "QUAD:LTUS:470: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, "QUAD:LTUS:470: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, "") field(OMSL, "supervisory") field(FLNK, "QUAD:LTUS:470:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"QUAD:LTUS:470:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "QUAD:LTUS:470:OUTOFSERVICE NPP NMS") field(OUT, "QUAD:LTUS:470:ONLINE PP") } record(bo, "QUAD:LTUS:470:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "QUAD:LTUS:470: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, "1") } record(bo, "QUAD:LTUS:470: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, "1") } record(bo, "QUAD:LTUS:470: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, "QUAD:LTUS:470: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, "QUAD:LTUS:470: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, "QUAD:LTUS:470: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, "QUAD:LTUS:470: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, "QUAD:LTUS:470: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, "1") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:470: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, "1") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:470: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, "2") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:470: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, "0") field(ASG, "NOWRITE") field(FLNK, "QUAD:LTUS:470:TRIMTYPE") } record(stringout, "QUAD:LTUS:470:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "QUAD:LTUS:470:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "QUAD:LTUS:470:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "QUAD:LTUS:470:STATE.RVAL") field(INPB, "QUAD:LTUS:470:INTLKSUMY.RVAL") field(OUT, "QUAD:LTUS:470:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:LTUS:470: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, "QUAD:LTUS:470:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "QUAD:LTUS:470:STATE.RVAL") field(INPB, "QUAD:LTUS:470:INTLKSUMY.RVAL") field(OUT, "QUAD:LTUS:470:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:LTUS:470:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "QUAD:LTUS:470:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "QUAD:LTUS:470: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, "QUAD:LTUS:470:RAMPSTARTDLY") { field(DESC, "Tansition to ramp delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "2") } ######### For PSTYPE=2 Only ############# record(mbbo, "QUAD:LTUS:470: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, "QUAD:LTUS:470: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,"QUAD:LTUS:470: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("QUAD:LTUS:470:TURNEDOFF",3140,1907,0,1,"QUAD:LTUS:470:TURNEDOFF") #! 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, "QUAD:LTUS:500:IACT") { field(DESC, "Current") field(INP, "PSC:LTUS:MG09:IACT") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "QUAD:LTUS:500:BACT") info(autosaveFields,"HYST") } record(bi, "QUAD:LTUS:500:STATE") { field(DESC, "PS On/Off Status") field(DTYP, "Raw Soft Channel") field(INP, "PSC:LTUS:MG09:STATE NPP MS") field(ZSV, "MAJOR") field(ZNAM, "OFF") field(ONAM, "ON") } record(ao, "QUAD:LTUS:500:IDES") { field(DESC, "Desired Current") field(PREC, "3") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(MDEL, "-1") field(HIHI, "200.0") field(LOLO, "0.0") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "QUAD:LTUS:500:BDELTAS") field(DRVH, "200.0") field(DRVL, "0.0") field(DOL, "QUAD:LTUS:500: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, "QUAD:LTUS:500:ICTRL PP") } # This record is processed by QUAD:LTUS:500:ICON") # Note: we are not setting alarms here. record(ao, "QUAD:LTUS:500:ICON") { field(DESC, "Config I") field(DTYP, "Soft Channel") field(PREC, "3") field(HOPR, "200.0") field(LOPR, "0.0") field(DRVH, "200.0") field(DRVL, "0.0") field(DOL, "QUAD:LTUS:500:B2ICON.K") field(OMSL, "closed_loop") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:500:INOM") { field(DESC, "Nominal Current") field(DOL, "QUAD:LTUS:500:BNOM.K") field(OMSL, "closed_loop") field(PREC, "3") field(EGU, "A") field(DRVH, "200.0") field(DRVL, "0.0") field(HOPR, "200.0") field(LOPR, "0.0") } record(ao, "QUAD:LTUS:500:ICTRL") { field(DESC, "Set Current") field(PREC, "3") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(DRVH, "200.0") field(DRVL, "0.0") field(MDEL, "-1") field(FLNK, "QUAD:LTUS:500:ICTRLGO") field(OMSL, "supervisory") info(autosavefields,"VAL") } record(seq, "QUAD:LTUS:500:ICTRLGO") { field(DESC, "Process Current Setpoint") field(PREC, "3") # Set ISETPT to supervisory field(DOL1, "0") field(LNK1, "QUAD:LTUS:500:ISETPT.OMSL") field(DOL2, "QUAD:LTUS:500:ICTRL") field(LNK2, "QUAD:LTUS:500:ISETPT PP") # Set ISETPT to closed loop - get data from BCTRLSUB.K field(DOL3, "1") field(LNK3, "QUAD:LTUS:500:ISETPT.OMSL") } record(ao, "QUAD:LTUS:500:IMAX") { field(DESC, "Max I") field(DTYP, "Soft Channel") field(DRVH, "200.0") field(DRVL, "0.0") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(PREC, "3") field(PINI, "YES") field(VAL, "200.0") field(FLNK, "QUAD:LTUS:500:IMIN") } record(ao, "QUAD:LTUS:500:IMIN") { field(DESC, "Min I") field(DTYP, "Soft Channel") field(DRVH, "200.0") field(DRVL, "0.0") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(PREC, "3") field(VAL, "0.0") field(FLNK, "QUAD:LTUS:500:IRANGE") } record(sel, "QUAD:LTUS:500:IACTPREVOK") { field(DESC, "Last Good Current") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(PREC, "3") field(NVL, "QUAD:LTUS:500:BACT.SEVR") field(INPA, "QUAD:LTUS:500:IACT NPP MS") field(INPB, "QUAD:LTUS:500:IACTPREVOK NPP MS") field(INPC, "QUAD:LTUS:500:IACTPREVOK NPP MS") field(INPD, "QUAD:LTUS:500:IACTPREVOK NPP MS") } record(sub, "QUAD:LTUS:500:IACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:500:IDES") field(INPB, "QUAD:LTUS:500:ISETPT.DRVH") field(INPC, "QUAD:LTUS:500:ISETPT.DRVL") field(INPD, "QUAD:LTUS:500:IDELTAS.I") field(INPE, "QUAD:LTUS:500:IDELTAS.J") field(INPG, "QUAD:LTUS:500:STATE") field(INPH, "QUAD:LTUS:500:HSTA") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(sub, "QUAD:LTUS:500:IMONLIMITS") { field(DESC, "Aux Current Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:500:IDES") field(INPB, "QUAD:LTUS:500:ISETPT.DRVH") field(INPC, "QUAD:LTUS:500:ISETPT.DRVL") field(INPD, "QUAD:LTUS:500:IDELTAS.K") field(INPE, "QUAD:LTUS:500:IDELTAS.L") field(INPG, "QUAD:LTUS:500:STATE") field(INPH, "QUAD:LTUS:500:HSTA") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(seq, "QUAD:LTUS:500:ILIMITS") { field(DESC, "Set ACT and MON Limits") field(PREC, "3") field(DOL1, "QUAD:LTUS:500:BLIMITS") field(LNK1, "QUAD:LTUS:500:IACTLIMITS.F PP") field(DOL2, "QUAD:LTUS:500:IACTLIMITS.I") field(LNK2, "QUAD:LTUS:500:IACT.HIGH") field(DOL3, "QUAD:LTUS:500:IACTLIMITS.J") field(LNK3, "QUAD:LTUS:500:IACT.LOW") field(DOL4, "QUAD:LTUS:500:IACTLIMITS.K") field(LNK4, "QUAD:LTUS:500:IACT.HIHI") field(DOL5, "QUAD:LTUS:500:IACTLIMITS.L") field(LNK5, "QUAD:LTUS:500:IACT.LOLO") field(DOL6, "QUAD:LTUS:500:BLIMITS") field(LNK6, "QUAD:LTUS:500:IMONLIMITS.F PP") field(DOL7, "QUAD:LTUS:500:IMONLIMITS.I") field(LNK7, "QUAD:LTUS:500:IMON.HIGH") field(DOL8, "QUAD:LTUS:500:IMONLIMITS.J") field(LNK8, "QUAD:LTUS:500:IMON.LOW") field(DOL9, "QUAD:LTUS:500:IMONLIMITS.K") field(LNK9, "QUAD:LTUS:500:IMON.HIHI") field(DOLA, "QUAD:LTUS:500:IMONLIMITS.L") field(LNKA, "QUAD:LTUS:500: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, "QUAD:LTUS:500:IDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntRawDeltas") field(INPD, "QUAD:LTUS:500:TRIMBTOL") field(INPE, "QUAD:LTUS:500:CHCKBTOL") field(INPF, "QUAD:LTUS:500:BDELTAS.K") field(INPG, "QUAD:LTUS:500:BDELTAS.L") field(INPH, "QUAD:LTUS:500: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, "QUAD:LTUS:500:STDZITOLR") field(INPC, "QUAD:LTUS:500:STDZITOL") field(FLNK, "") } # All ps controllers with on/off control will set the macro ONOF # as follows: # # ONOF = PSC:LTUS:MG09: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, "QUAD:LTUS:500:STATESETPT") { field(DESC, "PS On/Off") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFF") field(ONAM, "ON") field(OUT, "PSC:LTUS:MG09:STATESETPT PP") 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 = PSC:LTUS:MG09:RESET PP # record(bo, "QUAD:LTUS:500:RESET") { field(DESC, "Interlock Latch Reset") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFF") field(ONAM, "ON") field(HIGH, "1.0") field(OUT, "PSC:LTUS:MG09:RESET PP") } record(bo, "QUAD:LTUS:500:RAMPSTATE") { field(DESC, "PS Ramp Status") field(DTYP, "Soft Channel") field(DOL, "PSC:LTUS:MG09:RAMPSTATE NPP 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, "QUAD:LTUS:500: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, "QUAD:LTUS:500:TRIMRAMPRATE") field(OUT, "PSC:LTUS:MG09:IRAMPRATE PP") field(FLNK, "QUAD:LTUS:500:STDZDLY") } record(ao, "QUAD:LTUS:500:ISETPT") { field(DESC, "Current Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(DRVH, "200.0") field(DRVL, "0.0") field(MDEL, "-1") field(OUT, "PSC:LTUS:MG09:ISETPT PP") field(DOL, "QUAD:LTUS:500: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, "QUAD:LTUS:500:IMON") { field(DESC, "Aux Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(INP, "PSC:LTUS:MG09:IMON") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "QUAD:LTUS:500:BMON") } record(ao, "QUAD:LTUS:500:IRIPL") { field(DESC, "Ripple Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(DOL, "PSC:LTUS:MG09:IRIPL NPP NMS") field(OMSL, "closed_loop") field(EGU, "A") field(DRVH, "1.0") field(HOPR, "1.0") field(PREC, "3") field(FLNK, "QUAD:LTUS:500:IRIPLOK") } record(sub, "QUAD:LTUS:500:IRIPLOK") { field(DESC, "Ripple Current Status") field(INAM, "mgntInit") field(SNAM, "mgntRiplOK") field(INPA, "QUAD:LTUS:500:IRIPL.VAL") field(INPB, "QUAD:LTUS:500: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, "QUAD:LTUS:500:R") { field(DESC, "Resistance") field(EGU, "Ohms") field(PREC, "4") field(PINI, "YES") field(DOL, "PSC:LTUS:MG09:R NPP MS") 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, "QUAD:LTUS:500:IGND") { field(DESC, "Ground Current") field(EGU, "A") field(PREC, "6") field(PINI, "YES") field(DOL, "PSC:LTUS:MG09:IGND NPP MS") field(OMSL, "closed_loop") } record(bi, "QUAD:LTUS:500:INTLKSUMY") { field(DESC, "Interlock Summary") field(INP, "PSC:LTUS:MG09:INTLKSUMY NPP MS") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(ZNAM, "OK") field(ONAM, "FAULT") field(PINI, "NO") } record(mbbo, "QUAD:LTUS:500: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, "PSC:LTUS:MG09:COOLING") field(OMSL, "closed_loop") } # The following PV is processed by :BACTFO # which is processed by :BACT record(fanout, "QUAD:LTUS:500:IACTFO") { field(DESC, "IACT processing") field(SELM, "All") field(LNK1, "QUAD:LTUS:500:IACTPREVOK") field(LNK2, "QUAD:LTUS:500:IDIFF") field(LNK3, "QUAD:LTUS:500:IADIFF") field(LNK4, "QUAD:LTUS:500:IRATIO") field(LNK5, "QUAD:LTUS:500:IDIRECT") field(LNK6, "QUAD:LTUS:500:IACTPOL_CHECK") } record(calc, "QUAD:LTUS:500:IDIFF") { field(DESC, "IDES-IACT") field(CALC, "A-B") field(INPA, "QUAD:LTUS:500:IDES") field(INPB, "QUAD:LTUS:500:IACT") field(EGU, "A") field(PREC, "9") field(HOPR, "200.0") field(LOPR, "0.0") } record(calc, "QUAD:LTUS:500:IADIFF") { field(DESC, "Absolute IDES-IACT") field(CALC, "A<0?ABS(A):A") field(INPA, "QUAD:LTUS:500:IDIFF") field(PREC, "9") } record(calc, "QUAD:LTUS:500:IRATIO") { field(DESC, "IDES-IACT/IMAX") field(CALC, "B?A/B:0") field(INPA, "QUAD:LTUS:500:IDIFF") field(INPB, "QUAD:LTUS:500:IDES.DRVH") field(PREC, "9") } record(calcout, "QUAD:LTUS:500:IRANGE") { field(DESC, "Current Range") field(PINI, "YES") field(CALC, "ABS(A-B)") field(INPA, "QUAD:LTUS:500:IMIN") field(INPB, "QUAD:LTUS:500: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, "QUAD:LTUS:500: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, "QUAD:LTUS:500:IACT") field(FLNK, "QUAD:LTUS:500:IACTPOL") } record(bo, "QUAD:LTUS:500:IACTPOL") { field(DESC, "Actual I Polarity") field(DTYP, "Raw Soft Channel") field(DOL, "QUAD:LTUS:500: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,"QUAD:LTUS:500:I*LIMITS:\n Calculate alarm and warning limits based on \n deltas from QUAD:LTUS:500:IDELTAS and the\n QUAD:LTUS:500: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,"QUAD:LTUS:500:IACT: \n Get copy of QUAD:LTUS:500:I. \n",null) #! TextBox(TB12,1280,3100,1760,3200,0,"Dialog",12,1,16777215,"QUAD:LTUS:500: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,"QUAD:LTUS:500:IDES:\n Contains raw value calculated by \nQUAD:LTUS:500: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 \nQUAD:LTUS:500:BDELTAS.\n",null) #! TextBox(TB10,56,1940,316,2340,0,"Dialog",12,1,16777215,"QUAD:LTUS:500: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 QUAD:LTUS:500: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 QUAD:LTUS:500: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,"QUAD:LTUS:500:ISETPT:\n Sets the hardware. When fast feedback is set on, this record is\n set to closed loop mode by QUAD:LTUS:500:FBCKSTART sequence. When \n the loop is closed, this record takes input calculated by \n BFBCK only. When fast feedback is set off, QUAD:LTUS:500:FBCKSTOP \n will set it back to supervisory so that the value can be set by \n QUAD:LTUS:500: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, "QUAD:LTUS:500:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:500:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "QUAD:LTUS:500:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "QUAD:LTUS:500:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "QUAD:LTUS:500:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "QUAD:LTUS:500:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "1") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "QUAD:LTUS:500: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, "QUAD:LTUS:500:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "QUAD:LTUS:500:TRIMTYPE.RVAL") field(INPB, "QUAD:LTUS:500:CONFIG.RVAL") field(OUT, "QUAD:LTUS:500:TRIMMAXNUM PP") } record(longout, "QUAD:LTUS:500: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, "QUAD:LTUS:500: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, "") field(OMSL, "supervisory") field(VAL, "10") field(OUT, "QUAD:LTUS:500:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "QUAD:LTUS:500: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, "") field(OMSL, "supervisory") field(VAL, "10") } record(bo, "QUAD:LTUS:500: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, "QUAD:LTUS:500: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, "QUAD:LTUS:500: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, "QUAD:LTUS:500:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "0") } record(ao, "QUAD:LTUS:500: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, "QUAD:LTUS:500:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "QUAD:LTUS:500: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, "QUAD:LTUS:500: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, "QUAD:LTUS:500:IMOVE") field(INPB, "QUAD:LTUS:500:IACT") field(INPC, "QUAD:LTUS:500:IRAMPRATE") field(INPD, "1.577") field(INPE, "QUAD:LTUS:500:TRIMDLYPCT") field(INPF, "QUAD:LTUS:500:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "QUAD:LTUS:500:RAMPTIME_LEFT PP") } record(longout, "QUAD:LTUS:500:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "QUAD:LTUS:500:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "QUAD:LTUS:500:RAMPDONE_CALC") } record(calc, "QUAD:LTUS:500:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "QUAD:LTUS:500:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "QUAD:LTUS:500:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "QUAD:LTUS:500: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, "QUAD:LTUS:500:RAMPTIME_LEFT") field(OUT, "QUAD:LTUS:500:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "QUAD:LTUS:500:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "QUAD:LTUS:500:RAMPTIME_LEFT NMS") field(OUT, "QUAD:LTUS:500:RAMPDONE PP") } record(bo, "QUAD:LTUS:500:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "QUAD:LTUS:500:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "QUAD:LTUS:500: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, "QUAD:LTUS:500: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, "QUAD:LTUS:500:STDZINIT") { field(DESC, "Proc. Stdz PVs on boot") field(PINI, "YES") field(DOL1, "1") field(DOL2, "1") field(DOL3, "1") field(LNK1, "QUAD:LTUS:500:DEBUG.PROC PP") field(LNK2, "QUAD:LTUS:500:STDZCYCLENUM.PROC PP") field(LNK3, "QUAD:LTUS:500:STDZDISABLE.PROC PP") field(LNK4, "QUAD:LTUS:500: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, "QUAD:LTUS:500:STDZSUB") { field(DESC, "Stdz subroutine") field(INAM, "mgntStdzInit") field(SNAM, "mgntStdz") field(BRSV, "INVALID") field(INPA, "QUAD:LTUS:500:STDZIMIN NPP NMS") field(INPB, "QUAD:LTUS:500:STDZIMAX NPP NMS") field(INPC, "QUAD:LTUS:500:STDZIFINAL NPP NMS") field(INPD, "QUAD:LTUS:500:STDZCYCLENUM NPP NMS") field(INPE, "QUAD:LTUS:500:STDZDIRECT.RVAL NPP NMS") field(INPF, "QUAD:LTUS:500:STDZDISABLE.RVAL CPP NMS") field(INPG, "QUAD:LTUS:500: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, "QUAD:LTUS:500:STDZWF PP") field(OUTB, "QUAD:LTUS:500: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, "QUAD:LTUS:500:STDZWF") } record(mbbo, "QUAD:LTUS:500: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, "QUAD:LTUS:500: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, "QUAD:LTUS:500:STDZMAINPS") { field(DESC, "Stdz by main or self") field(PINI, "YES") field(DTYP, "Soft Channel") field(ZNAM, "SELF") field(ONAM, "MAIN") } record(bo, "QUAD:LTUS:500: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, "QUAD:LTUS:500: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, "QUAD:LTUS:500: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, "QUAD:LTUS:500:STDZTOD") { field(DESC, "Successful Standardize Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "QUAD:LTUS:500:STDZLOSTTOD") { field(DESC, "Standardize Lost Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(longout, "QUAD:LTUS:500:STDZCYCLECNT") { field(DESC, "Cycle Count") field(PINI, "YES") } record(longout, "QUAD:LTUS:500:STDZCYCLENUM") { field(DESC, "No. Standardize Cycles") field(VAL, "3") field(HOPR, "10") field(LOPR, "0") field(DRVH, "10") field(DRVL, "0") field(PINI, "YES") field(FLNK, "QUAD:LTUS:500:STDZDIRECT") } # The default standardize direction is "UP" for # all LCLS Magnets.. record(bo, "QUAD:LTUS:500:STDZDIRECT") { field(DESC, "Standardize Direction ") field(ZNAM, "UP") field(ONAM, "DOWN") field(VAL, "0") field(FLNK, "QUAD:LTUS:500:STDZIMIN") } record(ao, "QUAD:LTUS:500:STDZIMIN") { field(DESC, "Min-STDZ Current") field(PREC, "1") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(VAL, "0.0") field(FLNK, "QUAD:LTUS:500:STDZIMAX") } record(ao, "QUAD:LTUS:500:STDZIMAX") { field(DESC, "Max. Standarize Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(VAL, "200.0") field(FLNK, "QUAD:LTUS:500:STDZIFINAL") } record(ao, "QUAD:LTUS:500:STDZIFINAL") { field(DESC, "Final SDTZ Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(VAL, "0.0") field(FLNK, "QUAD:LTUS:500: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, "QUAD:LTUS:500: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, "QUAD:LTUS:500:STDZITOL") { field(DESC, "Stdz min tolerance") field(PREC, "5") field(CALC, "MAX(ABS(A),ABS(B))*C") field(INPA, "QUAD:LTUS:500:STDZIMIN CP NMS") field(INPB, "QUAD:LTUS:500:STDZIMAX CP MMS") field(INPC, "0.05") field(INPD, "QUAD:LTUS:500:STDZITOLR CP MMS") field(EGU, "A") field(FLNK, "QUAD:LTUS:500:IDELTAS") field(PINI, "YES") } # D - factor (3.154/2 = 1.577) for EPSC, otherwise, set to 1.0 record(calc, "QUAD:LTUS:500:STDZDLY") { field(DESC, "Ramp time for stdz cycle") field(CALC, "C>0?MAX(1,ABS((A-B)/C)*D):0") field(INPA, "QUAD:LTUS:500:STDZIMIN CP NMS") field(INPB, "QUAD:LTUS:500:STDZIMAX CP NMS") field(INPC, "QUAD:LTUS:500:TRIMRAMPRATE CP NMS") field(INPD, "1.577") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") } record(calc, "QUAD:LTUS:500:STDZRAMPDLY") { field(DESC, "Ramp delay total") field(CALC, "MAX(1,((A/100)*B+B))") field(PREC, "5") field(INPA, "QUAD:LTUS:500:TRIMDLYPCT CP MS") field(INPB, "QUAD:LTUS:500: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, "QUAD:LTUS:500:STDZMINIDLY") { field(DESC, "Mini-stdz delay") field(CALC, "A") field(PREC, "5") field(A, "1.0") field(EGU, "sec") field(PINI, "YES") } record(ao, "QUAD:LTUS:500: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, "QUAD:LTUS:500:STDZMINIDELTA") { field(DESC, "Stdz mini % of IMAX") field(CALC, "(B/100)*(A-C)") field(INPA, "QUAD:LTUS:500:IDES.HOPR") field(INPB, "QUAD:LTUS:500:STDZMINIPCT CPP NMS") field(INPC, "QUAD:LTUS:500:IDES.LOPR") field(PREC, "5") } record(calc, "QUAD:LTUS:500:STDZMINISETPT") { field(DESC, "Mini Stdz delta") field(CALC, "C==0?MAX(E-D,B):MIN(E+D,A)") field(INPA, "QUAD:LTUS:500:IDES.HOPR") field(INPB, "QUAD:LTUS:500:IDES.LOPR") field(INPC, "QUAD:LTUS:500:STDZDIRECT.RVAL") field(INPD, "QUAD:LTUS:500:STDZMINIDELTA") field(INPE, "QUAD:LTUS:500:IDES") field(PREC, "5") field(FLNK, "QUAD:LTUS:500: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, "QUAD:LTUS:500:STDZMINISETPTOOR") { field(DESC, "Mini Stdz setpoint out of range") field(CALC, "C==0?(E-DA)") field(INPA, "QUAD:LTUS:500:IDES.HOPR") field(INPB, "QUAD:LTUS:500:IDES.LOPR") field(INPC, "QUAD:LTUS:500:STDZDIRECT.RVAL") field(INPD, "QUAD:LTUS:500:STDZMINIDELTA") field(INPE, "QUAD:LTUS:500: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, "QUAD:LTUS:500: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, "QUAD:LTUS:500:IADJUST.RVAL") field(INPB, "QUAD:LTUS:500:STDZDIRECT.RVAL") field(INPC, "QUAD:LTUS:500:STDZOK.RVAL") field(INPD, "QUAD:LTUS:500:STDZDISABLE.RVAL") field(INPE, "QUAD:LTUS:500:STATE.RVAL CPP NMS") field(INPF, "QUAD:LTUS:500:ICTRL.RVAL") field(INPG, "QUAD:LTUS:500:STATE.SEVR") field(INPH, "QUAD:LTUS:500:BDELTAS.M") field(INPI, "QUAD:LTUS:500:IACT.SEVR") field(OUT, "QUAD:LTUS:500:STDZLOSTGO.SELN PP NMS") field(OOPT, "Transition To Non-zero") } record(seq, "QUAD:LTUS:500:STDZLOSTGO") { field(DESC, "Process lost stdz") field(SELM, "Mask") field(DOL1, "1") field(DOL2, "0") field(LNK1, "QUAD:LTUS:500:STDZLOSTTOD.PROC") field(LNK2, "QUAD:LTUS:500:STDZOK PP") } # Record maximum current after standardize # Reset to IACT from sequence after trim # Disable processing during (mini-)standardize or trim record(calc, "QUAD:LTUS:500:STDZIACTMAX") { field(DESC, "Max act current after stdz") field(CALC, "MAX(A, B)") field(DISV, "0") field(SDIS, "QUAD:LTUS:500:CHECKPWRDIP_ENABLE") field(INPA, "QUAD:LTUS:500:IACT CP") field(INPB, "QUAD:LTUS:500:STDZIACTMAX") field(EGU, "A") field(FLNK, "QUAD:LTUS:500:CHECKPWRDIP") } # Detect power dip if STDZOK is YES, STDZ is enabled, and IACT is valid # If IACT drops below STDZIACTMAX by more than the trim tolerance, clear STDZOK # Warning: Take the absolute value of the trim tolerance, or else quads of # negative polarity will always lose STDZ since their IDELTAS.I are negative. # Note: Large quads and bends are prone to losing STDZ even if they are # perturbed toward higher current since their current tends to overshoot # by greater than the trim tolerance before settling down. record(calcout, "QUAD:LTUS:500:CHECKPWRDIP") { field(DESC, "Detect power dip") field(CALC, "(A-B>ABS(C))?3:0") field(DISV, "0") field(SDIS, "QUAD:LTUS:500:CHECKPWRDIP_ENABLE") field(INPA, "QUAD:LTUS:500:STDZIACTMAX") field(INPB, "QUAD:LTUS:500:IACT") field(INPC, "QUAD:LTUS:500:IDELTAS.I") field(OUT, "QUAD:LTUS:500:STDZLOSTGO.SELN PP NMS") field(OOPT, "When Non-zero") } # Enable processing of STDZIACTMAX and CHECKPWRDIP only if # STDZOK = YES, STDZDISABLE = NO, CTRL != Trim (2), and # CTRL != Stdz (4) record(calc, "QUAD:LTUS:500:CHECKPWRDIP_ENABLE") { field(CALC, "A&&!B&&(C#2)&&(C#4)") field(INPA, "QUAD:LTUS:500:STDZOK.RVAL CP") field(INPB, "QUAD:LTUS:500:STDZDISABLE.RVAL CP") field(INPC, "QUAD:LTUS:500:CTRL.RVAL CP") } #! 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, "QUAD:LTUS:500: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, "QUAD:LTUS:500:CALBOK") { field(DESC, "Successful Calibration") field(DTYP, "Raw Soft Channel") field(ZNAM, "NO") field(ONAM, "YES") field(DOL, "PSC:LTUS:MG09:CALBOK.RVAL") field(OMSL, "closed_loop") 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, "QUAD:LTUS:500:CALBSET") { field(DESC, "Use DAC Calbration") field(SCAN, "10 second") field(CALC, "A&&(B==0)&&C?31:960") field(INPA, "QUAD:LTUS:500:CALBOK") field(INPB, "QUAD:LTUS:500:CALBDISABLE") field(INPC, "QUAD:LTUS:500:CALBSLOPE") field(OOPT, "On Change") field(OUT, "QUAD:LTUS:500: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, "QUAD:LTUS:500:CALB_SEQ") { field(DESC, "Output Calib Values") field(SELM, "Mask") field(SELL, "QUAD:LTUS:500: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, "QUAD:LTUS:500:CALBSLOPE") field(DOL3, "QUAD:LTUS:500: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, "QUAD:LTUS:500:CALBTOD") { field(DESC, "Calibration Success Time") field(PINI, "YES") field(DOL, "PSC:LTUS:MG09:CALBTOD") field(OMSL, "closed_loop") field(DTYP, "Soft Channel") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:500: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, "QUAD:LTUS:500: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, "QUAD:LTUS:500: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, "QUAD:LTUS:500:CALBOFFSET") { field(DESC, "Calc DAC Offset") field(PREC, "6") field(EGU, "Counts") field(PINI, "YES") } record(bo, "QUAD:LTUS:500: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, "QUAD:LTUS:500:DACSLOPE") { field(DESC, "V to DAC slope") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "closed_loop") field(PINI, "YES") field(FLNK, "QUAD:LTUS:500:DACOFFSET") } # Default Offset used in conversion from Volts to DAC Counts record(ao, "QUAD:LTUS:500:DACOFFSET") { field(DESC, "V to DAC offset") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "closed_loop") field(PINI, "YES") field(FLNK, "QUAD:LTUS:500: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, "QUAD:LTUS:500: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, "QUAD:LTUS:500:IACT") field(INPD, "QUAD:LTUS:500:DACSLOPE") field(INPE, "QUAD:LTUS:500:DACOFFSET") field(EGU, "Counts") field(PREC, "6") } record(ao, "QUAD:LTUS:500:DAC") { field(DESC, "DAC Set point") field(EGU, "Counts") field(DOL, "") field(OMSL, "closed_loop") field(PREC, "6") field(PINI, "YES") } record(ao, "QUAD:LTUS:500:CALBIMIN") { field(DESC, "Calibration Min Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(DRVH, "200.0") field(HOPR, "200.0") field(DRVL, "0.0") field(LOPR, "0.0") field(PREC, "3") field(EGU, "A") field(VAL, "0.0") field(FLNK, "QUAD:LTUS:500:CALBIMAX") } record(ao, "QUAD:LTUS:500:CALBIMAX") { field(DESC, "Calibration Max Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(DRVH, "200.0") field(HOPR, "200.0") field(LOPR, "0.0") field(DRVL, "0.0") field(EGU, "A") field(VAL, "200.0") field(FLNK, "QUAD:LTUS:500:CALBSTEPNUM") } record(ao, "QUAD:LTUS:500:CALBIFINAL") { field(DESC, "Calibration Last Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(PREC, "3") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(VAL, "0") } record(longout, "QUAD:LTUS:500: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, "QUAD:LTUS:500:CALBIDELTA") } record(calc, "QUAD:LTUS:500:CALBIDELTA") { field(DESC, "Step size for CALB") field(CALC, "C=0?0:ABS((A-B)/C)") field(INPA, "QUAD:LTUS:500:CALBIMAX") field(INPB, "QUAD:LTUS:500:CALBIMIN") field(INPC, "QUAD:LTUS:500: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, "QUAD:LTUS:500:CALBIMULT") { field(DESC, "IACT vs ISETPT mult") field(CALC, "C#0||A=0?1:ABS(B/A)") field(INPA, "PSC:LTUS:MG09:ISETPT.DRVH") field(INPB, "PSC:LTUS:MG09:IACT.HOPR") field(INPC, "QUAD:LTUS:500:PSCONTROLLER.RVAL CPP") field(EGU, "A") field(PINI, "YES") } # SNL dbputs DAC values here. 6-10 steps are possible. record(waveform, "QUAD:LTUS:500:CALBICTRLWF") { field(DESC, "ICTRL setpoint array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") } record(waveform, "QUAD:LTUS:500:DACWF") { field(DESC, "DAC count array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:500:DACSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:500:DACSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "QUAD:LTUS:500: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, "QUAD:LTUS:500:CALCDACWF") { field(DESC, "Calc DAC counts array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:500:CALCDACSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:500:CALCDACSA") { field(DESC, "Calc DAC counts") field(DTYP, "Soft Channel") field(INP, "QUAD:LTUS:500: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, "QUAD:LTUS:500:CALBYWF") { field(DESC, "mx + b") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:500:CALBYSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:500:CALBYSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "QUAD:LTUS:500:CALBYWF") field(MALM, "10") field(NELM, "6") field(INDX, "0") field(FTVL, "DOUBLE") } record(waveform, "QUAD:LTUS:500:CALBIACTWF") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:500:CALBIACTSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:500:CALBIACTSA") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(MALM, "10") field(NELM, "6") field(INP, "QUAD:LTUS:500:CALBIACTWF") field(INDX, "0") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:500:CALBLIMITS") } # Check that measured current during calibration is within # tolerance. record(aSub, "QUAD:LTUS:500: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, "QUAD:LTUS:500:CALBSTEPNUM") field(INPB, "QUAD:LTUS:500:CALBIACTWF") field(INPC, "QUAD:LTUS:500: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, "QUAD:LTUS:500: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, "QUAD:LTUS:500:STDZITOL") field(INPH, "QUAD:LTUS:500:DACSLOPE") field(INPI, "QUAD:LTUS:500: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, "QUAD:LTUS:500: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, "QUAD:LTUS:500:CALBSTEPNUM") field(INPB, "QUAD:LTUS:500:CALBIACTWF") field(INPC, "QUAD:LTUS:500:DACWF") field(INPF, "QUAD:LTUS:500: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 QUAD:LTUS:500CALBOK 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, "QUAD:LTUS:500:DEGAUSINIT") { field(DESC, "Proc. Degauss PVs on boot") field(PINI, "YES") field(DOL, "1") field(OUTA, "QUAD:LTUS:500:DEGAUSIMIN.PROC PP") field(OUTB, "QUAD:LTUS:500:DEGAUSIMAX.PROC PP") field(OUTC, "QUAD:LTUS:500:DEGAUSTYPE.PROC PP") field(OUTD, "QUAD:LTUS:500:DEGAUSSTEP.PROC PP") field(OUTE, "QUAD:LTUS:500:MADNAME.PROC PP") field(OUTF, "QUAD:LTUS:500:PSTYPE.PROC PP") field(OUTG, "QUAD:LTUS:500: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, "QUAD:LTUS:500:DEGAUSSUB") { field(DESC, "Degauss subroutine") field(INAM, "mgntDegaussInit") field(SNAM, "mgntDegauss") field(BRSV, "INVALID") field(INPA, "QUAD:LTUS:500:DEGAUSIMIN NPP NMS") field(INPB, "QUAD:LTUS:500:DEGAUSIMAX NPP NMS") field(INPC, "QUAD:LTUS:500:DEGAUSTYPE.RVAL NPP NMS") field(INPE, "QUAD:LTUS:500:DEGAUSMETHOD.RVAL NPP NMS") field(INPF, "QUAD:LTUS:500:PSTYPE NPP NMS") field(INPG, "QUAD:LTUS:500:DEBUG.RVAL NPP NMS") field(INPH, "QUAD:LTUS:500: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, "QUAD:LTUS:500:DEGAUSWF PP") field(OUTB, "QUAD:LTUS:500:DEGAUSMSG PP") field(OUTC, "QUAD:LTUS:500: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, "QUAD:LTUS:500:DEGAUSWF") { field(DESC, "Degauss Setpts") field(NELM, "60") field(FTVL, "DOUBLE") } record(mbbo,"QUAD:LTUS:500: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, "QUAD:LTUS:500: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, "QUAD:LTUS:500: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, "QUAD:LTUS:500: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, "QUAD:LTUS:500: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, "QUAD:LTUS:500:DEGAUSIMIN") { field(DESC, "Min. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "200.0") field(LOPR, "-200.0") field(DRVH, "200.0") field(DRVL, "-200.0") field(VAL, "-200.0") } record(ao, "QUAD:LTUS:500:DEGAUSIMAX") { field(DESC, "Max. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "200.0") field(LOPR, "-200.0") field(DRVH, "200.0") field(DRVL, "-200.0") field(VAL, "200.0") } # 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,"QUAD:LTUS:500: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, "QUAD:LTUS:500: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,"QUAD:LTUS:500: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, "QUAD:LTUS:500: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, "QUAD:LTUS:500: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, "QUAD:LTUS:500: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, "QUAD:LTUS:500:DEGAUSTOD") { field(DESC, "Successful Degauss Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "QUAD:LTUS:500:DEGAUSLOSTTOD") { field(DESC, "Degauss Lost Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:500:DEGAUSTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "QUAD:LTUS:500:DEGAUSTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "QUAD:LTUS:500: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, "QUAD:LTUS:500:DEGAUSGO") { field(DESC, "Set bdes of btrms to zero") field(ASG, "Internal") field(OUTA, "") field(OUTB, "") field(OUTC, "") field(OUTD, "") } # =========== CRYO ONLY =========== record(bo, "QUAD:LTUS:500: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, "QUAD:LTUS:500:DEGAUS_IMAX_CHECK") { field(DESC, "Check if imax shoud chg") field(CALC, "(C==4)&&(ABS(B)>ABS(A))?1:0") field(INPA, "QUAD:LTUS:500:DEGAUS_IMAX") field(INPB, "QUAD:LTUS:500:ISETPT") field(INPC, "QUAD:LTUS:500:DEGAUSTYPE.RVAL") field(OUT, "QUAD:LTUS:500:DEGAUS_IMAX_UPDATE.SELN") field(FLNK, "QUAD:LTUS:500:DEGAUS_IMAX_UPDATE") } record(seq, "QUAD:LTUS:500:DEGAUS_IMAX_UPDATE") { field(DESC, "Degauss IMAX Update") field(SELM, "Specified") field(DOL1, "QUAD:LTUS:500:ISETPT") field(LNK1, "QUAD:LTUS:500:DEGAUS_IMAX PP") } # Set the maximum current after a successful # degauss. This pv is updated by the # sequence. record(ao, "QUAD:LTUS:500:DEGAUS_IMAX") { field(DESC, "Max I set afer a degauss") field(EGU, "Amps") field(PINI, "YES") field(PREC, "6") field(HOPR, "200.0") field(LOPR, "-200.0") field(DRVH, "200.0") field(DRVL, "-200.0") field(VAL, "200.0") field(FLNK, "QUAD:LTUS:500:DEGAUS_IMAXPOL_CHECK") info(autosaveFields,"VAL,RVAL") } # Set the polarity if degauss_imax record(calcout, "QUAD:LTUS:500:DEGAUS_IMAXPOL_CHECK") { field(DESC, "Determine polarity of imax") field(CALC, "A>=0?0:1") field(INPA, "QUAD:LTUS:500:DEGAUS_IMAX") field(FLNK, "QUAD:LTUS:500:DEGAUS_IMAXPOL") } record(bo, "QUAD:LTUS:500:DEGAUS_IMAXPOL") { field(DESC, "Polarity of imax I") field(DTYP, "Raw Soft Channel") field(DOL, "QUAD:LTUS:500:DEGAUS_IMAXPOL_CHECK") field(OMSL, "closed_loop") field(ZNAM, "Positive") field(ONAM, "Negative") field(FLNK, "QUAD:LTUS:500: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, "QUAD:LTUS:500:DEGAUS_ABSIMAX") { field(DESC, "Absolute Max. Degauss I") field(CALC, "ABS(A)") field(INPA, "QUAD:LTUS:500:DEGAUS_IMAX") field(PREC, "6") field(EGU, "Amps") field(HOPR, "200.0") field(LOPR, "-200.0") info(autosaveFields,"VAL RVAL") } # IACT Polarity record(calcout, "QUAD:LTUS:500:IACTPOL_CHECK") { field(DESC, "Determine IACT polarity") field(SCAN, "5 second") field(CALC, "ABS(A-B)>C?(A>=0?0:1):D") field(INPA, "QUAD:LTUS:500:IACT") field(INPB, "QUAD:LTUS:500:IACTPOL_CHECK.LA") field(INPC, "0.0001") field(INPD, "QUAD:LTUS:500:IACTPOL_CHECK.PVAL") field(OOPT, "On Change") field(FLNK, "QUAD:LTUS:500:IACTPOL") } record(bo, "QUAD:LTUS:500: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,"QUAD:LTUS:500: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, "QUAD:LTUS:500:DEGAUSENABLE CP") field(INPB, "QUAD:LTUS:500:DEGAUSOK") field(INPC, "QUAD:LTUS:500:STATE CP") field(INPD, "QUAD:LTUS:500:STATE.SEVR") field(OUT, "QUAD:LTUS:500:DEGAUS_STATE_SEQ.SELN PP") field(ASG, "Internal") } record(seq, "QUAD:LTUS:500:DEGAUS_STATE_SEQ") { field(DESC, "Degauss State Sequence") field(SELM, "Specified") field(SELL, "QUAD:LTUS:500:DEGAUS_STATE_CHECK") field(LNK1, "QUAD:LTUS:500:DEGAUS_STATE_DISABLE.PROC PP") field(LNK2, "QUAD:LTUS:500:DEGAUS_STATE_LOST.PROC PP") field(LNK3, "QUAD:LTUS:500:DEGAUS_STATE_GOOD.PROC PP") field(LNK4, "QUAD:LTUS:500: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, "QUAD:LTUS:500:DEGAUS_STATE_DISABLE") { field(DESC, "Degauss not used") field(LNK1, "QUAD:LTUS:500:DEGAUSOK.ZSV") field(LNK2, "QUAD:LTUS:500: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, "QUAD:LTUS:500:STATMSG.FRSV") field(LNK4, "QUAD:LTUS:500: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, "QUAD:LTUS:500:DEGAUS_STATE_LOST") { field(DESC, "Degauss lost and ps On") field(DOL1, "1") field(LNK1, "QUAD:LTUS:500:DEGAUSOK.ZSV") field(LNK2, "QUAD:LTUS:500: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, "QUAD:LTUS:500:STATMSG.FRSV") field(LNK4, "QUAD:LTUS:500: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, "QUAD:LTUS:500:DEGAUS_STATE_OFF") { field(DESC, "Degaused lost and ps Off") field(DOL1, "2") field(LNK1, "QUAD:LTUS:500: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, "QUAD:LTUS:500:STATMSG.FRSV") field(LNK3, "QUAD:LTUS:500: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, "QUAD:LTUS:500:DEGAUS_STATE_GOOD") { field(DESC, "Degauss good") field(DOL1, "1") field(LNK1, "QUAD:LTUS:500: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, "QUAD:LTUS:500:STATMSG.FRSV PP") field(LNK3, "QUAD:LTUS:500:STATMSG.FVSV PP") field(LNK4, "") field(ASG, "Internal") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(mbbo, "QUAD:LTUS:500:FUNC") { field(DESC, "QUAD:LTUS:500 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, "1") field(THVL, "9") field(FRVL, "10") field(FVVL, "0") field(SXVL, "2") field(SVVL, "8") field(EIVL, "11") field(NIVL, "12") field(TEVL, "13") field(ELVL, "5") field(TVVL, "6") field(TTVL, "7") field(FTVL, "4") field(FFVL, "3") field(OUT, "QUAD:LTUS:500:CTRL CA") } # :CTRL pv is processed at boot in the # sequence mgntCtrl.st Processed in sequence # record(mbbo, "QUAD:LTUS:500:CTRL") { field(DESC, "QUAD:LTUS:500 Control") field(PINI, "NO") field(ZRST, "Ready") field(ONST, "TRIM") field(TWST, "PERTURB") field(THST, "BCON_TO_BDES") field(FRST, "BACT_TO_BDES") field(FVST, "SAVE_BDES") field(SXST, "LOAD_BDES") field(SVST, "UNDO_BDES") field(EIST, "DAC_ZERO") field(NIST, "CALB") field(TEST, "STDZ") field(ELST, "RESET") field(TVST, "TURN_ON") field(TTST, "TURN_OFF") field(FTST, "") field(FFST, "") field(ZRVL, "0") field(ONVL, "2") field(TWVL, "6") field(THVL, "15") field(FRVL, "14") field(FVVL, "11") field(SXVL, "12") field(SVVL, "13") field(EIVL, "7") field(NIVL, "3") field(TEVL, "4") field(ELVL, "8") field(TVVL, "9") field(TTVL, "10") field(FTVL, "0") field(FFVL, "0") field(OUT, "QUAD:LTUS:500:SELECTEN.A PP") field(SDIS, "0") } # If a function has been selected set this unit to busy record(calcout, "QUAD:LTUS:500:SELECTEN") { field(DESC, "Control Select Enable") field(CALC, "A>0?1:A") field(FLNK, "QUAD:LTUS:500:BUSY") } # Set to FREE on IOC reboot record(bo, "QUAD:LTUS:500:BUSY") { field(DESC, "QUAD:LTUS:500 Ctrl Done") field(DOL, "QUAD:LTUS:500:SELECTEN") field(ZNAM, "FREE") field(ONAM, "BUSY") field(PINI, "YES") field(FLNK, "QUAD:LTUS:500:SELECT") } record(bo, "QUAD:LTUS:500:SELECT") { field(ZNAM, "NO") field(ONAM, "YES") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") } record(bo, "QUAD:LTUS:500: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, "QUAD:LTUS:500:CTRLSTATE") { field(DESC, "QUAD:LTUS:500 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("QUAD:LTUS:500:CTRL",20,20,0,0,"QUAD:LTUS:500:CTRL") #! Field("QUAD:LTUS:500:CTRL.OUT",16777215,1,"QUAD:LTUS:500:CTRL.OUT") #! Link("QUAD:LTUS:500:CTRL.OUT","QUAD:LTUS:500:SELECTEN.A") #! Field("QUAD:LTUS:500:CTRL.VAL",16777215,1,"QUAD:LTUS:500:CTRL.VAL") #! Record("QUAD:LTUS:500:SELECTEN",321,381,0,0,"QUAD:LTUS:500:SELECTEN") #! Field("QUAD:LTUS:500:SELECTEN.A",16777215,0,"QUAD:LTUS:500:SELECTEN.A") #! Field("QUAD:LTUS:500:SELECTEN.FLNK",16777215,1,"QUAD:LTUS:500:SELECTEN.FLNK") #! Link("QUAD:LTUS:500:SELECTEN.FLNK","QUAD:LTUS:500:BUSY") #! Field("QUAD:LTUS:500:SELECTEN.VAL",16777215,1,"QUAD:LTUS:500:SELECTEN.VAL") #! Record("QUAD:LTUS:500:BUSY",623,274,0,0,"QUAD:LTUS:500:BUSY") #! Field("QUAD:LTUS:500:BUSY.DOL",16777215,0,"QUAD:LTUS:500:BUSY.DOL") #! Link("QUAD:LTUS:500:BUSY.DOL","QUAD:LTUS:500:SELECTEN.VAL") #! Field("QUAD:LTUS:500:BUSY.FLNK",16777215,1,"QUAD:LTUS:500:BUSY.FLNK") #! Link("QUAD:LTUS:500:BUSY.FLNK","QUAD:LTUS:500:SELECT") #! Record("QUAD:LTUS:500:SELECT",669,508,0,1,"QUAD:LTUS:500:SELECT") #! Record("QUAD:LTUS:500:FUNC",940,120,0,0,"QUAD:LTUS:500:FUNC") #! Field("QUAD:LTUS:500:FUNC.OUT",16777215,0,"QUAD:LTUS:500:FUNC.OUT") #! Link("QUAD:LTUS:500:FUNC.OUT","QUAD:LTUS:500:CTRL.VAL") #! Record("QUAD:LTUS:500:ABORT",193,41,0,0,"QUAD:LTUS:500:ABORT") #! Record("QUAD:LTUS:500:CTRLSTATE",369,34,0,0,"QUAD:LTUS:500: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,"QUAD:LTUS:500:SELECT is used for Multi-device selection.\nIt is enabled when associated QUAD:LTUS:500:CTRL is \"0\" (DONE).\nIt is disabled when associated QUAD:LTUS:500: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,"QUAD:LTUS:500: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, "QUAD:LTUS:500:BCTRL_INIT") { field(DESC, "Process BCTRL on boot") field(PINI, "YES") field(CALC, "A=3?1:0") field(INPA, "QUAD:LTUS:500:BCTRL.SEVR") field(OUT, "QUAD:LTUS:500: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, "QUAD:LTUS:500:BACT") { field(DESC, "Actual B") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "QUAD:LTUS:500:BACT") field(INPB, "QUAD:LTUS:500:POLYCOEF") field(INPC, "QUAD:LTUS:500:POLYCOEF.A") field(INPD, "QUAD:LTUS:500:POLYCOEF.B") field(INPE, "QUAD:LTUS:500:IACT MS") field(INPF, "QUAD:LTUS:500:BDELTAS PP") field(INPG, "100") field(EGU, "kG") field(HOPR, "-0.2564") field(LOPR, "-101.4549") field(HIHI, "-0.2564") field(LOLO, "-101.4549") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "-0.2564") field(LOW, "-101.4549") field(FLNK, "QUAD:LTUS:500: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, "QUAD:LTUS:500:BDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntPhyDeltas") field(EGU, "kG") field(HOPR, "1") field(PREC, "7") field(BRSV, "INVALID") field(INPA, "QUAD:LTUS:500:BDES") field(INPB, "QUAD:LTUS:500:TRIMBTOL") field(INPC, "QUAD:LTUS:500:TRIMBTOLR") field(INPD, "QUAD:LTUS:500:CHCKBTOL") field(INPE, "QUAD:LTUS:500:CHCKBTOLR") field(F, "2.0") field(INPG, "30") field(INPH, "QUAD:LTUS:500:BACT.VAL") # # MPS absolute and relative tolerances field(INPP, "QUAD:LTUS:500:MPSBTOL") field(INPQ, "QUAD:LTUS:500:MPSBTOLR") field(FLNK, "QUAD:LTUS:500:BCONLIMITS") info(autosaveFields,"F") } # This record is processed by BDELTAS record(aSub, "QUAD:LTUS:500:BCONLIMITS") { field(DESC, "Config B-field Limits") field(INAM, "mgntInit") field(SNAM, "mgntBCONLimits") field(INPA, "QUAD:LTUS:500:BDES") field(INPB, "QUAD:LTUS:500:BDELTAS.I") field(INPG, "QUAD:LTUS:500:DEBUG.RVAL") field(FTA, "DOUBLE") field(FTB, "DOUBLE") field(FTG, "ULONG") field(OUTA, "QUAD:LTUS:500:BCON.HIGH") field(OUTB, "QUAD:LTUS:500:BCON.LOW") field(OUTC, "QUAD:LTUS:500:BCON.HIHI") field(OUTD, "QUAD:LTUS:500:BCON.LOLO PP") field(FTVA, "DOUBLE") field(FTVB, "DOUBLE") field(FTVC, "DOUBLE") field(FTVD, "DOUBLE") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:500:IDELTAS") } # The following PV is processed by :BACT # which is processed by :BACT # record(fanout, "QUAD:LTUS:500:BACTFO") { field(DESC, "BACT processing") field(SELM, "All") field(LNK1, "QUAD:LTUS:500:BDIFF") field(LNK2, "QUAD:LTUS:500:BADIFF") field(LNK3, "QUAD:LTUS:500:BRATIO") field(LNK4, "QUAD:LTUS:500:MPSLIMITS") field(LNK5, "QUAD:LTUS:500:I2BSTATUS") field(LNK6, "QUAD:LTUS:500:IACTFO.PROC") } record(calc, "QUAD:LTUS:500:BDIFF") { field(DESC, "BDES-BACT") field(CALC, "A-B") field(INPA, "QUAD:LTUS:500:BDES") field(INPB, "QUAD:LTUS:500:BACT") field(EGU, "kG") field(PREC, "7") } record(calc, "QUAD:LTUS:500:BADIFF") { field(DESC, "Absolute BDES-BACT") field(INPA, "QUAD:LTUS:500:BDIFF") field(EGU, "kG") field(PREC, "7") field(CALC, "A<0?ABS(A):A") } record(calc, "QUAD:LTUS:500:BRATIO") { field(DESC, "BACT Error") field(CALC, "B?A/B:0") field(INPA, "QUAD:LTUS:500:BDIFF") field(INPB, "QUAD:LTUS:500:BDES.HOPR") field(EGU, "kG") field(PREC, "7") } record(mbbi, "QUAD:LTUS:500: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, "QUAD:LTUS:500:BACT.J") } # Note: for a string slave set the MONFL # macro to the following: # MONFL=:IMONCALC MS record(sub, "QUAD:LTUS:500:BMON") { field(DESC, "Second Transductor") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "QUAD:LTUS:500:BMON") field(INPB, "QUAD:LTUS:500:POLYCOEF") field(INPC, "QUAD:LTUS:500:POLYCOEF.A") field(INPD, "QUAD:LTUS:500:POLYCOEF.B") field(INPE, "QUAD:LTUS:500:IMON MS") field(INPF, "QUAD:LTUS:500:BDELTAS.VAL") field(INPG, "100") field(EGU, "kG") field(HOPR, "-0.2564") field(LOPR, "-101.4549") field(HIHI, "-0.2564") field(LOLO, "-101.4549") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "-0.2564") field(LOW, "-101.4549") } # 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=PSC:LTUS:MG09:BDES CP record(ao, "QUAD:LTUS:500:BDES") { field(DESC, "Desired B-Field") field(PINI, "YES") field(DRVH, "-0.2564") field(DRVL, "-101.4549") field(HOPR, "-0.2564") field(LOPR, "-101.4549") field(PREC, "7") field(EGU, "kG") field(MDEL, "-1") field(OMSL, "supervisory") # field(DOL, "") field(OUT, "QUAD:LTUS:500:B2IDES PP") info(autosaveFields,"VAL") } record(sub, "QUAD:LTUS:500:B2IDES") { field(DESC, "Convert Desired B-Field to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:500:POLYCOEF") field(INPC, "QUAD:LTUS:500:POLYCOEF.A") field(INPD, "QUAD:LTUS:500:POLYCOEF.B") field(PREC, "7") field(EGU, "kG") field(HOPR, "-0.2564") field(LOPR, "-101.4549") field(MDEL, "-1") field(INPE, "QUAD:LTUS:500:BDES.DRVH") field(INPF, "QUAD:LTUS:500:BDES.DRVL") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:500:IDES") } record(sub, "QUAD:LTUS:500:BNOM") { field(DESC, "Nominal Field") field(PINI, "YES") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:500:POLYCOEF") field(INPC, "QUAD:LTUS:500:POLYCOEF.A") field(INPD, "QUAD:LTUS:500:POLYCOEF.B") field(INPE, "QUAD:LTUS:500:BDES.DRVH") field(INPF, "QUAD:LTUS:500:BDES.DRVL") field(EGU, "kG") field(HOPR, "-0.2564") field(LOPR, "-101.4549") field(PREC, "7") field(VAL, "0.0") field(FLNK, "QUAD:LTUS:500:INOM") } record(sub, "QUAD:LTUS:500:BACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:500:BDES.VAL") field(INPB, "QUAD:LTUS:500:BDES.DRVH") field(INPC, "QUAD:LTUS:500:BDES.DRVL") field(INPD, "QUAD:LTUS:500:BDELTAS.I") field(INPE, "QUAD:LTUS:500:BDELTAS.J") field(INPG, "QUAD:LTUS:500:STATE") field(INPH, "QUAD:LTUS:500:HSTA") field(EGU, "kG") field(HOPR, "-0.2564") field(LOPR, "-101.4549") field(PREC, "7") field(BRSV, "INVALID") } record(sub, "QUAD:LTUS:500:BMONLIMITS") { field(DESC, "MON Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:500:BDES.VAL") field(INPB, "QUAD:LTUS:500:BDES.DRVH") field(INPC, "QUAD:LTUS:500:BDES.DRVL") field(INPD, "QUAD:LTUS:500:BDELTAS.K") field(INPE, "QUAD:LTUS:500:BDELTAS.L") field(INPG, "QUAD:LTUS:500:STATE") field(INPH, "QUAD:LTUS:500:HSTA") field(EGU, "kG") field(HOPR, "-0.2564") field(LOPR, "-101.4549") field(PREC, "7") field(BRSV, "INVALID") } record(seq, "QUAD:LTUS:500:BLIMITS") { field(DESC, "ACT Limits") field(PREC, "7") field(DOL1, "QUAD:LTUS:500:BLIMITS") field(LNK1, "QUAD:LTUS:500:BACTLIMITS.F PP") field(DOL2, "QUAD:LTUS:500:BACTLIMITS.I") field(LNK2, "QUAD:LTUS:500:BACT.HIGH") field(DOL3, "QUAD:LTUS:500:BACTLIMITS.J") field(LNK3, "QUAD:LTUS:500:BACT.LOW") field(DOL4, "QUAD:LTUS:500:BACTLIMITS.K") field(LNK4, "QUAD:LTUS:500:BACT.HIHI") field(DOL5, "QUAD:LTUS:500:BACTLIMITS.L") field(LNK5, "QUAD:LTUS:500:BACT.LOLO") field(DOL6, "QUAD:LTUS:500:BLIMITS") field(LNK6, "QUAD:LTUS:500:BMONLIMITS.F PP") field(DOL7, "QUAD:LTUS:500:BMONLIMITS.I") field(LNK7, "QUAD:LTUS:500:BMON.HIGH") field(DOL8, "QUAD:LTUS:500:BMONLIMITS.J") field(LNK8, "QUAD:LTUS:500:BMON.LOW") field(DOL9, "QUAD:LTUS:500:BMONLIMITS.K") field(LNK9, "QUAD:LTUS:500:BMON.HIHI") field(DOLA, "QUAD:LTUS:500:BMONLIMITS.L") field(LNKA, "QUAD:LTUS:500:BMON.LOLO") field(FLNK, "QUAD:LTUS:500:ILIMITS") field(SCAN, "5 second") } record(ao, "QUAD:LTUS:500:BCTRL") { field(DESC, "B-Perturb") field(PREC, "7") field(EGU, "kG") field(DRVH, "-0.2564") field(DRVL, "-101.4549") field(HOPR, "-0.2564") field(LOPR, "-101.4549") # 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, "QUAD:LTUS:500: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, "QUAD:LTUS:500:BCTRLGO") { field(DESC, "Update DES and perturb") field(PREC, "7") # Disable BACT limits field(DOL1, "1") field(LNK1, "QUAD:LTUS:500:BLIMITS.VAL") # Update BDES with the BCTRL (slider) value field(DOL2, "QUAD:LTUS:500:BCTRL.VAL") field(LNK2, "QUAD:LTUS:500:BDES PP") field(DOL3, "1") field(LNK3, "QUAD:LTUS:500:IDIRECT.PROC PP") field(DOL4, "1") field(LNK4, "QUAD:LTUS:500:CHECKSTDZLOST.PROC PP") field(DOL5, "QUAD:LTUS:500:BCTRL.VAL") field(LNK5, "QUAD:LTUS:500:BCTRLSUB PP") # Re-enable BACT limits field(DOL6, "0") field(LNK6, "QUAD:LTUS:500:BLIMITS.VAL") } # Convert B-field to Current and output to ISETPT record(sub, "QUAD:LTUS:500:BCTRLSUB") { field(DESC, "Feedback") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:500:POLYCOEF") field(INPC, "QUAD:LTUS:500:POLYCOEF.A") field(INPD, "QUAD:LTUS:500:POLYCOEF.B") field(INPE, "QUAD:LTUS:500:BDES.DRVH") field(INPF, "QUAD:LTUS:500:BDES.DRVL") field(PREC, "7") field(EGU, "kG") field(HOPR, "-0.2564") field(LOPR, "-101.4549") field(MDEL, "-1") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:500:ISETPT") } record(ao, "QUAD:LTUS:500:BDESPREVTRIM") { field(DESC, "trim bdes for undo") field(DTYP, "Soft Channel") field(DRVH, "-0.2564") field(DRVL, "-101.4549") field(EGU, "kG") field(HOPR, "-0.2564") field(LOPR, "-101.4549") field(PREC, "7") field(PINI, "YES") info(autosaveFields,"VAL") } record(stringin, "QUAD:LTUS:500:MADNAME") { field(DESC, "MAD deck nomenclature") field(PINI, "YES") field(VAL, "QDL21") } record(ai, "QUAD:LTUS:500: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, "3364.281179") } record(ao, "QUAD:LTUS:500:BMAX") { field(DESC, "Max B-Field") field(DTYP, "Soft Channel") field(DRVH, "-0.2564") field(DRVL, "-101.4549") field(EGU, "kG") field(HOPR, "-0.2564") field(LOPR, "-101.4549") field(PREC, "7") field(PINI, "YES") field(VAL, "-0.2564") field(FLNK, "QUAD:LTUS:500:BSTEP") } record(ao, "QUAD:LTUS:500:BMIN") { field(DESC, "Min B-Field") field(DTYP, "Soft Channel") field(DRVH, "-0.2564") field(DRVL, "-101.4549") field(EGU, "kG") field(HOPR, "-0.2564") field(LOPR, "-101.4549") field(PREC, "7") field(PINI, "YES") field(VAL, "-101.4549") field(FLNK, "QUAD:LTUS:500:BSTEP") } record(ao, "QUAD:LTUS:500:BDESSAVE") { field(DESC, "bdes for save/load") field(DTYP, "Soft Channel") field(DRVH, "-0.2564") field(DRVL, "-101.4549") field(EGU, "kG") field(HOPR, "-0.2564") field(LOPR, "-101.4549") field(PINI, "YES") field(PREC, "7") } # This record is processed by QUAD:LTUS:500: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, "QUAD:LTUS:500:BCON") { field(DESC, "Config B-Field ") field(DTYP, "Soft Channel") field(PREC, "7") field(EGU, "kG") field(HOPR, "-0.2564") field(LOPR, "-101.4549") field(DRVH, "-0.2564") field(DRVL, "-101.4549") # Set MINOR Alarm as the default, slaves will set NO_ALARM=0. field(HHSV, "MINOR") field(LLSV, "MINOR") field(HSV, "MINOR") field(LSV, "MINOR") # field(DOL , "") field(OMSL, "supervisory") field(OUT, "QUAD:LTUS:500:B2ICON PP") info(autosaveFields,"VAL") } record(sub, "QUAD:LTUS:500:B2ICON") { field(DESC, "Convert Desired ICon to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:500:POLYCOEF") field(INPC, "QUAD:LTUS:500:POLYCOEF.A") field(INPD, "QUAD:LTUS:500:POLYCOEF.B") field(PREC, "7") field(EGU, "kG") field(HOPR, "-0.2564") field(LOPR, "-101.4549") field(MDEL, "-1") field(INPE, "QUAD:LTUS:500:BCON.DRVH") field(INPF, "QUAD:LTUS:500:BCON.DRVL") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:500: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, "QUAD:LTUS:500:BSTEP") { field(DESC, "B-Field step size") field(CALC, "(C==3)||(D==3)?0:ABS(A-B)*0.005") field(INPA, "QUAD:LTUS:500:BMAX") field(INPB, "QUAD:LTUS:500:BMIN") field(INPC, "QUAD:LTUS:500:BMIN.SEVR") field(INPD, "QUAD:LTUS:500:BMAX.SEVR") field(EGU, "kG") 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,"QUAD:LTUS:500:BCTRLDISABLECALC") { field(DESC, "Calc for disabling BCTRL") field(ASG, "Internal") field(CALC, "A?2:1") field(INPA, "QUAD:LTUS:500:ONLINE CP") field(OUT, "QUAD:LTUS:500:BCTRLDISABLEFOUT PP") } record(fanout, "QUAD:LTUS:500:BCTRLDISABLEFOUT") { field(DESC, "Disable BCTRL fanout") field(SELM, "Specified") field(SELL, "QUAD:LTUS:500:BCTRLDISABLECALC") field(LNK1, "QUAD:LTUS:500:BCTRLDISABLE") field(LNK2, "QUAD:LTUS:500:BCTRLENABLE") } record(stringout, "QUAD:LTUS:500:BCTRLDISABLE") { field(DESC, "Disable BCTRL") field(DTYP, "Soft Channel") field(OUT, "QUAD:LTUS:500:BCTRL.ASG") field(VAL, "NOWRITE") field(FLNK, "QUAD:LTUS:500:BCTRLDISV_UPDATE") } record(stringout, "QUAD:LTUS:500:BCTRLENABLE") { field(DESC, "Enable BCTRL") field(DTYP, "Soft Channel") field(OUT, "QUAD:LTUS:500:BCTRL.ASG") field(VAL, "") field(FLNK, "QUAD:LTUS:500:BCTRLDISV_UPDATE") } record(calcout, "QUAD:LTUS:500:BCTRLDISV_UPDATE") { field(DESC, "Calc for updating BCTRL.DISV") field(ASG, "Internal") field(CALC, "A") field(INPA, "QUAD:LTUS:500:ONLINE") field(OUT, "QUAD:LTUS:500: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,"QUAD:LTUS:500:BACT and MON\n are processed via links from \n QUAD:LTUS:500:IACT (device raw value readback 1)\n and\n QUAD:LTUS:500: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 QUAD:LTUS:500:POLYCOEF\nC = First polynomial coefficient (offset if linear)\nD = Second polynomial coefficient (slope if linear)\nE = QUAD:LTUS:500: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,"QUAD:LTUS:500:BDES\n is processed when set by CA users or \n QUAD:LTUS:500: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,"QUAD:LTUS:500: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 QUAD:LTUS:500: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 (QUAD:LTUS:500: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,"QUAD:LTUS:500:B*LIMITS and QUAD:LTUS:500:BLIMITS:\n Calculate alarm and warning limits based on \n deltas from QUAD:LTUS:500: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,"QUAD:LTUS:500: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,"QUAD:LTUS:500: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, "QUAD:LTUS:500: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, "QUAD:LTUS:500:MPSBTOL") { field(DESC, "Absolute mps tol") field(EGU, "kG") field(PREC, "2") field(CALC, "ABS(A)*0.02") field(INPA, "QUAD:LTUS:500:BMAX") field(PINI, "YES") } # # 21-Aug-2013: K. Luchini # Set channel access security so that users # cannot easily change values. record(ao, "QUAD:LTUS:500:MPSBMAX") { field(DESC, "MPS Max B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "-0.2564") field(DRVL, "-101.4549") field(PINI, "YES") field(VAL, "-0.2564") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:500:MPSBMIN") { field(DESC, "MPS Min B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "-0.2564") field(DRVL, "-101.4549") field(PINI, "YES") field(VAL, "-101.4549") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:500:MPSBLLIM") { field(DESC, "MPS Low Limit B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "-0.2564") field(DRVL, "-101.4549") field(PINI, "YES") field(VAL, "-101.4549") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:500:MPSBLLIM2") { field(DESC, "MPS Low Limit #2 B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "-0.2564") field(DRVL, "-101.4549") field(PINI, "YES") field(VAL, "-101.4549") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } # Set the default to Std record(mbbo, "QUAD:LTUS:500: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, "QUAD:LTUS:500:MPSLIMITS.E PP") } record(aSub, "QUAD:LTUS:500: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, "QUAD:LTUS:500:MPS.RVAL") field(INPB, "QUAD:LTUS:500:BADIFF") field(INPC, "QUAD:LTUS:500:BDELTAS.N") field(INPD, "QUAD:LTUS:500:BACT") field(INPE, "QUAD:LTUS:500:MPSBITMASK.RVAL") field(INPF, "QUAD:LTUS:500:MPSBLLIM") field(INPG, "QUAD:LTUS:500:MPSBMIN") field(INPH, "QUAD:LTUS:500:MPSBMAX") field(INPI, "QUAD:LTUS:500: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, "QUAD:LTUS:500:INTOL.RVAL PP") field(OUTB, "QUAD:LTUS:500:INTOL_BMIN.RVAL PP") field(OUTC, "QUAD:LTUS:500:INTOL_BRANGE.RVAL PP") field(OUTD, "QUAD:LTUS:500: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, "QUAD:LTUS:500:INTOL") { field(DESC, "BACT within MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:500:MPSLIMITS.VALA") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "QUAD:LTUS:500:INTOL_BMIN") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:500:MPSLIMITS.VALB") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "QUAD:LTUS:500:INTOL_BMIN2") { field(DESC, "MPS tol #2") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:500:MPSLIMITS.VALD") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "QUAD:LTUS:500:INTOL_BRANGE") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:500: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, "QUAD:LTUS:500:CHCKITOL") { field(DESC, "Absolute Check I Tolerance") field(EGU, "A") field(FLNK, "QUAD:LTUS:500:TRIMITOL") field(CALC, "ABS(A*B)") field(INPA, "QUAD:LTUS:500:CHCKBTOL") field(INPB, "QUAD:LTUS:500:POLYCOEF.B") field(PREC, "9") } record(calc, "QUAD:LTUS:500:TRIMBTOL") { field(EGU, "kG") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(DESC, "Absolute Trim Tolerance") field(CALC, "ABS(A)/2") field(INPA, "QUAD:LTUS:500:CHCKBTOL") field(FLNK, "QUAD:LTUS:500:CHCKITOL") } record(calc, "QUAD:LTUS:500:CHCKBTOL") { field(DESC, "Check absolute tolerance") field(EGU, "A") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(FLNK, "QUAD:LTUS:500:TRIMBTOL") field(CALC, "MAX(ABS(A),ABS(C))*(B/1000000)") field(INPA, "QUAD:LTUS:500:BDES.HOPR") field(INPB, "QUAD:LTUS:500:STABILITY") field(INPC, "QUAD:LTUS:500:BDES.LOPR") } record(longout, "QUAD:LTUS:500: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, "QUAD:LTUS:500:CHCKBTOL") } record(calc, "QUAD:LTUS:500:TRIMITOL") { field(DESC, "Absolute Trim I Tolerance") field(EGU, "kG") field(CALC, "ABS(A*B)") field(INPA, "QUAD:LTUS:500:POLYCOEF.B") field(INPB, "QUAD:LTUS:500:TRIMBTOL") field(PREC, "9") } record(ai, "QUAD:LTUS:500:TRIMBTOLR") { field(DESC, "Relative trim tol") field(PREC, "4") field(EGU, "%") field(HOPR, "1.0") field(LOPR, "0.0") field(PINI, "YES") } record(ai, "QUAD:LTUS:500: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, "QUAD:LTUS:500:FBCKFCOM") { field(ZNAM, "CA") field(ONAM, "FCOM") field(DESC, "CA Mode") field(PINI, "YES") field(SDIS, "0") } record(bo, "QUAD:LTUS:500:PAU") { field(ZNAM, "NotConfigured") field(ONAM, "Configured") field(DESC, "PAU Present") field(PINI, "YES") field(SDIS, "0") field(FLNK, "QUAD:LTUS:500:PAUGO") } record(fanout, "QUAD:LTUS:500:PAUGO") { field(DESC, "PAU control") field(LNK1, "QUAD:LTUS:500:PAUSTOP") field(LNK2, "QUAD:LTUS:500: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, "QUAD:LTUS:500:PAUSTART") { field(DESC, "Setup for PAU On") field(SDIS, "QUAD:LTUS:500: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, "QUAD:LTUS:500:PAUSTOP") { field(DESC, "Setup for PAU Off") field(SDIS, "QUAD:LTUS:500: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, "QUAD:LTUS:500:MCORDEVNAME") { field(DESC, "PS device name") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, "PSC:LTUS:MG09:") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "QUAD:LTUS:500: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, "QUAD:LTUS:500:PSTYPE.RVAL") field(INPC, "QUAD:LTUS:500:TURNEDOFF.RVAL") field(INPD, "QUAD:LTUS:500:CONFIG.RVAL") field(INPE, "QUAD:LTUS:500:PSCATEGORY.RVAL") field(INPF, "QUAD:LTUS:500:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "QUAD:LTUS:500:AUTOCTRL.RVAL") field(INPJ, "QUAD:LTUS:500:OUTOFSERVICE.RVAL") field(INPL, "QUAD:LTUS:500:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "QUAD:LTUS:500:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "QUAD:LTUS:500:PAU") field(INPP, "QUAD:LTUS:500:CALBDISABLE.RVAL") field(INPQ, "QUAD:LTUS:500:PTRBDISABLE.RVAL") field(INPR, "QUAD:LTUS:500:TRIMDISABLE.RVAL") field(INPS, "QUAD:LTUS:500:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "QUAD:LTUS:500:FBCK") field(INPU, "QUAD:LTUS:500:TRIMTYPE.RVAL") field(INPV, "QUAD:LTUS:500:STDZDIRECT.RVAL") field(INPW, "QUAD:LTUS:500:DEGAUSENABLE.RVAL") field(FLNK, "QUAD:LTUS:500:HSTA") } record(longin, "QUAD:LTUS:500:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "QUAD:LTUS:500:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "QUAD:LTUS:500: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, "QUAD:LTUS:500: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, "QUAD:LTUS:500:CALBDISABLE") { field(DESC, "DAC Calb Disabled") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:500:PTRBDISABLE") { field(DESC, "Perturb Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:500:TRIMDISABLE") { field(DESC, "Trim Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:500: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 QUAD:LTUS:500:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses QUAD:LTUS:500:FBCK. # This PV should be replaced by QUAD:LTUS:500: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, "QUAD:LTUS:500: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, "QUAD:LTUS:500: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, "QUAD:LTUS:500: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, "") field(OMSL, "supervisory") field(FLNK, "QUAD:LTUS:500:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"QUAD:LTUS:500:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "QUAD:LTUS:500:OUTOFSERVICE NPP NMS") field(OUT, "QUAD:LTUS:500:ONLINE PP") } record(bo, "QUAD:LTUS:500:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "QUAD:LTUS:500: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, "1") } record(bo, "QUAD:LTUS:500: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, "1") } record(bo, "QUAD:LTUS:500: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, "QUAD:LTUS:500: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, "QUAD:LTUS:500: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, "QUAD:LTUS:500: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, "QUAD:LTUS:500: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, "QUAD:LTUS:500: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, "1") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:500: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, "1") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:500: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, "2") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:500: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, "0") field(ASG, "NOWRITE") field(FLNK, "QUAD:LTUS:500:TRIMTYPE") } record(stringout, "QUAD:LTUS:500:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "QUAD:LTUS:500:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "QUAD:LTUS:500:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "QUAD:LTUS:500:STATE.RVAL") field(INPB, "QUAD:LTUS:500:INTLKSUMY.RVAL") field(OUT, "QUAD:LTUS:500:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:LTUS:500: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, "QUAD:LTUS:500:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "QUAD:LTUS:500:STATE.RVAL") field(INPB, "QUAD:LTUS:500:INTLKSUMY.RVAL") field(OUT, "QUAD:LTUS:500:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:LTUS:500:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "QUAD:LTUS:500:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "QUAD:LTUS:500: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, "QUAD:LTUS:500:RAMPSTARTDLY") { field(DESC, "Tansition to ramp delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "2") } ######### For PSTYPE=2 Only ############# record(mbbo, "QUAD:LTUS:500: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, "QUAD:LTUS:500: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,"QUAD:LTUS:500: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("QUAD:LTUS:500:TURNEDOFF",3140,1907,0,1,"QUAD:LTUS:500:TURNEDOFF") #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "QUAD:LTUS:500:STATSUB") { field(DESC, "Build STATus ") field(INAM, "mgntInit") field(SNAM, "mgntSlcStat") field(INPA, "QUAD:LTUS:500:BACT.STAT") field(INPB, "QUAD:LTUS:500:BDES.STAT") field(INPC, "QUAD:LTUS:500:IRIPL.STAT") field(INPD, "PSC:LTUS:MG09:ISETPT.STAT") field(INPE, "PSC:LTUS:MG09:IACT.STAT") # 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, "QUAD:LTUS:500:BACT.SEVR") field(INPH, "QUAD:LTUS:500:BDES.SEVR") field(INPI, "QUAD:LTUS:500:IRIPL.SEVR") field(INPJ, "PSC:LTUS:MG09:ISETPT.SEVR") field(INPK, "PSC:LTUS:MG09:IACT.SEVR") # # 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, "QUAD:LTUS:500:STATE.RVAL") field(INPN, "QUAD:LTUS:500:STDZOK") field(INPO, "QUAD:LTUS:500:CALBOK") field(INPP, "QUAD:LTUS:500:OUTOFSERVICE.RVAL") field(INPQ, "QUAD:LTUS:500:CONFIG.RVAL") field(INPR, "QUAD:LTUS:500:HSTA") field(INPS, "QUAD:LTUS:500:CTRL.RVAL") field(INPT, "QUAD:LTUS:500:DEGAUSOK") field(INPV, "QUAD:LTUS:500: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, "QUAD:LTUS:500:STAT") } record(longout, "QUAD:LTUS:500:STAT") { field(DESC, "STAT sent to SLC") field(SCAN, "Passive") field(FLNK, "QUAD:LTUS:500:STATCTRLSUB") field(DOL, "QUAD:LTUS:500:STATSUB.VAL") field(OMSL, "closed_loop") } record(sSub, "QUAD:LTUS:500:STATCTRLSUB") { field(DESC, "Decode SLC STAT into mbbo") field(INAM, "mgntInit") field(SNAM, "mgntStatDecode") field(INPA, "QUAD:LTUS:500:STAT") field(INPB, "QUAD:LTUS:500:HSTA") field(INPD, "QUAD:LTUS:500:ONOFFCTRL.RVAL") field(FLNK, "QUAD:LTUS:500:STATMSG") } record(mbbo, "QUAD:LTUS:500: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, "QUAD:LTUS:500:UNAVAILGO") field(DOL, "QUAD:LTUS:500:STATCTRLSUB.W") } record(seq, "QUAD:LTUS:500:UNAVAILGO") { field(DESC, "Process UNAVAIL") field(DOL1, "QUAD:LTUS:500:STATSUB.U") field(LNK1, "QUAD:LTUS:500:UNAVAIL PP") } record(stringout, "QUAD:LTUS:500:SNLSTATMSG") { field(DTYP, "Soft Channel") } #! TextBox(TB0,820,1000,1200,1220,0,"Dialog",12,1,16777215,"QUAD:LTUS:500:STATUSSUB - future\nOverall device status - takes input from action snls, record sevrs, master snl(s) and outputs final status\n\nInputs:\nA - QUAD:LTUS:500:CTRLSTATUS - snl status\nB - MGNT:CTRLSTATUS - master list status\nC\nD - QUAD:LTUS:500: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,"QUAD:LTUS:500STATSUB\nformat control bo's into slc STAT\n\nInputs:\nA - QUAD:LTUS:500:STATUS\nC - QUAD:LTUS:500:ON\nD - QUAD:LTUS:500:STDZOK\nE - QUAD:LTUS:500:CALBOK\nF - QUAD:LTUS:500:BACTDRIFT (future)\nG -\nH- QUAD:LTUS:500:DACSTATUS\nI -QUAD:LTUS:500:ADCSTATUS\nJ - QUAD:LTUS:500:BACTSTATUS\nK - QUAD:LTUS:500:BDESSTATUS\nL - QUAD:LTUS:500:RIPLSTATUS\n\nOutput:\nP - QUAD:LTUS:500: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, "QUAD:LTUS:500: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, "QUAD:LTUS:500: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, "QUAD:LTUS:500: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, "QUAD:LTUS:500: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.6 #! DBDSTART #! DBD("../../../../dbd/mgntSoft.dbd") #! DBDEND record(stringout, "QUAD:LTUS:500:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:500:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "QUAD:LTUS:500:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "QUAD:LTUS:500:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "QUAD:LTUS:500:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "QUAD:LTUS:500:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "1") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "QUAD:LTUS:500: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, "QUAD:LTUS:500:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "QUAD:LTUS:500:TRIMTYPE.RVAL") field(INPB, "QUAD:LTUS:500:CONFIG.RVAL") field(OUT, "QUAD:LTUS:500:TRIMMAXNUM PP") } record(longout, "QUAD:LTUS:500: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, "QUAD:LTUS:500: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, "") field(OMSL, "supervisory") field(VAL, "20") field(OUT, "QUAD:LTUS:500:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "QUAD:LTUS:500: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, "") field(OMSL, "supervisory") field(VAL, "10") } record(bo, "QUAD:LTUS:500: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, "QUAD:LTUS:500: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, "QUAD:LTUS:500: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, "QUAD:LTUS:500:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "0") } record(ao, "QUAD:LTUS:500: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, "QUAD:LTUS:500:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "QUAD:LTUS:500: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, "QUAD:LTUS:500: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, "QUAD:LTUS:500:IMOVE") field(INPB, "QUAD:LTUS:500:IACT") field(INPC, "QUAD:LTUS:500:IRAMPRATE") field(INPD, "1.577") field(INPE, "QUAD:LTUS:500:TRIMDLYPCT") field(INPF, "QUAD:LTUS:500:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "QUAD:LTUS:500:RAMPTIME_LEFT PP") } record(longout, "QUAD:LTUS:500:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "QUAD:LTUS:500:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "QUAD:LTUS:500:RAMPDONE_CALC") } record(calc, "QUAD:LTUS:500:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "QUAD:LTUS:500:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "QUAD:LTUS:500:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "QUAD:LTUS:500: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, "QUAD:LTUS:500:RAMPTIME_LEFT") field(OUT, "QUAD:LTUS:500:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "QUAD:LTUS:500:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "QUAD:LTUS:500:RAMPTIME_LEFT NMS") field(OUT, "QUAD:LTUS:500:RAMPDONE PP") } record(bo, "QUAD:LTUS:500:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "QUAD:LTUS:500:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "QUAD:LTUS:500: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, "QUAD:LTUS:500: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(sSub, "QUAD:LTUS:500: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, "QUAD:LTUS:500:PSTYPE.RVAL") field(INPC, "QUAD:LTUS:500:TURNEDOFF.RVAL") field(INPD, "QUAD:LTUS:500:CONFIG.RVAL") field(INPE, "QUAD:LTUS:500:PSCATEGORY.RVAL") field(INPF, "QUAD:LTUS:500:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "QUAD:LTUS:500:AUTOCTRL.RVAL") field(INPJ, "QUAD:LTUS:500:OUTOFSERVICE.RVAL") field(INPL, "QUAD:LTUS:500:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "QUAD:LTUS:500:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "QUAD:LTUS:500:PAU") field(INPP, "QUAD:LTUS:500:CALBDISABLE.RVAL") field(INPQ, "QUAD:LTUS:500:PTRBDISABLE.RVAL") field(INPR, "QUAD:LTUS:500:TRIMDISABLE.RVAL") field(INPS, "QUAD:LTUS:500:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "QUAD:LTUS:500:FBCK") field(INPU, "QUAD:LTUS:500:TRIMTYPE.RVAL") field(INPV, "QUAD:LTUS:500:STDZDIRECT.RVAL") field(INPW, "QUAD:LTUS:500:DEGAUSENABLE.RVAL") field(FLNK, "QUAD:LTUS:500:HSTA") } record(longin, "QUAD:LTUS:500:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "QUAD:LTUS:500:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "QUAD:LTUS:500: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, "QUAD:LTUS:500: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, "QUAD:LTUS:500:CALBDISABLE") { field(DESC, "DAC Calb Disabled") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:500:PTRBDISABLE") { field(DESC, "Perturb Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:500:TRIMDISABLE") { field(DESC, "Trim Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:500:STDZDISABLE") { field(DTYP, "Raw Soft Channel") field(ZNAM, "NO") field(ONAM, "YES") field(DESC, "Standardize Function") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } # This PV has been replaced by QUAD:LTUS:500:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses QUAD:LTUS:500:FBCK. # This PV should be replaced by QUAD:LTUS:500: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, "QUAD:LTUS:500: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, "QUAD:LTUS:500: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, "QUAD:LTUS:500: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, "") field(OMSL, "supervisory") field(FLNK, "QUAD:LTUS:500:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"QUAD:LTUS:500:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "QUAD:LTUS:500:OUTOFSERVICE NPP NMS") field(OUT, "QUAD:LTUS:500:ONLINE PP") } record(bo, "QUAD:LTUS:500:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "QUAD:LTUS:500: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, "1") } record(bo, "QUAD:LTUS:500: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, "1") } record(bo, "QUAD:LTUS:500: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, "QUAD:LTUS:500: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, "QUAD:LTUS:500: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, "QUAD:LTUS:500: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, "QUAD:LTUS:500: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, "QUAD:LTUS:500: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, "1") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:500: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, "1") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:500: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, "2") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:500: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, "0") field(ASG, "NOWRITE") field(FLNK, "QUAD:LTUS:500:TRIMTYPE") } record(stringout, "QUAD:LTUS:500:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "QUAD:LTUS:500:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "QUAD:LTUS:500:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "QUAD:LTUS:500:STATE.RVAL") field(INPB, "QUAD:LTUS:500:INTLKSUMY.RVAL") field(OUT, "QUAD:LTUS:500:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:LTUS:500: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, "QUAD:LTUS:500:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "QUAD:LTUS:500:STATE.RVAL") field(INPB, "QUAD:LTUS:500:INTLKSUMY.RVAL") field(OUT, "QUAD:LTUS:500:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:LTUS:500:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "QUAD:LTUS:500:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "QUAD:LTUS:500: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, "QUAD:LTUS:500:RAMPSTARTDLY") { field(DESC, "Tansition to ramp delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "2") } ######### For PSTYPE=2 Only ############# record(mbbo, "QUAD:LTUS:500: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, "QUAD:LTUS:500: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,"QUAD:LTUS:500: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("QUAD:LTUS:500:TURNEDOFF",3140,1907,0,1,"QUAD:LTUS:500:TURNEDOFF") #! 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, "QUAD:LTUS:510:IACT") { field(DESC, "Current") field(INP, "PSC:LTUS:MG10:IACT") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "QUAD:LTUS:510:BACT") info(autosaveFields,"HYST") } record(bi, "QUAD:LTUS:510:STATE") { field(DESC, "PS On/Off Status") field(DTYP, "Raw Soft Channel") field(INP, "PSC:LTUS:MG10:STATE NPP MS") field(ZSV, "MAJOR") field(ZNAM, "OFF") field(ONAM, "ON") } record(ao, "QUAD:LTUS:510:IDES") { field(DESC, "Desired Current") field(PREC, "3") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(MDEL, "-1") field(HIHI, "200.0") field(LOLO, "0.0") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "QUAD:LTUS:510:BDELTAS") field(DRVH, "200.0") field(DRVL, "0.0") field(DOL, "QUAD:LTUS:510: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, "QUAD:LTUS:510:ICTRL PP") } # This record is processed by QUAD:LTUS:510:ICON") # Note: we are not setting alarms here. record(ao, "QUAD:LTUS:510:ICON") { field(DESC, "Config I") field(DTYP, "Soft Channel") field(PREC, "3") field(HOPR, "200.0") field(LOPR, "0.0") field(DRVH, "200.0") field(DRVL, "0.0") field(DOL, "QUAD:LTUS:510:B2ICON.K") field(OMSL, "closed_loop") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:510:INOM") { field(DESC, "Nominal Current") field(DOL, "QUAD:LTUS:510:BNOM.K") field(OMSL, "closed_loop") field(PREC, "3") field(EGU, "A") field(DRVH, "200.0") field(DRVL, "0.0") field(HOPR, "200.0") field(LOPR, "0.0") } record(ao, "QUAD:LTUS:510:ICTRL") { field(DESC, "Set Current") field(PREC, "3") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(DRVH, "200.0") field(DRVL, "0.0") field(MDEL, "-1") field(FLNK, "QUAD:LTUS:510:ICTRLGO") field(OMSL, "supervisory") info(autosavefields,"VAL") } record(seq, "QUAD:LTUS:510:ICTRLGO") { field(DESC, "Process Current Setpoint") field(PREC, "3") # Set ISETPT to supervisory field(DOL1, "0") field(LNK1, "QUAD:LTUS:510:ISETPT.OMSL") field(DOL2, "QUAD:LTUS:510:ICTRL") field(LNK2, "QUAD:LTUS:510:ISETPT PP") # Set ISETPT to closed loop - get data from BCTRLSUB.K field(DOL3, "1") field(LNK3, "QUAD:LTUS:510:ISETPT.OMSL") } record(ao, "QUAD:LTUS:510:IMAX") { field(DESC, "Max I") field(DTYP, "Soft Channel") field(DRVH, "200.0") field(DRVL, "0.0") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(PREC, "3") field(PINI, "YES") field(VAL, "200.0") field(FLNK, "QUAD:LTUS:510:IMIN") } record(ao, "QUAD:LTUS:510:IMIN") { field(DESC, "Min I") field(DTYP, "Soft Channel") field(DRVH, "200.0") field(DRVL, "0.0") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(PREC, "3") field(VAL, "0.0") field(FLNK, "QUAD:LTUS:510:IRANGE") } record(sel, "QUAD:LTUS:510:IACTPREVOK") { field(DESC, "Last Good Current") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(PREC, "3") field(NVL, "QUAD:LTUS:510:BACT.SEVR") field(INPA, "QUAD:LTUS:510:IACT NPP MS") field(INPB, "QUAD:LTUS:510:IACTPREVOK NPP MS") field(INPC, "QUAD:LTUS:510:IACTPREVOK NPP MS") field(INPD, "QUAD:LTUS:510:IACTPREVOK NPP MS") } record(sub, "QUAD:LTUS:510:IACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:510:IDES") field(INPB, "QUAD:LTUS:510:ISETPT.DRVH") field(INPC, "QUAD:LTUS:510:ISETPT.DRVL") field(INPD, "QUAD:LTUS:510:IDELTAS.I") field(INPE, "QUAD:LTUS:510:IDELTAS.J") field(INPG, "QUAD:LTUS:510:STATE") field(INPH, "QUAD:LTUS:510:HSTA") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(sub, "QUAD:LTUS:510:IMONLIMITS") { field(DESC, "Aux Current Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:510:IDES") field(INPB, "QUAD:LTUS:510:ISETPT.DRVH") field(INPC, "QUAD:LTUS:510:ISETPT.DRVL") field(INPD, "QUAD:LTUS:510:IDELTAS.K") field(INPE, "QUAD:LTUS:510:IDELTAS.L") field(INPG, "QUAD:LTUS:510:STATE") field(INPH, "QUAD:LTUS:510:HSTA") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(seq, "QUAD:LTUS:510:ILIMITS") { field(DESC, "Set ACT and MON Limits") field(PREC, "3") field(DOL1, "QUAD:LTUS:510:BLIMITS") field(LNK1, "QUAD:LTUS:510:IACTLIMITS.F PP") field(DOL2, "QUAD:LTUS:510:IACTLIMITS.I") field(LNK2, "QUAD:LTUS:510:IACT.HIGH") field(DOL3, "QUAD:LTUS:510:IACTLIMITS.J") field(LNK3, "QUAD:LTUS:510:IACT.LOW") field(DOL4, "QUAD:LTUS:510:IACTLIMITS.K") field(LNK4, "QUAD:LTUS:510:IACT.HIHI") field(DOL5, "QUAD:LTUS:510:IACTLIMITS.L") field(LNK5, "QUAD:LTUS:510:IACT.LOLO") field(DOL6, "QUAD:LTUS:510:BLIMITS") field(LNK6, "QUAD:LTUS:510:IMONLIMITS.F PP") field(DOL7, "QUAD:LTUS:510:IMONLIMITS.I") field(LNK7, "QUAD:LTUS:510:IMON.HIGH") field(DOL8, "QUAD:LTUS:510:IMONLIMITS.J") field(LNK8, "QUAD:LTUS:510:IMON.LOW") field(DOL9, "QUAD:LTUS:510:IMONLIMITS.K") field(LNK9, "QUAD:LTUS:510:IMON.HIHI") field(DOLA, "QUAD:LTUS:510:IMONLIMITS.L") field(LNKA, "QUAD:LTUS:510: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, "QUAD:LTUS:510:IDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntRawDeltas") field(INPD, "QUAD:LTUS:510:TRIMBTOL") field(INPE, "QUAD:LTUS:510:CHCKBTOL") field(INPF, "QUAD:LTUS:510:BDELTAS.K") field(INPG, "QUAD:LTUS:510:BDELTAS.L") field(INPH, "QUAD:LTUS:510: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, "QUAD:LTUS:510:STDZITOLR") field(INPC, "QUAD:LTUS:510:STDZITOL") field(FLNK, "") } # All ps controllers with on/off control will set the macro ONOF # as follows: # # ONOF = PSC:LTUS:MG10: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, "QUAD:LTUS:510:STATESETPT") { field(DESC, "PS On/Off") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFF") field(ONAM, "ON") field(OUT, "PSC:LTUS:MG10:STATESETPT PP") 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 = PSC:LTUS:MG10:RESET PP # record(bo, "QUAD:LTUS:510:RESET") { field(DESC, "Interlock Latch Reset") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFF") field(ONAM, "ON") field(HIGH, "1.0") field(OUT, "PSC:LTUS:MG10:RESET PP") } record(bo, "QUAD:LTUS:510:RAMPSTATE") { field(DESC, "PS Ramp Status") field(DTYP, "Soft Channel") field(DOL, "PSC:LTUS:MG10:RAMPSTATE NPP 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, "QUAD:LTUS:510: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, "QUAD:LTUS:510:TRIMRAMPRATE") field(OUT, "PSC:LTUS:MG10:IRAMPRATE PP") field(FLNK, "QUAD:LTUS:510:STDZDLY") } record(ao, "QUAD:LTUS:510:ISETPT") { field(DESC, "Current Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(DRVH, "200.0") field(DRVL, "0.0") field(MDEL, "-1") field(OUT, "PSC:LTUS:MG10:ISETPT PP") field(DOL, "QUAD:LTUS:510: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, "QUAD:LTUS:510:IMON") { field(DESC, "Aux Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(INP, "PSC:LTUS:MG10:IMON") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "QUAD:LTUS:510:BMON") } record(ao, "QUAD:LTUS:510:IRIPL") { field(DESC, "Ripple Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(DOL, "PSC:LTUS:MG10:IRIPL NPP NMS") field(OMSL, "closed_loop") field(EGU, "A") field(DRVH, "1.0") field(HOPR, "1.0") field(PREC, "3") field(FLNK, "QUAD:LTUS:510:IRIPLOK") } record(sub, "QUAD:LTUS:510:IRIPLOK") { field(DESC, "Ripple Current Status") field(INAM, "mgntInit") field(SNAM, "mgntRiplOK") field(INPA, "QUAD:LTUS:510:IRIPL.VAL") field(INPB, "QUAD:LTUS:510: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, "QUAD:LTUS:510:R") { field(DESC, "Resistance") field(EGU, "Ohms") field(PREC, "4") field(PINI, "YES") field(DOL, "PSC:LTUS:MG10:R NPP MS") 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, "QUAD:LTUS:510:IGND") { field(DESC, "Ground Current") field(EGU, "A") field(PREC, "6") field(PINI, "YES") field(DOL, "PSC:LTUS:MG10:IGND NPP MS") field(OMSL, "closed_loop") } record(bi, "QUAD:LTUS:510:INTLKSUMY") { field(DESC, "Interlock Summary") field(INP, "PSC:LTUS:MG10:INTLKSUMY NPP MS") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(ZNAM, "OK") field(ONAM, "FAULT") field(PINI, "NO") } record(mbbo, "QUAD:LTUS:510: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, "PSC:LTUS:MG10:COOLING") field(OMSL, "closed_loop") } # The following PV is processed by :BACTFO # which is processed by :BACT record(fanout, "QUAD:LTUS:510:IACTFO") { field(DESC, "IACT processing") field(SELM, "All") field(LNK1, "QUAD:LTUS:510:IACTPREVOK") field(LNK2, "QUAD:LTUS:510:IDIFF") field(LNK3, "QUAD:LTUS:510:IADIFF") field(LNK4, "QUAD:LTUS:510:IRATIO") field(LNK5, "QUAD:LTUS:510:IDIRECT") field(LNK6, "QUAD:LTUS:510:IACTPOL_CHECK") } record(calc, "QUAD:LTUS:510:IDIFF") { field(DESC, "IDES-IACT") field(CALC, "A-B") field(INPA, "QUAD:LTUS:510:IDES") field(INPB, "QUAD:LTUS:510:IACT") field(EGU, "A") field(PREC, "9") field(HOPR, "200.0") field(LOPR, "0.0") } record(calc, "QUAD:LTUS:510:IADIFF") { field(DESC, "Absolute IDES-IACT") field(CALC, "A<0?ABS(A):A") field(INPA, "QUAD:LTUS:510:IDIFF") field(PREC, "9") } record(calc, "QUAD:LTUS:510:IRATIO") { field(DESC, "IDES-IACT/IMAX") field(CALC, "B?A/B:0") field(INPA, "QUAD:LTUS:510:IDIFF") field(INPB, "QUAD:LTUS:510:IDES.DRVH") field(PREC, "9") } record(calcout, "QUAD:LTUS:510:IRANGE") { field(DESC, "Current Range") field(PINI, "YES") field(CALC, "ABS(A-B)") field(INPA, "QUAD:LTUS:510:IMIN") field(INPB, "QUAD:LTUS:510: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, "QUAD:LTUS:510: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, "QUAD:LTUS:510:IACT") field(FLNK, "QUAD:LTUS:510:IACTPOL") } record(bo, "QUAD:LTUS:510:IACTPOL") { field(DESC, "Actual I Polarity") field(DTYP, "Raw Soft Channel") field(DOL, "QUAD:LTUS:510: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,"QUAD:LTUS:510:I*LIMITS:\n Calculate alarm and warning limits based on \n deltas from QUAD:LTUS:510:IDELTAS and the\n QUAD:LTUS:510: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,"QUAD:LTUS:510:IACT: \n Get copy of QUAD:LTUS:510:I. \n",null) #! TextBox(TB12,1280,3100,1760,3200,0,"Dialog",12,1,16777215,"QUAD:LTUS:510: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,"QUAD:LTUS:510:IDES:\n Contains raw value calculated by \nQUAD:LTUS:510: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 \nQUAD:LTUS:510:BDELTAS.\n",null) #! TextBox(TB10,56,1940,316,2340,0,"Dialog",12,1,16777215,"QUAD:LTUS:510: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 QUAD:LTUS:510: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 QUAD:LTUS:510: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,"QUAD:LTUS:510:ISETPT:\n Sets the hardware. When fast feedback is set on, this record is\n set to closed loop mode by QUAD:LTUS:510:FBCKSTART sequence. When \n the loop is closed, this record takes input calculated by \n BFBCK only. When fast feedback is set off, QUAD:LTUS:510:FBCKSTOP \n will set it back to supervisory so that the value can be set by \n QUAD:LTUS:510: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, "QUAD:LTUS:510:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:510:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "QUAD:LTUS:510:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "QUAD:LTUS:510:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "QUAD:LTUS:510:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "QUAD:LTUS:510:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "1") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "QUAD:LTUS:510: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, "QUAD:LTUS:510:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "QUAD:LTUS:510:TRIMTYPE.RVAL") field(INPB, "QUAD:LTUS:510:CONFIG.RVAL") field(OUT, "QUAD:LTUS:510:TRIMMAXNUM PP") } record(longout, "QUAD:LTUS:510: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, "QUAD:LTUS:510: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, "") field(OMSL, "supervisory") field(VAL, "10") field(OUT, "QUAD:LTUS:510:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "QUAD:LTUS:510: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, "") field(OMSL, "supervisory") field(VAL, "10") } record(bo, "QUAD:LTUS:510: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, "QUAD:LTUS:510: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, "QUAD:LTUS:510: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, "QUAD:LTUS:510:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "0") } record(ao, "QUAD:LTUS:510: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, "QUAD:LTUS:510:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "QUAD:LTUS:510: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, "QUAD:LTUS:510: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, "QUAD:LTUS:510:IMOVE") field(INPB, "QUAD:LTUS:510:IACT") field(INPC, "QUAD:LTUS:510:IRAMPRATE") field(INPD, "1.577") field(INPE, "QUAD:LTUS:510:TRIMDLYPCT") field(INPF, "QUAD:LTUS:510:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "QUAD:LTUS:510:RAMPTIME_LEFT PP") } record(longout, "QUAD:LTUS:510:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "QUAD:LTUS:510:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "QUAD:LTUS:510:RAMPDONE_CALC") } record(calc, "QUAD:LTUS:510:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "QUAD:LTUS:510:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "QUAD:LTUS:510:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "QUAD:LTUS:510: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, "QUAD:LTUS:510:RAMPTIME_LEFT") field(OUT, "QUAD:LTUS:510:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "QUAD:LTUS:510:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "QUAD:LTUS:510:RAMPTIME_LEFT NMS") field(OUT, "QUAD:LTUS:510:RAMPDONE PP") } record(bo, "QUAD:LTUS:510:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "QUAD:LTUS:510:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "QUAD:LTUS:510: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, "QUAD:LTUS:510: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, "QUAD:LTUS:510:STDZINIT") { field(DESC, "Proc. Stdz PVs on boot") field(PINI, "YES") field(DOL1, "1") field(DOL2, "1") field(DOL3, "1") field(LNK1, "QUAD:LTUS:510:DEBUG.PROC PP") field(LNK2, "QUAD:LTUS:510:STDZCYCLENUM.PROC PP") field(LNK3, "QUAD:LTUS:510:STDZDISABLE.PROC PP") field(LNK4, "QUAD:LTUS:510: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, "QUAD:LTUS:510:STDZSUB") { field(DESC, "Stdz subroutine") field(INAM, "mgntStdzInit") field(SNAM, "mgntStdz") field(BRSV, "INVALID") field(INPA, "QUAD:LTUS:510:STDZIMIN NPP NMS") field(INPB, "QUAD:LTUS:510:STDZIMAX NPP NMS") field(INPC, "QUAD:LTUS:510:STDZIFINAL NPP NMS") field(INPD, "QUAD:LTUS:510:STDZCYCLENUM NPP NMS") field(INPE, "QUAD:LTUS:510:STDZDIRECT.RVAL NPP NMS") field(INPF, "QUAD:LTUS:510:STDZDISABLE.RVAL CPP NMS") field(INPG, "QUAD:LTUS:510: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, "QUAD:LTUS:510:STDZWF PP") field(OUTB, "QUAD:LTUS:510: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, "QUAD:LTUS:510:STDZWF") } record(mbbo, "QUAD:LTUS:510: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, "QUAD:LTUS:510: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, "QUAD:LTUS:510:STDZMAINPS") { field(DESC, "Stdz by main or self") field(PINI, "YES") field(DTYP, "Soft Channel") field(ZNAM, "SELF") field(ONAM, "MAIN") } record(bo, "QUAD:LTUS:510: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, "QUAD:LTUS:510: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, "QUAD:LTUS:510: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, "QUAD:LTUS:510:STDZTOD") { field(DESC, "Successful Standardize Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "QUAD:LTUS:510:STDZLOSTTOD") { field(DESC, "Standardize Lost Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(longout, "QUAD:LTUS:510:STDZCYCLECNT") { field(DESC, "Cycle Count") field(PINI, "YES") } record(longout, "QUAD:LTUS:510:STDZCYCLENUM") { field(DESC, "No. Standardize Cycles") field(VAL, "3") field(HOPR, "10") field(LOPR, "0") field(DRVH, "10") field(DRVL, "0") field(PINI, "YES") field(FLNK, "QUAD:LTUS:510:STDZDIRECT") } # The default standardize direction is "UP" for # all LCLS Magnets.. record(bo, "QUAD:LTUS:510:STDZDIRECT") { field(DESC, "Standardize Direction ") field(ZNAM, "UP") field(ONAM, "DOWN") field(VAL, "0") field(FLNK, "QUAD:LTUS:510:STDZIMIN") } record(ao, "QUAD:LTUS:510:STDZIMIN") { field(DESC, "Min-STDZ Current") field(PREC, "1") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(VAL, "0.0") field(FLNK, "QUAD:LTUS:510:STDZIMAX") } record(ao, "QUAD:LTUS:510:STDZIMAX") { field(DESC, "Max. Standarize Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(VAL, "200.0") field(FLNK, "QUAD:LTUS:510:STDZIFINAL") } record(ao, "QUAD:LTUS:510:STDZIFINAL") { field(DESC, "Final SDTZ Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(VAL, "0.0") field(FLNK, "QUAD:LTUS:510: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, "QUAD:LTUS:510: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, "QUAD:LTUS:510:STDZITOL") { field(DESC, "Stdz min tolerance") field(PREC, "5") field(CALC, "MAX(ABS(A),ABS(B))*C") field(INPA, "QUAD:LTUS:510:STDZIMIN CP NMS") field(INPB, "QUAD:LTUS:510:STDZIMAX CP MMS") field(INPC, "0.05") field(INPD, "QUAD:LTUS:510:STDZITOLR CP MMS") field(EGU, "A") field(FLNK, "QUAD:LTUS:510:IDELTAS") field(PINI, "YES") } # D - factor (3.154/2 = 1.577) for EPSC, otherwise, set to 1.0 record(calc, "QUAD:LTUS:510:STDZDLY") { field(DESC, "Ramp time for stdz cycle") field(CALC, "C>0?MAX(1,ABS((A-B)/C)*D):0") field(INPA, "QUAD:LTUS:510:STDZIMIN CP NMS") field(INPB, "QUAD:LTUS:510:STDZIMAX CP NMS") field(INPC, "QUAD:LTUS:510:TRIMRAMPRATE CP NMS") field(INPD, "1.577") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") } record(calc, "QUAD:LTUS:510:STDZRAMPDLY") { field(DESC, "Ramp delay total") field(CALC, "MAX(1,((A/100)*B+B))") field(PREC, "5") field(INPA, "QUAD:LTUS:510:TRIMDLYPCT CP MS") field(INPB, "QUAD:LTUS:510: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, "QUAD:LTUS:510:STDZMINIDLY") { field(DESC, "Mini-stdz delay") field(CALC, "A") field(PREC, "5") field(A, "1.0") field(EGU, "sec") field(PINI, "YES") } record(ao, "QUAD:LTUS:510: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, "QUAD:LTUS:510:STDZMINIDELTA") { field(DESC, "Stdz mini % of IMAX") field(CALC, "(B/100)*(A-C)") field(INPA, "QUAD:LTUS:510:IDES.HOPR") field(INPB, "QUAD:LTUS:510:STDZMINIPCT CPP NMS") field(INPC, "QUAD:LTUS:510:IDES.LOPR") field(PREC, "5") } record(calc, "QUAD:LTUS:510:STDZMINISETPT") { field(DESC, "Mini Stdz delta") field(CALC, "C==0?MAX(E-D,B):MIN(E+D,A)") field(INPA, "QUAD:LTUS:510:IDES.HOPR") field(INPB, "QUAD:LTUS:510:IDES.LOPR") field(INPC, "QUAD:LTUS:510:STDZDIRECT.RVAL") field(INPD, "QUAD:LTUS:510:STDZMINIDELTA") field(INPE, "QUAD:LTUS:510:IDES") field(PREC, "5") field(FLNK, "QUAD:LTUS:510: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, "QUAD:LTUS:510:STDZMINISETPTOOR") { field(DESC, "Mini Stdz setpoint out of range") field(CALC, "C==0?(E-DA)") field(INPA, "QUAD:LTUS:510:IDES.HOPR") field(INPB, "QUAD:LTUS:510:IDES.LOPR") field(INPC, "QUAD:LTUS:510:STDZDIRECT.RVAL") field(INPD, "QUAD:LTUS:510:STDZMINIDELTA") field(INPE, "QUAD:LTUS:510: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, "QUAD:LTUS:510: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, "QUAD:LTUS:510:IADJUST.RVAL") field(INPB, "QUAD:LTUS:510:STDZDIRECT.RVAL") field(INPC, "QUAD:LTUS:510:STDZOK.RVAL") field(INPD, "QUAD:LTUS:510:STDZDISABLE.RVAL") field(INPE, "QUAD:LTUS:510:STATE.RVAL CPP NMS") field(INPF, "QUAD:LTUS:510:ICTRL.RVAL") field(INPG, "QUAD:LTUS:510:STATE.SEVR") field(INPH, "QUAD:LTUS:510:BDELTAS.M") field(INPI, "QUAD:LTUS:510:IACT.SEVR") field(OUT, "QUAD:LTUS:510:STDZLOSTGO.SELN PP NMS") field(OOPT, "Transition To Non-zero") } record(seq, "QUAD:LTUS:510:STDZLOSTGO") { field(DESC, "Process lost stdz") field(SELM, "Mask") field(DOL1, "1") field(DOL2, "0") field(LNK1, "QUAD:LTUS:510:STDZLOSTTOD.PROC") field(LNK2, "QUAD:LTUS:510:STDZOK PP") } # Record maximum current after standardize # Reset to IACT from sequence after trim # Disable processing during (mini-)standardize or trim record(calc, "QUAD:LTUS:510:STDZIACTMAX") { field(DESC, "Max act current after stdz") field(CALC, "MAX(A, B)") field(DISV, "0") field(SDIS, "QUAD:LTUS:510:CHECKPWRDIP_ENABLE") field(INPA, "QUAD:LTUS:510:IACT CP") field(INPB, "QUAD:LTUS:510:STDZIACTMAX") field(EGU, "A") field(FLNK, "QUAD:LTUS:510:CHECKPWRDIP") } # Detect power dip if STDZOK is YES, STDZ is enabled, and IACT is valid # If IACT drops below STDZIACTMAX by more than the trim tolerance, clear STDZOK # Warning: Take the absolute value of the trim tolerance, or else quads of # negative polarity will always lose STDZ since their IDELTAS.I are negative. # Note: Large quads and bends are prone to losing STDZ even if they are # perturbed toward higher current since their current tends to overshoot # by greater than the trim tolerance before settling down. record(calcout, "QUAD:LTUS:510:CHECKPWRDIP") { field(DESC, "Detect power dip") field(CALC, "(A-B>ABS(C))?3:0") field(DISV, "0") field(SDIS, "QUAD:LTUS:510:CHECKPWRDIP_ENABLE") field(INPA, "QUAD:LTUS:510:STDZIACTMAX") field(INPB, "QUAD:LTUS:510:IACT") field(INPC, "QUAD:LTUS:510:IDELTAS.I") field(OUT, "QUAD:LTUS:510:STDZLOSTGO.SELN PP NMS") field(OOPT, "When Non-zero") } # Enable processing of STDZIACTMAX and CHECKPWRDIP only if # STDZOK = YES, STDZDISABLE = NO, CTRL != Trim (2), and # CTRL != Stdz (4) record(calc, "QUAD:LTUS:510:CHECKPWRDIP_ENABLE") { field(CALC, "A&&!B&&(C#2)&&(C#4)") field(INPA, "QUAD:LTUS:510:STDZOK.RVAL CP") field(INPB, "QUAD:LTUS:510:STDZDISABLE.RVAL CP") field(INPC, "QUAD:LTUS:510:CTRL.RVAL CP") } #! 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, "QUAD:LTUS:510: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, "QUAD:LTUS:510:CALBOK") { field(DESC, "Successful Calibration") field(DTYP, "Raw Soft Channel") field(ZNAM, "NO") field(ONAM, "YES") field(DOL, "PSC:LTUS:MG10:CALBOK.RVAL") field(OMSL, "closed_loop") 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, "QUAD:LTUS:510:CALBSET") { field(DESC, "Use DAC Calbration") field(SCAN, "10 second") field(CALC, "A&&(B==0)&&C?31:960") field(INPA, "QUAD:LTUS:510:CALBOK") field(INPB, "QUAD:LTUS:510:CALBDISABLE") field(INPC, "QUAD:LTUS:510:CALBSLOPE") field(OOPT, "On Change") field(OUT, "QUAD:LTUS:510: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, "QUAD:LTUS:510:CALB_SEQ") { field(DESC, "Output Calib Values") field(SELM, "Mask") field(SELL, "QUAD:LTUS:510: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, "QUAD:LTUS:510:CALBSLOPE") field(DOL3, "QUAD:LTUS:510: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, "QUAD:LTUS:510:CALBTOD") { field(DESC, "Calibration Success Time") field(PINI, "YES") field(DOL, "PSC:LTUS:MG10:CALBTOD") field(OMSL, "closed_loop") field(DTYP, "Soft Channel") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:510: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, "QUAD:LTUS:510: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, "QUAD:LTUS:510: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, "QUAD:LTUS:510:CALBOFFSET") { field(DESC, "Calc DAC Offset") field(PREC, "6") field(EGU, "Counts") field(PINI, "YES") } record(bo, "QUAD:LTUS:510: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, "QUAD:LTUS:510:DACSLOPE") { field(DESC, "V to DAC slope") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "closed_loop") field(PINI, "YES") field(FLNK, "QUAD:LTUS:510:DACOFFSET") } # Default Offset used in conversion from Volts to DAC Counts record(ao, "QUAD:LTUS:510:DACOFFSET") { field(DESC, "V to DAC offset") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "closed_loop") field(PINI, "YES") field(FLNK, "QUAD:LTUS:510: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, "QUAD:LTUS:510: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, "QUAD:LTUS:510:IACT") field(INPD, "QUAD:LTUS:510:DACSLOPE") field(INPE, "QUAD:LTUS:510:DACOFFSET") field(EGU, "Counts") field(PREC, "6") } record(ao, "QUAD:LTUS:510:DAC") { field(DESC, "DAC Set point") field(EGU, "Counts") field(DOL, "") field(OMSL, "closed_loop") field(PREC, "6") field(PINI, "YES") } record(ao, "QUAD:LTUS:510:CALBIMIN") { field(DESC, "Calibration Min Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(DRVH, "200.0") field(HOPR, "200.0") field(DRVL, "0.0") field(LOPR, "0.0") field(PREC, "3") field(EGU, "A") field(VAL, "0.0") field(FLNK, "QUAD:LTUS:510:CALBIMAX") } record(ao, "QUAD:LTUS:510:CALBIMAX") { field(DESC, "Calibration Max Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(DRVH, "200.0") field(HOPR, "200.0") field(LOPR, "0.0") field(DRVL, "0.0") field(EGU, "A") field(VAL, "200.0") field(FLNK, "QUAD:LTUS:510:CALBSTEPNUM") } record(ao, "QUAD:LTUS:510:CALBIFINAL") { field(DESC, "Calibration Last Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(PREC, "3") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(VAL, "0") } record(longout, "QUAD:LTUS:510: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, "QUAD:LTUS:510:CALBIDELTA") } record(calc, "QUAD:LTUS:510:CALBIDELTA") { field(DESC, "Step size for CALB") field(CALC, "C=0?0:ABS((A-B)/C)") field(INPA, "QUAD:LTUS:510:CALBIMAX") field(INPB, "QUAD:LTUS:510:CALBIMIN") field(INPC, "QUAD:LTUS:510: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, "QUAD:LTUS:510:CALBIMULT") { field(DESC, "IACT vs ISETPT mult") field(CALC, "C#0||A=0?1:ABS(B/A)") field(INPA, "PSC:LTUS:MG10:ISETPT.DRVH") field(INPB, "PSC:LTUS:MG10:IACT.HOPR") field(INPC, "QUAD:LTUS:510:PSCONTROLLER.RVAL CPP") field(EGU, "A") field(PINI, "YES") } # SNL dbputs DAC values here. 6-10 steps are possible. record(waveform, "QUAD:LTUS:510:CALBICTRLWF") { field(DESC, "ICTRL setpoint array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") } record(waveform, "QUAD:LTUS:510:DACWF") { field(DESC, "DAC count array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:510:DACSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:510:DACSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "QUAD:LTUS:510: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, "QUAD:LTUS:510:CALCDACWF") { field(DESC, "Calc DAC counts array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:510:CALCDACSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:510:CALCDACSA") { field(DESC, "Calc DAC counts") field(DTYP, "Soft Channel") field(INP, "QUAD:LTUS:510: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, "QUAD:LTUS:510:CALBYWF") { field(DESC, "mx + b") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:510:CALBYSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:510:CALBYSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "QUAD:LTUS:510:CALBYWF") field(MALM, "10") field(NELM, "6") field(INDX, "0") field(FTVL, "DOUBLE") } record(waveform, "QUAD:LTUS:510:CALBIACTWF") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:510:CALBIACTSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:510:CALBIACTSA") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(MALM, "10") field(NELM, "6") field(INP, "QUAD:LTUS:510:CALBIACTWF") field(INDX, "0") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:510:CALBLIMITS") } # Check that measured current during calibration is within # tolerance. record(aSub, "QUAD:LTUS:510: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, "QUAD:LTUS:510:CALBSTEPNUM") field(INPB, "QUAD:LTUS:510:CALBIACTWF") field(INPC, "QUAD:LTUS:510: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, "QUAD:LTUS:510: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, "QUAD:LTUS:510:STDZITOL") field(INPH, "QUAD:LTUS:510:DACSLOPE") field(INPI, "QUAD:LTUS:510: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, "QUAD:LTUS:510: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, "QUAD:LTUS:510:CALBSTEPNUM") field(INPB, "QUAD:LTUS:510:CALBIACTWF") field(INPC, "QUAD:LTUS:510:DACWF") field(INPF, "QUAD:LTUS:510: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 QUAD:LTUS:510CALBOK 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, "QUAD:LTUS:510:DEGAUSINIT") { field(DESC, "Proc. Degauss PVs on boot") field(PINI, "YES") field(DOL, "1") field(OUTA, "QUAD:LTUS:510:DEGAUSIMIN.PROC PP") field(OUTB, "QUAD:LTUS:510:DEGAUSIMAX.PROC PP") field(OUTC, "QUAD:LTUS:510:DEGAUSTYPE.PROC PP") field(OUTD, "QUAD:LTUS:510:DEGAUSSTEP.PROC PP") field(OUTE, "QUAD:LTUS:510:MADNAME.PROC PP") field(OUTF, "QUAD:LTUS:510:PSTYPE.PROC PP") field(OUTG, "QUAD:LTUS:510: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, "QUAD:LTUS:510:DEGAUSSUB") { field(DESC, "Degauss subroutine") field(INAM, "mgntDegaussInit") field(SNAM, "mgntDegauss") field(BRSV, "INVALID") field(INPA, "QUAD:LTUS:510:DEGAUSIMIN NPP NMS") field(INPB, "QUAD:LTUS:510:DEGAUSIMAX NPP NMS") field(INPC, "QUAD:LTUS:510:DEGAUSTYPE.RVAL NPP NMS") field(INPE, "QUAD:LTUS:510:DEGAUSMETHOD.RVAL NPP NMS") field(INPF, "QUAD:LTUS:510:PSTYPE NPP NMS") field(INPG, "QUAD:LTUS:510:DEBUG.RVAL NPP NMS") field(INPH, "QUAD:LTUS:510: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, "QUAD:LTUS:510:DEGAUSWF PP") field(OUTB, "QUAD:LTUS:510:DEGAUSMSG PP") field(OUTC, "QUAD:LTUS:510: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, "QUAD:LTUS:510:DEGAUSWF") { field(DESC, "Degauss Setpts") field(NELM, "60") field(FTVL, "DOUBLE") } record(mbbo,"QUAD:LTUS:510: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, "QUAD:LTUS:510: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, "QUAD:LTUS:510: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, "QUAD:LTUS:510: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, "QUAD:LTUS:510: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, "QUAD:LTUS:510:DEGAUSIMIN") { field(DESC, "Min. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "200.0") field(LOPR, "-200.0") field(DRVH, "200.0") field(DRVL, "-200.0") field(VAL, "-200.0") } record(ao, "QUAD:LTUS:510:DEGAUSIMAX") { field(DESC, "Max. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "200.0") field(LOPR, "-200.0") field(DRVH, "200.0") field(DRVL, "-200.0") field(VAL, "200.0") } # 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,"QUAD:LTUS:510: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, "QUAD:LTUS:510: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,"QUAD:LTUS:510: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, "QUAD:LTUS:510: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, "QUAD:LTUS:510: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, "QUAD:LTUS:510: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, "QUAD:LTUS:510:DEGAUSTOD") { field(DESC, "Successful Degauss Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "QUAD:LTUS:510:DEGAUSLOSTTOD") { field(DESC, "Degauss Lost Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:510:DEGAUSTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "QUAD:LTUS:510:DEGAUSTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "QUAD:LTUS:510: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, "QUAD:LTUS:510:DEGAUSGO") { field(DESC, "Set bdes of btrms to zero") field(ASG, "Internal") field(OUTA, "") field(OUTB, "") field(OUTC, "") field(OUTD, "") } # =========== CRYO ONLY =========== record(bo, "QUAD:LTUS:510: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, "QUAD:LTUS:510:DEGAUS_IMAX_CHECK") { field(DESC, "Check if imax shoud chg") field(CALC, "(C==4)&&(ABS(B)>ABS(A))?1:0") field(INPA, "QUAD:LTUS:510:DEGAUS_IMAX") field(INPB, "QUAD:LTUS:510:ISETPT") field(INPC, "QUAD:LTUS:510:DEGAUSTYPE.RVAL") field(OUT, "QUAD:LTUS:510:DEGAUS_IMAX_UPDATE.SELN") field(FLNK, "QUAD:LTUS:510:DEGAUS_IMAX_UPDATE") } record(seq, "QUAD:LTUS:510:DEGAUS_IMAX_UPDATE") { field(DESC, "Degauss IMAX Update") field(SELM, "Specified") field(DOL1, "QUAD:LTUS:510:ISETPT") field(LNK1, "QUAD:LTUS:510:DEGAUS_IMAX PP") } # Set the maximum current after a successful # degauss. This pv is updated by the # sequence. record(ao, "QUAD:LTUS:510:DEGAUS_IMAX") { field(DESC, "Max I set afer a degauss") field(EGU, "Amps") field(PINI, "YES") field(PREC, "6") field(HOPR, "200.0") field(LOPR, "-200.0") field(DRVH, "200.0") field(DRVL, "-200.0") field(VAL, "200.0") field(FLNK, "QUAD:LTUS:510:DEGAUS_IMAXPOL_CHECK") info(autosaveFields,"VAL,RVAL") } # Set the polarity if degauss_imax record(calcout, "QUAD:LTUS:510:DEGAUS_IMAXPOL_CHECK") { field(DESC, "Determine polarity of imax") field(CALC, "A>=0?0:1") field(INPA, "QUAD:LTUS:510:DEGAUS_IMAX") field(FLNK, "QUAD:LTUS:510:DEGAUS_IMAXPOL") } record(bo, "QUAD:LTUS:510:DEGAUS_IMAXPOL") { field(DESC, "Polarity of imax I") field(DTYP, "Raw Soft Channel") field(DOL, "QUAD:LTUS:510:DEGAUS_IMAXPOL_CHECK") field(OMSL, "closed_loop") field(ZNAM, "Positive") field(ONAM, "Negative") field(FLNK, "QUAD:LTUS:510: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, "QUAD:LTUS:510:DEGAUS_ABSIMAX") { field(DESC, "Absolute Max. Degauss I") field(CALC, "ABS(A)") field(INPA, "QUAD:LTUS:510:DEGAUS_IMAX") field(PREC, "6") field(EGU, "Amps") field(HOPR, "200.0") field(LOPR, "-200.0") info(autosaveFields,"VAL RVAL") } # IACT Polarity record(calcout, "QUAD:LTUS:510:IACTPOL_CHECK") { field(DESC, "Determine IACT polarity") field(SCAN, "5 second") field(CALC, "ABS(A-B)>C?(A>=0?0:1):D") field(INPA, "QUAD:LTUS:510:IACT") field(INPB, "QUAD:LTUS:510:IACTPOL_CHECK.LA") field(INPC, "0.0001") field(INPD, "QUAD:LTUS:510:IACTPOL_CHECK.PVAL") field(OOPT, "On Change") field(FLNK, "QUAD:LTUS:510:IACTPOL") } record(bo, "QUAD:LTUS:510: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,"QUAD:LTUS:510: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, "QUAD:LTUS:510:DEGAUSENABLE CP") field(INPB, "QUAD:LTUS:510:DEGAUSOK") field(INPC, "QUAD:LTUS:510:STATE CP") field(INPD, "QUAD:LTUS:510:STATE.SEVR") field(OUT, "QUAD:LTUS:510:DEGAUS_STATE_SEQ.SELN PP") field(ASG, "Internal") } record(seq, "QUAD:LTUS:510:DEGAUS_STATE_SEQ") { field(DESC, "Degauss State Sequence") field(SELM, "Specified") field(SELL, "QUAD:LTUS:510:DEGAUS_STATE_CHECK") field(LNK1, "QUAD:LTUS:510:DEGAUS_STATE_DISABLE.PROC PP") field(LNK2, "QUAD:LTUS:510:DEGAUS_STATE_LOST.PROC PP") field(LNK3, "QUAD:LTUS:510:DEGAUS_STATE_GOOD.PROC PP") field(LNK4, "QUAD:LTUS:510: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, "QUAD:LTUS:510:DEGAUS_STATE_DISABLE") { field(DESC, "Degauss not used") field(LNK1, "QUAD:LTUS:510:DEGAUSOK.ZSV") field(LNK2, "QUAD:LTUS:510: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, "QUAD:LTUS:510:STATMSG.FRSV") field(LNK4, "QUAD:LTUS:510: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, "QUAD:LTUS:510:DEGAUS_STATE_LOST") { field(DESC, "Degauss lost and ps On") field(DOL1, "1") field(LNK1, "QUAD:LTUS:510:DEGAUSOK.ZSV") field(LNK2, "QUAD:LTUS:510: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, "QUAD:LTUS:510:STATMSG.FRSV") field(LNK4, "QUAD:LTUS:510: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, "QUAD:LTUS:510:DEGAUS_STATE_OFF") { field(DESC, "Degaused lost and ps Off") field(DOL1, "2") field(LNK1, "QUAD:LTUS:510: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, "QUAD:LTUS:510:STATMSG.FRSV") field(LNK3, "QUAD:LTUS:510: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, "QUAD:LTUS:510:DEGAUS_STATE_GOOD") { field(DESC, "Degauss good") field(DOL1, "1") field(LNK1, "QUAD:LTUS:510: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, "QUAD:LTUS:510:STATMSG.FRSV PP") field(LNK3, "QUAD:LTUS:510:STATMSG.FVSV PP") field(LNK4, "") field(ASG, "Internal") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(mbbo, "QUAD:LTUS:510:FUNC") { field(DESC, "QUAD:LTUS:510 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, "1") field(THVL, "9") field(FRVL, "10") field(FVVL, "0") field(SXVL, "2") field(SVVL, "8") field(EIVL, "11") field(NIVL, "12") field(TEVL, "13") field(ELVL, "5") field(TVVL, "6") field(TTVL, "7") field(FTVL, "4") field(FFVL, "3") field(OUT, "QUAD:LTUS:510:CTRL CA") } # :CTRL pv is processed at boot in the # sequence mgntCtrl.st Processed in sequence # record(mbbo, "QUAD:LTUS:510:CTRL") { field(DESC, "QUAD:LTUS:510 Control") field(PINI, "NO") field(ZRST, "Ready") field(ONST, "TRIM") field(TWST, "PERTURB") field(THST, "BCON_TO_BDES") field(FRST, "BACT_TO_BDES") field(FVST, "SAVE_BDES") field(SXST, "LOAD_BDES") field(SVST, "UNDO_BDES") field(EIST, "DAC_ZERO") field(NIST, "CALB") field(TEST, "STDZ") field(ELST, "RESET") field(TVST, "TURN_ON") field(TTST, "TURN_OFF") field(FTST, "") field(FFST, "") field(ZRVL, "0") field(ONVL, "2") field(TWVL, "6") field(THVL, "15") field(FRVL, "14") field(FVVL, "11") field(SXVL, "12") field(SVVL, "13") field(EIVL, "7") field(NIVL, "3") field(TEVL, "4") field(ELVL, "8") field(TVVL, "9") field(TTVL, "10") field(FTVL, "0") field(FFVL, "0") field(OUT, "QUAD:LTUS:510:SELECTEN.A PP") field(SDIS, "0") } # If a function has been selected set this unit to busy record(calcout, "QUAD:LTUS:510:SELECTEN") { field(DESC, "Control Select Enable") field(CALC, "A>0?1:A") field(FLNK, "QUAD:LTUS:510:BUSY") } # Set to FREE on IOC reboot record(bo, "QUAD:LTUS:510:BUSY") { field(DESC, "QUAD:LTUS:510 Ctrl Done") field(DOL, "QUAD:LTUS:510:SELECTEN") field(ZNAM, "FREE") field(ONAM, "BUSY") field(PINI, "YES") field(FLNK, "QUAD:LTUS:510:SELECT") } record(bo, "QUAD:LTUS:510:SELECT") { field(ZNAM, "NO") field(ONAM, "YES") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") } record(bo, "QUAD:LTUS:510: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, "QUAD:LTUS:510:CTRLSTATE") { field(DESC, "QUAD:LTUS:510 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("QUAD:LTUS:510:CTRL",20,20,0,0,"QUAD:LTUS:510:CTRL") #! Field("QUAD:LTUS:510:CTRL.OUT",16777215,1,"QUAD:LTUS:510:CTRL.OUT") #! Link("QUAD:LTUS:510:CTRL.OUT","QUAD:LTUS:510:SELECTEN.A") #! Field("QUAD:LTUS:510:CTRL.VAL",16777215,1,"QUAD:LTUS:510:CTRL.VAL") #! Record("QUAD:LTUS:510:SELECTEN",321,381,0,0,"QUAD:LTUS:510:SELECTEN") #! Field("QUAD:LTUS:510:SELECTEN.A",16777215,0,"QUAD:LTUS:510:SELECTEN.A") #! Field("QUAD:LTUS:510:SELECTEN.FLNK",16777215,1,"QUAD:LTUS:510:SELECTEN.FLNK") #! Link("QUAD:LTUS:510:SELECTEN.FLNK","QUAD:LTUS:510:BUSY") #! Field("QUAD:LTUS:510:SELECTEN.VAL",16777215,1,"QUAD:LTUS:510:SELECTEN.VAL") #! Record("QUAD:LTUS:510:BUSY",623,274,0,0,"QUAD:LTUS:510:BUSY") #! Field("QUAD:LTUS:510:BUSY.DOL",16777215,0,"QUAD:LTUS:510:BUSY.DOL") #! Link("QUAD:LTUS:510:BUSY.DOL","QUAD:LTUS:510:SELECTEN.VAL") #! Field("QUAD:LTUS:510:BUSY.FLNK",16777215,1,"QUAD:LTUS:510:BUSY.FLNK") #! Link("QUAD:LTUS:510:BUSY.FLNK","QUAD:LTUS:510:SELECT") #! Record("QUAD:LTUS:510:SELECT",669,508,0,1,"QUAD:LTUS:510:SELECT") #! Record("QUAD:LTUS:510:FUNC",940,120,0,0,"QUAD:LTUS:510:FUNC") #! Field("QUAD:LTUS:510:FUNC.OUT",16777215,0,"QUAD:LTUS:510:FUNC.OUT") #! Link("QUAD:LTUS:510:FUNC.OUT","QUAD:LTUS:510:CTRL.VAL") #! Record("QUAD:LTUS:510:ABORT",193,41,0,0,"QUAD:LTUS:510:ABORT") #! Record("QUAD:LTUS:510:CTRLSTATE",369,34,0,0,"QUAD:LTUS:510: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,"QUAD:LTUS:510:SELECT is used for Multi-device selection.\nIt is enabled when associated QUAD:LTUS:510:CTRL is \"0\" (DONE).\nIt is disabled when associated QUAD:LTUS:510: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,"QUAD:LTUS:510: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, "QUAD:LTUS:510:BCTRL_INIT") { field(DESC, "Process BCTRL on boot") field(PINI, "YES") field(CALC, "A=3?1:0") field(INPA, "QUAD:LTUS:510:BCTRL.SEVR") field(OUT, "QUAD:LTUS:510: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, "QUAD:LTUS:510:BACT") { field(DESC, "Actual B") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "QUAD:LTUS:510:BACT") field(INPB, "QUAD:LTUS:510:POLYCOEF") field(INPC, "QUAD:LTUS:510:POLYCOEF.A") field(INPD, "QUAD:LTUS:510:POLYCOEF.B") field(INPE, "QUAD:LTUS:510:IACT MS") field(INPF, "QUAD:LTUS:510:BDELTAS PP") field(INPG, "100") field(EGU, "kG") field(HOPR, "101.5482") field(LOPR, "0.2622") field(HIHI, "101.5482") field(LOLO, "0.2622") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "101.5482") field(LOW, "0.2622") field(FLNK, "QUAD:LTUS:510: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, "QUAD:LTUS:510:BDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntPhyDeltas") field(EGU, "kG") field(HOPR, "1") field(PREC, "7") field(BRSV, "INVALID") field(INPA, "QUAD:LTUS:510:BDES") field(INPB, "QUAD:LTUS:510:TRIMBTOL") field(INPC, "QUAD:LTUS:510:TRIMBTOLR") field(INPD, "QUAD:LTUS:510:CHCKBTOL") field(INPE, "QUAD:LTUS:510:CHCKBTOLR") field(F, "2.0") field(INPG, "30") field(INPH, "QUAD:LTUS:510:BACT.VAL") # # MPS absolute and relative tolerances field(INPP, "QUAD:LTUS:510:MPSBTOL") field(INPQ, "QUAD:LTUS:510:MPSBTOLR") field(FLNK, "QUAD:LTUS:510:BCONLIMITS") info(autosaveFields,"F") } # This record is processed by BDELTAS record(aSub, "QUAD:LTUS:510:BCONLIMITS") { field(DESC, "Config B-field Limits") field(INAM, "mgntInit") field(SNAM, "mgntBCONLimits") field(INPA, "QUAD:LTUS:510:BDES") field(INPB, "QUAD:LTUS:510:BDELTAS.I") field(INPG, "QUAD:LTUS:510:DEBUG.RVAL") field(FTA, "DOUBLE") field(FTB, "DOUBLE") field(FTG, "ULONG") field(OUTA, "QUAD:LTUS:510:BCON.HIGH") field(OUTB, "QUAD:LTUS:510:BCON.LOW") field(OUTC, "QUAD:LTUS:510:BCON.HIHI") field(OUTD, "QUAD:LTUS:510:BCON.LOLO PP") field(FTVA, "DOUBLE") field(FTVB, "DOUBLE") field(FTVC, "DOUBLE") field(FTVD, "DOUBLE") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:510:IDELTAS") } # The following PV is processed by :BACT # which is processed by :BACT # record(fanout, "QUAD:LTUS:510:BACTFO") { field(DESC, "BACT processing") field(SELM, "All") field(LNK1, "QUAD:LTUS:510:BDIFF") field(LNK2, "QUAD:LTUS:510:BADIFF") field(LNK3, "QUAD:LTUS:510:BRATIO") field(LNK4, "QUAD:LTUS:510:MPSLIMITS") field(LNK5, "QUAD:LTUS:510:I2BSTATUS") field(LNK6, "QUAD:LTUS:510:IACTFO.PROC") } record(calc, "QUAD:LTUS:510:BDIFF") { field(DESC, "BDES-BACT") field(CALC, "A-B") field(INPA, "QUAD:LTUS:510:BDES") field(INPB, "QUAD:LTUS:510:BACT") field(EGU, "kG") field(PREC, "7") } record(calc, "QUAD:LTUS:510:BADIFF") { field(DESC, "Absolute BDES-BACT") field(INPA, "QUAD:LTUS:510:BDIFF") field(EGU, "kG") field(PREC, "7") field(CALC, "A<0?ABS(A):A") } record(calc, "QUAD:LTUS:510:BRATIO") { field(DESC, "BACT Error") field(CALC, "B?A/B:0") field(INPA, "QUAD:LTUS:510:BDIFF") field(INPB, "QUAD:LTUS:510:BDES.HOPR") field(EGU, "kG") field(PREC, "7") } record(mbbi, "QUAD:LTUS:510: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, "QUAD:LTUS:510:BACT.J") } # Note: for a string slave set the MONFL # macro to the following: # MONFL=:IMONCALC MS record(sub, "QUAD:LTUS:510:BMON") { field(DESC, "Second Transductor") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "QUAD:LTUS:510:BMON") field(INPB, "QUAD:LTUS:510:POLYCOEF") field(INPC, "QUAD:LTUS:510:POLYCOEF.A") field(INPD, "QUAD:LTUS:510:POLYCOEF.B") field(INPE, "QUAD:LTUS:510:IMON MS") field(INPF, "QUAD:LTUS:510:BDELTAS.VAL") field(INPG, "100") field(EGU, "kG") field(HOPR, "101.5482") field(LOPR, "0.2622") field(HIHI, "101.5482") field(LOLO, "0.2622") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "101.5482") field(LOW, "0.2622") } # 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=PSC:LTUS:MG10:BDES CP record(ao, "QUAD:LTUS:510:BDES") { field(DESC, "Desired B-Field") field(PINI, "YES") field(DRVH, "101.5482") field(DRVL, "0.2622") field(HOPR, "101.5482") field(LOPR, "0.2622") field(PREC, "7") field(EGU, "kG") field(MDEL, "-1") field(OMSL, "supervisory") # field(DOL, "") field(OUT, "QUAD:LTUS:510:B2IDES PP") info(autosaveFields,"VAL") } record(sub, "QUAD:LTUS:510:B2IDES") { field(DESC, "Convert Desired B-Field to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:510:POLYCOEF") field(INPC, "QUAD:LTUS:510:POLYCOEF.A") field(INPD, "QUAD:LTUS:510:POLYCOEF.B") field(PREC, "7") field(EGU, "kG") field(HOPR, "101.5482") field(LOPR, "0.2622") field(MDEL, "-1") field(INPE, "QUAD:LTUS:510:BDES.DRVH") field(INPF, "QUAD:LTUS:510:BDES.DRVL") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:510:IDES") } record(sub, "QUAD:LTUS:510:BNOM") { field(DESC, "Nominal Field") field(PINI, "YES") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:510:POLYCOEF") field(INPC, "QUAD:LTUS:510:POLYCOEF.A") field(INPD, "QUAD:LTUS:510:POLYCOEF.B") field(INPE, "QUAD:LTUS:510:BDES.DRVH") field(INPF, "QUAD:LTUS:510:BDES.DRVL") field(EGU, "kG") field(HOPR, "101.5482") field(LOPR, "0.2622") field(PREC, "7") field(VAL, "0.0") field(FLNK, "QUAD:LTUS:510:INOM") } record(sub, "QUAD:LTUS:510:BACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:510:BDES.VAL") field(INPB, "QUAD:LTUS:510:BDES.DRVH") field(INPC, "QUAD:LTUS:510:BDES.DRVL") field(INPD, "QUAD:LTUS:510:BDELTAS.I") field(INPE, "QUAD:LTUS:510:BDELTAS.J") field(INPG, "QUAD:LTUS:510:STATE") field(INPH, "QUAD:LTUS:510:HSTA") field(EGU, "kG") field(HOPR, "101.5482") field(LOPR, "0.2622") field(PREC, "7") field(BRSV, "INVALID") } record(sub, "QUAD:LTUS:510:BMONLIMITS") { field(DESC, "MON Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:510:BDES.VAL") field(INPB, "QUAD:LTUS:510:BDES.DRVH") field(INPC, "QUAD:LTUS:510:BDES.DRVL") field(INPD, "QUAD:LTUS:510:BDELTAS.K") field(INPE, "QUAD:LTUS:510:BDELTAS.L") field(INPG, "QUAD:LTUS:510:STATE") field(INPH, "QUAD:LTUS:510:HSTA") field(EGU, "kG") field(HOPR, "101.5482") field(LOPR, "0.2622") field(PREC, "7") field(BRSV, "INVALID") } record(seq, "QUAD:LTUS:510:BLIMITS") { field(DESC, "ACT Limits") field(PREC, "7") field(DOL1, "QUAD:LTUS:510:BLIMITS") field(LNK1, "QUAD:LTUS:510:BACTLIMITS.F PP") field(DOL2, "QUAD:LTUS:510:BACTLIMITS.I") field(LNK2, "QUAD:LTUS:510:BACT.HIGH") field(DOL3, "QUAD:LTUS:510:BACTLIMITS.J") field(LNK3, "QUAD:LTUS:510:BACT.LOW") field(DOL4, "QUAD:LTUS:510:BACTLIMITS.K") field(LNK4, "QUAD:LTUS:510:BACT.HIHI") field(DOL5, "QUAD:LTUS:510:BACTLIMITS.L") field(LNK5, "QUAD:LTUS:510:BACT.LOLO") field(DOL6, "QUAD:LTUS:510:BLIMITS") field(LNK6, "QUAD:LTUS:510:BMONLIMITS.F PP") field(DOL7, "QUAD:LTUS:510:BMONLIMITS.I") field(LNK7, "QUAD:LTUS:510:BMON.HIGH") field(DOL8, "QUAD:LTUS:510:BMONLIMITS.J") field(LNK8, "QUAD:LTUS:510:BMON.LOW") field(DOL9, "QUAD:LTUS:510:BMONLIMITS.K") field(LNK9, "QUAD:LTUS:510:BMON.HIHI") field(DOLA, "QUAD:LTUS:510:BMONLIMITS.L") field(LNKA, "QUAD:LTUS:510:BMON.LOLO") field(FLNK, "QUAD:LTUS:510:ILIMITS") field(SCAN, "5 second") } record(ao, "QUAD:LTUS:510:BCTRL") { field(DESC, "B-Perturb") field(PREC, "7") field(EGU, "kG") field(DRVH, "101.5482") field(DRVL, "0.2622") field(HOPR, "101.5482") field(LOPR, "0.2622") # 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, "QUAD:LTUS:510: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, "QUAD:LTUS:510:BCTRLGO") { field(DESC, "Update DES and perturb") field(PREC, "7") # Disable BACT limits field(DOL1, "1") field(LNK1, "QUAD:LTUS:510:BLIMITS.VAL") # Update BDES with the BCTRL (slider) value field(DOL2, "QUAD:LTUS:510:BCTRL.VAL") field(LNK2, "QUAD:LTUS:510:BDES PP") field(DOL3, "1") field(LNK3, "QUAD:LTUS:510:IDIRECT.PROC PP") field(DOL4, "1") field(LNK4, "QUAD:LTUS:510:CHECKSTDZLOST.PROC PP") field(DOL5, "QUAD:LTUS:510:BCTRL.VAL") field(LNK5, "QUAD:LTUS:510:BCTRLSUB PP") # Re-enable BACT limits field(DOL6, "0") field(LNK6, "QUAD:LTUS:510:BLIMITS.VAL") } # Convert B-field to Current and output to ISETPT record(sub, "QUAD:LTUS:510:BCTRLSUB") { field(DESC, "Feedback") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:510:POLYCOEF") field(INPC, "QUAD:LTUS:510:POLYCOEF.A") field(INPD, "QUAD:LTUS:510:POLYCOEF.B") field(INPE, "QUAD:LTUS:510:BDES.DRVH") field(INPF, "QUAD:LTUS:510:BDES.DRVL") field(PREC, "7") field(EGU, "kG") field(HOPR, "101.5482") field(LOPR, "0.2622") field(MDEL, "-1") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:510:ISETPT") } record(ao, "QUAD:LTUS:510:BDESPREVTRIM") { field(DESC, "trim bdes for undo") field(DTYP, "Soft Channel") field(DRVH, "101.5482") field(DRVL, "0.2622") field(EGU, "kG") field(HOPR, "101.5482") field(LOPR, "0.2622") field(PREC, "7") field(PINI, "YES") info(autosaveFields,"VAL") } record(stringin, "QUAD:LTUS:510:MADNAME") { field(DESC, "MAD deck nomenclature") field(PINI, "YES") field(VAL, "QDL22") } record(ai, "QUAD:LTUS:510: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, "3366.597179") } record(ao, "QUAD:LTUS:510:BMAX") { field(DESC, "Max B-Field") field(DTYP, "Soft Channel") field(DRVH, "101.5482") field(DRVL, "0.2622") field(EGU, "kG") field(HOPR, "101.5482") field(LOPR, "0.2622") field(PREC, "7") field(PINI, "YES") field(VAL, "101.5482") field(FLNK, "QUAD:LTUS:510:BSTEP") } record(ao, "QUAD:LTUS:510:BMIN") { field(DESC, "Min B-Field") field(DTYP, "Soft Channel") field(DRVH, "101.5482") field(DRVL, "0.2622") field(EGU, "kG") field(HOPR, "101.5482") field(LOPR, "0.2622") field(PREC, "7") field(PINI, "YES") field(VAL, "0.2622") field(FLNK, "QUAD:LTUS:510:BSTEP") } record(ao, "QUAD:LTUS:510:BDESSAVE") { field(DESC, "bdes for save/load") field(DTYP, "Soft Channel") field(DRVH, "101.5482") field(DRVL, "0.2622") field(EGU, "kG") field(HOPR, "101.5482") field(LOPR, "0.2622") field(PINI, "YES") field(PREC, "7") } # This record is processed by QUAD:LTUS:510: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, "QUAD:LTUS:510:BCON") { field(DESC, "Config B-Field ") field(DTYP, "Soft Channel") field(PREC, "7") field(EGU, "kG") field(HOPR, "101.5482") field(LOPR, "0.2622") field(DRVH, "101.5482") field(DRVL, "0.2622") # Set MINOR Alarm as the default, slaves will set NO_ALARM=0. field(HHSV, "MINOR") field(LLSV, "MINOR") field(HSV, "MINOR") field(LSV, "MINOR") # field(DOL , "") field(OMSL, "supervisory") field(OUT, "QUAD:LTUS:510:B2ICON PP") info(autosaveFields,"VAL") } record(sub, "QUAD:LTUS:510:B2ICON") { field(DESC, "Convert Desired ICon to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:510:POLYCOEF") field(INPC, "QUAD:LTUS:510:POLYCOEF.A") field(INPD, "QUAD:LTUS:510:POLYCOEF.B") field(PREC, "7") field(EGU, "kG") field(HOPR, "101.5482") field(LOPR, "0.2622") field(MDEL, "-1") field(INPE, "QUAD:LTUS:510:BCON.DRVH") field(INPF, "QUAD:LTUS:510:BCON.DRVL") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:510: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, "QUAD:LTUS:510:BSTEP") { field(DESC, "B-Field step size") field(CALC, "(C==3)||(D==3)?0:ABS(A-B)*0.005") field(INPA, "QUAD:LTUS:510:BMAX") field(INPB, "QUAD:LTUS:510:BMIN") field(INPC, "QUAD:LTUS:510:BMIN.SEVR") field(INPD, "QUAD:LTUS:510:BMAX.SEVR") field(EGU, "kG") 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,"QUAD:LTUS:510:BCTRLDISABLECALC") { field(DESC, "Calc for disabling BCTRL") field(ASG, "Internal") field(CALC, "A?2:1") field(INPA, "QUAD:LTUS:510:ONLINE CP") field(OUT, "QUAD:LTUS:510:BCTRLDISABLEFOUT PP") } record(fanout, "QUAD:LTUS:510:BCTRLDISABLEFOUT") { field(DESC, "Disable BCTRL fanout") field(SELM, "Specified") field(SELL, "QUAD:LTUS:510:BCTRLDISABLECALC") field(LNK1, "QUAD:LTUS:510:BCTRLDISABLE") field(LNK2, "QUAD:LTUS:510:BCTRLENABLE") } record(stringout, "QUAD:LTUS:510:BCTRLDISABLE") { field(DESC, "Disable BCTRL") field(DTYP, "Soft Channel") field(OUT, "QUAD:LTUS:510:BCTRL.ASG") field(VAL, "NOWRITE") field(FLNK, "QUAD:LTUS:510:BCTRLDISV_UPDATE") } record(stringout, "QUAD:LTUS:510:BCTRLENABLE") { field(DESC, "Enable BCTRL") field(DTYP, "Soft Channel") field(OUT, "QUAD:LTUS:510:BCTRL.ASG") field(VAL, "") field(FLNK, "QUAD:LTUS:510:BCTRLDISV_UPDATE") } record(calcout, "QUAD:LTUS:510:BCTRLDISV_UPDATE") { field(DESC, "Calc for updating BCTRL.DISV") field(ASG, "Internal") field(CALC, "A") field(INPA, "QUAD:LTUS:510:ONLINE") field(OUT, "QUAD:LTUS:510: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,"QUAD:LTUS:510:BACT and MON\n are processed via links from \n QUAD:LTUS:510:IACT (device raw value readback 1)\n and\n QUAD:LTUS:510: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 QUAD:LTUS:510:POLYCOEF\nC = First polynomial coefficient (offset if linear)\nD = Second polynomial coefficient (slope if linear)\nE = QUAD:LTUS:510: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,"QUAD:LTUS:510:BDES\n is processed when set by CA users or \n QUAD:LTUS:510: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,"QUAD:LTUS:510: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 QUAD:LTUS:510: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 (QUAD:LTUS:510: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,"QUAD:LTUS:510:B*LIMITS and QUAD:LTUS:510:BLIMITS:\n Calculate alarm and warning limits based on \n deltas from QUAD:LTUS:510: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,"QUAD:LTUS:510: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,"QUAD:LTUS:510: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, "QUAD:LTUS:510: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, "QUAD:LTUS:510:MPSBTOL") { field(DESC, "Absolute mps tol") field(EGU, "kG") field(PREC, "2") field(CALC, "ABS(A)*0.02") field(INPA, "QUAD:LTUS:510:BMAX") field(PINI, "YES") } # # 21-Aug-2013: K. Luchini # Set channel access security so that users # cannot easily change values. record(ao, "QUAD:LTUS:510:MPSBMAX") { field(DESC, "MPS Max B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "101.5482") field(DRVL, "0.2622") field(PINI, "YES") field(VAL, "101.5482") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:510:MPSBMIN") { field(DESC, "MPS Min B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "101.5482") field(DRVL, "0.2622") field(PINI, "YES") field(VAL, "0.2622") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:510:MPSBLLIM") { field(DESC, "MPS Low Limit B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "101.5482") field(DRVL, "0.2622") field(PINI, "YES") field(VAL, "0.2622") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:510:MPSBLLIM2") { field(DESC, "MPS Low Limit #2 B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "101.5482") field(DRVL, "0.2622") field(PINI, "YES") field(VAL, "0.2622") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } # Set the default to Std record(mbbo, "QUAD:LTUS:510: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, "QUAD:LTUS:510:MPSLIMITS.E PP") } record(aSub, "QUAD:LTUS:510: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, "QUAD:LTUS:510:MPS.RVAL") field(INPB, "QUAD:LTUS:510:BADIFF") field(INPC, "QUAD:LTUS:510:BDELTAS.N") field(INPD, "QUAD:LTUS:510:BACT") field(INPE, "QUAD:LTUS:510:MPSBITMASK.RVAL") field(INPF, "QUAD:LTUS:510:MPSBLLIM") field(INPG, "QUAD:LTUS:510:MPSBMIN") field(INPH, "QUAD:LTUS:510:MPSBMAX") field(INPI, "QUAD:LTUS:510: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, "QUAD:LTUS:510:INTOL.RVAL PP") field(OUTB, "QUAD:LTUS:510:INTOL_BMIN.RVAL PP") field(OUTC, "QUAD:LTUS:510:INTOL_BRANGE.RVAL PP") field(OUTD, "QUAD:LTUS:510: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, "QUAD:LTUS:510:INTOL") { field(DESC, "BACT within MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:510:MPSLIMITS.VALA") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "QUAD:LTUS:510:INTOL_BMIN") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:510:MPSLIMITS.VALB") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "QUAD:LTUS:510:INTOL_BMIN2") { field(DESC, "MPS tol #2") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:510:MPSLIMITS.VALD") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "QUAD:LTUS:510:INTOL_BRANGE") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:510: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, "QUAD:LTUS:510:CHCKITOL") { field(DESC, "Absolute Check I Tolerance") field(EGU, "A") field(FLNK, "QUAD:LTUS:510:TRIMITOL") field(CALC, "ABS(A*B)") field(INPA, "QUAD:LTUS:510:CHCKBTOL") field(INPB, "QUAD:LTUS:510:POLYCOEF.B") field(PREC, "9") } record(calc, "QUAD:LTUS:510:TRIMBTOL") { field(EGU, "kG") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(DESC, "Absolute Trim Tolerance") field(CALC, "ABS(A)/2") field(INPA, "QUAD:LTUS:510:CHCKBTOL") field(FLNK, "QUAD:LTUS:510:CHCKITOL") } record(calc, "QUAD:LTUS:510:CHCKBTOL") { field(DESC, "Check absolute tolerance") field(EGU, "A") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(FLNK, "QUAD:LTUS:510:TRIMBTOL") field(CALC, "MAX(ABS(A),ABS(C))*(B/1000000)") field(INPA, "QUAD:LTUS:510:BDES.HOPR") field(INPB, "QUAD:LTUS:510:STABILITY") field(INPC, "QUAD:LTUS:510:BDES.LOPR") } record(longout, "QUAD:LTUS:510: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, "QUAD:LTUS:510:CHCKBTOL") } record(calc, "QUAD:LTUS:510:TRIMITOL") { field(DESC, "Absolute Trim I Tolerance") field(EGU, "kG") field(CALC, "ABS(A*B)") field(INPA, "QUAD:LTUS:510:POLYCOEF.B") field(INPB, "QUAD:LTUS:510:TRIMBTOL") field(PREC, "9") } record(ai, "QUAD:LTUS:510:TRIMBTOLR") { field(DESC, "Relative trim tol") field(PREC, "4") field(EGU, "%") field(HOPR, "1.0") field(LOPR, "0.0") field(PINI, "YES") } record(ai, "QUAD:LTUS:510: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, "QUAD:LTUS:510:FBCKFCOM") { field(ZNAM, "CA") field(ONAM, "FCOM") field(DESC, "CA Mode") field(PINI, "YES") field(SDIS, "0") } record(bo, "QUAD:LTUS:510:PAU") { field(ZNAM, "NotConfigured") field(ONAM, "Configured") field(DESC, "PAU Present") field(PINI, "YES") field(SDIS, "0") field(FLNK, "QUAD:LTUS:510:PAUGO") } record(fanout, "QUAD:LTUS:510:PAUGO") { field(DESC, "PAU control") field(LNK1, "QUAD:LTUS:510:PAUSTOP") field(LNK2, "QUAD:LTUS:510: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, "QUAD:LTUS:510:PAUSTART") { field(DESC, "Setup for PAU On") field(SDIS, "QUAD:LTUS:510: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, "QUAD:LTUS:510:PAUSTOP") { field(DESC, "Setup for PAU Off") field(SDIS, "QUAD:LTUS:510: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, "QUAD:LTUS:510:MCORDEVNAME") { field(DESC, "PS device name") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, "PSC:LTUS:MG10:") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "QUAD:LTUS:510: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, "QUAD:LTUS:510:PSTYPE.RVAL") field(INPC, "QUAD:LTUS:510:TURNEDOFF.RVAL") field(INPD, "QUAD:LTUS:510:CONFIG.RVAL") field(INPE, "QUAD:LTUS:510:PSCATEGORY.RVAL") field(INPF, "QUAD:LTUS:510:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "QUAD:LTUS:510:AUTOCTRL.RVAL") field(INPJ, "QUAD:LTUS:510:OUTOFSERVICE.RVAL") field(INPL, "QUAD:LTUS:510:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "QUAD:LTUS:510:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "QUAD:LTUS:510:PAU") field(INPP, "QUAD:LTUS:510:CALBDISABLE.RVAL") field(INPQ, "QUAD:LTUS:510:PTRBDISABLE.RVAL") field(INPR, "QUAD:LTUS:510:TRIMDISABLE.RVAL") field(INPS, "QUAD:LTUS:510:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "QUAD:LTUS:510:FBCK") field(INPU, "QUAD:LTUS:510:TRIMTYPE.RVAL") field(INPV, "QUAD:LTUS:510:STDZDIRECT.RVAL") field(INPW, "QUAD:LTUS:510:DEGAUSENABLE.RVAL") field(FLNK, "QUAD:LTUS:510:HSTA") } record(longin, "QUAD:LTUS:510:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "QUAD:LTUS:510:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "QUAD:LTUS:510: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, "QUAD:LTUS:510: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, "QUAD:LTUS:510:CALBDISABLE") { field(DESC, "DAC Calb Disabled") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:510:PTRBDISABLE") { field(DESC, "Perturb Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:510:TRIMDISABLE") { field(DESC, "Trim Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:510: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 QUAD:LTUS:510:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses QUAD:LTUS:510:FBCK. # This PV should be replaced by QUAD:LTUS:510: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, "QUAD:LTUS:510: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, "QUAD:LTUS:510: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, "QUAD:LTUS:510: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, "") field(OMSL, "supervisory") field(FLNK, "QUAD:LTUS:510:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"QUAD:LTUS:510:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "QUAD:LTUS:510:OUTOFSERVICE NPP NMS") field(OUT, "QUAD:LTUS:510:ONLINE PP") } record(bo, "QUAD:LTUS:510:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "QUAD:LTUS:510: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, "1") } record(bo, "QUAD:LTUS:510: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, "1") } record(bo, "QUAD:LTUS:510: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, "QUAD:LTUS:510: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, "QUAD:LTUS:510: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, "QUAD:LTUS:510: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, "QUAD:LTUS:510: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, "QUAD:LTUS:510: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, "1") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:510: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, "1") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:510: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, "2") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:510: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, "0") field(ASG, "NOWRITE") field(FLNK, "QUAD:LTUS:510:TRIMTYPE") } record(stringout, "QUAD:LTUS:510:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "QUAD:LTUS:510:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "QUAD:LTUS:510:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "QUAD:LTUS:510:STATE.RVAL") field(INPB, "QUAD:LTUS:510:INTLKSUMY.RVAL") field(OUT, "QUAD:LTUS:510:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:LTUS:510: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, "QUAD:LTUS:510:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "QUAD:LTUS:510:STATE.RVAL") field(INPB, "QUAD:LTUS:510:INTLKSUMY.RVAL") field(OUT, "QUAD:LTUS:510:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:LTUS:510:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "QUAD:LTUS:510:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "QUAD:LTUS:510: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, "QUAD:LTUS:510:RAMPSTARTDLY") { field(DESC, "Tansition to ramp delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "2") } ######### For PSTYPE=2 Only ############# record(mbbo, "QUAD:LTUS:510: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, "QUAD:LTUS:510: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,"QUAD:LTUS:510: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("QUAD:LTUS:510:TURNEDOFF",3140,1907,0,1,"QUAD:LTUS:510:TURNEDOFF") #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "QUAD:LTUS:510:STATSUB") { field(DESC, "Build STATus ") field(INAM, "mgntInit") field(SNAM, "mgntSlcStat") field(INPA, "QUAD:LTUS:510:BACT.STAT") field(INPB, "QUAD:LTUS:510:BDES.STAT") field(INPC, "QUAD:LTUS:510:IRIPL.STAT") field(INPD, "PSC:LTUS:MG10:ISETPT.STAT") field(INPE, "PSC:LTUS:MG10:IACT.STAT") # 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, "QUAD:LTUS:510:BACT.SEVR") field(INPH, "QUAD:LTUS:510:BDES.SEVR") field(INPI, "QUAD:LTUS:510:IRIPL.SEVR") field(INPJ, "PSC:LTUS:MG10:ISETPT.SEVR") field(INPK, "PSC:LTUS:MG10:IACT.SEVR") # # 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, "QUAD:LTUS:510:STATE.RVAL") field(INPN, "QUAD:LTUS:510:STDZOK") field(INPO, "QUAD:LTUS:510:CALBOK") field(INPP, "QUAD:LTUS:510:OUTOFSERVICE.RVAL") field(INPQ, "QUAD:LTUS:510:CONFIG.RVAL") field(INPR, "QUAD:LTUS:510:HSTA") field(INPS, "QUAD:LTUS:510:CTRL.RVAL") field(INPT, "QUAD:LTUS:510:DEGAUSOK") field(INPV, "QUAD:LTUS:510: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, "QUAD:LTUS:510:STAT") } record(longout, "QUAD:LTUS:510:STAT") { field(DESC, "STAT sent to SLC") field(SCAN, "Passive") field(FLNK, "QUAD:LTUS:510:STATCTRLSUB") field(DOL, "QUAD:LTUS:510:STATSUB.VAL") field(OMSL, "closed_loop") } record(sSub, "QUAD:LTUS:510:STATCTRLSUB") { field(DESC, "Decode SLC STAT into mbbo") field(INAM, "mgntInit") field(SNAM, "mgntStatDecode") field(INPA, "QUAD:LTUS:510:STAT") field(INPB, "QUAD:LTUS:510:HSTA") field(INPD, "QUAD:LTUS:510:ONOFFCTRL.RVAL") field(FLNK, "QUAD:LTUS:510:STATMSG") } record(mbbo, "QUAD:LTUS:510: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, "QUAD:LTUS:510:UNAVAILGO") field(DOL, "QUAD:LTUS:510:STATCTRLSUB.W") } record(seq, "QUAD:LTUS:510:UNAVAILGO") { field(DESC, "Process UNAVAIL") field(DOL1, "QUAD:LTUS:510:STATSUB.U") field(LNK1, "QUAD:LTUS:510:UNAVAIL PP") } record(stringout, "QUAD:LTUS:510:SNLSTATMSG") { field(DTYP, "Soft Channel") } #! TextBox(TB0,820,1000,1200,1220,0,"Dialog",12,1,16777215,"QUAD:LTUS:510:STATUSSUB - future\nOverall device status - takes input from action snls, record sevrs, master snl(s) and outputs final status\n\nInputs:\nA - QUAD:LTUS:510:CTRLSTATUS - snl status\nB - MGNT:CTRLSTATUS - master list status\nC\nD - QUAD:LTUS:510: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,"QUAD:LTUS:510STATSUB\nformat control bo's into slc STAT\n\nInputs:\nA - QUAD:LTUS:510:STATUS\nC - QUAD:LTUS:510:ON\nD - QUAD:LTUS:510:STDZOK\nE - QUAD:LTUS:510:CALBOK\nF - QUAD:LTUS:510:BACTDRIFT (future)\nG -\nH- QUAD:LTUS:510:DACSTATUS\nI -QUAD:LTUS:510:ADCSTATUS\nJ - QUAD:LTUS:510:BACTSTATUS\nK - QUAD:LTUS:510:BDESSTATUS\nL - QUAD:LTUS:510:RIPLSTATUS\n\nOutput:\nP - QUAD:LTUS:510: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, "QUAD:LTUS:510: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, "QUAD:LTUS:510: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, "QUAD:LTUS:510: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, "QUAD:LTUS:510: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.6 #! DBDSTART #! DBD("../../../../dbd/mgntSoft.dbd") #! DBDEND record(stringout, "QUAD:LTUS:510:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:510:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "QUAD:LTUS:510:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "QUAD:LTUS:510:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "QUAD:LTUS:510:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "QUAD:LTUS:510:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "1") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "QUAD:LTUS:510: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, "QUAD:LTUS:510:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "QUAD:LTUS:510:TRIMTYPE.RVAL") field(INPB, "QUAD:LTUS:510:CONFIG.RVAL") field(OUT, "QUAD:LTUS:510:TRIMMAXNUM PP") } record(longout, "QUAD:LTUS:510: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, "QUAD:LTUS:510: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, "") field(OMSL, "supervisory") field(VAL, "20") field(OUT, "QUAD:LTUS:510:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "QUAD:LTUS:510: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, "") field(OMSL, "supervisory") field(VAL, "10") } record(bo, "QUAD:LTUS:510: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, "QUAD:LTUS:510: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, "QUAD:LTUS:510: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, "QUAD:LTUS:510:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "0") } record(ao, "QUAD:LTUS:510: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, "QUAD:LTUS:510:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "QUAD:LTUS:510: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, "QUAD:LTUS:510: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, "QUAD:LTUS:510:IMOVE") field(INPB, "QUAD:LTUS:510:IACT") field(INPC, "QUAD:LTUS:510:IRAMPRATE") field(INPD, "1.577") field(INPE, "QUAD:LTUS:510:TRIMDLYPCT") field(INPF, "QUAD:LTUS:510:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "QUAD:LTUS:510:RAMPTIME_LEFT PP") } record(longout, "QUAD:LTUS:510:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "QUAD:LTUS:510:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "QUAD:LTUS:510:RAMPDONE_CALC") } record(calc, "QUAD:LTUS:510:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "QUAD:LTUS:510:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "QUAD:LTUS:510:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "QUAD:LTUS:510: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, "QUAD:LTUS:510:RAMPTIME_LEFT") field(OUT, "QUAD:LTUS:510:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "QUAD:LTUS:510:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "QUAD:LTUS:510:RAMPTIME_LEFT NMS") field(OUT, "QUAD:LTUS:510:RAMPDONE PP") } record(bo, "QUAD:LTUS:510:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "QUAD:LTUS:510:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "QUAD:LTUS:510: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, "QUAD:LTUS:510: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(sSub, "QUAD:LTUS:510: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, "QUAD:LTUS:510:PSTYPE.RVAL") field(INPC, "QUAD:LTUS:510:TURNEDOFF.RVAL") field(INPD, "QUAD:LTUS:510:CONFIG.RVAL") field(INPE, "QUAD:LTUS:510:PSCATEGORY.RVAL") field(INPF, "QUAD:LTUS:510:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "QUAD:LTUS:510:AUTOCTRL.RVAL") field(INPJ, "QUAD:LTUS:510:OUTOFSERVICE.RVAL") field(INPL, "QUAD:LTUS:510:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "QUAD:LTUS:510:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "QUAD:LTUS:510:PAU") field(INPP, "QUAD:LTUS:510:CALBDISABLE.RVAL") field(INPQ, "QUAD:LTUS:510:PTRBDISABLE.RVAL") field(INPR, "QUAD:LTUS:510:TRIMDISABLE.RVAL") field(INPS, "QUAD:LTUS:510:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "QUAD:LTUS:510:FBCK") field(INPU, "QUAD:LTUS:510:TRIMTYPE.RVAL") field(INPV, "QUAD:LTUS:510:STDZDIRECT.RVAL") field(INPW, "QUAD:LTUS:510:DEGAUSENABLE.RVAL") field(FLNK, "QUAD:LTUS:510:HSTA") } record(longin, "QUAD:LTUS:510:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "QUAD:LTUS:510:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "QUAD:LTUS:510: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, "QUAD:LTUS:510: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, "QUAD:LTUS:510:CALBDISABLE") { field(DESC, "DAC Calb Disabled") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:510:PTRBDISABLE") { field(DESC, "Perturb Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:510:TRIMDISABLE") { field(DESC, "Trim Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:510:STDZDISABLE") { field(DTYP, "Raw Soft Channel") field(ZNAM, "NO") field(ONAM, "YES") field(DESC, "Standardize Function") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } # This PV has been replaced by QUAD:LTUS:510:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses QUAD:LTUS:510:FBCK. # This PV should be replaced by QUAD:LTUS:510: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, "QUAD:LTUS:510: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, "QUAD:LTUS:510: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, "QUAD:LTUS:510: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, "") field(OMSL, "supervisory") field(FLNK, "QUAD:LTUS:510:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"QUAD:LTUS:510:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "QUAD:LTUS:510:OUTOFSERVICE NPP NMS") field(OUT, "QUAD:LTUS:510:ONLINE PP") } record(bo, "QUAD:LTUS:510:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "QUAD:LTUS:510: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, "1") } record(bo, "QUAD:LTUS:510: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, "1") } record(bo, "QUAD:LTUS:510: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, "QUAD:LTUS:510: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, "QUAD:LTUS:510: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, "QUAD:LTUS:510: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, "QUAD:LTUS:510: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, "QUAD:LTUS:510: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, "1") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:510: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, "1") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:510: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, "2") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:510: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, "0") field(ASG, "NOWRITE") field(FLNK, "QUAD:LTUS:510:TRIMTYPE") } record(stringout, "QUAD:LTUS:510:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "QUAD:LTUS:510:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "QUAD:LTUS:510:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "QUAD:LTUS:510:STATE.RVAL") field(INPB, "QUAD:LTUS:510:INTLKSUMY.RVAL") field(OUT, "QUAD:LTUS:510:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:LTUS:510: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, "QUAD:LTUS:510:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "QUAD:LTUS:510:STATE.RVAL") field(INPB, "QUAD:LTUS:510:INTLKSUMY.RVAL") field(OUT, "QUAD:LTUS:510:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:LTUS:510:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "QUAD:LTUS:510:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "QUAD:LTUS:510: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, "QUAD:LTUS:510:RAMPSTARTDLY") { field(DESC, "Tansition to ramp delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "2") } ######### For PSTYPE=2 Only ############# record(mbbo, "QUAD:LTUS:510: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, "QUAD:LTUS:510: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,"QUAD:LTUS:510: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("QUAD:LTUS:510:TURNEDOFF",3140,1907,0,1,"QUAD:LTUS:510:TURNEDOFF") #! 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, "QUAD:LTUS:540:IACT") { field(DESC, "Current") field(INP, "PSC:LTUS:MG11:IACT") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "QUAD:LTUS:540:BACT") info(autosaveFields,"HYST") } record(bi, "QUAD:LTUS:540:STATE") { field(DESC, "PS On/Off Status") field(DTYP, "Raw Soft Channel") field(INP, "PSC:LTUS:MG11:STATE NPP MS") field(ZSV, "MAJOR") field(ZNAM, "OFF") field(ONAM, "ON") } record(ao, "QUAD:LTUS:540:IDES") { field(DESC, "Desired Current") field(PREC, "3") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(MDEL, "-1") field(HIHI, "200.0") field(LOLO, "0.0") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "QUAD:LTUS:540:BDELTAS") field(DRVH, "200.0") field(DRVL, "0.0") field(DOL, "QUAD:LTUS:540: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, "QUAD:LTUS:540:ICTRL PP") } # This record is processed by QUAD:LTUS:540:ICON") # Note: we are not setting alarms here. record(ao, "QUAD:LTUS:540:ICON") { field(DESC, "Config I") field(DTYP, "Soft Channel") field(PREC, "3") field(HOPR, "200.0") field(LOPR, "0.0") field(DRVH, "200.0") field(DRVL, "0.0") field(DOL, "QUAD:LTUS:540:B2ICON.K") field(OMSL, "closed_loop") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:540:INOM") { field(DESC, "Nominal Current") field(DOL, "QUAD:LTUS:540:BNOM.K") field(OMSL, "closed_loop") field(PREC, "3") field(EGU, "A") field(DRVH, "200.0") field(DRVL, "0.0") field(HOPR, "200.0") field(LOPR, "0.0") } record(ao, "QUAD:LTUS:540:ICTRL") { field(DESC, "Set Current") field(PREC, "3") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(DRVH, "200.0") field(DRVL, "0.0") field(MDEL, "-1") field(FLNK, "QUAD:LTUS:540:ICTRLGO") field(OMSL, "supervisory") info(autosavefields,"VAL") } record(seq, "QUAD:LTUS:540:ICTRLGO") { field(DESC, "Process Current Setpoint") field(PREC, "3") # Set ISETPT to supervisory field(DOL1, "0") field(LNK1, "QUAD:LTUS:540:ISETPT.OMSL") field(DOL2, "QUAD:LTUS:540:ICTRL") field(LNK2, "QUAD:LTUS:540:ISETPT PP") # Set ISETPT to closed loop - get data from BCTRLSUB.K field(DOL3, "1") field(LNK3, "QUAD:LTUS:540:ISETPT.OMSL") } record(ao, "QUAD:LTUS:540:IMAX") { field(DESC, "Max I") field(DTYP, "Soft Channel") field(DRVH, "200.0") field(DRVL, "0.0") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(PREC, "3") field(PINI, "YES") field(VAL, "200.0") field(FLNK, "QUAD:LTUS:540:IMIN") } record(ao, "QUAD:LTUS:540:IMIN") { field(DESC, "Min I") field(DTYP, "Soft Channel") field(DRVH, "200.0") field(DRVL, "0.0") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(PREC, "3") field(VAL, "0.0") field(FLNK, "QUAD:LTUS:540:IRANGE") } record(sel, "QUAD:LTUS:540:IACTPREVOK") { field(DESC, "Last Good Current") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(PREC, "3") field(NVL, "QUAD:LTUS:540:BACT.SEVR") field(INPA, "QUAD:LTUS:540:IACT NPP MS") field(INPB, "QUAD:LTUS:540:IACTPREVOK NPP MS") field(INPC, "QUAD:LTUS:540:IACTPREVOK NPP MS") field(INPD, "QUAD:LTUS:540:IACTPREVOK NPP MS") } record(sub, "QUAD:LTUS:540:IACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:540:IDES") field(INPB, "QUAD:LTUS:540:ISETPT.DRVH") field(INPC, "QUAD:LTUS:540:ISETPT.DRVL") field(INPD, "QUAD:LTUS:540:IDELTAS.I") field(INPE, "QUAD:LTUS:540:IDELTAS.J") field(INPG, "QUAD:LTUS:540:STATE") field(INPH, "QUAD:LTUS:540:HSTA") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(sub, "QUAD:LTUS:540:IMONLIMITS") { field(DESC, "Aux Current Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:540:IDES") field(INPB, "QUAD:LTUS:540:ISETPT.DRVH") field(INPC, "QUAD:LTUS:540:ISETPT.DRVL") field(INPD, "QUAD:LTUS:540:IDELTAS.K") field(INPE, "QUAD:LTUS:540:IDELTAS.L") field(INPG, "QUAD:LTUS:540:STATE") field(INPH, "QUAD:LTUS:540:HSTA") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(seq, "QUAD:LTUS:540:ILIMITS") { field(DESC, "Set ACT and MON Limits") field(PREC, "3") field(DOL1, "QUAD:LTUS:540:BLIMITS") field(LNK1, "QUAD:LTUS:540:IACTLIMITS.F PP") field(DOL2, "QUAD:LTUS:540:IACTLIMITS.I") field(LNK2, "QUAD:LTUS:540:IACT.HIGH") field(DOL3, "QUAD:LTUS:540:IACTLIMITS.J") field(LNK3, "QUAD:LTUS:540:IACT.LOW") field(DOL4, "QUAD:LTUS:540:IACTLIMITS.K") field(LNK4, "QUAD:LTUS:540:IACT.HIHI") field(DOL5, "QUAD:LTUS:540:IACTLIMITS.L") field(LNK5, "QUAD:LTUS:540:IACT.LOLO") field(DOL6, "QUAD:LTUS:540:BLIMITS") field(LNK6, "QUAD:LTUS:540:IMONLIMITS.F PP") field(DOL7, "QUAD:LTUS:540:IMONLIMITS.I") field(LNK7, "QUAD:LTUS:540:IMON.HIGH") field(DOL8, "QUAD:LTUS:540:IMONLIMITS.J") field(LNK8, "QUAD:LTUS:540:IMON.LOW") field(DOL9, "QUAD:LTUS:540:IMONLIMITS.K") field(LNK9, "QUAD:LTUS:540:IMON.HIHI") field(DOLA, "QUAD:LTUS:540:IMONLIMITS.L") field(LNKA, "QUAD:LTUS:540: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, "QUAD:LTUS:540:IDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntRawDeltas") field(INPD, "QUAD:LTUS:540:TRIMBTOL") field(INPE, "QUAD:LTUS:540:CHCKBTOL") field(INPF, "QUAD:LTUS:540:BDELTAS.K") field(INPG, "QUAD:LTUS:540:BDELTAS.L") field(INPH, "QUAD:LTUS:540: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, "QUAD:LTUS:540:STDZITOLR") field(INPC, "QUAD:LTUS:540:STDZITOL") field(FLNK, "") } # All ps controllers with on/off control will set the macro ONOF # as follows: # # ONOF = PSC:LTUS:MG11: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, "QUAD:LTUS:540:STATESETPT") { field(DESC, "PS On/Off") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFF") field(ONAM, "ON") field(OUT, "PSC:LTUS:MG11:STATESETPT PP") 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 = PSC:LTUS:MG11:RESET PP # record(bo, "QUAD:LTUS:540:RESET") { field(DESC, "Interlock Latch Reset") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFF") field(ONAM, "ON") field(HIGH, "1.0") field(OUT, "PSC:LTUS:MG11:RESET PP") } record(bo, "QUAD:LTUS:540:RAMPSTATE") { field(DESC, "PS Ramp Status") field(DTYP, "Soft Channel") field(DOL, "PSC:LTUS:MG11:RAMPSTATE NPP 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, "QUAD:LTUS:540: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, "QUAD:LTUS:540:TRIMRAMPRATE") field(OUT, "PSC:LTUS:MG11:IRAMPRATE PP") field(FLNK, "QUAD:LTUS:540:STDZDLY") } record(ao, "QUAD:LTUS:540:ISETPT") { field(DESC, "Current Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(DRVH, "200.0") field(DRVL, "0.0") field(MDEL, "-1") field(OUT, "PSC:LTUS:MG11:ISETPT PP") field(DOL, "QUAD:LTUS:540: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, "QUAD:LTUS:540:IMON") { field(DESC, "Aux Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(INP, "PSC:LTUS:MG11:IMON") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "QUAD:LTUS:540:BMON") } record(ao, "QUAD:LTUS:540:IRIPL") { field(DESC, "Ripple Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(DOL, "PSC:LTUS:MG11:IRIPL NPP NMS") field(OMSL, "closed_loop") field(EGU, "A") field(DRVH, "1.0") field(HOPR, "1.0") field(PREC, "3") field(FLNK, "QUAD:LTUS:540:IRIPLOK") } record(sub, "QUAD:LTUS:540:IRIPLOK") { field(DESC, "Ripple Current Status") field(INAM, "mgntInit") field(SNAM, "mgntRiplOK") field(INPA, "QUAD:LTUS:540:IRIPL.VAL") field(INPB, "QUAD:LTUS:540: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, "QUAD:LTUS:540:R") { field(DESC, "Resistance") field(EGU, "Ohms") field(PREC, "4") field(PINI, "YES") field(DOL, "PSC:LTUS:MG11:R NPP MS") 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, "QUAD:LTUS:540:IGND") { field(DESC, "Ground Current") field(EGU, "A") field(PREC, "6") field(PINI, "YES") field(DOL, "PSC:LTUS:MG11:IGND NPP MS") field(OMSL, "closed_loop") } record(bi, "QUAD:LTUS:540:INTLKSUMY") { field(DESC, "Interlock Summary") field(INP, "PSC:LTUS:MG11:INTLKSUMY NPP MS") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(ZNAM, "OK") field(ONAM, "FAULT") field(PINI, "NO") } record(mbbo, "QUAD:LTUS:540: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, "PSC:LTUS:MG11:COOLING") field(OMSL, "closed_loop") } # The following PV is processed by :BACTFO # which is processed by :BACT record(fanout, "QUAD:LTUS:540:IACTFO") { field(DESC, "IACT processing") field(SELM, "All") field(LNK1, "QUAD:LTUS:540:IACTPREVOK") field(LNK2, "QUAD:LTUS:540:IDIFF") field(LNK3, "QUAD:LTUS:540:IADIFF") field(LNK4, "QUAD:LTUS:540:IRATIO") field(LNK5, "QUAD:LTUS:540:IDIRECT") field(LNK6, "QUAD:LTUS:540:IACTPOL_CHECK") } record(calc, "QUAD:LTUS:540:IDIFF") { field(DESC, "IDES-IACT") field(CALC, "A-B") field(INPA, "QUAD:LTUS:540:IDES") field(INPB, "QUAD:LTUS:540:IACT") field(EGU, "A") field(PREC, "9") field(HOPR, "200.0") field(LOPR, "0.0") } record(calc, "QUAD:LTUS:540:IADIFF") { field(DESC, "Absolute IDES-IACT") field(CALC, "A<0?ABS(A):A") field(INPA, "QUAD:LTUS:540:IDIFF") field(PREC, "9") } record(calc, "QUAD:LTUS:540:IRATIO") { field(DESC, "IDES-IACT/IMAX") field(CALC, "B?A/B:0") field(INPA, "QUAD:LTUS:540:IDIFF") field(INPB, "QUAD:LTUS:540:IDES.DRVH") field(PREC, "9") } record(calcout, "QUAD:LTUS:540:IRANGE") { field(DESC, "Current Range") field(PINI, "YES") field(CALC, "ABS(A-B)") field(INPA, "QUAD:LTUS:540:IMIN") field(INPB, "QUAD:LTUS:540: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, "QUAD:LTUS:540: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, "QUAD:LTUS:540:IACT") field(FLNK, "QUAD:LTUS:540:IACTPOL") } record(bo, "QUAD:LTUS:540:IACTPOL") { field(DESC, "Actual I Polarity") field(DTYP, "Raw Soft Channel") field(DOL, "QUAD:LTUS:540: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,"QUAD:LTUS:540:I*LIMITS:\n Calculate alarm and warning limits based on \n deltas from QUAD:LTUS:540:IDELTAS and the\n QUAD:LTUS:540: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,"QUAD:LTUS:540:IACT: \n Get copy of QUAD:LTUS:540:I. \n",null) #! TextBox(TB12,1280,3100,1760,3200,0,"Dialog",12,1,16777215,"QUAD:LTUS:540: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,"QUAD:LTUS:540:IDES:\n Contains raw value calculated by \nQUAD:LTUS:540: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 \nQUAD:LTUS:540:BDELTAS.\n",null) #! TextBox(TB10,56,1940,316,2340,0,"Dialog",12,1,16777215,"QUAD:LTUS:540: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 QUAD:LTUS:540: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 QUAD:LTUS:540: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,"QUAD:LTUS:540:ISETPT:\n Sets the hardware. When fast feedback is set on, this record is\n set to closed loop mode by QUAD:LTUS:540:FBCKSTART sequence. When \n the loop is closed, this record takes input calculated by \n BFBCK only. When fast feedback is set off, QUAD:LTUS:540:FBCKSTOP \n will set it back to supervisory so that the value can be set by \n QUAD:LTUS:540: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, "QUAD:LTUS:540:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:540:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "QUAD:LTUS:540:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "QUAD:LTUS:540:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "QUAD:LTUS:540:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "QUAD:LTUS:540:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "1") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "QUAD:LTUS:540: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, "QUAD:LTUS:540:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "QUAD:LTUS:540:TRIMTYPE.RVAL") field(INPB, "QUAD:LTUS:540:CONFIG.RVAL") field(OUT, "QUAD:LTUS:540:TRIMMAXNUM PP") } record(longout, "QUAD:LTUS:540: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, "QUAD:LTUS:540: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, "") field(OMSL, "supervisory") field(VAL, "10") field(OUT, "QUAD:LTUS:540:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "QUAD:LTUS:540: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, "") field(OMSL, "supervisory") field(VAL, "10") } record(bo, "QUAD:LTUS:540: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, "QUAD:LTUS:540: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, "QUAD:LTUS:540: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, "QUAD:LTUS:540:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "0") } record(ao, "QUAD:LTUS:540: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, "QUAD:LTUS:540:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "QUAD:LTUS:540: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, "QUAD:LTUS:540: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, "QUAD:LTUS:540:IMOVE") field(INPB, "QUAD:LTUS:540:IACT") field(INPC, "QUAD:LTUS:540:IRAMPRATE") field(INPD, "1.577") field(INPE, "QUAD:LTUS:540:TRIMDLYPCT") field(INPF, "QUAD:LTUS:540:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "QUAD:LTUS:540:RAMPTIME_LEFT PP") } record(longout, "QUAD:LTUS:540:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "QUAD:LTUS:540:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "QUAD:LTUS:540:RAMPDONE_CALC") } record(calc, "QUAD:LTUS:540:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "QUAD:LTUS:540:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "QUAD:LTUS:540:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "QUAD:LTUS:540: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, "QUAD:LTUS:540:RAMPTIME_LEFT") field(OUT, "QUAD:LTUS:540:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "QUAD:LTUS:540:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "QUAD:LTUS:540:RAMPTIME_LEFT NMS") field(OUT, "QUAD:LTUS:540:RAMPDONE PP") } record(bo, "QUAD:LTUS:540:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "QUAD:LTUS:540:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "QUAD:LTUS:540: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, "QUAD:LTUS:540: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, "QUAD:LTUS:540:STDZINIT") { field(DESC, "Proc. Stdz PVs on boot") field(PINI, "YES") field(DOL1, "1") field(DOL2, "1") field(DOL3, "1") field(LNK1, "QUAD:LTUS:540:DEBUG.PROC PP") field(LNK2, "QUAD:LTUS:540:STDZCYCLENUM.PROC PP") field(LNK3, "QUAD:LTUS:540:STDZDISABLE.PROC PP") field(LNK4, "QUAD:LTUS:540: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, "QUAD:LTUS:540:STDZSUB") { field(DESC, "Stdz subroutine") field(INAM, "mgntStdzInit") field(SNAM, "mgntStdz") field(BRSV, "INVALID") field(INPA, "QUAD:LTUS:540:STDZIMIN NPP NMS") field(INPB, "QUAD:LTUS:540:STDZIMAX NPP NMS") field(INPC, "QUAD:LTUS:540:STDZIFINAL NPP NMS") field(INPD, "QUAD:LTUS:540:STDZCYCLENUM NPP NMS") field(INPE, "QUAD:LTUS:540:STDZDIRECT.RVAL NPP NMS") field(INPF, "QUAD:LTUS:540:STDZDISABLE.RVAL CPP NMS") field(INPG, "QUAD:LTUS:540: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, "QUAD:LTUS:540:STDZWF PP") field(OUTB, "QUAD:LTUS:540: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, "QUAD:LTUS:540:STDZWF") } record(mbbo, "QUAD:LTUS:540: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, "QUAD:LTUS:540: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, "QUAD:LTUS:540:STDZMAINPS") { field(DESC, "Stdz by main or self") field(PINI, "YES") field(DTYP, "Soft Channel") field(ZNAM, "SELF") field(ONAM, "MAIN") } record(bo, "QUAD:LTUS:540: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, "QUAD:LTUS:540: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, "QUAD:LTUS:540: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, "QUAD:LTUS:540:STDZTOD") { field(DESC, "Successful Standardize Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "QUAD:LTUS:540:STDZLOSTTOD") { field(DESC, "Standardize Lost Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(longout, "QUAD:LTUS:540:STDZCYCLECNT") { field(DESC, "Cycle Count") field(PINI, "YES") } record(longout, "QUAD:LTUS:540:STDZCYCLENUM") { field(DESC, "No. Standardize Cycles") field(VAL, "3") field(HOPR, "10") field(LOPR, "0") field(DRVH, "10") field(DRVL, "0") field(PINI, "YES") field(FLNK, "QUAD:LTUS:540:STDZDIRECT") } # The default standardize direction is "UP" for # all LCLS Magnets.. record(bo, "QUAD:LTUS:540:STDZDIRECT") { field(DESC, "Standardize Direction ") field(ZNAM, "UP") field(ONAM, "DOWN") field(VAL, "0") field(FLNK, "QUAD:LTUS:540:STDZIMIN") } record(ao, "QUAD:LTUS:540:STDZIMIN") { field(DESC, "Min-STDZ Current") field(PREC, "1") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(VAL, "0.0") field(FLNK, "QUAD:LTUS:540:STDZIMAX") } record(ao, "QUAD:LTUS:540:STDZIMAX") { field(DESC, "Max. Standarize Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(VAL, "200.0") field(FLNK, "QUAD:LTUS:540:STDZIFINAL") } record(ao, "QUAD:LTUS:540:STDZIFINAL") { field(DESC, "Final SDTZ Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(VAL, "0.0") field(FLNK, "QUAD:LTUS:540: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, "QUAD:LTUS:540: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, "QUAD:LTUS:540:STDZITOL") { field(DESC, "Stdz min tolerance") field(PREC, "5") field(CALC, "MAX(ABS(A),ABS(B))*C") field(INPA, "QUAD:LTUS:540:STDZIMIN CP NMS") field(INPB, "QUAD:LTUS:540:STDZIMAX CP MMS") field(INPC, "0.05") field(INPD, "QUAD:LTUS:540:STDZITOLR CP MMS") field(EGU, "A") field(FLNK, "QUAD:LTUS:540:IDELTAS") field(PINI, "YES") } # D - factor (3.154/2 = 1.577) for EPSC, otherwise, set to 1.0 record(calc, "QUAD:LTUS:540:STDZDLY") { field(DESC, "Ramp time for stdz cycle") field(CALC, "C>0?MAX(1,ABS((A-B)/C)*D):0") field(INPA, "QUAD:LTUS:540:STDZIMIN CP NMS") field(INPB, "QUAD:LTUS:540:STDZIMAX CP NMS") field(INPC, "QUAD:LTUS:540:TRIMRAMPRATE CP NMS") field(INPD, "1.577") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") } record(calc, "QUAD:LTUS:540:STDZRAMPDLY") { field(DESC, "Ramp delay total") field(CALC, "MAX(1,((A/100)*B+B))") field(PREC, "5") field(INPA, "QUAD:LTUS:540:TRIMDLYPCT CP MS") field(INPB, "QUAD:LTUS:540: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, "QUAD:LTUS:540:STDZMINIDLY") { field(DESC, "Mini-stdz delay") field(CALC, "A") field(PREC, "5") field(A, "1.0") field(EGU, "sec") field(PINI, "YES") } record(ao, "QUAD:LTUS:540: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, "QUAD:LTUS:540:STDZMINIDELTA") { field(DESC, "Stdz mini % of IMAX") field(CALC, "(B/100)*(A-C)") field(INPA, "QUAD:LTUS:540:IDES.HOPR") field(INPB, "QUAD:LTUS:540:STDZMINIPCT CPP NMS") field(INPC, "QUAD:LTUS:540:IDES.LOPR") field(PREC, "5") } record(calc, "QUAD:LTUS:540:STDZMINISETPT") { field(DESC, "Mini Stdz delta") field(CALC, "C==0?MAX(E-D,B):MIN(E+D,A)") field(INPA, "QUAD:LTUS:540:IDES.HOPR") field(INPB, "QUAD:LTUS:540:IDES.LOPR") field(INPC, "QUAD:LTUS:540:STDZDIRECT.RVAL") field(INPD, "QUAD:LTUS:540:STDZMINIDELTA") field(INPE, "QUAD:LTUS:540:IDES") field(PREC, "5") field(FLNK, "QUAD:LTUS:540: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, "QUAD:LTUS:540:STDZMINISETPTOOR") { field(DESC, "Mini Stdz setpoint out of range") field(CALC, "C==0?(E-DA)") field(INPA, "QUAD:LTUS:540:IDES.HOPR") field(INPB, "QUAD:LTUS:540:IDES.LOPR") field(INPC, "QUAD:LTUS:540:STDZDIRECT.RVAL") field(INPD, "QUAD:LTUS:540:STDZMINIDELTA") field(INPE, "QUAD:LTUS:540: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, "QUAD:LTUS:540: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, "QUAD:LTUS:540:IADJUST.RVAL") field(INPB, "QUAD:LTUS:540:STDZDIRECT.RVAL") field(INPC, "QUAD:LTUS:540:STDZOK.RVAL") field(INPD, "QUAD:LTUS:540:STDZDISABLE.RVAL") field(INPE, "QUAD:LTUS:540:STATE.RVAL CPP NMS") field(INPF, "QUAD:LTUS:540:ICTRL.RVAL") field(INPG, "QUAD:LTUS:540:STATE.SEVR") field(INPH, "QUAD:LTUS:540:BDELTAS.M") field(INPI, "QUAD:LTUS:540:IACT.SEVR") field(OUT, "QUAD:LTUS:540:STDZLOSTGO.SELN PP NMS") field(OOPT, "Transition To Non-zero") } record(seq, "QUAD:LTUS:540:STDZLOSTGO") { field(DESC, "Process lost stdz") field(SELM, "Mask") field(DOL1, "1") field(DOL2, "0") field(LNK1, "QUAD:LTUS:540:STDZLOSTTOD.PROC") field(LNK2, "QUAD:LTUS:540:STDZOK PP") } # Record maximum current after standardize # Reset to IACT from sequence after trim # Disable processing during (mini-)standardize or trim record(calc, "QUAD:LTUS:540:STDZIACTMAX") { field(DESC, "Max act current after stdz") field(CALC, "MAX(A, B)") field(DISV, "0") field(SDIS, "QUAD:LTUS:540:CHECKPWRDIP_ENABLE") field(INPA, "QUAD:LTUS:540:IACT CP") field(INPB, "QUAD:LTUS:540:STDZIACTMAX") field(EGU, "A") field(FLNK, "QUAD:LTUS:540:CHECKPWRDIP") } # Detect power dip if STDZOK is YES, STDZ is enabled, and IACT is valid # If IACT drops below STDZIACTMAX by more than the trim tolerance, clear STDZOK # Warning: Take the absolute value of the trim tolerance, or else quads of # negative polarity will always lose STDZ since their IDELTAS.I are negative. # Note: Large quads and bends are prone to losing STDZ even if they are # perturbed toward higher current since their current tends to overshoot # by greater than the trim tolerance before settling down. record(calcout, "QUAD:LTUS:540:CHECKPWRDIP") { field(DESC, "Detect power dip") field(CALC, "(A-B>ABS(C))?3:0") field(DISV, "0") field(SDIS, "QUAD:LTUS:540:CHECKPWRDIP_ENABLE") field(INPA, "QUAD:LTUS:540:STDZIACTMAX") field(INPB, "QUAD:LTUS:540:IACT") field(INPC, "QUAD:LTUS:540:IDELTAS.I") field(OUT, "QUAD:LTUS:540:STDZLOSTGO.SELN PP NMS") field(OOPT, "When Non-zero") } # Enable processing of STDZIACTMAX and CHECKPWRDIP only if # STDZOK = YES, STDZDISABLE = NO, CTRL != Trim (2), and # CTRL != Stdz (4) record(calc, "QUAD:LTUS:540:CHECKPWRDIP_ENABLE") { field(CALC, "A&&!B&&(C#2)&&(C#4)") field(INPA, "QUAD:LTUS:540:STDZOK.RVAL CP") field(INPB, "QUAD:LTUS:540:STDZDISABLE.RVAL CP") field(INPC, "QUAD:LTUS:540:CTRL.RVAL CP") } #! 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, "QUAD:LTUS:540: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, "QUAD:LTUS:540:CALBOK") { field(DESC, "Successful Calibration") field(DTYP, "Raw Soft Channel") field(ZNAM, "NO") field(ONAM, "YES") field(DOL, "PSC:LTUS:MG11:CALBOK.RVAL") field(OMSL, "closed_loop") 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, "QUAD:LTUS:540:CALBSET") { field(DESC, "Use DAC Calbration") field(SCAN, "10 second") field(CALC, "A&&(B==0)&&C?31:960") field(INPA, "QUAD:LTUS:540:CALBOK") field(INPB, "QUAD:LTUS:540:CALBDISABLE") field(INPC, "QUAD:LTUS:540:CALBSLOPE") field(OOPT, "On Change") field(OUT, "QUAD:LTUS:540: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, "QUAD:LTUS:540:CALB_SEQ") { field(DESC, "Output Calib Values") field(SELM, "Mask") field(SELL, "QUAD:LTUS:540: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, "QUAD:LTUS:540:CALBSLOPE") field(DOL3, "QUAD:LTUS:540: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, "QUAD:LTUS:540:CALBTOD") { field(DESC, "Calibration Success Time") field(PINI, "YES") field(DOL, "PSC:LTUS:MG11:CALBTOD") field(OMSL, "closed_loop") field(DTYP, "Soft Channel") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:540: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, "QUAD:LTUS:540: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, "QUAD:LTUS:540: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, "QUAD:LTUS:540:CALBOFFSET") { field(DESC, "Calc DAC Offset") field(PREC, "6") field(EGU, "Counts") field(PINI, "YES") } record(bo, "QUAD:LTUS:540: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, "QUAD:LTUS:540:DACSLOPE") { field(DESC, "V to DAC slope") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "closed_loop") field(PINI, "YES") field(FLNK, "QUAD:LTUS:540:DACOFFSET") } # Default Offset used in conversion from Volts to DAC Counts record(ao, "QUAD:LTUS:540:DACOFFSET") { field(DESC, "V to DAC offset") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "closed_loop") field(PINI, "YES") field(FLNK, "QUAD:LTUS:540: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, "QUAD:LTUS:540: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, "QUAD:LTUS:540:IACT") field(INPD, "QUAD:LTUS:540:DACSLOPE") field(INPE, "QUAD:LTUS:540:DACOFFSET") field(EGU, "Counts") field(PREC, "6") } record(ao, "QUAD:LTUS:540:DAC") { field(DESC, "DAC Set point") field(EGU, "Counts") field(DOL, "") field(OMSL, "closed_loop") field(PREC, "6") field(PINI, "YES") } record(ao, "QUAD:LTUS:540:CALBIMIN") { field(DESC, "Calibration Min Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(DRVH, "200.0") field(HOPR, "200.0") field(DRVL, "0.0") field(LOPR, "0.0") field(PREC, "3") field(EGU, "A") field(VAL, "0.0") field(FLNK, "QUAD:LTUS:540:CALBIMAX") } record(ao, "QUAD:LTUS:540:CALBIMAX") { field(DESC, "Calibration Max Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(DRVH, "200.0") field(HOPR, "200.0") field(LOPR, "0.0") field(DRVL, "0.0") field(EGU, "A") field(VAL, "200.0") field(FLNK, "QUAD:LTUS:540:CALBSTEPNUM") } record(ao, "QUAD:LTUS:540:CALBIFINAL") { field(DESC, "Calibration Last Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(PREC, "3") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(VAL, "0") } record(longout, "QUAD:LTUS:540: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, "QUAD:LTUS:540:CALBIDELTA") } record(calc, "QUAD:LTUS:540:CALBIDELTA") { field(DESC, "Step size for CALB") field(CALC, "C=0?0:ABS((A-B)/C)") field(INPA, "QUAD:LTUS:540:CALBIMAX") field(INPB, "QUAD:LTUS:540:CALBIMIN") field(INPC, "QUAD:LTUS:540: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, "QUAD:LTUS:540:CALBIMULT") { field(DESC, "IACT vs ISETPT mult") field(CALC, "C#0||A=0?1:ABS(B/A)") field(INPA, "PSC:LTUS:MG11:ISETPT.DRVH") field(INPB, "PSC:LTUS:MG11:IACT.HOPR") field(INPC, "QUAD:LTUS:540:PSCONTROLLER.RVAL CPP") field(EGU, "A") field(PINI, "YES") } # SNL dbputs DAC values here. 6-10 steps are possible. record(waveform, "QUAD:LTUS:540:CALBICTRLWF") { field(DESC, "ICTRL setpoint array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") } record(waveform, "QUAD:LTUS:540:DACWF") { field(DESC, "DAC count array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:540:DACSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:540:DACSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "QUAD:LTUS:540: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, "QUAD:LTUS:540:CALCDACWF") { field(DESC, "Calc DAC counts array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:540:CALCDACSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:540:CALCDACSA") { field(DESC, "Calc DAC counts") field(DTYP, "Soft Channel") field(INP, "QUAD:LTUS:540: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, "QUAD:LTUS:540:CALBYWF") { field(DESC, "mx + b") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:540:CALBYSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:540:CALBYSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "QUAD:LTUS:540:CALBYWF") field(MALM, "10") field(NELM, "6") field(INDX, "0") field(FTVL, "DOUBLE") } record(waveform, "QUAD:LTUS:540:CALBIACTWF") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:540:CALBIACTSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:540:CALBIACTSA") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(MALM, "10") field(NELM, "6") field(INP, "QUAD:LTUS:540:CALBIACTWF") field(INDX, "0") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:540:CALBLIMITS") } # Check that measured current during calibration is within # tolerance. record(aSub, "QUAD:LTUS:540: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, "QUAD:LTUS:540:CALBSTEPNUM") field(INPB, "QUAD:LTUS:540:CALBIACTWF") field(INPC, "QUAD:LTUS:540: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, "QUAD:LTUS:540: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, "QUAD:LTUS:540:STDZITOL") field(INPH, "QUAD:LTUS:540:DACSLOPE") field(INPI, "QUAD:LTUS:540: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, "QUAD:LTUS:540: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, "QUAD:LTUS:540:CALBSTEPNUM") field(INPB, "QUAD:LTUS:540:CALBIACTWF") field(INPC, "QUAD:LTUS:540:DACWF") field(INPF, "QUAD:LTUS:540: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 QUAD:LTUS:540CALBOK 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, "QUAD:LTUS:540:DEGAUSINIT") { field(DESC, "Proc. Degauss PVs on boot") field(PINI, "YES") field(DOL, "1") field(OUTA, "QUAD:LTUS:540:DEGAUSIMIN.PROC PP") field(OUTB, "QUAD:LTUS:540:DEGAUSIMAX.PROC PP") field(OUTC, "QUAD:LTUS:540:DEGAUSTYPE.PROC PP") field(OUTD, "QUAD:LTUS:540:DEGAUSSTEP.PROC PP") field(OUTE, "QUAD:LTUS:540:MADNAME.PROC PP") field(OUTF, "QUAD:LTUS:540:PSTYPE.PROC PP") field(OUTG, "QUAD:LTUS:540: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, "QUAD:LTUS:540:DEGAUSSUB") { field(DESC, "Degauss subroutine") field(INAM, "mgntDegaussInit") field(SNAM, "mgntDegauss") field(BRSV, "INVALID") field(INPA, "QUAD:LTUS:540:DEGAUSIMIN NPP NMS") field(INPB, "QUAD:LTUS:540:DEGAUSIMAX NPP NMS") field(INPC, "QUAD:LTUS:540:DEGAUSTYPE.RVAL NPP NMS") field(INPE, "QUAD:LTUS:540:DEGAUSMETHOD.RVAL NPP NMS") field(INPF, "QUAD:LTUS:540:PSTYPE NPP NMS") field(INPG, "QUAD:LTUS:540:DEBUG.RVAL NPP NMS") field(INPH, "QUAD:LTUS:540: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, "QUAD:LTUS:540:DEGAUSWF PP") field(OUTB, "QUAD:LTUS:540:DEGAUSMSG PP") field(OUTC, "QUAD:LTUS:540: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, "QUAD:LTUS:540:DEGAUSWF") { field(DESC, "Degauss Setpts") field(NELM, "60") field(FTVL, "DOUBLE") } record(mbbo,"QUAD:LTUS:540: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, "QUAD:LTUS:540: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, "QUAD:LTUS:540: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, "QUAD:LTUS:540: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, "QUAD:LTUS:540: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, "QUAD:LTUS:540:DEGAUSIMIN") { field(DESC, "Min. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "200.0") field(LOPR, "-200.0") field(DRVH, "200.0") field(DRVL, "-200.0") field(VAL, "-200.0") } record(ao, "QUAD:LTUS:540:DEGAUSIMAX") { field(DESC, "Max. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "200.0") field(LOPR, "-200.0") field(DRVH, "200.0") field(DRVL, "-200.0") field(VAL, "200.0") } # 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,"QUAD:LTUS:540: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, "QUAD:LTUS:540: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,"QUAD:LTUS:540: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, "QUAD:LTUS:540: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, "QUAD:LTUS:540: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, "QUAD:LTUS:540: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, "QUAD:LTUS:540:DEGAUSTOD") { field(DESC, "Successful Degauss Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "QUAD:LTUS:540:DEGAUSLOSTTOD") { field(DESC, "Degauss Lost Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:540:DEGAUSTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "QUAD:LTUS:540:DEGAUSTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "QUAD:LTUS:540: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, "QUAD:LTUS:540:DEGAUSGO") { field(DESC, "Set bdes of btrms to zero") field(ASG, "Internal") field(OUTA, "") field(OUTB, "") field(OUTC, "") field(OUTD, "") } # =========== CRYO ONLY =========== record(bo, "QUAD:LTUS:540: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, "QUAD:LTUS:540:DEGAUS_IMAX_CHECK") { field(DESC, "Check if imax shoud chg") field(CALC, "(C==4)&&(ABS(B)>ABS(A))?1:0") field(INPA, "QUAD:LTUS:540:DEGAUS_IMAX") field(INPB, "QUAD:LTUS:540:ISETPT") field(INPC, "QUAD:LTUS:540:DEGAUSTYPE.RVAL") field(OUT, "QUAD:LTUS:540:DEGAUS_IMAX_UPDATE.SELN") field(FLNK, "QUAD:LTUS:540:DEGAUS_IMAX_UPDATE") } record(seq, "QUAD:LTUS:540:DEGAUS_IMAX_UPDATE") { field(DESC, "Degauss IMAX Update") field(SELM, "Specified") field(DOL1, "QUAD:LTUS:540:ISETPT") field(LNK1, "QUAD:LTUS:540:DEGAUS_IMAX PP") } # Set the maximum current after a successful # degauss. This pv is updated by the # sequence. record(ao, "QUAD:LTUS:540:DEGAUS_IMAX") { field(DESC, "Max I set afer a degauss") field(EGU, "Amps") field(PINI, "YES") field(PREC, "6") field(HOPR, "200.0") field(LOPR, "-200.0") field(DRVH, "200.0") field(DRVL, "-200.0") field(VAL, "200.0") field(FLNK, "QUAD:LTUS:540:DEGAUS_IMAXPOL_CHECK") info(autosaveFields,"VAL,RVAL") } # Set the polarity if degauss_imax record(calcout, "QUAD:LTUS:540:DEGAUS_IMAXPOL_CHECK") { field(DESC, "Determine polarity of imax") field(CALC, "A>=0?0:1") field(INPA, "QUAD:LTUS:540:DEGAUS_IMAX") field(FLNK, "QUAD:LTUS:540:DEGAUS_IMAXPOL") } record(bo, "QUAD:LTUS:540:DEGAUS_IMAXPOL") { field(DESC, "Polarity of imax I") field(DTYP, "Raw Soft Channel") field(DOL, "QUAD:LTUS:540:DEGAUS_IMAXPOL_CHECK") field(OMSL, "closed_loop") field(ZNAM, "Positive") field(ONAM, "Negative") field(FLNK, "QUAD:LTUS:540: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, "QUAD:LTUS:540:DEGAUS_ABSIMAX") { field(DESC, "Absolute Max. Degauss I") field(CALC, "ABS(A)") field(INPA, "QUAD:LTUS:540:DEGAUS_IMAX") field(PREC, "6") field(EGU, "Amps") field(HOPR, "200.0") field(LOPR, "-200.0") info(autosaveFields,"VAL RVAL") } # IACT Polarity record(calcout, "QUAD:LTUS:540:IACTPOL_CHECK") { field(DESC, "Determine IACT polarity") field(SCAN, "5 second") field(CALC, "ABS(A-B)>C?(A>=0?0:1):D") field(INPA, "QUAD:LTUS:540:IACT") field(INPB, "QUAD:LTUS:540:IACTPOL_CHECK.LA") field(INPC, "0.0001") field(INPD, "QUAD:LTUS:540:IACTPOL_CHECK.PVAL") field(OOPT, "On Change") field(FLNK, "QUAD:LTUS:540:IACTPOL") } record(bo, "QUAD:LTUS:540: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,"QUAD:LTUS:540: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, "QUAD:LTUS:540:DEGAUSENABLE CP") field(INPB, "QUAD:LTUS:540:DEGAUSOK") field(INPC, "QUAD:LTUS:540:STATE CP") field(INPD, "QUAD:LTUS:540:STATE.SEVR") field(OUT, "QUAD:LTUS:540:DEGAUS_STATE_SEQ.SELN PP") field(ASG, "Internal") } record(seq, "QUAD:LTUS:540:DEGAUS_STATE_SEQ") { field(DESC, "Degauss State Sequence") field(SELM, "Specified") field(SELL, "QUAD:LTUS:540:DEGAUS_STATE_CHECK") field(LNK1, "QUAD:LTUS:540:DEGAUS_STATE_DISABLE.PROC PP") field(LNK2, "QUAD:LTUS:540:DEGAUS_STATE_LOST.PROC PP") field(LNK3, "QUAD:LTUS:540:DEGAUS_STATE_GOOD.PROC PP") field(LNK4, "QUAD:LTUS:540: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, "QUAD:LTUS:540:DEGAUS_STATE_DISABLE") { field(DESC, "Degauss not used") field(LNK1, "QUAD:LTUS:540:DEGAUSOK.ZSV") field(LNK2, "QUAD:LTUS:540: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, "QUAD:LTUS:540:STATMSG.FRSV") field(LNK4, "QUAD:LTUS:540: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, "QUAD:LTUS:540:DEGAUS_STATE_LOST") { field(DESC, "Degauss lost and ps On") field(DOL1, "1") field(LNK1, "QUAD:LTUS:540:DEGAUSOK.ZSV") field(LNK2, "QUAD:LTUS:540: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, "QUAD:LTUS:540:STATMSG.FRSV") field(LNK4, "QUAD:LTUS:540: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, "QUAD:LTUS:540:DEGAUS_STATE_OFF") { field(DESC, "Degaused lost and ps Off") field(DOL1, "2") field(LNK1, "QUAD:LTUS:540: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, "QUAD:LTUS:540:STATMSG.FRSV") field(LNK3, "QUAD:LTUS:540: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, "QUAD:LTUS:540:DEGAUS_STATE_GOOD") { field(DESC, "Degauss good") field(DOL1, "1") field(LNK1, "QUAD:LTUS:540: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, "QUAD:LTUS:540:STATMSG.FRSV PP") field(LNK3, "QUAD:LTUS:540:STATMSG.FVSV PP") field(LNK4, "") field(ASG, "Internal") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(mbbo, "QUAD:LTUS:540:FUNC") { field(DESC, "QUAD:LTUS:540 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, "1") field(THVL, "9") field(FRVL, "10") field(FVVL, "0") field(SXVL, "2") field(SVVL, "8") field(EIVL, "11") field(NIVL, "12") field(TEVL, "13") field(ELVL, "5") field(TVVL, "6") field(TTVL, "7") field(FTVL, "4") field(FFVL, "3") field(OUT, "QUAD:LTUS:540:CTRL CA") } # :CTRL pv is processed at boot in the # sequence mgntCtrl.st Processed in sequence # record(mbbo, "QUAD:LTUS:540:CTRL") { field(DESC, "QUAD:LTUS:540 Control") field(PINI, "NO") field(ZRST, "Ready") field(ONST, "TRIM") field(TWST, "PERTURB") field(THST, "BCON_TO_BDES") field(FRST, "BACT_TO_BDES") field(FVST, "SAVE_BDES") field(SXST, "LOAD_BDES") field(SVST, "UNDO_BDES") field(EIST, "DAC_ZERO") field(NIST, "CALB") field(TEST, "STDZ") field(ELST, "RESET") field(TVST, "TURN_ON") field(TTST, "TURN_OFF") field(FTST, "") field(FFST, "") field(ZRVL, "0") field(ONVL, "2") field(TWVL, "6") field(THVL, "15") field(FRVL, "14") field(FVVL, "11") field(SXVL, "12") field(SVVL, "13") field(EIVL, "7") field(NIVL, "3") field(TEVL, "4") field(ELVL, "8") field(TVVL, "9") field(TTVL, "10") field(FTVL, "0") field(FFVL, "0") field(OUT, "QUAD:LTUS:540:SELECTEN.A PP") field(SDIS, "0") } # If a function has been selected set this unit to busy record(calcout, "QUAD:LTUS:540:SELECTEN") { field(DESC, "Control Select Enable") field(CALC, "A>0?1:A") field(FLNK, "QUAD:LTUS:540:BUSY") } # Set to FREE on IOC reboot record(bo, "QUAD:LTUS:540:BUSY") { field(DESC, "QUAD:LTUS:540 Ctrl Done") field(DOL, "QUAD:LTUS:540:SELECTEN") field(ZNAM, "FREE") field(ONAM, "BUSY") field(PINI, "YES") field(FLNK, "QUAD:LTUS:540:SELECT") } record(bo, "QUAD:LTUS:540:SELECT") { field(ZNAM, "NO") field(ONAM, "YES") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") } record(bo, "QUAD:LTUS:540: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, "QUAD:LTUS:540:CTRLSTATE") { field(DESC, "QUAD:LTUS:540 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("QUAD:LTUS:540:CTRL",20,20,0,0,"QUAD:LTUS:540:CTRL") #! Field("QUAD:LTUS:540:CTRL.OUT",16777215,1,"QUAD:LTUS:540:CTRL.OUT") #! Link("QUAD:LTUS:540:CTRL.OUT","QUAD:LTUS:540:SELECTEN.A") #! Field("QUAD:LTUS:540:CTRL.VAL",16777215,1,"QUAD:LTUS:540:CTRL.VAL") #! Record("QUAD:LTUS:540:SELECTEN",321,381,0,0,"QUAD:LTUS:540:SELECTEN") #! Field("QUAD:LTUS:540:SELECTEN.A",16777215,0,"QUAD:LTUS:540:SELECTEN.A") #! Field("QUAD:LTUS:540:SELECTEN.FLNK",16777215,1,"QUAD:LTUS:540:SELECTEN.FLNK") #! Link("QUAD:LTUS:540:SELECTEN.FLNK","QUAD:LTUS:540:BUSY") #! Field("QUAD:LTUS:540:SELECTEN.VAL",16777215,1,"QUAD:LTUS:540:SELECTEN.VAL") #! Record("QUAD:LTUS:540:BUSY",623,274,0,0,"QUAD:LTUS:540:BUSY") #! Field("QUAD:LTUS:540:BUSY.DOL",16777215,0,"QUAD:LTUS:540:BUSY.DOL") #! Link("QUAD:LTUS:540:BUSY.DOL","QUAD:LTUS:540:SELECTEN.VAL") #! Field("QUAD:LTUS:540:BUSY.FLNK",16777215,1,"QUAD:LTUS:540:BUSY.FLNK") #! Link("QUAD:LTUS:540:BUSY.FLNK","QUAD:LTUS:540:SELECT") #! Record("QUAD:LTUS:540:SELECT",669,508,0,1,"QUAD:LTUS:540:SELECT") #! Record("QUAD:LTUS:540:FUNC",940,120,0,0,"QUAD:LTUS:540:FUNC") #! Field("QUAD:LTUS:540:FUNC.OUT",16777215,0,"QUAD:LTUS:540:FUNC.OUT") #! Link("QUAD:LTUS:540:FUNC.OUT","QUAD:LTUS:540:CTRL.VAL") #! Record("QUAD:LTUS:540:ABORT",193,41,0,0,"QUAD:LTUS:540:ABORT") #! Record("QUAD:LTUS:540:CTRLSTATE",369,34,0,0,"QUAD:LTUS:540: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,"QUAD:LTUS:540:SELECT is used for Multi-device selection.\nIt is enabled when associated QUAD:LTUS:540:CTRL is \"0\" (DONE).\nIt is disabled when associated QUAD:LTUS:540: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,"QUAD:LTUS:540: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, "QUAD:LTUS:540:BCTRL_INIT") { field(DESC, "Process BCTRL on boot") field(PINI, "YES") field(CALC, "A=3?1:0") field(INPA, "QUAD:LTUS:540:BCTRL.SEVR") field(OUT, "QUAD:LTUS:540: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, "QUAD:LTUS:540:BACT") { field(DESC, "Actual B") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "QUAD:LTUS:540:BACT") field(INPB, "QUAD:LTUS:540:POLYCOEF") field(INPC, "QUAD:LTUS:540:POLYCOEF.A") field(INPD, "QUAD:LTUS:540:POLYCOEF.B") field(INPE, "QUAD:LTUS:540:IACT MS") field(INPF, "QUAD:LTUS:540:BDELTAS PP") field(INPG, "100") field(EGU, "kG") field(HOPR, "-0.2484") field(LOPR, "-102.1643") field(HIHI, "-0.2484") field(LOLO, "-102.1643") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "-0.2484") field(LOW, "-102.1643") field(FLNK, "QUAD:LTUS:540: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, "QUAD:LTUS:540:BDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntPhyDeltas") field(EGU, "kG") field(HOPR, "1") field(PREC, "7") field(BRSV, "INVALID") field(INPA, "QUAD:LTUS:540:BDES") field(INPB, "QUAD:LTUS:540:TRIMBTOL") field(INPC, "QUAD:LTUS:540:TRIMBTOLR") field(INPD, "QUAD:LTUS:540:CHCKBTOL") field(INPE, "QUAD:LTUS:540:CHCKBTOLR") field(F, "2.0") field(INPG, "30") field(INPH, "QUAD:LTUS:540:BACT.VAL") # # MPS absolute and relative tolerances field(INPP, "QUAD:LTUS:540:MPSBTOL") field(INPQ, "QUAD:LTUS:540:MPSBTOLR") field(FLNK, "QUAD:LTUS:540:BCONLIMITS") info(autosaveFields,"F") } # This record is processed by BDELTAS record(aSub, "QUAD:LTUS:540:BCONLIMITS") { field(DESC, "Config B-field Limits") field(INAM, "mgntInit") field(SNAM, "mgntBCONLimits") field(INPA, "QUAD:LTUS:540:BDES") field(INPB, "QUAD:LTUS:540:BDELTAS.I") field(INPG, "QUAD:LTUS:540:DEBUG.RVAL") field(FTA, "DOUBLE") field(FTB, "DOUBLE") field(FTG, "ULONG") field(OUTA, "QUAD:LTUS:540:BCON.HIGH") field(OUTB, "QUAD:LTUS:540:BCON.LOW") field(OUTC, "QUAD:LTUS:540:BCON.HIHI") field(OUTD, "QUAD:LTUS:540:BCON.LOLO PP") field(FTVA, "DOUBLE") field(FTVB, "DOUBLE") field(FTVC, "DOUBLE") field(FTVD, "DOUBLE") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:540:IDELTAS") } # The following PV is processed by :BACT # which is processed by :BACT # record(fanout, "QUAD:LTUS:540:BACTFO") { field(DESC, "BACT processing") field(SELM, "All") field(LNK1, "QUAD:LTUS:540:BDIFF") field(LNK2, "QUAD:LTUS:540:BADIFF") field(LNK3, "QUAD:LTUS:540:BRATIO") field(LNK4, "QUAD:LTUS:540:MPSLIMITS") field(LNK5, "QUAD:LTUS:540:I2BSTATUS") field(LNK6, "QUAD:LTUS:540:IACTFO.PROC") } record(calc, "QUAD:LTUS:540:BDIFF") { field(DESC, "BDES-BACT") field(CALC, "A-B") field(INPA, "QUAD:LTUS:540:BDES") field(INPB, "QUAD:LTUS:540:BACT") field(EGU, "kG") field(PREC, "7") } record(calc, "QUAD:LTUS:540:BADIFF") { field(DESC, "Absolute BDES-BACT") field(INPA, "QUAD:LTUS:540:BDIFF") field(EGU, "kG") field(PREC, "7") field(CALC, "A<0?ABS(A):A") } record(calc, "QUAD:LTUS:540:BRATIO") { field(DESC, "BACT Error") field(CALC, "B?A/B:0") field(INPA, "QUAD:LTUS:540:BDIFF") field(INPB, "QUAD:LTUS:540:BDES.HOPR") field(EGU, "kG") field(PREC, "7") } record(mbbi, "QUAD:LTUS:540: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, "QUAD:LTUS:540:BACT.J") } # Note: for a string slave set the MONFL # macro to the following: # MONFL=:IMONCALC MS record(sub, "QUAD:LTUS:540:BMON") { field(DESC, "Second Transductor") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "QUAD:LTUS:540:BMON") field(INPB, "QUAD:LTUS:540:POLYCOEF") field(INPC, "QUAD:LTUS:540:POLYCOEF.A") field(INPD, "QUAD:LTUS:540:POLYCOEF.B") field(INPE, "QUAD:LTUS:540:IMON MS") field(INPF, "QUAD:LTUS:540:BDELTAS.VAL") field(INPG, "100") field(EGU, "kG") field(HOPR, "-0.2484") field(LOPR, "-102.1643") field(HIHI, "-0.2484") field(LOLO, "-102.1643") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "-0.2484") field(LOW, "-102.1643") } # 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=PSC:LTUS:MG11:BDES CP record(ao, "QUAD:LTUS:540:BDES") { field(DESC, "Desired B-Field") field(PINI, "YES") field(DRVH, "-0.2484") field(DRVL, "-102.1643") field(HOPR, "-0.2484") field(LOPR, "-102.1643") field(PREC, "7") field(EGU, "kG") field(MDEL, "-1") field(OMSL, "supervisory") # field(DOL, "") field(OUT, "QUAD:LTUS:540:B2IDES PP") info(autosaveFields,"VAL") } record(sub, "QUAD:LTUS:540:B2IDES") { field(DESC, "Convert Desired B-Field to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:540:POLYCOEF") field(INPC, "QUAD:LTUS:540:POLYCOEF.A") field(INPD, "QUAD:LTUS:540:POLYCOEF.B") field(PREC, "7") field(EGU, "kG") field(HOPR, "-0.2484") field(LOPR, "-102.1643") field(MDEL, "-1") field(INPE, "QUAD:LTUS:540:BDES.DRVH") field(INPF, "QUAD:LTUS:540:BDES.DRVL") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:540:IDES") } record(sub, "QUAD:LTUS:540:BNOM") { field(DESC, "Nominal Field") field(PINI, "YES") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:540:POLYCOEF") field(INPC, "QUAD:LTUS:540:POLYCOEF.A") field(INPD, "QUAD:LTUS:540:POLYCOEF.B") field(INPE, "QUAD:LTUS:540:BDES.DRVH") field(INPF, "QUAD:LTUS:540:BDES.DRVL") field(EGU, "kG") field(HOPR, "-0.2484") field(LOPR, "-102.1643") field(PREC, "7") field(VAL, "0.0") field(FLNK, "QUAD:LTUS:540:INOM") } record(sub, "QUAD:LTUS:540:BACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:540:BDES.VAL") field(INPB, "QUAD:LTUS:540:BDES.DRVH") field(INPC, "QUAD:LTUS:540:BDES.DRVL") field(INPD, "QUAD:LTUS:540:BDELTAS.I") field(INPE, "QUAD:LTUS:540:BDELTAS.J") field(INPG, "QUAD:LTUS:540:STATE") field(INPH, "QUAD:LTUS:540:HSTA") field(EGU, "kG") field(HOPR, "-0.2484") field(LOPR, "-102.1643") field(PREC, "7") field(BRSV, "INVALID") } record(sub, "QUAD:LTUS:540:BMONLIMITS") { field(DESC, "MON Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:540:BDES.VAL") field(INPB, "QUAD:LTUS:540:BDES.DRVH") field(INPC, "QUAD:LTUS:540:BDES.DRVL") field(INPD, "QUAD:LTUS:540:BDELTAS.K") field(INPE, "QUAD:LTUS:540:BDELTAS.L") field(INPG, "QUAD:LTUS:540:STATE") field(INPH, "QUAD:LTUS:540:HSTA") field(EGU, "kG") field(HOPR, "-0.2484") field(LOPR, "-102.1643") field(PREC, "7") field(BRSV, "INVALID") } record(seq, "QUAD:LTUS:540:BLIMITS") { field(DESC, "ACT Limits") field(PREC, "7") field(DOL1, "QUAD:LTUS:540:BLIMITS") field(LNK1, "QUAD:LTUS:540:BACTLIMITS.F PP") field(DOL2, "QUAD:LTUS:540:BACTLIMITS.I") field(LNK2, "QUAD:LTUS:540:BACT.HIGH") field(DOL3, "QUAD:LTUS:540:BACTLIMITS.J") field(LNK3, "QUAD:LTUS:540:BACT.LOW") field(DOL4, "QUAD:LTUS:540:BACTLIMITS.K") field(LNK4, "QUAD:LTUS:540:BACT.HIHI") field(DOL5, "QUAD:LTUS:540:BACTLIMITS.L") field(LNK5, "QUAD:LTUS:540:BACT.LOLO") field(DOL6, "QUAD:LTUS:540:BLIMITS") field(LNK6, "QUAD:LTUS:540:BMONLIMITS.F PP") field(DOL7, "QUAD:LTUS:540:BMONLIMITS.I") field(LNK7, "QUAD:LTUS:540:BMON.HIGH") field(DOL8, "QUAD:LTUS:540:BMONLIMITS.J") field(LNK8, "QUAD:LTUS:540:BMON.LOW") field(DOL9, "QUAD:LTUS:540:BMONLIMITS.K") field(LNK9, "QUAD:LTUS:540:BMON.HIHI") field(DOLA, "QUAD:LTUS:540:BMONLIMITS.L") field(LNKA, "QUAD:LTUS:540:BMON.LOLO") field(FLNK, "QUAD:LTUS:540:ILIMITS") field(SCAN, "5 second") } record(ao, "QUAD:LTUS:540:BCTRL") { field(DESC, "B-Perturb") field(PREC, "7") field(EGU, "kG") field(DRVH, "-0.2484") field(DRVL, "-102.1643") field(HOPR, "-0.2484") field(LOPR, "-102.1643") # 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, "QUAD:LTUS:540: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, "QUAD:LTUS:540:BCTRLGO") { field(DESC, "Update DES and perturb") field(PREC, "7") # Disable BACT limits field(DOL1, "1") field(LNK1, "QUAD:LTUS:540:BLIMITS.VAL") # Update BDES with the BCTRL (slider) value field(DOL2, "QUAD:LTUS:540:BCTRL.VAL") field(LNK2, "QUAD:LTUS:540:BDES PP") field(DOL3, "1") field(LNK3, "QUAD:LTUS:540:IDIRECT.PROC PP") field(DOL4, "1") field(LNK4, "QUAD:LTUS:540:CHECKSTDZLOST.PROC PP") field(DOL5, "QUAD:LTUS:540:BCTRL.VAL") field(LNK5, "QUAD:LTUS:540:BCTRLSUB PP") # Re-enable BACT limits field(DOL6, "0") field(LNK6, "QUAD:LTUS:540:BLIMITS.VAL") } # Convert B-field to Current and output to ISETPT record(sub, "QUAD:LTUS:540:BCTRLSUB") { field(DESC, "Feedback") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:540:POLYCOEF") field(INPC, "QUAD:LTUS:540:POLYCOEF.A") field(INPD, "QUAD:LTUS:540:POLYCOEF.B") field(INPE, "QUAD:LTUS:540:BDES.DRVH") field(INPF, "QUAD:LTUS:540:BDES.DRVL") field(PREC, "7") field(EGU, "kG") field(HOPR, "-0.2484") field(LOPR, "-102.1643") field(MDEL, "-1") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:540:ISETPT") } record(ao, "QUAD:LTUS:540:BDESPREVTRIM") { field(DESC, "trim bdes for undo") field(DTYP, "Soft Channel") field(DRVH, "-0.2484") field(DRVL, "-102.1643") field(EGU, "kG") field(HOPR, "-0.2484") field(LOPR, "-102.1643") field(PREC, "7") field(PINI, "YES") info(autosaveFields,"VAL") } record(stringin, "QUAD:LTUS:540:MADNAME") { field(DESC, "MAD deck nomenclature") field(PINI, "YES") field(VAL, "QVB1B") } record(ai, "QUAD:LTUS:540: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, "3376.489974") } record(ao, "QUAD:LTUS:540:BMAX") { field(DESC, "Max B-Field") field(DTYP, "Soft Channel") field(DRVH, "-0.2484") field(DRVL, "-102.1643") field(EGU, "kG") field(HOPR, "-0.2484") field(LOPR, "-102.1643") field(PREC, "7") field(PINI, "YES") field(VAL, "-0.2484") field(FLNK, "QUAD:LTUS:540:BSTEP") } record(ao, "QUAD:LTUS:540:BMIN") { field(DESC, "Min B-Field") field(DTYP, "Soft Channel") field(DRVH, "-0.2484") field(DRVL, "-102.1643") field(EGU, "kG") field(HOPR, "-0.2484") field(LOPR, "-102.1643") field(PREC, "7") field(PINI, "YES") field(VAL, "-102.1643") field(FLNK, "QUAD:LTUS:540:BSTEP") } record(ao, "QUAD:LTUS:540:BDESSAVE") { field(DESC, "bdes for save/load") field(DTYP, "Soft Channel") field(DRVH, "-0.2484") field(DRVL, "-102.1643") field(EGU, "kG") field(HOPR, "-0.2484") field(LOPR, "-102.1643") field(PINI, "YES") field(PREC, "7") } # This record is processed by QUAD:LTUS:540: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, "QUAD:LTUS:540:BCON") { field(DESC, "Config B-Field ") field(DTYP, "Soft Channel") field(PREC, "7") field(EGU, "kG") field(HOPR, "-0.2484") field(LOPR, "-102.1643") field(DRVH, "-0.2484") field(DRVL, "-102.1643") # Set MINOR Alarm as the default, slaves will set NO_ALARM=0. field(HHSV, "MINOR") field(LLSV, "MINOR") field(HSV, "MINOR") field(LSV, "MINOR") # field(DOL , "") field(OMSL, "supervisory") field(OUT, "QUAD:LTUS:540:B2ICON PP") info(autosaveFields,"VAL") } record(sub, "QUAD:LTUS:540:B2ICON") { field(DESC, "Convert Desired ICon to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:540:POLYCOEF") field(INPC, "QUAD:LTUS:540:POLYCOEF.A") field(INPD, "QUAD:LTUS:540:POLYCOEF.B") field(PREC, "7") field(EGU, "kG") field(HOPR, "-0.2484") field(LOPR, "-102.1643") field(MDEL, "-1") field(INPE, "QUAD:LTUS:540:BCON.DRVH") field(INPF, "QUAD:LTUS:540:BCON.DRVL") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:540: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, "QUAD:LTUS:540:BSTEP") { field(DESC, "B-Field step size") field(CALC, "(C==3)||(D==3)?0:ABS(A-B)*0.005") field(INPA, "QUAD:LTUS:540:BMAX") field(INPB, "QUAD:LTUS:540:BMIN") field(INPC, "QUAD:LTUS:540:BMIN.SEVR") field(INPD, "QUAD:LTUS:540:BMAX.SEVR") field(EGU, "kG") 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,"QUAD:LTUS:540:BCTRLDISABLECALC") { field(DESC, "Calc for disabling BCTRL") field(ASG, "Internal") field(CALC, "A?2:1") field(INPA, "QUAD:LTUS:540:ONLINE CP") field(OUT, "QUAD:LTUS:540:BCTRLDISABLEFOUT PP") } record(fanout, "QUAD:LTUS:540:BCTRLDISABLEFOUT") { field(DESC, "Disable BCTRL fanout") field(SELM, "Specified") field(SELL, "QUAD:LTUS:540:BCTRLDISABLECALC") field(LNK1, "QUAD:LTUS:540:BCTRLDISABLE") field(LNK2, "QUAD:LTUS:540:BCTRLENABLE") } record(stringout, "QUAD:LTUS:540:BCTRLDISABLE") { field(DESC, "Disable BCTRL") field(DTYP, "Soft Channel") field(OUT, "QUAD:LTUS:540:BCTRL.ASG") field(VAL, "NOWRITE") field(FLNK, "QUAD:LTUS:540:BCTRLDISV_UPDATE") } record(stringout, "QUAD:LTUS:540:BCTRLENABLE") { field(DESC, "Enable BCTRL") field(DTYP, "Soft Channel") field(OUT, "QUAD:LTUS:540:BCTRL.ASG") field(VAL, "") field(FLNK, "QUAD:LTUS:540:BCTRLDISV_UPDATE") } record(calcout, "QUAD:LTUS:540:BCTRLDISV_UPDATE") { field(DESC, "Calc for updating BCTRL.DISV") field(ASG, "Internal") field(CALC, "A") field(INPA, "QUAD:LTUS:540:ONLINE") field(OUT, "QUAD:LTUS:540: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,"QUAD:LTUS:540:BACT and MON\n are processed via links from \n QUAD:LTUS:540:IACT (device raw value readback 1)\n and\n QUAD:LTUS:540: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 QUAD:LTUS:540:POLYCOEF\nC = First polynomial coefficient (offset if linear)\nD = Second polynomial coefficient (slope if linear)\nE = QUAD:LTUS:540: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,"QUAD:LTUS:540:BDES\n is processed when set by CA users or \n QUAD:LTUS:540: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,"QUAD:LTUS:540: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 QUAD:LTUS:540: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 (QUAD:LTUS:540: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,"QUAD:LTUS:540:B*LIMITS and QUAD:LTUS:540:BLIMITS:\n Calculate alarm and warning limits based on \n deltas from QUAD:LTUS:540: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,"QUAD:LTUS:540: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,"QUAD:LTUS:540: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, "QUAD:LTUS:540: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, "QUAD:LTUS:540:MPSBTOL") { field(DESC, "Absolute mps tol") field(EGU, "kG") field(PREC, "2") field(CALC, "ABS(A)*0.02") field(INPA, "QUAD:LTUS:540:BMAX") field(PINI, "YES") } # # 21-Aug-2013: K. Luchini # Set channel access security so that users # cannot easily change values. record(ao, "QUAD:LTUS:540:MPSBMAX") { field(DESC, "MPS Max B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "-0.2484") field(DRVL, "-102.1643") field(PINI, "YES") field(VAL, "-0.2484") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:540:MPSBMIN") { field(DESC, "MPS Min B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "-0.2484") field(DRVL, "-102.1643") field(PINI, "YES") field(VAL, "-102.1643") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:540:MPSBLLIM") { field(DESC, "MPS Low Limit B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "-0.2484") field(DRVL, "-102.1643") field(PINI, "YES") field(VAL, "-102.1643") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:540:MPSBLLIM2") { field(DESC, "MPS Low Limit #2 B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "-0.2484") field(DRVL, "-102.1643") field(PINI, "YES") field(VAL, "-102.1643") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } # Set the default to Std record(mbbo, "QUAD:LTUS:540: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, "QUAD:LTUS:540:MPSLIMITS.E PP") } record(aSub, "QUAD:LTUS:540: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, "QUAD:LTUS:540:MPS.RVAL") field(INPB, "QUAD:LTUS:540:BADIFF") field(INPC, "QUAD:LTUS:540:BDELTAS.N") field(INPD, "QUAD:LTUS:540:BACT") field(INPE, "QUAD:LTUS:540:MPSBITMASK.RVAL") field(INPF, "QUAD:LTUS:540:MPSBLLIM") field(INPG, "QUAD:LTUS:540:MPSBMIN") field(INPH, "QUAD:LTUS:540:MPSBMAX") field(INPI, "QUAD:LTUS:540: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, "QUAD:LTUS:540:INTOL.RVAL PP") field(OUTB, "QUAD:LTUS:540:INTOL_BMIN.RVAL PP") field(OUTC, "QUAD:LTUS:540:INTOL_BRANGE.RVAL PP") field(OUTD, "QUAD:LTUS:540: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, "QUAD:LTUS:540:INTOL") { field(DESC, "BACT within MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:540:MPSLIMITS.VALA") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "QUAD:LTUS:540:INTOL_BMIN") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:540:MPSLIMITS.VALB") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "QUAD:LTUS:540:INTOL_BMIN2") { field(DESC, "MPS tol #2") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:540:MPSLIMITS.VALD") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "QUAD:LTUS:540:INTOL_BRANGE") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:540: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, "QUAD:LTUS:540:CHCKITOL") { field(DESC, "Absolute Check I Tolerance") field(EGU, "A") field(FLNK, "QUAD:LTUS:540:TRIMITOL") field(CALC, "ABS(A*B)") field(INPA, "QUAD:LTUS:540:CHCKBTOL") field(INPB, "QUAD:LTUS:540:POLYCOEF.B") field(PREC, "9") } record(calc, "QUAD:LTUS:540:TRIMBTOL") { field(EGU, "kG") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(DESC, "Absolute Trim Tolerance") field(CALC, "ABS(A)/2") field(INPA, "QUAD:LTUS:540:CHCKBTOL") field(FLNK, "QUAD:LTUS:540:CHCKITOL") } record(calc, "QUAD:LTUS:540:CHCKBTOL") { field(DESC, "Check absolute tolerance") field(EGU, "A") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(FLNK, "QUAD:LTUS:540:TRIMBTOL") field(CALC, "MAX(ABS(A),ABS(C))*(B/1000000)") field(INPA, "QUAD:LTUS:540:BDES.HOPR") field(INPB, "QUAD:LTUS:540:STABILITY") field(INPC, "QUAD:LTUS:540:BDES.LOPR") } record(longout, "QUAD:LTUS:540: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, "QUAD:LTUS:540:CHCKBTOL") } record(calc, "QUAD:LTUS:540:TRIMITOL") { field(DESC, "Absolute Trim I Tolerance") field(EGU, "kG") field(CALC, "ABS(A*B)") field(INPA, "QUAD:LTUS:540:POLYCOEF.B") field(INPB, "QUAD:LTUS:540:TRIMBTOL") field(PREC, "9") } record(ai, "QUAD:LTUS:540:TRIMBTOLR") { field(DESC, "Relative trim tol") field(PREC, "4") field(EGU, "%") field(HOPR, "1.0") field(LOPR, "0.0") field(PINI, "YES") } record(ai, "QUAD:LTUS:540: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, "QUAD:LTUS:540:FBCKFCOM") { field(ZNAM, "CA") field(ONAM, "FCOM") field(DESC, "CA Mode") field(PINI, "YES") field(SDIS, "0") } record(bo, "QUAD:LTUS:540:PAU") { field(ZNAM, "NotConfigured") field(ONAM, "Configured") field(DESC, "PAU Present") field(PINI, "YES") field(SDIS, "0") field(FLNK, "QUAD:LTUS:540:PAUGO") } record(fanout, "QUAD:LTUS:540:PAUGO") { field(DESC, "PAU control") field(LNK1, "QUAD:LTUS:540:PAUSTOP") field(LNK2, "QUAD:LTUS:540: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, "QUAD:LTUS:540:PAUSTART") { field(DESC, "Setup for PAU On") field(SDIS, "QUAD:LTUS:540: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, "QUAD:LTUS:540:PAUSTOP") { field(DESC, "Setup for PAU Off") field(SDIS, "QUAD:LTUS:540: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, "QUAD:LTUS:540:MCORDEVNAME") { field(DESC, "PS device name") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, "PSC:LTUS:MG11:") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "QUAD:LTUS:540: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, "QUAD:LTUS:540:PSTYPE.RVAL") field(INPC, "QUAD:LTUS:540:TURNEDOFF.RVAL") field(INPD, "QUAD:LTUS:540:CONFIG.RVAL") field(INPE, "QUAD:LTUS:540:PSCATEGORY.RVAL") field(INPF, "QUAD:LTUS:540:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "QUAD:LTUS:540:AUTOCTRL.RVAL") field(INPJ, "QUAD:LTUS:540:OUTOFSERVICE.RVAL") field(INPL, "QUAD:LTUS:540:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "QUAD:LTUS:540:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "QUAD:LTUS:540:PAU") field(INPP, "QUAD:LTUS:540:CALBDISABLE.RVAL") field(INPQ, "QUAD:LTUS:540:PTRBDISABLE.RVAL") field(INPR, "QUAD:LTUS:540:TRIMDISABLE.RVAL") field(INPS, "QUAD:LTUS:540:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "QUAD:LTUS:540:FBCK") field(INPU, "QUAD:LTUS:540:TRIMTYPE.RVAL") field(INPV, "QUAD:LTUS:540:STDZDIRECT.RVAL") field(INPW, "QUAD:LTUS:540:DEGAUSENABLE.RVAL") field(FLNK, "QUAD:LTUS:540:HSTA") } record(longin, "QUAD:LTUS:540:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "QUAD:LTUS:540:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "QUAD:LTUS:540: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, "QUAD:LTUS:540: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, "QUAD:LTUS:540:CALBDISABLE") { field(DESC, "DAC Calb Disabled") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:540:PTRBDISABLE") { field(DESC, "Perturb Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:540:TRIMDISABLE") { field(DESC, "Trim Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:540: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 QUAD:LTUS:540:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses QUAD:LTUS:540:FBCK. # This PV should be replaced by QUAD:LTUS:540: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, "QUAD:LTUS:540: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, "QUAD:LTUS:540: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, "QUAD:LTUS:540: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, "") field(OMSL, "supervisory") field(FLNK, "QUAD:LTUS:540:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"QUAD:LTUS:540:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "QUAD:LTUS:540:OUTOFSERVICE NPP NMS") field(OUT, "QUAD:LTUS:540:ONLINE PP") } record(bo, "QUAD:LTUS:540:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "QUAD:LTUS:540: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, "1") } record(bo, "QUAD:LTUS:540: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, "1") } record(bo, "QUAD:LTUS:540: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, "QUAD:LTUS:540: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, "QUAD:LTUS:540: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, "QUAD:LTUS:540: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, "QUAD:LTUS:540: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, "QUAD:LTUS:540: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, "1") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:540: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, "1") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:540: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, "2") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:540: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, "0") field(ASG, "NOWRITE") field(FLNK, "QUAD:LTUS:540:TRIMTYPE") } record(stringout, "QUAD:LTUS:540:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "QUAD:LTUS:540:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "QUAD:LTUS:540:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "QUAD:LTUS:540:STATE.RVAL") field(INPB, "QUAD:LTUS:540:INTLKSUMY.RVAL") field(OUT, "QUAD:LTUS:540:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:LTUS:540: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, "QUAD:LTUS:540:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "QUAD:LTUS:540:STATE.RVAL") field(INPB, "QUAD:LTUS:540:INTLKSUMY.RVAL") field(OUT, "QUAD:LTUS:540:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:LTUS:540:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "QUAD:LTUS:540:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "QUAD:LTUS:540: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, "QUAD:LTUS:540:RAMPSTARTDLY") { field(DESC, "Tansition to ramp delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "2") } ######### For PSTYPE=2 Only ############# record(mbbo, "QUAD:LTUS:540: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, "QUAD:LTUS:540: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,"QUAD:LTUS:540: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("QUAD:LTUS:540:TURNEDOFF",3140,1907,0,1,"QUAD:LTUS:540:TURNEDOFF") #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "QUAD:LTUS:540:STATSUB") { field(DESC, "Build STATus ") field(INAM, "mgntInit") field(SNAM, "mgntSlcStat") field(INPA, "QUAD:LTUS:540:BACT.STAT") field(INPB, "QUAD:LTUS:540:BDES.STAT") field(INPC, "QUAD:LTUS:540:IRIPL.STAT") field(INPD, "PSC:LTUS:MG11:ISETPT.STAT") field(INPE, "PSC:LTUS:MG11:IACT.STAT") # 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, "QUAD:LTUS:540:BACT.SEVR") field(INPH, "QUAD:LTUS:540:BDES.SEVR") field(INPI, "QUAD:LTUS:540:IRIPL.SEVR") field(INPJ, "PSC:LTUS:MG11:ISETPT.SEVR") field(INPK, "PSC:LTUS:MG11:IACT.SEVR") # # 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, "QUAD:LTUS:540:STATE.RVAL") field(INPN, "QUAD:LTUS:540:STDZOK") field(INPO, "QUAD:LTUS:540:CALBOK") field(INPP, "QUAD:LTUS:540:OUTOFSERVICE.RVAL") field(INPQ, "QUAD:LTUS:540:CONFIG.RVAL") field(INPR, "QUAD:LTUS:540:HSTA") field(INPS, "QUAD:LTUS:540:CTRL.RVAL") field(INPT, "QUAD:LTUS:540:DEGAUSOK") field(INPV, "QUAD:LTUS:540: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, "QUAD:LTUS:540:STAT") } record(longout, "QUAD:LTUS:540:STAT") { field(DESC, "STAT sent to SLC") field(SCAN, "Passive") field(FLNK, "QUAD:LTUS:540:STATCTRLSUB") field(DOL, "QUAD:LTUS:540:STATSUB.VAL") field(OMSL, "closed_loop") } record(sSub, "QUAD:LTUS:540:STATCTRLSUB") { field(DESC, "Decode SLC STAT into mbbo") field(INAM, "mgntInit") field(SNAM, "mgntStatDecode") field(INPA, "QUAD:LTUS:540:STAT") field(INPB, "QUAD:LTUS:540:HSTA") field(INPD, "QUAD:LTUS:540:ONOFFCTRL.RVAL") field(FLNK, "QUAD:LTUS:540:STATMSG") } record(mbbo, "QUAD:LTUS:540: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, "QUAD:LTUS:540:UNAVAILGO") field(DOL, "QUAD:LTUS:540:STATCTRLSUB.W") } record(seq, "QUAD:LTUS:540:UNAVAILGO") { field(DESC, "Process UNAVAIL") field(DOL1, "QUAD:LTUS:540:STATSUB.U") field(LNK1, "QUAD:LTUS:540:UNAVAIL PP") } record(stringout, "QUAD:LTUS:540:SNLSTATMSG") { field(DTYP, "Soft Channel") } #! TextBox(TB0,820,1000,1200,1220,0,"Dialog",12,1,16777215,"QUAD:LTUS:540:STATUSSUB - future\nOverall device status - takes input from action snls, record sevrs, master snl(s) and outputs final status\n\nInputs:\nA - QUAD:LTUS:540:CTRLSTATUS - snl status\nB - MGNT:CTRLSTATUS - master list status\nC\nD - QUAD:LTUS:540: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,"QUAD:LTUS:540STATSUB\nformat control bo's into slc STAT\n\nInputs:\nA - QUAD:LTUS:540:STATUS\nC - QUAD:LTUS:540:ON\nD - QUAD:LTUS:540:STDZOK\nE - QUAD:LTUS:540:CALBOK\nF - QUAD:LTUS:540:BACTDRIFT (future)\nG -\nH- QUAD:LTUS:540:DACSTATUS\nI -QUAD:LTUS:540:ADCSTATUS\nJ - QUAD:LTUS:540:BACTSTATUS\nK - QUAD:LTUS:540:BDESSTATUS\nL - QUAD:LTUS:540:RIPLSTATUS\n\nOutput:\nP - QUAD:LTUS:540: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, "QUAD:LTUS:540: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, "QUAD:LTUS:540: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, "QUAD:LTUS:540: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, "QUAD:LTUS:540: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.6 #! DBDSTART #! DBD("../../../../dbd/mgntSoft.dbd") #! DBDEND record(stringout, "QUAD:LTUS:540:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:540:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "QUAD:LTUS:540:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "QUAD:LTUS:540:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "QUAD:LTUS:540:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "QUAD:LTUS:540:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "1") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "QUAD:LTUS:540: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, "QUAD:LTUS:540:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "QUAD:LTUS:540:TRIMTYPE.RVAL") field(INPB, "QUAD:LTUS:540:CONFIG.RVAL") field(OUT, "QUAD:LTUS:540:TRIMMAXNUM PP") } record(longout, "QUAD:LTUS:540: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, "QUAD:LTUS:540: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, "") field(OMSL, "supervisory") field(VAL, "20") field(OUT, "QUAD:LTUS:540:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "QUAD:LTUS:540: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, "") field(OMSL, "supervisory") field(VAL, "10") } record(bo, "QUAD:LTUS:540: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, "QUAD:LTUS:540: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, "QUAD:LTUS:540: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, "QUAD:LTUS:540:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "0") } record(ao, "QUAD:LTUS:540: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, "QUAD:LTUS:540:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "QUAD:LTUS:540: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, "QUAD:LTUS:540: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, "QUAD:LTUS:540:IMOVE") field(INPB, "QUAD:LTUS:540:IACT") field(INPC, "QUAD:LTUS:540:IRAMPRATE") field(INPD, "1.577") field(INPE, "QUAD:LTUS:540:TRIMDLYPCT") field(INPF, "QUAD:LTUS:540:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "QUAD:LTUS:540:RAMPTIME_LEFT PP") } record(longout, "QUAD:LTUS:540:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "QUAD:LTUS:540:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "QUAD:LTUS:540:RAMPDONE_CALC") } record(calc, "QUAD:LTUS:540:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "QUAD:LTUS:540:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "QUAD:LTUS:540:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "QUAD:LTUS:540: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, "QUAD:LTUS:540:RAMPTIME_LEFT") field(OUT, "QUAD:LTUS:540:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "QUAD:LTUS:540:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "QUAD:LTUS:540:RAMPTIME_LEFT NMS") field(OUT, "QUAD:LTUS:540:RAMPDONE PP") } record(bo, "QUAD:LTUS:540:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "QUAD:LTUS:540:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "QUAD:LTUS:540: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, "QUAD:LTUS:540: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(sSub, "QUAD:LTUS:540: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, "QUAD:LTUS:540:PSTYPE.RVAL") field(INPC, "QUAD:LTUS:540:TURNEDOFF.RVAL") field(INPD, "QUAD:LTUS:540:CONFIG.RVAL") field(INPE, "QUAD:LTUS:540:PSCATEGORY.RVAL") field(INPF, "QUAD:LTUS:540:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "QUAD:LTUS:540:AUTOCTRL.RVAL") field(INPJ, "QUAD:LTUS:540:OUTOFSERVICE.RVAL") field(INPL, "QUAD:LTUS:540:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "QUAD:LTUS:540:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "QUAD:LTUS:540:PAU") field(INPP, "QUAD:LTUS:540:CALBDISABLE.RVAL") field(INPQ, "QUAD:LTUS:540:PTRBDISABLE.RVAL") field(INPR, "QUAD:LTUS:540:TRIMDISABLE.RVAL") field(INPS, "QUAD:LTUS:540:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "QUAD:LTUS:540:FBCK") field(INPU, "QUAD:LTUS:540:TRIMTYPE.RVAL") field(INPV, "QUAD:LTUS:540:STDZDIRECT.RVAL") field(INPW, "QUAD:LTUS:540:DEGAUSENABLE.RVAL") field(FLNK, "QUAD:LTUS:540:HSTA") } record(longin, "QUAD:LTUS:540:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "QUAD:LTUS:540:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "QUAD:LTUS:540: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, "QUAD:LTUS:540: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, "QUAD:LTUS:540:CALBDISABLE") { field(DESC, "DAC Calb Disabled") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:540:PTRBDISABLE") { field(DESC, "Perturb Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:540:TRIMDISABLE") { field(DESC, "Trim Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:540:STDZDISABLE") { field(DTYP, "Raw Soft Channel") field(ZNAM, "NO") field(ONAM, "YES") field(DESC, "Standardize Function") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } # This PV has been replaced by QUAD:LTUS:540:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses QUAD:LTUS:540:FBCK. # This PV should be replaced by QUAD:LTUS:540: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, "QUAD:LTUS:540: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, "QUAD:LTUS:540: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, "QUAD:LTUS:540: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, "") field(OMSL, "supervisory") field(FLNK, "QUAD:LTUS:540:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"QUAD:LTUS:540:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "QUAD:LTUS:540:OUTOFSERVICE NPP NMS") field(OUT, "QUAD:LTUS:540:ONLINE PP") } record(bo, "QUAD:LTUS:540:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "QUAD:LTUS:540: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, "1") } record(bo, "QUAD:LTUS:540: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, "1") } record(bo, "QUAD:LTUS:540: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, "QUAD:LTUS:540: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, "QUAD:LTUS:540: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, "QUAD:LTUS:540: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, "QUAD:LTUS:540: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, "QUAD:LTUS:540: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, "1") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:540: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, "1") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:540: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, "2") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:540: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, "2") field(ASG, "NOWRITE") field(FLNK, "QUAD:LTUS:540:TRIMTYPE") } record(stringout, "QUAD:LTUS:540:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "QUAD:LTUS:540:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "QUAD:LTUS:540:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "QUAD:LTUS:540:STATE.RVAL") field(INPB, "QUAD:LTUS:540:INTLKSUMY.RVAL") field(OUT, "QUAD:LTUS:540:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:LTUS:540: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, "QUAD:LTUS:540:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "QUAD:LTUS:540:STATE.RVAL") field(INPB, "QUAD:LTUS:540:INTLKSUMY.RVAL") field(OUT, "QUAD:LTUS:540:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:LTUS:540:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "QUAD:LTUS:540:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "QUAD:LTUS:540: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, "QUAD:LTUS:540:RAMPSTARTDLY") { field(DESC, "Tansition to ramp delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "2") } ######### For PSTYPE=2 Only ############# record(mbbo, "QUAD:LTUS:540: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, "QUAD:LTUS:540: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,"QUAD:LTUS:540: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("QUAD:LTUS:540:TURNEDOFF",3140,1907,0,1,"QUAD:LTUS:540:TURNEDOFF") #! 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, "QUAD:LTUS:570:IACT") { field(DESC, "Current") field(INP, "PSC:LTUS:MG12:IACT") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "-165.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "QUAD:LTUS:570:BACT") info(autosaveFields,"HYST") } record(bi, "QUAD:LTUS:570:STATE") { field(DESC, "PS On/Off Status") field(DTYP, "Raw Soft Channel") field(INP, "PSC:LTUS:MG12:STATE NPP MS") field(ZSV, "MAJOR") field(ZNAM, "OFF") field(ONAM, "ON") } record(ao, "QUAD:LTUS:570:IDES") { field(DESC, "Desired Current") field(PREC, "3") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "-165.0") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(MDEL, "-1") field(HIHI, "165.0") field(LOLO, "-165.0") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "QUAD:LTUS:570:BDELTAS") field(DRVH, "165.0") field(DRVL, "-165.0") field(DOL, "QUAD:LTUS:570: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, "QUAD:LTUS:570:ICTRL PP") } # This record is processed by QUAD:LTUS:570:ICON") # Note: we are not setting alarms here. record(ao, "QUAD:LTUS:570:ICON") { field(DESC, "Config I") field(DTYP, "Soft Channel") field(PREC, "3") field(HOPR, "165.0") field(LOPR, "-165.0") field(DRVH, "165.0") field(DRVL, "-165.0") field(DOL, "QUAD:LTUS:570:B2ICON.K") field(OMSL, "closed_loop") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:570:INOM") { field(DESC, "Nominal Current") field(DOL, "QUAD:LTUS:570:BNOM.K") field(OMSL, "closed_loop") field(PREC, "3") field(EGU, "A") field(DRVH, "165.0") field(DRVL, "-165.0") field(HOPR, "165.0") field(LOPR, "-165.0") } record(ao, "QUAD:LTUS:570:ICTRL") { field(DESC, "Set Current") field(PREC, "3") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "-165.0") field(DRVH, "165.0") field(DRVL, "-165.0") field(MDEL, "-1") field(FLNK, "QUAD:LTUS:570:ICTRLGO") field(OMSL, "supervisory") info(autosavefields,"VAL") } record(seq, "QUAD:LTUS:570:ICTRLGO") { field(DESC, "Process Current Setpoint") field(PREC, "3") # Set ISETPT to supervisory field(DOL1, "0") field(LNK1, "QUAD:LTUS:570:ISETPT.OMSL") field(DOL2, "QUAD:LTUS:570:ICTRL") field(LNK2, "QUAD:LTUS:570:ISETPT PP") # Set ISETPT to closed loop - get data from BCTRLSUB.K field(DOL3, "1") field(LNK3, "QUAD:LTUS:570:ISETPT.OMSL") } record(ao, "QUAD:LTUS:570:IMAX") { field(DESC, "Max I") field(DTYP, "Soft Channel") field(DRVH, "165.0") field(DRVL, "-165.0") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "-165.0") field(PREC, "3") field(PINI, "YES") field(VAL, "165.0") field(FLNK, "QUAD:LTUS:570:IMIN") } record(ao, "QUAD:LTUS:570:IMIN") { field(DESC, "Min I") field(DTYP, "Soft Channel") field(DRVH, "165.0") field(DRVL, "-165.0") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "-165.0") field(PREC, "3") field(VAL, "-165.0") field(FLNK, "QUAD:LTUS:570:IRANGE") } record(sel, "QUAD:LTUS:570:IACTPREVOK") { field(DESC, "Last Good Current") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "-165.0") field(PREC, "3") field(NVL, "QUAD:LTUS:570:BACT.SEVR") field(INPA, "QUAD:LTUS:570:IACT NPP MS") field(INPB, "QUAD:LTUS:570:IACTPREVOK NPP MS") field(INPC, "QUAD:LTUS:570:IACTPREVOK NPP MS") field(INPD, "QUAD:LTUS:570:IACTPREVOK NPP MS") } record(sub, "QUAD:LTUS:570:IACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:570:IDES") field(INPB, "QUAD:LTUS:570:ISETPT.DRVH") field(INPC, "QUAD:LTUS:570:ISETPT.DRVL") field(INPD, "QUAD:LTUS:570:IDELTAS.I") field(INPE, "QUAD:LTUS:570:IDELTAS.J") field(INPG, "QUAD:LTUS:570:STATE") field(INPH, "QUAD:LTUS:570:HSTA") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "-165.0") field(PREC, "3") field(BRSV, "INVALID") } record(sub, "QUAD:LTUS:570:IMONLIMITS") { field(DESC, "Aux Current Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:570:IDES") field(INPB, "QUAD:LTUS:570:ISETPT.DRVH") field(INPC, "QUAD:LTUS:570:ISETPT.DRVL") field(INPD, "QUAD:LTUS:570:IDELTAS.K") field(INPE, "QUAD:LTUS:570:IDELTAS.L") field(INPG, "QUAD:LTUS:570:STATE") field(INPH, "QUAD:LTUS:570:HSTA") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "-165.0") field(PREC, "3") field(BRSV, "INVALID") } record(seq, "QUAD:LTUS:570:ILIMITS") { field(DESC, "Set ACT and MON Limits") field(PREC, "3") field(DOL1, "QUAD:LTUS:570:BLIMITS") field(LNK1, "QUAD:LTUS:570:IACTLIMITS.F PP") field(DOL2, "QUAD:LTUS:570:IACTLIMITS.I") field(LNK2, "QUAD:LTUS:570:IACT.HIGH") field(DOL3, "QUAD:LTUS:570:IACTLIMITS.J") field(LNK3, "QUAD:LTUS:570:IACT.LOW") field(DOL4, "QUAD:LTUS:570:IACTLIMITS.K") field(LNK4, "QUAD:LTUS:570:IACT.HIHI") field(DOL5, "QUAD:LTUS:570:IACTLIMITS.L") field(LNK5, "QUAD:LTUS:570:IACT.LOLO") field(DOL6, "QUAD:LTUS:570:BLIMITS") field(LNK6, "QUAD:LTUS:570:IMONLIMITS.F PP") field(DOL7, "QUAD:LTUS:570:IMONLIMITS.I") field(LNK7, "QUAD:LTUS:570:IMON.HIGH") field(DOL8, "QUAD:LTUS:570:IMONLIMITS.J") field(LNK8, "QUAD:LTUS:570:IMON.LOW") field(DOL9, "QUAD:LTUS:570:IMONLIMITS.K") field(LNK9, "QUAD:LTUS:570:IMON.HIHI") field(DOLA, "QUAD:LTUS:570:IMONLIMITS.L") field(LNKA, "QUAD:LTUS:570: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, "QUAD:LTUS:570:IDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntRawDeltas") field(INPD, "QUAD:LTUS:570:TRIMBTOL") field(INPE, "QUAD:LTUS:570:CHCKBTOL") field(INPF, "QUAD:LTUS:570:BDELTAS.K") field(INPG, "QUAD:LTUS:570:BDELTAS.L") field(INPH, "QUAD:LTUS:570: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, "QUAD:LTUS:570:STDZITOLR") field(INPC, "QUAD:LTUS:570:STDZITOL") field(FLNK, "") } # All ps controllers with on/off control will set the macro ONOF # as follows: # # ONOF = PSC:LTUS:MG12: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, "QUAD:LTUS:570:STATESETPT") { field(DESC, "PS On/Off") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFF") field(ONAM, "ON") field(OUT, "PSC:LTUS:MG12:STATESETPT PP") 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 = PSC:LTUS:MG12:RESET PP # record(bo, "QUAD:LTUS:570:RESET") { field(DESC, "Interlock Latch Reset") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFF") field(ONAM, "ON") field(HIGH, "1.0") field(OUT, "PSC:LTUS:MG12:RESET PP") } record(bo, "QUAD:LTUS:570:RAMPSTATE") { field(DESC, "PS Ramp Status") field(DTYP, "Soft Channel") field(DOL, "PSC:LTUS:MG12:RAMPSTATE NPP 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, "QUAD:LTUS:570: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, "QUAD:LTUS:570:TRIMRAMPRATE") field(OUT, "PSC:LTUS:MG12:IRAMPRATE PP") field(FLNK, "QUAD:LTUS:570:STDZDLY") } record(ao, "QUAD:LTUS:570:ISETPT") { field(DESC, "Current Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "-165.0") field(DRVH, "165.0") field(DRVL, "-165.0") field(MDEL, "-1") field(OUT, "PSC:LTUS:MG12:ISETPT PP") field(DOL, "QUAD:LTUS:570: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, "QUAD:LTUS:570:IMON") { field(DESC, "Aux Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(INP, "PSC:LTUS:MG12:IMON") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "-165.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "QUAD:LTUS:570:BMON") } record(ao, "QUAD:LTUS:570:IRIPL") { field(DESC, "Ripple Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(DOL, "PSC:LTUS:MG12:IRIPL NPP NMS") field(OMSL, "closed_loop") field(EGU, "A") field(DRVH, "1.0") field(HOPR, "1.0") field(PREC, "3") field(FLNK, "QUAD:LTUS:570:IRIPLOK") } record(sub, "QUAD:LTUS:570:IRIPLOK") { field(DESC, "Ripple Current Status") field(INAM, "mgntInit") field(SNAM, "mgntRiplOK") field(INPA, "QUAD:LTUS:570:IRIPL.VAL") field(INPB, "QUAD:LTUS:570: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, "QUAD:LTUS:570:R") { field(DESC, "Resistance") field(EGU, "Ohms") field(PREC, "4") field(PINI, "YES") field(DOL, "PSC:LTUS:MG12:R NPP MS") 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, "QUAD:LTUS:570:IGND") { field(DESC, "Ground Current") field(EGU, "A") field(PREC, "6") field(PINI, "YES") field(DOL, "PSC:LTUS:MG12:IGND NPP MS") field(OMSL, "closed_loop") } record(bi, "QUAD:LTUS:570:INTLKSUMY") { field(DESC, "Interlock Summary") field(INP, "PSC:LTUS:MG12:INTLKSUMY NPP MS") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(ZNAM, "OK") field(ONAM, "FAULT") field(PINI, "NO") } record(mbbo, "QUAD:LTUS:570: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, "PSC:LTUS:MG12:COOLING") field(OMSL, "closed_loop") } # The following PV is processed by :BACTFO # which is processed by :BACT record(fanout, "QUAD:LTUS:570:IACTFO") { field(DESC, "IACT processing") field(SELM, "All") field(LNK1, "QUAD:LTUS:570:IACTPREVOK") field(LNK2, "QUAD:LTUS:570:IDIFF") field(LNK3, "QUAD:LTUS:570:IADIFF") field(LNK4, "QUAD:LTUS:570:IRATIO") field(LNK5, "QUAD:LTUS:570:IDIRECT") field(LNK6, "QUAD:LTUS:570:IACTPOL_CHECK") } record(calc, "QUAD:LTUS:570:IDIFF") { field(DESC, "IDES-IACT") field(CALC, "A-B") field(INPA, "QUAD:LTUS:570:IDES") field(INPB, "QUAD:LTUS:570:IACT") field(EGU, "A") field(PREC, "9") field(HOPR, "165.0") field(LOPR, "-165.0") } record(calc, "QUAD:LTUS:570:IADIFF") { field(DESC, "Absolute IDES-IACT") field(CALC, "A<0?ABS(A):A") field(INPA, "QUAD:LTUS:570:IDIFF") field(PREC, "9") } record(calc, "QUAD:LTUS:570:IRATIO") { field(DESC, "IDES-IACT/IMAX") field(CALC, "B?A/B:0") field(INPA, "QUAD:LTUS:570:IDIFF") field(INPB, "QUAD:LTUS:570:IDES.DRVH") field(PREC, "9") } record(calcout, "QUAD:LTUS:570:IRANGE") { field(DESC, "Current Range") field(PINI, "YES") field(CALC, "ABS(A-B)") field(INPA, "QUAD:LTUS:570:IMIN") field(INPB, "QUAD:LTUS:570: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, "QUAD:LTUS:570: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, "QUAD:LTUS:570:IACT") field(FLNK, "QUAD:LTUS:570:IACTPOL") } record(bo, "QUAD:LTUS:570:IACTPOL") { field(DESC, "Actual I Polarity") field(DTYP, "Raw Soft Channel") field(DOL, "QUAD:LTUS:570: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,"QUAD:LTUS:570:I*LIMITS:\n Calculate alarm and warning limits based on \n deltas from QUAD:LTUS:570:IDELTAS and the\n QUAD:LTUS:570: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,"QUAD:LTUS:570:IACT: \n Get copy of QUAD:LTUS:570:I. \n",null) #! TextBox(TB12,1280,3100,1760,3200,0,"Dialog",12,1,16777215,"QUAD:LTUS:570: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,"QUAD:LTUS:570:IDES:\n Contains raw value calculated by \nQUAD:LTUS:570: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 \nQUAD:LTUS:570:BDELTAS.\n",null) #! TextBox(TB10,56,1940,316,2340,0,"Dialog",12,1,16777215,"QUAD:LTUS:570: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 QUAD:LTUS:570: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 QUAD:LTUS:570: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,"QUAD:LTUS:570:ISETPT:\n Sets the hardware. When fast feedback is set on, this record is\n set to closed loop mode by QUAD:LTUS:570:FBCKSTART sequence. When \n the loop is closed, this record takes input calculated by \n BFBCK only. When fast feedback is set off, QUAD:LTUS:570:FBCKSTOP \n will set it back to supervisory so that the value can be set by \n QUAD:LTUS:570: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, "QUAD:LTUS:570:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:570:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "QUAD:LTUS:570:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "QUAD:LTUS:570:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "QUAD:LTUS:570:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "QUAD:LTUS:570:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "1") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "QUAD:LTUS:570: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, "QUAD:LTUS:570:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "QUAD:LTUS:570:TRIMTYPE.RVAL") field(INPB, "QUAD:LTUS:570:CONFIG.RVAL") field(OUT, "QUAD:LTUS:570:TRIMMAXNUM PP") } record(longout, "QUAD:LTUS:570: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, "QUAD:LTUS:570: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, "") field(OMSL, "supervisory") field(VAL, "10") field(OUT, "QUAD:LTUS:570:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "QUAD:LTUS:570: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, "") field(OMSL, "supervisory") field(VAL, "10") } record(bo, "QUAD:LTUS:570: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, "QUAD:LTUS:570: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, "QUAD:LTUS:570: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, "QUAD:LTUS:570:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "0") } record(ao, "QUAD:LTUS:570: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, "QUAD:LTUS:570:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "QUAD:LTUS:570: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, "QUAD:LTUS:570: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, "QUAD:LTUS:570:IMOVE") field(INPB, "QUAD:LTUS:570:IACT") field(INPC, "QUAD:LTUS:570:IRAMPRATE") field(INPD, "1.577") field(INPE, "QUAD:LTUS:570:TRIMDLYPCT") field(INPF, "QUAD:LTUS:570:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "QUAD:LTUS:570:RAMPTIME_LEFT PP") } record(longout, "QUAD:LTUS:570:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "QUAD:LTUS:570:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "QUAD:LTUS:570:RAMPDONE_CALC") } record(calc, "QUAD:LTUS:570:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "QUAD:LTUS:570:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "QUAD:LTUS:570:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "QUAD:LTUS:570: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, "QUAD:LTUS:570:RAMPTIME_LEFT") field(OUT, "QUAD:LTUS:570:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "QUAD:LTUS:570:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "QUAD:LTUS:570:RAMPTIME_LEFT NMS") field(OUT, "QUAD:LTUS:570:RAMPDONE PP") } record(bo, "QUAD:LTUS:570:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "QUAD:LTUS:570:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "QUAD:LTUS:570: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, "QUAD:LTUS:570: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, "QUAD:LTUS:570:STDZINIT") { field(DESC, "Proc. Stdz PVs on boot") field(PINI, "YES") field(DOL1, "1") field(DOL2, "1") field(DOL3, "1") field(LNK1, "QUAD:LTUS:570:DEBUG.PROC PP") field(LNK2, "QUAD:LTUS:570:STDZCYCLENUM.PROC PP") field(LNK3, "QUAD:LTUS:570:STDZDISABLE.PROC PP") field(LNK4, "QUAD:LTUS:570: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, "QUAD:LTUS:570:STDZSUB") { field(DESC, "Stdz subroutine") field(INAM, "mgntStdzInit") field(SNAM, "mgntStdz") field(BRSV, "INVALID") field(INPA, "QUAD:LTUS:570:STDZIMIN NPP NMS") field(INPB, "QUAD:LTUS:570:STDZIMAX NPP NMS") field(INPC, "QUAD:LTUS:570:STDZIFINAL NPP NMS") field(INPD, "QUAD:LTUS:570:STDZCYCLENUM NPP NMS") field(INPE, "QUAD:LTUS:570:STDZDIRECT.RVAL NPP NMS") field(INPF, "QUAD:LTUS:570:STDZDISABLE.RVAL CPP NMS") field(INPG, "QUAD:LTUS:570: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, "QUAD:LTUS:570:STDZWF PP") field(OUTB, "QUAD:LTUS:570: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, "QUAD:LTUS:570:STDZWF") } record(mbbo, "QUAD:LTUS:570: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, "QUAD:LTUS:570: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, "QUAD:LTUS:570:STDZMAINPS") { field(DESC, "Stdz by main or self") field(PINI, "YES") field(DTYP, "Soft Channel") field(ZNAM, "SELF") field(ONAM, "MAIN") } record(bo, "QUAD:LTUS:570: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, "QUAD:LTUS:570: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, "QUAD:LTUS:570: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, "QUAD:LTUS:570:STDZTOD") { field(DESC, "Successful Standardize Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "QUAD:LTUS:570:STDZLOSTTOD") { field(DESC, "Standardize Lost Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(longout, "QUAD:LTUS:570:STDZCYCLECNT") { field(DESC, "Cycle Count") field(PINI, "YES") } record(longout, "QUAD:LTUS:570:STDZCYCLENUM") { field(DESC, "No. Standardize Cycles") field(VAL, "3") field(HOPR, "10") field(LOPR, "0") field(DRVH, "10") field(DRVL, "0") field(PINI, "YES") field(FLNK, "QUAD:LTUS:570:STDZDIRECT") } # The default standardize direction is "UP" for # all LCLS Magnets.. record(bo, "QUAD:LTUS:570:STDZDIRECT") { field(DESC, "Standardize Direction ") field(ZNAM, "UP") field(ONAM, "DOWN") field(VAL, "0") field(FLNK, "QUAD:LTUS:570:STDZIMIN") } record(ao, "QUAD:LTUS:570:STDZIMIN") { field(DESC, "Min-STDZ Current") field(PREC, "1") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "-165.0") field(VAL, "-165.0") field(FLNK, "QUAD:LTUS:570:STDZIMAX") } record(ao, "QUAD:LTUS:570:STDZIMAX") { field(DESC, "Max. Standarize Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "-165.0") field(VAL, "165.0") field(FLNK, "QUAD:LTUS:570:STDZIFINAL") } record(ao, "QUAD:LTUS:570:STDZIFINAL") { field(DESC, "Final SDTZ Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "-165.0") field(VAL, "-165.0") field(FLNK, "QUAD:LTUS:570: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, "QUAD:LTUS:570: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, "QUAD:LTUS:570:STDZITOL") { field(DESC, "Stdz min tolerance") field(PREC, "5") field(CALC, "MAX(ABS(A),ABS(B))*C") field(INPA, "QUAD:LTUS:570:STDZIMIN CP NMS") field(INPB, "QUAD:LTUS:570:STDZIMAX CP MMS") field(INPC, "0.05") field(INPD, "QUAD:LTUS:570:STDZITOLR CP MMS") field(EGU, "A") field(FLNK, "QUAD:LTUS:570:IDELTAS") field(PINI, "YES") } # D - factor (3.154/2 = 1.577) for EPSC, otherwise, set to 1.0 record(calc, "QUAD:LTUS:570:STDZDLY") { field(DESC, "Ramp time for stdz cycle") field(CALC, "C>0?MAX(1,ABS((A-B)/C)*D):0") field(INPA, "QUAD:LTUS:570:STDZIMIN CP NMS") field(INPB, "QUAD:LTUS:570:STDZIMAX CP NMS") field(INPC, "QUAD:LTUS:570:TRIMRAMPRATE CP NMS") field(INPD, "1.577") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") } record(calc, "QUAD:LTUS:570:STDZRAMPDLY") { field(DESC, "Ramp delay total") field(CALC, "MAX(1,((A/100)*B+B))") field(PREC, "5") field(INPA, "QUAD:LTUS:570:TRIMDLYPCT CP MS") field(INPB, "QUAD:LTUS:570: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, "QUAD:LTUS:570:STDZMINIDLY") { field(DESC, "Mini-stdz delay") field(CALC, "A") field(PREC, "5") field(A, "1.0") field(EGU, "sec") field(PINI, "YES") } record(ao, "QUAD:LTUS:570: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, "QUAD:LTUS:570:STDZMINIDELTA") { field(DESC, "Stdz mini % of IMAX") field(CALC, "(B/100)*(A-C)") field(INPA, "QUAD:LTUS:570:IDES.HOPR") field(INPB, "QUAD:LTUS:570:STDZMINIPCT CPP NMS") field(INPC, "QUAD:LTUS:570:IDES.LOPR") field(PREC, "5") } record(calc, "QUAD:LTUS:570:STDZMINISETPT") { field(DESC, "Mini Stdz delta") field(CALC, "C==0?MAX(E-D,B):MIN(E+D,A)") field(INPA, "QUAD:LTUS:570:IDES.HOPR") field(INPB, "QUAD:LTUS:570:IDES.LOPR") field(INPC, "QUAD:LTUS:570:STDZDIRECT.RVAL") field(INPD, "QUAD:LTUS:570:STDZMINIDELTA") field(INPE, "QUAD:LTUS:570:IDES") field(PREC, "5") field(FLNK, "QUAD:LTUS:570: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, "QUAD:LTUS:570:STDZMINISETPTOOR") { field(DESC, "Mini Stdz setpoint out of range") field(CALC, "C==0?(E-DA)") field(INPA, "QUAD:LTUS:570:IDES.HOPR") field(INPB, "QUAD:LTUS:570:IDES.LOPR") field(INPC, "QUAD:LTUS:570:STDZDIRECT.RVAL") field(INPD, "QUAD:LTUS:570:STDZMINIDELTA") field(INPE, "QUAD:LTUS:570: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, "QUAD:LTUS:570: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, "QUAD:LTUS:570:IADJUST.RVAL") field(INPB, "QUAD:LTUS:570:STDZDIRECT.RVAL") field(INPC, "QUAD:LTUS:570:STDZOK.RVAL") field(INPD, "QUAD:LTUS:570:STDZDISABLE.RVAL") field(INPE, "QUAD:LTUS:570:STATE.RVAL CPP NMS") field(INPF, "QUAD:LTUS:570:ICTRL.RVAL") field(INPG, "QUAD:LTUS:570:STATE.SEVR") field(INPH, "QUAD:LTUS:570:BDELTAS.M") field(INPI, "QUAD:LTUS:570:IACT.SEVR") field(OUT, "QUAD:LTUS:570:STDZLOSTGO.SELN PP NMS") field(OOPT, "Transition To Non-zero") } record(seq, "QUAD:LTUS:570:STDZLOSTGO") { field(DESC, "Process lost stdz") field(SELM, "Mask") field(DOL1, "1") field(DOL2, "0") field(LNK1, "QUAD:LTUS:570:STDZLOSTTOD.PROC") field(LNK2, "QUAD:LTUS:570:STDZOK PP") } # Record maximum current after standardize # Reset to IACT from sequence after trim # Disable processing during (mini-)standardize or trim record(calc, "QUAD:LTUS:570:STDZIACTMAX") { field(DESC, "Max act current after stdz") field(CALC, "MAX(A, B)") field(DISV, "0") field(SDIS, "QUAD:LTUS:570:CHECKPWRDIP_ENABLE") field(INPA, "QUAD:LTUS:570:IACT CP") field(INPB, "QUAD:LTUS:570:STDZIACTMAX") field(EGU, "A") field(FLNK, "QUAD:LTUS:570:CHECKPWRDIP") } # Detect power dip if STDZOK is YES, STDZ is enabled, and IACT is valid # If IACT drops below STDZIACTMAX by more than the trim tolerance, clear STDZOK # Warning: Take the absolute value of the trim tolerance, or else quads of # negative polarity will always lose STDZ since their IDELTAS.I are negative. # Note: Large quads and bends are prone to losing STDZ even if they are # perturbed toward higher current since their current tends to overshoot # by greater than the trim tolerance before settling down. record(calcout, "QUAD:LTUS:570:CHECKPWRDIP") { field(DESC, "Detect power dip") field(CALC, "(A-B>ABS(C))?3:0") field(DISV, "0") field(SDIS, "QUAD:LTUS:570:CHECKPWRDIP_ENABLE") field(INPA, "QUAD:LTUS:570:STDZIACTMAX") field(INPB, "QUAD:LTUS:570:IACT") field(INPC, "QUAD:LTUS:570:IDELTAS.I") field(OUT, "QUAD:LTUS:570:STDZLOSTGO.SELN PP NMS") field(OOPT, "When Non-zero") } # Enable processing of STDZIACTMAX and CHECKPWRDIP only if # STDZOK = YES, STDZDISABLE = NO, CTRL != Trim (2), and # CTRL != Stdz (4) record(calc, "QUAD:LTUS:570:CHECKPWRDIP_ENABLE") { field(CALC, "A&&!B&&(C#2)&&(C#4)") field(INPA, "QUAD:LTUS:570:STDZOK.RVAL CP") field(INPB, "QUAD:LTUS:570:STDZDISABLE.RVAL CP") field(INPC, "QUAD:LTUS:570:CTRL.RVAL CP") } #! 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, "QUAD:LTUS:570: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, "QUAD:LTUS:570:CALBOK") { field(DESC, "Successful Calibration") field(DTYP, "Raw Soft Channel") field(ZNAM, "NO") field(ONAM, "YES") field(DOL, "PSC:LTUS:MG12:CALBOK.RVAL") field(OMSL, "closed_loop") 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, "QUAD:LTUS:570:CALBSET") { field(DESC, "Use DAC Calbration") field(SCAN, "10 second") field(CALC, "A&&(B==0)&&C?31:960") field(INPA, "QUAD:LTUS:570:CALBOK") field(INPB, "QUAD:LTUS:570:CALBDISABLE") field(INPC, "QUAD:LTUS:570:CALBSLOPE") field(OOPT, "On Change") field(OUT, "QUAD:LTUS:570: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, "QUAD:LTUS:570:CALB_SEQ") { field(DESC, "Output Calib Values") field(SELM, "Mask") field(SELL, "QUAD:LTUS:570: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, "QUAD:LTUS:570:CALBSLOPE") field(DOL3, "QUAD:LTUS:570: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, "QUAD:LTUS:570:CALBTOD") { field(DESC, "Calibration Success Time") field(PINI, "YES") field(DOL, "PSC:LTUS:MG12:CALBTOD") field(OMSL, "closed_loop") field(DTYP, "Soft Channel") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:570: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, "QUAD:LTUS:570: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, "QUAD:LTUS:570: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, "QUAD:LTUS:570:CALBOFFSET") { field(DESC, "Calc DAC Offset") field(PREC, "6") field(EGU, "Counts") field(PINI, "YES") } record(bo, "QUAD:LTUS:570: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, "QUAD:LTUS:570:DACSLOPE") { field(DESC, "V to DAC slope") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "closed_loop") field(PINI, "YES") field(FLNK, "QUAD:LTUS:570:DACOFFSET") } # Default Offset used in conversion from Volts to DAC Counts record(ao, "QUAD:LTUS:570:DACOFFSET") { field(DESC, "V to DAC offset") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "closed_loop") field(PINI, "YES") field(FLNK, "QUAD:LTUS:570: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, "QUAD:LTUS:570: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, "QUAD:LTUS:570:IACT") field(INPD, "QUAD:LTUS:570:DACSLOPE") field(INPE, "QUAD:LTUS:570:DACOFFSET") field(EGU, "Counts") field(PREC, "6") } record(ao, "QUAD:LTUS:570:DAC") { field(DESC, "DAC Set point") field(EGU, "Counts") field(DOL, "") field(OMSL, "closed_loop") field(PREC, "6") field(PINI, "YES") } record(ao, "QUAD:LTUS:570:CALBIMIN") { field(DESC, "Calibration Min Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(DRVH, "165.0") field(HOPR, "165.0") field(DRVL, "-165.0") field(LOPR, "-165.0") field(PREC, "3") field(EGU, "A") field(VAL, "0.0") field(FLNK, "QUAD:LTUS:570:CALBIMAX") } record(ao, "QUAD:LTUS:570:CALBIMAX") { field(DESC, "Calibration Max Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(DRVH, "165.0") field(HOPR, "165.0") field(LOPR, "-165.0") field(DRVL, "-165.0") field(EGU, "A") field(VAL, "165.0") field(FLNK, "QUAD:LTUS:570:CALBSTEPNUM") } record(ao, "QUAD:LTUS:570:CALBIFINAL") { field(DESC, "Calibration Last Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(PREC, "3") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "-165.0") field(VAL, "0") } record(longout, "QUAD:LTUS:570: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, "QUAD:LTUS:570:CALBIDELTA") } record(calc, "QUAD:LTUS:570:CALBIDELTA") { field(DESC, "Step size for CALB") field(CALC, "C=0?0:ABS((A-B)/C)") field(INPA, "QUAD:LTUS:570:CALBIMAX") field(INPB, "QUAD:LTUS:570:CALBIMIN") field(INPC, "QUAD:LTUS:570: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, "QUAD:LTUS:570:CALBIMULT") { field(DESC, "IACT vs ISETPT mult") field(CALC, "C#0||A=0?1:ABS(B/A)") field(INPA, "PSC:LTUS:MG12:ISETPT.DRVH") field(INPB, "PSC:LTUS:MG12:IACT.HOPR") field(INPC, "QUAD:LTUS:570:PSCONTROLLER.RVAL CPP") field(EGU, "A") field(PINI, "YES") } # SNL dbputs DAC values here. 6-10 steps are possible. record(waveform, "QUAD:LTUS:570:CALBICTRLWF") { field(DESC, "ICTRL setpoint array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") } record(waveform, "QUAD:LTUS:570:DACWF") { field(DESC, "DAC count array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:570:DACSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:570:DACSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "QUAD:LTUS:570: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, "QUAD:LTUS:570:CALCDACWF") { field(DESC, "Calc DAC counts array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:570:CALCDACSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:570:CALCDACSA") { field(DESC, "Calc DAC counts") field(DTYP, "Soft Channel") field(INP, "QUAD:LTUS:570: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, "QUAD:LTUS:570:CALBYWF") { field(DESC, "mx + b") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:570:CALBYSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:570:CALBYSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "QUAD:LTUS:570:CALBYWF") field(MALM, "10") field(NELM, "6") field(INDX, "0") field(FTVL, "DOUBLE") } record(waveform, "QUAD:LTUS:570:CALBIACTWF") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:570:CALBIACTSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:570:CALBIACTSA") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(MALM, "10") field(NELM, "6") field(INP, "QUAD:LTUS:570:CALBIACTWF") field(INDX, "0") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:570:CALBLIMITS") } # Check that measured current during calibration is within # tolerance. record(aSub, "QUAD:LTUS:570: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, "QUAD:LTUS:570:CALBSTEPNUM") field(INPB, "QUAD:LTUS:570:CALBIACTWF") field(INPC, "QUAD:LTUS:570: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, "QUAD:LTUS:570: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, "QUAD:LTUS:570:STDZITOL") field(INPH, "QUAD:LTUS:570:DACSLOPE") field(INPI, "QUAD:LTUS:570: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, "QUAD:LTUS:570: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, "QUAD:LTUS:570:CALBSTEPNUM") field(INPB, "QUAD:LTUS:570:CALBIACTWF") field(INPC, "QUAD:LTUS:570:DACWF") field(INPF, "QUAD:LTUS:570: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 QUAD:LTUS:570CALBOK 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, "QUAD:LTUS:570:DEGAUSINIT") { field(DESC, "Proc. Degauss PVs on boot") field(PINI, "YES") field(DOL, "1") field(OUTA, "QUAD:LTUS:570:DEGAUSIMIN.PROC PP") field(OUTB, "QUAD:LTUS:570:DEGAUSIMAX.PROC PP") field(OUTC, "QUAD:LTUS:570:DEGAUSTYPE.PROC PP") field(OUTD, "QUAD:LTUS:570:DEGAUSSTEP.PROC PP") field(OUTE, "QUAD:LTUS:570:MADNAME.PROC PP") field(OUTF, "QUAD:LTUS:570:PSTYPE.PROC PP") field(OUTG, "QUAD:LTUS:570: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, "QUAD:LTUS:570:DEGAUSSUB") { field(DESC, "Degauss subroutine") field(INAM, "mgntDegaussInit") field(SNAM, "mgntDegauss") field(BRSV, "INVALID") field(INPA, "QUAD:LTUS:570:DEGAUSIMIN NPP NMS") field(INPB, "QUAD:LTUS:570:DEGAUSIMAX NPP NMS") field(INPC, "QUAD:LTUS:570:DEGAUSTYPE.RVAL NPP NMS") field(INPE, "QUAD:LTUS:570:DEGAUSMETHOD.RVAL NPP NMS") field(INPF, "QUAD:LTUS:570:PSTYPE NPP NMS") field(INPG, "QUAD:LTUS:570:DEBUG.RVAL NPP NMS") field(INPH, "QUAD:LTUS:570: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, "QUAD:LTUS:570:DEGAUSWF PP") field(OUTB, "QUAD:LTUS:570:DEGAUSMSG PP") field(OUTC, "QUAD:LTUS:570: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, "QUAD:LTUS:570:DEGAUSWF") { field(DESC, "Degauss Setpts") field(NELM, "60") field(FTVL, "DOUBLE") } record(mbbo,"QUAD:LTUS:570: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, "QUAD:LTUS:570: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, "QUAD:LTUS:570: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, "QUAD:LTUS:570: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, "QUAD:LTUS:570: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, "QUAD:LTUS:570:DEGAUSIMIN") { field(DESC, "Min. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "165.0") field(LOPR, "-165.0") field(DRVH, "165.0") field(DRVL, "-165.0") field(VAL, "-165.0") } record(ao, "QUAD:LTUS:570:DEGAUSIMAX") { field(DESC, "Max. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "165.0") field(LOPR, "-165.0") field(DRVH, "165.0") field(DRVL, "-165.0") field(VAL, "165.0") } # 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,"QUAD:LTUS:570: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, "QUAD:LTUS:570: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,"QUAD:LTUS:570: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, "QUAD:LTUS:570: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, "QUAD:LTUS:570: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, "QUAD:LTUS:570: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, "QUAD:LTUS:570:DEGAUSTOD") { field(DESC, "Successful Degauss Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "QUAD:LTUS:570:DEGAUSLOSTTOD") { field(DESC, "Degauss Lost Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:570:DEGAUSTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "QUAD:LTUS:570:DEGAUSTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "QUAD:LTUS:570: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, "QUAD:LTUS:570:DEGAUSGO") { field(DESC, "Set bdes of btrms to zero") field(ASG, "Internal") field(OUTA, "") field(OUTB, "") field(OUTC, "") field(OUTD, "") } # =========== CRYO ONLY =========== record(bo, "QUAD:LTUS:570: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, "QUAD:LTUS:570:DEGAUS_IMAX_CHECK") { field(DESC, "Check if imax shoud chg") field(CALC, "(C==4)&&(ABS(B)>ABS(A))?1:0") field(INPA, "QUAD:LTUS:570:DEGAUS_IMAX") field(INPB, "QUAD:LTUS:570:ISETPT") field(INPC, "QUAD:LTUS:570:DEGAUSTYPE.RVAL") field(OUT, "QUAD:LTUS:570:DEGAUS_IMAX_UPDATE.SELN") field(FLNK, "QUAD:LTUS:570:DEGAUS_IMAX_UPDATE") } record(seq, "QUAD:LTUS:570:DEGAUS_IMAX_UPDATE") { field(DESC, "Degauss IMAX Update") field(SELM, "Specified") field(DOL1, "QUAD:LTUS:570:ISETPT") field(LNK1, "QUAD:LTUS:570:DEGAUS_IMAX PP") } # Set the maximum current after a successful # degauss. This pv is updated by the # sequence. record(ao, "QUAD:LTUS:570:DEGAUS_IMAX") { field(DESC, "Max I set afer a degauss") field(EGU, "Amps") field(PINI, "YES") field(PREC, "6") field(HOPR, "165.0") field(LOPR, "-165.0") field(DRVH, "165.0") field(DRVL, "-165.0") field(VAL, "165.0") field(FLNK, "QUAD:LTUS:570:DEGAUS_IMAXPOL_CHECK") info(autosaveFields,"VAL,RVAL") } # Set the polarity if degauss_imax record(calcout, "QUAD:LTUS:570:DEGAUS_IMAXPOL_CHECK") { field(DESC, "Determine polarity of imax") field(CALC, "A>=0?0:1") field(INPA, "QUAD:LTUS:570:DEGAUS_IMAX") field(FLNK, "QUAD:LTUS:570:DEGAUS_IMAXPOL") } record(bo, "QUAD:LTUS:570:DEGAUS_IMAXPOL") { field(DESC, "Polarity of imax I") field(DTYP, "Raw Soft Channel") field(DOL, "QUAD:LTUS:570:DEGAUS_IMAXPOL_CHECK") field(OMSL, "closed_loop") field(ZNAM, "Positive") field(ONAM, "Negative") field(FLNK, "QUAD:LTUS:570: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, "QUAD:LTUS:570:DEGAUS_ABSIMAX") { field(DESC, "Absolute Max. Degauss I") field(CALC, "ABS(A)") field(INPA, "QUAD:LTUS:570:DEGAUS_IMAX") field(PREC, "6") field(EGU, "Amps") field(HOPR, "165.0") field(LOPR, "-165.0") info(autosaveFields,"VAL RVAL") } # IACT Polarity record(calcout, "QUAD:LTUS:570:IACTPOL_CHECK") { field(DESC, "Determine IACT polarity") field(SCAN, "5 second") field(CALC, "ABS(A-B)>C?(A>=0?0:1):D") field(INPA, "QUAD:LTUS:570:IACT") field(INPB, "QUAD:LTUS:570:IACTPOL_CHECK.LA") field(INPC, "0.0001") field(INPD, "QUAD:LTUS:570:IACTPOL_CHECK.PVAL") field(OOPT, "On Change") field(FLNK, "QUAD:LTUS:570:IACTPOL") } record(bo, "QUAD:LTUS:570: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,"QUAD:LTUS:570: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, "QUAD:LTUS:570:DEGAUSENABLE CP") field(INPB, "QUAD:LTUS:570:DEGAUSOK") field(INPC, "QUAD:LTUS:570:STATE CP") field(INPD, "QUAD:LTUS:570:STATE.SEVR") field(OUT, "QUAD:LTUS:570:DEGAUS_STATE_SEQ.SELN PP") field(ASG, "Internal") } record(seq, "QUAD:LTUS:570:DEGAUS_STATE_SEQ") { field(DESC, "Degauss State Sequence") field(SELM, "Specified") field(SELL, "QUAD:LTUS:570:DEGAUS_STATE_CHECK") field(LNK1, "QUAD:LTUS:570:DEGAUS_STATE_DISABLE.PROC PP") field(LNK2, "QUAD:LTUS:570:DEGAUS_STATE_LOST.PROC PP") field(LNK3, "QUAD:LTUS:570:DEGAUS_STATE_GOOD.PROC PP") field(LNK4, "QUAD:LTUS:570: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, "QUAD:LTUS:570:DEGAUS_STATE_DISABLE") { field(DESC, "Degauss not used") field(LNK1, "QUAD:LTUS:570:DEGAUSOK.ZSV") field(LNK2, "QUAD:LTUS:570: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, "QUAD:LTUS:570:STATMSG.FRSV") field(LNK4, "QUAD:LTUS:570: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, "QUAD:LTUS:570:DEGAUS_STATE_LOST") { field(DESC, "Degauss lost and ps On") field(DOL1, "1") field(LNK1, "QUAD:LTUS:570:DEGAUSOK.ZSV") field(LNK2, "QUAD:LTUS:570: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, "QUAD:LTUS:570:STATMSG.FRSV") field(LNK4, "QUAD:LTUS:570: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, "QUAD:LTUS:570:DEGAUS_STATE_OFF") { field(DESC, "Degaused lost and ps Off") field(DOL1, "2") field(LNK1, "QUAD:LTUS:570: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, "QUAD:LTUS:570:STATMSG.FRSV") field(LNK3, "QUAD:LTUS:570: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, "QUAD:LTUS:570:DEGAUS_STATE_GOOD") { field(DESC, "Degauss good") field(DOL1, "1") field(LNK1, "QUAD:LTUS:570: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, "QUAD:LTUS:570:STATMSG.FRSV PP") field(LNK3, "QUAD:LTUS:570:STATMSG.FVSV PP") field(LNK4, "") field(ASG, "Internal") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(mbbo, "QUAD:LTUS:570:FUNC") { field(DESC, "QUAD:LTUS:570 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, "1") field(THVL, "9") field(FRVL, "10") field(FVVL, "0") field(SXVL, "2") field(SVVL, "8") field(EIVL, "11") field(NIVL, "12") field(TEVL, "13") field(ELVL, "5") field(TVVL, "6") field(TTVL, "7") field(FTVL, "4") field(FFVL, "3") field(OUT, "QUAD:LTUS:570:CTRL CA") } # :CTRL pv is processed at boot in the # sequence mgntCtrl.st Processed in sequence # record(mbbo, "QUAD:LTUS:570:CTRL") { field(DESC, "QUAD:LTUS:570 Control") field(PINI, "NO") field(ZRST, "Ready") field(ONST, "TRIM") field(TWST, "PERTURB") field(THST, "BCON_TO_BDES") field(FRST, "BACT_TO_BDES") field(FVST, "SAVE_BDES") field(SXST, "LOAD_BDES") field(SVST, "UNDO_BDES") field(EIST, "DAC_ZERO") field(NIST, "CALB") field(TEST, "STDZ") field(ELST, "RESET") field(TVST, "TURN_ON") field(TTST, "TURN_OFF") field(FTST, "") field(FFST, "") field(ZRVL, "0") field(ONVL, "2") field(TWVL, "6") field(THVL, "15") field(FRVL, "14") field(FVVL, "11") field(SXVL, "12") field(SVVL, "13") field(EIVL, "7") field(NIVL, "3") field(TEVL, "4") field(ELVL, "8") field(TVVL, "9") field(TTVL, "10") field(FTVL, "0") field(FFVL, "0") field(OUT, "QUAD:LTUS:570:SELECTEN.A PP") field(SDIS, "0") } # If a function has been selected set this unit to busy record(calcout, "QUAD:LTUS:570:SELECTEN") { field(DESC, "Control Select Enable") field(CALC, "A>0?1:A") field(FLNK, "QUAD:LTUS:570:BUSY") } # Set to FREE on IOC reboot record(bo, "QUAD:LTUS:570:BUSY") { field(DESC, "QUAD:LTUS:570 Ctrl Done") field(DOL, "QUAD:LTUS:570:SELECTEN") field(ZNAM, "FREE") field(ONAM, "BUSY") field(PINI, "YES") field(FLNK, "QUAD:LTUS:570:SELECT") } record(bo, "QUAD:LTUS:570:SELECT") { field(ZNAM, "NO") field(ONAM, "YES") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") } record(bo, "QUAD:LTUS:570: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, "QUAD:LTUS:570:CTRLSTATE") { field(DESC, "QUAD:LTUS:570 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("QUAD:LTUS:570:CTRL",20,20,0,0,"QUAD:LTUS:570:CTRL") #! Field("QUAD:LTUS:570:CTRL.OUT",16777215,1,"QUAD:LTUS:570:CTRL.OUT") #! Link("QUAD:LTUS:570:CTRL.OUT","QUAD:LTUS:570:SELECTEN.A") #! Field("QUAD:LTUS:570:CTRL.VAL",16777215,1,"QUAD:LTUS:570:CTRL.VAL") #! Record("QUAD:LTUS:570:SELECTEN",321,381,0,0,"QUAD:LTUS:570:SELECTEN") #! Field("QUAD:LTUS:570:SELECTEN.A",16777215,0,"QUAD:LTUS:570:SELECTEN.A") #! Field("QUAD:LTUS:570:SELECTEN.FLNK",16777215,1,"QUAD:LTUS:570:SELECTEN.FLNK") #! Link("QUAD:LTUS:570:SELECTEN.FLNK","QUAD:LTUS:570:BUSY") #! Field("QUAD:LTUS:570:SELECTEN.VAL",16777215,1,"QUAD:LTUS:570:SELECTEN.VAL") #! Record("QUAD:LTUS:570:BUSY",623,274,0,0,"QUAD:LTUS:570:BUSY") #! Field("QUAD:LTUS:570:BUSY.DOL",16777215,0,"QUAD:LTUS:570:BUSY.DOL") #! Link("QUAD:LTUS:570:BUSY.DOL","QUAD:LTUS:570:SELECTEN.VAL") #! Field("QUAD:LTUS:570:BUSY.FLNK",16777215,1,"QUAD:LTUS:570:BUSY.FLNK") #! Link("QUAD:LTUS:570:BUSY.FLNK","QUAD:LTUS:570:SELECT") #! Record("QUAD:LTUS:570:SELECT",669,508,0,1,"QUAD:LTUS:570:SELECT") #! Record("QUAD:LTUS:570:FUNC",940,120,0,0,"QUAD:LTUS:570:FUNC") #! Field("QUAD:LTUS:570:FUNC.OUT",16777215,0,"QUAD:LTUS:570:FUNC.OUT") #! Link("QUAD:LTUS:570:FUNC.OUT","QUAD:LTUS:570:CTRL.VAL") #! Record("QUAD:LTUS:570:ABORT",193,41,0,0,"QUAD:LTUS:570:ABORT") #! Record("QUAD:LTUS:570:CTRLSTATE",369,34,0,0,"QUAD:LTUS:570: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,"QUAD:LTUS:570:SELECT is used for Multi-device selection.\nIt is enabled when associated QUAD:LTUS:570:CTRL is \"0\" (DONE).\nIt is disabled when associated QUAD:LTUS:570: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,"QUAD:LTUS:570: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, "QUAD:LTUS:570:BCTRL_INIT") { field(DESC, "Process BCTRL on boot") field(PINI, "YES") field(CALC, "A=3?1:0") field(INPA, "QUAD:LTUS:570:BCTRL.SEVR") field(OUT, "QUAD:LTUS:570: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, "QUAD:LTUS:570:BACT") { field(DESC, "Actual B") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "QUAD:LTUS:570:BACT") field(INPB, "QUAD:LTUS:570:POLYCOEF") field(INPC, "QUAD:LTUS:570:POLYCOEF.A") field(INPD, "QUAD:LTUS:570:POLYCOEF.B") field(INPE, "QUAD:LTUS:570:IACT MS") field(INPF, "QUAD:LTUS:570:BDELTAS PP") field(INPG, "100") field(EGU, "kG") field(HOPR, "150.01136") field(LOPR, "-152.248") field(HIHI, "150.01136") field(LOLO, "-152.248") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "150.01136") field(LOW, "-152.248") field(FLNK, "QUAD:LTUS:570: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, "QUAD:LTUS:570:BDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntPhyDeltas") field(EGU, "kG") field(HOPR, "1") field(PREC, "7") field(BRSV, "INVALID") field(INPA, "QUAD:LTUS:570:BDES") field(INPB, "QUAD:LTUS:570:TRIMBTOL") field(INPC, "QUAD:LTUS:570:TRIMBTOLR") field(INPD, "QUAD:LTUS:570:CHCKBTOL") field(INPE, "QUAD:LTUS:570:CHCKBTOLR") field(F, "2.0") field(INPG, "30") field(INPH, "QUAD:LTUS:570:BACT.VAL") # # MPS absolute and relative tolerances field(INPP, "QUAD:LTUS:570:MPSBTOL") field(INPQ, "QUAD:LTUS:570:MPSBTOLR") field(FLNK, "QUAD:LTUS:570:BCONLIMITS") info(autosaveFields,"F") } # This record is processed by BDELTAS record(aSub, "QUAD:LTUS:570:BCONLIMITS") { field(DESC, "Config B-field Limits") field(INAM, "mgntInit") field(SNAM, "mgntBCONLimits") field(INPA, "QUAD:LTUS:570:BDES") field(INPB, "QUAD:LTUS:570:BDELTAS.I") field(INPG, "QUAD:LTUS:570:DEBUG.RVAL") field(FTA, "DOUBLE") field(FTB, "DOUBLE") field(FTG, "ULONG") field(OUTA, "QUAD:LTUS:570:BCON.HIGH") field(OUTB, "QUAD:LTUS:570:BCON.LOW") field(OUTC, "QUAD:LTUS:570:BCON.HIHI") field(OUTD, "QUAD:LTUS:570:BCON.LOLO PP") field(FTVA, "DOUBLE") field(FTVB, "DOUBLE") field(FTVC, "DOUBLE") field(FTVD, "DOUBLE") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:570:IDELTAS") } # The following PV is processed by :BACT # which is processed by :BACT # record(fanout, "QUAD:LTUS:570:BACTFO") { field(DESC, "BACT processing") field(SELM, "All") field(LNK1, "QUAD:LTUS:570:BDIFF") field(LNK2, "QUAD:LTUS:570:BADIFF") field(LNK3, "QUAD:LTUS:570:BRATIO") field(LNK4, "QUAD:LTUS:570:MPSLIMITS") field(LNK5, "QUAD:LTUS:570:I2BSTATUS") field(LNK6, "QUAD:LTUS:570:IACTFO.PROC") } record(calc, "QUAD:LTUS:570:BDIFF") { field(DESC, "BDES-BACT") field(CALC, "A-B") field(INPA, "QUAD:LTUS:570:BDES") field(INPB, "QUAD:LTUS:570:BACT") field(EGU, "kG") field(PREC, "7") } record(calc, "QUAD:LTUS:570:BADIFF") { field(DESC, "Absolute BDES-BACT") field(INPA, "QUAD:LTUS:570:BDIFF") field(EGU, "kG") field(PREC, "7") field(CALC, "A<0?ABS(A):A") } record(calc, "QUAD:LTUS:570:BRATIO") { field(DESC, "BACT Error") field(CALC, "B?A/B:0") field(INPA, "QUAD:LTUS:570:BDIFF") field(INPB, "QUAD:LTUS:570:BDES.HOPR") field(EGU, "kG") field(PREC, "7") } record(mbbi, "QUAD:LTUS:570: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, "QUAD:LTUS:570:BACT.J") } # Note: for a string slave set the MONFL # macro to the following: # MONFL=:IMONCALC MS record(sub, "QUAD:LTUS:570:BMON") { field(DESC, "Second Transductor") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "QUAD:LTUS:570:BMON") field(INPB, "QUAD:LTUS:570:POLYCOEF") field(INPC, "QUAD:LTUS:570:POLYCOEF.A") field(INPD, "QUAD:LTUS:570:POLYCOEF.B") field(INPE, "QUAD:LTUS:570:IMON MS") field(INPF, "QUAD:LTUS:570:BDELTAS.VAL") field(INPG, "100") field(EGU, "kG") field(HOPR, "150.01136") field(LOPR, "-152.248") field(HIHI, "150.01136") field(LOLO, "-152.248") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "150.01136") field(LOW, "-152.248") } # 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=PSC:LTUS:MG12:BDES CP record(ao, "QUAD:LTUS:570:BDES") { field(DESC, "Desired B-Field") field(PINI, "YES") field(DRVH, "150.01136") field(DRVL, "-152.248") field(HOPR, "150.01136") field(LOPR, "-152.248") field(PREC, "7") field(EGU, "kG") field(MDEL, "-1") field(OMSL, "supervisory") # field(DOL, "") field(OUT, "QUAD:LTUS:570:B2IDES PP") info(autosaveFields,"VAL") } record(sub, "QUAD:LTUS:570:B2IDES") { field(DESC, "Convert Desired B-Field to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:570:POLYCOEF") field(INPC, "QUAD:LTUS:570:POLYCOEF.A") field(INPD, "QUAD:LTUS:570:POLYCOEF.B") field(PREC, "7") field(EGU, "kG") field(HOPR, "150.01136") field(LOPR, "-152.248") field(MDEL, "-1") field(INPE, "QUAD:LTUS:570:BDES.DRVH") field(INPF, "QUAD:LTUS:570:BDES.DRVL") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:570:IDES") } record(sub, "QUAD:LTUS:570:BNOM") { field(DESC, "Nominal Field") field(PINI, "YES") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:570:POLYCOEF") field(INPC, "QUAD:LTUS:570:POLYCOEF.A") field(INPD, "QUAD:LTUS:570:POLYCOEF.B") field(INPE, "QUAD:LTUS:570:BDES.DRVH") field(INPF, "QUAD:LTUS:570:BDES.DRVL") field(EGU, "kG") field(HOPR, "150.01136") field(LOPR, "-152.248") field(PREC, "7") field(VAL, "0.0") field(FLNK, "QUAD:LTUS:570:INOM") } record(sub, "QUAD:LTUS:570:BACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:570:BDES.VAL") field(INPB, "QUAD:LTUS:570:BDES.DRVH") field(INPC, "QUAD:LTUS:570:BDES.DRVL") field(INPD, "QUAD:LTUS:570:BDELTAS.I") field(INPE, "QUAD:LTUS:570:BDELTAS.J") field(INPG, "QUAD:LTUS:570:STATE") field(INPH, "QUAD:LTUS:570:HSTA") field(EGU, "kG") field(HOPR, "150.01136") field(LOPR, "-152.248") field(PREC, "7") field(BRSV, "INVALID") } record(sub, "QUAD:LTUS:570:BMONLIMITS") { field(DESC, "MON Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:570:BDES.VAL") field(INPB, "QUAD:LTUS:570:BDES.DRVH") field(INPC, "QUAD:LTUS:570:BDES.DRVL") field(INPD, "QUAD:LTUS:570:BDELTAS.K") field(INPE, "QUAD:LTUS:570:BDELTAS.L") field(INPG, "QUAD:LTUS:570:STATE") field(INPH, "QUAD:LTUS:570:HSTA") field(EGU, "kG") field(HOPR, "150.01136") field(LOPR, "-152.248") field(PREC, "7") field(BRSV, "INVALID") } record(seq, "QUAD:LTUS:570:BLIMITS") { field(DESC, "ACT Limits") field(PREC, "7") field(DOL1, "QUAD:LTUS:570:BLIMITS") field(LNK1, "QUAD:LTUS:570:BACTLIMITS.F PP") field(DOL2, "QUAD:LTUS:570:BACTLIMITS.I") field(LNK2, "QUAD:LTUS:570:BACT.HIGH") field(DOL3, "QUAD:LTUS:570:BACTLIMITS.J") field(LNK3, "QUAD:LTUS:570:BACT.LOW") field(DOL4, "QUAD:LTUS:570:BACTLIMITS.K") field(LNK4, "QUAD:LTUS:570:BACT.HIHI") field(DOL5, "QUAD:LTUS:570:BACTLIMITS.L") field(LNK5, "QUAD:LTUS:570:BACT.LOLO") field(DOL6, "QUAD:LTUS:570:BLIMITS") field(LNK6, "QUAD:LTUS:570:BMONLIMITS.F PP") field(DOL7, "QUAD:LTUS:570:BMONLIMITS.I") field(LNK7, "QUAD:LTUS:570:BMON.HIGH") field(DOL8, "QUAD:LTUS:570:BMONLIMITS.J") field(LNK8, "QUAD:LTUS:570:BMON.LOW") field(DOL9, "QUAD:LTUS:570:BMONLIMITS.K") field(LNK9, "QUAD:LTUS:570:BMON.HIHI") field(DOLA, "QUAD:LTUS:570:BMONLIMITS.L") field(LNKA, "QUAD:LTUS:570:BMON.LOLO") field(FLNK, "QUAD:LTUS:570:ILIMITS") field(SCAN, "5 second") } record(ao, "QUAD:LTUS:570:BCTRL") { field(DESC, "B-Perturb") field(PREC, "7") field(EGU, "kG") field(DRVH, "150.01136") field(DRVL, "-152.248") field(HOPR, "150.01136") field(LOPR, "-152.248") # 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, "QUAD:LTUS:570: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, "QUAD:LTUS:570:BCTRLGO") { field(DESC, "Update DES and perturb") field(PREC, "7") # Disable BACT limits field(DOL1, "1") field(LNK1, "QUAD:LTUS:570:BLIMITS.VAL") # Update BDES with the BCTRL (slider) value field(DOL2, "QUAD:LTUS:570:BCTRL.VAL") field(LNK2, "QUAD:LTUS:570:BDES PP") field(DOL3, "1") field(LNK3, "QUAD:LTUS:570:IDIRECT.PROC PP") field(DOL4, "1") field(LNK4, "QUAD:LTUS:570:CHECKSTDZLOST.PROC PP") field(DOL5, "QUAD:LTUS:570:BCTRL.VAL") field(LNK5, "QUAD:LTUS:570:BCTRLSUB PP") # Re-enable BACT limits field(DOL6, "0") field(LNK6, "QUAD:LTUS:570:BLIMITS.VAL") } # Convert B-field to Current and output to ISETPT record(sub, "QUAD:LTUS:570:BCTRLSUB") { field(DESC, "Feedback") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:570:POLYCOEF") field(INPC, "QUAD:LTUS:570:POLYCOEF.A") field(INPD, "QUAD:LTUS:570:POLYCOEF.B") field(INPE, "QUAD:LTUS:570:BDES.DRVH") field(INPF, "QUAD:LTUS:570:BDES.DRVL") field(PREC, "7") field(EGU, "kG") field(HOPR, "150.01136") field(LOPR, "-152.248") field(MDEL, "-1") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:570:ISETPT") } record(ao, "QUAD:LTUS:570:BDESPREVTRIM") { field(DESC, "trim bdes for undo") field(DTYP, "Soft Channel") field(DRVH, "150.01136") field(DRVL, "-152.248") field(EGU, "kG") field(HOPR, "150.01136") field(LOPR, "-152.248") field(PREC, "7") field(PINI, "YES") info(autosaveFields,"VAL") } record(stringin, "QUAD:LTUS:570:MADNAME") { field(DESC, "MAD deck nomenclature") field(PINI, "YES") field(VAL, "QVM3B") } record(ai, "QUAD:LTUS:570: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, "3389.600212") } record(ao, "QUAD:LTUS:570:BMAX") { field(DESC, "Max B-Field") field(DTYP, "Soft Channel") field(DRVH, "150.01136") field(DRVL, "-152.248") field(EGU, "kG") field(HOPR, "150.01136") field(LOPR, "-152.248") field(PREC, "7") field(PINI, "YES") field(VAL, "150.01136") field(FLNK, "QUAD:LTUS:570:BSTEP") } record(ao, "QUAD:LTUS:570:BMIN") { field(DESC, "Min B-Field") field(DTYP, "Soft Channel") field(DRVH, "150.01136") field(DRVL, "-152.248") field(EGU, "kG") field(HOPR, "150.01136") field(LOPR, "-152.248") field(PREC, "7") field(PINI, "YES") field(VAL, "-152.248") field(FLNK, "QUAD:LTUS:570:BSTEP") } record(ao, "QUAD:LTUS:570:BDESSAVE") { field(DESC, "bdes for save/load") field(DTYP, "Soft Channel") field(DRVH, "150.01136") field(DRVL, "-152.248") field(EGU, "kG") field(HOPR, "150.01136") field(LOPR, "-152.248") field(PINI, "YES") field(PREC, "7") } # This record is processed by QUAD:LTUS:570: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, "QUAD:LTUS:570:BCON") { field(DESC, "Config B-Field ") field(DTYP, "Soft Channel") field(PREC, "7") field(EGU, "kG") field(HOPR, "150.01136") field(LOPR, "-152.248") field(DRVH, "150.01136") field(DRVL, "-152.248") # Set MINOR Alarm as the default, slaves will set NO_ALARM=0. field(HHSV, "MINOR") field(LLSV, "MINOR") field(HSV, "MINOR") field(LSV, "MINOR") # field(DOL , "") field(OMSL, "supervisory") field(OUT, "QUAD:LTUS:570:B2ICON PP") info(autosaveFields,"VAL") } record(sub, "QUAD:LTUS:570:B2ICON") { field(DESC, "Convert Desired ICon to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:570:POLYCOEF") field(INPC, "QUAD:LTUS:570:POLYCOEF.A") field(INPD, "QUAD:LTUS:570:POLYCOEF.B") field(PREC, "7") field(EGU, "kG") field(HOPR, "150.01136") field(LOPR, "-152.248") field(MDEL, "-1") field(INPE, "QUAD:LTUS:570:BCON.DRVH") field(INPF, "QUAD:LTUS:570:BCON.DRVL") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:570: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, "QUAD:LTUS:570:BSTEP") { field(DESC, "B-Field step size") field(CALC, "(C==3)||(D==3)?0:ABS(A-B)*0.005") field(INPA, "QUAD:LTUS:570:BMAX") field(INPB, "QUAD:LTUS:570:BMIN") field(INPC, "QUAD:LTUS:570:BMIN.SEVR") field(INPD, "QUAD:LTUS:570:BMAX.SEVR") field(EGU, "kG") 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,"QUAD:LTUS:570:BCTRLDISABLECALC") { field(DESC, "Calc for disabling BCTRL") field(ASG, "Internal") field(CALC, "A?2:1") field(INPA, "QUAD:LTUS:570:ONLINE CP") field(OUT, "QUAD:LTUS:570:BCTRLDISABLEFOUT PP") } record(fanout, "QUAD:LTUS:570:BCTRLDISABLEFOUT") { field(DESC, "Disable BCTRL fanout") field(SELM, "Specified") field(SELL, "QUAD:LTUS:570:BCTRLDISABLECALC") field(LNK1, "QUAD:LTUS:570:BCTRLDISABLE") field(LNK2, "QUAD:LTUS:570:BCTRLENABLE") } record(stringout, "QUAD:LTUS:570:BCTRLDISABLE") { field(DESC, "Disable BCTRL") field(DTYP, "Soft Channel") field(OUT, "QUAD:LTUS:570:BCTRL.ASG") field(VAL, "NOWRITE") field(FLNK, "QUAD:LTUS:570:BCTRLDISV_UPDATE") } record(stringout, "QUAD:LTUS:570:BCTRLENABLE") { field(DESC, "Enable BCTRL") field(DTYP, "Soft Channel") field(OUT, "QUAD:LTUS:570:BCTRL.ASG") field(VAL, "") field(FLNK, "QUAD:LTUS:570:BCTRLDISV_UPDATE") } record(calcout, "QUAD:LTUS:570:BCTRLDISV_UPDATE") { field(DESC, "Calc for updating BCTRL.DISV") field(ASG, "Internal") field(CALC, "A") field(INPA, "QUAD:LTUS:570:ONLINE") field(OUT, "QUAD:LTUS:570: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,"QUAD:LTUS:570:BACT and MON\n are processed via links from \n QUAD:LTUS:570:IACT (device raw value readback 1)\n and\n QUAD:LTUS:570: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 QUAD:LTUS:570:POLYCOEF\nC = First polynomial coefficient (offset if linear)\nD = Second polynomial coefficient (slope if linear)\nE = QUAD:LTUS:570: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,"QUAD:LTUS:570:BDES\n is processed when set by CA users or \n QUAD:LTUS:570: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,"QUAD:LTUS:570: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 QUAD:LTUS:570: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 (QUAD:LTUS:570: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,"QUAD:LTUS:570:B*LIMITS and QUAD:LTUS:570:BLIMITS:\n Calculate alarm and warning limits based on \n deltas from QUAD:LTUS:570: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,"QUAD:LTUS:570: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,"QUAD:LTUS:570: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, "QUAD:LTUS:570: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, "QUAD:LTUS:570:MPSBTOL") { field(DESC, "Absolute mps tol") field(EGU, "kG") field(PREC, "2") field(CALC, "ABS(A)*0.02") field(INPA, "QUAD:LTUS:570:BMAX") field(PINI, "YES") } # # 21-Aug-2013: K. Luchini # Set channel access security so that users # cannot easily change values. record(ao, "QUAD:LTUS:570:MPSBMAX") { field(DESC, "MPS Max B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "150.01136") field(DRVL, "-152.248") field(PINI, "YES") field(VAL, "150.01136") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:570:MPSBMIN") { field(DESC, "MPS Min B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "150.01136") field(DRVL, "-152.248") field(PINI, "YES") field(VAL, "-152.248") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:570:MPSBLLIM") { field(DESC, "MPS Low Limit B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "150.01136") field(DRVL, "-152.248") field(PINI, "YES") field(VAL, "-152.248") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:570:MPSBLLIM2") { field(DESC, "MPS Low Limit #2 B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "150.01136") field(DRVL, "-152.248") field(PINI, "YES") field(VAL, "-152.248") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } # Set the default to Std record(mbbo, "QUAD:LTUS:570: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, "QUAD:LTUS:570:MPSLIMITS.E PP") } record(aSub, "QUAD:LTUS:570: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, "QUAD:LTUS:570:MPS.RVAL") field(INPB, "QUAD:LTUS:570:BADIFF") field(INPC, "QUAD:LTUS:570:BDELTAS.N") field(INPD, "QUAD:LTUS:570:BACT") field(INPE, "QUAD:LTUS:570:MPSBITMASK.RVAL") field(INPF, "QUAD:LTUS:570:MPSBLLIM") field(INPG, "QUAD:LTUS:570:MPSBMIN") field(INPH, "QUAD:LTUS:570:MPSBMAX") field(INPI, "QUAD:LTUS:570: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, "QUAD:LTUS:570:INTOL.RVAL PP") field(OUTB, "QUAD:LTUS:570:INTOL_BMIN.RVAL PP") field(OUTC, "QUAD:LTUS:570:INTOL_BRANGE.RVAL PP") field(OUTD, "QUAD:LTUS:570: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, "QUAD:LTUS:570:INTOL") { field(DESC, "BACT within MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:570:MPSLIMITS.VALA") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "QUAD:LTUS:570:INTOL_BMIN") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:570:MPSLIMITS.VALB") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "QUAD:LTUS:570:INTOL_BMIN2") { field(DESC, "MPS tol #2") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:570:MPSLIMITS.VALD") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "QUAD:LTUS:570:INTOL_BRANGE") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:570: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, "QUAD:LTUS:570:CHCKITOL") { field(DESC, "Absolute Check I Tolerance") field(EGU, "A") field(FLNK, "QUAD:LTUS:570:TRIMITOL") field(CALC, "ABS(A*B)") field(INPA, "QUAD:LTUS:570:CHCKBTOL") field(INPB, "QUAD:LTUS:570:POLYCOEF.B") field(PREC, "9") } record(calc, "QUAD:LTUS:570:TRIMBTOL") { field(EGU, "kG") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(DESC, "Absolute Trim Tolerance") field(CALC, "ABS(A)/2") field(INPA, "QUAD:LTUS:570:CHCKBTOL") field(FLNK, "QUAD:LTUS:570:CHCKITOL") } record(calc, "QUAD:LTUS:570:CHCKBTOL") { field(DESC, "Check absolute tolerance") field(EGU, "A") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(FLNK, "QUAD:LTUS:570:TRIMBTOL") field(CALC, "MAX(ABS(A),ABS(C))*(B/1000000)") field(INPA, "QUAD:LTUS:570:BDES.HOPR") field(INPB, "QUAD:LTUS:570:STABILITY") field(INPC, "QUAD:LTUS:570:BDES.LOPR") } record(longout, "QUAD:LTUS:570: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, "QUAD:LTUS:570:CHCKBTOL") } record(calc, "QUAD:LTUS:570:TRIMITOL") { field(DESC, "Absolute Trim I Tolerance") field(EGU, "kG") field(CALC, "ABS(A*B)") field(INPA, "QUAD:LTUS:570:POLYCOEF.B") field(INPB, "QUAD:LTUS:570:TRIMBTOL") field(PREC, "9") } record(ai, "QUAD:LTUS:570:TRIMBTOLR") { field(DESC, "Relative trim tol") field(PREC, "4") field(EGU, "%") field(HOPR, "1.0") field(LOPR, "0.0") field(PINI, "YES") } record(ai, "QUAD:LTUS:570: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, "QUAD:LTUS:570:FBCKFCOM") { field(ZNAM, "CA") field(ONAM, "FCOM") field(DESC, "CA Mode") field(PINI, "YES") field(SDIS, "0") } record(bo, "QUAD:LTUS:570:PAU") { field(ZNAM, "NotConfigured") field(ONAM, "Configured") field(DESC, "PAU Present") field(PINI, "YES") field(SDIS, "0") field(FLNK, "QUAD:LTUS:570:PAUGO") } record(fanout, "QUAD:LTUS:570:PAUGO") { field(DESC, "PAU control") field(LNK1, "QUAD:LTUS:570:PAUSTOP") field(LNK2, "QUAD:LTUS:570: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, "QUAD:LTUS:570:PAUSTART") { field(DESC, "Setup for PAU On") field(SDIS, "QUAD:LTUS:570: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, "QUAD:LTUS:570:PAUSTOP") { field(DESC, "Setup for PAU Off") field(SDIS, "QUAD:LTUS:570: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, "QUAD:LTUS:570:MCORDEVNAME") { field(DESC, "PS device name") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, "PSC:LTUS:MG12:") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "QUAD:LTUS:570: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, "QUAD:LTUS:570:PSTYPE.RVAL") field(INPC, "QUAD:LTUS:570:TURNEDOFF.RVAL") field(INPD, "QUAD:LTUS:570:CONFIG.RVAL") field(INPE, "QUAD:LTUS:570:PSCATEGORY.RVAL") field(INPF, "QUAD:LTUS:570:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "QUAD:LTUS:570:AUTOCTRL.RVAL") field(INPJ, "QUAD:LTUS:570:OUTOFSERVICE.RVAL") field(INPL, "QUAD:LTUS:570:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "QUAD:LTUS:570:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "QUAD:LTUS:570:PAU") field(INPP, "QUAD:LTUS:570:CALBDISABLE.RVAL") field(INPQ, "QUAD:LTUS:570:PTRBDISABLE.RVAL") field(INPR, "QUAD:LTUS:570:TRIMDISABLE.RVAL") field(INPS, "QUAD:LTUS:570:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "QUAD:LTUS:570:FBCK") field(INPU, "QUAD:LTUS:570:TRIMTYPE.RVAL") field(INPV, "QUAD:LTUS:570:STDZDIRECT.RVAL") field(INPW, "QUAD:LTUS:570:DEGAUSENABLE.RVAL") field(FLNK, "QUAD:LTUS:570:HSTA") } record(longin, "QUAD:LTUS:570:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "QUAD:LTUS:570:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "QUAD:LTUS:570: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, "QUAD:LTUS:570: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, "QUAD:LTUS:570:CALBDISABLE") { field(DESC, "DAC Calb Disabled") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:570:PTRBDISABLE") { field(DESC, "Perturb Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:570:TRIMDISABLE") { field(DESC, "Trim Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:570: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 QUAD:LTUS:570:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses QUAD:LTUS:570:FBCK. # This PV should be replaced by QUAD:LTUS:570: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, "QUAD:LTUS:570: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, "QUAD:LTUS:570: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, "QUAD:LTUS:570: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, "") field(OMSL, "supervisory") field(FLNK, "QUAD:LTUS:570:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"QUAD:LTUS:570:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "QUAD:LTUS:570:OUTOFSERVICE NPP NMS") field(OUT, "QUAD:LTUS:570:ONLINE PP") } record(bo, "QUAD:LTUS:570:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "QUAD:LTUS:570: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, "1") } record(bo, "QUAD:LTUS:570: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, "1") } record(bo, "QUAD:LTUS:570: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, "QUAD:LTUS:570: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, "QUAD:LTUS:570: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, "QUAD:LTUS:570: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, "QUAD:LTUS:570: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, "QUAD:LTUS:570: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, "1") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:570: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, "1") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:570: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, "2") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:570: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, "0") field(ASG, "NOWRITE") field(FLNK, "QUAD:LTUS:570:TRIMTYPE") } record(stringout, "QUAD:LTUS:570:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "QUAD:LTUS:570:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "QUAD:LTUS:570:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "QUAD:LTUS:570:STATE.RVAL") field(INPB, "QUAD:LTUS:570:INTLKSUMY.RVAL") field(OUT, "QUAD:LTUS:570:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:LTUS:570: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, "QUAD:LTUS:570:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "QUAD:LTUS:570:STATE.RVAL") field(INPB, "QUAD:LTUS:570:INTLKSUMY.RVAL") field(OUT, "QUAD:LTUS:570:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:LTUS:570:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "QUAD:LTUS:570:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "QUAD:LTUS:570: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, "QUAD:LTUS:570:RAMPSTARTDLY") { field(DESC, "Tansition to ramp delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "2") } ######### For PSTYPE=2 Only ############# record(mbbo, "QUAD:LTUS:570: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, "QUAD:LTUS:570: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,"QUAD:LTUS:570: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("QUAD:LTUS:570:TURNEDOFF",3140,1907,0,1,"QUAD:LTUS:570:TURNEDOFF") #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "QUAD:LTUS:570:STATSUB") { field(DESC, "Build STATus ") field(INAM, "mgntInit") field(SNAM, "mgntSlcStat") field(INPA, "QUAD:LTUS:570:BACT.STAT") field(INPB, "QUAD:LTUS:570:BDES.STAT") field(INPC, "QUAD:LTUS:570:IRIPL.STAT") field(INPD, "PSC:LTUS:MG12:ISETPT.STAT") field(INPE, "PSC:LTUS:MG12:IACT.STAT") # 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, "QUAD:LTUS:570:BACT.SEVR") field(INPH, "QUAD:LTUS:570:BDES.SEVR") field(INPI, "QUAD:LTUS:570:IRIPL.SEVR") field(INPJ, "PSC:LTUS:MG12:ISETPT.SEVR") field(INPK, "PSC:LTUS:MG12:IACT.SEVR") # # 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, "QUAD:LTUS:570:STATE.RVAL") field(INPN, "QUAD:LTUS:570:STDZOK") field(INPO, "QUAD:LTUS:570:CALBOK") field(INPP, "QUAD:LTUS:570:OUTOFSERVICE.RVAL") field(INPQ, "QUAD:LTUS:570:CONFIG.RVAL") field(INPR, "QUAD:LTUS:570:HSTA") field(INPS, "QUAD:LTUS:570:CTRL.RVAL") field(INPT, "QUAD:LTUS:570:DEGAUSOK") field(INPV, "QUAD:LTUS:570: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, "QUAD:LTUS:570:STAT") } record(longout, "QUAD:LTUS:570:STAT") { field(DESC, "STAT sent to SLC") field(SCAN, "Passive") field(FLNK, "QUAD:LTUS:570:STATCTRLSUB") field(DOL, "QUAD:LTUS:570:STATSUB.VAL") field(OMSL, "closed_loop") } record(sSub, "QUAD:LTUS:570:STATCTRLSUB") { field(DESC, "Decode SLC STAT into mbbo") field(INAM, "mgntInit") field(SNAM, "mgntStatDecode") field(INPA, "QUAD:LTUS:570:STAT") field(INPB, "QUAD:LTUS:570:HSTA") field(INPD, "QUAD:LTUS:570:ONOFFCTRL.RVAL") field(FLNK, "QUAD:LTUS:570:STATMSG") } record(mbbo, "QUAD:LTUS:570: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, "QUAD:LTUS:570:UNAVAILGO") field(DOL, "QUAD:LTUS:570:STATCTRLSUB.W") } record(seq, "QUAD:LTUS:570:UNAVAILGO") { field(DESC, "Process UNAVAIL") field(DOL1, "QUAD:LTUS:570:STATSUB.U") field(LNK1, "QUAD:LTUS:570:UNAVAIL PP") } record(stringout, "QUAD:LTUS:570:SNLSTATMSG") { field(DTYP, "Soft Channel") } #! TextBox(TB0,820,1000,1200,1220,0,"Dialog",12,1,16777215,"QUAD:LTUS:570:STATUSSUB - future\nOverall device status - takes input from action snls, record sevrs, master snl(s) and outputs final status\n\nInputs:\nA - QUAD:LTUS:570:CTRLSTATUS - snl status\nB - MGNT:CTRLSTATUS - master list status\nC\nD - QUAD:LTUS:570: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,"QUAD:LTUS:570STATSUB\nformat control bo's into slc STAT\n\nInputs:\nA - QUAD:LTUS:570:STATUS\nC - QUAD:LTUS:570:ON\nD - QUAD:LTUS:570:STDZOK\nE - QUAD:LTUS:570:CALBOK\nF - QUAD:LTUS:570:BACTDRIFT (future)\nG -\nH- QUAD:LTUS:570:DACSTATUS\nI -QUAD:LTUS:570:ADCSTATUS\nJ - QUAD:LTUS:570:BACTSTATUS\nK - QUAD:LTUS:570:BDESSTATUS\nL - QUAD:LTUS:570:RIPLSTATUS\n\nOutput:\nP - QUAD:LTUS:570: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, "QUAD:LTUS:570: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, "QUAD:LTUS:570: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, "QUAD:LTUS:570: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, "QUAD:LTUS:570: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.6 #! DBDSTART #! DBD("../../../../dbd/mgntSoft.dbd") #! DBDEND record(stringout, "QUAD:LTUS:570:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:570:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "QUAD:LTUS:570:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "QUAD:LTUS:570:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "QUAD:LTUS:570:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "QUAD:LTUS:570:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "1") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "QUAD:LTUS:570: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, "QUAD:LTUS:570:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "QUAD:LTUS:570:TRIMTYPE.RVAL") field(INPB, "QUAD:LTUS:570:CONFIG.RVAL") field(OUT, "QUAD:LTUS:570:TRIMMAXNUM PP") } record(longout, "QUAD:LTUS:570: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, "QUAD:LTUS:570: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, "") field(OMSL, "supervisory") field(VAL, "20") field(OUT, "QUAD:LTUS:570:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "QUAD:LTUS:570: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, "") field(OMSL, "supervisory") field(VAL, "10") } record(bo, "QUAD:LTUS:570: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, "QUAD:LTUS:570: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, "QUAD:LTUS:570: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, "QUAD:LTUS:570:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "0") } record(ao, "QUAD:LTUS:570: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, "QUAD:LTUS:570:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "QUAD:LTUS:570: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, "QUAD:LTUS:570: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, "QUAD:LTUS:570:IMOVE") field(INPB, "QUAD:LTUS:570:IACT") field(INPC, "QUAD:LTUS:570:IRAMPRATE") field(INPD, "1.577") field(INPE, "QUAD:LTUS:570:TRIMDLYPCT") field(INPF, "QUAD:LTUS:570:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "QUAD:LTUS:570:RAMPTIME_LEFT PP") } record(longout, "QUAD:LTUS:570:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "QUAD:LTUS:570:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "QUAD:LTUS:570:RAMPDONE_CALC") } record(calc, "QUAD:LTUS:570:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "QUAD:LTUS:570:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "QUAD:LTUS:570:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "QUAD:LTUS:570: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, "QUAD:LTUS:570:RAMPTIME_LEFT") field(OUT, "QUAD:LTUS:570:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "QUAD:LTUS:570:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "QUAD:LTUS:570:RAMPTIME_LEFT NMS") field(OUT, "QUAD:LTUS:570:RAMPDONE PP") } record(bo, "QUAD:LTUS:570:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "QUAD:LTUS:570:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "QUAD:LTUS:570: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, "QUAD:LTUS:570: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(sSub, "QUAD:LTUS:570: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, "QUAD:LTUS:570:PSTYPE.RVAL") field(INPC, "QUAD:LTUS:570:TURNEDOFF.RVAL") field(INPD, "QUAD:LTUS:570:CONFIG.RVAL") field(INPE, "QUAD:LTUS:570:PSCATEGORY.RVAL") field(INPF, "QUAD:LTUS:570:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "QUAD:LTUS:570:AUTOCTRL.RVAL") field(INPJ, "QUAD:LTUS:570:OUTOFSERVICE.RVAL") field(INPL, "QUAD:LTUS:570:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "QUAD:LTUS:570:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "QUAD:LTUS:570:PAU") field(INPP, "QUAD:LTUS:570:CALBDISABLE.RVAL") field(INPQ, "QUAD:LTUS:570:PTRBDISABLE.RVAL") field(INPR, "QUAD:LTUS:570:TRIMDISABLE.RVAL") field(INPS, "QUAD:LTUS:570:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "QUAD:LTUS:570:FBCK") field(INPU, "QUAD:LTUS:570:TRIMTYPE.RVAL") field(INPV, "QUAD:LTUS:570:STDZDIRECT.RVAL") field(INPW, "QUAD:LTUS:570:DEGAUSENABLE.RVAL") field(FLNK, "QUAD:LTUS:570:HSTA") } record(longin, "QUAD:LTUS:570:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "QUAD:LTUS:570:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "QUAD:LTUS:570: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, "QUAD:LTUS:570: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, "QUAD:LTUS:570:CALBDISABLE") { field(DESC, "DAC Calb Disabled") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:570:PTRBDISABLE") { field(DESC, "Perturb Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:570:TRIMDISABLE") { field(DESC, "Trim Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:570:STDZDISABLE") { field(DTYP, "Raw Soft Channel") field(ZNAM, "NO") field(ONAM, "YES") field(DESC, "Standardize Function") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } # This PV has been replaced by QUAD:LTUS:570:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses QUAD:LTUS:570:FBCK. # This PV should be replaced by QUAD:LTUS:570: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, "QUAD:LTUS:570: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, "QUAD:LTUS:570: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, "QUAD:LTUS:570: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, "") field(OMSL, "supervisory") field(FLNK, "QUAD:LTUS:570:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"QUAD:LTUS:570:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "QUAD:LTUS:570:OUTOFSERVICE NPP NMS") field(OUT, "QUAD:LTUS:570:ONLINE PP") } record(bo, "QUAD:LTUS:570:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "QUAD:LTUS:570: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, "1") } record(bo, "QUAD:LTUS:570: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, "1") } record(bo, "QUAD:LTUS:570: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, "QUAD:LTUS:570: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, "QUAD:LTUS:570: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, "QUAD:LTUS:570: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, "QUAD:LTUS:570: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, "QUAD:LTUS:570: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, "1") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:570: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, "1") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:570: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, "2") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:570: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, "0") field(ASG, "NOWRITE") field(FLNK, "QUAD:LTUS:570:TRIMTYPE") } record(stringout, "QUAD:LTUS:570:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "QUAD:LTUS:570:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "QUAD:LTUS:570:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "QUAD:LTUS:570:STATE.RVAL") field(INPB, "QUAD:LTUS:570:INTLKSUMY.RVAL") field(OUT, "QUAD:LTUS:570:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:LTUS:570: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, "QUAD:LTUS:570:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "QUAD:LTUS:570:STATE.RVAL") field(INPB, "QUAD:LTUS:570:INTLKSUMY.RVAL") field(OUT, "QUAD:LTUS:570:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:LTUS:570:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "QUAD:LTUS:570:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "QUAD:LTUS:570: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, "QUAD:LTUS:570:RAMPSTARTDLY") { field(DESC, "Tansition to ramp delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "2") } ######### For PSTYPE=2 Only ############# record(mbbo, "QUAD:LTUS:570: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, "QUAD:LTUS:570: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,"QUAD:LTUS:570: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("QUAD:LTUS:570:TURNEDOFF",3140,1907,0,1,"QUAD:LTUS:570:TURNEDOFF") #! 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, "QUAD:LTUS:580:IACT") { field(DESC, "Current") field(INP, "PSC:LTUS:MG13:IACT") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "-165.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "QUAD:LTUS:580:BACT") info(autosaveFields,"HYST") } record(bi, "QUAD:LTUS:580:STATE") { field(DESC, "PS On/Off Status") field(DTYP, "Raw Soft Channel") field(INP, "PSC:LTUS:MG13:STATE NPP MS") field(ZSV, "MAJOR") field(ZNAM, "OFF") field(ONAM, "ON") } record(ao, "QUAD:LTUS:580:IDES") { field(DESC, "Desired Current") field(PREC, "3") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "-165.0") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(MDEL, "-1") field(HIHI, "165.0") field(LOLO, "-165.0") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "QUAD:LTUS:580:BDELTAS") field(DRVH, "165.0") field(DRVL, "-165.0") field(DOL, "QUAD:LTUS:580: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, "QUAD:LTUS:580:ICTRL PP") } # This record is processed by QUAD:LTUS:580:ICON") # Note: we are not setting alarms here. record(ao, "QUAD:LTUS:580:ICON") { field(DESC, "Config I") field(DTYP, "Soft Channel") field(PREC, "3") field(HOPR, "165.0") field(LOPR, "-165.0") field(DRVH, "165.0") field(DRVL, "-165.0") field(DOL, "QUAD:LTUS:580:B2ICON.K") field(OMSL, "closed_loop") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:580:INOM") { field(DESC, "Nominal Current") field(DOL, "QUAD:LTUS:580:BNOM.K") field(OMSL, "closed_loop") field(PREC, "3") field(EGU, "A") field(DRVH, "165.0") field(DRVL, "-165.0") field(HOPR, "165.0") field(LOPR, "-165.0") } record(ao, "QUAD:LTUS:580:ICTRL") { field(DESC, "Set Current") field(PREC, "3") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "-165.0") field(DRVH, "165.0") field(DRVL, "-165.0") field(MDEL, "-1") field(FLNK, "QUAD:LTUS:580:ICTRLGO") field(OMSL, "supervisory") info(autosavefields,"VAL") } record(seq, "QUAD:LTUS:580:ICTRLGO") { field(DESC, "Process Current Setpoint") field(PREC, "3") # Set ISETPT to supervisory field(DOL1, "0") field(LNK1, "QUAD:LTUS:580:ISETPT.OMSL") field(DOL2, "QUAD:LTUS:580:ICTRL") field(LNK2, "QUAD:LTUS:580:ISETPT PP") # Set ISETPT to closed loop - get data from BCTRLSUB.K field(DOL3, "1") field(LNK3, "QUAD:LTUS:580:ISETPT.OMSL") } record(ao, "QUAD:LTUS:580:IMAX") { field(DESC, "Max I") field(DTYP, "Soft Channel") field(DRVH, "165.0") field(DRVL, "-165.0") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "-165.0") field(PREC, "3") field(PINI, "YES") field(VAL, "165.0") field(FLNK, "QUAD:LTUS:580:IMIN") } record(ao, "QUAD:LTUS:580:IMIN") { field(DESC, "Min I") field(DTYP, "Soft Channel") field(DRVH, "165.0") field(DRVL, "-165.0") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "-165.0") field(PREC, "3") field(VAL, "-165.0") field(FLNK, "QUAD:LTUS:580:IRANGE") } record(sel, "QUAD:LTUS:580:IACTPREVOK") { field(DESC, "Last Good Current") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "-165.0") field(PREC, "3") field(NVL, "QUAD:LTUS:580:BACT.SEVR") field(INPA, "QUAD:LTUS:580:IACT NPP MS") field(INPB, "QUAD:LTUS:580:IACTPREVOK NPP MS") field(INPC, "QUAD:LTUS:580:IACTPREVOK NPP MS") field(INPD, "QUAD:LTUS:580:IACTPREVOK NPP MS") } record(sub, "QUAD:LTUS:580:IACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:580:IDES") field(INPB, "QUAD:LTUS:580:ISETPT.DRVH") field(INPC, "QUAD:LTUS:580:ISETPT.DRVL") field(INPD, "QUAD:LTUS:580:IDELTAS.I") field(INPE, "QUAD:LTUS:580:IDELTAS.J") field(INPG, "QUAD:LTUS:580:STATE") field(INPH, "QUAD:LTUS:580:HSTA") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "-165.0") field(PREC, "3") field(BRSV, "INVALID") } record(sub, "QUAD:LTUS:580:IMONLIMITS") { field(DESC, "Aux Current Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:580:IDES") field(INPB, "QUAD:LTUS:580:ISETPT.DRVH") field(INPC, "QUAD:LTUS:580:ISETPT.DRVL") field(INPD, "QUAD:LTUS:580:IDELTAS.K") field(INPE, "QUAD:LTUS:580:IDELTAS.L") field(INPG, "QUAD:LTUS:580:STATE") field(INPH, "QUAD:LTUS:580:HSTA") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "-165.0") field(PREC, "3") field(BRSV, "INVALID") } record(seq, "QUAD:LTUS:580:ILIMITS") { field(DESC, "Set ACT and MON Limits") field(PREC, "3") field(DOL1, "QUAD:LTUS:580:BLIMITS") field(LNK1, "QUAD:LTUS:580:IACTLIMITS.F PP") field(DOL2, "QUAD:LTUS:580:IACTLIMITS.I") field(LNK2, "QUAD:LTUS:580:IACT.HIGH") field(DOL3, "QUAD:LTUS:580:IACTLIMITS.J") field(LNK3, "QUAD:LTUS:580:IACT.LOW") field(DOL4, "QUAD:LTUS:580:IACTLIMITS.K") field(LNK4, "QUAD:LTUS:580:IACT.HIHI") field(DOL5, "QUAD:LTUS:580:IACTLIMITS.L") field(LNK5, "QUAD:LTUS:580:IACT.LOLO") field(DOL6, "QUAD:LTUS:580:BLIMITS") field(LNK6, "QUAD:LTUS:580:IMONLIMITS.F PP") field(DOL7, "QUAD:LTUS:580:IMONLIMITS.I") field(LNK7, "QUAD:LTUS:580:IMON.HIGH") field(DOL8, "QUAD:LTUS:580:IMONLIMITS.J") field(LNK8, "QUAD:LTUS:580:IMON.LOW") field(DOL9, "QUAD:LTUS:580:IMONLIMITS.K") field(LNK9, "QUAD:LTUS:580:IMON.HIHI") field(DOLA, "QUAD:LTUS:580:IMONLIMITS.L") field(LNKA, "QUAD:LTUS:580: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, "QUAD:LTUS:580:IDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntRawDeltas") field(INPD, "QUAD:LTUS:580:TRIMBTOL") field(INPE, "QUAD:LTUS:580:CHCKBTOL") field(INPF, "QUAD:LTUS:580:BDELTAS.K") field(INPG, "QUAD:LTUS:580:BDELTAS.L") field(INPH, "QUAD:LTUS:580: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, "QUAD:LTUS:580:STDZITOLR") field(INPC, "QUAD:LTUS:580:STDZITOL") field(FLNK, "") } # All ps controllers with on/off control will set the macro ONOF # as follows: # # ONOF = PSC:LTUS:MG13: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, "QUAD:LTUS:580:STATESETPT") { field(DESC, "PS On/Off") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFF") field(ONAM, "ON") field(OUT, "PSC:LTUS:MG13:STATESETPT PP") 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 = PSC:LTUS:MG13:RESET PP # record(bo, "QUAD:LTUS:580:RESET") { field(DESC, "Interlock Latch Reset") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFF") field(ONAM, "ON") field(HIGH, "1.0") field(OUT, "PSC:LTUS:MG13:RESET PP") } record(bo, "QUAD:LTUS:580:RAMPSTATE") { field(DESC, "PS Ramp Status") field(DTYP, "Soft Channel") field(DOL, "PSC:LTUS:MG13:RAMPSTATE NPP 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, "QUAD:LTUS:580: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, "QUAD:LTUS:580:TRIMRAMPRATE") field(OUT, "PSC:LTUS:MG13:IRAMPRATE PP") field(FLNK, "QUAD:LTUS:580:STDZDLY") } record(ao, "QUAD:LTUS:580:ISETPT") { field(DESC, "Current Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "-165.0") field(DRVH, "165.0") field(DRVL, "-165.0") field(MDEL, "-1") field(OUT, "PSC:LTUS:MG13:ISETPT PP") field(DOL, "QUAD:LTUS:580: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, "QUAD:LTUS:580:IMON") { field(DESC, "Aux Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(INP, "PSC:LTUS:MG13:IMON") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "-165.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "QUAD:LTUS:580:BMON") } record(ao, "QUAD:LTUS:580:IRIPL") { field(DESC, "Ripple Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(DOL, "PSC:LTUS:MG13:IRIPL NPP NMS") field(OMSL, "closed_loop") field(EGU, "A") field(DRVH, "1.0") field(HOPR, "1.0") field(PREC, "3") field(FLNK, "QUAD:LTUS:580:IRIPLOK") } record(sub, "QUAD:LTUS:580:IRIPLOK") { field(DESC, "Ripple Current Status") field(INAM, "mgntInit") field(SNAM, "mgntRiplOK") field(INPA, "QUAD:LTUS:580:IRIPL.VAL") field(INPB, "QUAD:LTUS:580: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, "QUAD:LTUS:580:R") { field(DESC, "Resistance") field(EGU, "Ohms") field(PREC, "4") field(PINI, "YES") field(DOL, "PSC:LTUS:MG13:R NPP MS") 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, "QUAD:LTUS:580:IGND") { field(DESC, "Ground Current") field(EGU, "A") field(PREC, "6") field(PINI, "YES") field(DOL, "PSC:LTUS:MG13:IGND NPP MS") field(OMSL, "closed_loop") } record(bi, "QUAD:LTUS:580:INTLKSUMY") { field(DESC, "Interlock Summary") field(INP, "PSC:LTUS:MG13:INTLKSUMY NPP MS") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(ZNAM, "OK") field(ONAM, "FAULT") field(PINI, "NO") } record(mbbo, "QUAD:LTUS:580: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, "PSC:LTUS:MG13:COOLING") field(OMSL, "closed_loop") } # The following PV is processed by :BACTFO # which is processed by :BACT record(fanout, "QUAD:LTUS:580:IACTFO") { field(DESC, "IACT processing") field(SELM, "All") field(LNK1, "QUAD:LTUS:580:IACTPREVOK") field(LNK2, "QUAD:LTUS:580:IDIFF") field(LNK3, "QUAD:LTUS:580:IADIFF") field(LNK4, "QUAD:LTUS:580:IRATIO") field(LNK5, "QUAD:LTUS:580:IDIRECT") field(LNK6, "QUAD:LTUS:580:IACTPOL_CHECK") } record(calc, "QUAD:LTUS:580:IDIFF") { field(DESC, "IDES-IACT") field(CALC, "A-B") field(INPA, "QUAD:LTUS:580:IDES") field(INPB, "QUAD:LTUS:580:IACT") field(EGU, "A") field(PREC, "9") field(HOPR, "165.0") field(LOPR, "-165.0") } record(calc, "QUAD:LTUS:580:IADIFF") { field(DESC, "Absolute IDES-IACT") field(CALC, "A<0?ABS(A):A") field(INPA, "QUAD:LTUS:580:IDIFF") field(PREC, "9") } record(calc, "QUAD:LTUS:580:IRATIO") { field(DESC, "IDES-IACT/IMAX") field(CALC, "B?A/B:0") field(INPA, "QUAD:LTUS:580:IDIFF") field(INPB, "QUAD:LTUS:580:IDES.DRVH") field(PREC, "9") } record(calcout, "QUAD:LTUS:580:IRANGE") { field(DESC, "Current Range") field(PINI, "YES") field(CALC, "ABS(A-B)") field(INPA, "QUAD:LTUS:580:IMIN") field(INPB, "QUAD:LTUS:580: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, "QUAD:LTUS:580: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, "QUAD:LTUS:580:IACT") field(FLNK, "QUAD:LTUS:580:IACTPOL") } record(bo, "QUAD:LTUS:580:IACTPOL") { field(DESC, "Actual I Polarity") field(DTYP, "Raw Soft Channel") field(DOL, "QUAD:LTUS:580: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,"QUAD:LTUS:580:I*LIMITS:\n Calculate alarm and warning limits based on \n deltas from QUAD:LTUS:580:IDELTAS and the\n QUAD:LTUS:580: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,"QUAD:LTUS:580:IACT: \n Get copy of QUAD:LTUS:580:I. \n",null) #! TextBox(TB12,1280,3100,1760,3200,0,"Dialog",12,1,16777215,"QUAD:LTUS:580: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,"QUAD:LTUS:580:IDES:\n Contains raw value calculated by \nQUAD:LTUS:580: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 \nQUAD:LTUS:580:BDELTAS.\n",null) #! TextBox(TB10,56,1940,316,2340,0,"Dialog",12,1,16777215,"QUAD:LTUS:580: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 QUAD:LTUS:580: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 QUAD:LTUS:580: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,"QUAD:LTUS:580:ISETPT:\n Sets the hardware. When fast feedback is set on, this record is\n set to closed loop mode by QUAD:LTUS:580:FBCKSTART sequence. When \n the loop is closed, this record takes input calculated by \n BFBCK only. When fast feedback is set off, QUAD:LTUS:580:FBCKSTOP \n will set it back to supervisory so that the value can be set by \n QUAD:LTUS:580: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, "QUAD:LTUS:580:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:580:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "QUAD:LTUS:580:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "QUAD:LTUS:580:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "QUAD:LTUS:580:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "QUAD:LTUS:580:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "1") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "QUAD:LTUS:580: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, "QUAD:LTUS:580:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "QUAD:LTUS:580:TRIMTYPE.RVAL") field(INPB, "QUAD:LTUS:580:CONFIG.RVAL") field(OUT, "QUAD:LTUS:580:TRIMMAXNUM PP") } record(longout, "QUAD:LTUS:580: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, "QUAD:LTUS:580: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, "") field(OMSL, "supervisory") field(VAL, "10") field(OUT, "QUAD:LTUS:580:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "QUAD:LTUS:580: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, "") field(OMSL, "supervisory") field(VAL, "10") } record(bo, "QUAD:LTUS:580: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, "QUAD:LTUS:580: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, "QUAD:LTUS:580: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, "QUAD:LTUS:580:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "0") } record(ao, "QUAD:LTUS:580: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, "QUAD:LTUS:580:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "QUAD:LTUS:580: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, "QUAD:LTUS:580: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, "QUAD:LTUS:580:IMOVE") field(INPB, "QUAD:LTUS:580:IACT") field(INPC, "QUAD:LTUS:580:IRAMPRATE") field(INPD, "1.577") field(INPE, "QUAD:LTUS:580:TRIMDLYPCT") field(INPF, "QUAD:LTUS:580:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "QUAD:LTUS:580:RAMPTIME_LEFT PP") } record(longout, "QUAD:LTUS:580:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "QUAD:LTUS:580:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "QUAD:LTUS:580:RAMPDONE_CALC") } record(calc, "QUAD:LTUS:580:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "QUAD:LTUS:580:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "QUAD:LTUS:580:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "QUAD:LTUS:580: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, "QUAD:LTUS:580:RAMPTIME_LEFT") field(OUT, "QUAD:LTUS:580:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "QUAD:LTUS:580:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "QUAD:LTUS:580:RAMPTIME_LEFT NMS") field(OUT, "QUAD:LTUS:580:RAMPDONE PP") } record(bo, "QUAD:LTUS:580:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "QUAD:LTUS:580:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "QUAD:LTUS:580: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, "QUAD:LTUS:580: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, "QUAD:LTUS:580:STDZINIT") { field(DESC, "Proc. Stdz PVs on boot") field(PINI, "YES") field(DOL1, "1") field(DOL2, "1") field(DOL3, "1") field(LNK1, "QUAD:LTUS:580:DEBUG.PROC PP") field(LNK2, "QUAD:LTUS:580:STDZCYCLENUM.PROC PP") field(LNK3, "QUAD:LTUS:580:STDZDISABLE.PROC PP") field(LNK4, "QUAD:LTUS:580: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, "QUAD:LTUS:580:STDZSUB") { field(DESC, "Stdz subroutine") field(INAM, "mgntStdzInit") field(SNAM, "mgntStdz") field(BRSV, "INVALID") field(INPA, "QUAD:LTUS:580:STDZIMIN NPP NMS") field(INPB, "QUAD:LTUS:580:STDZIMAX NPP NMS") field(INPC, "QUAD:LTUS:580:STDZIFINAL NPP NMS") field(INPD, "QUAD:LTUS:580:STDZCYCLENUM NPP NMS") field(INPE, "QUAD:LTUS:580:STDZDIRECT.RVAL NPP NMS") field(INPF, "QUAD:LTUS:580:STDZDISABLE.RVAL CPP NMS") field(INPG, "QUAD:LTUS:580: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, "QUAD:LTUS:580:STDZWF PP") field(OUTB, "QUAD:LTUS:580: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, "QUAD:LTUS:580:STDZWF") } record(mbbo, "QUAD:LTUS:580: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, "QUAD:LTUS:580: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, "QUAD:LTUS:580:STDZMAINPS") { field(DESC, "Stdz by main or self") field(PINI, "YES") field(DTYP, "Soft Channel") field(ZNAM, "SELF") field(ONAM, "MAIN") } record(bo, "QUAD:LTUS:580: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, "QUAD:LTUS:580: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, "QUAD:LTUS:580: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, "QUAD:LTUS:580:STDZTOD") { field(DESC, "Successful Standardize Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "QUAD:LTUS:580:STDZLOSTTOD") { field(DESC, "Standardize Lost Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(longout, "QUAD:LTUS:580:STDZCYCLECNT") { field(DESC, "Cycle Count") field(PINI, "YES") } record(longout, "QUAD:LTUS:580:STDZCYCLENUM") { field(DESC, "No. Standardize Cycles") field(VAL, "3") field(HOPR, "10") field(LOPR, "0") field(DRVH, "10") field(DRVL, "0") field(PINI, "YES") field(FLNK, "QUAD:LTUS:580:STDZDIRECT") } # The default standardize direction is "UP" for # all LCLS Magnets.. record(bo, "QUAD:LTUS:580:STDZDIRECT") { field(DESC, "Standardize Direction ") field(ZNAM, "UP") field(ONAM, "DOWN") field(VAL, "0") field(FLNK, "QUAD:LTUS:580:STDZIMIN") } record(ao, "QUAD:LTUS:580:STDZIMIN") { field(DESC, "Min-STDZ Current") field(PREC, "1") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "-165.0") field(VAL, "-165.0") field(FLNK, "QUAD:LTUS:580:STDZIMAX") } record(ao, "QUAD:LTUS:580:STDZIMAX") { field(DESC, "Max. Standarize Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "-165.0") field(VAL, "165.0") field(FLNK, "QUAD:LTUS:580:STDZIFINAL") } record(ao, "QUAD:LTUS:580:STDZIFINAL") { field(DESC, "Final SDTZ Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "-165.0") field(VAL, "-165.0") field(FLNK, "QUAD:LTUS:580: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, "QUAD:LTUS:580: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, "QUAD:LTUS:580:STDZITOL") { field(DESC, "Stdz min tolerance") field(PREC, "5") field(CALC, "MAX(ABS(A),ABS(B))*C") field(INPA, "QUAD:LTUS:580:STDZIMIN CP NMS") field(INPB, "QUAD:LTUS:580:STDZIMAX CP MMS") field(INPC, "0.05") field(INPD, "QUAD:LTUS:580:STDZITOLR CP MMS") field(EGU, "A") field(FLNK, "QUAD:LTUS:580:IDELTAS") field(PINI, "YES") } # D - factor (3.154/2 = 1.577) for EPSC, otherwise, set to 1.0 record(calc, "QUAD:LTUS:580:STDZDLY") { field(DESC, "Ramp time for stdz cycle") field(CALC, "C>0?MAX(1,ABS((A-B)/C)*D):0") field(INPA, "QUAD:LTUS:580:STDZIMIN CP NMS") field(INPB, "QUAD:LTUS:580:STDZIMAX CP NMS") field(INPC, "QUAD:LTUS:580:TRIMRAMPRATE CP NMS") field(INPD, "1.577") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") } record(calc, "QUAD:LTUS:580:STDZRAMPDLY") { field(DESC, "Ramp delay total") field(CALC, "MAX(1,((A/100)*B+B))") field(PREC, "5") field(INPA, "QUAD:LTUS:580:TRIMDLYPCT CP MS") field(INPB, "QUAD:LTUS:580: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, "QUAD:LTUS:580:STDZMINIDLY") { field(DESC, "Mini-stdz delay") field(CALC, "A") field(PREC, "5") field(A, "1.0") field(EGU, "sec") field(PINI, "YES") } record(ao, "QUAD:LTUS:580: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, "QUAD:LTUS:580:STDZMINIDELTA") { field(DESC, "Stdz mini % of IMAX") field(CALC, "(B/100)*(A-C)") field(INPA, "QUAD:LTUS:580:IDES.HOPR") field(INPB, "QUAD:LTUS:580:STDZMINIPCT CPP NMS") field(INPC, "QUAD:LTUS:580:IDES.LOPR") field(PREC, "5") } record(calc, "QUAD:LTUS:580:STDZMINISETPT") { field(DESC, "Mini Stdz delta") field(CALC, "C==0?MAX(E-D,B):MIN(E+D,A)") field(INPA, "QUAD:LTUS:580:IDES.HOPR") field(INPB, "QUAD:LTUS:580:IDES.LOPR") field(INPC, "QUAD:LTUS:580:STDZDIRECT.RVAL") field(INPD, "QUAD:LTUS:580:STDZMINIDELTA") field(INPE, "QUAD:LTUS:580:IDES") field(PREC, "5") field(FLNK, "QUAD:LTUS:580: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, "QUAD:LTUS:580:STDZMINISETPTOOR") { field(DESC, "Mini Stdz setpoint out of range") field(CALC, "C==0?(E-DA)") field(INPA, "QUAD:LTUS:580:IDES.HOPR") field(INPB, "QUAD:LTUS:580:IDES.LOPR") field(INPC, "QUAD:LTUS:580:STDZDIRECT.RVAL") field(INPD, "QUAD:LTUS:580:STDZMINIDELTA") field(INPE, "QUAD:LTUS:580: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, "QUAD:LTUS:580: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, "QUAD:LTUS:580:IADJUST.RVAL") field(INPB, "QUAD:LTUS:580:STDZDIRECT.RVAL") field(INPC, "QUAD:LTUS:580:STDZOK.RVAL") field(INPD, "QUAD:LTUS:580:STDZDISABLE.RVAL") field(INPE, "QUAD:LTUS:580:STATE.RVAL CPP NMS") field(INPF, "QUAD:LTUS:580:ICTRL.RVAL") field(INPG, "QUAD:LTUS:580:STATE.SEVR") field(INPH, "QUAD:LTUS:580:BDELTAS.M") field(INPI, "QUAD:LTUS:580:IACT.SEVR") field(OUT, "QUAD:LTUS:580:STDZLOSTGO.SELN PP NMS") field(OOPT, "Transition To Non-zero") } record(seq, "QUAD:LTUS:580:STDZLOSTGO") { field(DESC, "Process lost stdz") field(SELM, "Mask") field(DOL1, "1") field(DOL2, "0") field(LNK1, "QUAD:LTUS:580:STDZLOSTTOD.PROC") field(LNK2, "QUAD:LTUS:580:STDZOK PP") } # Record maximum current after standardize # Reset to IACT from sequence after trim # Disable processing during (mini-)standardize or trim record(calc, "QUAD:LTUS:580:STDZIACTMAX") { field(DESC, "Max act current after stdz") field(CALC, "MAX(A, B)") field(DISV, "0") field(SDIS, "QUAD:LTUS:580:CHECKPWRDIP_ENABLE") field(INPA, "QUAD:LTUS:580:IACT CP") field(INPB, "QUAD:LTUS:580:STDZIACTMAX") field(EGU, "A") field(FLNK, "QUAD:LTUS:580:CHECKPWRDIP") } # Detect power dip if STDZOK is YES, STDZ is enabled, and IACT is valid # If IACT drops below STDZIACTMAX by more than the trim tolerance, clear STDZOK # Warning: Take the absolute value of the trim tolerance, or else quads of # negative polarity will always lose STDZ since their IDELTAS.I are negative. # Note: Large quads and bends are prone to losing STDZ even if they are # perturbed toward higher current since their current tends to overshoot # by greater than the trim tolerance before settling down. record(calcout, "QUAD:LTUS:580:CHECKPWRDIP") { field(DESC, "Detect power dip") field(CALC, "(A-B>ABS(C))?3:0") field(DISV, "0") field(SDIS, "QUAD:LTUS:580:CHECKPWRDIP_ENABLE") field(INPA, "QUAD:LTUS:580:STDZIACTMAX") field(INPB, "QUAD:LTUS:580:IACT") field(INPC, "QUAD:LTUS:580:IDELTAS.I") field(OUT, "QUAD:LTUS:580:STDZLOSTGO.SELN PP NMS") field(OOPT, "When Non-zero") } # Enable processing of STDZIACTMAX and CHECKPWRDIP only if # STDZOK = YES, STDZDISABLE = NO, CTRL != Trim (2), and # CTRL != Stdz (4) record(calc, "QUAD:LTUS:580:CHECKPWRDIP_ENABLE") { field(CALC, "A&&!B&&(C#2)&&(C#4)") field(INPA, "QUAD:LTUS:580:STDZOK.RVAL CP") field(INPB, "QUAD:LTUS:580:STDZDISABLE.RVAL CP") field(INPC, "QUAD:LTUS:580:CTRL.RVAL CP") } #! 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, "QUAD:LTUS:580: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, "QUAD:LTUS:580:CALBOK") { field(DESC, "Successful Calibration") field(DTYP, "Raw Soft Channel") field(ZNAM, "NO") field(ONAM, "YES") field(DOL, "PSC:LTUS:MG13:CALBOK.RVAL") field(OMSL, "closed_loop") 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, "QUAD:LTUS:580:CALBSET") { field(DESC, "Use DAC Calbration") field(SCAN, "10 second") field(CALC, "A&&(B==0)&&C?31:960") field(INPA, "QUAD:LTUS:580:CALBOK") field(INPB, "QUAD:LTUS:580:CALBDISABLE") field(INPC, "QUAD:LTUS:580:CALBSLOPE") field(OOPT, "On Change") field(OUT, "QUAD:LTUS:580: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, "QUAD:LTUS:580:CALB_SEQ") { field(DESC, "Output Calib Values") field(SELM, "Mask") field(SELL, "QUAD:LTUS:580: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, "QUAD:LTUS:580:CALBSLOPE") field(DOL3, "QUAD:LTUS:580: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, "QUAD:LTUS:580:CALBTOD") { field(DESC, "Calibration Success Time") field(PINI, "YES") field(DOL, "PSC:LTUS:MG13:CALBTOD") field(OMSL, "closed_loop") field(DTYP, "Soft Channel") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:580: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, "QUAD:LTUS:580: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, "QUAD:LTUS:580: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, "QUAD:LTUS:580:CALBOFFSET") { field(DESC, "Calc DAC Offset") field(PREC, "6") field(EGU, "Counts") field(PINI, "YES") } record(bo, "QUAD:LTUS:580: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, "QUAD:LTUS:580:DACSLOPE") { field(DESC, "V to DAC slope") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "closed_loop") field(PINI, "YES") field(FLNK, "QUAD:LTUS:580:DACOFFSET") } # Default Offset used in conversion from Volts to DAC Counts record(ao, "QUAD:LTUS:580:DACOFFSET") { field(DESC, "V to DAC offset") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "closed_loop") field(PINI, "YES") field(FLNK, "QUAD:LTUS:580: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, "QUAD:LTUS:580: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, "QUAD:LTUS:580:IACT") field(INPD, "QUAD:LTUS:580:DACSLOPE") field(INPE, "QUAD:LTUS:580:DACOFFSET") field(EGU, "Counts") field(PREC, "6") } record(ao, "QUAD:LTUS:580:DAC") { field(DESC, "DAC Set point") field(EGU, "Counts") field(DOL, "") field(OMSL, "closed_loop") field(PREC, "6") field(PINI, "YES") } record(ao, "QUAD:LTUS:580:CALBIMIN") { field(DESC, "Calibration Min Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(DRVH, "165.0") field(HOPR, "165.0") field(DRVL, "-165.0") field(LOPR, "-165.0") field(PREC, "3") field(EGU, "A") field(VAL, "0.0") field(FLNK, "QUAD:LTUS:580:CALBIMAX") } record(ao, "QUAD:LTUS:580:CALBIMAX") { field(DESC, "Calibration Max Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(DRVH, "165.0") field(HOPR, "165.0") field(LOPR, "-165.0") field(DRVL, "-165.0") field(EGU, "A") field(VAL, "165.0") field(FLNK, "QUAD:LTUS:580:CALBSTEPNUM") } record(ao, "QUAD:LTUS:580:CALBIFINAL") { field(DESC, "Calibration Last Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(PREC, "3") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "-165.0") field(VAL, "0") } record(longout, "QUAD:LTUS:580: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, "QUAD:LTUS:580:CALBIDELTA") } record(calc, "QUAD:LTUS:580:CALBIDELTA") { field(DESC, "Step size for CALB") field(CALC, "C=0?0:ABS((A-B)/C)") field(INPA, "QUAD:LTUS:580:CALBIMAX") field(INPB, "QUAD:LTUS:580:CALBIMIN") field(INPC, "QUAD:LTUS:580: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, "QUAD:LTUS:580:CALBIMULT") { field(DESC, "IACT vs ISETPT mult") field(CALC, "C#0||A=0?1:ABS(B/A)") field(INPA, "PSC:LTUS:MG13:ISETPT.DRVH") field(INPB, "PSC:LTUS:MG13:IACT.HOPR") field(INPC, "QUAD:LTUS:580:PSCONTROLLER.RVAL CPP") field(EGU, "A") field(PINI, "YES") } # SNL dbputs DAC values here. 6-10 steps are possible. record(waveform, "QUAD:LTUS:580:CALBICTRLWF") { field(DESC, "ICTRL setpoint array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") } record(waveform, "QUAD:LTUS:580:DACWF") { field(DESC, "DAC count array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:580:DACSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:580:DACSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "QUAD:LTUS:580: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, "QUAD:LTUS:580:CALCDACWF") { field(DESC, "Calc DAC counts array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:580:CALCDACSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:580:CALCDACSA") { field(DESC, "Calc DAC counts") field(DTYP, "Soft Channel") field(INP, "QUAD:LTUS:580: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, "QUAD:LTUS:580:CALBYWF") { field(DESC, "mx + b") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:580:CALBYSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:580:CALBYSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "QUAD:LTUS:580:CALBYWF") field(MALM, "10") field(NELM, "6") field(INDX, "0") field(FTVL, "DOUBLE") } record(waveform, "QUAD:LTUS:580:CALBIACTWF") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:580:CALBIACTSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:580:CALBIACTSA") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(MALM, "10") field(NELM, "6") field(INP, "QUAD:LTUS:580:CALBIACTWF") field(INDX, "0") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:580:CALBLIMITS") } # Check that measured current during calibration is within # tolerance. record(aSub, "QUAD:LTUS:580: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, "QUAD:LTUS:580:CALBSTEPNUM") field(INPB, "QUAD:LTUS:580:CALBIACTWF") field(INPC, "QUAD:LTUS:580: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, "QUAD:LTUS:580: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, "QUAD:LTUS:580:STDZITOL") field(INPH, "QUAD:LTUS:580:DACSLOPE") field(INPI, "QUAD:LTUS:580: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, "QUAD:LTUS:580: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, "QUAD:LTUS:580:CALBSTEPNUM") field(INPB, "QUAD:LTUS:580:CALBIACTWF") field(INPC, "QUAD:LTUS:580:DACWF") field(INPF, "QUAD:LTUS:580: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 QUAD:LTUS:580CALBOK 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, "QUAD:LTUS:580:DEGAUSINIT") { field(DESC, "Proc. Degauss PVs on boot") field(PINI, "YES") field(DOL, "1") field(OUTA, "QUAD:LTUS:580:DEGAUSIMIN.PROC PP") field(OUTB, "QUAD:LTUS:580:DEGAUSIMAX.PROC PP") field(OUTC, "QUAD:LTUS:580:DEGAUSTYPE.PROC PP") field(OUTD, "QUAD:LTUS:580:DEGAUSSTEP.PROC PP") field(OUTE, "QUAD:LTUS:580:MADNAME.PROC PP") field(OUTF, "QUAD:LTUS:580:PSTYPE.PROC PP") field(OUTG, "QUAD:LTUS:580: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, "QUAD:LTUS:580:DEGAUSSUB") { field(DESC, "Degauss subroutine") field(INAM, "mgntDegaussInit") field(SNAM, "mgntDegauss") field(BRSV, "INVALID") field(INPA, "QUAD:LTUS:580:DEGAUSIMIN NPP NMS") field(INPB, "QUAD:LTUS:580:DEGAUSIMAX NPP NMS") field(INPC, "QUAD:LTUS:580:DEGAUSTYPE.RVAL NPP NMS") field(INPE, "QUAD:LTUS:580:DEGAUSMETHOD.RVAL NPP NMS") field(INPF, "QUAD:LTUS:580:PSTYPE NPP NMS") field(INPG, "QUAD:LTUS:580:DEBUG.RVAL NPP NMS") field(INPH, "QUAD:LTUS:580: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, "QUAD:LTUS:580:DEGAUSWF PP") field(OUTB, "QUAD:LTUS:580:DEGAUSMSG PP") field(OUTC, "QUAD:LTUS:580: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, "QUAD:LTUS:580:DEGAUSWF") { field(DESC, "Degauss Setpts") field(NELM, "60") field(FTVL, "DOUBLE") } record(mbbo,"QUAD:LTUS:580: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, "QUAD:LTUS:580: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, "QUAD:LTUS:580: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, "QUAD:LTUS:580: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, "QUAD:LTUS:580: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, "QUAD:LTUS:580:DEGAUSIMIN") { field(DESC, "Min. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "165.0") field(LOPR, "-165.0") field(DRVH, "165.0") field(DRVL, "-165.0") field(VAL, "-165.0") } record(ao, "QUAD:LTUS:580:DEGAUSIMAX") { field(DESC, "Max. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "165.0") field(LOPR, "-165.0") field(DRVH, "165.0") field(DRVL, "-165.0") field(VAL, "165.0") } # 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,"QUAD:LTUS:580: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, "QUAD:LTUS:580: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,"QUAD:LTUS:580: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, "QUAD:LTUS:580: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, "QUAD:LTUS:580: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, "QUAD:LTUS:580: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, "QUAD:LTUS:580:DEGAUSTOD") { field(DESC, "Successful Degauss Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "QUAD:LTUS:580:DEGAUSLOSTTOD") { field(DESC, "Degauss Lost Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:580:DEGAUSTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "QUAD:LTUS:580:DEGAUSTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "QUAD:LTUS:580: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, "QUAD:LTUS:580:DEGAUSGO") { field(DESC, "Set bdes of btrms to zero") field(ASG, "Internal") field(OUTA, "") field(OUTB, "") field(OUTC, "") field(OUTD, "") } # =========== CRYO ONLY =========== record(bo, "QUAD:LTUS:580: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, "QUAD:LTUS:580:DEGAUS_IMAX_CHECK") { field(DESC, "Check if imax shoud chg") field(CALC, "(C==4)&&(ABS(B)>ABS(A))?1:0") field(INPA, "QUAD:LTUS:580:DEGAUS_IMAX") field(INPB, "QUAD:LTUS:580:ISETPT") field(INPC, "QUAD:LTUS:580:DEGAUSTYPE.RVAL") field(OUT, "QUAD:LTUS:580:DEGAUS_IMAX_UPDATE.SELN") field(FLNK, "QUAD:LTUS:580:DEGAUS_IMAX_UPDATE") } record(seq, "QUAD:LTUS:580:DEGAUS_IMAX_UPDATE") { field(DESC, "Degauss IMAX Update") field(SELM, "Specified") field(DOL1, "QUAD:LTUS:580:ISETPT") field(LNK1, "QUAD:LTUS:580:DEGAUS_IMAX PP") } # Set the maximum current after a successful # degauss. This pv is updated by the # sequence. record(ao, "QUAD:LTUS:580:DEGAUS_IMAX") { field(DESC, "Max I set afer a degauss") field(EGU, "Amps") field(PINI, "YES") field(PREC, "6") field(HOPR, "165.0") field(LOPR, "-165.0") field(DRVH, "165.0") field(DRVL, "-165.0") field(VAL, "165.0") field(FLNK, "QUAD:LTUS:580:DEGAUS_IMAXPOL_CHECK") info(autosaveFields,"VAL,RVAL") } # Set the polarity if degauss_imax record(calcout, "QUAD:LTUS:580:DEGAUS_IMAXPOL_CHECK") { field(DESC, "Determine polarity of imax") field(CALC, "A>=0?0:1") field(INPA, "QUAD:LTUS:580:DEGAUS_IMAX") field(FLNK, "QUAD:LTUS:580:DEGAUS_IMAXPOL") } record(bo, "QUAD:LTUS:580:DEGAUS_IMAXPOL") { field(DESC, "Polarity of imax I") field(DTYP, "Raw Soft Channel") field(DOL, "QUAD:LTUS:580:DEGAUS_IMAXPOL_CHECK") field(OMSL, "closed_loop") field(ZNAM, "Positive") field(ONAM, "Negative") field(FLNK, "QUAD:LTUS:580: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, "QUAD:LTUS:580:DEGAUS_ABSIMAX") { field(DESC, "Absolute Max. Degauss I") field(CALC, "ABS(A)") field(INPA, "QUAD:LTUS:580:DEGAUS_IMAX") field(PREC, "6") field(EGU, "Amps") field(HOPR, "165.0") field(LOPR, "-165.0") info(autosaveFields,"VAL RVAL") } # IACT Polarity record(calcout, "QUAD:LTUS:580:IACTPOL_CHECK") { field(DESC, "Determine IACT polarity") field(SCAN, "5 second") field(CALC, "ABS(A-B)>C?(A>=0?0:1):D") field(INPA, "QUAD:LTUS:580:IACT") field(INPB, "QUAD:LTUS:580:IACTPOL_CHECK.LA") field(INPC, "0.0001") field(INPD, "QUAD:LTUS:580:IACTPOL_CHECK.PVAL") field(OOPT, "On Change") field(FLNK, "QUAD:LTUS:580:IACTPOL") } record(bo, "QUAD:LTUS:580: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,"QUAD:LTUS:580: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, "QUAD:LTUS:580:DEGAUSENABLE CP") field(INPB, "QUAD:LTUS:580:DEGAUSOK") field(INPC, "QUAD:LTUS:580:STATE CP") field(INPD, "QUAD:LTUS:580:STATE.SEVR") field(OUT, "QUAD:LTUS:580:DEGAUS_STATE_SEQ.SELN PP") field(ASG, "Internal") } record(seq, "QUAD:LTUS:580:DEGAUS_STATE_SEQ") { field(DESC, "Degauss State Sequence") field(SELM, "Specified") field(SELL, "QUAD:LTUS:580:DEGAUS_STATE_CHECK") field(LNK1, "QUAD:LTUS:580:DEGAUS_STATE_DISABLE.PROC PP") field(LNK2, "QUAD:LTUS:580:DEGAUS_STATE_LOST.PROC PP") field(LNK3, "QUAD:LTUS:580:DEGAUS_STATE_GOOD.PROC PP") field(LNK4, "QUAD:LTUS:580: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, "QUAD:LTUS:580:DEGAUS_STATE_DISABLE") { field(DESC, "Degauss not used") field(LNK1, "QUAD:LTUS:580:DEGAUSOK.ZSV") field(LNK2, "QUAD:LTUS:580: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, "QUAD:LTUS:580:STATMSG.FRSV") field(LNK4, "QUAD:LTUS:580: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, "QUAD:LTUS:580:DEGAUS_STATE_LOST") { field(DESC, "Degauss lost and ps On") field(DOL1, "1") field(LNK1, "QUAD:LTUS:580:DEGAUSOK.ZSV") field(LNK2, "QUAD:LTUS:580: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, "QUAD:LTUS:580:STATMSG.FRSV") field(LNK4, "QUAD:LTUS:580: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, "QUAD:LTUS:580:DEGAUS_STATE_OFF") { field(DESC, "Degaused lost and ps Off") field(DOL1, "2") field(LNK1, "QUAD:LTUS:580: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, "QUAD:LTUS:580:STATMSG.FRSV") field(LNK3, "QUAD:LTUS:580: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, "QUAD:LTUS:580:DEGAUS_STATE_GOOD") { field(DESC, "Degauss good") field(DOL1, "1") field(LNK1, "QUAD:LTUS:580: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, "QUAD:LTUS:580:STATMSG.FRSV PP") field(LNK3, "QUAD:LTUS:580:STATMSG.FVSV PP") field(LNK4, "") field(ASG, "Internal") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(mbbo, "QUAD:LTUS:580:FUNC") { field(DESC, "QUAD:LTUS:580 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, "1") field(THVL, "9") field(FRVL, "10") field(FVVL, "0") field(SXVL, "2") field(SVVL, "8") field(EIVL, "11") field(NIVL, "12") field(TEVL, "13") field(ELVL, "5") field(TVVL, "6") field(TTVL, "7") field(FTVL, "4") field(FFVL, "3") field(OUT, "QUAD:LTUS:580:CTRL CA") } # :CTRL pv is processed at boot in the # sequence mgntCtrl.st Processed in sequence # record(mbbo, "QUAD:LTUS:580:CTRL") { field(DESC, "QUAD:LTUS:580 Control") field(PINI, "NO") field(ZRST, "Ready") field(ONST, "TRIM") field(TWST, "PERTURB") field(THST, "BCON_TO_BDES") field(FRST, "BACT_TO_BDES") field(FVST, "SAVE_BDES") field(SXST, "LOAD_BDES") field(SVST, "UNDO_BDES") field(EIST, "DAC_ZERO") field(NIST, "CALB") field(TEST, "STDZ") field(ELST, "RESET") field(TVST, "TURN_ON") field(TTST, "TURN_OFF") field(FTST, "") field(FFST, "") field(ZRVL, "0") field(ONVL, "2") field(TWVL, "6") field(THVL, "15") field(FRVL, "14") field(FVVL, "11") field(SXVL, "12") field(SVVL, "13") field(EIVL, "7") field(NIVL, "3") field(TEVL, "4") field(ELVL, "8") field(TVVL, "9") field(TTVL, "10") field(FTVL, "0") field(FFVL, "0") field(OUT, "QUAD:LTUS:580:SELECTEN.A PP") field(SDIS, "0") } # If a function has been selected set this unit to busy record(calcout, "QUAD:LTUS:580:SELECTEN") { field(DESC, "Control Select Enable") field(CALC, "A>0?1:A") field(FLNK, "QUAD:LTUS:580:BUSY") } # Set to FREE on IOC reboot record(bo, "QUAD:LTUS:580:BUSY") { field(DESC, "QUAD:LTUS:580 Ctrl Done") field(DOL, "QUAD:LTUS:580:SELECTEN") field(ZNAM, "FREE") field(ONAM, "BUSY") field(PINI, "YES") field(FLNK, "QUAD:LTUS:580:SELECT") } record(bo, "QUAD:LTUS:580:SELECT") { field(ZNAM, "NO") field(ONAM, "YES") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") } record(bo, "QUAD:LTUS:580: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, "QUAD:LTUS:580:CTRLSTATE") { field(DESC, "QUAD:LTUS:580 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("QUAD:LTUS:580:CTRL",20,20,0,0,"QUAD:LTUS:580:CTRL") #! Field("QUAD:LTUS:580:CTRL.OUT",16777215,1,"QUAD:LTUS:580:CTRL.OUT") #! Link("QUAD:LTUS:580:CTRL.OUT","QUAD:LTUS:580:SELECTEN.A") #! Field("QUAD:LTUS:580:CTRL.VAL",16777215,1,"QUAD:LTUS:580:CTRL.VAL") #! Record("QUAD:LTUS:580:SELECTEN",321,381,0,0,"QUAD:LTUS:580:SELECTEN") #! Field("QUAD:LTUS:580:SELECTEN.A",16777215,0,"QUAD:LTUS:580:SELECTEN.A") #! Field("QUAD:LTUS:580:SELECTEN.FLNK",16777215,1,"QUAD:LTUS:580:SELECTEN.FLNK") #! Link("QUAD:LTUS:580:SELECTEN.FLNK","QUAD:LTUS:580:BUSY") #! Field("QUAD:LTUS:580:SELECTEN.VAL",16777215,1,"QUAD:LTUS:580:SELECTEN.VAL") #! Record("QUAD:LTUS:580:BUSY",623,274,0,0,"QUAD:LTUS:580:BUSY") #! Field("QUAD:LTUS:580:BUSY.DOL",16777215,0,"QUAD:LTUS:580:BUSY.DOL") #! Link("QUAD:LTUS:580:BUSY.DOL","QUAD:LTUS:580:SELECTEN.VAL") #! Field("QUAD:LTUS:580:BUSY.FLNK",16777215,1,"QUAD:LTUS:580:BUSY.FLNK") #! Link("QUAD:LTUS:580:BUSY.FLNK","QUAD:LTUS:580:SELECT") #! Record("QUAD:LTUS:580:SELECT",669,508,0,1,"QUAD:LTUS:580:SELECT") #! Record("QUAD:LTUS:580:FUNC",940,120,0,0,"QUAD:LTUS:580:FUNC") #! Field("QUAD:LTUS:580:FUNC.OUT",16777215,0,"QUAD:LTUS:580:FUNC.OUT") #! Link("QUAD:LTUS:580:FUNC.OUT","QUAD:LTUS:580:CTRL.VAL") #! Record("QUAD:LTUS:580:ABORT",193,41,0,0,"QUAD:LTUS:580:ABORT") #! Record("QUAD:LTUS:580:CTRLSTATE",369,34,0,0,"QUAD:LTUS:580: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,"QUAD:LTUS:580:SELECT is used for Multi-device selection.\nIt is enabled when associated QUAD:LTUS:580:CTRL is \"0\" (DONE).\nIt is disabled when associated QUAD:LTUS:580: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,"QUAD:LTUS:580: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, "QUAD:LTUS:580:BCTRL_INIT") { field(DESC, "Process BCTRL on boot") field(PINI, "YES") field(CALC, "A=3?1:0") field(INPA, "QUAD:LTUS:580:BCTRL.SEVR") field(OUT, "QUAD:LTUS:580: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, "QUAD:LTUS:580:BACT") { field(DESC, "Actual B") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "QUAD:LTUS:580:BACT") field(INPB, "QUAD:LTUS:580:POLYCOEF") field(INPC, "QUAD:LTUS:580:POLYCOEF.A") field(INPD, "QUAD:LTUS:580:POLYCOEF.B") field(INPE, "QUAD:LTUS:580:IACT MS") field(INPF, "QUAD:LTUS:580:BDELTAS PP") field(INPG, "100") field(EGU, "kG") field(HOPR, "150.0853") field(LOPR, "-152.1937") field(HIHI, "150.0853") field(LOLO, "-152.1937") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "150.0853") field(LOW, "-152.1937") field(FLNK, "QUAD:LTUS:580: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, "QUAD:LTUS:580:BDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntPhyDeltas") field(EGU, "kG") field(HOPR, "1") field(PREC, "7") field(BRSV, "INVALID") field(INPA, "QUAD:LTUS:580:BDES") field(INPB, "QUAD:LTUS:580:TRIMBTOL") field(INPC, "QUAD:LTUS:580:TRIMBTOLR") field(INPD, "QUAD:LTUS:580:CHCKBTOL") field(INPE, "QUAD:LTUS:580:CHCKBTOLR") field(F, "2.0") field(INPG, "30") field(INPH, "QUAD:LTUS:580:BACT.VAL") # # MPS absolute and relative tolerances field(INPP, "QUAD:LTUS:580:MPSBTOL") field(INPQ, "QUAD:LTUS:580:MPSBTOLR") field(FLNK, "QUAD:LTUS:580:BCONLIMITS") info(autosaveFields,"F") } # This record is processed by BDELTAS record(aSub, "QUAD:LTUS:580:BCONLIMITS") { field(DESC, "Config B-field Limits") field(INAM, "mgntInit") field(SNAM, "mgntBCONLimits") field(INPA, "QUAD:LTUS:580:BDES") field(INPB, "QUAD:LTUS:580:BDELTAS.I") field(INPG, "QUAD:LTUS:580:DEBUG.RVAL") field(FTA, "DOUBLE") field(FTB, "DOUBLE") field(FTG, "ULONG") field(OUTA, "QUAD:LTUS:580:BCON.HIGH") field(OUTB, "QUAD:LTUS:580:BCON.LOW") field(OUTC, "QUAD:LTUS:580:BCON.HIHI") field(OUTD, "QUAD:LTUS:580:BCON.LOLO PP") field(FTVA, "DOUBLE") field(FTVB, "DOUBLE") field(FTVC, "DOUBLE") field(FTVD, "DOUBLE") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:580:IDELTAS") } # The following PV is processed by :BACT # which is processed by :BACT # record(fanout, "QUAD:LTUS:580:BACTFO") { field(DESC, "BACT processing") field(SELM, "All") field(LNK1, "QUAD:LTUS:580:BDIFF") field(LNK2, "QUAD:LTUS:580:BADIFF") field(LNK3, "QUAD:LTUS:580:BRATIO") field(LNK4, "QUAD:LTUS:580:MPSLIMITS") field(LNK5, "QUAD:LTUS:580:I2BSTATUS") field(LNK6, "QUAD:LTUS:580:IACTFO.PROC") } record(calc, "QUAD:LTUS:580:BDIFF") { field(DESC, "BDES-BACT") field(CALC, "A-B") field(INPA, "QUAD:LTUS:580:BDES") field(INPB, "QUAD:LTUS:580:BACT") field(EGU, "kG") field(PREC, "7") } record(calc, "QUAD:LTUS:580:BADIFF") { field(DESC, "Absolute BDES-BACT") field(INPA, "QUAD:LTUS:580:BDIFF") field(EGU, "kG") field(PREC, "7") field(CALC, "A<0?ABS(A):A") } record(calc, "QUAD:LTUS:580:BRATIO") { field(DESC, "BACT Error") field(CALC, "B?A/B:0") field(INPA, "QUAD:LTUS:580:BDIFF") field(INPB, "QUAD:LTUS:580:BDES.HOPR") field(EGU, "kG") field(PREC, "7") } record(mbbi, "QUAD:LTUS:580: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, "QUAD:LTUS:580:BACT.J") } # Note: for a string slave set the MONFL # macro to the following: # MONFL=:IMONCALC MS record(sub, "QUAD:LTUS:580:BMON") { field(DESC, "Second Transductor") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "QUAD:LTUS:580:BMON") field(INPB, "QUAD:LTUS:580:POLYCOEF") field(INPC, "QUAD:LTUS:580:POLYCOEF.A") field(INPD, "QUAD:LTUS:580:POLYCOEF.B") field(INPE, "QUAD:LTUS:580:IMON MS") field(INPF, "QUAD:LTUS:580:BDELTAS.VAL") field(INPG, "100") field(EGU, "kG") field(HOPR, "150.0853") field(LOPR, "-152.1937") field(HIHI, "150.0853") field(LOLO, "-152.1937") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "150.0853") field(LOW, "-152.1937") } # 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=PSC:LTUS:MG13:BDES CP record(ao, "QUAD:LTUS:580:BDES") { field(DESC, "Desired B-Field") field(PINI, "YES") field(DRVH, "150.0853") field(DRVL, "-152.1937") field(HOPR, "150.0853") field(LOPR, "-152.1937") field(PREC, "7") field(EGU, "kG") field(MDEL, "-1") field(OMSL, "supervisory") # field(DOL, "") field(OUT, "QUAD:LTUS:580:B2IDES PP") info(autosaveFields,"VAL") } record(sub, "QUAD:LTUS:580:B2IDES") { field(DESC, "Convert Desired B-Field to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:580:POLYCOEF") field(INPC, "QUAD:LTUS:580:POLYCOEF.A") field(INPD, "QUAD:LTUS:580:POLYCOEF.B") field(PREC, "7") field(EGU, "kG") field(HOPR, "150.0853") field(LOPR, "-152.1937") field(MDEL, "-1") field(INPE, "QUAD:LTUS:580:BDES.DRVH") field(INPF, "QUAD:LTUS:580:BDES.DRVL") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:580:IDES") } record(sub, "QUAD:LTUS:580:BNOM") { field(DESC, "Nominal Field") field(PINI, "YES") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:580:POLYCOEF") field(INPC, "QUAD:LTUS:580:POLYCOEF.A") field(INPD, "QUAD:LTUS:580:POLYCOEF.B") field(INPE, "QUAD:LTUS:580:BDES.DRVH") field(INPF, "QUAD:LTUS:580:BDES.DRVL") field(EGU, "kG") field(HOPR, "150.0853") field(LOPR, "-152.1937") field(PREC, "7") field(VAL, "0.0") field(FLNK, "QUAD:LTUS:580:INOM") } record(sub, "QUAD:LTUS:580:BACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:580:BDES.VAL") field(INPB, "QUAD:LTUS:580:BDES.DRVH") field(INPC, "QUAD:LTUS:580:BDES.DRVL") field(INPD, "QUAD:LTUS:580:BDELTAS.I") field(INPE, "QUAD:LTUS:580:BDELTAS.J") field(INPG, "QUAD:LTUS:580:STATE") field(INPH, "QUAD:LTUS:580:HSTA") field(EGU, "kG") field(HOPR, "150.0853") field(LOPR, "-152.1937") field(PREC, "7") field(BRSV, "INVALID") } record(sub, "QUAD:LTUS:580:BMONLIMITS") { field(DESC, "MON Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:580:BDES.VAL") field(INPB, "QUAD:LTUS:580:BDES.DRVH") field(INPC, "QUAD:LTUS:580:BDES.DRVL") field(INPD, "QUAD:LTUS:580:BDELTAS.K") field(INPE, "QUAD:LTUS:580:BDELTAS.L") field(INPG, "QUAD:LTUS:580:STATE") field(INPH, "QUAD:LTUS:580:HSTA") field(EGU, "kG") field(HOPR, "150.0853") field(LOPR, "-152.1937") field(PREC, "7") field(BRSV, "INVALID") } record(seq, "QUAD:LTUS:580:BLIMITS") { field(DESC, "ACT Limits") field(PREC, "7") field(DOL1, "QUAD:LTUS:580:BLIMITS") field(LNK1, "QUAD:LTUS:580:BACTLIMITS.F PP") field(DOL2, "QUAD:LTUS:580:BACTLIMITS.I") field(LNK2, "QUAD:LTUS:580:BACT.HIGH") field(DOL3, "QUAD:LTUS:580:BACTLIMITS.J") field(LNK3, "QUAD:LTUS:580:BACT.LOW") field(DOL4, "QUAD:LTUS:580:BACTLIMITS.K") field(LNK4, "QUAD:LTUS:580:BACT.HIHI") field(DOL5, "QUAD:LTUS:580:BACTLIMITS.L") field(LNK5, "QUAD:LTUS:580:BACT.LOLO") field(DOL6, "QUAD:LTUS:580:BLIMITS") field(LNK6, "QUAD:LTUS:580:BMONLIMITS.F PP") field(DOL7, "QUAD:LTUS:580:BMONLIMITS.I") field(LNK7, "QUAD:LTUS:580:BMON.HIGH") field(DOL8, "QUAD:LTUS:580:BMONLIMITS.J") field(LNK8, "QUAD:LTUS:580:BMON.LOW") field(DOL9, "QUAD:LTUS:580:BMONLIMITS.K") field(LNK9, "QUAD:LTUS:580:BMON.HIHI") field(DOLA, "QUAD:LTUS:580:BMONLIMITS.L") field(LNKA, "QUAD:LTUS:580:BMON.LOLO") field(FLNK, "QUAD:LTUS:580:ILIMITS") field(SCAN, "5 second") } record(ao, "QUAD:LTUS:580:BCTRL") { field(DESC, "B-Perturb") field(PREC, "7") field(EGU, "kG") field(DRVH, "150.0853") field(DRVL, "-152.1937") field(HOPR, "150.0853") field(LOPR, "-152.1937") # 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, "QUAD:LTUS:580: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, "QUAD:LTUS:580:BCTRLGO") { field(DESC, "Update DES and perturb") field(PREC, "7") # Disable BACT limits field(DOL1, "1") field(LNK1, "QUAD:LTUS:580:BLIMITS.VAL") # Update BDES with the BCTRL (slider) value field(DOL2, "QUAD:LTUS:580:BCTRL.VAL") field(LNK2, "QUAD:LTUS:580:BDES PP") field(DOL3, "1") field(LNK3, "QUAD:LTUS:580:IDIRECT.PROC PP") field(DOL4, "1") field(LNK4, "QUAD:LTUS:580:CHECKSTDZLOST.PROC PP") field(DOL5, "QUAD:LTUS:580:BCTRL.VAL") field(LNK5, "QUAD:LTUS:580:BCTRLSUB PP") # Re-enable BACT limits field(DOL6, "0") field(LNK6, "QUAD:LTUS:580:BLIMITS.VAL") } # Convert B-field to Current and output to ISETPT record(sub, "QUAD:LTUS:580:BCTRLSUB") { field(DESC, "Feedback") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:580:POLYCOEF") field(INPC, "QUAD:LTUS:580:POLYCOEF.A") field(INPD, "QUAD:LTUS:580:POLYCOEF.B") field(INPE, "QUAD:LTUS:580:BDES.DRVH") field(INPF, "QUAD:LTUS:580:BDES.DRVL") field(PREC, "7") field(EGU, "kG") field(HOPR, "150.0853") field(LOPR, "-152.1937") field(MDEL, "-1") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:580:ISETPT") } record(ao, "QUAD:LTUS:580:BDESPREVTRIM") { field(DESC, "trim bdes for undo") field(DTYP, "Soft Channel") field(DRVH, "150.0853") field(DRVL, "-152.1937") field(EGU, "kG") field(HOPR, "150.0853") field(LOPR, "-152.1937") field(PREC, "7") field(PINI, "YES") info(autosaveFields,"VAL") } record(stringin, "QUAD:LTUS:580:MADNAME") { field(DESC, "MAD deck nomenclature") field(PINI, "YES") field(VAL, "QVM4B") } record(ai, "QUAD:LTUS:580: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, "3391.56111") } record(ao, "QUAD:LTUS:580:BMAX") { field(DESC, "Max B-Field") field(DTYP, "Soft Channel") field(DRVH, "150.0853") field(DRVL, "-152.1937") field(EGU, "kG") field(HOPR, "150.0853") field(LOPR, "-152.1937") field(PREC, "7") field(PINI, "YES") field(VAL, "150.0853") field(FLNK, "QUAD:LTUS:580:BSTEP") } record(ao, "QUAD:LTUS:580:BMIN") { field(DESC, "Min B-Field") field(DTYP, "Soft Channel") field(DRVH, "150.0853") field(DRVL, "-152.1937") field(EGU, "kG") field(HOPR, "150.0853") field(LOPR, "-152.1937") field(PREC, "7") field(PINI, "YES") field(VAL, "-152.1937") field(FLNK, "QUAD:LTUS:580:BSTEP") } record(ao, "QUAD:LTUS:580:BDESSAVE") { field(DESC, "bdes for save/load") field(DTYP, "Soft Channel") field(DRVH, "150.0853") field(DRVL, "-152.1937") field(EGU, "kG") field(HOPR, "150.0853") field(LOPR, "-152.1937") field(PINI, "YES") field(PREC, "7") } # This record is processed by QUAD:LTUS:580: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, "QUAD:LTUS:580:BCON") { field(DESC, "Config B-Field ") field(DTYP, "Soft Channel") field(PREC, "7") field(EGU, "kG") field(HOPR, "150.0853") field(LOPR, "-152.1937") field(DRVH, "150.0853") field(DRVL, "-152.1937") # Set MINOR Alarm as the default, slaves will set NO_ALARM=0. field(HHSV, "MINOR") field(LLSV, "MINOR") field(HSV, "MINOR") field(LSV, "MINOR") # field(DOL , "") field(OMSL, "supervisory") field(OUT, "QUAD:LTUS:580:B2ICON PP") info(autosaveFields,"VAL") } record(sub, "QUAD:LTUS:580:B2ICON") { field(DESC, "Convert Desired ICon to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:580:POLYCOEF") field(INPC, "QUAD:LTUS:580:POLYCOEF.A") field(INPD, "QUAD:LTUS:580:POLYCOEF.B") field(PREC, "7") field(EGU, "kG") field(HOPR, "150.0853") field(LOPR, "-152.1937") field(MDEL, "-1") field(INPE, "QUAD:LTUS:580:BCON.DRVH") field(INPF, "QUAD:LTUS:580:BCON.DRVL") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:580: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, "QUAD:LTUS:580:BSTEP") { field(DESC, "B-Field step size") field(CALC, "(C==3)||(D==3)?0:ABS(A-B)*0.005") field(INPA, "QUAD:LTUS:580:BMAX") field(INPB, "QUAD:LTUS:580:BMIN") field(INPC, "QUAD:LTUS:580:BMIN.SEVR") field(INPD, "QUAD:LTUS:580:BMAX.SEVR") field(EGU, "kG") 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,"QUAD:LTUS:580:BCTRLDISABLECALC") { field(DESC, "Calc for disabling BCTRL") field(ASG, "Internal") field(CALC, "A?2:1") field(INPA, "QUAD:LTUS:580:ONLINE CP") field(OUT, "QUAD:LTUS:580:BCTRLDISABLEFOUT PP") } record(fanout, "QUAD:LTUS:580:BCTRLDISABLEFOUT") { field(DESC, "Disable BCTRL fanout") field(SELM, "Specified") field(SELL, "QUAD:LTUS:580:BCTRLDISABLECALC") field(LNK1, "QUAD:LTUS:580:BCTRLDISABLE") field(LNK2, "QUAD:LTUS:580:BCTRLENABLE") } record(stringout, "QUAD:LTUS:580:BCTRLDISABLE") { field(DESC, "Disable BCTRL") field(DTYP, "Soft Channel") field(OUT, "QUAD:LTUS:580:BCTRL.ASG") field(VAL, "NOWRITE") field(FLNK, "QUAD:LTUS:580:BCTRLDISV_UPDATE") } record(stringout, "QUAD:LTUS:580:BCTRLENABLE") { field(DESC, "Enable BCTRL") field(DTYP, "Soft Channel") field(OUT, "QUAD:LTUS:580:BCTRL.ASG") field(VAL, "") field(FLNK, "QUAD:LTUS:580:BCTRLDISV_UPDATE") } record(calcout, "QUAD:LTUS:580:BCTRLDISV_UPDATE") { field(DESC, "Calc for updating BCTRL.DISV") field(ASG, "Internal") field(CALC, "A") field(INPA, "QUAD:LTUS:580:ONLINE") field(OUT, "QUAD:LTUS:580: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,"QUAD:LTUS:580:BACT and MON\n are processed via links from \n QUAD:LTUS:580:IACT (device raw value readback 1)\n and\n QUAD:LTUS:580: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 QUAD:LTUS:580:POLYCOEF\nC = First polynomial coefficient (offset if linear)\nD = Second polynomial coefficient (slope if linear)\nE = QUAD:LTUS:580: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,"QUAD:LTUS:580:BDES\n is processed when set by CA users or \n QUAD:LTUS:580: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,"QUAD:LTUS:580: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 QUAD:LTUS:580: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 (QUAD:LTUS:580: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,"QUAD:LTUS:580:B*LIMITS and QUAD:LTUS:580:BLIMITS:\n Calculate alarm and warning limits based on \n deltas from QUAD:LTUS:580: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,"QUAD:LTUS:580: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,"QUAD:LTUS:580: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, "QUAD:LTUS:580: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, "QUAD:LTUS:580:MPSBTOL") { field(DESC, "Absolute mps tol") field(EGU, "kG") field(PREC, "2") field(CALC, "ABS(A)*0.02") field(INPA, "QUAD:LTUS:580:BMAX") field(PINI, "YES") } # # 21-Aug-2013: K. Luchini # Set channel access security so that users # cannot easily change values. record(ao, "QUAD:LTUS:580:MPSBMAX") { field(DESC, "MPS Max B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "150.0853") field(DRVL, "-152.1937") field(PINI, "YES") field(VAL, "150.0853") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:580:MPSBMIN") { field(DESC, "MPS Min B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "150.0853") field(DRVL, "-152.1937") field(PINI, "YES") field(VAL, "-152.1937") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:580:MPSBLLIM") { field(DESC, "MPS Low Limit B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "150.0853") field(DRVL, "-152.1937") field(PINI, "YES") field(VAL, "-152.1937") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:580:MPSBLLIM2") { field(DESC, "MPS Low Limit #2 B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "150.0853") field(DRVL, "-152.1937") field(PINI, "YES") field(VAL, "-152.1937") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } # Set the default to Std record(mbbo, "QUAD:LTUS:580: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, "QUAD:LTUS:580:MPSLIMITS.E PP") } record(aSub, "QUAD:LTUS:580: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, "QUAD:LTUS:580:MPS.RVAL") field(INPB, "QUAD:LTUS:580:BADIFF") field(INPC, "QUAD:LTUS:580:BDELTAS.N") field(INPD, "QUAD:LTUS:580:BACT") field(INPE, "QUAD:LTUS:580:MPSBITMASK.RVAL") field(INPF, "QUAD:LTUS:580:MPSBLLIM") field(INPG, "QUAD:LTUS:580:MPSBMIN") field(INPH, "QUAD:LTUS:580:MPSBMAX") field(INPI, "QUAD:LTUS:580: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, "QUAD:LTUS:580:INTOL.RVAL PP") field(OUTB, "QUAD:LTUS:580:INTOL_BMIN.RVAL PP") field(OUTC, "QUAD:LTUS:580:INTOL_BRANGE.RVAL PP") field(OUTD, "QUAD:LTUS:580: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, "QUAD:LTUS:580:INTOL") { field(DESC, "BACT within MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:580:MPSLIMITS.VALA") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "QUAD:LTUS:580:INTOL_BMIN") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:580:MPSLIMITS.VALB") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "QUAD:LTUS:580:INTOL_BMIN2") { field(DESC, "MPS tol #2") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:580:MPSLIMITS.VALD") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "QUAD:LTUS:580:INTOL_BRANGE") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:580: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, "QUAD:LTUS:580:CHCKITOL") { field(DESC, "Absolute Check I Tolerance") field(EGU, "A") field(FLNK, "QUAD:LTUS:580:TRIMITOL") field(CALC, "ABS(A*B)") field(INPA, "QUAD:LTUS:580:CHCKBTOL") field(INPB, "QUAD:LTUS:580:POLYCOEF.B") field(PREC, "9") } record(calc, "QUAD:LTUS:580:TRIMBTOL") { field(EGU, "kG") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(DESC, "Absolute Trim Tolerance") field(CALC, "ABS(A)/2") field(INPA, "QUAD:LTUS:580:CHCKBTOL") field(FLNK, "QUAD:LTUS:580:CHCKITOL") } record(calc, "QUAD:LTUS:580:CHCKBTOL") { field(DESC, "Check absolute tolerance") field(EGU, "A") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(FLNK, "QUAD:LTUS:580:TRIMBTOL") field(CALC, "MAX(ABS(A),ABS(C))*(B/1000000)") field(INPA, "QUAD:LTUS:580:BDES.HOPR") field(INPB, "QUAD:LTUS:580:STABILITY") field(INPC, "QUAD:LTUS:580:BDES.LOPR") } record(longout, "QUAD:LTUS:580: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, "QUAD:LTUS:580:CHCKBTOL") } record(calc, "QUAD:LTUS:580:TRIMITOL") { field(DESC, "Absolute Trim I Tolerance") field(EGU, "kG") field(CALC, "ABS(A*B)") field(INPA, "QUAD:LTUS:580:POLYCOEF.B") field(INPB, "QUAD:LTUS:580:TRIMBTOL") field(PREC, "9") } record(ai, "QUAD:LTUS:580:TRIMBTOLR") { field(DESC, "Relative trim tol") field(PREC, "4") field(EGU, "%") field(HOPR, "1.0") field(LOPR, "0.0") field(PINI, "YES") } record(ai, "QUAD:LTUS:580: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, "QUAD:LTUS:580:FBCKFCOM") { field(ZNAM, "CA") field(ONAM, "FCOM") field(DESC, "CA Mode") field(PINI, "YES") field(SDIS, "0") } record(bo, "QUAD:LTUS:580:PAU") { field(ZNAM, "NotConfigured") field(ONAM, "Configured") field(DESC, "PAU Present") field(PINI, "YES") field(SDIS, "0") field(FLNK, "QUAD:LTUS:580:PAUGO") } record(fanout, "QUAD:LTUS:580:PAUGO") { field(DESC, "PAU control") field(LNK1, "QUAD:LTUS:580:PAUSTOP") field(LNK2, "QUAD:LTUS:580: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, "QUAD:LTUS:580:PAUSTART") { field(DESC, "Setup for PAU On") field(SDIS, "QUAD:LTUS:580: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, "QUAD:LTUS:580:PAUSTOP") { field(DESC, "Setup for PAU Off") field(SDIS, "QUAD:LTUS:580: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, "QUAD:LTUS:580:MCORDEVNAME") { field(DESC, "PS device name") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, "PSC:LTUS:MG13:") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "QUAD:LTUS:580: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, "QUAD:LTUS:580:PSTYPE.RVAL") field(INPC, "QUAD:LTUS:580:TURNEDOFF.RVAL") field(INPD, "QUAD:LTUS:580:CONFIG.RVAL") field(INPE, "QUAD:LTUS:580:PSCATEGORY.RVAL") field(INPF, "QUAD:LTUS:580:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "QUAD:LTUS:580:AUTOCTRL.RVAL") field(INPJ, "QUAD:LTUS:580:OUTOFSERVICE.RVAL") field(INPL, "QUAD:LTUS:580:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "QUAD:LTUS:580:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "QUAD:LTUS:580:PAU") field(INPP, "QUAD:LTUS:580:CALBDISABLE.RVAL") field(INPQ, "QUAD:LTUS:580:PTRBDISABLE.RVAL") field(INPR, "QUAD:LTUS:580:TRIMDISABLE.RVAL") field(INPS, "QUAD:LTUS:580:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "QUAD:LTUS:580:FBCK") field(INPU, "QUAD:LTUS:580:TRIMTYPE.RVAL") field(INPV, "QUAD:LTUS:580:STDZDIRECT.RVAL") field(INPW, "QUAD:LTUS:580:DEGAUSENABLE.RVAL") field(FLNK, "QUAD:LTUS:580:HSTA") } record(longin, "QUAD:LTUS:580:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "QUAD:LTUS:580:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "QUAD:LTUS:580: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, "QUAD:LTUS:580: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, "QUAD:LTUS:580:CALBDISABLE") { field(DESC, "DAC Calb Disabled") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:580:PTRBDISABLE") { field(DESC, "Perturb Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:580:TRIMDISABLE") { field(DESC, "Trim Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:580: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 QUAD:LTUS:580:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses QUAD:LTUS:580:FBCK. # This PV should be replaced by QUAD:LTUS:580: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, "QUAD:LTUS:580: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, "QUAD:LTUS:580: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, "QUAD:LTUS:580: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, "") field(OMSL, "supervisory") field(FLNK, "QUAD:LTUS:580:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"QUAD:LTUS:580:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "QUAD:LTUS:580:OUTOFSERVICE NPP NMS") field(OUT, "QUAD:LTUS:580:ONLINE PP") } record(bo, "QUAD:LTUS:580:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "QUAD:LTUS:580: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, "1") } record(bo, "QUAD:LTUS:580: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, "1") } record(bo, "QUAD:LTUS:580: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, "QUAD:LTUS:580: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, "QUAD:LTUS:580: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, "QUAD:LTUS:580: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, "QUAD:LTUS:580: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, "QUAD:LTUS:580: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, "1") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:580: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, "1") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:580: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, "2") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:580: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, "0") field(ASG, "NOWRITE") field(FLNK, "QUAD:LTUS:580:TRIMTYPE") } record(stringout, "QUAD:LTUS:580:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "QUAD:LTUS:580:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "QUAD:LTUS:580:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "QUAD:LTUS:580:STATE.RVAL") field(INPB, "QUAD:LTUS:580:INTLKSUMY.RVAL") field(OUT, "QUAD:LTUS:580:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:LTUS:580: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, "QUAD:LTUS:580:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "QUAD:LTUS:580:STATE.RVAL") field(INPB, "QUAD:LTUS:580:INTLKSUMY.RVAL") field(OUT, "QUAD:LTUS:580:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:LTUS:580:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "QUAD:LTUS:580:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "QUAD:LTUS:580: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, "QUAD:LTUS:580:RAMPSTARTDLY") { field(DESC, "Tansition to ramp delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "2") } ######### For PSTYPE=2 Only ############# record(mbbo, "QUAD:LTUS:580: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, "QUAD:LTUS:580: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,"QUAD:LTUS:580: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("QUAD:LTUS:580:TURNEDOFF",3140,1907,0,1,"QUAD:LTUS:580:TURNEDOFF") #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "QUAD:LTUS:580:STATSUB") { field(DESC, "Build STATus ") field(INAM, "mgntInit") field(SNAM, "mgntSlcStat") field(INPA, "QUAD:LTUS:580:BACT.STAT") field(INPB, "QUAD:LTUS:580:BDES.STAT") field(INPC, "QUAD:LTUS:580:IRIPL.STAT") field(INPD, "PSC:LTUS:MG13:ISETPT.STAT") field(INPE, "PSC:LTUS:MG13:IACT.STAT") # 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, "QUAD:LTUS:580:BACT.SEVR") field(INPH, "QUAD:LTUS:580:BDES.SEVR") field(INPI, "QUAD:LTUS:580:IRIPL.SEVR") field(INPJ, "PSC:LTUS:MG13:ISETPT.SEVR") field(INPK, "PSC:LTUS:MG13:IACT.SEVR") # # 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, "QUAD:LTUS:580:STATE.RVAL") field(INPN, "QUAD:LTUS:580:STDZOK") field(INPO, "QUAD:LTUS:580:CALBOK") field(INPP, "QUAD:LTUS:580:OUTOFSERVICE.RVAL") field(INPQ, "QUAD:LTUS:580:CONFIG.RVAL") field(INPR, "QUAD:LTUS:580:HSTA") field(INPS, "QUAD:LTUS:580:CTRL.RVAL") field(INPT, "QUAD:LTUS:580:DEGAUSOK") field(INPV, "QUAD:LTUS:580: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, "QUAD:LTUS:580:STAT") } record(longout, "QUAD:LTUS:580:STAT") { field(DESC, "STAT sent to SLC") field(SCAN, "Passive") field(FLNK, "QUAD:LTUS:580:STATCTRLSUB") field(DOL, "QUAD:LTUS:580:STATSUB.VAL") field(OMSL, "closed_loop") } record(sSub, "QUAD:LTUS:580:STATCTRLSUB") { field(DESC, "Decode SLC STAT into mbbo") field(INAM, "mgntInit") field(SNAM, "mgntStatDecode") field(INPA, "QUAD:LTUS:580:STAT") field(INPB, "QUAD:LTUS:580:HSTA") field(INPD, "QUAD:LTUS:580:ONOFFCTRL.RVAL") field(FLNK, "QUAD:LTUS:580:STATMSG") } record(mbbo, "QUAD:LTUS:580: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, "QUAD:LTUS:580:UNAVAILGO") field(DOL, "QUAD:LTUS:580:STATCTRLSUB.W") } record(seq, "QUAD:LTUS:580:UNAVAILGO") { field(DESC, "Process UNAVAIL") field(DOL1, "QUAD:LTUS:580:STATSUB.U") field(LNK1, "QUAD:LTUS:580:UNAVAIL PP") } record(stringout, "QUAD:LTUS:580:SNLSTATMSG") { field(DTYP, "Soft Channel") } #! TextBox(TB0,820,1000,1200,1220,0,"Dialog",12,1,16777215,"QUAD:LTUS:580:STATUSSUB - future\nOverall device status - takes input from action snls, record sevrs, master snl(s) and outputs final status\n\nInputs:\nA - QUAD:LTUS:580:CTRLSTATUS - snl status\nB - MGNT:CTRLSTATUS - master list status\nC\nD - QUAD:LTUS:580: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,"QUAD:LTUS:580STATSUB\nformat control bo's into slc STAT\n\nInputs:\nA - QUAD:LTUS:580:STATUS\nC - QUAD:LTUS:580:ON\nD - QUAD:LTUS:580:STDZOK\nE - QUAD:LTUS:580:CALBOK\nF - QUAD:LTUS:580:BACTDRIFT (future)\nG -\nH- QUAD:LTUS:580:DACSTATUS\nI -QUAD:LTUS:580:ADCSTATUS\nJ - QUAD:LTUS:580:BACTSTATUS\nK - QUAD:LTUS:580:BDESSTATUS\nL - QUAD:LTUS:580:RIPLSTATUS\n\nOutput:\nP - QUAD:LTUS:580: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, "QUAD:LTUS:580: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, "QUAD:LTUS:580: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, "QUAD:LTUS:580: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, "QUAD:LTUS:580: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.6 #! DBDSTART #! DBD("../../../../dbd/mgntSoft.dbd") #! DBDEND record(stringout, "QUAD:LTUS:580:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:580:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "QUAD:LTUS:580:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "QUAD:LTUS:580:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "QUAD:LTUS:580:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "QUAD:LTUS:580:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "1") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "QUAD:LTUS:580: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, "QUAD:LTUS:580:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "QUAD:LTUS:580:TRIMTYPE.RVAL") field(INPB, "QUAD:LTUS:580:CONFIG.RVAL") field(OUT, "QUAD:LTUS:580:TRIMMAXNUM PP") } record(longout, "QUAD:LTUS:580: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, "QUAD:LTUS:580: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, "") field(OMSL, "supervisory") field(VAL, "20") field(OUT, "QUAD:LTUS:580:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "QUAD:LTUS:580: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, "") field(OMSL, "supervisory") field(VAL, "10") } record(bo, "QUAD:LTUS:580: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, "QUAD:LTUS:580: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, "QUAD:LTUS:580: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, "QUAD:LTUS:580:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "0") } record(ao, "QUAD:LTUS:580: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, "QUAD:LTUS:580:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "QUAD:LTUS:580: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, "QUAD:LTUS:580: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, "QUAD:LTUS:580:IMOVE") field(INPB, "QUAD:LTUS:580:IACT") field(INPC, "QUAD:LTUS:580:IRAMPRATE") field(INPD, "1.577") field(INPE, "QUAD:LTUS:580:TRIMDLYPCT") field(INPF, "QUAD:LTUS:580:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "QUAD:LTUS:580:RAMPTIME_LEFT PP") } record(longout, "QUAD:LTUS:580:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "QUAD:LTUS:580:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "QUAD:LTUS:580:RAMPDONE_CALC") } record(calc, "QUAD:LTUS:580:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "QUAD:LTUS:580:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "QUAD:LTUS:580:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "QUAD:LTUS:580: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, "QUAD:LTUS:580:RAMPTIME_LEFT") field(OUT, "QUAD:LTUS:580:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "QUAD:LTUS:580:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "QUAD:LTUS:580:RAMPTIME_LEFT NMS") field(OUT, "QUAD:LTUS:580:RAMPDONE PP") } record(bo, "QUAD:LTUS:580:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "QUAD:LTUS:580:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "QUAD:LTUS:580: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, "QUAD:LTUS:580: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(sSub, "QUAD:LTUS:580: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, "QUAD:LTUS:580:PSTYPE.RVAL") field(INPC, "QUAD:LTUS:580:TURNEDOFF.RVAL") field(INPD, "QUAD:LTUS:580:CONFIG.RVAL") field(INPE, "QUAD:LTUS:580:PSCATEGORY.RVAL") field(INPF, "QUAD:LTUS:580:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "QUAD:LTUS:580:AUTOCTRL.RVAL") field(INPJ, "QUAD:LTUS:580:OUTOFSERVICE.RVAL") field(INPL, "QUAD:LTUS:580:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "QUAD:LTUS:580:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "QUAD:LTUS:580:PAU") field(INPP, "QUAD:LTUS:580:CALBDISABLE.RVAL") field(INPQ, "QUAD:LTUS:580:PTRBDISABLE.RVAL") field(INPR, "QUAD:LTUS:580:TRIMDISABLE.RVAL") field(INPS, "QUAD:LTUS:580:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "QUAD:LTUS:580:FBCK") field(INPU, "QUAD:LTUS:580:TRIMTYPE.RVAL") field(INPV, "QUAD:LTUS:580:STDZDIRECT.RVAL") field(INPW, "QUAD:LTUS:580:DEGAUSENABLE.RVAL") field(FLNK, "QUAD:LTUS:580:HSTA") } record(longin, "QUAD:LTUS:580:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "QUAD:LTUS:580:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "QUAD:LTUS:580: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, "QUAD:LTUS:580: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, "QUAD:LTUS:580:CALBDISABLE") { field(DESC, "DAC Calb Disabled") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:580:PTRBDISABLE") { field(DESC, "Perturb Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:580:TRIMDISABLE") { field(DESC, "Trim Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:580:STDZDISABLE") { field(DTYP, "Raw Soft Channel") field(ZNAM, "NO") field(ONAM, "YES") field(DESC, "Standardize Function") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } # This PV has been replaced by QUAD:LTUS:580:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses QUAD:LTUS:580:FBCK. # This PV should be replaced by QUAD:LTUS:580: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, "QUAD:LTUS:580: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, "QUAD:LTUS:580: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, "QUAD:LTUS:580: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, "") field(OMSL, "supervisory") field(FLNK, "QUAD:LTUS:580:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"QUAD:LTUS:580:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "QUAD:LTUS:580:OUTOFSERVICE NPP NMS") field(OUT, "QUAD:LTUS:580:ONLINE PP") } record(bo, "QUAD:LTUS:580:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "QUAD:LTUS:580: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, "1") } record(bo, "QUAD:LTUS:580: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, "1") } record(bo, "QUAD:LTUS:580: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, "QUAD:LTUS:580: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, "QUAD:LTUS:580: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, "QUAD:LTUS:580: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, "QUAD:LTUS:580: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, "QUAD:LTUS:580: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, "1") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:580: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, "1") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:580: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, "2") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:580: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, "0") field(ASG, "NOWRITE") field(FLNK, "QUAD:LTUS:580:TRIMTYPE") } record(stringout, "QUAD:LTUS:580:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "QUAD:LTUS:580:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "QUAD:LTUS:580:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "QUAD:LTUS:580:STATE.RVAL") field(INPB, "QUAD:LTUS:580:INTLKSUMY.RVAL") field(OUT, "QUAD:LTUS:580:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:LTUS:580: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, "QUAD:LTUS:580:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "QUAD:LTUS:580:STATE.RVAL") field(INPB, "QUAD:LTUS:580:INTLKSUMY.RVAL") field(OUT, "QUAD:LTUS:580:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:LTUS:580:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "QUAD:LTUS:580:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "QUAD:LTUS:580: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, "QUAD:LTUS:580:RAMPSTARTDLY") { field(DESC, "Tansition to ramp delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "2") } ######### For PSTYPE=2 Only ############# record(mbbo, "QUAD:LTUS:580: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, "QUAD:LTUS:580: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,"QUAD:LTUS:580: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("QUAD:LTUS:580:TURNEDOFF",3140,1907,0,1,"QUAD:LTUS:580:TURNEDOFF") #! 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, "QUAD:LTUS:620:IACT") { field(DESC, "Current") field(INP, "PSC:LTUS:MG14:IACT") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "-200.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "QUAD:LTUS:620:BACT") info(autosaveFields,"HYST") } record(bi, "QUAD:LTUS:620:STATE") { field(DESC, "PS On/Off Status") field(DTYP, "Raw Soft Channel") field(INP, "PSC:LTUS:MG14:STATE NPP MS") field(ZSV, "MAJOR") field(ZNAM, "OFF") field(ONAM, "ON") } record(ao, "QUAD:LTUS:620:IDES") { field(DESC, "Desired Current") field(PREC, "3") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "-200.0") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(MDEL, "-1") field(HIHI, "200.0") field(LOLO, "-200.0") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "QUAD:LTUS:620:BDELTAS") field(DRVH, "200.0") field(DRVL, "-200.0") field(DOL, "QUAD:LTUS:620: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, "QUAD:LTUS:620:ICTRL PP") } # This record is processed by QUAD:LTUS:620:ICON") # Note: we are not setting alarms here. record(ao, "QUAD:LTUS:620:ICON") { field(DESC, "Config I") field(DTYP, "Soft Channel") field(PREC, "3") field(HOPR, "200.0") field(LOPR, "-200.0") field(DRVH, "200.0") field(DRVL, "-200.0") field(DOL, "QUAD:LTUS:620:B2ICON.K") field(OMSL, "closed_loop") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:620:INOM") { field(DESC, "Nominal Current") field(DOL, "QUAD:LTUS:620:BNOM.K") field(OMSL, "closed_loop") field(PREC, "3") field(EGU, "A") field(DRVH, "200.0") field(DRVL, "-200.0") field(HOPR, "200.0") field(LOPR, "-200.0") } record(ao, "QUAD:LTUS:620:ICTRL") { field(DESC, "Set Current") field(PREC, "3") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "-200.0") field(DRVH, "200.0") field(DRVL, "-200.0") field(MDEL, "-1") field(FLNK, "QUAD:LTUS:620:ICTRLGO") field(OMSL, "supervisory") info(autosavefields,"VAL") } record(seq, "QUAD:LTUS:620:ICTRLGO") { field(DESC, "Process Current Setpoint") field(PREC, "3") # Set ISETPT to supervisory field(DOL1, "0") field(LNK1, "QUAD:LTUS:620:ISETPT.OMSL") field(DOL2, "QUAD:LTUS:620:ICTRL") field(LNK2, "QUAD:LTUS:620:ISETPT PP") # Set ISETPT to closed loop - get data from BCTRLSUB.K field(DOL3, "1") field(LNK3, "QUAD:LTUS:620:ISETPT.OMSL") } record(ao, "QUAD:LTUS:620:IMAX") { field(DESC, "Max I") field(DTYP, "Soft Channel") field(DRVH, "200.0") field(DRVL, "-200.0") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "-200.0") field(PREC, "3") field(PINI, "YES") field(VAL, "200.0") field(FLNK, "QUAD:LTUS:620:IMIN") } record(ao, "QUAD:LTUS:620:IMIN") { field(DESC, "Min I") field(DTYP, "Soft Channel") field(DRVH, "200.0") field(DRVL, "-200.0") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "-200.0") field(PREC, "3") field(VAL, "-200.0") field(FLNK, "QUAD:LTUS:620:IRANGE") } record(sel, "QUAD:LTUS:620:IACTPREVOK") { field(DESC, "Last Good Current") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "-200.0") field(PREC, "3") field(NVL, "QUAD:LTUS:620:BACT.SEVR") field(INPA, "QUAD:LTUS:620:IACT NPP MS") field(INPB, "QUAD:LTUS:620:IACTPREVOK NPP MS") field(INPC, "QUAD:LTUS:620:IACTPREVOK NPP MS") field(INPD, "QUAD:LTUS:620:IACTPREVOK NPP MS") } record(sub, "QUAD:LTUS:620:IACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:620:IDES") field(INPB, "QUAD:LTUS:620:ISETPT.DRVH") field(INPC, "QUAD:LTUS:620:ISETPT.DRVL") field(INPD, "QUAD:LTUS:620:IDELTAS.I") field(INPE, "QUAD:LTUS:620:IDELTAS.J") field(INPG, "QUAD:LTUS:620:STATE") field(INPH, "QUAD:LTUS:620:HSTA") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "-200.0") field(PREC, "3") field(BRSV, "INVALID") } record(sub, "QUAD:LTUS:620:IMONLIMITS") { field(DESC, "Aux Current Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:620:IDES") field(INPB, "QUAD:LTUS:620:ISETPT.DRVH") field(INPC, "QUAD:LTUS:620:ISETPT.DRVL") field(INPD, "QUAD:LTUS:620:IDELTAS.K") field(INPE, "QUAD:LTUS:620:IDELTAS.L") field(INPG, "QUAD:LTUS:620:STATE") field(INPH, "QUAD:LTUS:620:HSTA") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "-200.0") field(PREC, "3") field(BRSV, "INVALID") } record(seq, "QUAD:LTUS:620:ILIMITS") { field(DESC, "Set ACT and MON Limits") field(PREC, "3") field(DOL1, "QUAD:LTUS:620:BLIMITS") field(LNK1, "QUAD:LTUS:620:IACTLIMITS.F PP") field(DOL2, "QUAD:LTUS:620:IACTLIMITS.I") field(LNK2, "QUAD:LTUS:620:IACT.HIGH") field(DOL3, "QUAD:LTUS:620:IACTLIMITS.J") field(LNK3, "QUAD:LTUS:620:IACT.LOW") field(DOL4, "QUAD:LTUS:620:IACTLIMITS.K") field(LNK4, "QUAD:LTUS:620:IACT.HIHI") field(DOL5, "QUAD:LTUS:620:IACTLIMITS.L") field(LNK5, "QUAD:LTUS:620:IACT.LOLO") field(DOL6, "QUAD:LTUS:620:BLIMITS") field(LNK6, "QUAD:LTUS:620:IMONLIMITS.F PP") field(DOL7, "QUAD:LTUS:620:IMONLIMITS.I") field(LNK7, "QUAD:LTUS:620:IMON.HIGH") field(DOL8, "QUAD:LTUS:620:IMONLIMITS.J") field(LNK8, "QUAD:LTUS:620:IMON.LOW") field(DOL9, "QUAD:LTUS:620:IMONLIMITS.K") field(LNK9, "QUAD:LTUS:620:IMON.HIHI") field(DOLA, "QUAD:LTUS:620:IMONLIMITS.L") field(LNKA, "QUAD:LTUS:620: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, "QUAD:LTUS:620:IDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntRawDeltas") field(INPD, "QUAD:LTUS:620:TRIMBTOL") field(INPE, "QUAD:LTUS:620:CHCKBTOL") field(INPF, "QUAD:LTUS:620:BDELTAS.K") field(INPG, "QUAD:LTUS:620:BDELTAS.L") field(INPH, "QUAD:LTUS:620: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, "QUAD:LTUS:620:STDZITOLR") field(INPC, "QUAD:LTUS:620:STDZITOL") field(FLNK, "") } # All ps controllers with on/off control will set the macro ONOF # as follows: # # ONOF = PSC:LTUS:MG14: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, "QUAD:LTUS:620:STATESETPT") { field(DESC, "PS On/Off") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFF") field(ONAM, "ON") field(OUT, "PSC:LTUS:MG14:STATESETPT PP") 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 = PSC:LTUS:MG14:RESET PP # record(bo, "QUAD:LTUS:620:RESET") { field(DESC, "Interlock Latch Reset") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFF") field(ONAM, "ON") field(HIGH, "1.0") field(OUT, "PSC:LTUS:MG14:RESET PP") } record(bo, "QUAD:LTUS:620:RAMPSTATE") { field(DESC, "PS Ramp Status") field(DTYP, "Soft Channel") field(DOL, "PSC:LTUS:MG14:RAMPSTATE NPP 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, "QUAD:LTUS:620: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, "QUAD:LTUS:620:TRIMRAMPRATE") field(OUT, "PSC:LTUS:MG14:IRAMPRATE PP") field(FLNK, "QUAD:LTUS:620:STDZDLY") } record(ao, "QUAD:LTUS:620:ISETPT") { field(DESC, "Current Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "-200.0") field(DRVH, "200.0") field(DRVL, "-200.0") field(MDEL, "-1") field(OUT, "PSC:LTUS:MG14:ISETPT PP") field(DOL, "QUAD:LTUS:620: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, "QUAD:LTUS:620:IMON") { field(DESC, "Aux Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(INP, "PSC:LTUS:MG14:IMON") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "-200.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "QUAD:LTUS:620:BMON") } record(ao, "QUAD:LTUS:620:IRIPL") { field(DESC, "Ripple Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(DOL, "PSC:LTUS:MG14:IRIPL NPP NMS") field(OMSL, "closed_loop") field(EGU, "A") field(DRVH, "1.0") field(HOPR, "1.0") field(PREC, "3") field(FLNK, "QUAD:LTUS:620:IRIPLOK") } record(sub, "QUAD:LTUS:620:IRIPLOK") { field(DESC, "Ripple Current Status") field(INAM, "mgntInit") field(SNAM, "mgntRiplOK") field(INPA, "QUAD:LTUS:620:IRIPL.VAL") field(INPB, "QUAD:LTUS:620: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, "QUAD:LTUS:620:R") { field(DESC, "Resistance") field(EGU, "Ohms") field(PREC, "4") field(PINI, "YES") field(DOL, "PSC:LTUS:MG14:R NPP MS") 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, "QUAD:LTUS:620:IGND") { field(DESC, "Ground Current") field(EGU, "A") field(PREC, "6") field(PINI, "YES") field(DOL, "PSC:LTUS:MG14:IGND NPP MS") field(OMSL, "closed_loop") } record(bi, "QUAD:LTUS:620:INTLKSUMY") { field(DESC, "Interlock Summary") field(INP, "PSC:LTUS:MG14:INTLKSUMY NPP MS") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(ZNAM, "OK") field(ONAM, "FAULT") field(PINI, "NO") } record(mbbo, "QUAD:LTUS:620: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, "PSC:LTUS:MG14:COOLING") field(OMSL, "closed_loop") } # The following PV is processed by :BACTFO # which is processed by :BACT record(fanout, "QUAD:LTUS:620:IACTFO") { field(DESC, "IACT processing") field(SELM, "All") field(LNK1, "QUAD:LTUS:620:IACTPREVOK") field(LNK2, "QUAD:LTUS:620:IDIFF") field(LNK3, "QUAD:LTUS:620:IADIFF") field(LNK4, "QUAD:LTUS:620:IRATIO") field(LNK5, "QUAD:LTUS:620:IDIRECT") field(LNK6, "QUAD:LTUS:620:IACTPOL_CHECK") } record(calc, "QUAD:LTUS:620:IDIFF") { field(DESC, "IDES-IACT") field(CALC, "A-B") field(INPA, "QUAD:LTUS:620:IDES") field(INPB, "QUAD:LTUS:620:IACT") field(EGU, "A") field(PREC, "9") field(HOPR, "200.0") field(LOPR, "-200.0") } record(calc, "QUAD:LTUS:620:IADIFF") { field(DESC, "Absolute IDES-IACT") field(CALC, "A<0?ABS(A):A") field(INPA, "QUAD:LTUS:620:IDIFF") field(PREC, "9") } record(calc, "QUAD:LTUS:620:IRATIO") { field(DESC, "IDES-IACT/IMAX") field(CALC, "B?A/B:0") field(INPA, "QUAD:LTUS:620:IDIFF") field(INPB, "QUAD:LTUS:620:IDES.DRVH") field(PREC, "9") } record(calcout, "QUAD:LTUS:620:IRANGE") { field(DESC, "Current Range") field(PINI, "YES") field(CALC, "ABS(A-B)") field(INPA, "QUAD:LTUS:620:IMIN") field(INPB, "QUAD:LTUS:620: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, "QUAD:LTUS:620: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, "QUAD:LTUS:620:IACT") field(FLNK, "QUAD:LTUS:620:IACTPOL") } record(bo, "QUAD:LTUS:620:IACTPOL") { field(DESC, "Actual I Polarity") field(DTYP, "Raw Soft Channel") field(DOL, "QUAD:LTUS:620: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,"QUAD:LTUS:620:I*LIMITS:\n Calculate alarm and warning limits based on \n deltas from QUAD:LTUS:620:IDELTAS and the\n QUAD:LTUS:620: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,"QUAD:LTUS:620:IACT: \n Get copy of QUAD:LTUS:620:I. \n",null) #! TextBox(TB12,1280,3100,1760,3200,0,"Dialog",12,1,16777215,"QUAD:LTUS:620: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,"QUAD:LTUS:620:IDES:\n Contains raw value calculated by \nQUAD:LTUS:620: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 \nQUAD:LTUS:620:BDELTAS.\n",null) #! TextBox(TB10,56,1940,316,2340,0,"Dialog",12,1,16777215,"QUAD:LTUS:620: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 QUAD:LTUS:620: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 QUAD:LTUS:620: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,"QUAD:LTUS:620:ISETPT:\n Sets the hardware. When fast feedback is set on, this record is\n set to closed loop mode by QUAD:LTUS:620:FBCKSTART sequence. When \n the loop is closed, this record takes input calculated by \n BFBCK only. When fast feedback is set off, QUAD:LTUS:620:FBCKSTOP \n will set it back to supervisory so that the value can be set by \n QUAD:LTUS:620: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, "QUAD:LTUS:620:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:620:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "QUAD:LTUS:620:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "QUAD:LTUS:620:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "QUAD:LTUS:620:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "QUAD:LTUS:620:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "1") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "QUAD:LTUS:620: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, "QUAD:LTUS:620:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "QUAD:LTUS:620:TRIMTYPE.RVAL") field(INPB, "QUAD:LTUS:620:CONFIG.RVAL") field(OUT, "QUAD:LTUS:620:TRIMMAXNUM PP") } record(longout, "QUAD:LTUS:620: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, "QUAD:LTUS:620: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, "") field(OMSL, "supervisory") field(VAL, "10") field(OUT, "QUAD:LTUS:620:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "QUAD:LTUS:620: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, "") field(OMSL, "supervisory") field(VAL, "10") } record(bo, "QUAD:LTUS:620: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, "QUAD:LTUS:620: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, "QUAD:LTUS:620: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, "QUAD:LTUS:620:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "0") } record(ao, "QUAD:LTUS:620: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, "QUAD:LTUS:620:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "QUAD:LTUS:620: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, "QUAD:LTUS:620: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, "QUAD:LTUS:620:IMOVE") field(INPB, "QUAD:LTUS:620:IACT") field(INPC, "QUAD:LTUS:620:IRAMPRATE") field(INPD, "1.577") field(INPE, "QUAD:LTUS:620:TRIMDLYPCT") field(INPF, "QUAD:LTUS:620:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "QUAD:LTUS:620:RAMPTIME_LEFT PP") } record(longout, "QUAD:LTUS:620:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "QUAD:LTUS:620:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "QUAD:LTUS:620:RAMPDONE_CALC") } record(calc, "QUAD:LTUS:620:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "QUAD:LTUS:620:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "QUAD:LTUS:620:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "QUAD:LTUS:620: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, "QUAD:LTUS:620:RAMPTIME_LEFT") field(OUT, "QUAD:LTUS:620:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "QUAD:LTUS:620:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "QUAD:LTUS:620:RAMPTIME_LEFT NMS") field(OUT, "QUAD:LTUS:620:RAMPDONE PP") } record(bo, "QUAD:LTUS:620:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "QUAD:LTUS:620:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "QUAD:LTUS:620: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, "QUAD:LTUS:620: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, "QUAD:LTUS:620:STDZINIT") { field(DESC, "Proc. Stdz PVs on boot") field(PINI, "YES") field(DOL1, "1") field(DOL2, "1") field(DOL3, "1") field(LNK1, "QUAD:LTUS:620:DEBUG.PROC PP") field(LNK2, "QUAD:LTUS:620:STDZCYCLENUM.PROC PP") field(LNK3, "QUAD:LTUS:620:STDZDISABLE.PROC PP") field(LNK4, "QUAD:LTUS:620: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, "QUAD:LTUS:620:STDZSUB") { field(DESC, "Stdz subroutine") field(INAM, "mgntStdzInit") field(SNAM, "mgntStdz") field(BRSV, "INVALID") field(INPA, "QUAD:LTUS:620:STDZIMIN NPP NMS") field(INPB, "QUAD:LTUS:620:STDZIMAX NPP NMS") field(INPC, "QUAD:LTUS:620:STDZIFINAL NPP NMS") field(INPD, "QUAD:LTUS:620:STDZCYCLENUM NPP NMS") field(INPE, "QUAD:LTUS:620:STDZDIRECT.RVAL NPP NMS") field(INPF, "QUAD:LTUS:620:STDZDISABLE.RVAL CPP NMS") field(INPG, "QUAD:LTUS:620: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, "QUAD:LTUS:620:STDZWF PP") field(OUTB, "QUAD:LTUS:620: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, "QUAD:LTUS:620:STDZWF") } record(mbbo, "QUAD:LTUS:620: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, "QUAD:LTUS:620: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, "QUAD:LTUS:620:STDZMAINPS") { field(DESC, "Stdz by main or self") field(PINI, "YES") field(DTYP, "Soft Channel") field(ZNAM, "SELF") field(ONAM, "MAIN") } record(bo, "QUAD:LTUS:620: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, "QUAD:LTUS:620: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, "QUAD:LTUS:620: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, "QUAD:LTUS:620:STDZTOD") { field(DESC, "Successful Standardize Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "QUAD:LTUS:620:STDZLOSTTOD") { field(DESC, "Standardize Lost Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(longout, "QUAD:LTUS:620:STDZCYCLECNT") { field(DESC, "Cycle Count") field(PINI, "YES") } record(longout, "QUAD:LTUS:620:STDZCYCLENUM") { field(DESC, "No. Standardize Cycles") field(VAL, "3") field(HOPR, "10") field(LOPR, "0") field(DRVH, "10") field(DRVL, "0") field(PINI, "YES") field(FLNK, "QUAD:LTUS:620:STDZDIRECT") } # The default standardize direction is "UP" for # all LCLS Magnets.. record(bo, "QUAD:LTUS:620:STDZDIRECT") { field(DESC, "Standardize Direction ") field(ZNAM, "UP") field(ONAM, "DOWN") field(VAL, "0") field(FLNK, "QUAD:LTUS:620:STDZIMIN") } record(ao, "QUAD:LTUS:620:STDZIMIN") { field(DESC, "Min-STDZ Current") field(PREC, "1") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "-200.0") field(VAL, "-200.0") field(FLNK, "QUAD:LTUS:620:STDZIMAX") } record(ao, "QUAD:LTUS:620:STDZIMAX") { field(DESC, "Max. Standarize Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "-200.0") field(VAL, "200.0") field(FLNK, "QUAD:LTUS:620:STDZIFINAL") } record(ao, "QUAD:LTUS:620:STDZIFINAL") { field(DESC, "Final SDTZ Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "-200.0") field(VAL, "-200.0") field(FLNK, "QUAD:LTUS:620: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, "QUAD:LTUS:620: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, "QUAD:LTUS:620:STDZITOL") { field(DESC, "Stdz min tolerance") field(PREC, "5") field(CALC, "MAX(ABS(A),ABS(B))*C") field(INPA, "QUAD:LTUS:620:STDZIMIN CP NMS") field(INPB, "QUAD:LTUS:620:STDZIMAX CP MMS") field(INPC, "0.05") field(INPD, "QUAD:LTUS:620:STDZITOLR CP MMS") field(EGU, "A") field(FLNK, "QUAD:LTUS:620:IDELTAS") field(PINI, "YES") } # D - factor (3.154/2 = 1.577) for EPSC, otherwise, set to 1.0 record(calc, "QUAD:LTUS:620:STDZDLY") { field(DESC, "Ramp time for stdz cycle") field(CALC, "C>0?MAX(1,ABS((A-B)/C)*D):0") field(INPA, "QUAD:LTUS:620:STDZIMIN CP NMS") field(INPB, "QUAD:LTUS:620:STDZIMAX CP NMS") field(INPC, "QUAD:LTUS:620:TRIMRAMPRATE CP NMS") field(INPD, "1.577") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") } record(calc, "QUAD:LTUS:620:STDZRAMPDLY") { field(DESC, "Ramp delay total") field(CALC, "MAX(1,((A/100)*B+B))") field(PREC, "5") field(INPA, "QUAD:LTUS:620:TRIMDLYPCT CP MS") field(INPB, "QUAD:LTUS:620: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, "QUAD:LTUS:620:STDZMINIDLY") { field(DESC, "Mini-stdz delay") field(CALC, "A") field(PREC, "5") field(A, "1.0") field(EGU, "sec") field(PINI, "YES") } record(ao, "QUAD:LTUS:620: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, "QUAD:LTUS:620:STDZMINIDELTA") { field(DESC, "Stdz mini % of IMAX") field(CALC, "(B/100)*(A-C)") field(INPA, "QUAD:LTUS:620:IDES.HOPR") field(INPB, "QUAD:LTUS:620:STDZMINIPCT CPP NMS") field(INPC, "QUAD:LTUS:620:IDES.LOPR") field(PREC, "5") } record(calc, "QUAD:LTUS:620:STDZMINISETPT") { field(DESC, "Mini Stdz delta") field(CALC, "C==0?MAX(E-D,B):MIN(E+D,A)") field(INPA, "QUAD:LTUS:620:IDES.HOPR") field(INPB, "QUAD:LTUS:620:IDES.LOPR") field(INPC, "QUAD:LTUS:620:STDZDIRECT.RVAL") field(INPD, "QUAD:LTUS:620:STDZMINIDELTA") field(INPE, "QUAD:LTUS:620:IDES") field(PREC, "5") field(FLNK, "QUAD:LTUS:620: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, "QUAD:LTUS:620:STDZMINISETPTOOR") { field(DESC, "Mini Stdz setpoint out of range") field(CALC, "C==0?(E-DA)") field(INPA, "QUAD:LTUS:620:IDES.HOPR") field(INPB, "QUAD:LTUS:620:IDES.LOPR") field(INPC, "QUAD:LTUS:620:STDZDIRECT.RVAL") field(INPD, "QUAD:LTUS:620:STDZMINIDELTA") field(INPE, "QUAD:LTUS:620: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, "QUAD:LTUS:620: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, "QUAD:LTUS:620:IADJUST.RVAL") field(INPB, "QUAD:LTUS:620:STDZDIRECT.RVAL") field(INPC, "QUAD:LTUS:620:STDZOK.RVAL") field(INPD, "QUAD:LTUS:620:STDZDISABLE.RVAL") field(INPE, "QUAD:LTUS:620:STATE.RVAL CPP NMS") field(INPF, "QUAD:LTUS:620:ICTRL.RVAL") field(INPG, "QUAD:LTUS:620:STATE.SEVR") field(INPH, "QUAD:LTUS:620:BDELTAS.M") field(INPI, "QUAD:LTUS:620:IACT.SEVR") field(OUT, "QUAD:LTUS:620:STDZLOSTGO.SELN PP NMS") field(OOPT, "Transition To Non-zero") } record(seq, "QUAD:LTUS:620:STDZLOSTGO") { field(DESC, "Process lost stdz") field(SELM, "Mask") field(DOL1, "1") field(DOL2, "0") field(LNK1, "QUAD:LTUS:620:STDZLOSTTOD.PROC") field(LNK2, "QUAD:LTUS:620:STDZOK PP") } # Record maximum current after standardize # Reset to IACT from sequence after trim # Disable processing during (mini-)standardize or trim record(calc, "QUAD:LTUS:620:STDZIACTMAX") { field(DESC, "Max act current after stdz") field(CALC, "MAX(A, B)") field(DISV, "0") field(SDIS, "QUAD:LTUS:620:CHECKPWRDIP_ENABLE") field(INPA, "QUAD:LTUS:620:IACT CP") field(INPB, "QUAD:LTUS:620:STDZIACTMAX") field(EGU, "A") field(FLNK, "QUAD:LTUS:620:CHECKPWRDIP") } # Detect power dip if STDZOK is YES, STDZ is enabled, and IACT is valid # If IACT drops below STDZIACTMAX by more than the trim tolerance, clear STDZOK # Warning: Take the absolute value of the trim tolerance, or else quads of # negative polarity will always lose STDZ since their IDELTAS.I are negative. # Note: Large quads and bends are prone to losing STDZ even if they are # perturbed toward higher current since their current tends to overshoot # by greater than the trim tolerance before settling down. record(calcout, "QUAD:LTUS:620:CHECKPWRDIP") { field(DESC, "Detect power dip") field(CALC, "(A-B>ABS(C))?3:0") field(DISV, "0") field(SDIS, "QUAD:LTUS:620:CHECKPWRDIP_ENABLE") field(INPA, "QUAD:LTUS:620:STDZIACTMAX") field(INPB, "QUAD:LTUS:620:IACT") field(INPC, "QUAD:LTUS:620:IDELTAS.I") field(OUT, "QUAD:LTUS:620:STDZLOSTGO.SELN PP NMS") field(OOPT, "When Non-zero") } # Enable processing of STDZIACTMAX and CHECKPWRDIP only if # STDZOK = YES, STDZDISABLE = NO, CTRL != Trim (2), and # CTRL != Stdz (4) record(calc, "QUAD:LTUS:620:CHECKPWRDIP_ENABLE") { field(CALC, "A&&!B&&(C#2)&&(C#4)") field(INPA, "QUAD:LTUS:620:STDZOK.RVAL CP") field(INPB, "QUAD:LTUS:620:STDZDISABLE.RVAL CP") field(INPC, "QUAD:LTUS:620:CTRL.RVAL CP") } #! 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, "QUAD:LTUS:620: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, "QUAD:LTUS:620:CALBOK") { field(DESC, "Successful Calibration") field(DTYP, "Raw Soft Channel") field(ZNAM, "NO") field(ONAM, "YES") field(DOL, "PSC:LTUS:MG14:CALBOK.RVAL") field(OMSL, "closed_loop") 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, "QUAD:LTUS:620:CALBSET") { field(DESC, "Use DAC Calbration") field(SCAN, "10 second") field(CALC, "A&&(B==0)&&C?31:960") field(INPA, "QUAD:LTUS:620:CALBOK") field(INPB, "QUAD:LTUS:620:CALBDISABLE") field(INPC, "QUAD:LTUS:620:CALBSLOPE") field(OOPT, "On Change") field(OUT, "QUAD:LTUS:620: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, "QUAD:LTUS:620:CALB_SEQ") { field(DESC, "Output Calib Values") field(SELM, "Mask") field(SELL, "QUAD:LTUS:620: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, "QUAD:LTUS:620:CALBSLOPE") field(DOL3, "QUAD:LTUS:620: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, "QUAD:LTUS:620:CALBTOD") { field(DESC, "Calibration Success Time") field(PINI, "YES") field(DOL, "PSC:LTUS:MG14:CALBTOD") field(OMSL, "closed_loop") field(DTYP, "Soft Channel") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:620: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, "QUAD:LTUS:620: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, "QUAD:LTUS:620: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, "QUAD:LTUS:620:CALBOFFSET") { field(DESC, "Calc DAC Offset") field(PREC, "6") field(EGU, "Counts") field(PINI, "YES") } record(bo, "QUAD:LTUS:620: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, "QUAD:LTUS:620:DACSLOPE") { field(DESC, "V to DAC slope") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "closed_loop") field(PINI, "YES") field(FLNK, "QUAD:LTUS:620:DACOFFSET") } # Default Offset used in conversion from Volts to DAC Counts record(ao, "QUAD:LTUS:620:DACOFFSET") { field(DESC, "V to DAC offset") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "closed_loop") field(PINI, "YES") field(FLNK, "QUAD:LTUS:620: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, "QUAD:LTUS:620: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, "QUAD:LTUS:620:IACT") field(INPD, "QUAD:LTUS:620:DACSLOPE") field(INPE, "QUAD:LTUS:620:DACOFFSET") field(EGU, "Counts") field(PREC, "6") } record(ao, "QUAD:LTUS:620:DAC") { field(DESC, "DAC Set point") field(EGU, "Counts") field(DOL, "") field(OMSL, "closed_loop") field(PREC, "6") field(PINI, "YES") } record(ao, "QUAD:LTUS:620:CALBIMIN") { field(DESC, "Calibration Min Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(DRVH, "200.0") field(HOPR, "200.0") field(DRVL, "-200.0") field(LOPR, "-200.0") field(PREC, "3") field(EGU, "A") field(VAL, "0.0") field(FLNK, "QUAD:LTUS:620:CALBIMAX") } record(ao, "QUAD:LTUS:620:CALBIMAX") { field(DESC, "Calibration Max Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(DRVH, "200.0") field(HOPR, "200.0") field(LOPR, "-200.0") field(DRVL, "-200.0") field(EGU, "A") field(VAL, "200.0") field(FLNK, "QUAD:LTUS:620:CALBSTEPNUM") } record(ao, "QUAD:LTUS:620:CALBIFINAL") { field(DESC, "Calibration Last Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(PREC, "3") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "-200.0") field(VAL, "0") } record(longout, "QUAD:LTUS:620: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, "QUAD:LTUS:620:CALBIDELTA") } record(calc, "QUAD:LTUS:620:CALBIDELTA") { field(DESC, "Step size for CALB") field(CALC, "C=0?0:ABS((A-B)/C)") field(INPA, "QUAD:LTUS:620:CALBIMAX") field(INPB, "QUAD:LTUS:620:CALBIMIN") field(INPC, "QUAD:LTUS:620: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, "QUAD:LTUS:620:CALBIMULT") { field(DESC, "IACT vs ISETPT mult") field(CALC, "C#0||A=0?1:ABS(B/A)") field(INPA, "PSC:LTUS:MG14:ISETPT.DRVH") field(INPB, "PSC:LTUS:MG14:IACT.HOPR") field(INPC, "QUAD:LTUS:620:PSCONTROLLER.RVAL CPP") field(EGU, "A") field(PINI, "YES") } # SNL dbputs DAC values here. 6-10 steps are possible. record(waveform, "QUAD:LTUS:620:CALBICTRLWF") { field(DESC, "ICTRL setpoint array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") } record(waveform, "QUAD:LTUS:620:DACWF") { field(DESC, "DAC count array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:620:DACSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:620:DACSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "QUAD:LTUS:620: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, "QUAD:LTUS:620:CALCDACWF") { field(DESC, "Calc DAC counts array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:620:CALCDACSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:620:CALCDACSA") { field(DESC, "Calc DAC counts") field(DTYP, "Soft Channel") field(INP, "QUAD:LTUS:620: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, "QUAD:LTUS:620:CALBYWF") { field(DESC, "mx + b") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:620:CALBYSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:620:CALBYSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "QUAD:LTUS:620:CALBYWF") field(MALM, "10") field(NELM, "6") field(INDX, "0") field(FTVL, "DOUBLE") } record(waveform, "QUAD:LTUS:620:CALBIACTWF") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:620:CALBIACTSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:620:CALBIACTSA") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(MALM, "10") field(NELM, "6") field(INP, "QUAD:LTUS:620:CALBIACTWF") field(INDX, "0") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:620:CALBLIMITS") } # Check that measured current during calibration is within # tolerance. record(aSub, "QUAD:LTUS:620: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, "QUAD:LTUS:620:CALBSTEPNUM") field(INPB, "QUAD:LTUS:620:CALBIACTWF") field(INPC, "QUAD:LTUS:620: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, "QUAD:LTUS:620: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, "QUAD:LTUS:620:STDZITOL") field(INPH, "QUAD:LTUS:620:DACSLOPE") field(INPI, "QUAD:LTUS:620: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, "QUAD:LTUS:620: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, "QUAD:LTUS:620:CALBSTEPNUM") field(INPB, "QUAD:LTUS:620:CALBIACTWF") field(INPC, "QUAD:LTUS:620:DACWF") field(INPF, "QUAD:LTUS:620: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 QUAD:LTUS:620CALBOK 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, "QUAD:LTUS:620:DEGAUSINIT") { field(DESC, "Proc. Degauss PVs on boot") field(PINI, "YES") field(DOL, "1") field(OUTA, "QUAD:LTUS:620:DEGAUSIMIN.PROC PP") field(OUTB, "QUAD:LTUS:620:DEGAUSIMAX.PROC PP") field(OUTC, "QUAD:LTUS:620:DEGAUSTYPE.PROC PP") field(OUTD, "QUAD:LTUS:620:DEGAUSSTEP.PROC PP") field(OUTE, "QUAD:LTUS:620:MADNAME.PROC PP") field(OUTF, "QUAD:LTUS:620:PSTYPE.PROC PP") field(OUTG, "QUAD:LTUS:620: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, "QUAD:LTUS:620:DEGAUSSUB") { field(DESC, "Degauss subroutine") field(INAM, "mgntDegaussInit") field(SNAM, "mgntDegauss") field(BRSV, "INVALID") field(INPA, "QUAD:LTUS:620:DEGAUSIMIN NPP NMS") field(INPB, "QUAD:LTUS:620:DEGAUSIMAX NPP NMS") field(INPC, "QUAD:LTUS:620:DEGAUSTYPE.RVAL NPP NMS") field(INPE, "QUAD:LTUS:620:DEGAUSMETHOD.RVAL NPP NMS") field(INPF, "QUAD:LTUS:620:PSTYPE NPP NMS") field(INPG, "QUAD:LTUS:620:DEBUG.RVAL NPP NMS") field(INPH, "QUAD:LTUS:620: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, "QUAD:LTUS:620:DEGAUSWF PP") field(OUTB, "QUAD:LTUS:620:DEGAUSMSG PP") field(OUTC, "QUAD:LTUS:620: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, "QUAD:LTUS:620:DEGAUSWF") { field(DESC, "Degauss Setpts") field(NELM, "60") field(FTVL, "DOUBLE") } record(mbbo,"QUAD:LTUS:620: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, "QUAD:LTUS:620: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, "QUAD:LTUS:620: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, "QUAD:LTUS:620: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, "QUAD:LTUS:620: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, "QUAD:LTUS:620:DEGAUSIMIN") { field(DESC, "Min. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "200.0") field(LOPR, "-200.0") field(DRVH, "200.0") field(DRVL, "-200.0") field(VAL, "-200.0") } record(ao, "QUAD:LTUS:620:DEGAUSIMAX") { field(DESC, "Max. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "200.0") field(LOPR, "-200.0") field(DRVH, "200.0") field(DRVL, "-200.0") field(VAL, "200.0") } # 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,"QUAD:LTUS:620: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, "QUAD:LTUS:620: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,"QUAD:LTUS:620: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, "QUAD:LTUS:620: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, "QUAD:LTUS:620: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, "QUAD:LTUS:620: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, "QUAD:LTUS:620:DEGAUSTOD") { field(DESC, "Successful Degauss Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "QUAD:LTUS:620:DEGAUSLOSTTOD") { field(DESC, "Degauss Lost Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:620:DEGAUSTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "QUAD:LTUS:620:DEGAUSTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "QUAD:LTUS:620: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, "QUAD:LTUS:620:DEGAUSGO") { field(DESC, "Set bdes of btrms to zero") field(ASG, "Internal") field(OUTA, "") field(OUTB, "") field(OUTC, "") field(OUTD, "") } # =========== CRYO ONLY =========== record(bo, "QUAD:LTUS:620: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, "QUAD:LTUS:620:DEGAUS_IMAX_CHECK") { field(DESC, "Check if imax shoud chg") field(CALC, "(C==4)&&(ABS(B)>ABS(A))?1:0") field(INPA, "QUAD:LTUS:620:DEGAUS_IMAX") field(INPB, "QUAD:LTUS:620:ISETPT") field(INPC, "QUAD:LTUS:620:DEGAUSTYPE.RVAL") field(OUT, "QUAD:LTUS:620:DEGAUS_IMAX_UPDATE.SELN") field(FLNK, "QUAD:LTUS:620:DEGAUS_IMAX_UPDATE") } record(seq, "QUAD:LTUS:620:DEGAUS_IMAX_UPDATE") { field(DESC, "Degauss IMAX Update") field(SELM, "Specified") field(DOL1, "QUAD:LTUS:620:ISETPT") field(LNK1, "QUAD:LTUS:620:DEGAUS_IMAX PP") } # Set the maximum current after a successful # degauss. This pv is updated by the # sequence. record(ao, "QUAD:LTUS:620:DEGAUS_IMAX") { field(DESC, "Max I set afer a degauss") field(EGU, "Amps") field(PINI, "YES") field(PREC, "6") field(HOPR, "200.0") field(LOPR, "-200.0") field(DRVH, "200.0") field(DRVL, "-200.0") field(VAL, "200.0") field(FLNK, "QUAD:LTUS:620:DEGAUS_IMAXPOL_CHECK") info(autosaveFields,"VAL,RVAL") } # Set the polarity if degauss_imax record(calcout, "QUAD:LTUS:620:DEGAUS_IMAXPOL_CHECK") { field(DESC, "Determine polarity of imax") field(CALC, "A>=0?0:1") field(INPA, "QUAD:LTUS:620:DEGAUS_IMAX") field(FLNK, "QUAD:LTUS:620:DEGAUS_IMAXPOL") } record(bo, "QUAD:LTUS:620:DEGAUS_IMAXPOL") { field(DESC, "Polarity of imax I") field(DTYP, "Raw Soft Channel") field(DOL, "QUAD:LTUS:620:DEGAUS_IMAXPOL_CHECK") field(OMSL, "closed_loop") field(ZNAM, "Positive") field(ONAM, "Negative") field(FLNK, "QUAD:LTUS:620: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, "QUAD:LTUS:620:DEGAUS_ABSIMAX") { field(DESC, "Absolute Max. Degauss I") field(CALC, "ABS(A)") field(INPA, "QUAD:LTUS:620:DEGAUS_IMAX") field(PREC, "6") field(EGU, "Amps") field(HOPR, "200.0") field(LOPR, "-200.0") info(autosaveFields,"VAL RVAL") } # IACT Polarity record(calcout, "QUAD:LTUS:620:IACTPOL_CHECK") { field(DESC, "Determine IACT polarity") field(SCAN, "5 second") field(CALC, "ABS(A-B)>C?(A>=0?0:1):D") field(INPA, "QUAD:LTUS:620:IACT") field(INPB, "QUAD:LTUS:620:IACTPOL_CHECK.LA") field(INPC, "0.0001") field(INPD, "QUAD:LTUS:620:IACTPOL_CHECK.PVAL") field(OOPT, "On Change") field(FLNK, "QUAD:LTUS:620:IACTPOL") } record(bo, "QUAD:LTUS:620: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,"QUAD:LTUS:620: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, "QUAD:LTUS:620:DEGAUSENABLE CP") field(INPB, "QUAD:LTUS:620:DEGAUSOK") field(INPC, "QUAD:LTUS:620:STATE CP") field(INPD, "QUAD:LTUS:620:STATE.SEVR") field(OUT, "QUAD:LTUS:620:DEGAUS_STATE_SEQ.SELN PP") field(ASG, "Internal") } record(seq, "QUAD:LTUS:620:DEGAUS_STATE_SEQ") { field(DESC, "Degauss State Sequence") field(SELM, "Specified") field(SELL, "QUAD:LTUS:620:DEGAUS_STATE_CHECK") field(LNK1, "QUAD:LTUS:620:DEGAUS_STATE_DISABLE.PROC PP") field(LNK2, "QUAD:LTUS:620:DEGAUS_STATE_LOST.PROC PP") field(LNK3, "QUAD:LTUS:620:DEGAUS_STATE_GOOD.PROC PP") field(LNK4, "QUAD:LTUS:620: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, "QUAD:LTUS:620:DEGAUS_STATE_DISABLE") { field(DESC, "Degauss not used") field(LNK1, "QUAD:LTUS:620:DEGAUSOK.ZSV") field(LNK2, "QUAD:LTUS:620: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, "QUAD:LTUS:620:STATMSG.FRSV") field(LNK4, "QUAD:LTUS:620: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, "QUAD:LTUS:620:DEGAUS_STATE_LOST") { field(DESC, "Degauss lost and ps On") field(DOL1, "1") field(LNK1, "QUAD:LTUS:620:DEGAUSOK.ZSV") field(LNK2, "QUAD:LTUS:620: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, "QUAD:LTUS:620:STATMSG.FRSV") field(LNK4, "QUAD:LTUS:620: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, "QUAD:LTUS:620:DEGAUS_STATE_OFF") { field(DESC, "Degaused lost and ps Off") field(DOL1, "2") field(LNK1, "QUAD:LTUS:620: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, "QUAD:LTUS:620:STATMSG.FRSV") field(LNK3, "QUAD:LTUS:620: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, "QUAD:LTUS:620:DEGAUS_STATE_GOOD") { field(DESC, "Degauss good") field(DOL1, "1") field(LNK1, "QUAD:LTUS:620: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, "QUAD:LTUS:620:STATMSG.FRSV PP") field(LNK3, "QUAD:LTUS:620:STATMSG.FVSV PP") field(LNK4, "") field(ASG, "Internal") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(mbbo, "QUAD:LTUS:620:FUNC") { field(DESC, "QUAD:LTUS:620 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, "1") field(THVL, "9") field(FRVL, "10") field(FVVL, "0") field(SXVL, "2") field(SVVL, "8") field(EIVL, "11") field(NIVL, "12") field(TEVL, "13") field(ELVL, "5") field(TVVL, "6") field(TTVL, "7") field(FTVL, "4") field(FFVL, "3") field(OUT, "QUAD:LTUS:620:CTRL CA") } # :CTRL pv is processed at boot in the # sequence mgntCtrl.st Processed in sequence # record(mbbo, "QUAD:LTUS:620:CTRL") { field(DESC, "QUAD:LTUS:620 Control") field(PINI, "NO") field(ZRST, "Ready") field(ONST, "TRIM") field(TWST, "PERTURB") field(THST, "BCON_TO_BDES") field(FRST, "BACT_TO_BDES") field(FVST, "SAVE_BDES") field(SXST, "LOAD_BDES") field(SVST, "UNDO_BDES") field(EIST, "DAC_ZERO") field(NIST, "CALB") field(TEST, "STDZ") field(ELST, "RESET") field(TVST, "TURN_ON") field(TTST, "TURN_OFF") field(FTST, "") field(FFST, "") field(ZRVL, "0") field(ONVL, "2") field(TWVL, "6") field(THVL, "15") field(FRVL, "14") field(FVVL, "11") field(SXVL, "12") field(SVVL, "13") field(EIVL, "7") field(NIVL, "3") field(TEVL, "4") field(ELVL, "8") field(TVVL, "9") field(TTVL, "10") field(FTVL, "0") field(FFVL, "0") field(OUT, "QUAD:LTUS:620:SELECTEN.A PP") field(SDIS, "0") } # If a function has been selected set this unit to busy record(calcout, "QUAD:LTUS:620:SELECTEN") { field(DESC, "Control Select Enable") field(CALC, "A>0?1:A") field(FLNK, "QUAD:LTUS:620:BUSY") } # Set to FREE on IOC reboot record(bo, "QUAD:LTUS:620:BUSY") { field(DESC, "QUAD:LTUS:620 Ctrl Done") field(DOL, "QUAD:LTUS:620:SELECTEN") field(ZNAM, "FREE") field(ONAM, "BUSY") field(PINI, "YES") field(FLNK, "QUAD:LTUS:620:SELECT") } record(bo, "QUAD:LTUS:620:SELECT") { field(ZNAM, "NO") field(ONAM, "YES") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") } record(bo, "QUAD:LTUS:620: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, "QUAD:LTUS:620:CTRLSTATE") { field(DESC, "QUAD:LTUS:620 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("QUAD:LTUS:620:CTRL",20,20,0,0,"QUAD:LTUS:620:CTRL") #! Field("QUAD:LTUS:620:CTRL.OUT",16777215,1,"QUAD:LTUS:620:CTRL.OUT") #! Link("QUAD:LTUS:620:CTRL.OUT","QUAD:LTUS:620:SELECTEN.A") #! Field("QUAD:LTUS:620:CTRL.VAL",16777215,1,"QUAD:LTUS:620:CTRL.VAL") #! Record("QUAD:LTUS:620:SELECTEN",321,381,0,0,"QUAD:LTUS:620:SELECTEN") #! Field("QUAD:LTUS:620:SELECTEN.A",16777215,0,"QUAD:LTUS:620:SELECTEN.A") #! Field("QUAD:LTUS:620:SELECTEN.FLNK",16777215,1,"QUAD:LTUS:620:SELECTEN.FLNK") #! Link("QUAD:LTUS:620:SELECTEN.FLNK","QUAD:LTUS:620:BUSY") #! Field("QUAD:LTUS:620:SELECTEN.VAL",16777215,1,"QUAD:LTUS:620:SELECTEN.VAL") #! Record("QUAD:LTUS:620:BUSY",623,274,0,0,"QUAD:LTUS:620:BUSY") #! Field("QUAD:LTUS:620:BUSY.DOL",16777215,0,"QUAD:LTUS:620:BUSY.DOL") #! Link("QUAD:LTUS:620:BUSY.DOL","QUAD:LTUS:620:SELECTEN.VAL") #! Field("QUAD:LTUS:620:BUSY.FLNK",16777215,1,"QUAD:LTUS:620:BUSY.FLNK") #! Link("QUAD:LTUS:620:BUSY.FLNK","QUAD:LTUS:620:SELECT") #! Record("QUAD:LTUS:620:SELECT",669,508,0,1,"QUAD:LTUS:620:SELECT") #! Record("QUAD:LTUS:620:FUNC",940,120,0,0,"QUAD:LTUS:620:FUNC") #! Field("QUAD:LTUS:620:FUNC.OUT",16777215,0,"QUAD:LTUS:620:FUNC.OUT") #! Link("QUAD:LTUS:620:FUNC.OUT","QUAD:LTUS:620:CTRL.VAL") #! Record("QUAD:LTUS:620:ABORT",193,41,0,0,"QUAD:LTUS:620:ABORT") #! Record("QUAD:LTUS:620:CTRLSTATE",369,34,0,0,"QUAD:LTUS:620: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,"QUAD:LTUS:620:SELECT is used for Multi-device selection.\nIt is enabled when associated QUAD:LTUS:620:CTRL is \"0\" (DONE).\nIt is disabled when associated QUAD:LTUS:620: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,"QUAD:LTUS:620: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, "QUAD:LTUS:620:BCTRL_INIT") { field(DESC, "Process BCTRL on boot") field(PINI, "YES") field(CALC, "A=3?1:0") field(INPA, "QUAD:LTUS:620:BCTRL.SEVR") field(OUT, "QUAD:LTUS:620: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, "QUAD:LTUS:620:BACT") { field(DESC, "Actual B") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "QUAD:LTUS:620:BACT") field(INPB, "QUAD:LTUS:620:POLYCOEF") field(INPC, "QUAD:LTUS:620:POLYCOEF.A") field(INPD, "QUAD:LTUS:620:POLYCOEF.B") field(INPE, "QUAD:LTUS:620:IACT MS") field(INPF, "QUAD:LTUS:620:BDELTAS PP") field(INPG, "100") field(EGU, "kG") field(HOPR, "102.1939") field(LOPR, "-102.3996") field(HIHI, "102.1939") field(LOLO, "-102.3996") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "102.1939") field(LOW, "-102.3996") field(FLNK, "QUAD:LTUS:620: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, "QUAD:LTUS:620:BDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntPhyDeltas") field(EGU, "kG") field(HOPR, "1") field(PREC, "7") field(BRSV, "INVALID") field(INPA, "QUAD:LTUS:620:BDES") field(INPB, "QUAD:LTUS:620:TRIMBTOL") field(INPC, "QUAD:LTUS:620:TRIMBTOLR") field(INPD, "QUAD:LTUS:620:CHCKBTOL") field(INPE, "QUAD:LTUS:620:CHCKBTOLR") field(F, "2.0") field(INPG, "30") field(INPH, "QUAD:LTUS:620:BACT.VAL") # # MPS absolute and relative tolerances field(INPP, "QUAD:LTUS:620:MPSBTOL") field(INPQ, "QUAD:LTUS:620:MPSBTOLR") field(FLNK, "QUAD:LTUS:620:BCONLIMITS") info(autosaveFields,"F") } # This record is processed by BDELTAS record(aSub, "QUAD:LTUS:620:BCONLIMITS") { field(DESC, "Config B-field Limits") field(INAM, "mgntInit") field(SNAM, "mgntBCONLimits") field(INPA, "QUAD:LTUS:620:BDES") field(INPB, "QUAD:LTUS:620:BDELTAS.I") field(INPG, "QUAD:LTUS:620:DEBUG.RVAL") field(FTA, "DOUBLE") field(FTB, "DOUBLE") field(FTG, "ULONG") field(OUTA, "QUAD:LTUS:620:BCON.HIGH") field(OUTB, "QUAD:LTUS:620:BCON.LOW") field(OUTC, "QUAD:LTUS:620:BCON.HIHI") field(OUTD, "QUAD:LTUS:620:BCON.LOLO PP") field(FTVA, "DOUBLE") field(FTVB, "DOUBLE") field(FTVC, "DOUBLE") field(FTVD, "DOUBLE") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:620:IDELTAS") } # The following PV is processed by :BACT # which is processed by :BACT # record(fanout, "QUAD:LTUS:620:BACTFO") { field(DESC, "BACT processing") field(SELM, "All") field(LNK1, "QUAD:LTUS:620:BDIFF") field(LNK2, "QUAD:LTUS:620:BADIFF") field(LNK3, "QUAD:LTUS:620:BRATIO") field(LNK4, "QUAD:LTUS:620:MPSLIMITS") field(LNK5, "QUAD:LTUS:620:I2BSTATUS") field(LNK6, "QUAD:LTUS:620:IACTFO.PROC") } record(calc, "QUAD:LTUS:620:BDIFF") { field(DESC, "BDES-BACT") field(CALC, "A-B") field(INPA, "QUAD:LTUS:620:BDES") field(INPB, "QUAD:LTUS:620:BACT") field(EGU, "kG") field(PREC, "7") } record(calc, "QUAD:LTUS:620:BADIFF") { field(DESC, "Absolute BDES-BACT") field(INPA, "QUAD:LTUS:620:BDIFF") field(EGU, "kG") field(PREC, "7") field(CALC, "A<0?ABS(A):A") } record(calc, "QUAD:LTUS:620:BRATIO") { field(DESC, "BACT Error") field(CALC, "B?A/B:0") field(INPA, "QUAD:LTUS:620:BDIFF") field(INPB, "QUAD:LTUS:620:BDES.HOPR") field(EGU, "kG") field(PREC, "7") } record(mbbi, "QUAD:LTUS:620: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, "QUAD:LTUS:620:BACT.J") } # Note: for a string slave set the MONFL # macro to the following: # MONFL=:IMONCALC MS record(sub, "QUAD:LTUS:620:BMON") { field(DESC, "Second Transductor") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "QUAD:LTUS:620:BMON") field(INPB, "QUAD:LTUS:620:POLYCOEF") field(INPC, "QUAD:LTUS:620:POLYCOEF.A") field(INPD, "QUAD:LTUS:620:POLYCOEF.B") field(INPE, "QUAD:LTUS:620:IMON MS") field(INPF, "QUAD:LTUS:620:BDELTAS.VAL") field(INPG, "100") field(EGU, "kG") field(HOPR, "102.1939") field(LOPR, "-102.3996") field(HIHI, "102.1939") field(LOLO, "-102.3996") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "102.1939") field(LOW, "-102.3996") } # 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=PSC:LTUS:MG14:BDES CP record(ao, "QUAD:LTUS:620:BDES") { field(DESC, "Desired B-Field") field(PINI, "YES") field(DRVH, "102.1939") field(DRVL, "-102.3996") field(HOPR, "102.1939") field(LOPR, "-102.3996") field(PREC, "7") field(EGU, "kG") field(MDEL, "-1") field(OMSL, "supervisory") # field(DOL, "") field(OUT, "QUAD:LTUS:620:B2IDES PP") info(autosaveFields,"VAL") } record(sub, "QUAD:LTUS:620:B2IDES") { field(DESC, "Convert Desired B-Field to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:620:POLYCOEF") field(INPC, "QUAD:LTUS:620:POLYCOEF.A") field(INPD, "QUAD:LTUS:620:POLYCOEF.B") field(PREC, "7") field(EGU, "kG") field(HOPR, "102.1939") field(LOPR, "-102.3996") field(MDEL, "-1") field(INPE, "QUAD:LTUS:620:BDES.DRVH") field(INPF, "QUAD:LTUS:620:BDES.DRVL") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:620:IDES") } record(sub, "QUAD:LTUS:620:BNOM") { field(DESC, "Nominal Field") field(PINI, "YES") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:620:POLYCOEF") field(INPC, "QUAD:LTUS:620:POLYCOEF.A") field(INPD, "QUAD:LTUS:620:POLYCOEF.B") field(INPE, "QUAD:LTUS:620:BDES.DRVH") field(INPF, "QUAD:LTUS:620:BDES.DRVL") field(EGU, "kG") field(HOPR, "102.1939") field(LOPR, "-102.3996") field(PREC, "7") field(VAL, "0.0") field(FLNK, "QUAD:LTUS:620:INOM") } record(sub, "QUAD:LTUS:620:BACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:620:BDES.VAL") field(INPB, "QUAD:LTUS:620:BDES.DRVH") field(INPC, "QUAD:LTUS:620:BDES.DRVL") field(INPD, "QUAD:LTUS:620:BDELTAS.I") field(INPE, "QUAD:LTUS:620:BDELTAS.J") field(INPG, "QUAD:LTUS:620:STATE") field(INPH, "QUAD:LTUS:620:HSTA") field(EGU, "kG") field(HOPR, "102.1939") field(LOPR, "-102.3996") field(PREC, "7") field(BRSV, "INVALID") } record(sub, "QUAD:LTUS:620:BMONLIMITS") { field(DESC, "MON Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:620:BDES.VAL") field(INPB, "QUAD:LTUS:620:BDES.DRVH") field(INPC, "QUAD:LTUS:620:BDES.DRVL") field(INPD, "QUAD:LTUS:620:BDELTAS.K") field(INPE, "QUAD:LTUS:620:BDELTAS.L") field(INPG, "QUAD:LTUS:620:STATE") field(INPH, "QUAD:LTUS:620:HSTA") field(EGU, "kG") field(HOPR, "102.1939") field(LOPR, "-102.3996") field(PREC, "7") field(BRSV, "INVALID") } record(seq, "QUAD:LTUS:620:BLIMITS") { field(DESC, "ACT Limits") field(PREC, "7") field(DOL1, "QUAD:LTUS:620:BLIMITS") field(LNK1, "QUAD:LTUS:620:BACTLIMITS.F PP") field(DOL2, "QUAD:LTUS:620:BACTLIMITS.I") field(LNK2, "QUAD:LTUS:620:BACT.HIGH") field(DOL3, "QUAD:LTUS:620:BACTLIMITS.J") field(LNK3, "QUAD:LTUS:620:BACT.LOW") field(DOL4, "QUAD:LTUS:620:BACTLIMITS.K") field(LNK4, "QUAD:LTUS:620:BACT.HIHI") field(DOL5, "QUAD:LTUS:620:BACTLIMITS.L") field(LNK5, "QUAD:LTUS:620:BACT.LOLO") field(DOL6, "QUAD:LTUS:620:BLIMITS") field(LNK6, "QUAD:LTUS:620:BMONLIMITS.F PP") field(DOL7, "QUAD:LTUS:620:BMONLIMITS.I") field(LNK7, "QUAD:LTUS:620:BMON.HIGH") field(DOL8, "QUAD:LTUS:620:BMONLIMITS.J") field(LNK8, "QUAD:LTUS:620:BMON.LOW") field(DOL9, "QUAD:LTUS:620:BMONLIMITS.K") field(LNK9, "QUAD:LTUS:620:BMON.HIHI") field(DOLA, "QUAD:LTUS:620:BMONLIMITS.L") field(LNKA, "QUAD:LTUS:620:BMON.LOLO") field(FLNK, "QUAD:LTUS:620:ILIMITS") field(SCAN, "5 second") } record(ao, "QUAD:LTUS:620:BCTRL") { field(DESC, "B-Perturb") field(PREC, "7") field(EGU, "kG") field(DRVH, "102.1939") field(DRVL, "-102.3996") field(HOPR, "102.1939") field(LOPR, "-102.3996") # 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, "QUAD:LTUS:620: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, "QUAD:LTUS:620:BCTRLGO") { field(DESC, "Update DES and perturb") field(PREC, "7") # Disable BACT limits field(DOL1, "1") field(LNK1, "QUAD:LTUS:620:BLIMITS.VAL") # Update BDES with the BCTRL (slider) value field(DOL2, "QUAD:LTUS:620:BCTRL.VAL") field(LNK2, "QUAD:LTUS:620:BDES PP") field(DOL3, "1") field(LNK3, "QUAD:LTUS:620:IDIRECT.PROC PP") field(DOL4, "1") field(LNK4, "QUAD:LTUS:620:CHECKSTDZLOST.PROC PP") field(DOL5, "QUAD:LTUS:620:BCTRL.VAL") field(LNK5, "QUAD:LTUS:620:BCTRLSUB PP") # Re-enable BACT limits field(DOL6, "0") field(LNK6, "QUAD:LTUS:620:BLIMITS.VAL") } # Convert B-field to Current and output to ISETPT record(sub, "QUAD:LTUS:620:BCTRLSUB") { field(DESC, "Feedback") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:620:POLYCOEF") field(INPC, "QUAD:LTUS:620:POLYCOEF.A") field(INPD, "QUAD:LTUS:620:POLYCOEF.B") field(INPE, "QUAD:LTUS:620:BDES.DRVH") field(INPF, "QUAD:LTUS:620:BDES.DRVL") field(PREC, "7") field(EGU, "kG") field(HOPR, "102.1939") field(LOPR, "-102.3996") field(MDEL, "-1") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:620:ISETPT") } record(ao, "QUAD:LTUS:620:BDESPREVTRIM") { field(DESC, "trim bdes for undo") field(DTYP, "Soft Channel") field(DRVH, "102.1939") field(DRVL, "-102.3996") field(EGU, "kG") field(HOPR, "102.1939") field(LOPR, "-102.3996") field(PREC, "7") field(PINI, "YES") info(autosaveFields,"VAL") } record(stringin, "QUAD:LTUS:620:MADNAME") { field(DESC, "MAD deck nomenclature") field(PINI, "YES") field(VAL, "QEM1B") } record(ai, "QUAD:LTUS:620: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, "3400.753505") } record(ao, "QUAD:LTUS:620:BMAX") { field(DESC, "Max B-Field") field(DTYP, "Soft Channel") field(DRVH, "102.1939") field(DRVL, "-102.3996") field(EGU, "kG") field(HOPR, "102.1939") field(LOPR, "-102.3996") field(PREC, "7") field(PINI, "YES") field(VAL, "102.1939") field(FLNK, "QUAD:LTUS:620:BSTEP") } record(ao, "QUAD:LTUS:620:BMIN") { field(DESC, "Min B-Field") field(DTYP, "Soft Channel") field(DRVH, "102.1939") field(DRVL, "-102.3996") field(EGU, "kG") field(HOPR, "102.1939") field(LOPR, "-102.3996") field(PREC, "7") field(PINI, "YES") field(VAL, "-102.3996") field(FLNK, "QUAD:LTUS:620:BSTEP") } record(ao, "QUAD:LTUS:620:BDESSAVE") { field(DESC, "bdes for save/load") field(DTYP, "Soft Channel") field(DRVH, "102.1939") field(DRVL, "-102.3996") field(EGU, "kG") field(HOPR, "102.1939") field(LOPR, "-102.3996") field(PINI, "YES") field(PREC, "7") } # This record is processed by QUAD:LTUS:620: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, "QUAD:LTUS:620:BCON") { field(DESC, "Config B-Field ") field(DTYP, "Soft Channel") field(PREC, "7") field(EGU, "kG") field(HOPR, "102.1939") field(LOPR, "-102.3996") field(DRVH, "102.1939") field(DRVL, "-102.3996") # Set MINOR Alarm as the default, slaves will set NO_ALARM=0. field(HHSV, "MINOR") field(LLSV, "MINOR") field(HSV, "MINOR") field(LSV, "MINOR") # field(DOL , "") field(OMSL, "supervisory") field(OUT, "QUAD:LTUS:620:B2ICON PP") info(autosaveFields,"VAL") } record(sub, "QUAD:LTUS:620:B2ICON") { field(DESC, "Convert Desired ICon to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:620:POLYCOEF") field(INPC, "QUAD:LTUS:620:POLYCOEF.A") field(INPD, "QUAD:LTUS:620:POLYCOEF.B") field(PREC, "7") field(EGU, "kG") field(HOPR, "102.1939") field(LOPR, "-102.3996") field(MDEL, "-1") field(INPE, "QUAD:LTUS:620:BCON.DRVH") field(INPF, "QUAD:LTUS:620:BCON.DRVL") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:620: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, "QUAD:LTUS:620:BSTEP") { field(DESC, "B-Field step size") field(CALC, "(C==3)||(D==3)?0:ABS(A-B)*0.005") field(INPA, "QUAD:LTUS:620:BMAX") field(INPB, "QUAD:LTUS:620:BMIN") field(INPC, "QUAD:LTUS:620:BMIN.SEVR") field(INPD, "QUAD:LTUS:620:BMAX.SEVR") field(EGU, "kG") 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,"QUAD:LTUS:620:BCTRLDISABLECALC") { field(DESC, "Calc for disabling BCTRL") field(ASG, "Internal") field(CALC, "A?2:1") field(INPA, "QUAD:LTUS:620:ONLINE CP") field(OUT, "QUAD:LTUS:620:BCTRLDISABLEFOUT PP") } record(fanout, "QUAD:LTUS:620:BCTRLDISABLEFOUT") { field(DESC, "Disable BCTRL fanout") field(SELM, "Specified") field(SELL, "QUAD:LTUS:620:BCTRLDISABLECALC") field(LNK1, "QUAD:LTUS:620:BCTRLDISABLE") field(LNK2, "QUAD:LTUS:620:BCTRLENABLE") } record(stringout, "QUAD:LTUS:620:BCTRLDISABLE") { field(DESC, "Disable BCTRL") field(DTYP, "Soft Channel") field(OUT, "QUAD:LTUS:620:BCTRL.ASG") field(VAL, "NOWRITE") field(FLNK, "QUAD:LTUS:620:BCTRLDISV_UPDATE") } record(stringout, "QUAD:LTUS:620:BCTRLENABLE") { field(DESC, "Enable BCTRL") field(DTYP, "Soft Channel") field(OUT, "QUAD:LTUS:620:BCTRL.ASG") field(VAL, "") field(FLNK, "QUAD:LTUS:620:BCTRLDISV_UPDATE") } record(calcout, "QUAD:LTUS:620:BCTRLDISV_UPDATE") { field(DESC, "Calc for updating BCTRL.DISV") field(ASG, "Internal") field(CALC, "A") field(INPA, "QUAD:LTUS:620:ONLINE") field(OUT, "QUAD:LTUS:620: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,"QUAD:LTUS:620:BACT and MON\n are processed via links from \n QUAD:LTUS:620:IACT (device raw value readback 1)\n and\n QUAD:LTUS:620: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 QUAD:LTUS:620:POLYCOEF\nC = First polynomial coefficient (offset if linear)\nD = Second polynomial coefficient (slope if linear)\nE = QUAD:LTUS:620: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,"QUAD:LTUS:620:BDES\n is processed when set by CA users or \n QUAD:LTUS:620: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,"QUAD:LTUS:620: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 QUAD:LTUS:620: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 (QUAD:LTUS:620: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,"QUAD:LTUS:620:B*LIMITS and QUAD:LTUS:620:BLIMITS:\n Calculate alarm and warning limits based on \n deltas from QUAD:LTUS:620: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,"QUAD:LTUS:620: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,"QUAD:LTUS:620: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, "QUAD:LTUS:620: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, "QUAD:LTUS:620:MPSBTOL") { field(DESC, "Absolute mps tol") field(EGU, "kG") field(PREC, "2") field(CALC, "ABS(A)*0.02") field(INPA, "QUAD:LTUS:620:BMAX") field(PINI, "YES") } # # 21-Aug-2013: K. Luchini # Set channel access security so that users # cannot easily change values. record(ao, "QUAD:LTUS:620:MPSBMAX") { field(DESC, "MPS Max B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "102.1939") field(DRVL, "-102.3996") field(PINI, "YES") field(VAL, "102.1939") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:620:MPSBMIN") { field(DESC, "MPS Min B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "102.1939") field(DRVL, "-102.3996") field(PINI, "YES") field(VAL, "-102.3996") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:620:MPSBLLIM") { field(DESC, "MPS Low Limit B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "102.1939") field(DRVL, "-102.3996") field(PINI, "YES") field(VAL, "-102.3996") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:620:MPSBLLIM2") { field(DESC, "MPS Low Limit #2 B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "102.1939") field(DRVL, "-102.3996") field(PINI, "YES") field(VAL, "-102.3996") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } # Set the default to Std record(mbbo, "QUAD:LTUS:620: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, "QUAD:LTUS:620:MPSLIMITS.E PP") } record(aSub, "QUAD:LTUS:620: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, "QUAD:LTUS:620:MPS.RVAL") field(INPB, "QUAD:LTUS:620:BADIFF") field(INPC, "QUAD:LTUS:620:BDELTAS.N") field(INPD, "QUAD:LTUS:620:BACT") field(INPE, "QUAD:LTUS:620:MPSBITMASK.RVAL") field(INPF, "QUAD:LTUS:620:MPSBLLIM") field(INPG, "QUAD:LTUS:620:MPSBMIN") field(INPH, "QUAD:LTUS:620:MPSBMAX") field(INPI, "QUAD:LTUS:620: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, "QUAD:LTUS:620:INTOL.RVAL PP") field(OUTB, "QUAD:LTUS:620:INTOL_BMIN.RVAL PP") field(OUTC, "QUAD:LTUS:620:INTOL_BRANGE.RVAL PP") field(OUTD, "QUAD:LTUS:620: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, "QUAD:LTUS:620:INTOL") { field(DESC, "BACT within MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:620:MPSLIMITS.VALA") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "QUAD:LTUS:620:INTOL_BMIN") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:620:MPSLIMITS.VALB") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "QUAD:LTUS:620:INTOL_BMIN2") { field(DESC, "MPS tol #2") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:620:MPSLIMITS.VALD") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "QUAD:LTUS:620:INTOL_BRANGE") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:620: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, "QUAD:LTUS:620:CHCKITOL") { field(DESC, "Absolute Check I Tolerance") field(EGU, "A") field(FLNK, "QUAD:LTUS:620:TRIMITOL") field(CALC, "ABS(A*B)") field(INPA, "QUAD:LTUS:620:CHCKBTOL") field(INPB, "QUAD:LTUS:620:POLYCOEF.B") field(PREC, "9") } record(calc, "QUAD:LTUS:620:TRIMBTOL") { field(EGU, "kG") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(DESC, "Absolute Trim Tolerance") field(CALC, "ABS(A)/2") field(INPA, "QUAD:LTUS:620:CHCKBTOL") field(FLNK, "QUAD:LTUS:620:CHCKITOL") } record(calc, "QUAD:LTUS:620:CHCKBTOL") { field(DESC, "Check absolute tolerance") field(EGU, "A") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(FLNK, "QUAD:LTUS:620:TRIMBTOL") field(CALC, "MAX(ABS(A),ABS(C))*(B/1000000)") field(INPA, "QUAD:LTUS:620:BDES.HOPR") field(INPB, "QUAD:LTUS:620:STABILITY") field(INPC, "QUAD:LTUS:620:BDES.LOPR") } record(longout, "QUAD:LTUS:620: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, "QUAD:LTUS:620:CHCKBTOL") } record(calc, "QUAD:LTUS:620:TRIMITOL") { field(DESC, "Absolute Trim I Tolerance") field(EGU, "kG") field(CALC, "ABS(A*B)") field(INPA, "QUAD:LTUS:620:POLYCOEF.B") field(INPB, "QUAD:LTUS:620:TRIMBTOL") field(PREC, "9") } record(ai, "QUAD:LTUS:620:TRIMBTOLR") { field(DESC, "Relative trim tol") field(PREC, "4") field(EGU, "%") field(HOPR, "1.0") field(LOPR, "0.0") field(PINI, "YES") } record(ai, "QUAD:LTUS:620: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, "QUAD:LTUS:620:FBCKFCOM") { field(ZNAM, "CA") field(ONAM, "FCOM") field(DESC, "CA Mode") field(PINI, "YES") field(SDIS, "0") } record(bo, "QUAD:LTUS:620:PAU") { field(ZNAM, "NotConfigured") field(ONAM, "Configured") field(DESC, "PAU Present") field(PINI, "YES") field(SDIS, "0") field(FLNK, "QUAD:LTUS:620:PAUGO") } record(fanout, "QUAD:LTUS:620:PAUGO") { field(DESC, "PAU control") field(LNK1, "QUAD:LTUS:620:PAUSTOP") field(LNK2, "QUAD:LTUS:620: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, "QUAD:LTUS:620:PAUSTART") { field(DESC, "Setup for PAU On") field(SDIS, "QUAD:LTUS:620: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, "QUAD:LTUS:620:PAUSTOP") { field(DESC, "Setup for PAU Off") field(SDIS, "QUAD:LTUS:620: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, "QUAD:LTUS:620:MCORDEVNAME") { field(DESC, "PS device name") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, "PSC:LTUS:MG14:") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "QUAD:LTUS:620: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, "QUAD:LTUS:620:PSTYPE.RVAL") field(INPC, "QUAD:LTUS:620:TURNEDOFF.RVAL") field(INPD, "QUAD:LTUS:620:CONFIG.RVAL") field(INPE, "QUAD:LTUS:620:PSCATEGORY.RVAL") field(INPF, "QUAD:LTUS:620:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "QUAD:LTUS:620:AUTOCTRL.RVAL") field(INPJ, "QUAD:LTUS:620:OUTOFSERVICE.RVAL") field(INPL, "QUAD:LTUS:620:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "QUAD:LTUS:620:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "QUAD:LTUS:620:PAU") field(INPP, "QUAD:LTUS:620:CALBDISABLE.RVAL") field(INPQ, "QUAD:LTUS:620:PTRBDISABLE.RVAL") field(INPR, "QUAD:LTUS:620:TRIMDISABLE.RVAL") field(INPS, "QUAD:LTUS:620:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "QUAD:LTUS:620:FBCK") field(INPU, "QUAD:LTUS:620:TRIMTYPE.RVAL") field(INPV, "QUAD:LTUS:620:STDZDIRECT.RVAL") field(INPW, "QUAD:LTUS:620:DEGAUSENABLE.RVAL") field(FLNK, "QUAD:LTUS:620:HSTA") } record(longin, "QUAD:LTUS:620:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "QUAD:LTUS:620:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "QUAD:LTUS:620: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, "QUAD:LTUS:620: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, "QUAD:LTUS:620:CALBDISABLE") { field(DESC, "DAC Calb Disabled") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:620:PTRBDISABLE") { field(DESC, "Perturb Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:620:TRIMDISABLE") { field(DESC, "Trim Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:620: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 QUAD:LTUS:620:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses QUAD:LTUS:620:FBCK. # This PV should be replaced by QUAD:LTUS:620: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, "QUAD:LTUS:620: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, "QUAD:LTUS:620: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, "QUAD:LTUS:620: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, "") field(OMSL, "supervisory") field(FLNK, "QUAD:LTUS:620:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"QUAD:LTUS:620:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "QUAD:LTUS:620:OUTOFSERVICE NPP NMS") field(OUT, "QUAD:LTUS:620:ONLINE PP") } record(bo, "QUAD:LTUS:620:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "QUAD:LTUS:620: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, "1") } record(bo, "QUAD:LTUS:620: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, "1") } record(bo, "QUAD:LTUS:620: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, "QUAD:LTUS:620: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, "QUAD:LTUS:620: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, "QUAD:LTUS:620: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, "QUAD:LTUS:620: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, "QUAD:LTUS:620: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, "1") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:620: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, "1") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:620: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, "2") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:620: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, "0") field(ASG, "NOWRITE") field(FLNK, "QUAD:LTUS:620:TRIMTYPE") } record(stringout, "QUAD:LTUS:620:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "QUAD:LTUS:620:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "QUAD:LTUS:620:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "QUAD:LTUS:620:STATE.RVAL") field(INPB, "QUAD:LTUS:620:INTLKSUMY.RVAL") field(OUT, "QUAD:LTUS:620:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:LTUS:620: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, "QUAD:LTUS:620:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "QUAD:LTUS:620:STATE.RVAL") field(INPB, "QUAD:LTUS:620:INTLKSUMY.RVAL") field(OUT, "QUAD:LTUS:620:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:LTUS:620:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "QUAD:LTUS:620:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "QUAD:LTUS:620: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, "QUAD:LTUS:620:RAMPSTARTDLY") { field(DESC, "Tansition to ramp delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "2") } ######### For PSTYPE=2 Only ############# record(mbbo, "QUAD:LTUS:620: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, "QUAD:LTUS:620: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,"QUAD:LTUS:620: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("QUAD:LTUS:620:TURNEDOFF",3140,1907,0,1,"QUAD:LTUS:620:TURNEDOFF") #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "QUAD:LTUS:620:STATSUB") { field(DESC, "Build STATus ") field(INAM, "mgntInit") field(SNAM, "mgntSlcStat") field(INPA, "QUAD:LTUS:620:BACT.STAT") field(INPB, "QUAD:LTUS:620:BDES.STAT") field(INPC, "QUAD:LTUS:620:IRIPL.STAT") field(INPD, "PSC:LTUS:MG14:ISETPT.STAT") field(INPE, "PSC:LTUS:MG14:IACT.STAT") # 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, "QUAD:LTUS:620:BACT.SEVR") field(INPH, "QUAD:LTUS:620:BDES.SEVR") field(INPI, "QUAD:LTUS:620:IRIPL.SEVR") field(INPJ, "PSC:LTUS:MG14:ISETPT.SEVR") field(INPK, "PSC:LTUS:MG14:IACT.SEVR") # # 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, "QUAD:LTUS:620:STATE.RVAL") field(INPN, "QUAD:LTUS:620:STDZOK") field(INPO, "QUAD:LTUS:620:CALBOK") field(INPP, "QUAD:LTUS:620:OUTOFSERVICE.RVAL") field(INPQ, "QUAD:LTUS:620:CONFIG.RVAL") field(INPR, "QUAD:LTUS:620:HSTA") field(INPS, "QUAD:LTUS:620:CTRL.RVAL") field(INPT, "QUAD:LTUS:620:DEGAUSOK") field(INPV, "QUAD:LTUS:620: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, "QUAD:LTUS:620:STAT") } record(longout, "QUAD:LTUS:620:STAT") { field(DESC, "STAT sent to SLC") field(SCAN, "Passive") field(FLNK, "QUAD:LTUS:620:STATCTRLSUB") field(DOL, "QUAD:LTUS:620:STATSUB.VAL") field(OMSL, "closed_loop") } record(sSub, "QUAD:LTUS:620:STATCTRLSUB") { field(DESC, "Decode SLC STAT into mbbo") field(INAM, "mgntInit") field(SNAM, "mgntStatDecode") field(INPA, "QUAD:LTUS:620:STAT") field(INPB, "QUAD:LTUS:620:HSTA") field(INPD, "QUAD:LTUS:620:ONOFFCTRL.RVAL") field(FLNK, "QUAD:LTUS:620:STATMSG") } record(mbbo, "QUAD:LTUS:620: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, "QUAD:LTUS:620:UNAVAILGO") field(DOL, "QUAD:LTUS:620:STATCTRLSUB.W") } record(seq, "QUAD:LTUS:620:UNAVAILGO") { field(DESC, "Process UNAVAIL") field(DOL1, "QUAD:LTUS:620:STATSUB.U") field(LNK1, "QUAD:LTUS:620:UNAVAIL PP") } record(stringout, "QUAD:LTUS:620:SNLSTATMSG") { field(DTYP, "Soft Channel") } #! TextBox(TB0,820,1000,1200,1220,0,"Dialog",12,1,16777215,"QUAD:LTUS:620:STATUSSUB - future\nOverall device status - takes input from action snls, record sevrs, master snl(s) and outputs final status\n\nInputs:\nA - QUAD:LTUS:620:CTRLSTATUS - snl status\nB - MGNT:CTRLSTATUS - master list status\nC\nD - QUAD:LTUS:620: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,"QUAD:LTUS:620STATSUB\nformat control bo's into slc STAT\n\nInputs:\nA - QUAD:LTUS:620:STATUS\nC - QUAD:LTUS:620:ON\nD - QUAD:LTUS:620:STDZOK\nE - QUAD:LTUS:620:CALBOK\nF - QUAD:LTUS:620:BACTDRIFT (future)\nG -\nH- QUAD:LTUS:620:DACSTATUS\nI -QUAD:LTUS:620:ADCSTATUS\nJ - QUAD:LTUS:620:BACTSTATUS\nK - QUAD:LTUS:620:BDESSTATUS\nL - QUAD:LTUS:620:RIPLSTATUS\n\nOutput:\nP - QUAD:LTUS:620: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, "QUAD:LTUS:620: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, "QUAD:LTUS:620: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, "QUAD:LTUS:620: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, "QUAD:LTUS:620: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.6 #! DBDSTART #! DBD("../../../../dbd/mgntSoft.dbd") #! DBDEND record(stringout, "QUAD:LTUS:620:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:620:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "QUAD:LTUS:620:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "QUAD:LTUS:620:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "QUAD:LTUS:620:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "QUAD:LTUS:620:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "1") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "QUAD:LTUS:620: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, "QUAD:LTUS:620:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "QUAD:LTUS:620:TRIMTYPE.RVAL") field(INPB, "QUAD:LTUS:620:CONFIG.RVAL") field(OUT, "QUAD:LTUS:620:TRIMMAXNUM PP") } record(longout, "QUAD:LTUS:620: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, "QUAD:LTUS:620: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, "") field(OMSL, "supervisory") field(VAL, "20") field(OUT, "QUAD:LTUS:620:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "QUAD:LTUS:620: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, "") field(OMSL, "supervisory") field(VAL, "10") } record(bo, "QUAD:LTUS:620: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, "QUAD:LTUS:620: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, "QUAD:LTUS:620: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, "QUAD:LTUS:620:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "0") } record(ao, "QUAD:LTUS:620: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, "QUAD:LTUS:620:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "QUAD:LTUS:620: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, "QUAD:LTUS:620: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, "QUAD:LTUS:620:IMOVE") field(INPB, "QUAD:LTUS:620:IACT") field(INPC, "QUAD:LTUS:620:IRAMPRATE") field(INPD, "1.577") field(INPE, "QUAD:LTUS:620:TRIMDLYPCT") field(INPF, "QUAD:LTUS:620:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "QUAD:LTUS:620:RAMPTIME_LEFT PP") } record(longout, "QUAD:LTUS:620:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "QUAD:LTUS:620:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "QUAD:LTUS:620:RAMPDONE_CALC") } record(calc, "QUAD:LTUS:620:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "QUAD:LTUS:620:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "QUAD:LTUS:620:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "QUAD:LTUS:620: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, "QUAD:LTUS:620:RAMPTIME_LEFT") field(OUT, "QUAD:LTUS:620:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "QUAD:LTUS:620:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "QUAD:LTUS:620:RAMPTIME_LEFT NMS") field(OUT, "QUAD:LTUS:620:RAMPDONE PP") } record(bo, "QUAD:LTUS:620:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "QUAD:LTUS:620:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "QUAD:LTUS:620: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, "QUAD:LTUS:620: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(sSub, "QUAD:LTUS:620: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, "QUAD:LTUS:620:PSTYPE.RVAL") field(INPC, "QUAD:LTUS:620:TURNEDOFF.RVAL") field(INPD, "QUAD:LTUS:620:CONFIG.RVAL") field(INPE, "QUAD:LTUS:620:PSCATEGORY.RVAL") field(INPF, "QUAD:LTUS:620:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "QUAD:LTUS:620:AUTOCTRL.RVAL") field(INPJ, "QUAD:LTUS:620:OUTOFSERVICE.RVAL") field(INPL, "QUAD:LTUS:620:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "QUAD:LTUS:620:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "QUAD:LTUS:620:PAU") field(INPP, "QUAD:LTUS:620:CALBDISABLE.RVAL") field(INPQ, "QUAD:LTUS:620:PTRBDISABLE.RVAL") field(INPR, "QUAD:LTUS:620:TRIMDISABLE.RVAL") field(INPS, "QUAD:LTUS:620:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "QUAD:LTUS:620:FBCK") field(INPU, "QUAD:LTUS:620:TRIMTYPE.RVAL") field(INPV, "QUAD:LTUS:620:STDZDIRECT.RVAL") field(INPW, "QUAD:LTUS:620:DEGAUSENABLE.RVAL") field(FLNK, "QUAD:LTUS:620:HSTA") } record(longin, "QUAD:LTUS:620:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "QUAD:LTUS:620:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "QUAD:LTUS:620: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, "QUAD:LTUS:620: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, "QUAD:LTUS:620:CALBDISABLE") { field(DESC, "DAC Calb Disabled") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:620:PTRBDISABLE") { field(DESC, "Perturb Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:620:TRIMDISABLE") { field(DESC, "Trim Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:620:STDZDISABLE") { field(DTYP, "Raw Soft Channel") field(ZNAM, "NO") field(ONAM, "YES") field(DESC, "Standardize Function") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } # This PV has been replaced by QUAD:LTUS:620:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses QUAD:LTUS:620:FBCK. # This PV should be replaced by QUAD:LTUS:620: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, "QUAD:LTUS:620: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, "QUAD:LTUS:620: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, "QUAD:LTUS:620: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, "") field(OMSL, "supervisory") field(FLNK, "QUAD:LTUS:620:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"QUAD:LTUS:620:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "QUAD:LTUS:620:OUTOFSERVICE NPP NMS") field(OUT, "QUAD:LTUS:620:ONLINE PP") } record(bo, "QUAD:LTUS:620:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "QUAD:LTUS:620: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, "1") } record(bo, "QUAD:LTUS:620: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, "1") } record(bo, "QUAD:LTUS:620: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, "QUAD:LTUS:620: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, "QUAD:LTUS:620: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, "QUAD:LTUS:620: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, "QUAD:LTUS:620: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, "QUAD:LTUS:620: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, "1") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:620: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, "1") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:620: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, "2") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:620: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, "0") field(ASG, "NOWRITE") field(FLNK, "QUAD:LTUS:620:TRIMTYPE") } record(stringout, "QUAD:LTUS:620:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "QUAD:LTUS:620:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "QUAD:LTUS:620:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "QUAD:LTUS:620:STATE.RVAL") field(INPB, "QUAD:LTUS:620:INTLKSUMY.RVAL") field(OUT, "QUAD:LTUS:620:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:LTUS:620: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, "QUAD:LTUS:620:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "QUAD:LTUS:620:STATE.RVAL") field(INPB, "QUAD:LTUS:620:INTLKSUMY.RVAL") field(OUT, "QUAD:LTUS:620:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:LTUS:620:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "QUAD:LTUS:620:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "QUAD:LTUS:620: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, "QUAD:LTUS:620:RAMPSTARTDLY") { field(DESC, "Tansition to ramp delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "2") } ######### For PSTYPE=2 Only ############# record(mbbo, "QUAD:LTUS:620: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, "QUAD:LTUS:620: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,"QUAD:LTUS:620: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("QUAD:LTUS:620:TURNEDOFF",3140,1907,0,1,"QUAD:LTUS:620:TURNEDOFF") #! 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, "QUAD:LTUS:640:IACT") { field(DESC, "Current") field(INP, "PSC:LTUS:MG15:IACT") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "-200.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "QUAD:LTUS:640:BACT") info(autosaveFields,"HYST") } record(bi, "QUAD:LTUS:640:STATE") { field(DESC, "PS On/Off Status") field(DTYP, "Raw Soft Channel") field(INP, "PSC:LTUS:MG15:STATE NPP MS") field(ZSV, "MAJOR") field(ZNAM, "OFF") field(ONAM, "ON") } record(ao, "QUAD:LTUS:640:IDES") { field(DESC, "Desired Current") field(PREC, "3") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "-200.0") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(MDEL, "-1") field(HIHI, "200.0") field(LOLO, "-200.0") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "QUAD:LTUS:640:BDELTAS") field(DRVH, "200.0") field(DRVL, "-200.0") field(DOL, "QUAD:LTUS:640: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, "QUAD:LTUS:640:ICTRL PP") } # This record is processed by QUAD:LTUS:640:ICON") # Note: we are not setting alarms here. record(ao, "QUAD:LTUS:640:ICON") { field(DESC, "Config I") field(DTYP, "Soft Channel") field(PREC, "3") field(HOPR, "200.0") field(LOPR, "-200.0") field(DRVH, "200.0") field(DRVL, "-200.0") field(DOL, "QUAD:LTUS:640:B2ICON.K") field(OMSL, "closed_loop") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:640:INOM") { field(DESC, "Nominal Current") field(DOL, "QUAD:LTUS:640:BNOM.K") field(OMSL, "closed_loop") field(PREC, "3") field(EGU, "A") field(DRVH, "200.0") field(DRVL, "-200.0") field(HOPR, "200.0") field(LOPR, "-200.0") } record(ao, "QUAD:LTUS:640:ICTRL") { field(DESC, "Set Current") field(PREC, "3") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "-200.0") field(DRVH, "200.0") field(DRVL, "-200.0") field(MDEL, "-1") field(FLNK, "QUAD:LTUS:640:ICTRLGO") field(OMSL, "supervisory") info(autosavefields,"VAL") } record(seq, "QUAD:LTUS:640:ICTRLGO") { field(DESC, "Process Current Setpoint") field(PREC, "3") # Set ISETPT to supervisory field(DOL1, "0") field(LNK1, "QUAD:LTUS:640:ISETPT.OMSL") field(DOL2, "QUAD:LTUS:640:ICTRL") field(LNK2, "QUAD:LTUS:640:ISETPT PP") # Set ISETPT to closed loop - get data from BCTRLSUB.K field(DOL3, "1") field(LNK3, "QUAD:LTUS:640:ISETPT.OMSL") } record(ao, "QUAD:LTUS:640:IMAX") { field(DESC, "Max I") field(DTYP, "Soft Channel") field(DRVH, "200.0") field(DRVL, "-200.0") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "-200.0") field(PREC, "3") field(PINI, "YES") field(VAL, "200.0") field(FLNK, "QUAD:LTUS:640:IMIN") } record(ao, "QUAD:LTUS:640:IMIN") { field(DESC, "Min I") field(DTYP, "Soft Channel") field(DRVH, "200.0") field(DRVL, "-200.0") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "-200.0") field(PREC, "3") field(VAL, "-200.0") field(FLNK, "QUAD:LTUS:640:IRANGE") } record(sel, "QUAD:LTUS:640:IACTPREVOK") { field(DESC, "Last Good Current") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "-200.0") field(PREC, "3") field(NVL, "QUAD:LTUS:640:BACT.SEVR") field(INPA, "QUAD:LTUS:640:IACT NPP MS") field(INPB, "QUAD:LTUS:640:IACTPREVOK NPP MS") field(INPC, "QUAD:LTUS:640:IACTPREVOK NPP MS") field(INPD, "QUAD:LTUS:640:IACTPREVOK NPP MS") } record(sub, "QUAD:LTUS:640:IACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:640:IDES") field(INPB, "QUAD:LTUS:640:ISETPT.DRVH") field(INPC, "QUAD:LTUS:640:ISETPT.DRVL") field(INPD, "QUAD:LTUS:640:IDELTAS.I") field(INPE, "QUAD:LTUS:640:IDELTAS.J") field(INPG, "QUAD:LTUS:640:STATE") field(INPH, "QUAD:LTUS:640:HSTA") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "-200.0") field(PREC, "3") field(BRSV, "INVALID") } record(sub, "QUAD:LTUS:640:IMONLIMITS") { field(DESC, "Aux Current Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:640:IDES") field(INPB, "QUAD:LTUS:640:ISETPT.DRVH") field(INPC, "QUAD:LTUS:640:ISETPT.DRVL") field(INPD, "QUAD:LTUS:640:IDELTAS.K") field(INPE, "QUAD:LTUS:640:IDELTAS.L") field(INPG, "QUAD:LTUS:640:STATE") field(INPH, "QUAD:LTUS:640:HSTA") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "-200.0") field(PREC, "3") field(BRSV, "INVALID") } record(seq, "QUAD:LTUS:640:ILIMITS") { field(DESC, "Set ACT and MON Limits") field(PREC, "3") field(DOL1, "QUAD:LTUS:640:BLIMITS") field(LNK1, "QUAD:LTUS:640:IACTLIMITS.F PP") field(DOL2, "QUAD:LTUS:640:IACTLIMITS.I") field(LNK2, "QUAD:LTUS:640:IACT.HIGH") field(DOL3, "QUAD:LTUS:640:IACTLIMITS.J") field(LNK3, "QUAD:LTUS:640:IACT.LOW") field(DOL4, "QUAD:LTUS:640:IACTLIMITS.K") field(LNK4, "QUAD:LTUS:640:IACT.HIHI") field(DOL5, "QUAD:LTUS:640:IACTLIMITS.L") field(LNK5, "QUAD:LTUS:640:IACT.LOLO") field(DOL6, "QUAD:LTUS:640:BLIMITS") field(LNK6, "QUAD:LTUS:640:IMONLIMITS.F PP") field(DOL7, "QUAD:LTUS:640:IMONLIMITS.I") field(LNK7, "QUAD:LTUS:640:IMON.HIGH") field(DOL8, "QUAD:LTUS:640:IMONLIMITS.J") field(LNK8, "QUAD:LTUS:640:IMON.LOW") field(DOL9, "QUAD:LTUS:640:IMONLIMITS.K") field(LNK9, "QUAD:LTUS:640:IMON.HIHI") field(DOLA, "QUAD:LTUS:640:IMONLIMITS.L") field(LNKA, "QUAD:LTUS:640: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, "QUAD:LTUS:640:IDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntRawDeltas") field(INPD, "QUAD:LTUS:640:TRIMBTOL") field(INPE, "QUAD:LTUS:640:CHCKBTOL") field(INPF, "QUAD:LTUS:640:BDELTAS.K") field(INPG, "QUAD:LTUS:640:BDELTAS.L") field(INPH, "QUAD:LTUS:640: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, "QUAD:LTUS:640:STDZITOLR") field(INPC, "QUAD:LTUS:640:STDZITOL") field(FLNK, "") } # All ps controllers with on/off control will set the macro ONOF # as follows: # # ONOF = PSC:LTUS:MG15: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, "QUAD:LTUS:640:STATESETPT") { field(DESC, "PS On/Off") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFF") field(ONAM, "ON") field(OUT, "PSC:LTUS:MG15:STATESETPT PP") 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 = PSC:LTUS:MG15:RESET PP # record(bo, "QUAD:LTUS:640:RESET") { field(DESC, "Interlock Latch Reset") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFF") field(ONAM, "ON") field(HIGH, "1.0") field(OUT, "PSC:LTUS:MG15:RESET PP") } record(bo, "QUAD:LTUS:640:RAMPSTATE") { field(DESC, "PS Ramp Status") field(DTYP, "Soft Channel") field(DOL, "PSC:LTUS:MG15:RAMPSTATE NPP 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, "QUAD:LTUS:640: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, "QUAD:LTUS:640:TRIMRAMPRATE") field(OUT, "PSC:LTUS:MG15:IRAMPRATE PP") field(FLNK, "QUAD:LTUS:640:STDZDLY") } record(ao, "QUAD:LTUS:640:ISETPT") { field(DESC, "Current Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "-200.0") field(DRVH, "200.0") field(DRVL, "-200.0") field(MDEL, "-1") field(OUT, "PSC:LTUS:MG15:ISETPT PP") field(DOL, "QUAD:LTUS:640: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, "QUAD:LTUS:640:IMON") { field(DESC, "Aux Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(INP, "PSC:LTUS:MG15:IMON") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "-200.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "QUAD:LTUS:640:BMON") } record(ao, "QUAD:LTUS:640:IRIPL") { field(DESC, "Ripple Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(DOL, "PSC:LTUS:MG15:IRIPL NPP NMS") field(OMSL, "closed_loop") field(EGU, "A") field(DRVH, "1.0") field(HOPR, "1.0") field(PREC, "3") field(FLNK, "QUAD:LTUS:640:IRIPLOK") } record(sub, "QUAD:LTUS:640:IRIPLOK") { field(DESC, "Ripple Current Status") field(INAM, "mgntInit") field(SNAM, "mgntRiplOK") field(INPA, "QUAD:LTUS:640:IRIPL.VAL") field(INPB, "QUAD:LTUS:640: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, "QUAD:LTUS:640:R") { field(DESC, "Resistance") field(EGU, "Ohms") field(PREC, "4") field(PINI, "YES") field(DOL, "PSC:LTUS:MG15:R NPP MS") 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, "QUAD:LTUS:640:IGND") { field(DESC, "Ground Current") field(EGU, "A") field(PREC, "6") field(PINI, "YES") field(DOL, "PSC:LTUS:MG15:IGND NPP MS") field(OMSL, "closed_loop") } record(bi, "QUAD:LTUS:640:INTLKSUMY") { field(DESC, "Interlock Summary") field(INP, "PSC:LTUS:MG15:INTLKSUMY NPP MS") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(ZNAM, "OK") field(ONAM, "FAULT") field(PINI, "NO") } record(mbbo, "QUAD:LTUS:640: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, "PSC:LTUS:MG15:COOLING") field(OMSL, "closed_loop") } # The following PV is processed by :BACTFO # which is processed by :BACT record(fanout, "QUAD:LTUS:640:IACTFO") { field(DESC, "IACT processing") field(SELM, "All") field(LNK1, "QUAD:LTUS:640:IACTPREVOK") field(LNK2, "QUAD:LTUS:640:IDIFF") field(LNK3, "QUAD:LTUS:640:IADIFF") field(LNK4, "QUAD:LTUS:640:IRATIO") field(LNK5, "QUAD:LTUS:640:IDIRECT") field(LNK6, "QUAD:LTUS:640:IACTPOL_CHECK") } record(calc, "QUAD:LTUS:640:IDIFF") { field(DESC, "IDES-IACT") field(CALC, "A-B") field(INPA, "QUAD:LTUS:640:IDES") field(INPB, "QUAD:LTUS:640:IACT") field(EGU, "A") field(PREC, "9") field(HOPR, "200.0") field(LOPR, "-200.0") } record(calc, "QUAD:LTUS:640:IADIFF") { field(DESC, "Absolute IDES-IACT") field(CALC, "A<0?ABS(A):A") field(INPA, "QUAD:LTUS:640:IDIFF") field(PREC, "9") } record(calc, "QUAD:LTUS:640:IRATIO") { field(DESC, "IDES-IACT/IMAX") field(CALC, "B?A/B:0") field(INPA, "QUAD:LTUS:640:IDIFF") field(INPB, "QUAD:LTUS:640:IDES.DRVH") field(PREC, "9") } record(calcout, "QUAD:LTUS:640:IRANGE") { field(DESC, "Current Range") field(PINI, "YES") field(CALC, "ABS(A-B)") field(INPA, "QUAD:LTUS:640:IMIN") field(INPB, "QUAD:LTUS:640: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, "QUAD:LTUS:640: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, "QUAD:LTUS:640:IACT") field(FLNK, "QUAD:LTUS:640:IACTPOL") } record(bo, "QUAD:LTUS:640:IACTPOL") { field(DESC, "Actual I Polarity") field(DTYP, "Raw Soft Channel") field(DOL, "QUAD:LTUS:640: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,"QUAD:LTUS:640:I*LIMITS:\n Calculate alarm and warning limits based on \n deltas from QUAD:LTUS:640:IDELTAS and the\n QUAD:LTUS:640: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,"QUAD:LTUS:640:IACT: \n Get copy of QUAD:LTUS:640:I. \n",null) #! TextBox(TB12,1280,3100,1760,3200,0,"Dialog",12,1,16777215,"QUAD:LTUS:640: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,"QUAD:LTUS:640:IDES:\n Contains raw value calculated by \nQUAD:LTUS:640: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 \nQUAD:LTUS:640:BDELTAS.\n",null) #! TextBox(TB10,56,1940,316,2340,0,"Dialog",12,1,16777215,"QUAD:LTUS:640: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 QUAD:LTUS:640: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 QUAD:LTUS:640: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,"QUAD:LTUS:640:ISETPT:\n Sets the hardware. When fast feedback is set on, this record is\n set to closed loop mode by QUAD:LTUS:640:FBCKSTART sequence. When \n the loop is closed, this record takes input calculated by \n BFBCK only. When fast feedback is set off, QUAD:LTUS:640:FBCKSTOP \n will set it back to supervisory so that the value can be set by \n QUAD:LTUS:640: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, "QUAD:LTUS:640:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:640:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "QUAD:LTUS:640:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "QUAD:LTUS:640:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "QUAD:LTUS:640:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "QUAD:LTUS:640:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "1") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "QUAD:LTUS:640: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, "QUAD:LTUS:640:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "QUAD:LTUS:640:TRIMTYPE.RVAL") field(INPB, "QUAD:LTUS:640:CONFIG.RVAL") field(OUT, "QUAD:LTUS:640:TRIMMAXNUM PP") } record(longout, "QUAD:LTUS:640: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, "QUAD:LTUS:640: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, "") field(OMSL, "supervisory") field(VAL, "10") field(OUT, "QUAD:LTUS:640:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "QUAD:LTUS:640: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, "") field(OMSL, "supervisory") field(VAL, "10") } record(bo, "QUAD:LTUS:640: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, "QUAD:LTUS:640: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, "QUAD:LTUS:640: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, "QUAD:LTUS:640:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "0") } record(ao, "QUAD:LTUS:640: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, "QUAD:LTUS:640:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "QUAD:LTUS:640: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, "QUAD:LTUS:640: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, "QUAD:LTUS:640:IMOVE") field(INPB, "QUAD:LTUS:640:IACT") field(INPC, "QUAD:LTUS:640:IRAMPRATE") field(INPD, "1.577") field(INPE, "QUAD:LTUS:640:TRIMDLYPCT") field(INPF, "QUAD:LTUS:640:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "QUAD:LTUS:640:RAMPTIME_LEFT PP") } record(longout, "QUAD:LTUS:640:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "QUAD:LTUS:640:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "QUAD:LTUS:640:RAMPDONE_CALC") } record(calc, "QUAD:LTUS:640:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "QUAD:LTUS:640:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "QUAD:LTUS:640:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "QUAD:LTUS:640: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, "QUAD:LTUS:640:RAMPTIME_LEFT") field(OUT, "QUAD:LTUS:640:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "QUAD:LTUS:640:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "QUAD:LTUS:640:RAMPTIME_LEFT NMS") field(OUT, "QUAD:LTUS:640:RAMPDONE PP") } record(bo, "QUAD:LTUS:640:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "QUAD:LTUS:640:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "QUAD:LTUS:640: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, "QUAD:LTUS:640: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, "QUAD:LTUS:640:STDZINIT") { field(DESC, "Proc. Stdz PVs on boot") field(PINI, "YES") field(DOL1, "1") field(DOL2, "1") field(DOL3, "1") field(LNK1, "QUAD:LTUS:640:DEBUG.PROC PP") field(LNK2, "QUAD:LTUS:640:STDZCYCLENUM.PROC PP") field(LNK3, "QUAD:LTUS:640:STDZDISABLE.PROC PP") field(LNK4, "QUAD:LTUS:640: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, "QUAD:LTUS:640:STDZSUB") { field(DESC, "Stdz subroutine") field(INAM, "mgntStdzInit") field(SNAM, "mgntStdz") field(BRSV, "INVALID") field(INPA, "QUAD:LTUS:640:STDZIMIN NPP NMS") field(INPB, "QUAD:LTUS:640:STDZIMAX NPP NMS") field(INPC, "QUAD:LTUS:640:STDZIFINAL NPP NMS") field(INPD, "QUAD:LTUS:640:STDZCYCLENUM NPP NMS") field(INPE, "QUAD:LTUS:640:STDZDIRECT.RVAL NPP NMS") field(INPF, "QUAD:LTUS:640:STDZDISABLE.RVAL CPP NMS") field(INPG, "QUAD:LTUS:640: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, "QUAD:LTUS:640:STDZWF PP") field(OUTB, "QUAD:LTUS:640: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, "QUAD:LTUS:640:STDZWF") } record(mbbo, "QUAD:LTUS:640: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, "QUAD:LTUS:640: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, "QUAD:LTUS:640:STDZMAINPS") { field(DESC, "Stdz by main or self") field(PINI, "YES") field(DTYP, "Soft Channel") field(ZNAM, "SELF") field(ONAM, "MAIN") } record(bo, "QUAD:LTUS:640: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, "QUAD:LTUS:640: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, "QUAD:LTUS:640: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, "QUAD:LTUS:640:STDZTOD") { field(DESC, "Successful Standardize Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "QUAD:LTUS:640:STDZLOSTTOD") { field(DESC, "Standardize Lost Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(longout, "QUAD:LTUS:640:STDZCYCLECNT") { field(DESC, "Cycle Count") field(PINI, "YES") } record(longout, "QUAD:LTUS:640:STDZCYCLENUM") { field(DESC, "No. Standardize Cycles") field(VAL, "3") field(HOPR, "10") field(LOPR, "0") field(DRVH, "10") field(DRVL, "0") field(PINI, "YES") field(FLNK, "QUAD:LTUS:640:STDZDIRECT") } # The default standardize direction is "UP" for # all LCLS Magnets.. record(bo, "QUAD:LTUS:640:STDZDIRECT") { field(DESC, "Standardize Direction ") field(ZNAM, "UP") field(ONAM, "DOWN") field(VAL, "0") field(FLNK, "QUAD:LTUS:640:STDZIMIN") } record(ao, "QUAD:LTUS:640:STDZIMIN") { field(DESC, "Min-STDZ Current") field(PREC, "1") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "-200.0") field(VAL, "-200.0") field(FLNK, "QUAD:LTUS:640:STDZIMAX") } record(ao, "QUAD:LTUS:640:STDZIMAX") { field(DESC, "Max. Standarize Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "-200.0") field(VAL, "200.0") field(FLNK, "QUAD:LTUS:640:STDZIFINAL") } record(ao, "QUAD:LTUS:640:STDZIFINAL") { field(DESC, "Final SDTZ Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "-200.0") field(VAL, "-200.0") field(FLNK, "QUAD:LTUS:640: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, "QUAD:LTUS:640: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, "QUAD:LTUS:640:STDZITOL") { field(DESC, "Stdz min tolerance") field(PREC, "5") field(CALC, "MAX(ABS(A),ABS(B))*C") field(INPA, "QUAD:LTUS:640:STDZIMIN CP NMS") field(INPB, "QUAD:LTUS:640:STDZIMAX CP MMS") field(INPC, "0.05") field(INPD, "QUAD:LTUS:640:STDZITOLR CP MMS") field(EGU, "A") field(FLNK, "QUAD:LTUS:640:IDELTAS") field(PINI, "YES") } # D - factor (3.154/2 = 1.577) for EPSC, otherwise, set to 1.0 record(calc, "QUAD:LTUS:640:STDZDLY") { field(DESC, "Ramp time for stdz cycle") field(CALC, "C>0?MAX(1,ABS((A-B)/C)*D):0") field(INPA, "QUAD:LTUS:640:STDZIMIN CP NMS") field(INPB, "QUAD:LTUS:640:STDZIMAX CP NMS") field(INPC, "QUAD:LTUS:640:TRIMRAMPRATE CP NMS") field(INPD, "1.577") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") } record(calc, "QUAD:LTUS:640:STDZRAMPDLY") { field(DESC, "Ramp delay total") field(CALC, "MAX(1,((A/100)*B+B))") field(PREC, "5") field(INPA, "QUAD:LTUS:640:TRIMDLYPCT CP MS") field(INPB, "QUAD:LTUS:640: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, "QUAD:LTUS:640:STDZMINIDLY") { field(DESC, "Mini-stdz delay") field(CALC, "A") field(PREC, "5") field(A, "1.0") field(EGU, "sec") field(PINI, "YES") } record(ao, "QUAD:LTUS:640: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, "QUAD:LTUS:640:STDZMINIDELTA") { field(DESC, "Stdz mini % of IMAX") field(CALC, "(B/100)*(A-C)") field(INPA, "QUAD:LTUS:640:IDES.HOPR") field(INPB, "QUAD:LTUS:640:STDZMINIPCT CPP NMS") field(INPC, "QUAD:LTUS:640:IDES.LOPR") field(PREC, "5") } record(calc, "QUAD:LTUS:640:STDZMINISETPT") { field(DESC, "Mini Stdz delta") field(CALC, "C==0?MAX(E-D,B):MIN(E+D,A)") field(INPA, "QUAD:LTUS:640:IDES.HOPR") field(INPB, "QUAD:LTUS:640:IDES.LOPR") field(INPC, "QUAD:LTUS:640:STDZDIRECT.RVAL") field(INPD, "QUAD:LTUS:640:STDZMINIDELTA") field(INPE, "QUAD:LTUS:640:IDES") field(PREC, "5") field(FLNK, "QUAD:LTUS:640: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, "QUAD:LTUS:640:STDZMINISETPTOOR") { field(DESC, "Mini Stdz setpoint out of range") field(CALC, "C==0?(E-DA)") field(INPA, "QUAD:LTUS:640:IDES.HOPR") field(INPB, "QUAD:LTUS:640:IDES.LOPR") field(INPC, "QUAD:LTUS:640:STDZDIRECT.RVAL") field(INPD, "QUAD:LTUS:640:STDZMINIDELTA") field(INPE, "QUAD:LTUS:640: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, "QUAD:LTUS:640: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, "QUAD:LTUS:640:IADJUST.RVAL") field(INPB, "QUAD:LTUS:640:STDZDIRECT.RVAL") field(INPC, "QUAD:LTUS:640:STDZOK.RVAL") field(INPD, "QUAD:LTUS:640:STDZDISABLE.RVAL") field(INPE, "QUAD:LTUS:640:STATE.RVAL CPP NMS") field(INPF, "QUAD:LTUS:640:ICTRL.RVAL") field(INPG, "QUAD:LTUS:640:STATE.SEVR") field(INPH, "QUAD:LTUS:640:BDELTAS.M") field(INPI, "QUAD:LTUS:640:IACT.SEVR") field(OUT, "QUAD:LTUS:640:STDZLOSTGO.SELN PP NMS") field(OOPT, "Transition To Non-zero") } record(seq, "QUAD:LTUS:640:STDZLOSTGO") { field(DESC, "Process lost stdz") field(SELM, "Mask") field(DOL1, "1") field(DOL2, "0") field(LNK1, "QUAD:LTUS:640:STDZLOSTTOD.PROC") field(LNK2, "QUAD:LTUS:640:STDZOK PP") } # Record maximum current after standardize # Reset to IACT from sequence after trim # Disable processing during (mini-)standardize or trim record(calc, "QUAD:LTUS:640:STDZIACTMAX") { field(DESC, "Max act current after stdz") field(CALC, "MAX(A, B)") field(DISV, "0") field(SDIS, "QUAD:LTUS:640:CHECKPWRDIP_ENABLE") field(INPA, "QUAD:LTUS:640:IACT CP") field(INPB, "QUAD:LTUS:640:STDZIACTMAX") field(EGU, "A") field(FLNK, "QUAD:LTUS:640:CHECKPWRDIP") } # Detect power dip if STDZOK is YES, STDZ is enabled, and IACT is valid # If IACT drops below STDZIACTMAX by more than the trim tolerance, clear STDZOK # Warning: Take the absolute value of the trim tolerance, or else quads of # negative polarity will always lose STDZ since their IDELTAS.I are negative. # Note: Large quads and bends are prone to losing STDZ even if they are # perturbed toward higher current since their current tends to overshoot # by greater than the trim tolerance before settling down. record(calcout, "QUAD:LTUS:640:CHECKPWRDIP") { field(DESC, "Detect power dip") field(CALC, "(A-B>ABS(C))?3:0") field(DISV, "0") field(SDIS, "QUAD:LTUS:640:CHECKPWRDIP_ENABLE") field(INPA, "QUAD:LTUS:640:STDZIACTMAX") field(INPB, "QUAD:LTUS:640:IACT") field(INPC, "QUAD:LTUS:640:IDELTAS.I") field(OUT, "QUAD:LTUS:640:STDZLOSTGO.SELN PP NMS") field(OOPT, "When Non-zero") } # Enable processing of STDZIACTMAX and CHECKPWRDIP only if # STDZOK = YES, STDZDISABLE = NO, CTRL != Trim (2), and # CTRL != Stdz (4) record(calc, "QUAD:LTUS:640:CHECKPWRDIP_ENABLE") { field(CALC, "A&&!B&&(C#2)&&(C#4)") field(INPA, "QUAD:LTUS:640:STDZOK.RVAL CP") field(INPB, "QUAD:LTUS:640:STDZDISABLE.RVAL CP") field(INPC, "QUAD:LTUS:640:CTRL.RVAL CP") } #! 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, "QUAD:LTUS:640: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, "QUAD:LTUS:640:CALBOK") { field(DESC, "Successful Calibration") field(DTYP, "Raw Soft Channel") field(ZNAM, "NO") field(ONAM, "YES") field(DOL, "PSC:LTUS:MG15:CALBOK.RVAL") field(OMSL, "closed_loop") 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, "QUAD:LTUS:640:CALBSET") { field(DESC, "Use DAC Calbration") field(SCAN, "10 second") field(CALC, "A&&(B==0)&&C?31:960") field(INPA, "QUAD:LTUS:640:CALBOK") field(INPB, "QUAD:LTUS:640:CALBDISABLE") field(INPC, "QUAD:LTUS:640:CALBSLOPE") field(OOPT, "On Change") field(OUT, "QUAD:LTUS:640: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, "QUAD:LTUS:640:CALB_SEQ") { field(DESC, "Output Calib Values") field(SELM, "Mask") field(SELL, "QUAD:LTUS:640: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, "QUAD:LTUS:640:CALBSLOPE") field(DOL3, "QUAD:LTUS:640: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, "QUAD:LTUS:640:CALBTOD") { field(DESC, "Calibration Success Time") field(PINI, "YES") field(DOL, "PSC:LTUS:MG15:CALBTOD") field(OMSL, "closed_loop") field(DTYP, "Soft Channel") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:640: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, "QUAD:LTUS:640: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, "QUAD:LTUS:640: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, "QUAD:LTUS:640:CALBOFFSET") { field(DESC, "Calc DAC Offset") field(PREC, "6") field(EGU, "Counts") field(PINI, "YES") } record(bo, "QUAD:LTUS:640: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, "QUAD:LTUS:640:DACSLOPE") { field(DESC, "V to DAC slope") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "closed_loop") field(PINI, "YES") field(FLNK, "QUAD:LTUS:640:DACOFFSET") } # Default Offset used in conversion from Volts to DAC Counts record(ao, "QUAD:LTUS:640:DACOFFSET") { field(DESC, "V to DAC offset") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "closed_loop") field(PINI, "YES") field(FLNK, "QUAD:LTUS:640: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, "QUAD:LTUS:640: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, "QUAD:LTUS:640:IACT") field(INPD, "QUAD:LTUS:640:DACSLOPE") field(INPE, "QUAD:LTUS:640:DACOFFSET") field(EGU, "Counts") field(PREC, "6") } record(ao, "QUAD:LTUS:640:DAC") { field(DESC, "DAC Set point") field(EGU, "Counts") field(DOL, "") field(OMSL, "closed_loop") field(PREC, "6") field(PINI, "YES") } record(ao, "QUAD:LTUS:640:CALBIMIN") { field(DESC, "Calibration Min Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(DRVH, "200.0") field(HOPR, "200.0") field(DRVL, "-200.0") field(LOPR, "-200.0") field(PREC, "3") field(EGU, "A") field(VAL, "0.0") field(FLNK, "QUAD:LTUS:640:CALBIMAX") } record(ao, "QUAD:LTUS:640:CALBIMAX") { field(DESC, "Calibration Max Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(DRVH, "200.0") field(HOPR, "200.0") field(LOPR, "-200.0") field(DRVL, "-200.0") field(EGU, "A") field(VAL, "200.0") field(FLNK, "QUAD:LTUS:640:CALBSTEPNUM") } record(ao, "QUAD:LTUS:640:CALBIFINAL") { field(DESC, "Calibration Last Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(PREC, "3") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "-200.0") field(VAL, "0") } record(longout, "QUAD:LTUS:640: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, "QUAD:LTUS:640:CALBIDELTA") } record(calc, "QUAD:LTUS:640:CALBIDELTA") { field(DESC, "Step size for CALB") field(CALC, "C=0?0:ABS((A-B)/C)") field(INPA, "QUAD:LTUS:640:CALBIMAX") field(INPB, "QUAD:LTUS:640:CALBIMIN") field(INPC, "QUAD:LTUS:640: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, "QUAD:LTUS:640:CALBIMULT") { field(DESC, "IACT vs ISETPT mult") field(CALC, "C#0||A=0?1:ABS(B/A)") field(INPA, "PSC:LTUS:MG15:ISETPT.DRVH") field(INPB, "PSC:LTUS:MG15:IACT.HOPR") field(INPC, "QUAD:LTUS:640:PSCONTROLLER.RVAL CPP") field(EGU, "A") field(PINI, "YES") } # SNL dbputs DAC values here. 6-10 steps are possible. record(waveform, "QUAD:LTUS:640:CALBICTRLWF") { field(DESC, "ICTRL setpoint array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") } record(waveform, "QUAD:LTUS:640:DACWF") { field(DESC, "DAC count array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:640:DACSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:640:DACSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "QUAD:LTUS:640: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, "QUAD:LTUS:640:CALCDACWF") { field(DESC, "Calc DAC counts array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:640:CALCDACSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:640:CALCDACSA") { field(DESC, "Calc DAC counts") field(DTYP, "Soft Channel") field(INP, "QUAD:LTUS:640: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, "QUAD:LTUS:640:CALBYWF") { field(DESC, "mx + b") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:640:CALBYSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:640:CALBYSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "QUAD:LTUS:640:CALBYWF") field(MALM, "10") field(NELM, "6") field(INDX, "0") field(FTVL, "DOUBLE") } record(waveform, "QUAD:LTUS:640:CALBIACTWF") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:640:CALBIACTSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:640:CALBIACTSA") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(MALM, "10") field(NELM, "6") field(INP, "QUAD:LTUS:640:CALBIACTWF") field(INDX, "0") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:640:CALBLIMITS") } # Check that measured current during calibration is within # tolerance. record(aSub, "QUAD:LTUS:640: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, "QUAD:LTUS:640:CALBSTEPNUM") field(INPB, "QUAD:LTUS:640:CALBIACTWF") field(INPC, "QUAD:LTUS:640: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, "QUAD:LTUS:640: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, "QUAD:LTUS:640:STDZITOL") field(INPH, "QUAD:LTUS:640:DACSLOPE") field(INPI, "QUAD:LTUS:640: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, "QUAD:LTUS:640: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, "QUAD:LTUS:640:CALBSTEPNUM") field(INPB, "QUAD:LTUS:640:CALBIACTWF") field(INPC, "QUAD:LTUS:640:DACWF") field(INPF, "QUAD:LTUS:640: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 QUAD:LTUS:640CALBOK 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, "QUAD:LTUS:640:DEGAUSINIT") { field(DESC, "Proc. Degauss PVs on boot") field(PINI, "YES") field(DOL, "1") field(OUTA, "QUAD:LTUS:640:DEGAUSIMIN.PROC PP") field(OUTB, "QUAD:LTUS:640:DEGAUSIMAX.PROC PP") field(OUTC, "QUAD:LTUS:640:DEGAUSTYPE.PROC PP") field(OUTD, "QUAD:LTUS:640:DEGAUSSTEP.PROC PP") field(OUTE, "QUAD:LTUS:640:MADNAME.PROC PP") field(OUTF, "QUAD:LTUS:640:PSTYPE.PROC PP") field(OUTG, "QUAD:LTUS:640: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, "QUAD:LTUS:640:DEGAUSSUB") { field(DESC, "Degauss subroutine") field(INAM, "mgntDegaussInit") field(SNAM, "mgntDegauss") field(BRSV, "INVALID") field(INPA, "QUAD:LTUS:640:DEGAUSIMIN NPP NMS") field(INPB, "QUAD:LTUS:640:DEGAUSIMAX NPP NMS") field(INPC, "QUAD:LTUS:640:DEGAUSTYPE.RVAL NPP NMS") field(INPE, "QUAD:LTUS:640:DEGAUSMETHOD.RVAL NPP NMS") field(INPF, "QUAD:LTUS:640:PSTYPE NPP NMS") field(INPG, "QUAD:LTUS:640:DEBUG.RVAL NPP NMS") field(INPH, "QUAD:LTUS:640: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, "QUAD:LTUS:640:DEGAUSWF PP") field(OUTB, "QUAD:LTUS:640:DEGAUSMSG PP") field(OUTC, "QUAD:LTUS:640: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, "QUAD:LTUS:640:DEGAUSWF") { field(DESC, "Degauss Setpts") field(NELM, "60") field(FTVL, "DOUBLE") } record(mbbo,"QUAD:LTUS:640: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, "QUAD:LTUS:640: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, "QUAD:LTUS:640: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, "QUAD:LTUS:640: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, "QUAD:LTUS:640: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, "QUAD:LTUS:640:DEGAUSIMIN") { field(DESC, "Min. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "200.0") field(LOPR, "-200.0") field(DRVH, "200.0") field(DRVL, "-200.0") field(VAL, "-200.0") } record(ao, "QUAD:LTUS:640:DEGAUSIMAX") { field(DESC, "Max. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "200.0") field(LOPR, "-200.0") field(DRVH, "200.0") field(DRVL, "-200.0") field(VAL, "200.0") } # 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,"QUAD:LTUS:640: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, "QUAD:LTUS:640: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,"QUAD:LTUS:640: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, "QUAD:LTUS:640: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, "QUAD:LTUS:640: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, "QUAD:LTUS:640: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, "QUAD:LTUS:640:DEGAUSTOD") { field(DESC, "Successful Degauss Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "QUAD:LTUS:640:DEGAUSLOSTTOD") { field(DESC, "Degauss Lost Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:640:DEGAUSTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "QUAD:LTUS:640:DEGAUSTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "QUAD:LTUS:640: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, "QUAD:LTUS:640:DEGAUSGO") { field(DESC, "Set bdes of btrms to zero") field(ASG, "Internal") field(OUTA, "") field(OUTB, "") field(OUTC, "") field(OUTD, "") } # =========== CRYO ONLY =========== record(bo, "QUAD:LTUS:640: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, "QUAD:LTUS:640:DEGAUS_IMAX_CHECK") { field(DESC, "Check if imax shoud chg") field(CALC, "(C==4)&&(ABS(B)>ABS(A))?1:0") field(INPA, "QUAD:LTUS:640:DEGAUS_IMAX") field(INPB, "QUAD:LTUS:640:ISETPT") field(INPC, "QUAD:LTUS:640:DEGAUSTYPE.RVAL") field(OUT, "QUAD:LTUS:640:DEGAUS_IMAX_UPDATE.SELN") field(FLNK, "QUAD:LTUS:640:DEGAUS_IMAX_UPDATE") } record(seq, "QUAD:LTUS:640:DEGAUS_IMAX_UPDATE") { field(DESC, "Degauss IMAX Update") field(SELM, "Specified") field(DOL1, "QUAD:LTUS:640:ISETPT") field(LNK1, "QUAD:LTUS:640:DEGAUS_IMAX PP") } # Set the maximum current after a successful # degauss. This pv is updated by the # sequence. record(ao, "QUAD:LTUS:640:DEGAUS_IMAX") { field(DESC, "Max I set afer a degauss") field(EGU, "Amps") field(PINI, "YES") field(PREC, "6") field(HOPR, "200.0") field(LOPR, "-200.0") field(DRVH, "200.0") field(DRVL, "-200.0") field(VAL, "200.0") field(FLNK, "QUAD:LTUS:640:DEGAUS_IMAXPOL_CHECK") info(autosaveFields,"VAL,RVAL") } # Set the polarity if degauss_imax record(calcout, "QUAD:LTUS:640:DEGAUS_IMAXPOL_CHECK") { field(DESC, "Determine polarity of imax") field(CALC, "A>=0?0:1") field(INPA, "QUAD:LTUS:640:DEGAUS_IMAX") field(FLNK, "QUAD:LTUS:640:DEGAUS_IMAXPOL") } record(bo, "QUAD:LTUS:640:DEGAUS_IMAXPOL") { field(DESC, "Polarity of imax I") field(DTYP, "Raw Soft Channel") field(DOL, "QUAD:LTUS:640:DEGAUS_IMAXPOL_CHECK") field(OMSL, "closed_loop") field(ZNAM, "Positive") field(ONAM, "Negative") field(FLNK, "QUAD:LTUS:640: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, "QUAD:LTUS:640:DEGAUS_ABSIMAX") { field(DESC, "Absolute Max. Degauss I") field(CALC, "ABS(A)") field(INPA, "QUAD:LTUS:640:DEGAUS_IMAX") field(PREC, "6") field(EGU, "Amps") field(HOPR, "200.0") field(LOPR, "-200.0") info(autosaveFields,"VAL RVAL") } # IACT Polarity record(calcout, "QUAD:LTUS:640:IACTPOL_CHECK") { field(DESC, "Determine IACT polarity") field(SCAN, "5 second") field(CALC, "ABS(A-B)>C?(A>=0?0:1):D") field(INPA, "QUAD:LTUS:640:IACT") field(INPB, "QUAD:LTUS:640:IACTPOL_CHECK.LA") field(INPC, "0.0001") field(INPD, "QUAD:LTUS:640:IACTPOL_CHECK.PVAL") field(OOPT, "On Change") field(FLNK, "QUAD:LTUS:640:IACTPOL") } record(bo, "QUAD:LTUS:640: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,"QUAD:LTUS:640: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, "QUAD:LTUS:640:DEGAUSENABLE CP") field(INPB, "QUAD:LTUS:640:DEGAUSOK") field(INPC, "QUAD:LTUS:640:STATE CP") field(INPD, "QUAD:LTUS:640:STATE.SEVR") field(OUT, "QUAD:LTUS:640:DEGAUS_STATE_SEQ.SELN PP") field(ASG, "Internal") } record(seq, "QUAD:LTUS:640:DEGAUS_STATE_SEQ") { field(DESC, "Degauss State Sequence") field(SELM, "Specified") field(SELL, "QUAD:LTUS:640:DEGAUS_STATE_CHECK") field(LNK1, "QUAD:LTUS:640:DEGAUS_STATE_DISABLE.PROC PP") field(LNK2, "QUAD:LTUS:640:DEGAUS_STATE_LOST.PROC PP") field(LNK3, "QUAD:LTUS:640:DEGAUS_STATE_GOOD.PROC PP") field(LNK4, "QUAD:LTUS:640: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, "QUAD:LTUS:640:DEGAUS_STATE_DISABLE") { field(DESC, "Degauss not used") field(LNK1, "QUAD:LTUS:640:DEGAUSOK.ZSV") field(LNK2, "QUAD:LTUS:640: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, "QUAD:LTUS:640:STATMSG.FRSV") field(LNK4, "QUAD:LTUS:640: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, "QUAD:LTUS:640:DEGAUS_STATE_LOST") { field(DESC, "Degauss lost and ps On") field(DOL1, "1") field(LNK1, "QUAD:LTUS:640:DEGAUSOK.ZSV") field(LNK2, "QUAD:LTUS:640: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, "QUAD:LTUS:640:STATMSG.FRSV") field(LNK4, "QUAD:LTUS:640: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, "QUAD:LTUS:640:DEGAUS_STATE_OFF") { field(DESC, "Degaused lost and ps Off") field(DOL1, "2") field(LNK1, "QUAD:LTUS:640: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, "QUAD:LTUS:640:STATMSG.FRSV") field(LNK3, "QUAD:LTUS:640: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, "QUAD:LTUS:640:DEGAUS_STATE_GOOD") { field(DESC, "Degauss good") field(DOL1, "1") field(LNK1, "QUAD:LTUS:640: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, "QUAD:LTUS:640:STATMSG.FRSV PP") field(LNK3, "QUAD:LTUS:640:STATMSG.FVSV PP") field(LNK4, "") field(ASG, "Internal") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(mbbo, "QUAD:LTUS:640:FUNC") { field(DESC, "QUAD:LTUS:640 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, "1") field(THVL, "9") field(FRVL, "10") field(FVVL, "0") field(SXVL, "2") field(SVVL, "8") field(EIVL, "11") field(NIVL, "12") field(TEVL, "13") field(ELVL, "5") field(TVVL, "6") field(TTVL, "7") field(FTVL, "4") field(FFVL, "3") field(OUT, "QUAD:LTUS:640:CTRL CA") } # :CTRL pv is processed at boot in the # sequence mgntCtrl.st Processed in sequence # record(mbbo, "QUAD:LTUS:640:CTRL") { field(DESC, "QUAD:LTUS:640 Control") field(PINI, "NO") field(ZRST, "Ready") field(ONST, "TRIM") field(TWST, "PERTURB") field(THST, "BCON_TO_BDES") field(FRST, "BACT_TO_BDES") field(FVST, "SAVE_BDES") field(SXST, "LOAD_BDES") field(SVST, "UNDO_BDES") field(EIST, "DAC_ZERO") field(NIST, "CALB") field(TEST, "STDZ") field(ELST, "RESET") field(TVST, "TURN_ON") field(TTST, "TURN_OFF") field(FTST, "") field(FFST, "") field(ZRVL, "0") field(ONVL, "2") field(TWVL, "6") field(THVL, "15") field(FRVL, "14") field(FVVL, "11") field(SXVL, "12") field(SVVL, "13") field(EIVL, "7") field(NIVL, "3") field(TEVL, "4") field(ELVL, "8") field(TVVL, "9") field(TTVL, "10") field(FTVL, "0") field(FFVL, "0") field(OUT, "QUAD:LTUS:640:SELECTEN.A PP") field(SDIS, "0") } # If a function has been selected set this unit to busy record(calcout, "QUAD:LTUS:640:SELECTEN") { field(DESC, "Control Select Enable") field(CALC, "A>0?1:A") field(FLNK, "QUAD:LTUS:640:BUSY") } # Set to FREE on IOC reboot record(bo, "QUAD:LTUS:640:BUSY") { field(DESC, "QUAD:LTUS:640 Ctrl Done") field(DOL, "QUAD:LTUS:640:SELECTEN") field(ZNAM, "FREE") field(ONAM, "BUSY") field(PINI, "YES") field(FLNK, "QUAD:LTUS:640:SELECT") } record(bo, "QUAD:LTUS:640:SELECT") { field(ZNAM, "NO") field(ONAM, "YES") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") } record(bo, "QUAD:LTUS:640: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, "QUAD:LTUS:640:CTRLSTATE") { field(DESC, "QUAD:LTUS:640 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("QUAD:LTUS:640:CTRL",20,20,0,0,"QUAD:LTUS:640:CTRL") #! Field("QUAD:LTUS:640:CTRL.OUT",16777215,1,"QUAD:LTUS:640:CTRL.OUT") #! Link("QUAD:LTUS:640:CTRL.OUT","QUAD:LTUS:640:SELECTEN.A") #! Field("QUAD:LTUS:640:CTRL.VAL",16777215,1,"QUAD:LTUS:640:CTRL.VAL") #! Record("QUAD:LTUS:640:SELECTEN",321,381,0,0,"QUAD:LTUS:640:SELECTEN") #! Field("QUAD:LTUS:640:SELECTEN.A",16777215,0,"QUAD:LTUS:640:SELECTEN.A") #! Field("QUAD:LTUS:640:SELECTEN.FLNK",16777215,1,"QUAD:LTUS:640:SELECTEN.FLNK") #! Link("QUAD:LTUS:640:SELECTEN.FLNK","QUAD:LTUS:640:BUSY") #! Field("QUAD:LTUS:640:SELECTEN.VAL",16777215,1,"QUAD:LTUS:640:SELECTEN.VAL") #! Record("QUAD:LTUS:640:BUSY",623,274,0,0,"QUAD:LTUS:640:BUSY") #! Field("QUAD:LTUS:640:BUSY.DOL",16777215,0,"QUAD:LTUS:640:BUSY.DOL") #! Link("QUAD:LTUS:640:BUSY.DOL","QUAD:LTUS:640:SELECTEN.VAL") #! Field("QUAD:LTUS:640:BUSY.FLNK",16777215,1,"QUAD:LTUS:640:BUSY.FLNK") #! Link("QUAD:LTUS:640:BUSY.FLNK","QUAD:LTUS:640:SELECT") #! Record("QUAD:LTUS:640:SELECT",669,508,0,1,"QUAD:LTUS:640:SELECT") #! Record("QUAD:LTUS:640:FUNC",940,120,0,0,"QUAD:LTUS:640:FUNC") #! Field("QUAD:LTUS:640:FUNC.OUT",16777215,0,"QUAD:LTUS:640:FUNC.OUT") #! Link("QUAD:LTUS:640:FUNC.OUT","QUAD:LTUS:640:CTRL.VAL") #! Record("QUAD:LTUS:640:ABORT",193,41,0,0,"QUAD:LTUS:640:ABORT") #! Record("QUAD:LTUS:640:CTRLSTATE",369,34,0,0,"QUAD:LTUS:640: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,"QUAD:LTUS:640:SELECT is used for Multi-device selection.\nIt is enabled when associated QUAD:LTUS:640:CTRL is \"0\" (DONE).\nIt is disabled when associated QUAD:LTUS:640: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,"QUAD:LTUS:640: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, "QUAD:LTUS:640:BCTRL_INIT") { field(DESC, "Process BCTRL on boot") field(PINI, "YES") field(CALC, "A=3?1:0") field(INPA, "QUAD:LTUS:640:BCTRL.SEVR") field(OUT, "QUAD:LTUS:640: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, "QUAD:LTUS:640:BACT") { field(DESC, "Actual B") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "QUAD:LTUS:640:BACT") field(INPB, "QUAD:LTUS:640:POLYCOEF") field(INPC, "QUAD:LTUS:640:POLYCOEF.A") field(INPD, "QUAD:LTUS:640:POLYCOEF.B") field(INPE, "QUAD:LTUS:640:IACT MS") field(INPF, "QUAD:LTUS:640:BDELTAS PP") field(INPG, "100") field(EGU, "kG") field(HOPR, "102.2163") field(LOPR, "-102.4455") field(HIHI, "102.2163") field(LOLO, "-102.4455") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "102.2163") field(LOW, "-102.4455") field(FLNK, "QUAD:LTUS:640: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, "QUAD:LTUS:640:BDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntPhyDeltas") field(EGU, "kG") field(HOPR, "1") field(PREC, "7") field(BRSV, "INVALID") field(INPA, "QUAD:LTUS:640:BDES") field(INPB, "QUAD:LTUS:640:TRIMBTOL") field(INPC, "QUAD:LTUS:640:TRIMBTOLR") field(INPD, "QUAD:LTUS:640:CHCKBTOL") field(INPE, "QUAD:LTUS:640:CHCKBTOLR") field(F, "2.0") field(INPG, "30") field(INPH, "QUAD:LTUS:640:BACT.VAL") # # MPS absolute and relative tolerances field(INPP, "QUAD:LTUS:640:MPSBTOL") field(INPQ, "QUAD:LTUS:640:MPSBTOLR") field(FLNK, "QUAD:LTUS:640:BCONLIMITS") info(autosaveFields,"F") } # This record is processed by BDELTAS record(aSub, "QUAD:LTUS:640:BCONLIMITS") { field(DESC, "Config B-field Limits") field(INAM, "mgntInit") field(SNAM, "mgntBCONLimits") field(INPA, "QUAD:LTUS:640:BDES") field(INPB, "QUAD:LTUS:640:BDELTAS.I") field(INPG, "QUAD:LTUS:640:DEBUG.RVAL") field(FTA, "DOUBLE") field(FTB, "DOUBLE") field(FTG, "ULONG") field(OUTA, "QUAD:LTUS:640:BCON.HIGH") field(OUTB, "QUAD:LTUS:640:BCON.LOW") field(OUTC, "QUAD:LTUS:640:BCON.HIHI") field(OUTD, "QUAD:LTUS:640:BCON.LOLO PP") field(FTVA, "DOUBLE") field(FTVB, "DOUBLE") field(FTVC, "DOUBLE") field(FTVD, "DOUBLE") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:640:IDELTAS") } # The following PV is processed by :BACT # which is processed by :BACT # record(fanout, "QUAD:LTUS:640:BACTFO") { field(DESC, "BACT processing") field(SELM, "All") field(LNK1, "QUAD:LTUS:640:BDIFF") field(LNK2, "QUAD:LTUS:640:BADIFF") field(LNK3, "QUAD:LTUS:640:BRATIO") field(LNK4, "QUAD:LTUS:640:MPSLIMITS") field(LNK5, "QUAD:LTUS:640:I2BSTATUS") field(LNK6, "QUAD:LTUS:640:IACTFO.PROC") } record(calc, "QUAD:LTUS:640:BDIFF") { field(DESC, "BDES-BACT") field(CALC, "A-B") field(INPA, "QUAD:LTUS:640:BDES") field(INPB, "QUAD:LTUS:640:BACT") field(EGU, "kG") field(PREC, "7") } record(calc, "QUAD:LTUS:640:BADIFF") { field(DESC, "Absolute BDES-BACT") field(INPA, "QUAD:LTUS:640:BDIFF") field(EGU, "kG") field(PREC, "7") field(CALC, "A<0?ABS(A):A") } record(calc, "QUAD:LTUS:640:BRATIO") { field(DESC, "BACT Error") field(CALC, "B?A/B:0") field(INPA, "QUAD:LTUS:640:BDIFF") field(INPB, "QUAD:LTUS:640:BDES.HOPR") field(EGU, "kG") field(PREC, "7") } record(mbbi, "QUAD:LTUS:640: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, "QUAD:LTUS:640:BACT.J") } # Note: for a string slave set the MONFL # macro to the following: # MONFL=:IMONCALC MS record(sub, "QUAD:LTUS:640:BMON") { field(DESC, "Second Transductor") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "QUAD:LTUS:640:BMON") field(INPB, "QUAD:LTUS:640:POLYCOEF") field(INPC, "QUAD:LTUS:640:POLYCOEF.A") field(INPD, "QUAD:LTUS:640:POLYCOEF.B") field(INPE, "QUAD:LTUS:640:IMON MS") field(INPF, "QUAD:LTUS:640:BDELTAS.VAL") field(INPG, "100") field(EGU, "kG") field(HOPR, "102.2163") field(LOPR, "-102.4455") field(HIHI, "102.2163") field(LOLO, "-102.4455") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "102.2163") field(LOW, "-102.4455") } # 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=PSC:LTUS:MG15:BDES CP record(ao, "QUAD:LTUS:640:BDES") { field(DESC, "Desired B-Field") field(PINI, "YES") field(DRVH, "102.2163") field(DRVL, "-102.4455") field(HOPR, "102.2163") field(LOPR, "-102.4455") field(PREC, "7") field(EGU, "kG") field(MDEL, "-1") field(OMSL, "supervisory") # field(DOL, "") field(OUT, "QUAD:LTUS:640:B2IDES PP") info(autosaveFields,"VAL") } record(sub, "QUAD:LTUS:640:B2IDES") { field(DESC, "Convert Desired B-Field to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:640:POLYCOEF") field(INPC, "QUAD:LTUS:640:POLYCOEF.A") field(INPD, "QUAD:LTUS:640:POLYCOEF.B") field(PREC, "7") field(EGU, "kG") field(HOPR, "102.2163") field(LOPR, "-102.4455") field(MDEL, "-1") field(INPE, "QUAD:LTUS:640:BDES.DRVH") field(INPF, "QUAD:LTUS:640:BDES.DRVL") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:640:IDES") } record(sub, "QUAD:LTUS:640:BNOM") { field(DESC, "Nominal Field") field(PINI, "YES") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:640:POLYCOEF") field(INPC, "QUAD:LTUS:640:POLYCOEF.A") field(INPD, "QUAD:LTUS:640:POLYCOEF.B") field(INPE, "QUAD:LTUS:640:BDES.DRVH") field(INPF, "QUAD:LTUS:640:BDES.DRVL") field(EGU, "kG") field(HOPR, "102.2163") field(LOPR, "-102.4455") field(PREC, "7") field(VAL, "0.0") field(FLNK, "QUAD:LTUS:640:INOM") } record(sub, "QUAD:LTUS:640:BACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:640:BDES.VAL") field(INPB, "QUAD:LTUS:640:BDES.DRVH") field(INPC, "QUAD:LTUS:640:BDES.DRVL") field(INPD, "QUAD:LTUS:640:BDELTAS.I") field(INPE, "QUAD:LTUS:640:BDELTAS.J") field(INPG, "QUAD:LTUS:640:STATE") field(INPH, "QUAD:LTUS:640:HSTA") field(EGU, "kG") field(HOPR, "102.2163") field(LOPR, "-102.4455") field(PREC, "7") field(BRSV, "INVALID") } record(sub, "QUAD:LTUS:640:BMONLIMITS") { field(DESC, "MON Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:640:BDES.VAL") field(INPB, "QUAD:LTUS:640:BDES.DRVH") field(INPC, "QUAD:LTUS:640:BDES.DRVL") field(INPD, "QUAD:LTUS:640:BDELTAS.K") field(INPE, "QUAD:LTUS:640:BDELTAS.L") field(INPG, "QUAD:LTUS:640:STATE") field(INPH, "QUAD:LTUS:640:HSTA") field(EGU, "kG") field(HOPR, "102.2163") field(LOPR, "-102.4455") field(PREC, "7") field(BRSV, "INVALID") } record(seq, "QUAD:LTUS:640:BLIMITS") { field(DESC, "ACT Limits") field(PREC, "7") field(DOL1, "QUAD:LTUS:640:BLIMITS") field(LNK1, "QUAD:LTUS:640:BACTLIMITS.F PP") field(DOL2, "QUAD:LTUS:640:BACTLIMITS.I") field(LNK2, "QUAD:LTUS:640:BACT.HIGH") field(DOL3, "QUAD:LTUS:640:BACTLIMITS.J") field(LNK3, "QUAD:LTUS:640:BACT.LOW") field(DOL4, "QUAD:LTUS:640:BACTLIMITS.K") field(LNK4, "QUAD:LTUS:640:BACT.HIHI") field(DOL5, "QUAD:LTUS:640:BACTLIMITS.L") field(LNK5, "QUAD:LTUS:640:BACT.LOLO") field(DOL6, "QUAD:LTUS:640:BLIMITS") field(LNK6, "QUAD:LTUS:640:BMONLIMITS.F PP") field(DOL7, "QUAD:LTUS:640:BMONLIMITS.I") field(LNK7, "QUAD:LTUS:640:BMON.HIGH") field(DOL8, "QUAD:LTUS:640:BMONLIMITS.J") field(LNK8, "QUAD:LTUS:640:BMON.LOW") field(DOL9, "QUAD:LTUS:640:BMONLIMITS.K") field(LNK9, "QUAD:LTUS:640:BMON.HIHI") field(DOLA, "QUAD:LTUS:640:BMONLIMITS.L") field(LNKA, "QUAD:LTUS:640:BMON.LOLO") field(FLNK, "QUAD:LTUS:640:ILIMITS") field(SCAN, "5 second") } record(ao, "QUAD:LTUS:640:BCTRL") { field(DESC, "B-Perturb") field(PREC, "7") field(EGU, "kG") field(DRVH, "102.2163") field(DRVL, "-102.4455") field(HOPR, "102.2163") field(LOPR, "-102.4455") # 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, "QUAD:LTUS:640: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, "QUAD:LTUS:640:BCTRLGO") { field(DESC, "Update DES and perturb") field(PREC, "7") # Disable BACT limits field(DOL1, "1") field(LNK1, "QUAD:LTUS:640:BLIMITS.VAL") # Update BDES with the BCTRL (slider) value field(DOL2, "QUAD:LTUS:640:BCTRL.VAL") field(LNK2, "QUAD:LTUS:640:BDES PP") field(DOL3, "1") field(LNK3, "QUAD:LTUS:640:IDIRECT.PROC PP") field(DOL4, "1") field(LNK4, "QUAD:LTUS:640:CHECKSTDZLOST.PROC PP") field(DOL5, "QUAD:LTUS:640:BCTRL.VAL") field(LNK5, "QUAD:LTUS:640:BCTRLSUB PP") # Re-enable BACT limits field(DOL6, "0") field(LNK6, "QUAD:LTUS:640:BLIMITS.VAL") } # Convert B-field to Current and output to ISETPT record(sub, "QUAD:LTUS:640:BCTRLSUB") { field(DESC, "Feedback") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:640:POLYCOEF") field(INPC, "QUAD:LTUS:640:POLYCOEF.A") field(INPD, "QUAD:LTUS:640:POLYCOEF.B") field(INPE, "QUAD:LTUS:640:BDES.DRVH") field(INPF, "QUAD:LTUS:640:BDES.DRVL") field(PREC, "7") field(EGU, "kG") field(HOPR, "102.2163") field(LOPR, "-102.4455") field(MDEL, "-1") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:640:ISETPT") } record(ao, "QUAD:LTUS:640:BDESPREVTRIM") { field(DESC, "trim bdes for undo") field(DTYP, "Soft Channel") field(DRVH, "102.2163") field(DRVL, "-102.4455") field(EGU, "kG") field(HOPR, "102.2163") field(LOPR, "-102.4455") field(PREC, "7") field(PINI, "YES") info(autosaveFields,"VAL") } record(stringin, "QUAD:LTUS:640:MADNAME") { field(DESC, "MAD deck nomenclature") field(PINI, "YES") field(VAL, "QEM2B") } record(ai, "QUAD:LTUS:640: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, "3405.214377") } record(ao, "QUAD:LTUS:640:BMAX") { field(DESC, "Max B-Field") field(DTYP, "Soft Channel") field(DRVH, "102.2163") field(DRVL, "-102.4455") field(EGU, "kG") field(HOPR, "102.2163") field(LOPR, "-102.4455") field(PREC, "7") field(PINI, "YES") field(VAL, "102.2163") field(FLNK, "QUAD:LTUS:640:BSTEP") } record(ao, "QUAD:LTUS:640:BMIN") { field(DESC, "Min B-Field") field(DTYP, "Soft Channel") field(DRVH, "102.2163") field(DRVL, "-102.4455") field(EGU, "kG") field(HOPR, "102.2163") field(LOPR, "-102.4455") field(PREC, "7") field(PINI, "YES") field(VAL, "-102.4455") field(FLNK, "QUAD:LTUS:640:BSTEP") } record(ao, "QUAD:LTUS:640:BDESSAVE") { field(DESC, "bdes for save/load") field(DTYP, "Soft Channel") field(DRVH, "102.2163") field(DRVL, "-102.4455") field(EGU, "kG") field(HOPR, "102.2163") field(LOPR, "-102.4455") field(PINI, "YES") field(PREC, "7") } # This record is processed by QUAD:LTUS:640: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, "QUAD:LTUS:640:BCON") { field(DESC, "Config B-Field ") field(DTYP, "Soft Channel") field(PREC, "7") field(EGU, "kG") field(HOPR, "102.2163") field(LOPR, "-102.4455") field(DRVH, "102.2163") field(DRVL, "-102.4455") # Set MINOR Alarm as the default, slaves will set NO_ALARM=0. field(HHSV, "MINOR") field(LLSV, "MINOR") field(HSV, "MINOR") field(LSV, "MINOR") # field(DOL , "") field(OMSL, "supervisory") field(OUT, "QUAD:LTUS:640:B2ICON PP") info(autosaveFields,"VAL") } record(sub, "QUAD:LTUS:640:B2ICON") { field(DESC, "Convert Desired ICon to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:640:POLYCOEF") field(INPC, "QUAD:LTUS:640:POLYCOEF.A") field(INPD, "QUAD:LTUS:640:POLYCOEF.B") field(PREC, "7") field(EGU, "kG") field(HOPR, "102.2163") field(LOPR, "-102.4455") field(MDEL, "-1") field(INPE, "QUAD:LTUS:640:BCON.DRVH") field(INPF, "QUAD:LTUS:640:BCON.DRVL") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:640: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, "QUAD:LTUS:640:BSTEP") { field(DESC, "B-Field step size") field(CALC, "(C==3)||(D==3)?0:ABS(A-B)*0.005") field(INPA, "QUAD:LTUS:640:BMAX") field(INPB, "QUAD:LTUS:640:BMIN") field(INPC, "QUAD:LTUS:640:BMIN.SEVR") field(INPD, "QUAD:LTUS:640:BMAX.SEVR") field(EGU, "kG") 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,"QUAD:LTUS:640:BCTRLDISABLECALC") { field(DESC, "Calc for disabling BCTRL") field(ASG, "Internal") field(CALC, "A?2:1") field(INPA, "QUAD:LTUS:640:ONLINE CP") field(OUT, "QUAD:LTUS:640:BCTRLDISABLEFOUT PP") } record(fanout, "QUAD:LTUS:640:BCTRLDISABLEFOUT") { field(DESC, "Disable BCTRL fanout") field(SELM, "Specified") field(SELL, "QUAD:LTUS:640:BCTRLDISABLECALC") field(LNK1, "QUAD:LTUS:640:BCTRLDISABLE") field(LNK2, "QUAD:LTUS:640:BCTRLENABLE") } record(stringout, "QUAD:LTUS:640:BCTRLDISABLE") { field(DESC, "Disable BCTRL") field(DTYP, "Soft Channel") field(OUT, "QUAD:LTUS:640:BCTRL.ASG") field(VAL, "NOWRITE") field(FLNK, "QUAD:LTUS:640:BCTRLDISV_UPDATE") } record(stringout, "QUAD:LTUS:640:BCTRLENABLE") { field(DESC, "Enable BCTRL") field(DTYP, "Soft Channel") field(OUT, "QUAD:LTUS:640:BCTRL.ASG") field(VAL, "") field(FLNK, "QUAD:LTUS:640:BCTRLDISV_UPDATE") } record(calcout, "QUAD:LTUS:640:BCTRLDISV_UPDATE") { field(DESC, "Calc for updating BCTRL.DISV") field(ASG, "Internal") field(CALC, "A") field(INPA, "QUAD:LTUS:640:ONLINE") field(OUT, "QUAD:LTUS:640: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,"QUAD:LTUS:640:BACT and MON\n are processed via links from \n QUAD:LTUS:640:IACT (device raw value readback 1)\n and\n QUAD:LTUS:640: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 QUAD:LTUS:640:POLYCOEF\nC = First polynomial coefficient (offset if linear)\nD = Second polynomial coefficient (slope if linear)\nE = QUAD:LTUS:640: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,"QUAD:LTUS:640:BDES\n is processed when set by CA users or \n QUAD:LTUS:640: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,"QUAD:LTUS:640: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 QUAD:LTUS:640: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 (QUAD:LTUS:640: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,"QUAD:LTUS:640:B*LIMITS and QUAD:LTUS:640:BLIMITS:\n Calculate alarm and warning limits based on \n deltas from QUAD:LTUS:640: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,"QUAD:LTUS:640: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,"QUAD:LTUS:640: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, "QUAD:LTUS:640: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, "QUAD:LTUS:640:MPSBTOL") { field(DESC, "Absolute mps tol") field(EGU, "kG") field(PREC, "2") field(CALC, "ABS(A)*0.02") field(INPA, "QUAD:LTUS:640:BMAX") field(PINI, "YES") } # # 21-Aug-2013: K. Luchini # Set channel access security so that users # cannot easily change values. record(ao, "QUAD:LTUS:640:MPSBMAX") { field(DESC, "MPS Max B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "102.2163") field(DRVL, "-102.4455") field(PINI, "YES") field(VAL, "102.2163") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:640:MPSBMIN") { field(DESC, "MPS Min B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "102.2163") field(DRVL, "-102.4455") field(PINI, "YES") field(VAL, "-102.4455") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:640:MPSBLLIM") { field(DESC, "MPS Low Limit B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "102.2163") field(DRVL, "-102.4455") field(PINI, "YES") field(VAL, "-102.4455") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:640:MPSBLLIM2") { field(DESC, "MPS Low Limit #2 B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "102.2163") field(DRVL, "-102.4455") field(PINI, "YES") field(VAL, "-102.4455") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } # Set the default to Std record(mbbo, "QUAD:LTUS:640: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, "QUAD:LTUS:640:MPSLIMITS.E PP") } record(aSub, "QUAD:LTUS:640: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, "QUAD:LTUS:640:MPS.RVAL") field(INPB, "QUAD:LTUS:640:BADIFF") field(INPC, "QUAD:LTUS:640:BDELTAS.N") field(INPD, "QUAD:LTUS:640:BACT") field(INPE, "QUAD:LTUS:640:MPSBITMASK.RVAL") field(INPF, "QUAD:LTUS:640:MPSBLLIM") field(INPG, "QUAD:LTUS:640:MPSBMIN") field(INPH, "QUAD:LTUS:640:MPSBMAX") field(INPI, "QUAD:LTUS:640: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, "QUAD:LTUS:640:INTOL.RVAL PP") field(OUTB, "QUAD:LTUS:640:INTOL_BMIN.RVAL PP") field(OUTC, "QUAD:LTUS:640:INTOL_BRANGE.RVAL PP") field(OUTD, "QUAD:LTUS:640: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, "QUAD:LTUS:640:INTOL") { field(DESC, "BACT within MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:640:MPSLIMITS.VALA") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "QUAD:LTUS:640:INTOL_BMIN") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:640:MPSLIMITS.VALB") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "QUAD:LTUS:640:INTOL_BMIN2") { field(DESC, "MPS tol #2") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:640:MPSLIMITS.VALD") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "QUAD:LTUS:640:INTOL_BRANGE") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:640: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, "QUAD:LTUS:640:CHCKITOL") { field(DESC, "Absolute Check I Tolerance") field(EGU, "A") field(FLNK, "QUAD:LTUS:640:TRIMITOL") field(CALC, "ABS(A*B)") field(INPA, "QUAD:LTUS:640:CHCKBTOL") field(INPB, "QUAD:LTUS:640:POLYCOEF.B") field(PREC, "9") } record(calc, "QUAD:LTUS:640:TRIMBTOL") { field(EGU, "kG") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(DESC, "Absolute Trim Tolerance") field(CALC, "ABS(A)/2") field(INPA, "QUAD:LTUS:640:CHCKBTOL") field(FLNK, "QUAD:LTUS:640:CHCKITOL") } record(calc, "QUAD:LTUS:640:CHCKBTOL") { field(DESC, "Check absolute tolerance") field(EGU, "A") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(FLNK, "QUAD:LTUS:640:TRIMBTOL") field(CALC, "MAX(ABS(A),ABS(C))*(B/1000000)") field(INPA, "QUAD:LTUS:640:BDES.HOPR") field(INPB, "QUAD:LTUS:640:STABILITY") field(INPC, "QUAD:LTUS:640:BDES.LOPR") } record(longout, "QUAD:LTUS:640: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, "QUAD:LTUS:640:CHCKBTOL") } record(calc, "QUAD:LTUS:640:TRIMITOL") { field(DESC, "Absolute Trim I Tolerance") field(EGU, "kG") field(CALC, "ABS(A*B)") field(INPA, "QUAD:LTUS:640:POLYCOEF.B") field(INPB, "QUAD:LTUS:640:TRIMBTOL") field(PREC, "9") } record(ai, "QUAD:LTUS:640:TRIMBTOLR") { field(DESC, "Relative trim tol") field(PREC, "4") field(EGU, "%") field(HOPR, "1.0") field(LOPR, "0.0") field(PINI, "YES") } record(ai, "QUAD:LTUS:640: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, "QUAD:LTUS:640:FBCKFCOM") { field(ZNAM, "CA") field(ONAM, "FCOM") field(DESC, "CA Mode") field(PINI, "YES") field(SDIS, "0") } record(bo, "QUAD:LTUS:640:PAU") { field(ZNAM, "NotConfigured") field(ONAM, "Configured") field(DESC, "PAU Present") field(PINI, "YES") field(SDIS, "0") field(FLNK, "QUAD:LTUS:640:PAUGO") } record(fanout, "QUAD:LTUS:640:PAUGO") { field(DESC, "PAU control") field(LNK1, "QUAD:LTUS:640:PAUSTOP") field(LNK2, "QUAD:LTUS:640: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, "QUAD:LTUS:640:PAUSTART") { field(DESC, "Setup for PAU On") field(SDIS, "QUAD:LTUS:640: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, "QUAD:LTUS:640:PAUSTOP") { field(DESC, "Setup for PAU Off") field(SDIS, "QUAD:LTUS:640: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, "QUAD:LTUS:640:MCORDEVNAME") { field(DESC, "PS device name") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, "PSC:LTUS:MG15:") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "QUAD:LTUS:640: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, "QUAD:LTUS:640:PSTYPE.RVAL") field(INPC, "QUAD:LTUS:640:TURNEDOFF.RVAL") field(INPD, "QUAD:LTUS:640:CONFIG.RVAL") field(INPE, "QUAD:LTUS:640:PSCATEGORY.RVAL") field(INPF, "QUAD:LTUS:640:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "QUAD:LTUS:640:AUTOCTRL.RVAL") field(INPJ, "QUAD:LTUS:640:OUTOFSERVICE.RVAL") field(INPL, "QUAD:LTUS:640:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "QUAD:LTUS:640:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "QUAD:LTUS:640:PAU") field(INPP, "QUAD:LTUS:640:CALBDISABLE.RVAL") field(INPQ, "QUAD:LTUS:640:PTRBDISABLE.RVAL") field(INPR, "QUAD:LTUS:640:TRIMDISABLE.RVAL") field(INPS, "QUAD:LTUS:640:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "QUAD:LTUS:640:FBCK") field(INPU, "QUAD:LTUS:640:TRIMTYPE.RVAL") field(INPV, "QUAD:LTUS:640:STDZDIRECT.RVAL") field(INPW, "QUAD:LTUS:640:DEGAUSENABLE.RVAL") field(FLNK, "QUAD:LTUS:640:HSTA") } record(longin, "QUAD:LTUS:640:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "QUAD:LTUS:640:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "QUAD:LTUS:640: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, "QUAD:LTUS:640: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, "QUAD:LTUS:640:CALBDISABLE") { field(DESC, "DAC Calb Disabled") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:640:PTRBDISABLE") { field(DESC, "Perturb Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:640:TRIMDISABLE") { field(DESC, "Trim Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:640: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 QUAD:LTUS:640:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses QUAD:LTUS:640:FBCK. # This PV should be replaced by QUAD:LTUS:640: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, "QUAD:LTUS:640: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, "QUAD:LTUS:640: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, "QUAD:LTUS:640: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, "") field(OMSL, "supervisory") field(FLNK, "QUAD:LTUS:640:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"QUAD:LTUS:640:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "QUAD:LTUS:640:OUTOFSERVICE NPP NMS") field(OUT, "QUAD:LTUS:640:ONLINE PP") } record(bo, "QUAD:LTUS:640:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "QUAD:LTUS:640: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, "1") } record(bo, "QUAD:LTUS:640: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, "1") } record(bo, "QUAD:LTUS:640: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, "QUAD:LTUS:640: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, "QUAD:LTUS:640: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, "QUAD:LTUS:640: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, "QUAD:LTUS:640: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, "QUAD:LTUS:640: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, "1") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:640: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, "1") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:640: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, "2") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:640: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, "0") field(ASG, "NOWRITE") field(FLNK, "QUAD:LTUS:640:TRIMTYPE") } record(stringout, "QUAD:LTUS:640:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "QUAD:LTUS:640:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "QUAD:LTUS:640:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "QUAD:LTUS:640:STATE.RVAL") field(INPB, "QUAD:LTUS:640:INTLKSUMY.RVAL") field(OUT, "QUAD:LTUS:640:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:LTUS:640: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, "QUAD:LTUS:640:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "QUAD:LTUS:640:STATE.RVAL") field(INPB, "QUAD:LTUS:640:INTLKSUMY.RVAL") field(OUT, "QUAD:LTUS:640:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:LTUS:640:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "QUAD:LTUS:640:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "QUAD:LTUS:640: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, "QUAD:LTUS:640:RAMPSTARTDLY") { field(DESC, "Tansition to ramp delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "2") } ######### For PSTYPE=2 Only ############# record(mbbo, "QUAD:LTUS:640: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, "QUAD:LTUS:640: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,"QUAD:LTUS:640: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("QUAD:LTUS:640:TURNEDOFF",3140,1907,0,1,"QUAD:LTUS:640:TURNEDOFF") #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "QUAD:LTUS:640:STATSUB") { field(DESC, "Build STATus ") field(INAM, "mgntInit") field(SNAM, "mgntSlcStat") field(INPA, "QUAD:LTUS:640:BACT.STAT") field(INPB, "QUAD:LTUS:640:BDES.STAT") field(INPC, "QUAD:LTUS:640:IRIPL.STAT") field(INPD, "PSC:LTUS:MG15:ISETPT.STAT") field(INPE, "PSC:LTUS:MG15:IACT.STAT") # 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, "QUAD:LTUS:640:BACT.SEVR") field(INPH, "QUAD:LTUS:640:BDES.SEVR") field(INPI, "QUAD:LTUS:640:IRIPL.SEVR") field(INPJ, "PSC:LTUS:MG15:ISETPT.SEVR") field(INPK, "PSC:LTUS:MG15:IACT.SEVR") # # 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, "QUAD:LTUS:640:STATE.RVAL") field(INPN, "QUAD:LTUS:640:STDZOK") field(INPO, "QUAD:LTUS:640:CALBOK") field(INPP, "QUAD:LTUS:640:OUTOFSERVICE.RVAL") field(INPQ, "QUAD:LTUS:640:CONFIG.RVAL") field(INPR, "QUAD:LTUS:640:HSTA") field(INPS, "QUAD:LTUS:640:CTRL.RVAL") field(INPT, "QUAD:LTUS:640:DEGAUSOK") field(INPV, "QUAD:LTUS:640: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, "QUAD:LTUS:640:STAT") } record(longout, "QUAD:LTUS:640:STAT") { field(DESC, "STAT sent to SLC") field(SCAN, "Passive") field(FLNK, "QUAD:LTUS:640:STATCTRLSUB") field(DOL, "QUAD:LTUS:640:STATSUB.VAL") field(OMSL, "closed_loop") } record(sSub, "QUAD:LTUS:640:STATCTRLSUB") { field(DESC, "Decode SLC STAT into mbbo") field(INAM, "mgntInit") field(SNAM, "mgntStatDecode") field(INPA, "QUAD:LTUS:640:STAT") field(INPB, "QUAD:LTUS:640:HSTA") field(INPD, "QUAD:LTUS:640:ONOFFCTRL.RVAL") field(FLNK, "QUAD:LTUS:640:STATMSG") } record(mbbo, "QUAD:LTUS:640: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, "QUAD:LTUS:640:UNAVAILGO") field(DOL, "QUAD:LTUS:640:STATCTRLSUB.W") } record(seq, "QUAD:LTUS:640:UNAVAILGO") { field(DESC, "Process UNAVAIL") field(DOL1, "QUAD:LTUS:640:STATSUB.U") field(LNK1, "QUAD:LTUS:640:UNAVAIL PP") } record(stringout, "QUAD:LTUS:640:SNLSTATMSG") { field(DTYP, "Soft Channel") } #! TextBox(TB0,820,1000,1200,1220,0,"Dialog",12,1,16777215,"QUAD:LTUS:640:STATUSSUB - future\nOverall device status - takes input from action snls, record sevrs, master snl(s) and outputs final status\n\nInputs:\nA - QUAD:LTUS:640:CTRLSTATUS - snl status\nB - MGNT:CTRLSTATUS - master list status\nC\nD - QUAD:LTUS:640: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,"QUAD:LTUS:640STATSUB\nformat control bo's into slc STAT\n\nInputs:\nA - QUAD:LTUS:640:STATUS\nC - QUAD:LTUS:640:ON\nD - QUAD:LTUS:640:STDZOK\nE - QUAD:LTUS:640:CALBOK\nF - QUAD:LTUS:640:BACTDRIFT (future)\nG -\nH- QUAD:LTUS:640:DACSTATUS\nI -QUAD:LTUS:640:ADCSTATUS\nJ - QUAD:LTUS:640:BACTSTATUS\nK - QUAD:LTUS:640:BDESSTATUS\nL - QUAD:LTUS:640:RIPLSTATUS\n\nOutput:\nP - QUAD:LTUS:640: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, "QUAD:LTUS:640: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, "QUAD:LTUS:640: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, "QUAD:LTUS:640: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, "QUAD:LTUS:640: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.6 #! DBDSTART #! DBD("../../../../dbd/mgntSoft.dbd") #! DBDEND record(stringout, "QUAD:LTUS:640:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:640:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "QUAD:LTUS:640:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "QUAD:LTUS:640:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "QUAD:LTUS:640:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "QUAD:LTUS:640:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "1") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "QUAD:LTUS:640: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, "QUAD:LTUS:640:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "QUAD:LTUS:640:TRIMTYPE.RVAL") field(INPB, "QUAD:LTUS:640:CONFIG.RVAL") field(OUT, "QUAD:LTUS:640:TRIMMAXNUM PP") } record(longout, "QUAD:LTUS:640: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, "QUAD:LTUS:640: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, "") field(OMSL, "supervisory") field(VAL, "20") field(OUT, "QUAD:LTUS:640:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "QUAD:LTUS:640: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, "") field(OMSL, "supervisory") field(VAL, "10") } record(bo, "QUAD:LTUS:640: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, "QUAD:LTUS:640: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, "QUAD:LTUS:640: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, "QUAD:LTUS:640:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "0") } record(ao, "QUAD:LTUS:640: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, "QUAD:LTUS:640:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "QUAD:LTUS:640: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, "QUAD:LTUS:640: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, "QUAD:LTUS:640:IMOVE") field(INPB, "QUAD:LTUS:640:IACT") field(INPC, "QUAD:LTUS:640:IRAMPRATE") field(INPD, "1.577") field(INPE, "QUAD:LTUS:640:TRIMDLYPCT") field(INPF, "QUAD:LTUS:640:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "QUAD:LTUS:640:RAMPTIME_LEFT PP") } record(longout, "QUAD:LTUS:640:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "QUAD:LTUS:640:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "QUAD:LTUS:640:RAMPDONE_CALC") } record(calc, "QUAD:LTUS:640:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "QUAD:LTUS:640:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "QUAD:LTUS:640:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "QUAD:LTUS:640: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, "QUAD:LTUS:640:RAMPTIME_LEFT") field(OUT, "QUAD:LTUS:640:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "QUAD:LTUS:640:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "QUAD:LTUS:640:RAMPTIME_LEFT NMS") field(OUT, "QUAD:LTUS:640:RAMPDONE PP") } record(bo, "QUAD:LTUS:640:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "QUAD:LTUS:640:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "QUAD:LTUS:640: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, "QUAD:LTUS:640: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(sSub, "QUAD:LTUS:640: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, "QUAD:LTUS:640:PSTYPE.RVAL") field(INPC, "QUAD:LTUS:640:TURNEDOFF.RVAL") field(INPD, "QUAD:LTUS:640:CONFIG.RVAL") field(INPE, "QUAD:LTUS:640:PSCATEGORY.RVAL") field(INPF, "QUAD:LTUS:640:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "QUAD:LTUS:640:AUTOCTRL.RVAL") field(INPJ, "QUAD:LTUS:640:OUTOFSERVICE.RVAL") field(INPL, "QUAD:LTUS:640:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "QUAD:LTUS:640:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "QUAD:LTUS:640:PAU") field(INPP, "QUAD:LTUS:640:CALBDISABLE.RVAL") field(INPQ, "QUAD:LTUS:640:PTRBDISABLE.RVAL") field(INPR, "QUAD:LTUS:640:TRIMDISABLE.RVAL") field(INPS, "QUAD:LTUS:640:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "QUAD:LTUS:640:FBCK") field(INPU, "QUAD:LTUS:640:TRIMTYPE.RVAL") field(INPV, "QUAD:LTUS:640:STDZDIRECT.RVAL") field(INPW, "QUAD:LTUS:640:DEGAUSENABLE.RVAL") field(FLNK, "QUAD:LTUS:640:HSTA") } record(longin, "QUAD:LTUS:640:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "QUAD:LTUS:640:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "QUAD:LTUS:640: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, "QUAD:LTUS:640: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, "QUAD:LTUS:640:CALBDISABLE") { field(DESC, "DAC Calb Disabled") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:640:PTRBDISABLE") { field(DESC, "Perturb Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:640:TRIMDISABLE") { field(DESC, "Trim Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:640:STDZDISABLE") { field(DTYP, "Raw Soft Channel") field(ZNAM, "NO") field(ONAM, "YES") field(DESC, "Standardize Function") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } # This PV has been replaced by QUAD:LTUS:640:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses QUAD:LTUS:640:FBCK. # This PV should be replaced by QUAD:LTUS:640: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, "QUAD:LTUS:640: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, "QUAD:LTUS:640: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, "QUAD:LTUS:640: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, "") field(OMSL, "supervisory") field(FLNK, "QUAD:LTUS:640:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"QUAD:LTUS:640:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "QUAD:LTUS:640:OUTOFSERVICE NPP NMS") field(OUT, "QUAD:LTUS:640:ONLINE PP") } record(bo, "QUAD:LTUS:640:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "QUAD:LTUS:640: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, "1") } record(bo, "QUAD:LTUS:640: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, "1") } record(bo, "QUAD:LTUS:640: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, "QUAD:LTUS:640: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, "QUAD:LTUS:640: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, "QUAD:LTUS:640: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, "QUAD:LTUS:640: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, "QUAD:LTUS:640: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, "1") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:640: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, "1") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:640: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, "2") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:640: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, "0") field(ASG, "NOWRITE") field(FLNK, "QUAD:LTUS:640:TRIMTYPE") } record(stringout, "QUAD:LTUS:640:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "QUAD:LTUS:640:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "QUAD:LTUS:640:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "QUAD:LTUS:640:STATE.RVAL") field(INPB, "QUAD:LTUS:640:INTLKSUMY.RVAL") field(OUT, "QUAD:LTUS:640:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:LTUS:640: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, "QUAD:LTUS:640:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "QUAD:LTUS:640:STATE.RVAL") field(INPB, "QUAD:LTUS:640:INTLKSUMY.RVAL") field(OUT, "QUAD:LTUS:640:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:LTUS:640:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "QUAD:LTUS:640:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "QUAD:LTUS:640: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, "QUAD:LTUS:640:RAMPSTARTDLY") { field(DESC, "Tansition to ramp delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "2") } ######### For PSTYPE=2 Only ############# record(mbbo, "QUAD:LTUS:640: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, "QUAD:LTUS:640: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,"QUAD:LTUS:640: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("QUAD:LTUS:640:TURNEDOFF",3140,1907,0,1,"QUAD:LTUS:640:TURNEDOFF") #! 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, "QUAD:LTUS:660:IACT") { field(DESC, "Current") field(INP, "PSC:LTUS:MG16:IACT") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "QUAD:LTUS:660:BACT") info(autosaveFields,"HYST") } record(bi, "QUAD:LTUS:660:STATE") { field(DESC, "PS On/Off Status") field(DTYP, "Raw Soft Channel") field(INP, "PSC:LTUS:MG16:STATE NPP MS") field(ZSV, "MAJOR") field(ZNAM, "OFF") field(ONAM, "ON") } record(ao, "QUAD:LTUS:660:IDES") { field(DESC, "Desired Current") field(PREC, "3") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(MDEL, "-1") field(HIHI, "120.0") field(LOLO, "-120.0") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "QUAD:LTUS:660:BDELTAS") field(DRVH, "120.0") field(DRVL, "-120.0") field(DOL, "QUAD:LTUS:660: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, "QUAD:LTUS:660:ICTRL PP") } # This record is processed by QUAD:LTUS:660:ICON") # Note: we are not setting alarms here. record(ao, "QUAD:LTUS:660:ICON") { field(DESC, "Config I") field(DTYP, "Soft Channel") field(PREC, "3") field(HOPR, "120.0") field(LOPR, "-120.0") field(DRVH, "120.0") field(DRVL, "-120.0") field(DOL, "QUAD:LTUS:660:B2ICON.K") field(OMSL, "closed_loop") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:660:INOM") { field(DESC, "Nominal Current") field(DOL, "QUAD:LTUS:660:BNOM.K") field(OMSL, "closed_loop") field(PREC, "3") field(EGU, "A") field(DRVH, "120.0") field(DRVL, "-120.0") field(HOPR, "120.0") field(LOPR, "-120.0") } record(ao, "QUAD:LTUS:660:ICTRL") { field(DESC, "Set Current") field(PREC, "3") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(DRVH, "120.0") field(DRVL, "-120.0") field(MDEL, "-1") field(FLNK, "QUAD:LTUS:660:ICTRLGO") field(OMSL, "supervisory") info(autosavefields,"VAL") } record(seq, "QUAD:LTUS:660:ICTRLGO") { field(DESC, "Process Current Setpoint") field(PREC, "3") # Set ISETPT to supervisory field(DOL1, "0") field(LNK1, "QUAD:LTUS:660:ISETPT.OMSL") field(DOL2, "QUAD:LTUS:660:ICTRL") field(LNK2, "QUAD:LTUS:660:ISETPT PP") # Set ISETPT to closed loop - get data from BCTRLSUB.K field(DOL3, "1") field(LNK3, "QUAD:LTUS:660:ISETPT.OMSL") } record(ao, "QUAD:LTUS:660:IMAX") { field(DESC, "Max I") field(DTYP, "Soft Channel") field(DRVH, "120.0") field(DRVL, "-120.0") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(PREC, "3") field(PINI, "YES") field(VAL, "120.0") field(FLNK, "QUAD:LTUS:660:IMIN") } record(ao, "QUAD:LTUS:660:IMIN") { field(DESC, "Min I") field(DTYP, "Soft Channel") field(DRVH, "120.0") field(DRVL, "-120.0") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(PREC, "3") field(VAL, "-120.0") field(FLNK, "QUAD:LTUS:660:IRANGE") } record(sel, "QUAD:LTUS:660:IACTPREVOK") { field(DESC, "Last Good Current") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(PREC, "3") field(NVL, "QUAD:LTUS:660:BACT.SEVR") field(INPA, "QUAD:LTUS:660:IACT NPP MS") field(INPB, "QUAD:LTUS:660:IACTPREVOK NPP MS") field(INPC, "QUAD:LTUS:660:IACTPREVOK NPP MS") field(INPD, "QUAD:LTUS:660:IACTPREVOK NPP MS") } record(sub, "QUAD:LTUS:660:IACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:660:IDES") field(INPB, "QUAD:LTUS:660:ISETPT.DRVH") field(INPC, "QUAD:LTUS:660:ISETPT.DRVL") field(INPD, "QUAD:LTUS:660:IDELTAS.I") field(INPE, "QUAD:LTUS:660:IDELTAS.J") field(INPG, "QUAD:LTUS:660:STATE") field(INPH, "QUAD:LTUS:660:HSTA") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(PREC, "3") field(BRSV, "INVALID") } record(sub, "QUAD:LTUS:660:IMONLIMITS") { field(DESC, "Aux Current Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:660:IDES") field(INPB, "QUAD:LTUS:660:ISETPT.DRVH") field(INPC, "QUAD:LTUS:660:ISETPT.DRVL") field(INPD, "QUAD:LTUS:660:IDELTAS.K") field(INPE, "QUAD:LTUS:660:IDELTAS.L") field(INPG, "QUAD:LTUS:660:STATE") field(INPH, "QUAD:LTUS:660:HSTA") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(PREC, "3") field(BRSV, "INVALID") } record(seq, "QUAD:LTUS:660:ILIMITS") { field(DESC, "Set ACT and MON Limits") field(PREC, "3") field(DOL1, "QUAD:LTUS:660:BLIMITS") field(LNK1, "QUAD:LTUS:660:IACTLIMITS.F PP") field(DOL2, "QUAD:LTUS:660:IACTLIMITS.I") field(LNK2, "QUAD:LTUS:660:IACT.HIGH") field(DOL3, "QUAD:LTUS:660:IACTLIMITS.J") field(LNK3, "QUAD:LTUS:660:IACT.LOW") field(DOL4, "QUAD:LTUS:660:IACTLIMITS.K") field(LNK4, "QUAD:LTUS:660:IACT.HIHI") field(DOL5, "QUAD:LTUS:660:IACTLIMITS.L") field(LNK5, "QUAD:LTUS:660:IACT.LOLO") field(DOL6, "QUAD:LTUS:660:BLIMITS") field(LNK6, "QUAD:LTUS:660:IMONLIMITS.F PP") field(DOL7, "QUAD:LTUS:660:IMONLIMITS.I") field(LNK7, "QUAD:LTUS:660:IMON.HIGH") field(DOL8, "QUAD:LTUS:660:IMONLIMITS.J") field(LNK8, "QUAD:LTUS:660:IMON.LOW") field(DOL9, "QUAD:LTUS:660:IMONLIMITS.K") field(LNK9, "QUAD:LTUS:660:IMON.HIHI") field(DOLA, "QUAD:LTUS:660:IMONLIMITS.L") field(LNKA, "QUAD:LTUS:660: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, "QUAD:LTUS:660:IDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntRawDeltas") field(INPD, "QUAD:LTUS:660:TRIMBTOL") field(INPE, "QUAD:LTUS:660:CHCKBTOL") field(INPF, "QUAD:LTUS:660:BDELTAS.K") field(INPG, "QUAD:LTUS:660:BDELTAS.L") field(INPH, "QUAD:LTUS:660: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, "QUAD:LTUS:660:STDZITOLR") field(INPC, "QUAD:LTUS:660:STDZITOL") field(FLNK, "") } # All ps controllers with on/off control will set the macro ONOF # as follows: # # ONOF = PSC:LTUS:MG16: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, "QUAD:LTUS:660:STATESETPT") { field(DESC, "PS On/Off") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFF") field(ONAM, "ON") field(OUT, "PSC:LTUS:MG16:STATESETPT PP") 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 = PSC:LTUS:MG16:RESET PP # record(bo, "QUAD:LTUS:660:RESET") { field(DESC, "Interlock Latch Reset") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFF") field(ONAM, "ON") field(HIGH, "1.0") field(OUT, "PSC:LTUS:MG16:RESET PP") } record(bo, "QUAD:LTUS:660:RAMPSTATE") { field(DESC, "PS Ramp Status") field(DTYP, "Soft Channel") field(DOL, "PSC:LTUS:MG16:RAMPSTATE NPP 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, "QUAD:LTUS:660: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, "QUAD:LTUS:660:TRIMRAMPRATE") field(OUT, "PSC:LTUS:MG16:IRAMPRATE PP") field(FLNK, "QUAD:LTUS:660:STDZDLY") } record(ao, "QUAD:LTUS:660:ISETPT") { field(DESC, "Current Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(DRVH, "120.0") field(DRVL, "-120.0") field(MDEL, "-1") field(OUT, "PSC:LTUS:MG16:ISETPT PP") field(DOL, "QUAD:LTUS:660: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, "QUAD:LTUS:660:IMON") { field(DESC, "Aux Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(INP, "PSC:LTUS:MG16:IMON") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "QUAD:LTUS:660:BMON") } record(ao, "QUAD:LTUS:660:IRIPL") { field(DESC, "Ripple Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(DOL, "PSC:LTUS:MG16:IRIPL NPP NMS") field(OMSL, "closed_loop") field(EGU, "A") field(DRVH, "1.0") field(HOPR, "1.0") field(PREC, "3") field(FLNK, "QUAD:LTUS:660:IRIPLOK") } record(sub, "QUAD:LTUS:660:IRIPLOK") { field(DESC, "Ripple Current Status") field(INAM, "mgntInit") field(SNAM, "mgntRiplOK") field(INPA, "QUAD:LTUS:660:IRIPL.VAL") field(INPB, "QUAD:LTUS:660: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, "QUAD:LTUS:660:R") { field(DESC, "Resistance") field(EGU, "Ohms") field(PREC, "4") field(PINI, "YES") field(DOL, "PSC:LTUS:MG16:R NPP MS") 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, "QUAD:LTUS:660:IGND") { field(DESC, "Ground Current") field(EGU, "A") field(PREC, "6") field(PINI, "YES") field(DOL, "PSC:LTUS:MG16:IGND NPP MS") field(OMSL, "closed_loop") } record(bi, "QUAD:LTUS:660:INTLKSUMY") { field(DESC, "Interlock Summary") field(INP, "PSC:LTUS:MG16:INTLKSUMY NPP MS") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(ZNAM, "OK") field(ONAM, "FAULT") field(PINI, "NO") } record(mbbo, "QUAD:LTUS:660: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, "PSC:LTUS:MG16:COOLING") field(OMSL, "closed_loop") } # The following PV is processed by :BACTFO # which is processed by :BACT record(fanout, "QUAD:LTUS:660:IACTFO") { field(DESC, "IACT processing") field(SELM, "All") field(LNK1, "QUAD:LTUS:660:IACTPREVOK") field(LNK2, "QUAD:LTUS:660:IDIFF") field(LNK3, "QUAD:LTUS:660:IADIFF") field(LNK4, "QUAD:LTUS:660:IRATIO") field(LNK5, "QUAD:LTUS:660:IDIRECT") field(LNK6, "QUAD:LTUS:660:IACTPOL_CHECK") } record(calc, "QUAD:LTUS:660:IDIFF") { field(DESC, "IDES-IACT") field(CALC, "A-B") field(INPA, "QUAD:LTUS:660:IDES") field(INPB, "QUAD:LTUS:660:IACT") field(EGU, "A") field(PREC, "9") field(HOPR, "120.0") field(LOPR, "-120.0") } record(calc, "QUAD:LTUS:660:IADIFF") { field(DESC, "Absolute IDES-IACT") field(CALC, "A<0?ABS(A):A") field(INPA, "QUAD:LTUS:660:IDIFF") field(PREC, "9") } record(calc, "QUAD:LTUS:660:IRATIO") { field(DESC, "IDES-IACT/IMAX") field(CALC, "B?A/B:0") field(INPA, "QUAD:LTUS:660:IDIFF") field(INPB, "QUAD:LTUS:660:IDES.DRVH") field(PREC, "9") } record(calcout, "QUAD:LTUS:660:IRANGE") { field(DESC, "Current Range") field(PINI, "YES") field(CALC, "ABS(A-B)") field(INPA, "QUAD:LTUS:660:IMIN") field(INPB, "QUAD:LTUS:660: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, "QUAD:LTUS:660: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, "QUAD:LTUS:660:IACT") field(FLNK, "QUAD:LTUS:660:IACTPOL") } record(bo, "QUAD:LTUS:660:IACTPOL") { field(DESC, "Actual I Polarity") field(DTYP, "Raw Soft Channel") field(DOL, "QUAD:LTUS:660: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,"QUAD:LTUS:660:I*LIMITS:\n Calculate alarm and warning limits based on \n deltas from QUAD:LTUS:660:IDELTAS and the\n QUAD:LTUS:660: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,"QUAD:LTUS:660:IACT: \n Get copy of QUAD:LTUS:660:I. \n",null) #! TextBox(TB12,1280,3100,1760,3200,0,"Dialog",12,1,16777215,"QUAD:LTUS:660: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,"QUAD:LTUS:660:IDES:\n Contains raw value calculated by \nQUAD:LTUS:660: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 \nQUAD:LTUS:660:BDELTAS.\n",null) #! TextBox(TB10,56,1940,316,2340,0,"Dialog",12,1,16777215,"QUAD:LTUS:660: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 QUAD:LTUS:660: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 QUAD:LTUS:660: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,"QUAD:LTUS:660:ISETPT:\n Sets the hardware. When fast feedback is set on, this record is\n set to closed loop mode by QUAD:LTUS:660:FBCKSTART sequence. When \n the loop is closed, this record takes input calculated by \n BFBCK only. When fast feedback is set off, QUAD:LTUS:660:FBCKSTOP \n will set it back to supervisory so that the value can be set by \n QUAD:LTUS:660: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, "QUAD:LTUS:660:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:660:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "QUAD:LTUS:660:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "QUAD:LTUS:660:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "QUAD:LTUS:660:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "QUAD:LTUS:660:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "1") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "QUAD:LTUS:660: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, "QUAD:LTUS:660:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "QUAD:LTUS:660:TRIMTYPE.RVAL") field(INPB, "QUAD:LTUS:660:CONFIG.RVAL") field(OUT, "QUAD:LTUS:660:TRIMMAXNUM PP") } record(longout, "QUAD:LTUS:660: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, "QUAD:LTUS:660: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, "") field(OMSL, "supervisory") field(VAL, "10") field(OUT, "QUAD:LTUS:660:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "QUAD:LTUS:660: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, "") field(OMSL, "supervisory") field(VAL, "10") } record(bo, "QUAD:LTUS:660: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, "QUAD:LTUS:660: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, "QUAD:LTUS:660: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, "QUAD:LTUS:660:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "0") } record(ao, "QUAD:LTUS:660: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, "QUAD:LTUS:660:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "QUAD:LTUS:660: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, "QUAD:LTUS:660: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, "QUAD:LTUS:660:IMOVE") field(INPB, "QUAD:LTUS:660:IACT") field(INPC, "QUAD:LTUS:660:IRAMPRATE") field(INPD, "1.577") field(INPE, "QUAD:LTUS:660:TRIMDLYPCT") field(INPF, "QUAD:LTUS:660:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "QUAD:LTUS:660:RAMPTIME_LEFT PP") } record(longout, "QUAD:LTUS:660:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "QUAD:LTUS:660:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "QUAD:LTUS:660:RAMPDONE_CALC") } record(calc, "QUAD:LTUS:660:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "QUAD:LTUS:660:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "QUAD:LTUS:660:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "QUAD:LTUS:660: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, "QUAD:LTUS:660:RAMPTIME_LEFT") field(OUT, "QUAD:LTUS:660:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "QUAD:LTUS:660:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "QUAD:LTUS:660:RAMPTIME_LEFT NMS") field(OUT, "QUAD:LTUS:660:RAMPDONE PP") } record(bo, "QUAD:LTUS:660:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "QUAD:LTUS:660:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "QUAD:LTUS:660: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, "QUAD:LTUS:660: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, "QUAD:LTUS:660:STDZINIT") { field(DESC, "Proc. Stdz PVs on boot") field(PINI, "YES") field(DOL1, "1") field(DOL2, "1") field(DOL3, "1") field(LNK1, "QUAD:LTUS:660:DEBUG.PROC PP") field(LNK2, "QUAD:LTUS:660:STDZCYCLENUM.PROC PP") field(LNK3, "QUAD:LTUS:660:STDZDISABLE.PROC PP") field(LNK4, "QUAD:LTUS:660: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, "QUAD:LTUS:660:STDZSUB") { field(DESC, "Stdz subroutine") field(INAM, "mgntStdzInit") field(SNAM, "mgntStdz") field(BRSV, "INVALID") field(INPA, "QUAD:LTUS:660:STDZIMIN NPP NMS") field(INPB, "QUAD:LTUS:660:STDZIMAX NPP NMS") field(INPC, "QUAD:LTUS:660:STDZIFINAL NPP NMS") field(INPD, "QUAD:LTUS:660:STDZCYCLENUM NPP NMS") field(INPE, "QUAD:LTUS:660:STDZDIRECT.RVAL NPP NMS") field(INPF, "QUAD:LTUS:660:STDZDISABLE.RVAL CPP NMS") field(INPG, "QUAD:LTUS:660: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, "QUAD:LTUS:660:STDZWF PP") field(OUTB, "QUAD:LTUS:660: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, "QUAD:LTUS:660:STDZWF") } record(mbbo, "QUAD:LTUS:660: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, "QUAD:LTUS:660: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, "QUAD:LTUS:660:STDZMAINPS") { field(DESC, "Stdz by main or self") field(PINI, "YES") field(DTYP, "Soft Channel") field(ZNAM, "SELF") field(ONAM, "MAIN") } record(bo, "QUAD:LTUS:660: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, "QUAD:LTUS:660: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, "QUAD:LTUS:660: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, "QUAD:LTUS:660:STDZTOD") { field(DESC, "Successful Standardize Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "QUAD:LTUS:660:STDZLOSTTOD") { field(DESC, "Standardize Lost Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(longout, "QUAD:LTUS:660:STDZCYCLECNT") { field(DESC, "Cycle Count") field(PINI, "YES") } record(longout, "QUAD:LTUS:660:STDZCYCLENUM") { field(DESC, "No. Standardize Cycles") field(VAL, "3") field(HOPR, "10") field(LOPR, "0") field(DRVH, "10") field(DRVL, "0") field(PINI, "YES") field(FLNK, "QUAD:LTUS:660:STDZDIRECT") } # The default standardize direction is "UP" for # all LCLS Magnets.. record(bo, "QUAD:LTUS:660:STDZDIRECT") { field(DESC, "Standardize Direction ") field(ZNAM, "UP") field(ONAM, "DOWN") field(VAL, "0") field(FLNK, "QUAD:LTUS:660:STDZIMIN") } record(ao, "QUAD:LTUS:660:STDZIMIN") { field(DESC, "Min-STDZ Current") field(PREC, "1") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(VAL, "-120.0") field(FLNK, "QUAD:LTUS:660:STDZIMAX") } record(ao, "QUAD:LTUS:660:STDZIMAX") { field(DESC, "Max. Standarize Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(VAL, "120.0") field(FLNK, "QUAD:LTUS:660:STDZIFINAL") } record(ao, "QUAD:LTUS:660:STDZIFINAL") { field(DESC, "Final SDTZ Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(VAL, "-120.0") field(FLNK, "QUAD:LTUS:660: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, "QUAD:LTUS:660: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, "QUAD:LTUS:660:STDZITOL") { field(DESC, "Stdz min tolerance") field(PREC, "5") field(CALC, "MAX(ABS(A),ABS(B))*C") field(INPA, "QUAD:LTUS:660:STDZIMIN CP NMS") field(INPB, "QUAD:LTUS:660:STDZIMAX CP MMS") field(INPC, "0.05") field(INPD, "QUAD:LTUS:660:STDZITOLR CP MMS") field(EGU, "A") field(FLNK, "QUAD:LTUS:660:IDELTAS") field(PINI, "YES") } # D - factor (3.154/2 = 1.577) for EPSC, otherwise, set to 1.0 record(calc, "QUAD:LTUS:660:STDZDLY") { field(DESC, "Ramp time for stdz cycle") field(CALC, "C>0?MAX(1,ABS((A-B)/C)*D):0") field(INPA, "QUAD:LTUS:660:STDZIMIN CP NMS") field(INPB, "QUAD:LTUS:660:STDZIMAX CP NMS") field(INPC, "QUAD:LTUS:660:TRIMRAMPRATE CP NMS") field(INPD, "1.577") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") } record(calc, "QUAD:LTUS:660:STDZRAMPDLY") { field(DESC, "Ramp delay total") field(CALC, "MAX(1,((A/100)*B+B))") field(PREC, "5") field(INPA, "QUAD:LTUS:660:TRIMDLYPCT CP MS") field(INPB, "QUAD:LTUS:660: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, "QUAD:LTUS:660:STDZMINIDLY") { field(DESC, "Mini-stdz delay") field(CALC, "A") field(PREC, "5") field(A, "1.0") field(EGU, "sec") field(PINI, "YES") } record(ao, "QUAD:LTUS:660: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, "QUAD:LTUS:660:STDZMINIDELTA") { field(DESC, "Stdz mini % of IMAX") field(CALC, "(B/100)*(A-C)") field(INPA, "QUAD:LTUS:660:IDES.HOPR") field(INPB, "QUAD:LTUS:660:STDZMINIPCT CPP NMS") field(INPC, "QUAD:LTUS:660:IDES.LOPR") field(PREC, "5") } record(calc, "QUAD:LTUS:660:STDZMINISETPT") { field(DESC, "Mini Stdz delta") field(CALC, "C==0?MAX(E-D,B):MIN(E+D,A)") field(INPA, "QUAD:LTUS:660:IDES.HOPR") field(INPB, "QUAD:LTUS:660:IDES.LOPR") field(INPC, "QUAD:LTUS:660:STDZDIRECT.RVAL") field(INPD, "QUAD:LTUS:660:STDZMINIDELTA") field(INPE, "QUAD:LTUS:660:IDES") field(PREC, "5") field(FLNK, "QUAD:LTUS:660: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, "QUAD:LTUS:660:STDZMINISETPTOOR") { field(DESC, "Mini Stdz setpoint out of range") field(CALC, "C==0?(E-DA)") field(INPA, "QUAD:LTUS:660:IDES.HOPR") field(INPB, "QUAD:LTUS:660:IDES.LOPR") field(INPC, "QUAD:LTUS:660:STDZDIRECT.RVAL") field(INPD, "QUAD:LTUS:660:STDZMINIDELTA") field(INPE, "QUAD:LTUS:660: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, "QUAD:LTUS:660: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, "QUAD:LTUS:660:IADJUST.RVAL") field(INPB, "QUAD:LTUS:660:STDZDIRECT.RVAL") field(INPC, "QUAD:LTUS:660:STDZOK.RVAL") field(INPD, "QUAD:LTUS:660:STDZDISABLE.RVAL") field(INPE, "QUAD:LTUS:660:STATE.RVAL CPP NMS") field(INPF, "QUAD:LTUS:660:ICTRL.RVAL") field(INPG, "QUAD:LTUS:660:STATE.SEVR") field(INPH, "QUAD:LTUS:660:BDELTAS.M") field(INPI, "QUAD:LTUS:660:IACT.SEVR") field(OUT, "QUAD:LTUS:660:STDZLOSTGO.SELN PP NMS") field(OOPT, "Transition To Non-zero") } record(seq, "QUAD:LTUS:660:STDZLOSTGO") { field(DESC, "Process lost stdz") field(SELM, "Mask") field(DOL1, "1") field(DOL2, "0") field(LNK1, "QUAD:LTUS:660:STDZLOSTTOD.PROC") field(LNK2, "QUAD:LTUS:660:STDZOK PP") } # Record maximum current after standardize # Reset to IACT from sequence after trim # Disable processing during (mini-)standardize or trim record(calc, "QUAD:LTUS:660:STDZIACTMAX") { field(DESC, "Max act current after stdz") field(CALC, "MAX(A, B)") field(DISV, "0") field(SDIS, "QUAD:LTUS:660:CHECKPWRDIP_ENABLE") field(INPA, "QUAD:LTUS:660:IACT CP") field(INPB, "QUAD:LTUS:660:STDZIACTMAX") field(EGU, "A") field(FLNK, "QUAD:LTUS:660:CHECKPWRDIP") } # Detect power dip if STDZOK is YES, STDZ is enabled, and IACT is valid # If IACT drops below STDZIACTMAX by more than the trim tolerance, clear STDZOK # Warning: Take the absolute value of the trim tolerance, or else quads of # negative polarity will always lose STDZ since their IDELTAS.I are negative. # Note: Large quads and bends are prone to losing STDZ even if they are # perturbed toward higher current since their current tends to overshoot # by greater than the trim tolerance before settling down. record(calcout, "QUAD:LTUS:660:CHECKPWRDIP") { field(DESC, "Detect power dip") field(CALC, "(A-B>ABS(C))?3:0") field(DISV, "0") field(SDIS, "QUAD:LTUS:660:CHECKPWRDIP_ENABLE") field(INPA, "QUAD:LTUS:660:STDZIACTMAX") field(INPB, "QUAD:LTUS:660:IACT") field(INPC, "QUAD:LTUS:660:IDELTAS.I") field(OUT, "QUAD:LTUS:660:STDZLOSTGO.SELN PP NMS") field(OOPT, "When Non-zero") } # Enable processing of STDZIACTMAX and CHECKPWRDIP only if # STDZOK = YES, STDZDISABLE = NO, CTRL != Trim (2), and # CTRL != Stdz (4) record(calc, "QUAD:LTUS:660:CHECKPWRDIP_ENABLE") { field(CALC, "A&&!B&&(C#2)&&(C#4)") field(INPA, "QUAD:LTUS:660:STDZOK.RVAL CP") field(INPB, "QUAD:LTUS:660:STDZDISABLE.RVAL CP") field(INPC, "QUAD:LTUS:660:CTRL.RVAL CP") } #! 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, "QUAD:LTUS:660: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, "QUAD:LTUS:660:CALBOK") { field(DESC, "Successful Calibration") field(DTYP, "Raw Soft Channel") field(ZNAM, "NO") field(ONAM, "YES") field(DOL, "PSC:LTUS:MG16:CALBOK.RVAL") field(OMSL, "closed_loop") 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, "QUAD:LTUS:660:CALBSET") { field(DESC, "Use DAC Calbration") field(SCAN, "10 second") field(CALC, "A&&(B==0)&&C?31:960") field(INPA, "QUAD:LTUS:660:CALBOK") field(INPB, "QUAD:LTUS:660:CALBDISABLE") field(INPC, "QUAD:LTUS:660:CALBSLOPE") field(OOPT, "On Change") field(OUT, "QUAD:LTUS:660: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, "QUAD:LTUS:660:CALB_SEQ") { field(DESC, "Output Calib Values") field(SELM, "Mask") field(SELL, "QUAD:LTUS:660: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, "QUAD:LTUS:660:CALBSLOPE") field(DOL3, "QUAD:LTUS:660: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, "QUAD:LTUS:660:CALBTOD") { field(DESC, "Calibration Success Time") field(PINI, "YES") field(DOL, "PSC:LTUS:MG16:CALBTOD") field(OMSL, "closed_loop") field(DTYP, "Soft Channel") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:660: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, "QUAD:LTUS:660: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, "QUAD:LTUS:660: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, "QUAD:LTUS:660:CALBOFFSET") { field(DESC, "Calc DAC Offset") field(PREC, "6") field(EGU, "Counts") field(PINI, "YES") } record(bo, "QUAD:LTUS:660: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, "QUAD:LTUS:660:DACSLOPE") { field(DESC, "V to DAC slope") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "closed_loop") field(PINI, "YES") field(FLNK, "QUAD:LTUS:660:DACOFFSET") } # Default Offset used in conversion from Volts to DAC Counts record(ao, "QUAD:LTUS:660:DACOFFSET") { field(DESC, "V to DAC offset") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "closed_loop") field(PINI, "YES") field(FLNK, "QUAD:LTUS:660: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, "QUAD:LTUS:660: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, "QUAD:LTUS:660:IACT") field(INPD, "QUAD:LTUS:660:DACSLOPE") field(INPE, "QUAD:LTUS:660:DACOFFSET") field(EGU, "Counts") field(PREC, "6") } record(ao, "QUAD:LTUS:660:DAC") { field(DESC, "DAC Set point") field(EGU, "Counts") field(DOL, "") field(OMSL, "closed_loop") field(PREC, "6") field(PINI, "YES") } record(ao, "QUAD:LTUS:660:CALBIMIN") { field(DESC, "Calibration Min Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(DRVH, "120.0") field(HOPR, "120.0") field(DRVL, "-120.0") field(LOPR, "-120.0") field(PREC, "3") field(EGU, "A") field(VAL, "0.0") field(FLNK, "QUAD:LTUS:660:CALBIMAX") } record(ao, "QUAD:LTUS:660:CALBIMAX") { field(DESC, "Calibration Max Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(DRVH, "120.0") field(HOPR, "120.0") field(LOPR, "-120.0") field(DRVL, "-120.0") field(EGU, "A") field(VAL, "120.0") field(FLNK, "QUAD:LTUS:660:CALBSTEPNUM") } record(ao, "QUAD:LTUS:660:CALBIFINAL") { field(DESC, "Calibration Last Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(PREC, "3") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(VAL, "0") } record(longout, "QUAD:LTUS:660: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, "QUAD:LTUS:660:CALBIDELTA") } record(calc, "QUAD:LTUS:660:CALBIDELTA") { field(DESC, "Step size for CALB") field(CALC, "C=0?0:ABS((A-B)/C)") field(INPA, "QUAD:LTUS:660:CALBIMAX") field(INPB, "QUAD:LTUS:660:CALBIMIN") field(INPC, "QUAD:LTUS:660: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, "QUAD:LTUS:660:CALBIMULT") { field(DESC, "IACT vs ISETPT mult") field(CALC, "C#0||A=0?1:ABS(B/A)") field(INPA, "PSC:LTUS:MG16:ISETPT.DRVH") field(INPB, "PSC:LTUS:MG16:IACT.HOPR") field(INPC, "QUAD:LTUS:660:PSCONTROLLER.RVAL CPP") field(EGU, "A") field(PINI, "YES") } # SNL dbputs DAC values here. 6-10 steps are possible. record(waveform, "QUAD:LTUS:660:CALBICTRLWF") { field(DESC, "ICTRL setpoint array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") } record(waveform, "QUAD:LTUS:660:DACWF") { field(DESC, "DAC count array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:660:DACSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:660:DACSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "QUAD:LTUS:660: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, "QUAD:LTUS:660:CALCDACWF") { field(DESC, "Calc DAC counts array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:660:CALCDACSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:660:CALCDACSA") { field(DESC, "Calc DAC counts") field(DTYP, "Soft Channel") field(INP, "QUAD:LTUS:660: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, "QUAD:LTUS:660:CALBYWF") { field(DESC, "mx + b") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:660:CALBYSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:660:CALBYSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "QUAD:LTUS:660:CALBYWF") field(MALM, "10") field(NELM, "6") field(INDX, "0") field(FTVL, "DOUBLE") } record(waveform, "QUAD:LTUS:660:CALBIACTWF") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:660:CALBIACTSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:660:CALBIACTSA") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(MALM, "10") field(NELM, "6") field(INP, "QUAD:LTUS:660:CALBIACTWF") field(INDX, "0") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:660:CALBLIMITS") } # Check that measured current during calibration is within # tolerance. record(aSub, "QUAD:LTUS:660: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, "QUAD:LTUS:660:CALBSTEPNUM") field(INPB, "QUAD:LTUS:660:CALBIACTWF") field(INPC, "QUAD:LTUS:660: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, "QUAD:LTUS:660: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, "QUAD:LTUS:660:STDZITOL") field(INPH, "QUAD:LTUS:660:DACSLOPE") field(INPI, "QUAD:LTUS:660: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, "QUAD:LTUS:660: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, "QUAD:LTUS:660:CALBSTEPNUM") field(INPB, "QUAD:LTUS:660:CALBIACTWF") field(INPC, "QUAD:LTUS:660:DACWF") field(INPF, "QUAD:LTUS:660: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 QUAD:LTUS:660CALBOK 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, "QUAD:LTUS:660:DEGAUSINIT") { field(DESC, "Proc. Degauss PVs on boot") field(PINI, "YES") field(DOL, "1") field(OUTA, "QUAD:LTUS:660:DEGAUSIMIN.PROC PP") field(OUTB, "QUAD:LTUS:660:DEGAUSIMAX.PROC PP") field(OUTC, "QUAD:LTUS:660:DEGAUSTYPE.PROC PP") field(OUTD, "QUAD:LTUS:660:DEGAUSSTEP.PROC PP") field(OUTE, "QUAD:LTUS:660:MADNAME.PROC PP") field(OUTF, "QUAD:LTUS:660:PSTYPE.PROC PP") field(OUTG, "QUAD:LTUS:660: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, "QUAD:LTUS:660:DEGAUSSUB") { field(DESC, "Degauss subroutine") field(INAM, "mgntDegaussInit") field(SNAM, "mgntDegauss") field(BRSV, "INVALID") field(INPA, "QUAD:LTUS:660:DEGAUSIMIN NPP NMS") field(INPB, "QUAD:LTUS:660:DEGAUSIMAX NPP NMS") field(INPC, "QUAD:LTUS:660:DEGAUSTYPE.RVAL NPP NMS") field(INPE, "QUAD:LTUS:660:DEGAUSMETHOD.RVAL NPP NMS") field(INPF, "QUAD:LTUS:660:PSTYPE NPP NMS") field(INPG, "QUAD:LTUS:660:DEBUG.RVAL NPP NMS") field(INPH, "QUAD:LTUS:660: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, "QUAD:LTUS:660:DEGAUSWF PP") field(OUTB, "QUAD:LTUS:660:DEGAUSMSG PP") field(OUTC, "QUAD:LTUS:660: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, "QUAD:LTUS:660:DEGAUSWF") { field(DESC, "Degauss Setpts") field(NELM, "60") field(FTVL, "DOUBLE") } record(mbbo,"QUAD:LTUS:660: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, "QUAD:LTUS:660: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, "QUAD:LTUS:660: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, "QUAD:LTUS:660: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, "QUAD:LTUS:660: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, "QUAD:LTUS:660:DEGAUSIMIN") { field(DESC, "Min. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "120.0") field(LOPR, "-120.0") field(DRVH, "120.0") field(DRVL, "-120.0") field(VAL, "-120.0") } record(ao, "QUAD:LTUS:660:DEGAUSIMAX") { field(DESC, "Max. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "120.0") field(LOPR, "-120.0") field(DRVH, "120.0") field(DRVL, "-120.0") field(VAL, "120.0") } # 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,"QUAD:LTUS:660: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, "QUAD:LTUS:660: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,"QUAD:LTUS:660: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, "QUAD:LTUS:660: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, "QUAD:LTUS:660: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, "QUAD:LTUS:660: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, "QUAD:LTUS:660:DEGAUSTOD") { field(DESC, "Successful Degauss Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "QUAD:LTUS:660:DEGAUSLOSTTOD") { field(DESC, "Degauss Lost Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:660:DEGAUSTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "QUAD:LTUS:660:DEGAUSTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "QUAD:LTUS:660: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, "QUAD:LTUS:660:DEGAUSGO") { field(DESC, "Set bdes of btrms to zero") field(ASG, "Internal") field(OUTA, "") field(OUTB, "") field(OUTC, "") field(OUTD, "") } # =========== CRYO ONLY =========== record(bo, "QUAD:LTUS:660: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, "QUAD:LTUS:660:DEGAUS_IMAX_CHECK") { field(DESC, "Check if imax shoud chg") field(CALC, "(C==4)&&(ABS(B)>ABS(A))?1:0") field(INPA, "QUAD:LTUS:660:DEGAUS_IMAX") field(INPB, "QUAD:LTUS:660:ISETPT") field(INPC, "QUAD:LTUS:660:DEGAUSTYPE.RVAL") field(OUT, "QUAD:LTUS:660:DEGAUS_IMAX_UPDATE.SELN") field(FLNK, "QUAD:LTUS:660:DEGAUS_IMAX_UPDATE") } record(seq, "QUAD:LTUS:660:DEGAUS_IMAX_UPDATE") { field(DESC, "Degauss IMAX Update") field(SELM, "Specified") field(DOL1, "QUAD:LTUS:660:ISETPT") field(LNK1, "QUAD:LTUS:660:DEGAUS_IMAX PP") } # Set the maximum current after a successful # degauss. This pv is updated by the # sequence. record(ao, "QUAD:LTUS:660:DEGAUS_IMAX") { field(DESC, "Max I set afer a degauss") field(EGU, "Amps") field(PINI, "YES") field(PREC, "6") field(HOPR, "120.0") field(LOPR, "-120.0") field(DRVH, "120.0") field(DRVL, "-120.0") field(VAL, "120.0") field(FLNK, "QUAD:LTUS:660:DEGAUS_IMAXPOL_CHECK") info(autosaveFields,"VAL,RVAL") } # Set the polarity if degauss_imax record(calcout, "QUAD:LTUS:660:DEGAUS_IMAXPOL_CHECK") { field(DESC, "Determine polarity of imax") field(CALC, "A>=0?0:1") field(INPA, "QUAD:LTUS:660:DEGAUS_IMAX") field(FLNK, "QUAD:LTUS:660:DEGAUS_IMAXPOL") } record(bo, "QUAD:LTUS:660:DEGAUS_IMAXPOL") { field(DESC, "Polarity of imax I") field(DTYP, "Raw Soft Channel") field(DOL, "QUAD:LTUS:660:DEGAUS_IMAXPOL_CHECK") field(OMSL, "closed_loop") field(ZNAM, "Positive") field(ONAM, "Negative") field(FLNK, "QUAD:LTUS:660: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, "QUAD:LTUS:660:DEGAUS_ABSIMAX") { field(DESC, "Absolute Max. Degauss I") field(CALC, "ABS(A)") field(INPA, "QUAD:LTUS:660:DEGAUS_IMAX") field(PREC, "6") field(EGU, "Amps") field(HOPR, "120.0") field(LOPR, "-120.0") info(autosaveFields,"VAL RVAL") } # IACT Polarity record(calcout, "QUAD:LTUS:660:IACTPOL_CHECK") { field(DESC, "Determine IACT polarity") field(SCAN, "5 second") field(CALC, "ABS(A-B)>C?(A>=0?0:1):D") field(INPA, "QUAD:LTUS:660:IACT") field(INPB, "QUAD:LTUS:660:IACTPOL_CHECK.LA") field(INPC, "0.0001") field(INPD, "QUAD:LTUS:660:IACTPOL_CHECK.PVAL") field(OOPT, "On Change") field(FLNK, "QUAD:LTUS:660:IACTPOL") } record(bo, "QUAD:LTUS:660: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,"QUAD:LTUS:660: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, "QUAD:LTUS:660:DEGAUSENABLE CP") field(INPB, "QUAD:LTUS:660:DEGAUSOK") field(INPC, "QUAD:LTUS:660:STATE CP") field(INPD, "QUAD:LTUS:660:STATE.SEVR") field(OUT, "QUAD:LTUS:660:DEGAUS_STATE_SEQ.SELN PP") field(ASG, "Internal") } record(seq, "QUAD:LTUS:660:DEGAUS_STATE_SEQ") { field(DESC, "Degauss State Sequence") field(SELM, "Specified") field(SELL, "QUAD:LTUS:660:DEGAUS_STATE_CHECK") field(LNK1, "QUAD:LTUS:660:DEGAUS_STATE_DISABLE.PROC PP") field(LNK2, "QUAD:LTUS:660:DEGAUS_STATE_LOST.PROC PP") field(LNK3, "QUAD:LTUS:660:DEGAUS_STATE_GOOD.PROC PP") field(LNK4, "QUAD:LTUS:660: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, "QUAD:LTUS:660:DEGAUS_STATE_DISABLE") { field(DESC, "Degauss not used") field(LNK1, "QUAD:LTUS:660:DEGAUSOK.ZSV") field(LNK2, "QUAD:LTUS:660: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, "QUAD:LTUS:660:STATMSG.FRSV") field(LNK4, "QUAD:LTUS:660: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, "QUAD:LTUS:660:DEGAUS_STATE_LOST") { field(DESC, "Degauss lost and ps On") field(DOL1, "1") field(LNK1, "QUAD:LTUS:660:DEGAUSOK.ZSV") field(LNK2, "QUAD:LTUS:660: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, "QUAD:LTUS:660:STATMSG.FRSV") field(LNK4, "QUAD:LTUS:660: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, "QUAD:LTUS:660:DEGAUS_STATE_OFF") { field(DESC, "Degaused lost and ps Off") field(DOL1, "2") field(LNK1, "QUAD:LTUS:660: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, "QUAD:LTUS:660:STATMSG.FRSV") field(LNK3, "QUAD:LTUS:660: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, "QUAD:LTUS:660:DEGAUS_STATE_GOOD") { field(DESC, "Degauss good") field(DOL1, "1") field(LNK1, "QUAD:LTUS:660: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, "QUAD:LTUS:660:STATMSG.FRSV PP") field(LNK3, "QUAD:LTUS:660:STATMSG.FVSV PP") field(LNK4, "") field(ASG, "Internal") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(mbbo, "QUAD:LTUS:660:FUNC") { field(DESC, "QUAD:LTUS:660 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, "1") field(THVL, "9") field(FRVL, "10") field(FVVL, "0") field(SXVL, "2") field(SVVL, "8") field(EIVL, "11") field(NIVL, "12") field(TEVL, "13") field(ELVL, "5") field(TVVL, "6") field(TTVL, "7") field(FTVL, "4") field(FFVL, "3") field(OUT, "QUAD:LTUS:660:CTRL CA") } # :CTRL pv is processed at boot in the # sequence mgntCtrl.st Processed in sequence # record(mbbo, "QUAD:LTUS:660:CTRL") { field(DESC, "QUAD:LTUS:660 Control") field(PINI, "NO") field(ZRST, "Ready") field(ONST, "TRIM") field(TWST, "PERTURB") field(THST, "BCON_TO_BDES") field(FRST, "BACT_TO_BDES") field(FVST, "SAVE_BDES") field(SXST, "LOAD_BDES") field(SVST, "UNDO_BDES") field(EIST, "DAC_ZERO") field(NIST, "CALB") field(TEST, "STDZ") field(ELST, "RESET") field(TVST, "TURN_ON") field(TTST, "TURN_OFF") field(FTST, "") field(FFST, "") field(ZRVL, "0") field(ONVL, "2") field(TWVL, "6") field(THVL, "15") field(FRVL, "14") field(FVVL, "11") field(SXVL, "12") field(SVVL, "13") field(EIVL, "7") field(NIVL, "3") field(TEVL, "4") field(ELVL, "8") field(TVVL, "9") field(TTVL, "10") field(FTVL, "0") field(FFVL, "0") field(OUT, "QUAD:LTUS:660:SELECTEN.A PP") field(SDIS, "0") } # If a function has been selected set this unit to busy record(calcout, "QUAD:LTUS:660:SELECTEN") { field(DESC, "Control Select Enable") field(CALC, "A>0?1:A") field(FLNK, "QUAD:LTUS:660:BUSY") } # Set to FREE on IOC reboot record(bo, "QUAD:LTUS:660:BUSY") { field(DESC, "QUAD:LTUS:660 Ctrl Done") field(DOL, "QUAD:LTUS:660:SELECTEN") field(ZNAM, "FREE") field(ONAM, "BUSY") field(PINI, "YES") field(FLNK, "QUAD:LTUS:660:SELECT") } record(bo, "QUAD:LTUS:660:SELECT") { field(ZNAM, "NO") field(ONAM, "YES") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") } record(bo, "QUAD:LTUS:660: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, "QUAD:LTUS:660:CTRLSTATE") { field(DESC, "QUAD:LTUS:660 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("QUAD:LTUS:660:CTRL",20,20,0,0,"QUAD:LTUS:660:CTRL") #! Field("QUAD:LTUS:660:CTRL.OUT",16777215,1,"QUAD:LTUS:660:CTRL.OUT") #! Link("QUAD:LTUS:660:CTRL.OUT","QUAD:LTUS:660:SELECTEN.A") #! Field("QUAD:LTUS:660:CTRL.VAL",16777215,1,"QUAD:LTUS:660:CTRL.VAL") #! Record("QUAD:LTUS:660:SELECTEN",321,381,0,0,"QUAD:LTUS:660:SELECTEN") #! Field("QUAD:LTUS:660:SELECTEN.A",16777215,0,"QUAD:LTUS:660:SELECTEN.A") #! Field("QUAD:LTUS:660:SELECTEN.FLNK",16777215,1,"QUAD:LTUS:660:SELECTEN.FLNK") #! Link("QUAD:LTUS:660:SELECTEN.FLNK","QUAD:LTUS:660:BUSY") #! Field("QUAD:LTUS:660:SELECTEN.VAL",16777215,1,"QUAD:LTUS:660:SELECTEN.VAL") #! Record("QUAD:LTUS:660:BUSY",623,274,0,0,"QUAD:LTUS:660:BUSY") #! Field("QUAD:LTUS:660:BUSY.DOL",16777215,0,"QUAD:LTUS:660:BUSY.DOL") #! Link("QUAD:LTUS:660:BUSY.DOL","QUAD:LTUS:660:SELECTEN.VAL") #! Field("QUAD:LTUS:660:BUSY.FLNK",16777215,1,"QUAD:LTUS:660:BUSY.FLNK") #! Link("QUAD:LTUS:660:BUSY.FLNK","QUAD:LTUS:660:SELECT") #! Record("QUAD:LTUS:660:SELECT",669,508,0,1,"QUAD:LTUS:660:SELECT") #! Record("QUAD:LTUS:660:FUNC",940,120,0,0,"QUAD:LTUS:660:FUNC") #! Field("QUAD:LTUS:660:FUNC.OUT",16777215,0,"QUAD:LTUS:660:FUNC.OUT") #! Link("QUAD:LTUS:660:FUNC.OUT","QUAD:LTUS:660:CTRL.VAL") #! Record("QUAD:LTUS:660:ABORT",193,41,0,0,"QUAD:LTUS:660:ABORT") #! Record("QUAD:LTUS:660:CTRLSTATE",369,34,0,0,"QUAD:LTUS:660: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,"QUAD:LTUS:660:SELECT is used for Multi-device selection.\nIt is enabled when associated QUAD:LTUS:660:CTRL is \"0\" (DONE).\nIt is disabled when associated QUAD:LTUS:660: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,"QUAD:LTUS:660: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, "QUAD:LTUS:660:BCTRL_INIT") { field(DESC, "Process BCTRL on boot") field(PINI, "YES") field(CALC, "A=3?1:0") field(INPA, "QUAD:LTUS:660:BCTRL.SEVR") field(OUT, "QUAD:LTUS:660: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, "QUAD:LTUS:660:BACT") { field(DESC, "Actual B") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "QUAD:LTUS:660:BACT") field(INPB, "QUAD:LTUS:660:POLYCOEF") field(INPC, "QUAD:LTUS:660:POLYCOEF.A") field(INPD, "QUAD:LTUS:660:POLYCOEF.B") field(INPE, "QUAD:LTUS:660:IACT MS") field(INPF, "QUAD:LTUS:660:BDELTAS PP") field(INPG, "100") field(EGU, "kG") field(HOPR, "67.2373") field(LOPR, "-67.2374") field(HIHI, "67.2373") field(LOLO, "-67.2374") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "67.2373") field(LOW, "-67.2374") field(FLNK, "QUAD:LTUS:660: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, "QUAD:LTUS:660:BDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntPhyDeltas") field(EGU, "kG") field(HOPR, "1") field(PREC, "7") field(BRSV, "INVALID") field(INPA, "QUAD:LTUS:660:BDES") field(INPB, "QUAD:LTUS:660:TRIMBTOL") field(INPC, "QUAD:LTUS:660:TRIMBTOLR") field(INPD, "QUAD:LTUS:660:CHCKBTOL") field(INPE, "QUAD:LTUS:660:CHCKBTOLR") field(F, "2.0") field(INPG, "30") field(INPH, "QUAD:LTUS:660:BACT.VAL") # # MPS absolute and relative tolerances field(INPP, "QUAD:LTUS:660:MPSBTOL") field(INPQ, "QUAD:LTUS:660:MPSBTOLR") field(FLNK, "QUAD:LTUS:660:BCONLIMITS") info(autosaveFields,"F") } # This record is processed by BDELTAS record(aSub, "QUAD:LTUS:660:BCONLIMITS") { field(DESC, "Config B-field Limits") field(INAM, "mgntInit") field(SNAM, "mgntBCONLimits") field(INPA, "QUAD:LTUS:660:BDES") field(INPB, "QUAD:LTUS:660:BDELTAS.I") field(INPG, "QUAD:LTUS:660:DEBUG.RVAL") field(FTA, "DOUBLE") field(FTB, "DOUBLE") field(FTG, "ULONG") field(OUTA, "QUAD:LTUS:660:BCON.HIGH") field(OUTB, "QUAD:LTUS:660:BCON.LOW") field(OUTC, "QUAD:LTUS:660:BCON.HIHI") field(OUTD, "QUAD:LTUS:660:BCON.LOLO PP") field(FTVA, "DOUBLE") field(FTVB, "DOUBLE") field(FTVC, "DOUBLE") field(FTVD, "DOUBLE") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:660:IDELTAS") } # The following PV is processed by :BACT # which is processed by :BACT # record(fanout, "QUAD:LTUS:660:BACTFO") { field(DESC, "BACT processing") field(SELM, "All") field(LNK1, "QUAD:LTUS:660:BDIFF") field(LNK2, "QUAD:LTUS:660:BADIFF") field(LNK3, "QUAD:LTUS:660:BRATIO") field(LNK4, "QUAD:LTUS:660:MPSLIMITS") field(LNK5, "QUAD:LTUS:660:I2BSTATUS") field(LNK6, "QUAD:LTUS:660:IACTFO.PROC") } record(calc, "QUAD:LTUS:660:BDIFF") { field(DESC, "BDES-BACT") field(CALC, "A-B") field(INPA, "QUAD:LTUS:660:BDES") field(INPB, "QUAD:LTUS:660:BACT") field(EGU, "kG") field(PREC, "7") } record(calc, "QUAD:LTUS:660:BADIFF") { field(DESC, "Absolute BDES-BACT") field(INPA, "QUAD:LTUS:660:BDIFF") field(EGU, "kG") field(PREC, "7") field(CALC, "A<0?ABS(A):A") } record(calc, "QUAD:LTUS:660:BRATIO") { field(DESC, "BACT Error") field(CALC, "B?A/B:0") field(INPA, "QUAD:LTUS:660:BDIFF") field(INPB, "QUAD:LTUS:660:BDES.HOPR") field(EGU, "kG") field(PREC, "7") } record(mbbi, "QUAD:LTUS:660: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, "QUAD:LTUS:660:BACT.J") } # Note: for a string slave set the MONFL # macro to the following: # MONFL=:IMONCALC MS record(sub, "QUAD:LTUS:660:BMON") { field(DESC, "Second Transductor") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "QUAD:LTUS:660:BMON") field(INPB, "QUAD:LTUS:660:POLYCOEF") field(INPC, "QUAD:LTUS:660:POLYCOEF.A") field(INPD, "QUAD:LTUS:660:POLYCOEF.B") field(INPE, "QUAD:LTUS:660:IMON MS") field(INPF, "QUAD:LTUS:660:BDELTAS.VAL") field(INPG, "100") field(EGU, "kG") field(HOPR, "67.2373") field(LOPR, "-67.2374") field(HIHI, "67.2373") field(LOLO, "-67.2374") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "67.2373") field(LOW, "-67.2374") } # 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=PSC:LTUS:MG16:BDES CP record(ao, "QUAD:LTUS:660:BDES") { field(DESC, "Desired B-Field") field(PINI, "YES") field(DRVH, "67.2373") field(DRVL, "-67.2374") field(HOPR, "67.2373") field(LOPR, "-67.2374") field(PREC, "7") field(EGU, "kG") field(MDEL, "-1") field(OMSL, "supervisory") # field(DOL, "") field(OUT, "QUAD:LTUS:660:B2IDES PP") info(autosaveFields,"VAL") } record(sub, "QUAD:LTUS:660:B2IDES") { field(DESC, "Convert Desired B-Field to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:660:POLYCOEF") field(INPC, "QUAD:LTUS:660:POLYCOEF.A") field(INPD, "QUAD:LTUS:660:POLYCOEF.B") field(PREC, "7") field(EGU, "kG") field(HOPR, "67.2373") field(LOPR, "-67.2374") field(MDEL, "-1") field(INPE, "QUAD:LTUS:660:BDES.DRVH") field(INPF, "QUAD:LTUS:660:BDES.DRVL") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:660:IDES") } record(sub, "QUAD:LTUS:660:BNOM") { field(DESC, "Nominal Field") field(PINI, "YES") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:660:POLYCOEF") field(INPC, "QUAD:LTUS:660:POLYCOEF.A") field(INPD, "QUAD:LTUS:660:POLYCOEF.B") field(INPE, "QUAD:LTUS:660:BDES.DRVH") field(INPF, "QUAD:LTUS:660:BDES.DRVL") field(EGU, "kG") field(HOPR, "67.2373") field(LOPR, "-67.2374") field(PREC, "7") field(VAL, "0.0") field(FLNK, "QUAD:LTUS:660:INOM") } record(sub, "QUAD:LTUS:660:BACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:660:BDES.VAL") field(INPB, "QUAD:LTUS:660:BDES.DRVH") field(INPC, "QUAD:LTUS:660:BDES.DRVL") field(INPD, "QUAD:LTUS:660:BDELTAS.I") field(INPE, "QUAD:LTUS:660:BDELTAS.J") field(INPG, "QUAD:LTUS:660:STATE") field(INPH, "QUAD:LTUS:660:HSTA") field(EGU, "kG") field(HOPR, "67.2373") field(LOPR, "-67.2374") field(PREC, "7") field(BRSV, "INVALID") } record(sub, "QUAD:LTUS:660:BMONLIMITS") { field(DESC, "MON Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:660:BDES.VAL") field(INPB, "QUAD:LTUS:660:BDES.DRVH") field(INPC, "QUAD:LTUS:660:BDES.DRVL") field(INPD, "QUAD:LTUS:660:BDELTAS.K") field(INPE, "QUAD:LTUS:660:BDELTAS.L") field(INPG, "QUAD:LTUS:660:STATE") field(INPH, "QUAD:LTUS:660:HSTA") field(EGU, "kG") field(HOPR, "67.2373") field(LOPR, "-67.2374") field(PREC, "7") field(BRSV, "INVALID") } record(seq, "QUAD:LTUS:660:BLIMITS") { field(DESC, "ACT Limits") field(PREC, "7") field(DOL1, "QUAD:LTUS:660:BLIMITS") field(LNK1, "QUAD:LTUS:660:BACTLIMITS.F PP") field(DOL2, "QUAD:LTUS:660:BACTLIMITS.I") field(LNK2, "QUAD:LTUS:660:BACT.HIGH") field(DOL3, "QUAD:LTUS:660:BACTLIMITS.J") field(LNK3, "QUAD:LTUS:660:BACT.LOW") field(DOL4, "QUAD:LTUS:660:BACTLIMITS.K") field(LNK4, "QUAD:LTUS:660:BACT.HIHI") field(DOL5, "QUAD:LTUS:660:BACTLIMITS.L") field(LNK5, "QUAD:LTUS:660:BACT.LOLO") field(DOL6, "QUAD:LTUS:660:BLIMITS") field(LNK6, "QUAD:LTUS:660:BMONLIMITS.F PP") field(DOL7, "QUAD:LTUS:660:BMONLIMITS.I") field(LNK7, "QUAD:LTUS:660:BMON.HIGH") field(DOL8, "QUAD:LTUS:660:BMONLIMITS.J") field(LNK8, "QUAD:LTUS:660:BMON.LOW") field(DOL9, "QUAD:LTUS:660:BMONLIMITS.K") field(LNK9, "QUAD:LTUS:660:BMON.HIHI") field(DOLA, "QUAD:LTUS:660:BMONLIMITS.L") field(LNKA, "QUAD:LTUS:660:BMON.LOLO") field(FLNK, "QUAD:LTUS:660:ILIMITS") field(SCAN, "5 second") } record(ao, "QUAD:LTUS:660:BCTRL") { field(DESC, "B-Perturb") field(PREC, "7") field(EGU, "kG") field(DRVH, "67.2373") field(DRVL, "-67.2374") field(HOPR, "67.2373") field(LOPR, "-67.2374") # 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, "QUAD:LTUS:660: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, "QUAD:LTUS:660:BCTRLGO") { field(DESC, "Update DES and perturb") field(PREC, "7") # Disable BACT limits field(DOL1, "1") field(LNK1, "QUAD:LTUS:660:BLIMITS.VAL") # Update BDES with the BCTRL (slider) value field(DOL2, "QUAD:LTUS:660:BCTRL.VAL") field(LNK2, "QUAD:LTUS:660:BDES PP") field(DOL3, "1") field(LNK3, "QUAD:LTUS:660:IDIRECT.PROC PP") field(DOL4, "1") field(LNK4, "QUAD:LTUS:660:CHECKSTDZLOST.PROC PP") field(DOL5, "QUAD:LTUS:660:BCTRL.VAL") field(LNK5, "QUAD:LTUS:660:BCTRLSUB PP") # Re-enable BACT limits field(DOL6, "0") field(LNK6, "QUAD:LTUS:660:BLIMITS.VAL") } # Convert B-field to Current and output to ISETPT record(sub, "QUAD:LTUS:660:BCTRLSUB") { field(DESC, "Feedback") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:660:POLYCOEF") field(INPC, "QUAD:LTUS:660:POLYCOEF.A") field(INPD, "QUAD:LTUS:660:POLYCOEF.B") field(INPE, "QUAD:LTUS:660:BDES.DRVH") field(INPF, "QUAD:LTUS:660:BDES.DRVL") field(PREC, "7") field(EGU, "kG") field(HOPR, "67.2373") field(LOPR, "-67.2374") field(MDEL, "-1") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:660:ISETPT") } record(ao, "QUAD:LTUS:660:BDESPREVTRIM") { field(DESC, "trim bdes for undo") field(DTYP, "Soft Channel") field(DRVH, "67.2373") field(DRVL, "-67.2374") field(EGU, "kG") field(HOPR, "67.2373") field(LOPR, "-67.2374") field(PREC, "7") field(PINI, "YES") info(autosaveFields,"VAL") } record(stringin, "QUAD:LTUS:660:MADNAME") { field(DESC, "MAD deck nomenclature") field(PINI, "YES") field(VAL, "QEM3B") } record(ai, "QUAD:LTUS:660: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, "3417.675161") } record(ao, "QUAD:LTUS:660:BMAX") { field(DESC, "Max B-Field") field(DTYP, "Soft Channel") field(DRVH, "67.2373") field(DRVL, "-67.2374") field(EGU, "kG") field(HOPR, "67.2373") field(LOPR, "-67.2374") field(PREC, "7") field(PINI, "YES") field(VAL, "67.2373") field(FLNK, "QUAD:LTUS:660:BSTEP") } record(ao, "QUAD:LTUS:660:BMIN") { field(DESC, "Min B-Field") field(DTYP, "Soft Channel") field(DRVH, "67.2373") field(DRVL, "-67.2374") field(EGU, "kG") field(HOPR, "67.2373") field(LOPR, "-67.2374") field(PREC, "7") field(PINI, "YES") field(VAL, "-67.2374") field(FLNK, "QUAD:LTUS:660:BSTEP") } record(ao, "QUAD:LTUS:660:BDESSAVE") { field(DESC, "bdes for save/load") field(DTYP, "Soft Channel") field(DRVH, "67.2373") field(DRVL, "-67.2374") field(EGU, "kG") field(HOPR, "67.2373") field(LOPR, "-67.2374") field(PINI, "YES") field(PREC, "7") } # This record is processed by QUAD:LTUS:660: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, "QUAD:LTUS:660:BCON") { field(DESC, "Config B-Field ") field(DTYP, "Soft Channel") field(PREC, "7") field(EGU, "kG") field(HOPR, "67.2373") field(LOPR, "-67.2374") field(DRVH, "67.2373") field(DRVL, "-67.2374") # Set MINOR Alarm as the default, slaves will set NO_ALARM=0. field(HHSV, "MINOR") field(LLSV, "MINOR") field(HSV, "MINOR") field(LSV, "MINOR") # field(DOL , "") field(OMSL, "supervisory") field(OUT, "QUAD:LTUS:660:B2ICON PP") info(autosaveFields,"VAL") } record(sub, "QUAD:LTUS:660:B2ICON") { field(DESC, "Convert Desired ICon to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:660:POLYCOEF") field(INPC, "QUAD:LTUS:660:POLYCOEF.A") field(INPD, "QUAD:LTUS:660:POLYCOEF.B") field(PREC, "7") field(EGU, "kG") field(HOPR, "67.2373") field(LOPR, "-67.2374") field(MDEL, "-1") field(INPE, "QUAD:LTUS:660:BCON.DRVH") field(INPF, "QUAD:LTUS:660:BCON.DRVL") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:660: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, "QUAD:LTUS:660:BSTEP") { field(DESC, "B-Field step size") field(CALC, "(C==3)||(D==3)?0:ABS(A-B)*0.005") field(INPA, "QUAD:LTUS:660:BMAX") field(INPB, "QUAD:LTUS:660:BMIN") field(INPC, "QUAD:LTUS:660:BMIN.SEVR") field(INPD, "QUAD:LTUS:660:BMAX.SEVR") field(EGU, "kG") 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,"QUAD:LTUS:660:BCTRLDISABLECALC") { field(DESC, "Calc for disabling BCTRL") field(ASG, "Internal") field(CALC, "A?2:1") field(INPA, "QUAD:LTUS:660:ONLINE CP") field(OUT, "QUAD:LTUS:660:BCTRLDISABLEFOUT PP") } record(fanout, "QUAD:LTUS:660:BCTRLDISABLEFOUT") { field(DESC, "Disable BCTRL fanout") field(SELM, "Specified") field(SELL, "QUAD:LTUS:660:BCTRLDISABLECALC") field(LNK1, "QUAD:LTUS:660:BCTRLDISABLE") field(LNK2, "QUAD:LTUS:660:BCTRLENABLE") } record(stringout, "QUAD:LTUS:660:BCTRLDISABLE") { field(DESC, "Disable BCTRL") field(DTYP, "Soft Channel") field(OUT, "QUAD:LTUS:660:BCTRL.ASG") field(VAL, "NOWRITE") field(FLNK, "QUAD:LTUS:660:BCTRLDISV_UPDATE") } record(stringout, "QUAD:LTUS:660:BCTRLENABLE") { field(DESC, "Enable BCTRL") field(DTYP, "Soft Channel") field(OUT, "QUAD:LTUS:660:BCTRL.ASG") field(VAL, "") field(FLNK, "QUAD:LTUS:660:BCTRLDISV_UPDATE") } record(calcout, "QUAD:LTUS:660:BCTRLDISV_UPDATE") { field(DESC, "Calc for updating BCTRL.DISV") field(ASG, "Internal") field(CALC, "A") field(INPA, "QUAD:LTUS:660:ONLINE") field(OUT, "QUAD:LTUS:660: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,"QUAD:LTUS:660:BACT and MON\n are processed via links from \n QUAD:LTUS:660:IACT (device raw value readback 1)\n and\n QUAD:LTUS:660: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 QUAD:LTUS:660:POLYCOEF\nC = First polynomial coefficient (offset if linear)\nD = Second polynomial coefficient (slope if linear)\nE = QUAD:LTUS:660: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,"QUAD:LTUS:660:BDES\n is processed when set by CA users or \n QUAD:LTUS:660: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,"QUAD:LTUS:660: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 QUAD:LTUS:660: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 (QUAD:LTUS:660: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,"QUAD:LTUS:660:B*LIMITS and QUAD:LTUS:660:BLIMITS:\n Calculate alarm and warning limits based on \n deltas from QUAD:LTUS:660: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,"QUAD:LTUS:660: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,"QUAD:LTUS:660: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, "QUAD:LTUS:660: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, "QUAD:LTUS:660:MPSBTOL") { field(DESC, "Absolute mps tol") field(EGU, "kG") field(PREC, "2") field(CALC, "ABS(A)*0.02") field(INPA, "QUAD:LTUS:660:BMAX") field(PINI, "YES") } # # 21-Aug-2013: K. Luchini # Set channel access security so that users # cannot easily change values. record(ao, "QUAD:LTUS:660:MPSBMAX") { field(DESC, "MPS Max B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "67.2373") field(DRVL, "-67.2374") field(PINI, "YES") field(VAL, "67.2373") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:660:MPSBMIN") { field(DESC, "MPS Min B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "67.2373") field(DRVL, "-67.2374") field(PINI, "YES") field(VAL, "-67.2374") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:660:MPSBLLIM") { field(DESC, "MPS Low Limit B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "67.2373") field(DRVL, "-67.2374") field(PINI, "YES") field(VAL, "-67.2374") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:660:MPSBLLIM2") { field(DESC, "MPS Low Limit #2 B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "67.2373") field(DRVL, "-67.2374") field(PINI, "YES") field(VAL, "-67.2374") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } # Set the default to Std record(mbbo, "QUAD:LTUS:660: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, "QUAD:LTUS:660:MPSLIMITS.E PP") } record(aSub, "QUAD:LTUS:660: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, "QUAD:LTUS:660:MPS.RVAL") field(INPB, "QUAD:LTUS:660:BADIFF") field(INPC, "QUAD:LTUS:660:BDELTAS.N") field(INPD, "QUAD:LTUS:660:BACT") field(INPE, "QUAD:LTUS:660:MPSBITMASK.RVAL") field(INPF, "QUAD:LTUS:660:MPSBLLIM") field(INPG, "QUAD:LTUS:660:MPSBMIN") field(INPH, "QUAD:LTUS:660:MPSBMAX") field(INPI, "QUAD:LTUS:660: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, "QUAD:LTUS:660:INTOL.RVAL PP") field(OUTB, "QUAD:LTUS:660:INTOL_BMIN.RVAL PP") field(OUTC, "QUAD:LTUS:660:INTOL_BRANGE.RVAL PP") field(OUTD, "QUAD:LTUS:660: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, "QUAD:LTUS:660:INTOL") { field(DESC, "BACT within MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:660:MPSLIMITS.VALA") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "QUAD:LTUS:660:INTOL_BMIN") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:660:MPSLIMITS.VALB") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "QUAD:LTUS:660:INTOL_BMIN2") { field(DESC, "MPS tol #2") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:660:MPSLIMITS.VALD") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "QUAD:LTUS:660:INTOL_BRANGE") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:660: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, "QUAD:LTUS:660:CHCKITOL") { field(DESC, "Absolute Check I Tolerance") field(EGU, "A") field(FLNK, "QUAD:LTUS:660:TRIMITOL") field(CALC, "ABS(A*B)") field(INPA, "QUAD:LTUS:660:CHCKBTOL") field(INPB, "QUAD:LTUS:660:POLYCOEF.B") field(PREC, "9") } record(calc, "QUAD:LTUS:660:TRIMBTOL") { field(EGU, "kG") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(DESC, "Absolute Trim Tolerance") field(CALC, "ABS(A)/2") field(INPA, "QUAD:LTUS:660:CHCKBTOL") field(FLNK, "QUAD:LTUS:660:CHCKITOL") } record(calc, "QUAD:LTUS:660:CHCKBTOL") { field(DESC, "Check absolute tolerance") field(EGU, "A") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(FLNK, "QUAD:LTUS:660:TRIMBTOL") field(CALC, "MAX(ABS(A),ABS(C))*(B/1000000)") field(INPA, "QUAD:LTUS:660:BDES.HOPR") field(INPB, "QUAD:LTUS:660:STABILITY") field(INPC, "QUAD:LTUS:660:BDES.LOPR") } record(longout, "QUAD:LTUS:660: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, "QUAD:LTUS:660:CHCKBTOL") } record(calc, "QUAD:LTUS:660:TRIMITOL") { field(DESC, "Absolute Trim I Tolerance") field(EGU, "kG") field(CALC, "ABS(A*B)") field(INPA, "QUAD:LTUS:660:POLYCOEF.B") field(INPB, "QUAD:LTUS:660:TRIMBTOL") field(PREC, "9") } record(ai, "QUAD:LTUS:660:TRIMBTOLR") { field(DESC, "Relative trim tol") field(PREC, "4") field(EGU, "%") field(HOPR, "1.0") field(LOPR, "0.0") field(PINI, "YES") } record(ai, "QUAD:LTUS:660: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, "QUAD:LTUS:660:FBCKFCOM") { field(ZNAM, "CA") field(ONAM, "FCOM") field(DESC, "CA Mode") field(PINI, "YES") field(SDIS, "0") } record(bo, "QUAD:LTUS:660:PAU") { field(ZNAM, "NotConfigured") field(ONAM, "Configured") field(DESC, "PAU Present") field(PINI, "YES") field(SDIS, "0") field(FLNK, "QUAD:LTUS:660:PAUGO") } record(fanout, "QUAD:LTUS:660:PAUGO") { field(DESC, "PAU control") field(LNK1, "QUAD:LTUS:660:PAUSTOP") field(LNK2, "QUAD:LTUS:660: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, "QUAD:LTUS:660:PAUSTART") { field(DESC, "Setup for PAU On") field(SDIS, "QUAD:LTUS:660: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, "QUAD:LTUS:660:PAUSTOP") { field(DESC, "Setup for PAU Off") field(SDIS, "QUAD:LTUS:660: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, "QUAD:LTUS:660:MCORDEVNAME") { field(DESC, "PS device name") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, "PSC:LTUS:MG16:") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "QUAD:LTUS:660: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, "QUAD:LTUS:660:PSTYPE.RVAL") field(INPC, "QUAD:LTUS:660:TURNEDOFF.RVAL") field(INPD, "QUAD:LTUS:660:CONFIG.RVAL") field(INPE, "QUAD:LTUS:660:PSCATEGORY.RVAL") field(INPF, "QUAD:LTUS:660:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "QUAD:LTUS:660:AUTOCTRL.RVAL") field(INPJ, "QUAD:LTUS:660:OUTOFSERVICE.RVAL") field(INPL, "QUAD:LTUS:660:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "QUAD:LTUS:660:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "QUAD:LTUS:660:PAU") field(INPP, "QUAD:LTUS:660:CALBDISABLE.RVAL") field(INPQ, "QUAD:LTUS:660:PTRBDISABLE.RVAL") field(INPR, "QUAD:LTUS:660:TRIMDISABLE.RVAL") field(INPS, "QUAD:LTUS:660:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "QUAD:LTUS:660:FBCK") field(INPU, "QUAD:LTUS:660:TRIMTYPE.RVAL") field(INPV, "QUAD:LTUS:660:STDZDIRECT.RVAL") field(INPW, "QUAD:LTUS:660:DEGAUSENABLE.RVAL") field(FLNK, "QUAD:LTUS:660:HSTA") } record(longin, "QUAD:LTUS:660:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "QUAD:LTUS:660:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "QUAD:LTUS:660: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, "QUAD:LTUS:660: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, "QUAD:LTUS:660:CALBDISABLE") { field(DESC, "DAC Calb Disabled") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:660:PTRBDISABLE") { field(DESC, "Perturb Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:660:TRIMDISABLE") { field(DESC, "Trim Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:660: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 QUAD:LTUS:660:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses QUAD:LTUS:660:FBCK. # This PV should be replaced by QUAD:LTUS:660: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, "QUAD:LTUS:660: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, "QUAD:LTUS:660: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, "QUAD:LTUS:660: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, "") field(OMSL, "supervisory") field(FLNK, "QUAD:LTUS:660:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"QUAD:LTUS:660:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "QUAD:LTUS:660:OUTOFSERVICE NPP NMS") field(OUT, "QUAD:LTUS:660:ONLINE PP") } record(bo, "QUAD:LTUS:660:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "QUAD:LTUS:660: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, "1") } record(bo, "QUAD:LTUS:660: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, "1") } record(bo, "QUAD:LTUS:660: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, "QUAD:LTUS:660: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, "QUAD:LTUS:660: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, "QUAD:LTUS:660: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, "QUAD:LTUS:660: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, "QUAD:LTUS:660: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, "1") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:660: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, "1") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:660: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, "2") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:660: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, "0") field(ASG, "NOWRITE") field(FLNK, "QUAD:LTUS:660:TRIMTYPE") } record(stringout, "QUAD:LTUS:660:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "QUAD:LTUS:660:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "QUAD:LTUS:660:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "QUAD:LTUS:660:STATE.RVAL") field(INPB, "QUAD:LTUS:660:INTLKSUMY.RVAL") field(OUT, "QUAD:LTUS:660:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:LTUS:660: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, "QUAD:LTUS:660:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "QUAD:LTUS:660:STATE.RVAL") field(INPB, "QUAD:LTUS:660:INTLKSUMY.RVAL") field(OUT, "QUAD:LTUS:660:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:LTUS:660:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "QUAD:LTUS:660:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "QUAD:LTUS:660: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, "QUAD:LTUS:660:RAMPSTARTDLY") { field(DESC, "Tansition to ramp delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "2") } ######### For PSTYPE=2 Only ############# record(mbbo, "QUAD:LTUS:660: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, "QUAD:LTUS:660: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,"QUAD:LTUS:660: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("QUAD:LTUS:660:TURNEDOFF",3140,1907,0,1,"QUAD:LTUS:660:TURNEDOFF") #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "QUAD:LTUS:660:STATSUB") { field(DESC, "Build STATus ") field(INAM, "mgntInit") field(SNAM, "mgntSlcStat") field(INPA, "QUAD:LTUS:660:BACT.STAT") field(INPB, "QUAD:LTUS:660:BDES.STAT") field(INPC, "QUAD:LTUS:660:IRIPL.STAT") field(INPD, "PSC:LTUS:MG16:ISETPT.STAT") field(INPE, "PSC:LTUS:MG16:IACT.STAT") # 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, "QUAD:LTUS:660:BACT.SEVR") field(INPH, "QUAD:LTUS:660:BDES.SEVR") field(INPI, "QUAD:LTUS:660:IRIPL.SEVR") field(INPJ, "PSC:LTUS:MG16:ISETPT.SEVR") field(INPK, "PSC:LTUS:MG16:IACT.SEVR") # # 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, "QUAD:LTUS:660:STATE.RVAL") field(INPN, "QUAD:LTUS:660:STDZOK") field(INPO, "QUAD:LTUS:660:CALBOK") field(INPP, "QUAD:LTUS:660:OUTOFSERVICE.RVAL") field(INPQ, "QUAD:LTUS:660:CONFIG.RVAL") field(INPR, "QUAD:LTUS:660:HSTA") field(INPS, "QUAD:LTUS:660:CTRL.RVAL") field(INPT, "QUAD:LTUS:660:DEGAUSOK") field(INPV, "QUAD:LTUS:660: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, "QUAD:LTUS:660:STAT") } record(longout, "QUAD:LTUS:660:STAT") { field(DESC, "STAT sent to SLC") field(SCAN, "Passive") field(FLNK, "QUAD:LTUS:660:STATCTRLSUB") field(DOL, "QUAD:LTUS:660:STATSUB.VAL") field(OMSL, "closed_loop") } record(sSub, "QUAD:LTUS:660:STATCTRLSUB") { field(DESC, "Decode SLC STAT into mbbo") field(INAM, "mgntInit") field(SNAM, "mgntStatDecode") field(INPA, "QUAD:LTUS:660:STAT") field(INPB, "QUAD:LTUS:660:HSTA") field(INPD, "QUAD:LTUS:660:ONOFFCTRL.RVAL") field(FLNK, "QUAD:LTUS:660:STATMSG") } record(mbbo, "QUAD:LTUS:660: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, "QUAD:LTUS:660:UNAVAILGO") field(DOL, "QUAD:LTUS:660:STATCTRLSUB.W") } record(seq, "QUAD:LTUS:660:UNAVAILGO") { field(DESC, "Process UNAVAIL") field(DOL1, "QUAD:LTUS:660:STATSUB.U") field(LNK1, "QUAD:LTUS:660:UNAVAIL PP") } record(stringout, "QUAD:LTUS:660:SNLSTATMSG") { field(DTYP, "Soft Channel") } #! TextBox(TB0,820,1000,1200,1220,0,"Dialog",12,1,16777215,"QUAD:LTUS:660:STATUSSUB - future\nOverall device status - takes input from action snls, record sevrs, master snl(s) and outputs final status\n\nInputs:\nA - QUAD:LTUS:660:CTRLSTATUS - snl status\nB - MGNT:CTRLSTATUS - master list status\nC\nD - QUAD:LTUS:660: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,"QUAD:LTUS:660STATSUB\nformat control bo's into slc STAT\n\nInputs:\nA - QUAD:LTUS:660:STATUS\nC - QUAD:LTUS:660:ON\nD - QUAD:LTUS:660:STDZOK\nE - QUAD:LTUS:660:CALBOK\nF - QUAD:LTUS:660:BACTDRIFT (future)\nG -\nH- QUAD:LTUS:660:DACSTATUS\nI -QUAD:LTUS:660:ADCSTATUS\nJ - QUAD:LTUS:660:BACTSTATUS\nK - QUAD:LTUS:660:BDESSTATUS\nL - QUAD:LTUS:660:RIPLSTATUS\n\nOutput:\nP - QUAD:LTUS:660: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, "QUAD:LTUS:660: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, "QUAD:LTUS:660: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, "QUAD:LTUS:660: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, "QUAD:LTUS:660: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.6 #! DBDSTART #! DBD("../../../../dbd/mgntSoft.dbd") #! DBDEND record(stringout, "QUAD:LTUS:660:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:660:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "QUAD:LTUS:660:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "QUAD:LTUS:660:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "QUAD:LTUS:660:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "QUAD:LTUS:660:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "1") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "QUAD:LTUS:660: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, "QUAD:LTUS:660:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "QUAD:LTUS:660:TRIMTYPE.RVAL") field(INPB, "QUAD:LTUS:660:CONFIG.RVAL") field(OUT, "QUAD:LTUS:660:TRIMMAXNUM PP") } record(longout, "QUAD:LTUS:660: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, "QUAD:LTUS:660: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, "") field(OMSL, "supervisory") field(VAL, "20") field(OUT, "QUAD:LTUS:660:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "QUAD:LTUS:660: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, "") field(OMSL, "supervisory") field(VAL, "10") } record(bo, "QUAD:LTUS:660: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, "QUAD:LTUS:660: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, "QUAD:LTUS:660: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, "QUAD:LTUS:660:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "0") } record(ao, "QUAD:LTUS:660: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, "QUAD:LTUS:660:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "QUAD:LTUS:660: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, "QUAD:LTUS:660: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, "QUAD:LTUS:660:IMOVE") field(INPB, "QUAD:LTUS:660:IACT") field(INPC, "QUAD:LTUS:660:IRAMPRATE") field(INPD, "1.577") field(INPE, "QUAD:LTUS:660:TRIMDLYPCT") field(INPF, "QUAD:LTUS:660:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "QUAD:LTUS:660:RAMPTIME_LEFT PP") } record(longout, "QUAD:LTUS:660:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "QUAD:LTUS:660:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "QUAD:LTUS:660:RAMPDONE_CALC") } record(calc, "QUAD:LTUS:660:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "QUAD:LTUS:660:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "QUAD:LTUS:660:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "QUAD:LTUS:660: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, "QUAD:LTUS:660:RAMPTIME_LEFT") field(OUT, "QUAD:LTUS:660:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "QUAD:LTUS:660:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "QUAD:LTUS:660:RAMPTIME_LEFT NMS") field(OUT, "QUAD:LTUS:660:RAMPDONE PP") } record(bo, "QUAD:LTUS:660:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "QUAD:LTUS:660:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "QUAD:LTUS:660: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, "QUAD:LTUS:660: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(sSub, "QUAD:LTUS:660: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, "QUAD:LTUS:660:PSTYPE.RVAL") field(INPC, "QUAD:LTUS:660:TURNEDOFF.RVAL") field(INPD, "QUAD:LTUS:660:CONFIG.RVAL") field(INPE, "QUAD:LTUS:660:PSCATEGORY.RVAL") field(INPF, "QUAD:LTUS:660:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "QUAD:LTUS:660:AUTOCTRL.RVAL") field(INPJ, "QUAD:LTUS:660:OUTOFSERVICE.RVAL") field(INPL, "QUAD:LTUS:660:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "QUAD:LTUS:660:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "QUAD:LTUS:660:PAU") field(INPP, "QUAD:LTUS:660:CALBDISABLE.RVAL") field(INPQ, "QUAD:LTUS:660:PTRBDISABLE.RVAL") field(INPR, "QUAD:LTUS:660:TRIMDISABLE.RVAL") field(INPS, "QUAD:LTUS:660:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "QUAD:LTUS:660:FBCK") field(INPU, "QUAD:LTUS:660:TRIMTYPE.RVAL") field(INPV, "QUAD:LTUS:660:STDZDIRECT.RVAL") field(INPW, "QUAD:LTUS:660:DEGAUSENABLE.RVAL") field(FLNK, "QUAD:LTUS:660:HSTA") } record(longin, "QUAD:LTUS:660:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "QUAD:LTUS:660:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "QUAD:LTUS:660: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, "QUAD:LTUS:660: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, "QUAD:LTUS:660:CALBDISABLE") { field(DESC, "DAC Calb Disabled") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:660:PTRBDISABLE") { field(DESC, "Perturb Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:660:TRIMDISABLE") { field(DESC, "Trim Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:660:STDZDISABLE") { field(DTYP, "Raw Soft Channel") field(ZNAM, "NO") field(ONAM, "YES") field(DESC, "Standardize Function") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } # This PV has been replaced by QUAD:LTUS:660:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses QUAD:LTUS:660:FBCK. # This PV should be replaced by QUAD:LTUS:660: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, "QUAD:LTUS:660: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, "QUAD:LTUS:660: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, "QUAD:LTUS:660: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, "") field(OMSL, "supervisory") field(FLNK, "QUAD:LTUS:660:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"QUAD:LTUS:660:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "QUAD:LTUS:660:OUTOFSERVICE NPP NMS") field(OUT, "QUAD:LTUS:660:ONLINE PP") } record(bo, "QUAD:LTUS:660:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "QUAD:LTUS:660: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, "1") } record(bo, "QUAD:LTUS:660: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, "1") } record(bo, "QUAD:LTUS:660: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, "QUAD:LTUS:660: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, "QUAD:LTUS:660: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, "QUAD:LTUS:660: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, "QUAD:LTUS:660: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, "QUAD:LTUS:660: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, "1") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:660: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, "1") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:660: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, "2") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:660: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, "0") field(ASG, "NOWRITE") field(FLNK, "QUAD:LTUS:660:TRIMTYPE") } record(stringout, "QUAD:LTUS:660:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "QUAD:LTUS:660:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "QUAD:LTUS:660:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "QUAD:LTUS:660:STATE.RVAL") field(INPB, "QUAD:LTUS:660:INTLKSUMY.RVAL") field(OUT, "QUAD:LTUS:660:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:LTUS:660: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, "QUAD:LTUS:660:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "QUAD:LTUS:660:STATE.RVAL") field(INPB, "QUAD:LTUS:660:INTLKSUMY.RVAL") field(OUT, "QUAD:LTUS:660:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:LTUS:660:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "QUAD:LTUS:660:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "QUAD:LTUS:660: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, "QUAD:LTUS:660:RAMPSTARTDLY") { field(DESC, "Tansition to ramp delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "2") } ######### For PSTYPE=2 Only ############# record(mbbo, "QUAD:LTUS:660: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, "QUAD:LTUS:660: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,"QUAD:LTUS:660: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("QUAD:LTUS:660:TURNEDOFF",3140,1907,0,1,"QUAD:LTUS:660:TURNEDOFF") #! 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, "QUAD:LTUS:680:IACT") { field(DESC, "Current") field(INP, "PSC:LTUS:MG17:IACT") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "QUAD:LTUS:680:BACT") info(autosaveFields,"HYST") } record(bi, "QUAD:LTUS:680:STATE") { field(DESC, "PS On/Off Status") field(DTYP, "Raw Soft Channel") field(INP, "PSC:LTUS:MG17:STATE NPP MS") field(ZSV, "MAJOR") field(ZNAM, "OFF") field(ONAM, "ON") } record(ao, "QUAD:LTUS:680:IDES") { field(DESC, "Desired Current") field(PREC, "3") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(MDEL, "-1") field(HIHI, "120.0") field(LOLO, "-120.0") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "QUAD:LTUS:680:BDELTAS") field(DRVH, "120.0") field(DRVL, "-120.0") field(DOL, "QUAD:LTUS:680: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, "QUAD:LTUS:680:ICTRL PP") } # This record is processed by QUAD:LTUS:680:ICON") # Note: we are not setting alarms here. record(ao, "QUAD:LTUS:680:ICON") { field(DESC, "Config I") field(DTYP, "Soft Channel") field(PREC, "3") field(HOPR, "120.0") field(LOPR, "-120.0") field(DRVH, "120.0") field(DRVL, "-120.0") field(DOL, "QUAD:LTUS:680:B2ICON.K") field(OMSL, "closed_loop") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:680:INOM") { field(DESC, "Nominal Current") field(DOL, "QUAD:LTUS:680:BNOM.K") field(OMSL, "closed_loop") field(PREC, "3") field(EGU, "A") field(DRVH, "120.0") field(DRVL, "-120.0") field(HOPR, "120.0") field(LOPR, "-120.0") } record(ao, "QUAD:LTUS:680:ICTRL") { field(DESC, "Set Current") field(PREC, "3") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(DRVH, "120.0") field(DRVL, "-120.0") field(MDEL, "-1") field(FLNK, "QUAD:LTUS:680:ICTRLGO") field(OMSL, "supervisory") info(autosavefields,"VAL") } record(seq, "QUAD:LTUS:680:ICTRLGO") { field(DESC, "Process Current Setpoint") field(PREC, "3") # Set ISETPT to supervisory field(DOL1, "0") field(LNK1, "QUAD:LTUS:680:ISETPT.OMSL") field(DOL2, "QUAD:LTUS:680:ICTRL") field(LNK2, "QUAD:LTUS:680:ISETPT PP") # Set ISETPT to closed loop - get data from BCTRLSUB.K field(DOL3, "1") field(LNK3, "QUAD:LTUS:680:ISETPT.OMSL") } record(ao, "QUAD:LTUS:680:IMAX") { field(DESC, "Max I") field(DTYP, "Soft Channel") field(DRVH, "120.0") field(DRVL, "-120.0") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(PREC, "3") field(PINI, "YES") field(VAL, "120.0") field(FLNK, "QUAD:LTUS:680:IMIN") } record(ao, "QUAD:LTUS:680:IMIN") { field(DESC, "Min I") field(DTYP, "Soft Channel") field(DRVH, "120.0") field(DRVL, "-120.0") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(PREC, "3") field(VAL, "-120.0") field(FLNK, "QUAD:LTUS:680:IRANGE") } record(sel, "QUAD:LTUS:680:IACTPREVOK") { field(DESC, "Last Good Current") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(PREC, "3") field(NVL, "QUAD:LTUS:680:BACT.SEVR") field(INPA, "QUAD:LTUS:680:IACT NPP MS") field(INPB, "QUAD:LTUS:680:IACTPREVOK NPP MS") field(INPC, "QUAD:LTUS:680:IACTPREVOK NPP MS") field(INPD, "QUAD:LTUS:680:IACTPREVOK NPP MS") } record(sub, "QUAD:LTUS:680:IACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:680:IDES") field(INPB, "QUAD:LTUS:680:ISETPT.DRVH") field(INPC, "QUAD:LTUS:680:ISETPT.DRVL") field(INPD, "QUAD:LTUS:680:IDELTAS.I") field(INPE, "QUAD:LTUS:680:IDELTAS.J") field(INPG, "QUAD:LTUS:680:STATE") field(INPH, "QUAD:LTUS:680:HSTA") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(PREC, "3") field(BRSV, "INVALID") } record(sub, "QUAD:LTUS:680:IMONLIMITS") { field(DESC, "Aux Current Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:680:IDES") field(INPB, "QUAD:LTUS:680:ISETPT.DRVH") field(INPC, "QUAD:LTUS:680:ISETPT.DRVL") field(INPD, "QUAD:LTUS:680:IDELTAS.K") field(INPE, "QUAD:LTUS:680:IDELTAS.L") field(INPG, "QUAD:LTUS:680:STATE") field(INPH, "QUAD:LTUS:680:HSTA") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(PREC, "3") field(BRSV, "INVALID") } record(seq, "QUAD:LTUS:680:ILIMITS") { field(DESC, "Set ACT and MON Limits") field(PREC, "3") field(DOL1, "QUAD:LTUS:680:BLIMITS") field(LNK1, "QUAD:LTUS:680:IACTLIMITS.F PP") field(DOL2, "QUAD:LTUS:680:IACTLIMITS.I") field(LNK2, "QUAD:LTUS:680:IACT.HIGH") field(DOL3, "QUAD:LTUS:680:IACTLIMITS.J") field(LNK3, "QUAD:LTUS:680:IACT.LOW") field(DOL4, "QUAD:LTUS:680:IACTLIMITS.K") field(LNK4, "QUAD:LTUS:680:IACT.HIHI") field(DOL5, "QUAD:LTUS:680:IACTLIMITS.L") field(LNK5, "QUAD:LTUS:680:IACT.LOLO") field(DOL6, "QUAD:LTUS:680:BLIMITS") field(LNK6, "QUAD:LTUS:680:IMONLIMITS.F PP") field(DOL7, "QUAD:LTUS:680:IMONLIMITS.I") field(LNK7, "QUAD:LTUS:680:IMON.HIGH") field(DOL8, "QUAD:LTUS:680:IMONLIMITS.J") field(LNK8, "QUAD:LTUS:680:IMON.LOW") field(DOL9, "QUAD:LTUS:680:IMONLIMITS.K") field(LNK9, "QUAD:LTUS:680:IMON.HIHI") field(DOLA, "QUAD:LTUS:680:IMONLIMITS.L") field(LNKA, "QUAD:LTUS:680: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, "QUAD:LTUS:680:IDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntRawDeltas") field(INPD, "QUAD:LTUS:680:TRIMBTOL") field(INPE, "QUAD:LTUS:680:CHCKBTOL") field(INPF, "QUAD:LTUS:680:BDELTAS.K") field(INPG, "QUAD:LTUS:680:BDELTAS.L") field(INPH, "QUAD:LTUS:680: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, "QUAD:LTUS:680:STDZITOLR") field(INPC, "QUAD:LTUS:680:STDZITOL") field(FLNK, "") } # All ps controllers with on/off control will set the macro ONOF # as follows: # # ONOF = PSC:LTUS:MG17: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, "QUAD:LTUS:680:STATESETPT") { field(DESC, "PS On/Off") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFF") field(ONAM, "ON") field(OUT, "PSC:LTUS:MG17:STATESETPT PP") 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 = PSC:LTUS:MG17:RESET PP # record(bo, "QUAD:LTUS:680:RESET") { field(DESC, "Interlock Latch Reset") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFF") field(ONAM, "ON") field(HIGH, "1.0") field(OUT, "PSC:LTUS:MG17:RESET PP") } record(bo, "QUAD:LTUS:680:RAMPSTATE") { field(DESC, "PS Ramp Status") field(DTYP, "Soft Channel") field(DOL, "PSC:LTUS:MG17:RAMPSTATE NPP 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, "QUAD:LTUS:680: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, "QUAD:LTUS:680:TRIMRAMPRATE") field(OUT, "PSC:LTUS:MG17:IRAMPRATE PP") field(FLNK, "QUAD:LTUS:680:STDZDLY") } record(ao, "QUAD:LTUS:680:ISETPT") { field(DESC, "Current Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(DRVH, "120.0") field(DRVL, "-120.0") field(MDEL, "-1") field(OUT, "PSC:LTUS:MG17:ISETPT PP") field(DOL, "QUAD:LTUS:680: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, "QUAD:LTUS:680:IMON") { field(DESC, "Aux Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(INP, "PSC:LTUS:MG17:IMON") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "QUAD:LTUS:680:BMON") } record(ao, "QUAD:LTUS:680:IRIPL") { field(DESC, "Ripple Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(DOL, "PSC:LTUS:MG17:IRIPL NPP NMS") field(OMSL, "closed_loop") field(EGU, "A") field(DRVH, "1.0") field(HOPR, "1.0") field(PREC, "3") field(FLNK, "QUAD:LTUS:680:IRIPLOK") } record(sub, "QUAD:LTUS:680:IRIPLOK") { field(DESC, "Ripple Current Status") field(INAM, "mgntInit") field(SNAM, "mgntRiplOK") field(INPA, "QUAD:LTUS:680:IRIPL.VAL") field(INPB, "QUAD:LTUS:680: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, "QUAD:LTUS:680:R") { field(DESC, "Resistance") field(EGU, "Ohms") field(PREC, "4") field(PINI, "YES") field(DOL, "PSC:LTUS:MG17:R NPP MS") 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, "QUAD:LTUS:680:IGND") { field(DESC, "Ground Current") field(EGU, "A") field(PREC, "6") field(PINI, "YES") field(DOL, "PSC:LTUS:MG17:IGND NPP MS") field(OMSL, "closed_loop") } record(bi, "QUAD:LTUS:680:INTLKSUMY") { field(DESC, "Interlock Summary") field(INP, "PSC:LTUS:MG17:INTLKSUMY NPP MS") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(ZNAM, "OK") field(ONAM, "FAULT") field(PINI, "NO") } record(mbbo, "QUAD:LTUS:680: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, "PSC:LTUS:MG17:COOLING") field(OMSL, "closed_loop") } # The following PV is processed by :BACTFO # which is processed by :BACT record(fanout, "QUAD:LTUS:680:IACTFO") { field(DESC, "IACT processing") field(SELM, "All") field(LNK1, "QUAD:LTUS:680:IACTPREVOK") field(LNK2, "QUAD:LTUS:680:IDIFF") field(LNK3, "QUAD:LTUS:680:IADIFF") field(LNK4, "QUAD:LTUS:680:IRATIO") field(LNK5, "QUAD:LTUS:680:IDIRECT") field(LNK6, "QUAD:LTUS:680:IACTPOL_CHECK") } record(calc, "QUAD:LTUS:680:IDIFF") { field(DESC, "IDES-IACT") field(CALC, "A-B") field(INPA, "QUAD:LTUS:680:IDES") field(INPB, "QUAD:LTUS:680:IACT") field(EGU, "A") field(PREC, "9") field(HOPR, "120.0") field(LOPR, "-120.0") } record(calc, "QUAD:LTUS:680:IADIFF") { field(DESC, "Absolute IDES-IACT") field(CALC, "A<0?ABS(A):A") field(INPA, "QUAD:LTUS:680:IDIFF") field(PREC, "9") } record(calc, "QUAD:LTUS:680:IRATIO") { field(DESC, "IDES-IACT/IMAX") field(CALC, "B?A/B:0") field(INPA, "QUAD:LTUS:680:IDIFF") field(INPB, "QUAD:LTUS:680:IDES.DRVH") field(PREC, "9") } record(calcout, "QUAD:LTUS:680:IRANGE") { field(DESC, "Current Range") field(PINI, "YES") field(CALC, "ABS(A-B)") field(INPA, "QUAD:LTUS:680:IMIN") field(INPB, "QUAD:LTUS:680: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, "QUAD:LTUS:680: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, "QUAD:LTUS:680:IACT") field(FLNK, "QUAD:LTUS:680:IACTPOL") } record(bo, "QUAD:LTUS:680:IACTPOL") { field(DESC, "Actual I Polarity") field(DTYP, "Raw Soft Channel") field(DOL, "QUAD:LTUS:680: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,"QUAD:LTUS:680:I*LIMITS:\n Calculate alarm and warning limits based on \n deltas from QUAD:LTUS:680:IDELTAS and the\n QUAD:LTUS:680: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,"QUAD:LTUS:680:IACT: \n Get copy of QUAD:LTUS:680:I. \n",null) #! TextBox(TB12,1280,3100,1760,3200,0,"Dialog",12,1,16777215,"QUAD:LTUS:680: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,"QUAD:LTUS:680:IDES:\n Contains raw value calculated by \nQUAD:LTUS:680: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 \nQUAD:LTUS:680:BDELTAS.\n",null) #! TextBox(TB10,56,1940,316,2340,0,"Dialog",12,1,16777215,"QUAD:LTUS:680: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 QUAD:LTUS:680: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 QUAD:LTUS:680: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,"QUAD:LTUS:680:ISETPT:\n Sets the hardware. When fast feedback is set on, this record is\n set to closed loop mode by QUAD:LTUS:680:FBCKSTART sequence. When \n the loop is closed, this record takes input calculated by \n BFBCK only. When fast feedback is set off, QUAD:LTUS:680:FBCKSTOP \n will set it back to supervisory so that the value can be set by \n QUAD:LTUS:680: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, "QUAD:LTUS:680:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:680:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "QUAD:LTUS:680:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "QUAD:LTUS:680:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "QUAD:LTUS:680:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "QUAD:LTUS:680:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "1") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "QUAD:LTUS:680: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, "QUAD:LTUS:680:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "QUAD:LTUS:680:TRIMTYPE.RVAL") field(INPB, "QUAD:LTUS:680:CONFIG.RVAL") field(OUT, "QUAD:LTUS:680:TRIMMAXNUM PP") } record(longout, "QUAD:LTUS:680: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, "QUAD:LTUS:680: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, "") field(OMSL, "supervisory") field(VAL, "10") field(OUT, "QUAD:LTUS:680:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "QUAD:LTUS:680: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, "") field(OMSL, "supervisory") field(VAL, "10") } record(bo, "QUAD:LTUS:680: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, "QUAD:LTUS:680: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, "QUAD:LTUS:680: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, "QUAD:LTUS:680:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "0") } record(ao, "QUAD:LTUS:680: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, "QUAD:LTUS:680:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "QUAD:LTUS:680: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, "QUAD:LTUS:680: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, "QUAD:LTUS:680:IMOVE") field(INPB, "QUAD:LTUS:680:IACT") field(INPC, "QUAD:LTUS:680:IRAMPRATE") field(INPD, "1.577") field(INPE, "QUAD:LTUS:680:TRIMDLYPCT") field(INPF, "QUAD:LTUS:680:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "QUAD:LTUS:680:RAMPTIME_LEFT PP") } record(longout, "QUAD:LTUS:680:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "QUAD:LTUS:680:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "QUAD:LTUS:680:RAMPDONE_CALC") } record(calc, "QUAD:LTUS:680:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "QUAD:LTUS:680:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "QUAD:LTUS:680:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "QUAD:LTUS:680: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, "QUAD:LTUS:680:RAMPTIME_LEFT") field(OUT, "QUAD:LTUS:680:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "QUAD:LTUS:680:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "QUAD:LTUS:680:RAMPTIME_LEFT NMS") field(OUT, "QUAD:LTUS:680:RAMPDONE PP") } record(bo, "QUAD:LTUS:680:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "QUAD:LTUS:680:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "QUAD:LTUS:680: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, "QUAD:LTUS:680: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, "QUAD:LTUS:680:STDZINIT") { field(DESC, "Proc. Stdz PVs on boot") field(PINI, "YES") field(DOL1, "1") field(DOL2, "1") field(DOL3, "1") field(LNK1, "QUAD:LTUS:680:DEBUG.PROC PP") field(LNK2, "QUAD:LTUS:680:STDZCYCLENUM.PROC PP") field(LNK3, "QUAD:LTUS:680:STDZDISABLE.PROC PP") field(LNK4, "QUAD:LTUS:680: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, "QUAD:LTUS:680:STDZSUB") { field(DESC, "Stdz subroutine") field(INAM, "mgntStdzInit") field(SNAM, "mgntStdz") field(BRSV, "INVALID") field(INPA, "QUAD:LTUS:680:STDZIMIN NPP NMS") field(INPB, "QUAD:LTUS:680:STDZIMAX NPP NMS") field(INPC, "QUAD:LTUS:680:STDZIFINAL NPP NMS") field(INPD, "QUAD:LTUS:680:STDZCYCLENUM NPP NMS") field(INPE, "QUAD:LTUS:680:STDZDIRECT.RVAL NPP NMS") field(INPF, "QUAD:LTUS:680:STDZDISABLE.RVAL CPP NMS") field(INPG, "QUAD:LTUS:680: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, "QUAD:LTUS:680:STDZWF PP") field(OUTB, "QUAD:LTUS:680: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, "QUAD:LTUS:680:STDZWF") } record(mbbo, "QUAD:LTUS:680: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, "QUAD:LTUS:680: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, "QUAD:LTUS:680:STDZMAINPS") { field(DESC, "Stdz by main or self") field(PINI, "YES") field(DTYP, "Soft Channel") field(ZNAM, "SELF") field(ONAM, "MAIN") } record(bo, "QUAD:LTUS:680: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, "QUAD:LTUS:680: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, "QUAD:LTUS:680: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, "QUAD:LTUS:680:STDZTOD") { field(DESC, "Successful Standardize Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "QUAD:LTUS:680:STDZLOSTTOD") { field(DESC, "Standardize Lost Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(longout, "QUAD:LTUS:680:STDZCYCLECNT") { field(DESC, "Cycle Count") field(PINI, "YES") } record(longout, "QUAD:LTUS:680:STDZCYCLENUM") { field(DESC, "No. Standardize Cycles") field(VAL, "3") field(HOPR, "10") field(LOPR, "0") field(DRVH, "10") field(DRVL, "0") field(PINI, "YES") field(FLNK, "QUAD:LTUS:680:STDZDIRECT") } # The default standardize direction is "UP" for # all LCLS Magnets.. record(bo, "QUAD:LTUS:680:STDZDIRECT") { field(DESC, "Standardize Direction ") field(ZNAM, "UP") field(ONAM, "DOWN") field(VAL, "0") field(FLNK, "QUAD:LTUS:680:STDZIMIN") } record(ao, "QUAD:LTUS:680:STDZIMIN") { field(DESC, "Min-STDZ Current") field(PREC, "1") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(VAL, "-120.0") field(FLNK, "QUAD:LTUS:680:STDZIMAX") } record(ao, "QUAD:LTUS:680:STDZIMAX") { field(DESC, "Max. Standarize Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(VAL, "120.0") field(FLNK, "QUAD:LTUS:680:STDZIFINAL") } record(ao, "QUAD:LTUS:680:STDZIFINAL") { field(DESC, "Final SDTZ Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(VAL, "-120.0") field(FLNK, "QUAD:LTUS:680: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, "QUAD:LTUS:680: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, "QUAD:LTUS:680:STDZITOL") { field(DESC, "Stdz min tolerance") field(PREC, "5") field(CALC, "MAX(ABS(A),ABS(B))*C") field(INPA, "QUAD:LTUS:680:STDZIMIN CP NMS") field(INPB, "QUAD:LTUS:680:STDZIMAX CP MMS") field(INPC, "0.05") field(INPD, "QUAD:LTUS:680:STDZITOLR CP MMS") field(EGU, "A") field(FLNK, "QUAD:LTUS:680:IDELTAS") field(PINI, "YES") } # D - factor (3.154/2 = 1.577) for EPSC, otherwise, set to 1.0 record(calc, "QUAD:LTUS:680:STDZDLY") { field(DESC, "Ramp time for stdz cycle") field(CALC, "C>0?MAX(1,ABS((A-B)/C)*D):0") field(INPA, "QUAD:LTUS:680:STDZIMIN CP NMS") field(INPB, "QUAD:LTUS:680:STDZIMAX CP NMS") field(INPC, "QUAD:LTUS:680:TRIMRAMPRATE CP NMS") field(INPD, "1.577") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") } record(calc, "QUAD:LTUS:680:STDZRAMPDLY") { field(DESC, "Ramp delay total") field(CALC, "MAX(1,((A/100)*B+B))") field(PREC, "5") field(INPA, "QUAD:LTUS:680:TRIMDLYPCT CP MS") field(INPB, "QUAD:LTUS:680: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, "QUAD:LTUS:680:STDZMINIDLY") { field(DESC, "Mini-stdz delay") field(CALC, "A") field(PREC, "5") field(A, "1.0") field(EGU, "sec") field(PINI, "YES") } record(ao, "QUAD:LTUS:680: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, "QUAD:LTUS:680:STDZMINIDELTA") { field(DESC, "Stdz mini % of IMAX") field(CALC, "(B/100)*(A-C)") field(INPA, "QUAD:LTUS:680:IDES.HOPR") field(INPB, "QUAD:LTUS:680:STDZMINIPCT CPP NMS") field(INPC, "QUAD:LTUS:680:IDES.LOPR") field(PREC, "5") } record(calc, "QUAD:LTUS:680:STDZMINISETPT") { field(DESC, "Mini Stdz delta") field(CALC, "C==0?MAX(E-D,B):MIN(E+D,A)") field(INPA, "QUAD:LTUS:680:IDES.HOPR") field(INPB, "QUAD:LTUS:680:IDES.LOPR") field(INPC, "QUAD:LTUS:680:STDZDIRECT.RVAL") field(INPD, "QUAD:LTUS:680:STDZMINIDELTA") field(INPE, "QUAD:LTUS:680:IDES") field(PREC, "5") field(FLNK, "QUAD:LTUS:680: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, "QUAD:LTUS:680:STDZMINISETPTOOR") { field(DESC, "Mini Stdz setpoint out of range") field(CALC, "C==0?(E-DA)") field(INPA, "QUAD:LTUS:680:IDES.HOPR") field(INPB, "QUAD:LTUS:680:IDES.LOPR") field(INPC, "QUAD:LTUS:680:STDZDIRECT.RVAL") field(INPD, "QUAD:LTUS:680:STDZMINIDELTA") field(INPE, "QUAD:LTUS:680: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, "QUAD:LTUS:680: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, "QUAD:LTUS:680:IADJUST.RVAL") field(INPB, "QUAD:LTUS:680:STDZDIRECT.RVAL") field(INPC, "QUAD:LTUS:680:STDZOK.RVAL") field(INPD, "QUAD:LTUS:680:STDZDISABLE.RVAL") field(INPE, "QUAD:LTUS:680:STATE.RVAL CPP NMS") field(INPF, "QUAD:LTUS:680:ICTRL.RVAL") field(INPG, "QUAD:LTUS:680:STATE.SEVR") field(INPH, "QUAD:LTUS:680:BDELTAS.M") field(INPI, "QUAD:LTUS:680:IACT.SEVR") field(OUT, "QUAD:LTUS:680:STDZLOSTGO.SELN PP NMS") field(OOPT, "Transition To Non-zero") } record(seq, "QUAD:LTUS:680:STDZLOSTGO") { field(DESC, "Process lost stdz") field(SELM, "Mask") field(DOL1, "1") field(DOL2, "0") field(LNK1, "QUAD:LTUS:680:STDZLOSTTOD.PROC") field(LNK2, "QUAD:LTUS:680:STDZOK PP") } # Record maximum current after standardize # Reset to IACT from sequence after trim # Disable processing during (mini-)standardize or trim record(calc, "QUAD:LTUS:680:STDZIACTMAX") { field(DESC, "Max act current after stdz") field(CALC, "MAX(A, B)") field(DISV, "0") field(SDIS, "QUAD:LTUS:680:CHECKPWRDIP_ENABLE") field(INPA, "QUAD:LTUS:680:IACT CP") field(INPB, "QUAD:LTUS:680:STDZIACTMAX") field(EGU, "A") field(FLNK, "QUAD:LTUS:680:CHECKPWRDIP") } # Detect power dip if STDZOK is YES, STDZ is enabled, and IACT is valid # If IACT drops below STDZIACTMAX by more than the trim tolerance, clear STDZOK # Warning: Take the absolute value of the trim tolerance, or else quads of # negative polarity will always lose STDZ since their IDELTAS.I are negative. # Note: Large quads and bends are prone to losing STDZ even if they are # perturbed toward higher current since their current tends to overshoot # by greater than the trim tolerance before settling down. record(calcout, "QUAD:LTUS:680:CHECKPWRDIP") { field(DESC, "Detect power dip") field(CALC, "(A-B>ABS(C))?3:0") field(DISV, "0") field(SDIS, "QUAD:LTUS:680:CHECKPWRDIP_ENABLE") field(INPA, "QUAD:LTUS:680:STDZIACTMAX") field(INPB, "QUAD:LTUS:680:IACT") field(INPC, "QUAD:LTUS:680:IDELTAS.I") field(OUT, "QUAD:LTUS:680:STDZLOSTGO.SELN PP NMS") field(OOPT, "When Non-zero") } # Enable processing of STDZIACTMAX and CHECKPWRDIP only if # STDZOK = YES, STDZDISABLE = NO, CTRL != Trim (2), and # CTRL != Stdz (4) record(calc, "QUAD:LTUS:680:CHECKPWRDIP_ENABLE") { field(CALC, "A&&!B&&(C#2)&&(C#4)") field(INPA, "QUAD:LTUS:680:STDZOK.RVAL CP") field(INPB, "QUAD:LTUS:680:STDZDISABLE.RVAL CP") field(INPC, "QUAD:LTUS:680:CTRL.RVAL CP") } #! 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, "QUAD:LTUS:680: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, "QUAD:LTUS:680:CALBOK") { field(DESC, "Successful Calibration") field(DTYP, "Raw Soft Channel") field(ZNAM, "NO") field(ONAM, "YES") field(DOL, "PSC:LTUS:MG17:CALBOK.RVAL") field(OMSL, "closed_loop") 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, "QUAD:LTUS:680:CALBSET") { field(DESC, "Use DAC Calbration") field(SCAN, "10 second") field(CALC, "A&&(B==0)&&C?31:960") field(INPA, "QUAD:LTUS:680:CALBOK") field(INPB, "QUAD:LTUS:680:CALBDISABLE") field(INPC, "QUAD:LTUS:680:CALBSLOPE") field(OOPT, "On Change") field(OUT, "QUAD:LTUS:680: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, "QUAD:LTUS:680:CALB_SEQ") { field(DESC, "Output Calib Values") field(SELM, "Mask") field(SELL, "QUAD:LTUS:680: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, "QUAD:LTUS:680:CALBSLOPE") field(DOL3, "QUAD:LTUS:680: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, "QUAD:LTUS:680:CALBTOD") { field(DESC, "Calibration Success Time") field(PINI, "YES") field(DOL, "PSC:LTUS:MG17:CALBTOD") field(OMSL, "closed_loop") field(DTYP, "Soft Channel") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:680: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, "QUAD:LTUS:680: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, "QUAD:LTUS:680: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, "QUAD:LTUS:680:CALBOFFSET") { field(DESC, "Calc DAC Offset") field(PREC, "6") field(EGU, "Counts") field(PINI, "YES") } record(bo, "QUAD:LTUS:680: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, "QUAD:LTUS:680:DACSLOPE") { field(DESC, "V to DAC slope") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "closed_loop") field(PINI, "YES") field(FLNK, "QUAD:LTUS:680:DACOFFSET") } # Default Offset used in conversion from Volts to DAC Counts record(ao, "QUAD:LTUS:680:DACOFFSET") { field(DESC, "V to DAC offset") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "closed_loop") field(PINI, "YES") field(FLNK, "QUAD:LTUS:680: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, "QUAD:LTUS:680: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, "QUAD:LTUS:680:IACT") field(INPD, "QUAD:LTUS:680:DACSLOPE") field(INPE, "QUAD:LTUS:680:DACOFFSET") field(EGU, "Counts") field(PREC, "6") } record(ao, "QUAD:LTUS:680:DAC") { field(DESC, "DAC Set point") field(EGU, "Counts") field(DOL, "") field(OMSL, "closed_loop") field(PREC, "6") field(PINI, "YES") } record(ao, "QUAD:LTUS:680:CALBIMIN") { field(DESC, "Calibration Min Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(DRVH, "120.0") field(HOPR, "120.0") field(DRVL, "-120.0") field(LOPR, "-120.0") field(PREC, "3") field(EGU, "A") field(VAL, "0.0") field(FLNK, "QUAD:LTUS:680:CALBIMAX") } record(ao, "QUAD:LTUS:680:CALBIMAX") { field(DESC, "Calibration Max Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(DRVH, "120.0") field(HOPR, "120.0") field(LOPR, "-120.0") field(DRVL, "-120.0") field(EGU, "A") field(VAL, "120.0") field(FLNK, "QUAD:LTUS:680:CALBSTEPNUM") } record(ao, "QUAD:LTUS:680:CALBIFINAL") { field(DESC, "Calibration Last Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(PREC, "3") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(VAL, "0") } record(longout, "QUAD:LTUS:680: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, "QUAD:LTUS:680:CALBIDELTA") } record(calc, "QUAD:LTUS:680:CALBIDELTA") { field(DESC, "Step size for CALB") field(CALC, "C=0?0:ABS((A-B)/C)") field(INPA, "QUAD:LTUS:680:CALBIMAX") field(INPB, "QUAD:LTUS:680:CALBIMIN") field(INPC, "QUAD:LTUS:680: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, "QUAD:LTUS:680:CALBIMULT") { field(DESC, "IACT vs ISETPT mult") field(CALC, "C#0||A=0?1:ABS(B/A)") field(INPA, "PSC:LTUS:MG17:ISETPT.DRVH") field(INPB, "PSC:LTUS:MG17:IACT.HOPR") field(INPC, "QUAD:LTUS:680:PSCONTROLLER.RVAL CPP") field(EGU, "A") field(PINI, "YES") } # SNL dbputs DAC values here. 6-10 steps are possible. record(waveform, "QUAD:LTUS:680:CALBICTRLWF") { field(DESC, "ICTRL setpoint array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") } record(waveform, "QUAD:LTUS:680:DACWF") { field(DESC, "DAC count array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:680:DACSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:680:DACSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "QUAD:LTUS:680: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, "QUAD:LTUS:680:CALCDACWF") { field(DESC, "Calc DAC counts array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:680:CALCDACSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:680:CALCDACSA") { field(DESC, "Calc DAC counts") field(DTYP, "Soft Channel") field(INP, "QUAD:LTUS:680: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, "QUAD:LTUS:680:CALBYWF") { field(DESC, "mx + b") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:680:CALBYSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:680:CALBYSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "QUAD:LTUS:680:CALBYWF") field(MALM, "10") field(NELM, "6") field(INDX, "0") field(FTVL, "DOUBLE") } record(waveform, "QUAD:LTUS:680:CALBIACTWF") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:680:CALBIACTSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:680:CALBIACTSA") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(MALM, "10") field(NELM, "6") field(INP, "QUAD:LTUS:680:CALBIACTWF") field(INDX, "0") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:680:CALBLIMITS") } # Check that measured current during calibration is within # tolerance. record(aSub, "QUAD:LTUS:680: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, "QUAD:LTUS:680:CALBSTEPNUM") field(INPB, "QUAD:LTUS:680:CALBIACTWF") field(INPC, "QUAD:LTUS:680: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, "QUAD:LTUS:680: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, "QUAD:LTUS:680:STDZITOL") field(INPH, "QUAD:LTUS:680:DACSLOPE") field(INPI, "QUAD:LTUS:680: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, "QUAD:LTUS:680: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, "QUAD:LTUS:680:CALBSTEPNUM") field(INPB, "QUAD:LTUS:680:CALBIACTWF") field(INPC, "QUAD:LTUS:680:DACWF") field(INPF, "QUAD:LTUS:680: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 QUAD:LTUS:680CALBOK 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, "QUAD:LTUS:680:DEGAUSINIT") { field(DESC, "Proc. Degauss PVs on boot") field(PINI, "YES") field(DOL, "1") field(OUTA, "QUAD:LTUS:680:DEGAUSIMIN.PROC PP") field(OUTB, "QUAD:LTUS:680:DEGAUSIMAX.PROC PP") field(OUTC, "QUAD:LTUS:680:DEGAUSTYPE.PROC PP") field(OUTD, "QUAD:LTUS:680:DEGAUSSTEP.PROC PP") field(OUTE, "QUAD:LTUS:680:MADNAME.PROC PP") field(OUTF, "QUAD:LTUS:680:PSTYPE.PROC PP") field(OUTG, "QUAD:LTUS:680: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, "QUAD:LTUS:680:DEGAUSSUB") { field(DESC, "Degauss subroutine") field(INAM, "mgntDegaussInit") field(SNAM, "mgntDegauss") field(BRSV, "INVALID") field(INPA, "QUAD:LTUS:680:DEGAUSIMIN NPP NMS") field(INPB, "QUAD:LTUS:680:DEGAUSIMAX NPP NMS") field(INPC, "QUAD:LTUS:680:DEGAUSTYPE.RVAL NPP NMS") field(INPE, "QUAD:LTUS:680:DEGAUSMETHOD.RVAL NPP NMS") field(INPF, "QUAD:LTUS:680:PSTYPE NPP NMS") field(INPG, "QUAD:LTUS:680:DEBUG.RVAL NPP NMS") field(INPH, "QUAD:LTUS:680: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, "QUAD:LTUS:680:DEGAUSWF PP") field(OUTB, "QUAD:LTUS:680:DEGAUSMSG PP") field(OUTC, "QUAD:LTUS:680: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, "QUAD:LTUS:680:DEGAUSWF") { field(DESC, "Degauss Setpts") field(NELM, "60") field(FTVL, "DOUBLE") } record(mbbo,"QUAD:LTUS:680: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, "QUAD:LTUS:680: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, "QUAD:LTUS:680: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, "QUAD:LTUS:680: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, "QUAD:LTUS:680: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, "QUAD:LTUS:680:DEGAUSIMIN") { field(DESC, "Min. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "120.0") field(LOPR, "-120.0") field(DRVH, "120.0") field(DRVL, "-120.0") field(VAL, "-120.0") } record(ao, "QUAD:LTUS:680:DEGAUSIMAX") { field(DESC, "Max. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "120.0") field(LOPR, "-120.0") field(DRVH, "120.0") field(DRVL, "-120.0") field(VAL, "120.0") } # 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,"QUAD:LTUS:680: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, "QUAD:LTUS:680: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,"QUAD:LTUS:680: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, "QUAD:LTUS:680: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, "QUAD:LTUS:680: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, "QUAD:LTUS:680: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, "QUAD:LTUS:680:DEGAUSTOD") { field(DESC, "Successful Degauss Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "QUAD:LTUS:680:DEGAUSLOSTTOD") { field(DESC, "Degauss Lost Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:680:DEGAUSTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "QUAD:LTUS:680:DEGAUSTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "QUAD:LTUS:680: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, "QUAD:LTUS:680:DEGAUSGO") { field(DESC, "Set bdes of btrms to zero") field(ASG, "Internal") field(OUTA, "") field(OUTB, "") field(OUTC, "") field(OUTD, "") } # =========== CRYO ONLY =========== record(bo, "QUAD:LTUS:680: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, "QUAD:LTUS:680:DEGAUS_IMAX_CHECK") { field(DESC, "Check if imax shoud chg") field(CALC, "(C==4)&&(ABS(B)>ABS(A))?1:0") field(INPA, "QUAD:LTUS:680:DEGAUS_IMAX") field(INPB, "QUAD:LTUS:680:ISETPT") field(INPC, "QUAD:LTUS:680:DEGAUSTYPE.RVAL") field(OUT, "QUAD:LTUS:680:DEGAUS_IMAX_UPDATE.SELN") field(FLNK, "QUAD:LTUS:680:DEGAUS_IMAX_UPDATE") } record(seq, "QUAD:LTUS:680:DEGAUS_IMAX_UPDATE") { field(DESC, "Degauss IMAX Update") field(SELM, "Specified") field(DOL1, "QUAD:LTUS:680:ISETPT") field(LNK1, "QUAD:LTUS:680:DEGAUS_IMAX PP") } # Set the maximum current after a successful # degauss. This pv is updated by the # sequence. record(ao, "QUAD:LTUS:680:DEGAUS_IMAX") { field(DESC, "Max I set afer a degauss") field(EGU, "Amps") field(PINI, "YES") field(PREC, "6") field(HOPR, "120.0") field(LOPR, "-120.0") field(DRVH, "120.0") field(DRVL, "-120.0") field(VAL, "120.0") field(FLNK, "QUAD:LTUS:680:DEGAUS_IMAXPOL_CHECK") info(autosaveFields,"VAL,RVAL") } # Set the polarity if degauss_imax record(calcout, "QUAD:LTUS:680:DEGAUS_IMAXPOL_CHECK") { field(DESC, "Determine polarity of imax") field(CALC, "A>=0?0:1") field(INPA, "QUAD:LTUS:680:DEGAUS_IMAX") field(FLNK, "QUAD:LTUS:680:DEGAUS_IMAXPOL") } record(bo, "QUAD:LTUS:680:DEGAUS_IMAXPOL") { field(DESC, "Polarity of imax I") field(DTYP, "Raw Soft Channel") field(DOL, "QUAD:LTUS:680:DEGAUS_IMAXPOL_CHECK") field(OMSL, "closed_loop") field(ZNAM, "Positive") field(ONAM, "Negative") field(FLNK, "QUAD:LTUS:680: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, "QUAD:LTUS:680:DEGAUS_ABSIMAX") { field(DESC, "Absolute Max. Degauss I") field(CALC, "ABS(A)") field(INPA, "QUAD:LTUS:680:DEGAUS_IMAX") field(PREC, "6") field(EGU, "Amps") field(HOPR, "120.0") field(LOPR, "-120.0") info(autosaveFields,"VAL RVAL") } # IACT Polarity record(calcout, "QUAD:LTUS:680:IACTPOL_CHECK") { field(DESC, "Determine IACT polarity") field(SCAN, "5 second") field(CALC, "ABS(A-B)>C?(A>=0?0:1):D") field(INPA, "QUAD:LTUS:680:IACT") field(INPB, "QUAD:LTUS:680:IACTPOL_CHECK.LA") field(INPC, "0.0001") field(INPD, "QUAD:LTUS:680:IACTPOL_CHECK.PVAL") field(OOPT, "On Change") field(FLNK, "QUAD:LTUS:680:IACTPOL") } record(bo, "QUAD:LTUS:680: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,"QUAD:LTUS:680: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, "QUAD:LTUS:680:DEGAUSENABLE CP") field(INPB, "QUAD:LTUS:680:DEGAUSOK") field(INPC, "QUAD:LTUS:680:STATE CP") field(INPD, "QUAD:LTUS:680:STATE.SEVR") field(OUT, "QUAD:LTUS:680:DEGAUS_STATE_SEQ.SELN PP") field(ASG, "Internal") } record(seq, "QUAD:LTUS:680:DEGAUS_STATE_SEQ") { field(DESC, "Degauss State Sequence") field(SELM, "Specified") field(SELL, "QUAD:LTUS:680:DEGAUS_STATE_CHECK") field(LNK1, "QUAD:LTUS:680:DEGAUS_STATE_DISABLE.PROC PP") field(LNK2, "QUAD:LTUS:680:DEGAUS_STATE_LOST.PROC PP") field(LNK3, "QUAD:LTUS:680:DEGAUS_STATE_GOOD.PROC PP") field(LNK4, "QUAD:LTUS:680: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, "QUAD:LTUS:680:DEGAUS_STATE_DISABLE") { field(DESC, "Degauss not used") field(LNK1, "QUAD:LTUS:680:DEGAUSOK.ZSV") field(LNK2, "QUAD:LTUS:680: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, "QUAD:LTUS:680:STATMSG.FRSV") field(LNK4, "QUAD:LTUS:680: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, "QUAD:LTUS:680:DEGAUS_STATE_LOST") { field(DESC, "Degauss lost and ps On") field(DOL1, "1") field(LNK1, "QUAD:LTUS:680:DEGAUSOK.ZSV") field(LNK2, "QUAD:LTUS:680: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, "QUAD:LTUS:680:STATMSG.FRSV") field(LNK4, "QUAD:LTUS:680: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, "QUAD:LTUS:680:DEGAUS_STATE_OFF") { field(DESC, "Degaused lost and ps Off") field(DOL1, "2") field(LNK1, "QUAD:LTUS:680: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, "QUAD:LTUS:680:STATMSG.FRSV") field(LNK3, "QUAD:LTUS:680: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, "QUAD:LTUS:680:DEGAUS_STATE_GOOD") { field(DESC, "Degauss good") field(DOL1, "1") field(LNK1, "QUAD:LTUS:680: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, "QUAD:LTUS:680:STATMSG.FRSV PP") field(LNK3, "QUAD:LTUS:680:STATMSG.FVSV PP") field(LNK4, "") field(ASG, "Internal") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(mbbo, "QUAD:LTUS:680:FUNC") { field(DESC, "QUAD:LTUS:680 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, "1") field(THVL, "9") field(FRVL, "10") field(FVVL, "0") field(SXVL, "2") field(SVVL, "8") field(EIVL, "11") field(NIVL, "12") field(TEVL, "13") field(ELVL, "5") field(TVVL, "6") field(TTVL, "7") field(FTVL, "4") field(FFVL, "3") field(OUT, "QUAD:LTUS:680:CTRL CA") } # :CTRL pv is processed at boot in the # sequence mgntCtrl.st Processed in sequence # record(mbbo, "QUAD:LTUS:680:CTRL") { field(DESC, "QUAD:LTUS:680 Control") field(PINI, "NO") field(ZRST, "Ready") field(ONST, "TRIM") field(TWST, "PERTURB") field(THST, "BCON_TO_BDES") field(FRST, "BACT_TO_BDES") field(FVST, "SAVE_BDES") field(SXST, "LOAD_BDES") field(SVST, "UNDO_BDES") field(EIST, "DAC_ZERO") field(NIST, "CALB") field(TEST, "STDZ") field(ELST, "RESET") field(TVST, "TURN_ON") field(TTST, "TURN_OFF") field(FTST, "") field(FFST, "") field(ZRVL, "0") field(ONVL, "2") field(TWVL, "6") field(THVL, "15") field(FRVL, "14") field(FVVL, "11") field(SXVL, "12") field(SVVL, "13") field(EIVL, "7") field(NIVL, "3") field(TEVL, "4") field(ELVL, "8") field(TVVL, "9") field(TTVL, "10") field(FTVL, "0") field(FFVL, "0") field(OUT, "QUAD:LTUS:680:SELECTEN.A PP") field(SDIS, "0") } # If a function has been selected set this unit to busy record(calcout, "QUAD:LTUS:680:SELECTEN") { field(DESC, "Control Select Enable") field(CALC, "A>0?1:A") field(FLNK, "QUAD:LTUS:680:BUSY") } # Set to FREE on IOC reboot record(bo, "QUAD:LTUS:680:BUSY") { field(DESC, "QUAD:LTUS:680 Ctrl Done") field(DOL, "QUAD:LTUS:680:SELECTEN") field(ZNAM, "FREE") field(ONAM, "BUSY") field(PINI, "YES") field(FLNK, "QUAD:LTUS:680:SELECT") } record(bo, "QUAD:LTUS:680:SELECT") { field(ZNAM, "NO") field(ONAM, "YES") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") } record(bo, "QUAD:LTUS:680: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, "QUAD:LTUS:680:CTRLSTATE") { field(DESC, "QUAD:LTUS:680 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("QUAD:LTUS:680:CTRL",20,20,0,0,"QUAD:LTUS:680:CTRL") #! Field("QUAD:LTUS:680:CTRL.OUT",16777215,1,"QUAD:LTUS:680:CTRL.OUT") #! Link("QUAD:LTUS:680:CTRL.OUT","QUAD:LTUS:680:SELECTEN.A") #! Field("QUAD:LTUS:680:CTRL.VAL",16777215,1,"QUAD:LTUS:680:CTRL.VAL") #! Record("QUAD:LTUS:680:SELECTEN",321,381,0,0,"QUAD:LTUS:680:SELECTEN") #! Field("QUAD:LTUS:680:SELECTEN.A",16777215,0,"QUAD:LTUS:680:SELECTEN.A") #! Field("QUAD:LTUS:680:SELECTEN.FLNK",16777215,1,"QUAD:LTUS:680:SELECTEN.FLNK") #! Link("QUAD:LTUS:680:SELECTEN.FLNK","QUAD:LTUS:680:BUSY") #! Field("QUAD:LTUS:680:SELECTEN.VAL",16777215,1,"QUAD:LTUS:680:SELECTEN.VAL") #! Record("QUAD:LTUS:680:BUSY",623,274,0,0,"QUAD:LTUS:680:BUSY") #! Field("QUAD:LTUS:680:BUSY.DOL",16777215,0,"QUAD:LTUS:680:BUSY.DOL") #! Link("QUAD:LTUS:680:BUSY.DOL","QUAD:LTUS:680:SELECTEN.VAL") #! Field("QUAD:LTUS:680:BUSY.FLNK",16777215,1,"QUAD:LTUS:680:BUSY.FLNK") #! Link("QUAD:LTUS:680:BUSY.FLNK","QUAD:LTUS:680:SELECT") #! Record("QUAD:LTUS:680:SELECT",669,508,0,1,"QUAD:LTUS:680:SELECT") #! Record("QUAD:LTUS:680:FUNC",940,120,0,0,"QUAD:LTUS:680:FUNC") #! Field("QUAD:LTUS:680:FUNC.OUT",16777215,0,"QUAD:LTUS:680:FUNC.OUT") #! Link("QUAD:LTUS:680:FUNC.OUT","QUAD:LTUS:680:CTRL.VAL") #! Record("QUAD:LTUS:680:ABORT",193,41,0,0,"QUAD:LTUS:680:ABORT") #! Record("QUAD:LTUS:680:CTRLSTATE",369,34,0,0,"QUAD:LTUS:680: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,"QUAD:LTUS:680:SELECT is used for Multi-device selection.\nIt is enabled when associated QUAD:LTUS:680:CTRL is \"0\" (DONE).\nIt is disabled when associated QUAD:LTUS:680: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,"QUAD:LTUS:680: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, "QUAD:LTUS:680:BCTRL_INIT") { field(DESC, "Process BCTRL on boot") field(PINI, "YES") field(CALC, "A=3?1:0") field(INPA, "QUAD:LTUS:680:BCTRL.SEVR") field(OUT, "QUAD:LTUS:680: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, "QUAD:LTUS:680:BACT") { field(DESC, "Actual B") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "QUAD:LTUS:680:BACT") field(INPB, "QUAD:LTUS:680:POLYCOEF") field(INPC, "QUAD:LTUS:680:POLYCOEF.A") field(INPD, "QUAD:LTUS:680:POLYCOEF.B") field(INPE, "QUAD:LTUS:680:IACT MS") field(INPF, "QUAD:LTUS:680:BDELTAS PP") field(INPG, "100") field(EGU, "kG") field(HOPR, "67.4268") field(LOPR, "-67.6932") field(HIHI, "67.4268") field(LOLO, "-67.6932") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "67.4268") field(LOW, "-67.6932") field(FLNK, "QUAD:LTUS:680: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, "QUAD:LTUS:680:BDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntPhyDeltas") field(EGU, "kG") field(HOPR, "1") field(PREC, "7") field(BRSV, "INVALID") field(INPA, "QUAD:LTUS:680:BDES") field(INPB, "QUAD:LTUS:680:TRIMBTOL") field(INPC, "QUAD:LTUS:680:TRIMBTOLR") field(INPD, "QUAD:LTUS:680:CHCKBTOL") field(INPE, "QUAD:LTUS:680:CHCKBTOLR") field(F, "2.0") field(INPG, "30") field(INPH, "QUAD:LTUS:680:BACT.VAL") # # MPS absolute and relative tolerances field(INPP, "QUAD:LTUS:680:MPSBTOL") field(INPQ, "QUAD:LTUS:680:MPSBTOLR") field(FLNK, "QUAD:LTUS:680:BCONLIMITS") info(autosaveFields,"F") } # This record is processed by BDELTAS record(aSub, "QUAD:LTUS:680:BCONLIMITS") { field(DESC, "Config B-field Limits") field(INAM, "mgntInit") field(SNAM, "mgntBCONLimits") field(INPA, "QUAD:LTUS:680:BDES") field(INPB, "QUAD:LTUS:680:BDELTAS.I") field(INPG, "QUAD:LTUS:680:DEBUG.RVAL") field(FTA, "DOUBLE") field(FTB, "DOUBLE") field(FTG, "ULONG") field(OUTA, "QUAD:LTUS:680:BCON.HIGH") field(OUTB, "QUAD:LTUS:680:BCON.LOW") field(OUTC, "QUAD:LTUS:680:BCON.HIHI") field(OUTD, "QUAD:LTUS:680:BCON.LOLO PP") field(FTVA, "DOUBLE") field(FTVB, "DOUBLE") field(FTVC, "DOUBLE") field(FTVD, "DOUBLE") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:680:IDELTAS") } # The following PV is processed by :BACT # which is processed by :BACT # record(fanout, "QUAD:LTUS:680:BACTFO") { field(DESC, "BACT processing") field(SELM, "All") field(LNK1, "QUAD:LTUS:680:BDIFF") field(LNK2, "QUAD:LTUS:680:BADIFF") field(LNK3, "QUAD:LTUS:680:BRATIO") field(LNK4, "QUAD:LTUS:680:MPSLIMITS") field(LNK5, "QUAD:LTUS:680:I2BSTATUS") field(LNK6, "QUAD:LTUS:680:IACTFO.PROC") } record(calc, "QUAD:LTUS:680:BDIFF") { field(DESC, "BDES-BACT") field(CALC, "A-B") field(INPA, "QUAD:LTUS:680:BDES") field(INPB, "QUAD:LTUS:680:BACT") field(EGU, "kG") field(PREC, "7") } record(calc, "QUAD:LTUS:680:BADIFF") { field(DESC, "Absolute BDES-BACT") field(INPA, "QUAD:LTUS:680:BDIFF") field(EGU, "kG") field(PREC, "7") field(CALC, "A<0?ABS(A):A") } record(calc, "QUAD:LTUS:680:BRATIO") { field(DESC, "BACT Error") field(CALC, "B?A/B:0") field(INPA, "QUAD:LTUS:680:BDIFF") field(INPB, "QUAD:LTUS:680:BDES.HOPR") field(EGU, "kG") field(PREC, "7") } record(mbbi, "QUAD:LTUS:680: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, "QUAD:LTUS:680:BACT.J") } # Note: for a string slave set the MONFL # macro to the following: # MONFL=:IMONCALC MS record(sub, "QUAD:LTUS:680:BMON") { field(DESC, "Second Transductor") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "QUAD:LTUS:680:BMON") field(INPB, "QUAD:LTUS:680:POLYCOEF") field(INPC, "QUAD:LTUS:680:POLYCOEF.A") field(INPD, "QUAD:LTUS:680:POLYCOEF.B") field(INPE, "QUAD:LTUS:680:IMON MS") field(INPF, "QUAD:LTUS:680:BDELTAS.VAL") field(INPG, "100") field(EGU, "kG") field(HOPR, "67.4268") field(LOPR, "-67.6932") field(HIHI, "67.4268") field(LOLO, "-67.6932") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "67.4268") field(LOW, "-67.6932") } # 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=PSC:LTUS:MG17:BDES CP record(ao, "QUAD:LTUS:680:BDES") { field(DESC, "Desired B-Field") field(PINI, "YES") field(DRVH, "67.4268") field(DRVL, "-67.6932") field(HOPR, "67.4268") field(LOPR, "-67.6932") field(PREC, "7") field(EGU, "kG") field(MDEL, "-1") field(OMSL, "supervisory") # field(DOL, "") field(OUT, "QUAD:LTUS:680:B2IDES PP") info(autosaveFields,"VAL") } record(sub, "QUAD:LTUS:680:B2IDES") { field(DESC, "Convert Desired B-Field to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:680:POLYCOEF") field(INPC, "QUAD:LTUS:680:POLYCOEF.A") field(INPD, "QUAD:LTUS:680:POLYCOEF.B") field(PREC, "7") field(EGU, "kG") field(HOPR, "67.4268") field(LOPR, "-67.6932") field(MDEL, "-1") field(INPE, "QUAD:LTUS:680:BDES.DRVH") field(INPF, "QUAD:LTUS:680:BDES.DRVL") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:680:IDES") } record(sub, "QUAD:LTUS:680:BNOM") { field(DESC, "Nominal Field") field(PINI, "YES") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:680:POLYCOEF") field(INPC, "QUAD:LTUS:680:POLYCOEF.A") field(INPD, "QUAD:LTUS:680:POLYCOEF.B") field(INPE, "QUAD:LTUS:680:BDES.DRVH") field(INPF, "QUAD:LTUS:680:BDES.DRVL") field(EGU, "kG") field(HOPR, "67.4268") field(LOPR, "-67.6932") field(PREC, "7") field(VAL, "0.0") field(FLNK, "QUAD:LTUS:680:INOM") } record(sub, "QUAD:LTUS:680:BACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:680:BDES.VAL") field(INPB, "QUAD:LTUS:680:BDES.DRVH") field(INPC, "QUAD:LTUS:680:BDES.DRVL") field(INPD, "QUAD:LTUS:680:BDELTAS.I") field(INPE, "QUAD:LTUS:680:BDELTAS.J") field(INPG, "QUAD:LTUS:680:STATE") field(INPH, "QUAD:LTUS:680:HSTA") field(EGU, "kG") field(HOPR, "67.4268") field(LOPR, "-67.6932") field(PREC, "7") field(BRSV, "INVALID") } record(sub, "QUAD:LTUS:680:BMONLIMITS") { field(DESC, "MON Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:680:BDES.VAL") field(INPB, "QUAD:LTUS:680:BDES.DRVH") field(INPC, "QUAD:LTUS:680:BDES.DRVL") field(INPD, "QUAD:LTUS:680:BDELTAS.K") field(INPE, "QUAD:LTUS:680:BDELTAS.L") field(INPG, "QUAD:LTUS:680:STATE") field(INPH, "QUAD:LTUS:680:HSTA") field(EGU, "kG") field(HOPR, "67.4268") field(LOPR, "-67.6932") field(PREC, "7") field(BRSV, "INVALID") } record(seq, "QUAD:LTUS:680:BLIMITS") { field(DESC, "ACT Limits") field(PREC, "7") field(DOL1, "QUAD:LTUS:680:BLIMITS") field(LNK1, "QUAD:LTUS:680:BACTLIMITS.F PP") field(DOL2, "QUAD:LTUS:680:BACTLIMITS.I") field(LNK2, "QUAD:LTUS:680:BACT.HIGH") field(DOL3, "QUAD:LTUS:680:BACTLIMITS.J") field(LNK3, "QUAD:LTUS:680:BACT.LOW") field(DOL4, "QUAD:LTUS:680:BACTLIMITS.K") field(LNK4, "QUAD:LTUS:680:BACT.HIHI") field(DOL5, "QUAD:LTUS:680:BACTLIMITS.L") field(LNK5, "QUAD:LTUS:680:BACT.LOLO") field(DOL6, "QUAD:LTUS:680:BLIMITS") field(LNK6, "QUAD:LTUS:680:BMONLIMITS.F PP") field(DOL7, "QUAD:LTUS:680:BMONLIMITS.I") field(LNK7, "QUAD:LTUS:680:BMON.HIGH") field(DOL8, "QUAD:LTUS:680:BMONLIMITS.J") field(LNK8, "QUAD:LTUS:680:BMON.LOW") field(DOL9, "QUAD:LTUS:680:BMONLIMITS.K") field(LNK9, "QUAD:LTUS:680:BMON.HIHI") field(DOLA, "QUAD:LTUS:680:BMONLIMITS.L") field(LNKA, "QUAD:LTUS:680:BMON.LOLO") field(FLNK, "QUAD:LTUS:680:ILIMITS") field(SCAN, "5 second") } record(ao, "QUAD:LTUS:680:BCTRL") { field(DESC, "B-Perturb") field(PREC, "7") field(EGU, "kG") field(DRVH, "67.4268") field(DRVL, "-67.6932") field(HOPR, "67.4268") field(LOPR, "-67.6932") # 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, "QUAD:LTUS:680: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, "QUAD:LTUS:680:BCTRLGO") { field(DESC, "Update DES and perturb") field(PREC, "7") # Disable BACT limits field(DOL1, "1") field(LNK1, "QUAD:LTUS:680:BLIMITS.VAL") # Update BDES with the BCTRL (slider) value field(DOL2, "QUAD:LTUS:680:BCTRL.VAL") field(LNK2, "QUAD:LTUS:680:BDES PP") field(DOL3, "1") field(LNK3, "QUAD:LTUS:680:IDIRECT.PROC PP") field(DOL4, "1") field(LNK4, "QUAD:LTUS:680:CHECKSTDZLOST.PROC PP") field(DOL5, "QUAD:LTUS:680:BCTRL.VAL") field(LNK5, "QUAD:LTUS:680:BCTRLSUB PP") # Re-enable BACT limits field(DOL6, "0") field(LNK6, "QUAD:LTUS:680:BLIMITS.VAL") } # Convert B-field to Current and output to ISETPT record(sub, "QUAD:LTUS:680:BCTRLSUB") { field(DESC, "Feedback") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:680:POLYCOEF") field(INPC, "QUAD:LTUS:680:POLYCOEF.A") field(INPD, "QUAD:LTUS:680:POLYCOEF.B") field(INPE, "QUAD:LTUS:680:BDES.DRVH") field(INPF, "QUAD:LTUS:680:BDES.DRVL") field(PREC, "7") field(EGU, "kG") field(HOPR, "67.4268") field(LOPR, "-67.6932") field(MDEL, "-1") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:680:ISETPT") } record(ao, "QUAD:LTUS:680:BDESPREVTRIM") { field(DESC, "trim bdes for undo") field(DTYP, "Soft Channel") field(DRVH, "67.4268") field(DRVL, "-67.6932") field(EGU, "kG") field(HOPR, "67.4268") field(LOPR, "-67.6932") field(PREC, "7") field(PINI, "YES") info(autosaveFields,"VAL") } record(stringin, "QUAD:LTUS:680:MADNAME") { field(DESC, "MAD deck nomenclature") field(PINI, "YES") field(VAL, "QEM4B") } record(ai, "QUAD:LTUS:680: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, "3422.136032") } record(ao, "QUAD:LTUS:680:BMAX") { field(DESC, "Max B-Field") field(DTYP, "Soft Channel") field(DRVH, "67.4268") field(DRVL, "-67.6932") field(EGU, "kG") field(HOPR, "67.4268") field(LOPR, "-67.6932") field(PREC, "7") field(PINI, "YES") field(VAL, "67.4268") field(FLNK, "QUAD:LTUS:680:BSTEP") } record(ao, "QUAD:LTUS:680:BMIN") { field(DESC, "Min B-Field") field(DTYP, "Soft Channel") field(DRVH, "67.4268") field(DRVL, "-67.6932") field(EGU, "kG") field(HOPR, "67.4268") field(LOPR, "-67.6932") field(PREC, "7") field(PINI, "YES") field(VAL, "-67.6932") field(FLNK, "QUAD:LTUS:680:BSTEP") } record(ao, "QUAD:LTUS:680:BDESSAVE") { field(DESC, "bdes for save/load") field(DTYP, "Soft Channel") field(DRVH, "67.4268") field(DRVL, "-67.6932") field(EGU, "kG") field(HOPR, "67.4268") field(LOPR, "-67.6932") field(PINI, "YES") field(PREC, "7") } # This record is processed by QUAD:LTUS:680: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, "QUAD:LTUS:680:BCON") { field(DESC, "Config B-Field ") field(DTYP, "Soft Channel") field(PREC, "7") field(EGU, "kG") field(HOPR, "67.4268") field(LOPR, "-67.6932") field(DRVH, "67.4268") field(DRVL, "-67.6932") # Set MINOR Alarm as the default, slaves will set NO_ALARM=0. field(HHSV, "MINOR") field(LLSV, "MINOR") field(HSV, "MINOR") field(LSV, "MINOR") # field(DOL , "") field(OMSL, "supervisory") field(OUT, "QUAD:LTUS:680:B2ICON PP") info(autosaveFields,"VAL") } record(sub, "QUAD:LTUS:680:B2ICON") { field(DESC, "Convert Desired ICon to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:680:POLYCOEF") field(INPC, "QUAD:LTUS:680:POLYCOEF.A") field(INPD, "QUAD:LTUS:680:POLYCOEF.B") field(PREC, "7") field(EGU, "kG") field(HOPR, "67.4268") field(LOPR, "-67.6932") field(MDEL, "-1") field(INPE, "QUAD:LTUS:680:BCON.DRVH") field(INPF, "QUAD:LTUS:680:BCON.DRVL") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:680: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, "QUAD:LTUS:680:BSTEP") { field(DESC, "B-Field step size") field(CALC, "(C==3)||(D==3)?0:ABS(A-B)*0.005") field(INPA, "QUAD:LTUS:680:BMAX") field(INPB, "QUAD:LTUS:680:BMIN") field(INPC, "QUAD:LTUS:680:BMIN.SEVR") field(INPD, "QUAD:LTUS:680:BMAX.SEVR") field(EGU, "kG") 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,"QUAD:LTUS:680:BCTRLDISABLECALC") { field(DESC, "Calc for disabling BCTRL") field(ASG, "Internal") field(CALC, "A?2:1") field(INPA, "QUAD:LTUS:680:ONLINE CP") field(OUT, "QUAD:LTUS:680:BCTRLDISABLEFOUT PP") } record(fanout, "QUAD:LTUS:680:BCTRLDISABLEFOUT") { field(DESC, "Disable BCTRL fanout") field(SELM, "Specified") field(SELL, "QUAD:LTUS:680:BCTRLDISABLECALC") field(LNK1, "QUAD:LTUS:680:BCTRLDISABLE") field(LNK2, "QUAD:LTUS:680:BCTRLENABLE") } record(stringout, "QUAD:LTUS:680:BCTRLDISABLE") { field(DESC, "Disable BCTRL") field(DTYP, "Soft Channel") field(OUT, "QUAD:LTUS:680:BCTRL.ASG") field(VAL, "NOWRITE") field(FLNK, "QUAD:LTUS:680:BCTRLDISV_UPDATE") } record(stringout, "QUAD:LTUS:680:BCTRLENABLE") { field(DESC, "Enable BCTRL") field(DTYP, "Soft Channel") field(OUT, "QUAD:LTUS:680:BCTRL.ASG") field(VAL, "") field(FLNK, "QUAD:LTUS:680:BCTRLDISV_UPDATE") } record(calcout, "QUAD:LTUS:680:BCTRLDISV_UPDATE") { field(DESC, "Calc for updating BCTRL.DISV") field(ASG, "Internal") field(CALC, "A") field(INPA, "QUAD:LTUS:680:ONLINE") field(OUT, "QUAD:LTUS:680: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,"QUAD:LTUS:680:BACT and MON\n are processed via links from \n QUAD:LTUS:680:IACT (device raw value readback 1)\n and\n QUAD:LTUS:680: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 QUAD:LTUS:680:POLYCOEF\nC = First polynomial coefficient (offset if linear)\nD = Second polynomial coefficient (slope if linear)\nE = QUAD:LTUS:680: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,"QUAD:LTUS:680:BDES\n is processed when set by CA users or \n QUAD:LTUS:680: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,"QUAD:LTUS:680: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 QUAD:LTUS:680: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 (QUAD:LTUS:680: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,"QUAD:LTUS:680:B*LIMITS and QUAD:LTUS:680:BLIMITS:\n Calculate alarm and warning limits based on \n deltas from QUAD:LTUS:680: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,"QUAD:LTUS:680: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,"QUAD:LTUS:680: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, "QUAD:LTUS:680: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, "QUAD:LTUS:680:MPSBTOL") { field(DESC, "Absolute mps tol") field(EGU, "kG") field(PREC, "2") field(CALC, "ABS(A)*0.02") field(INPA, "QUAD:LTUS:680:BMAX") field(PINI, "YES") } # # 21-Aug-2013: K. Luchini # Set channel access security so that users # cannot easily change values. record(ao, "QUAD:LTUS:680:MPSBMAX") { field(DESC, "MPS Max B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "67.4268") field(DRVL, "-67.6932") field(PINI, "YES") field(VAL, "67.4268") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:680:MPSBMIN") { field(DESC, "MPS Min B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "67.4268") field(DRVL, "-67.6932") field(PINI, "YES") field(VAL, "-67.6932") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:680:MPSBLLIM") { field(DESC, "MPS Low Limit B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "67.4268") field(DRVL, "-67.6932") field(PINI, "YES") field(VAL, "-67.6932") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:680:MPSBLLIM2") { field(DESC, "MPS Low Limit #2 B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "67.4268") field(DRVL, "-67.6932") field(PINI, "YES") field(VAL, "-67.6932") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } # Set the default to Std record(mbbo, "QUAD:LTUS:680: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, "QUAD:LTUS:680:MPSLIMITS.E PP") } record(aSub, "QUAD:LTUS:680: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, "QUAD:LTUS:680:MPS.RVAL") field(INPB, "QUAD:LTUS:680:BADIFF") field(INPC, "QUAD:LTUS:680:BDELTAS.N") field(INPD, "QUAD:LTUS:680:BACT") field(INPE, "QUAD:LTUS:680:MPSBITMASK.RVAL") field(INPF, "QUAD:LTUS:680:MPSBLLIM") field(INPG, "QUAD:LTUS:680:MPSBMIN") field(INPH, "QUAD:LTUS:680:MPSBMAX") field(INPI, "QUAD:LTUS:680: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, "QUAD:LTUS:680:INTOL.RVAL PP") field(OUTB, "QUAD:LTUS:680:INTOL_BMIN.RVAL PP") field(OUTC, "QUAD:LTUS:680:INTOL_BRANGE.RVAL PP") field(OUTD, "QUAD:LTUS:680: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, "QUAD:LTUS:680:INTOL") { field(DESC, "BACT within MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:680:MPSLIMITS.VALA") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "QUAD:LTUS:680:INTOL_BMIN") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:680:MPSLIMITS.VALB") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "QUAD:LTUS:680:INTOL_BMIN2") { field(DESC, "MPS tol #2") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:680:MPSLIMITS.VALD") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "QUAD:LTUS:680:INTOL_BRANGE") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:680: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, "QUAD:LTUS:680:CHCKITOL") { field(DESC, "Absolute Check I Tolerance") field(EGU, "A") field(FLNK, "QUAD:LTUS:680:TRIMITOL") field(CALC, "ABS(A*B)") field(INPA, "QUAD:LTUS:680:CHCKBTOL") field(INPB, "QUAD:LTUS:680:POLYCOEF.B") field(PREC, "9") } record(calc, "QUAD:LTUS:680:TRIMBTOL") { field(EGU, "kG") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(DESC, "Absolute Trim Tolerance") field(CALC, "ABS(A)/2") field(INPA, "QUAD:LTUS:680:CHCKBTOL") field(FLNK, "QUAD:LTUS:680:CHCKITOL") } record(calc, "QUAD:LTUS:680:CHCKBTOL") { field(DESC, "Check absolute tolerance") field(EGU, "A") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(FLNK, "QUAD:LTUS:680:TRIMBTOL") field(CALC, "MAX(ABS(A),ABS(C))*(B/1000000)") field(INPA, "QUAD:LTUS:680:BDES.HOPR") field(INPB, "QUAD:LTUS:680:STABILITY") field(INPC, "QUAD:LTUS:680:BDES.LOPR") } record(longout, "QUAD:LTUS:680: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, "QUAD:LTUS:680:CHCKBTOL") } record(calc, "QUAD:LTUS:680:TRIMITOL") { field(DESC, "Absolute Trim I Tolerance") field(EGU, "kG") field(CALC, "ABS(A*B)") field(INPA, "QUAD:LTUS:680:POLYCOEF.B") field(INPB, "QUAD:LTUS:680:TRIMBTOL") field(PREC, "9") } record(ai, "QUAD:LTUS:680:TRIMBTOLR") { field(DESC, "Relative trim tol") field(PREC, "4") field(EGU, "%") field(HOPR, "1.0") field(LOPR, "0.0") field(PINI, "YES") } record(ai, "QUAD:LTUS:680: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, "QUAD:LTUS:680:FBCKFCOM") { field(ZNAM, "CA") field(ONAM, "FCOM") field(DESC, "CA Mode") field(PINI, "YES") field(SDIS, "0") } record(bo, "QUAD:LTUS:680:PAU") { field(ZNAM, "NotConfigured") field(ONAM, "Configured") field(DESC, "PAU Present") field(PINI, "YES") field(SDIS, "0") field(FLNK, "QUAD:LTUS:680:PAUGO") } record(fanout, "QUAD:LTUS:680:PAUGO") { field(DESC, "PAU control") field(LNK1, "QUAD:LTUS:680:PAUSTOP") field(LNK2, "QUAD:LTUS:680: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, "QUAD:LTUS:680:PAUSTART") { field(DESC, "Setup for PAU On") field(SDIS, "QUAD:LTUS:680: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, "QUAD:LTUS:680:PAUSTOP") { field(DESC, "Setup for PAU Off") field(SDIS, "QUAD:LTUS:680: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, "QUAD:LTUS:680:MCORDEVNAME") { field(DESC, "PS device name") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, "PSC:LTUS:MG17:") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "QUAD:LTUS:680: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, "QUAD:LTUS:680:PSTYPE.RVAL") field(INPC, "QUAD:LTUS:680:TURNEDOFF.RVAL") field(INPD, "QUAD:LTUS:680:CONFIG.RVAL") field(INPE, "QUAD:LTUS:680:PSCATEGORY.RVAL") field(INPF, "QUAD:LTUS:680:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "QUAD:LTUS:680:AUTOCTRL.RVAL") field(INPJ, "QUAD:LTUS:680:OUTOFSERVICE.RVAL") field(INPL, "QUAD:LTUS:680:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "QUAD:LTUS:680:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "QUAD:LTUS:680:PAU") field(INPP, "QUAD:LTUS:680:CALBDISABLE.RVAL") field(INPQ, "QUAD:LTUS:680:PTRBDISABLE.RVAL") field(INPR, "QUAD:LTUS:680:TRIMDISABLE.RVAL") field(INPS, "QUAD:LTUS:680:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "QUAD:LTUS:680:FBCK") field(INPU, "QUAD:LTUS:680:TRIMTYPE.RVAL") field(INPV, "QUAD:LTUS:680:STDZDIRECT.RVAL") field(INPW, "QUAD:LTUS:680:DEGAUSENABLE.RVAL") field(FLNK, "QUAD:LTUS:680:HSTA") } record(longin, "QUAD:LTUS:680:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "QUAD:LTUS:680:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "QUAD:LTUS:680: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, "QUAD:LTUS:680: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, "QUAD:LTUS:680:CALBDISABLE") { field(DESC, "DAC Calb Disabled") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:680:PTRBDISABLE") { field(DESC, "Perturb Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:680:TRIMDISABLE") { field(DESC, "Trim Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:680: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 QUAD:LTUS:680:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses QUAD:LTUS:680:FBCK. # This PV should be replaced by QUAD:LTUS:680: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, "QUAD:LTUS:680: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, "QUAD:LTUS:680: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, "QUAD:LTUS:680: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, "") field(OMSL, "supervisory") field(FLNK, "QUAD:LTUS:680:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"QUAD:LTUS:680:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "QUAD:LTUS:680:OUTOFSERVICE NPP NMS") field(OUT, "QUAD:LTUS:680:ONLINE PP") } record(bo, "QUAD:LTUS:680:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "QUAD:LTUS:680: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, "1") } record(bo, "QUAD:LTUS:680: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, "1") } record(bo, "QUAD:LTUS:680: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, "QUAD:LTUS:680: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, "QUAD:LTUS:680: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, "QUAD:LTUS:680: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, "QUAD:LTUS:680: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, "QUAD:LTUS:680: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, "1") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:680: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, "1") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:680: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, "2") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:680: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, "0") field(ASG, "NOWRITE") field(FLNK, "QUAD:LTUS:680:TRIMTYPE") } record(stringout, "QUAD:LTUS:680:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "QUAD:LTUS:680:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "QUAD:LTUS:680:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "QUAD:LTUS:680:STATE.RVAL") field(INPB, "QUAD:LTUS:680:INTLKSUMY.RVAL") field(OUT, "QUAD:LTUS:680:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:LTUS:680: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, "QUAD:LTUS:680:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "QUAD:LTUS:680:STATE.RVAL") field(INPB, "QUAD:LTUS:680:INTLKSUMY.RVAL") field(OUT, "QUAD:LTUS:680:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:LTUS:680:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "QUAD:LTUS:680:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "QUAD:LTUS:680: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, "QUAD:LTUS:680:RAMPSTARTDLY") { field(DESC, "Tansition to ramp delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "2") } ######### For PSTYPE=2 Only ############# record(mbbo, "QUAD:LTUS:680: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, "QUAD:LTUS:680: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,"QUAD:LTUS:680: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("QUAD:LTUS:680:TURNEDOFF",3140,1907,0,1,"QUAD:LTUS:680:TURNEDOFF") #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "QUAD:LTUS:680:STATSUB") { field(DESC, "Build STATus ") field(INAM, "mgntInit") field(SNAM, "mgntSlcStat") field(INPA, "QUAD:LTUS:680:BACT.STAT") field(INPB, "QUAD:LTUS:680:BDES.STAT") field(INPC, "QUAD:LTUS:680:IRIPL.STAT") field(INPD, "PSC:LTUS:MG17:ISETPT.STAT") field(INPE, "PSC:LTUS:MG17:IACT.STAT") # 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, "QUAD:LTUS:680:BACT.SEVR") field(INPH, "QUAD:LTUS:680:BDES.SEVR") field(INPI, "QUAD:LTUS:680:IRIPL.SEVR") field(INPJ, "PSC:LTUS:MG17:ISETPT.SEVR") field(INPK, "PSC:LTUS:MG17:IACT.SEVR") # # 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, "QUAD:LTUS:680:STATE.RVAL") field(INPN, "QUAD:LTUS:680:STDZOK") field(INPO, "QUAD:LTUS:680:CALBOK") field(INPP, "QUAD:LTUS:680:OUTOFSERVICE.RVAL") field(INPQ, "QUAD:LTUS:680:CONFIG.RVAL") field(INPR, "QUAD:LTUS:680:HSTA") field(INPS, "QUAD:LTUS:680:CTRL.RVAL") field(INPT, "QUAD:LTUS:680:DEGAUSOK") field(INPV, "QUAD:LTUS:680: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, "QUAD:LTUS:680:STAT") } record(longout, "QUAD:LTUS:680:STAT") { field(DESC, "STAT sent to SLC") field(SCAN, "Passive") field(FLNK, "QUAD:LTUS:680:STATCTRLSUB") field(DOL, "QUAD:LTUS:680:STATSUB.VAL") field(OMSL, "closed_loop") } record(sSub, "QUAD:LTUS:680:STATCTRLSUB") { field(DESC, "Decode SLC STAT into mbbo") field(INAM, "mgntInit") field(SNAM, "mgntStatDecode") field(INPA, "QUAD:LTUS:680:STAT") field(INPB, "QUAD:LTUS:680:HSTA") field(INPD, "QUAD:LTUS:680:ONOFFCTRL.RVAL") field(FLNK, "QUAD:LTUS:680:STATMSG") } record(mbbo, "QUAD:LTUS:680: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, "QUAD:LTUS:680:UNAVAILGO") field(DOL, "QUAD:LTUS:680:STATCTRLSUB.W") } record(seq, "QUAD:LTUS:680:UNAVAILGO") { field(DESC, "Process UNAVAIL") field(DOL1, "QUAD:LTUS:680:STATSUB.U") field(LNK1, "QUAD:LTUS:680:UNAVAIL PP") } record(stringout, "QUAD:LTUS:680:SNLSTATMSG") { field(DTYP, "Soft Channel") } #! TextBox(TB0,820,1000,1200,1220,0,"Dialog",12,1,16777215,"QUAD:LTUS:680:STATUSSUB - future\nOverall device status - takes input from action snls, record sevrs, master snl(s) and outputs final status\n\nInputs:\nA - QUAD:LTUS:680:CTRLSTATUS - snl status\nB - MGNT:CTRLSTATUS - master list status\nC\nD - QUAD:LTUS:680: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,"QUAD:LTUS:680STATSUB\nformat control bo's into slc STAT\n\nInputs:\nA - QUAD:LTUS:680:STATUS\nC - QUAD:LTUS:680:ON\nD - QUAD:LTUS:680:STDZOK\nE - QUAD:LTUS:680:CALBOK\nF - QUAD:LTUS:680:BACTDRIFT (future)\nG -\nH- QUAD:LTUS:680:DACSTATUS\nI -QUAD:LTUS:680:ADCSTATUS\nJ - QUAD:LTUS:680:BACTSTATUS\nK - QUAD:LTUS:680:BDESSTATUS\nL - QUAD:LTUS:680:RIPLSTATUS\n\nOutput:\nP - QUAD:LTUS:680: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, "QUAD:LTUS:680: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, "QUAD:LTUS:680: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, "QUAD:LTUS:680: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, "QUAD:LTUS:680: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.6 #! DBDSTART #! DBD("../../../../dbd/mgntSoft.dbd") #! DBDEND record(stringout, "QUAD:LTUS:680:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:680:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "QUAD:LTUS:680:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "QUAD:LTUS:680:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "QUAD:LTUS:680:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "QUAD:LTUS:680:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "1") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "QUAD:LTUS:680: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, "QUAD:LTUS:680:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "QUAD:LTUS:680:TRIMTYPE.RVAL") field(INPB, "QUAD:LTUS:680:CONFIG.RVAL") field(OUT, "QUAD:LTUS:680:TRIMMAXNUM PP") } record(longout, "QUAD:LTUS:680: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, "QUAD:LTUS:680: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, "") field(OMSL, "supervisory") field(VAL, "20") field(OUT, "QUAD:LTUS:680:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "QUAD:LTUS:680: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, "") field(OMSL, "supervisory") field(VAL, "10") } record(bo, "QUAD:LTUS:680: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, "QUAD:LTUS:680: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, "QUAD:LTUS:680: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, "QUAD:LTUS:680:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "0") } record(ao, "QUAD:LTUS:680: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, "QUAD:LTUS:680:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "QUAD:LTUS:680: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, "QUAD:LTUS:680: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, "QUAD:LTUS:680:IMOVE") field(INPB, "QUAD:LTUS:680:IACT") field(INPC, "QUAD:LTUS:680:IRAMPRATE") field(INPD, "1.577") field(INPE, "QUAD:LTUS:680:TRIMDLYPCT") field(INPF, "QUAD:LTUS:680:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "QUAD:LTUS:680:RAMPTIME_LEFT PP") } record(longout, "QUAD:LTUS:680:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "QUAD:LTUS:680:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "QUAD:LTUS:680:RAMPDONE_CALC") } record(calc, "QUAD:LTUS:680:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "QUAD:LTUS:680:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "QUAD:LTUS:680:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "QUAD:LTUS:680: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, "QUAD:LTUS:680:RAMPTIME_LEFT") field(OUT, "QUAD:LTUS:680:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "QUAD:LTUS:680:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "QUAD:LTUS:680:RAMPTIME_LEFT NMS") field(OUT, "QUAD:LTUS:680:RAMPDONE PP") } record(bo, "QUAD:LTUS:680:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "QUAD:LTUS:680:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "QUAD:LTUS:680: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, "QUAD:LTUS:680: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(sSub, "QUAD:LTUS:680: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, "QUAD:LTUS:680:PSTYPE.RVAL") field(INPC, "QUAD:LTUS:680:TURNEDOFF.RVAL") field(INPD, "QUAD:LTUS:680:CONFIG.RVAL") field(INPE, "QUAD:LTUS:680:PSCATEGORY.RVAL") field(INPF, "QUAD:LTUS:680:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "QUAD:LTUS:680:AUTOCTRL.RVAL") field(INPJ, "QUAD:LTUS:680:OUTOFSERVICE.RVAL") field(INPL, "QUAD:LTUS:680:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "QUAD:LTUS:680:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "QUAD:LTUS:680:PAU") field(INPP, "QUAD:LTUS:680:CALBDISABLE.RVAL") field(INPQ, "QUAD:LTUS:680:PTRBDISABLE.RVAL") field(INPR, "QUAD:LTUS:680:TRIMDISABLE.RVAL") field(INPS, "QUAD:LTUS:680:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "QUAD:LTUS:680:FBCK") field(INPU, "QUAD:LTUS:680:TRIMTYPE.RVAL") field(INPV, "QUAD:LTUS:680:STDZDIRECT.RVAL") field(INPW, "QUAD:LTUS:680:DEGAUSENABLE.RVAL") field(FLNK, "QUAD:LTUS:680:HSTA") } record(longin, "QUAD:LTUS:680:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "QUAD:LTUS:680:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "QUAD:LTUS:680: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, "QUAD:LTUS:680: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, "QUAD:LTUS:680:CALBDISABLE") { field(DESC, "DAC Calb Disabled") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:680:PTRBDISABLE") { field(DESC, "Perturb Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:680:TRIMDISABLE") { field(DESC, "Trim Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:680:STDZDISABLE") { field(DTYP, "Raw Soft Channel") field(ZNAM, "NO") field(ONAM, "YES") field(DESC, "Standardize Function") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } # This PV has been replaced by QUAD:LTUS:680:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses QUAD:LTUS:680:FBCK. # This PV should be replaced by QUAD:LTUS:680: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, "QUAD:LTUS:680: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, "QUAD:LTUS:680: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, "QUAD:LTUS:680: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, "") field(OMSL, "supervisory") field(FLNK, "QUAD:LTUS:680:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"QUAD:LTUS:680:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "QUAD:LTUS:680:OUTOFSERVICE NPP NMS") field(OUT, "QUAD:LTUS:680:ONLINE PP") } record(bo, "QUAD:LTUS:680:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "QUAD:LTUS:680: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, "1") } record(bo, "QUAD:LTUS:680: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, "1") } record(bo, "QUAD:LTUS:680: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, "QUAD:LTUS:680: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, "QUAD:LTUS:680: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, "QUAD:LTUS:680: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, "QUAD:LTUS:680: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, "QUAD:LTUS:680: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, "1") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:680: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, "1") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:680: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, "2") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:680: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, "0") field(ASG, "NOWRITE") field(FLNK, "QUAD:LTUS:680:TRIMTYPE") } record(stringout, "QUAD:LTUS:680:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "QUAD:LTUS:680:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "QUAD:LTUS:680:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "QUAD:LTUS:680:STATE.RVAL") field(INPB, "QUAD:LTUS:680:INTLKSUMY.RVAL") field(OUT, "QUAD:LTUS:680:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:LTUS:680: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, "QUAD:LTUS:680:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "QUAD:LTUS:680:STATE.RVAL") field(INPB, "QUAD:LTUS:680:INTLKSUMY.RVAL") field(OUT, "QUAD:LTUS:680:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:LTUS:680:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "QUAD:LTUS:680:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "QUAD:LTUS:680: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, "QUAD:LTUS:680:RAMPSTARTDLY") { field(DESC, "Tansition to ramp delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "2") } ######### For PSTYPE=2 Only ############# record(mbbo, "QUAD:LTUS:680: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, "QUAD:LTUS:680: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,"QUAD:LTUS:680: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("QUAD:LTUS:680:TURNEDOFF",3140,1907,0,1,"QUAD:LTUS:680:TURNEDOFF") #! 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, "QUAD:LTUS:725:IACT") { field(DESC, "Current") field(INP, "PSC:LTUS:MG23:IACT") field(EGU, "A") field(HOPR, "110.0") field(LOPR, "0.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "QUAD:LTUS:725:BACT") info(autosaveFields,"HYST") } record(bi, "QUAD:LTUS:725:STATE") { field(DESC, "PS On/Off Status") field(DTYP, "Raw Soft Channel") field(INP, "PSC:LTUS:MG23:STATE NPP MS") field(ZSV, "MAJOR") field(ZNAM, "OFF") field(ONAM, "ON") } record(ao, "QUAD:LTUS:725:IDES") { field(DESC, "Desired Current") field(PREC, "3") field(EGU, "A") field(HOPR, "110.0") field(LOPR, "0.0") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(MDEL, "-1") field(HIHI, "110.0") field(LOLO, "0.0") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "QUAD:LTUS:725:BDELTAS") field(DRVH, "110.0") field(DRVL, "0.0") field(DOL, "QUAD:LTUS:725: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, "QUAD:LTUS:725:ICTRL PP") } # This record is processed by QUAD:LTUS:725:ICON") # Note: we are not setting alarms here. record(ao, "QUAD:LTUS:725:ICON") { field(DESC, "Config I") field(DTYP, "Soft Channel") field(PREC, "3") field(HOPR, "110.0") field(LOPR, "0.0") field(DRVH, "110.0") field(DRVL, "0.0") field(DOL, "QUAD:LTUS:725:B2ICON.K") field(OMSL, "closed_loop") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:725:INOM") { field(DESC, "Nominal Current") field(DOL, "QUAD:LTUS:725:BNOM.K") field(OMSL, "closed_loop") field(PREC, "3") field(EGU, "A") field(DRVH, "110.0") field(DRVL, "0.0") field(HOPR, "110.0") field(LOPR, "0.0") } record(ao, "QUAD:LTUS:725:ICTRL") { field(DESC, "Set Current") field(PREC, "3") field(EGU, "A") field(HOPR, "110.0") field(LOPR, "0.0") field(DRVH, "110.0") field(DRVL, "0.0") field(MDEL, "-1") field(FLNK, "QUAD:LTUS:725:ICTRLGO") field(OMSL, "supervisory") info(autosavefields,"VAL") } record(seq, "QUAD:LTUS:725:ICTRLGO") { field(DESC, "Process Current Setpoint") field(PREC, "3") # Set ISETPT to supervisory field(DOL1, "0") field(LNK1, "QUAD:LTUS:725:ISETPT.OMSL") field(DOL2, "QUAD:LTUS:725:ICTRL") field(LNK2, "QUAD:LTUS:725:ISETPT PP") # Set ISETPT to closed loop - get data from BCTRLSUB.K field(DOL3, "1") field(LNK3, "QUAD:LTUS:725:ISETPT.OMSL") } record(ao, "QUAD:LTUS:725:IMAX") { field(DESC, "Max I") field(DTYP, "Soft Channel") field(DRVH, "110.0") field(DRVL, "0.0") field(EGU, "A") field(HOPR, "110.0") field(LOPR, "0.0") field(PREC, "3") field(PINI, "YES") field(VAL, "110.0") field(FLNK, "QUAD:LTUS:725:IMIN") } record(ao, "QUAD:LTUS:725:IMIN") { field(DESC, "Min I") field(DTYP, "Soft Channel") field(DRVH, "110.0") field(DRVL, "0.0") field(EGU, "A") field(HOPR, "110.0") field(LOPR, "0.0") field(PREC, "3") field(VAL, "0.0") field(FLNK, "QUAD:LTUS:725:IRANGE") } record(sel, "QUAD:LTUS:725:IACTPREVOK") { field(DESC, "Last Good Current") field(EGU, "A") field(HOPR, "110.0") field(LOPR, "0.0") field(PREC, "3") field(NVL, "QUAD:LTUS:725:BACT.SEVR") field(INPA, "QUAD:LTUS:725:IACT NPP MS") field(INPB, "QUAD:LTUS:725:IACTPREVOK NPP MS") field(INPC, "QUAD:LTUS:725:IACTPREVOK NPP MS") field(INPD, "QUAD:LTUS:725:IACTPREVOK NPP MS") } record(sub, "QUAD:LTUS:725:IACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:725:IDES") field(INPB, "QUAD:LTUS:725:ISETPT.DRVH") field(INPC, "QUAD:LTUS:725:ISETPT.DRVL") field(INPD, "QUAD:LTUS:725:IDELTAS.I") field(INPE, "QUAD:LTUS:725:IDELTAS.J") field(INPG, "QUAD:LTUS:725:STATE") field(INPH, "QUAD:LTUS:725:HSTA") field(EGU, "A") field(HOPR, "110.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(sub, "QUAD:LTUS:725:IMONLIMITS") { field(DESC, "Aux Current Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:725:IDES") field(INPB, "QUAD:LTUS:725:ISETPT.DRVH") field(INPC, "QUAD:LTUS:725:ISETPT.DRVL") field(INPD, "QUAD:LTUS:725:IDELTAS.K") field(INPE, "QUAD:LTUS:725:IDELTAS.L") field(INPG, "QUAD:LTUS:725:STATE") field(INPH, "QUAD:LTUS:725:HSTA") field(EGU, "A") field(HOPR, "110.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(seq, "QUAD:LTUS:725:ILIMITS") { field(DESC, "Set ACT and MON Limits") field(PREC, "3") field(DOL1, "QUAD:LTUS:725:BLIMITS") field(LNK1, "QUAD:LTUS:725:IACTLIMITS.F PP") field(DOL2, "QUAD:LTUS:725:IACTLIMITS.I") field(LNK2, "QUAD:LTUS:725:IACT.HIGH") field(DOL3, "QUAD:LTUS:725:IACTLIMITS.J") field(LNK3, "QUAD:LTUS:725:IACT.LOW") field(DOL4, "QUAD:LTUS:725:IACTLIMITS.K") field(LNK4, "QUAD:LTUS:725:IACT.HIHI") field(DOL5, "QUAD:LTUS:725:IACTLIMITS.L") field(LNK5, "QUAD:LTUS:725:IACT.LOLO") field(DOL6, "QUAD:LTUS:725:BLIMITS") field(LNK6, "QUAD:LTUS:725:IMONLIMITS.F PP") field(DOL7, "QUAD:LTUS:725:IMONLIMITS.I") field(LNK7, "QUAD:LTUS:725:IMON.HIGH") field(DOL8, "QUAD:LTUS:725:IMONLIMITS.J") field(LNK8, "QUAD:LTUS:725:IMON.LOW") field(DOL9, "QUAD:LTUS:725:IMONLIMITS.K") field(LNK9, "QUAD:LTUS:725:IMON.HIHI") field(DOLA, "QUAD:LTUS:725:IMONLIMITS.L") field(LNKA, "QUAD:LTUS:725: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, "QUAD:LTUS:725:IDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntRawDeltas") field(INPD, "QUAD:LTUS:725:TRIMBTOL") field(INPE, "QUAD:LTUS:725:CHCKBTOL") field(INPF, "QUAD:LTUS:725:BDELTAS.K") field(INPG, "QUAD:LTUS:725:BDELTAS.L") field(INPH, "QUAD:LTUS:725: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, "QUAD:LTUS:725:STDZITOLR") field(INPC, "QUAD:LTUS:725:STDZITOL") field(FLNK, "") } # All ps controllers with on/off control will set the macro ONOF # as follows: # # ONOF = PSC:LTUS:MG23: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, "QUAD:LTUS:725:STATESETPT") { field(DESC, "PS On/Off") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFF") field(ONAM, "ON") field(OUT, "PSC:LTUS:MG23:STATESETPT PP") 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 = PSC:LTUS:MG23:RESET PP # record(bo, "QUAD:LTUS:725:RESET") { field(DESC, "Interlock Latch Reset") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFF") field(ONAM, "ON") field(HIGH, "1.0") field(OUT, "PSC:LTUS:MG23:RESET PP") } record(bo, "QUAD:LTUS:725:RAMPSTATE") { field(DESC, "PS Ramp Status") field(DTYP, "Soft Channel") field(DOL, "PSC:LTUS:MG23:RAMPSTATE NPP 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, "QUAD:LTUS:725: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, "QUAD:LTUS:725:TRIMRAMPRATE") field(OUT, "PSC:LTUS:MG23:IRAMPRATE PP") field(FLNK, "QUAD:LTUS:725:STDZDLY") } record(ao, "QUAD:LTUS:725:ISETPT") { field(DESC, "Current Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(EGU, "A") field(HOPR, "110.0") field(LOPR, "0.0") field(DRVH, "110.0") field(DRVL, "0.0") field(MDEL, "-1") field(OUT, "PSC:LTUS:MG23:ISETPT PP") field(DOL, "QUAD:LTUS:725: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, "QUAD:LTUS:725:IMON") { field(DESC, "Aux Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(INP, "PSC:LTUS:MG23:IMON") field(EGU, "A") field(HOPR, "110.0") field(LOPR, "0.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "QUAD:LTUS:725:BMON") } record(ao, "QUAD:LTUS:725:IRIPL") { field(DESC, "Ripple Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(DOL, "PSC:LTUS:MG23:IRIPL NPP NMS") field(OMSL, "closed_loop") field(EGU, "A") field(DRVH, "1.0") field(HOPR, "1.0") field(PREC, "3") field(FLNK, "QUAD:LTUS:725:IRIPLOK") } record(sub, "QUAD:LTUS:725:IRIPLOK") { field(DESC, "Ripple Current Status") field(INAM, "mgntInit") field(SNAM, "mgntRiplOK") field(INPA, "QUAD:LTUS:725:IRIPL.VAL") field(INPB, "QUAD:LTUS:725: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, "QUAD:LTUS:725:R") { field(DESC, "Resistance") field(EGU, "Ohms") field(PREC, "4") field(PINI, "YES") field(DOL, "PSC:LTUS:MG23:R NPP MS") 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, "QUAD:LTUS:725:IGND") { field(DESC, "Ground Current") field(EGU, "A") field(PREC, "6") field(PINI, "YES") field(DOL, "PSC:LTUS:MG23:IGND NPP MS") field(OMSL, "closed_loop") } record(bi, "QUAD:LTUS:725:INTLKSUMY") { field(DESC, "Interlock Summary") field(INP, "PSC:LTUS:MG23:INTLKSUMY NPP MS") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(ZNAM, "OK") field(ONAM, "FAULT") field(PINI, "NO") } record(mbbo, "QUAD:LTUS:725: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, "PSC:LTUS:MG23:COOLING") field(OMSL, "closed_loop") } # The following PV is processed by :BACTFO # which is processed by :BACT record(fanout, "QUAD:LTUS:725:IACTFO") { field(DESC, "IACT processing") field(SELM, "All") field(LNK1, "QUAD:LTUS:725:IACTPREVOK") field(LNK2, "QUAD:LTUS:725:IDIFF") field(LNK3, "QUAD:LTUS:725:IADIFF") field(LNK4, "QUAD:LTUS:725:IRATIO") field(LNK5, "QUAD:LTUS:725:IDIRECT") field(LNK6, "QUAD:LTUS:725:IACTPOL_CHECK") } record(calc, "QUAD:LTUS:725:IDIFF") { field(DESC, "IDES-IACT") field(CALC, "A-B") field(INPA, "QUAD:LTUS:725:IDES") field(INPB, "QUAD:LTUS:725:IACT") field(EGU, "A") field(PREC, "9") field(HOPR, "110.0") field(LOPR, "0.0") } record(calc, "QUAD:LTUS:725:IADIFF") { field(DESC, "Absolute IDES-IACT") field(CALC, "A<0?ABS(A):A") field(INPA, "QUAD:LTUS:725:IDIFF") field(PREC, "9") } record(calc, "QUAD:LTUS:725:IRATIO") { field(DESC, "IDES-IACT/IMAX") field(CALC, "B?A/B:0") field(INPA, "QUAD:LTUS:725:IDIFF") field(INPB, "QUAD:LTUS:725:IDES.DRVH") field(PREC, "9") } record(calcout, "QUAD:LTUS:725:IRANGE") { field(DESC, "Current Range") field(PINI, "YES") field(CALC, "ABS(A-B)") field(INPA, "QUAD:LTUS:725:IMIN") field(INPB, "QUAD:LTUS:725: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, "QUAD:LTUS:725: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, "QUAD:LTUS:725:IACT") field(FLNK, "QUAD:LTUS:725:IACTPOL") } record(bo, "QUAD:LTUS:725:IACTPOL") { field(DESC, "Actual I Polarity") field(DTYP, "Raw Soft Channel") field(DOL, "QUAD:LTUS:725: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,"QUAD:LTUS:725:I*LIMITS:\n Calculate alarm and warning limits based on \n deltas from QUAD:LTUS:725:IDELTAS and the\n QUAD:LTUS:725: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,"QUAD:LTUS:725:IACT: \n Get copy of QUAD:LTUS:725:I. \n",null) #! TextBox(TB12,1280,3100,1760,3200,0,"Dialog",12,1,16777215,"QUAD:LTUS:725: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,"QUAD:LTUS:725:IDES:\n Contains raw value calculated by \nQUAD:LTUS:725: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 \nQUAD:LTUS:725:BDELTAS.\n",null) #! TextBox(TB10,56,1940,316,2340,0,"Dialog",12,1,16777215,"QUAD:LTUS:725: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 QUAD:LTUS:725: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 QUAD:LTUS:725: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,"QUAD:LTUS:725:ISETPT:\n Sets the hardware. When fast feedback is set on, this record is\n set to closed loop mode by QUAD:LTUS:725:FBCKSTART sequence. When \n the loop is closed, this record takes input calculated by \n BFBCK only. When fast feedback is set off, QUAD:LTUS:725:FBCKSTOP \n will set it back to supervisory so that the value can be set by \n QUAD:LTUS:725: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, "QUAD:LTUS:725:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:725:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "QUAD:LTUS:725:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "QUAD:LTUS:725:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "QUAD:LTUS:725:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "QUAD:LTUS:725:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "1") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "QUAD:LTUS:725: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, "QUAD:LTUS:725:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "QUAD:LTUS:725:TRIMTYPE.RVAL") field(INPB, "QUAD:LTUS:725:CONFIG.RVAL") field(OUT, "QUAD:LTUS:725:TRIMMAXNUM PP") } record(longout, "QUAD:LTUS:725: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, "QUAD:LTUS:725: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, "") field(OMSL, "supervisory") field(VAL, "10") field(OUT, "QUAD:LTUS:725:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "QUAD:LTUS:725: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, "") field(OMSL, "supervisory") field(VAL, "10") } record(bo, "QUAD:LTUS:725: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, "QUAD:LTUS:725: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, "QUAD:LTUS:725: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, "QUAD:LTUS:725:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "0") } record(ao, "QUAD:LTUS:725: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, "QUAD:LTUS:725:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "QUAD:LTUS:725: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, "QUAD:LTUS:725: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, "QUAD:LTUS:725:IMOVE") field(INPB, "QUAD:LTUS:725:IACT") field(INPC, "QUAD:LTUS:725:IRAMPRATE") field(INPD, "1.577") field(INPE, "QUAD:LTUS:725:TRIMDLYPCT") field(INPF, "QUAD:LTUS:725:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "QUAD:LTUS:725:RAMPTIME_LEFT PP") } record(longout, "QUAD:LTUS:725:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "QUAD:LTUS:725:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "QUAD:LTUS:725:RAMPDONE_CALC") } record(calc, "QUAD:LTUS:725:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "QUAD:LTUS:725:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "QUAD:LTUS:725:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "QUAD:LTUS:725: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, "QUAD:LTUS:725:RAMPTIME_LEFT") field(OUT, "QUAD:LTUS:725:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "QUAD:LTUS:725:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "QUAD:LTUS:725:RAMPTIME_LEFT NMS") field(OUT, "QUAD:LTUS:725:RAMPDONE PP") } record(bo, "QUAD:LTUS:725:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "QUAD:LTUS:725:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "QUAD:LTUS:725: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, "QUAD:LTUS:725: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, "QUAD:LTUS:725:STDZINIT") { field(DESC, "Proc. Stdz PVs on boot") field(PINI, "YES") field(DOL1, "1") field(DOL2, "1") field(DOL3, "1") field(LNK1, "QUAD:LTUS:725:DEBUG.PROC PP") field(LNK2, "QUAD:LTUS:725:STDZCYCLENUM.PROC PP") field(LNK3, "QUAD:LTUS:725:STDZDISABLE.PROC PP") field(LNK4, "QUAD:LTUS:725: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, "QUAD:LTUS:725:STDZSUB") { field(DESC, "Stdz subroutine") field(INAM, "mgntStdzInit") field(SNAM, "mgntStdz") field(BRSV, "INVALID") field(INPA, "QUAD:LTUS:725:STDZIMIN NPP NMS") field(INPB, "QUAD:LTUS:725:STDZIMAX NPP NMS") field(INPC, "QUAD:LTUS:725:STDZIFINAL NPP NMS") field(INPD, "QUAD:LTUS:725:STDZCYCLENUM NPP NMS") field(INPE, "QUAD:LTUS:725:STDZDIRECT.RVAL NPP NMS") field(INPF, "QUAD:LTUS:725:STDZDISABLE.RVAL CPP NMS") field(INPG, "QUAD:LTUS:725: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, "QUAD:LTUS:725:STDZWF PP") field(OUTB, "QUAD:LTUS:725: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, "QUAD:LTUS:725:STDZWF") } record(mbbo, "QUAD:LTUS:725: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, "QUAD:LTUS:725: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, "QUAD:LTUS:725:STDZMAINPS") { field(DESC, "Stdz by main or self") field(PINI, "YES") field(DTYP, "Soft Channel") field(ZNAM, "SELF") field(ONAM, "MAIN") } record(bo, "QUAD:LTUS:725: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, "QUAD:LTUS:725: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, "QUAD:LTUS:725: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, "QUAD:LTUS:725:STDZTOD") { field(DESC, "Successful Standardize Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "QUAD:LTUS:725:STDZLOSTTOD") { field(DESC, "Standardize Lost Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(longout, "QUAD:LTUS:725:STDZCYCLECNT") { field(DESC, "Cycle Count") field(PINI, "YES") } record(longout, "QUAD:LTUS:725:STDZCYCLENUM") { field(DESC, "No. Standardize Cycles") field(VAL, "3") field(HOPR, "10") field(LOPR, "0") field(DRVH, "10") field(DRVL, "0") field(PINI, "YES") field(FLNK, "QUAD:LTUS:725:STDZDIRECT") } # The default standardize direction is "UP" for # all LCLS Magnets.. record(bo, "QUAD:LTUS:725:STDZDIRECT") { field(DESC, "Standardize Direction ") field(ZNAM, "UP") field(ONAM, "DOWN") field(VAL, "0") field(FLNK, "QUAD:LTUS:725:STDZIMIN") } record(ao, "QUAD:LTUS:725:STDZIMIN") { field(DESC, "Min-STDZ Current") field(PREC, "1") field(EGU, "A") field(HOPR, "110.0") field(LOPR, "0.0") field(VAL, "0.0") field(FLNK, "QUAD:LTUS:725:STDZIMAX") } record(ao, "QUAD:LTUS:725:STDZIMAX") { field(DESC, "Max. Standarize Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "110.0") field(LOPR, "0.0") field(VAL, "110.0") field(FLNK, "QUAD:LTUS:725:STDZIFINAL") } record(ao, "QUAD:LTUS:725:STDZIFINAL") { field(DESC, "Final SDTZ Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "110.0") field(LOPR, "0.0") field(VAL, "0.0") field(FLNK, "QUAD:LTUS:725: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, "QUAD:LTUS:725: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, "QUAD:LTUS:725:STDZITOL") { field(DESC, "Stdz min tolerance") field(PREC, "5") field(CALC, "MAX(ABS(A),ABS(B))*C") field(INPA, "QUAD:LTUS:725:STDZIMIN CP NMS") field(INPB, "QUAD:LTUS:725:STDZIMAX CP MMS") field(INPC, "0.05") field(INPD, "QUAD:LTUS:725:STDZITOLR CP MMS") field(EGU, "A") field(FLNK, "QUAD:LTUS:725:IDELTAS") field(PINI, "YES") } # D - factor (3.154/2 = 1.577) for EPSC, otherwise, set to 1.0 record(calc, "QUAD:LTUS:725:STDZDLY") { field(DESC, "Ramp time for stdz cycle") field(CALC, "C>0?MAX(1,ABS((A-B)/C)*D):0") field(INPA, "QUAD:LTUS:725:STDZIMIN CP NMS") field(INPB, "QUAD:LTUS:725:STDZIMAX CP NMS") field(INPC, "QUAD:LTUS:725:TRIMRAMPRATE CP NMS") field(INPD, "1.577") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") } record(calc, "QUAD:LTUS:725:STDZRAMPDLY") { field(DESC, "Ramp delay total") field(CALC, "MAX(1,((A/100)*B+B))") field(PREC, "5") field(INPA, "QUAD:LTUS:725:TRIMDLYPCT CP MS") field(INPB, "QUAD:LTUS:725: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, "QUAD:LTUS:725:STDZMINIDLY") { field(DESC, "Mini-stdz delay") field(CALC, "A") field(PREC, "5") field(A, "1.0") field(EGU, "sec") field(PINI, "YES") } record(ao, "QUAD:LTUS:725: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, "QUAD:LTUS:725:STDZMINIDELTA") { field(DESC, "Stdz mini % of IMAX") field(CALC, "(B/100)*(A-C)") field(INPA, "QUAD:LTUS:725:IDES.HOPR") field(INPB, "QUAD:LTUS:725:STDZMINIPCT CPP NMS") field(INPC, "QUAD:LTUS:725:IDES.LOPR") field(PREC, "5") } record(calc, "QUAD:LTUS:725:STDZMINISETPT") { field(DESC, "Mini Stdz delta") field(CALC, "C==0?MAX(E-D,B):MIN(E+D,A)") field(INPA, "QUAD:LTUS:725:IDES.HOPR") field(INPB, "QUAD:LTUS:725:IDES.LOPR") field(INPC, "QUAD:LTUS:725:STDZDIRECT.RVAL") field(INPD, "QUAD:LTUS:725:STDZMINIDELTA") field(INPE, "QUAD:LTUS:725:IDES") field(PREC, "5") field(FLNK, "QUAD:LTUS:725: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, "QUAD:LTUS:725:STDZMINISETPTOOR") { field(DESC, "Mini Stdz setpoint out of range") field(CALC, "C==0?(E-DA)") field(INPA, "QUAD:LTUS:725:IDES.HOPR") field(INPB, "QUAD:LTUS:725:IDES.LOPR") field(INPC, "QUAD:LTUS:725:STDZDIRECT.RVAL") field(INPD, "QUAD:LTUS:725:STDZMINIDELTA") field(INPE, "QUAD:LTUS:725: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, "QUAD:LTUS:725: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, "QUAD:LTUS:725:IADJUST.RVAL") field(INPB, "QUAD:LTUS:725:STDZDIRECT.RVAL") field(INPC, "QUAD:LTUS:725:STDZOK.RVAL") field(INPD, "QUAD:LTUS:725:STDZDISABLE.RVAL") field(INPE, "QUAD:LTUS:725:STATE.RVAL CPP NMS") field(INPF, "QUAD:LTUS:725:ICTRL.RVAL") field(INPG, "QUAD:LTUS:725:STATE.SEVR") field(INPH, "QUAD:LTUS:725:BDELTAS.M") field(INPI, "QUAD:LTUS:725:IACT.SEVR") field(OUT, "QUAD:LTUS:725:STDZLOSTGO.SELN PP NMS") field(OOPT, "Transition To Non-zero") } record(seq, "QUAD:LTUS:725:STDZLOSTGO") { field(DESC, "Process lost stdz") field(SELM, "Mask") field(DOL1, "1") field(DOL2, "0") field(LNK1, "QUAD:LTUS:725:STDZLOSTTOD.PROC") field(LNK2, "QUAD:LTUS:725:STDZOK PP") } # Record maximum current after standardize # Reset to IACT from sequence after trim # Disable processing during (mini-)standardize or trim record(calc, "QUAD:LTUS:725:STDZIACTMAX") { field(DESC, "Max act current after stdz") field(CALC, "MAX(A, B)") field(DISV, "0") field(SDIS, "QUAD:LTUS:725:CHECKPWRDIP_ENABLE") field(INPA, "QUAD:LTUS:725:IACT CP") field(INPB, "QUAD:LTUS:725:STDZIACTMAX") field(EGU, "A") field(FLNK, "QUAD:LTUS:725:CHECKPWRDIP") } # Detect power dip if STDZOK is YES, STDZ is enabled, and IACT is valid # If IACT drops below STDZIACTMAX by more than the trim tolerance, clear STDZOK # Warning: Take the absolute value of the trim tolerance, or else quads of # negative polarity will always lose STDZ since their IDELTAS.I are negative. # Note: Large quads and bends are prone to losing STDZ even if they are # perturbed toward higher current since their current tends to overshoot # by greater than the trim tolerance before settling down. record(calcout, "QUAD:LTUS:725:CHECKPWRDIP") { field(DESC, "Detect power dip") field(CALC, "(A-B>ABS(C))?3:0") field(DISV, "0") field(SDIS, "QUAD:LTUS:725:CHECKPWRDIP_ENABLE") field(INPA, "QUAD:LTUS:725:STDZIACTMAX") field(INPB, "QUAD:LTUS:725:IACT") field(INPC, "QUAD:LTUS:725:IDELTAS.I") field(OUT, "QUAD:LTUS:725:STDZLOSTGO.SELN PP NMS") field(OOPT, "When Non-zero") } # Enable processing of STDZIACTMAX and CHECKPWRDIP only if # STDZOK = YES, STDZDISABLE = NO, CTRL != Trim (2), and # CTRL != Stdz (4) record(calc, "QUAD:LTUS:725:CHECKPWRDIP_ENABLE") { field(CALC, "A&&!B&&(C#2)&&(C#4)") field(INPA, "QUAD:LTUS:725:STDZOK.RVAL CP") field(INPB, "QUAD:LTUS:725:STDZDISABLE.RVAL CP") field(INPC, "QUAD:LTUS:725:CTRL.RVAL CP") } #! 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, "QUAD:LTUS:725: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, "QUAD:LTUS:725:CALBOK") { field(DESC, "Successful Calibration") field(DTYP, "Raw Soft Channel") field(ZNAM, "NO") field(ONAM, "YES") field(DOL, "PSC:LTUS:MG23:CALBOK.RVAL") field(OMSL, "closed_loop") 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, "QUAD:LTUS:725:CALBSET") { field(DESC, "Use DAC Calbration") field(SCAN, "10 second") field(CALC, "A&&(B==0)&&C?31:960") field(INPA, "QUAD:LTUS:725:CALBOK") field(INPB, "QUAD:LTUS:725:CALBDISABLE") field(INPC, "QUAD:LTUS:725:CALBSLOPE") field(OOPT, "On Change") field(OUT, "QUAD:LTUS:725: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, "QUAD:LTUS:725:CALB_SEQ") { field(DESC, "Output Calib Values") field(SELM, "Mask") field(SELL, "QUAD:LTUS:725: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, "QUAD:LTUS:725:CALBSLOPE") field(DOL3, "QUAD:LTUS:725: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, "QUAD:LTUS:725:CALBTOD") { field(DESC, "Calibration Success Time") field(PINI, "YES") field(DOL, "PSC:LTUS:MG23:CALBTOD") field(OMSL, "closed_loop") field(DTYP, "Soft Channel") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:725: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, "QUAD:LTUS:725: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, "QUAD:LTUS:725: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, "QUAD:LTUS:725:CALBOFFSET") { field(DESC, "Calc DAC Offset") field(PREC, "6") field(EGU, "Counts") field(PINI, "YES") } record(bo, "QUAD:LTUS:725: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, "QUAD:LTUS:725:DACSLOPE") { field(DESC, "V to DAC slope") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "closed_loop") field(PINI, "YES") field(FLNK, "QUAD:LTUS:725:DACOFFSET") } # Default Offset used in conversion from Volts to DAC Counts record(ao, "QUAD:LTUS:725:DACOFFSET") { field(DESC, "V to DAC offset") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "closed_loop") field(PINI, "YES") field(FLNK, "QUAD:LTUS:725: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, "QUAD:LTUS:725: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, "QUAD:LTUS:725:IACT") field(INPD, "QUAD:LTUS:725:DACSLOPE") field(INPE, "QUAD:LTUS:725:DACOFFSET") field(EGU, "Counts") field(PREC, "6") } record(ao, "QUAD:LTUS:725:DAC") { field(DESC, "DAC Set point") field(EGU, "Counts") field(DOL, "") field(OMSL, "closed_loop") field(PREC, "6") field(PINI, "YES") } record(ao, "QUAD:LTUS:725:CALBIMIN") { field(DESC, "Calibration Min Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(DRVH, "110.0") field(HOPR, "110.0") field(DRVL, "0.0") field(LOPR, "0.0") field(PREC, "3") field(EGU, "A") field(VAL, "0.0") field(FLNK, "QUAD:LTUS:725:CALBIMAX") } record(ao, "QUAD:LTUS:725:CALBIMAX") { field(DESC, "Calibration Max Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(DRVH, "110.0") field(HOPR, "110.0") field(LOPR, "0.0") field(DRVL, "0.0") field(EGU, "A") field(VAL, "110.0") field(FLNK, "QUAD:LTUS:725:CALBSTEPNUM") } record(ao, "QUAD:LTUS:725:CALBIFINAL") { field(DESC, "Calibration Last Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(PREC, "3") field(EGU, "A") field(HOPR, "110.0") field(LOPR, "0.0") field(VAL, "0") } record(longout, "QUAD:LTUS:725: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, "QUAD:LTUS:725:CALBIDELTA") } record(calc, "QUAD:LTUS:725:CALBIDELTA") { field(DESC, "Step size for CALB") field(CALC, "C=0?0:ABS((A-B)/C)") field(INPA, "QUAD:LTUS:725:CALBIMAX") field(INPB, "QUAD:LTUS:725:CALBIMIN") field(INPC, "QUAD:LTUS:725: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, "QUAD:LTUS:725:CALBIMULT") { field(DESC, "IACT vs ISETPT mult") field(CALC, "C#0||A=0?1:ABS(B/A)") field(INPA, "PSC:LTUS:MG23:ISETPT.DRVH") field(INPB, "PSC:LTUS:MG23:IACT.HOPR") field(INPC, "QUAD:LTUS:725:PSCONTROLLER.RVAL CPP") field(EGU, "A") field(PINI, "YES") } # SNL dbputs DAC values here. 6-10 steps are possible. record(waveform, "QUAD:LTUS:725:CALBICTRLWF") { field(DESC, "ICTRL setpoint array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") } record(waveform, "QUAD:LTUS:725:DACWF") { field(DESC, "DAC count array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:725:DACSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:725:DACSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "QUAD:LTUS:725: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, "QUAD:LTUS:725:CALCDACWF") { field(DESC, "Calc DAC counts array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:725:CALCDACSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:725:CALCDACSA") { field(DESC, "Calc DAC counts") field(DTYP, "Soft Channel") field(INP, "QUAD:LTUS:725: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, "QUAD:LTUS:725:CALBYWF") { field(DESC, "mx + b") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:725:CALBYSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:725:CALBYSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "QUAD:LTUS:725:CALBYWF") field(MALM, "10") field(NELM, "6") field(INDX, "0") field(FTVL, "DOUBLE") } record(waveform, "QUAD:LTUS:725:CALBIACTWF") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:725:CALBIACTSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:725:CALBIACTSA") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(MALM, "10") field(NELM, "6") field(INP, "QUAD:LTUS:725:CALBIACTWF") field(INDX, "0") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:725:CALBLIMITS") } # Check that measured current during calibration is within # tolerance. record(aSub, "QUAD:LTUS:725: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, "QUAD:LTUS:725:CALBSTEPNUM") field(INPB, "QUAD:LTUS:725:CALBIACTWF") field(INPC, "QUAD:LTUS:725: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, "QUAD:LTUS:725: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, "QUAD:LTUS:725:STDZITOL") field(INPH, "QUAD:LTUS:725:DACSLOPE") field(INPI, "QUAD:LTUS:725: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, "QUAD:LTUS:725: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, "QUAD:LTUS:725:CALBSTEPNUM") field(INPB, "QUAD:LTUS:725:CALBIACTWF") field(INPC, "QUAD:LTUS:725:DACWF") field(INPF, "QUAD:LTUS:725: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 QUAD:LTUS:725CALBOK 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, "QUAD:LTUS:725:DEGAUSINIT") { field(DESC, "Proc. Degauss PVs on boot") field(PINI, "YES") field(DOL, "1") field(OUTA, "QUAD:LTUS:725:DEGAUSIMIN.PROC PP") field(OUTB, "QUAD:LTUS:725:DEGAUSIMAX.PROC PP") field(OUTC, "QUAD:LTUS:725:DEGAUSTYPE.PROC PP") field(OUTD, "QUAD:LTUS:725:DEGAUSSTEP.PROC PP") field(OUTE, "QUAD:LTUS:725:MADNAME.PROC PP") field(OUTF, "QUAD:LTUS:725:PSTYPE.PROC PP") field(OUTG, "QUAD:LTUS:725: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, "QUAD:LTUS:725:DEGAUSSUB") { field(DESC, "Degauss subroutine") field(INAM, "mgntDegaussInit") field(SNAM, "mgntDegauss") field(BRSV, "INVALID") field(INPA, "QUAD:LTUS:725:DEGAUSIMIN NPP NMS") field(INPB, "QUAD:LTUS:725:DEGAUSIMAX NPP NMS") field(INPC, "QUAD:LTUS:725:DEGAUSTYPE.RVAL NPP NMS") field(INPE, "QUAD:LTUS:725:DEGAUSMETHOD.RVAL NPP NMS") field(INPF, "QUAD:LTUS:725:PSTYPE NPP NMS") field(INPG, "QUAD:LTUS:725:DEBUG.RVAL NPP NMS") field(INPH, "QUAD:LTUS:725: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, "QUAD:LTUS:725:DEGAUSWF PP") field(OUTB, "QUAD:LTUS:725:DEGAUSMSG PP") field(OUTC, "QUAD:LTUS:725: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, "QUAD:LTUS:725:DEGAUSWF") { field(DESC, "Degauss Setpts") field(NELM, "60") field(FTVL, "DOUBLE") } record(mbbo,"QUAD:LTUS:725: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, "QUAD:LTUS:725: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, "QUAD:LTUS:725: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, "QUAD:LTUS:725: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, "QUAD:LTUS:725: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, "QUAD:LTUS:725:DEGAUSIMIN") { field(DESC, "Min. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "110.0") field(LOPR, "-110.0") field(DRVH, "110.0") field(DRVL, "-110.0") field(VAL, "-110.0") } record(ao, "QUAD:LTUS:725:DEGAUSIMAX") { field(DESC, "Max. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "110.0") field(LOPR, "-110.0") field(DRVH, "110.0") field(DRVL, "-110.0") field(VAL, "110.0") } # 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,"QUAD:LTUS:725: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, "QUAD:LTUS:725: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,"QUAD:LTUS:725: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, "QUAD:LTUS:725: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, "QUAD:LTUS:725: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, "QUAD:LTUS:725: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, "QUAD:LTUS:725:DEGAUSTOD") { field(DESC, "Successful Degauss Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "QUAD:LTUS:725:DEGAUSLOSTTOD") { field(DESC, "Degauss Lost Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:725:DEGAUSTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "QUAD:LTUS:725:DEGAUSTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "QUAD:LTUS:725: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, "QUAD:LTUS:725:DEGAUSGO") { field(DESC, "Set bdes of btrms to zero") field(ASG, "Internal") field(OUTA, "") field(OUTB, "") field(OUTC, "") field(OUTD, "") } # =========== CRYO ONLY =========== record(bo, "QUAD:LTUS:725: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, "QUAD:LTUS:725:DEGAUS_IMAX_CHECK") { field(DESC, "Check if imax shoud chg") field(CALC, "(C==4)&&(ABS(B)>ABS(A))?1:0") field(INPA, "QUAD:LTUS:725:DEGAUS_IMAX") field(INPB, "QUAD:LTUS:725:ISETPT") field(INPC, "QUAD:LTUS:725:DEGAUSTYPE.RVAL") field(OUT, "QUAD:LTUS:725:DEGAUS_IMAX_UPDATE.SELN") field(FLNK, "QUAD:LTUS:725:DEGAUS_IMAX_UPDATE") } record(seq, "QUAD:LTUS:725:DEGAUS_IMAX_UPDATE") { field(DESC, "Degauss IMAX Update") field(SELM, "Specified") field(DOL1, "QUAD:LTUS:725:ISETPT") field(LNK1, "QUAD:LTUS:725:DEGAUS_IMAX PP") } # Set the maximum current after a successful # degauss. This pv is updated by the # sequence. record(ao, "QUAD:LTUS:725:DEGAUS_IMAX") { field(DESC, "Max I set afer a degauss") field(EGU, "Amps") field(PINI, "YES") field(PREC, "6") field(HOPR, "110.0") field(LOPR, "-110.0") field(DRVH, "110.0") field(DRVL, "-110.0") field(VAL, "110.0") field(FLNK, "QUAD:LTUS:725:DEGAUS_IMAXPOL_CHECK") info(autosaveFields,"VAL,RVAL") } # Set the polarity if degauss_imax record(calcout, "QUAD:LTUS:725:DEGAUS_IMAXPOL_CHECK") { field(DESC, "Determine polarity of imax") field(CALC, "A>=0?0:1") field(INPA, "QUAD:LTUS:725:DEGAUS_IMAX") field(FLNK, "QUAD:LTUS:725:DEGAUS_IMAXPOL") } record(bo, "QUAD:LTUS:725:DEGAUS_IMAXPOL") { field(DESC, "Polarity of imax I") field(DTYP, "Raw Soft Channel") field(DOL, "QUAD:LTUS:725:DEGAUS_IMAXPOL_CHECK") field(OMSL, "closed_loop") field(ZNAM, "Positive") field(ONAM, "Negative") field(FLNK, "QUAD:LTUS:725: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, "QUAD:LTUS:725:DEGAUS_ABSIMAX") { field(DESC, "Absolute Max. Degauss I") field(CALC, "ABS(A)") field(INPA, "QUAD:LTUS:725:DEGAUS_IMAX") field(PREC, "6") field(EGU, "Amps") field(HOPR, "110.0") field(LOPR, "-110.0") info(autosaveFields,"VAL RVAL") } # IACT Polarity record(calcout, "QUAD:LTUS:725:IACTPOL_CHECK") { field(DESC, "Determine IACT polarity") field(SCAN, "5 second") field(CALC, "ABS(A-B)>C?(A>=0?0:1):D") field(INPA, "QUAD:LTUS:725:IACT") field(INPB, "QUAD:LTUS:725:IACTPOL_CHECK.LA") field(INPC, "0.0001") field(INPD, "QUAD:LTUS:725:IACTPOL_CHECK.PVAL") field(OOPT, "On Change") field(FLNK, "QUAD:LTUS:725:IACTPOL") } record(bo, "QUAD:LTUS:725: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,"QUAD:LTUS:725: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, "QUAD:LTUS:725:DEGAUSENABLE CP") field(INPB, "QUAD:LTUS:725:DEGAUSOK") field(INPC, "QUAD:LTUS:725:STATE CP") field(INPD, "QUAD:LTUS:725:STATE.SEVR") field(OUT, "QUAD:LTUS:725:DEGAUS_STATE_SEQ.SELN PP") field(ASG, "Internal") } record(seq, "QUAD:LTUS:725:DEGAUS_STATE_SEQ") { field(DESC, "Degauss State Sequence") field(SELM, "Specified") field(SELL, "QUAD:LTUS:725:DEGAUS_STATE_CHECK") field(LNK1, "QUAD:LTUS:725:DEGAUS_STATE_DISABLE.PROC PP") field(LNK2, "QUAD:LTUS:725:DEGAUS_STATE_LOST.PROC PP") field(LNK3, "QUAD:LTUS:725:DEGAUS_STATE_GOOD.PROC PP") field(LNK4, "QUAD:LTUS:725: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, "QUAD:LTUS:725:DEGAUS_STATE_DISABLE") { field(DESC, "Degauss not used") field(LNK1, "QUAD:LTUS:725:DEGAUSOK.ZSV") field(LNK2, "QUAD:LTUS:725: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, "QUAD:LTUS:725:STATMSG.FRSV") field(LNK4, "QUAD:LTUS:725: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, "QUAD:LTUS:725:DEGAUS_STATE_LOST") { field(DESC, "Degauss lost and ps On") field(DOL1, "1") field(LNK1, "QUAD:LTUS:725:DEGAUSOK.ZSV") field(LNK2, "QUAD:LTUS:725: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, "QUAD:LTUS:725:STATMSG.FRSV") field(LNK4, "QUAD:LTUS:725: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, "QUAD:LTUS:725:DEGAUS_STATE_OFF") { field(DESC, "Degaused lost and ps Off") field(DOL1, "2") field(LNK1, "QUAD:LTUS:725: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, "QUAD:LTUS:725:STATMSG.FRSV") field(LNK3, "QUAD:LTUS:725: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, "QUAD:LTUS:725:DEGAUS_STATE_GOOD") { field(DESC, "Degauss good") field(DOL1, "1") field(LNK1, "QUAD:LTUS:725: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, "QUAD:LTUS:725:STATMSG.FRSV PP") field(LNK3, "QUAD:LTUS:725:STATMSG.FVSV PP") field(LNK4, "") field(ASG, "Internal") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(mbbo, "QUAD:LTUS:725:FUNC") { field(DESC, "QUAD:LTUS:725 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, "1") field(THVL, "9") field(FRVL, "10") field(FVVL, "0") field(SXVL, "2") field(SVVL, "8") field(EIVL, "11") field(NIVL, "12") field(TEVL, "13") field(ELVL, "5") field(TVVL, "6") field(TTVL, "7") field(FTVL, "4") field(FFVL, "3") field(OUT, "QUAD:LTUS:725:CTRL CA") } # :CTRL pv is processed at boot in the # sequence mgntCtrl.st Processed in sequence # record(mbbo, "QUAD:LTUS:725:CTRL") { field(DESC, "QUAD:LTUS:725 Control") field(PINI, "NO") field(ZRST, "Ready") field(ONST, "TRIM") field(TWST, "PERTURB") field(THST, "BCON_TO_BDES") field(FRST, "BACT_TO_BDES") field(FVST, "SAVE_BDES") field(SXST, "LOAD_BDES") field(SVST, "UNDO_BDES") field(EIST, "DAC_ZERO") field(NIST, "CALB") field(TEST, "STDZ") field(ELST, "RESET") field(TVST, "TURN_ON") field(TTST, "TURN_OFF") field(FTST, "") field(FFST, "") field(ZRVL, "0") field(ONVL, "2") field(TWVL, "6") field(THVL, "15") field(FRVL, "14") field(FVVL, "11") field(SXVL, "12") field(SVVL, "13") field(EIVL, "7") field(NIVL, "3") field(TEVL, "4") field(ELVL, "8") field(TVVL, "9") field(TTVL, "10") field(FTVL, "0") field(FFVL, "0") field(OUT, "QUAD:LTUS:725:SELECTEN.A PP") field(SDIS, "0") } # If a function has been selected set this unit to busy record(calcout, "QUAD:LTUS:725:SELECTEN") { field(DESC, "Control Select Enable") field(CALC, "A>0?1:A") field(FLNK, "QUAD:LTUS:725:BUSY") } # Set to FREE on IOC reboot record(bo, "QUAD:LTUS:725:BUSY") { field(DESC, "QUAD:LTUS:725 Ctrl Done") field(DOL, "QUAD:LTUS:725:SELECTEN") field(ZNAM, "FREE") field(ONAM, "BUSY") field(PINI, "YES") field(FLNK, "QUAD:LTUS:725:SELECT") } record(bo, "QUAD:LTUS:725:SELECT") { field(ZNAM, "NO") field(ONAM, "YES") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") } record(bo, "QUAD:LTUS:725: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, "QUAD:LTUS:725:CTRLSTATE") { field(DESC, "QUAD:LTUS:725 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("QUAD:LTUS:725:CTRL",20,20,0,0,"QUAD:LTUS:725:CTRL") #! Field("QUAD:LTUS:725:CTRL.OUT",16777215,1,"QUAD:LTUS:725:CTRL.OUT") #! Link("QUAD:LTUS:725:CTRL.OUT","QUAD:LTUS:725:SELECTEN.A") #! Field("QUAD:LTUS:725:CTRL.VAL",16777215,1,"QUAD:LTUS:725:CTRL.VAL") #! Record("QUAD:LTUS:725:SELECTEN",321,381,0,0,"QUAD:LTUS:725:SELECTEN") #! Field("QUAD:LTUS:725:SELECTEN.A",16777215,0,"QUAD:LTUS:725:SELECTEN.A") #! Field("QUAD:LTUS:725:SELECTEN.FLNK",16777215,1,"QUAD:LTUS:725:SELECTEN.FLNK") #! Link("QUAD:LTUS:725:SELECTEN.FLNK","QUAD:LTUS:725:BUSY") #! Field("QUAD:LTUS:725:SELECTEN.VAL",16777215,1,"QUAD:LTUS:725:SELECTEN.VAL") #! Record("QUAD:LTUS:725:BUSY",623,274,0,0,"QUAD:LTUS:725:BUSY") #! Field("QUAD:LTUS:725:BUSY.DOL",16777215,0,"QUAD:LTUS:725:BUSY.DOL") #! Link("QUAD:LTUS:725:BUSY.DOL","QUAD:LTUS:725:SELECTEN.VAL") #! Field("QUAD:LTUS:725:BUSY.FLNK",16777215,1,"QUAD:LTUS:725:BUSY.FLNK") #! Link("QUAD:LTUS:725:BUSY.FLNK","QUAD:LTUS:725:SELECT") #! Record("QUAD:LTUS:725:SELECT",669,508,0,1,"QUAD:LTUS:725:SELECT") #! Record("QUAD:LTUS:725:FUNC",940,120,0,0,"QUAD:LTUS:725:FUNC") #! Field("QUAD:LTUS:725:FUNC.OUT",16777215,0,"QUAD:LTUS:725:FUNC.OUT") #! Link("QUAD:LTUS:725:FUNC.OUT","QUAD:LTUS:725:CTRL.VAL") #! Record("QUAD:LTUS:725:ABORT",193,41,0,0,"QUAD:LTUS:725:ABORT") #! Record("QUAD:LTUS:725:CTRLSTATE",369,34,0,0,"QUAD:LTUS:725: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,"QUAD:LTUS:725:SELECT is used for Multi-device selection.\nIt is enabled when associated QUAD:LTUS:725:CTRL is \"0\" (DONE).\nIt is disabled when associated QUAD:LTUS:725: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,"QUAD:LTUS:725: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, "QUAD:LTUS:725:BCTRL_INIT") { field(DESC, "Process BCTRL on boot") field(PINI, "YES") field(CALC, "A=3?1:0") field(INPA, "QUAD:LTUS:725:BCTRL.SEVR") field(OUT, "QUAD:LTUS:725: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, "QUAD:LTUS:725:BACT") { field(DESC, "Actual B") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "QUAD:LTUS:725:BACT") field(INPB, "QUAD:LTUS:725:POLYCOEF") field(INPC, "QUAD:LTUS:725:POLYCOEF.A") field(INPD, "QUAD:LTUS:725:POLYCOEF.B") field(INPE, "QUAD:LTUS:725:IACT MS") field(INPF, "QUAD:LTUS:725:BDELTAS PP") field(INPG, "100") field(EGU, "kG") field(HOPR, "-0.2086") field(LOPR, "-62.1054") field(HIHI, "-0.2086") field(LOLO, "-62.1054") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "-0.2086") field(LOW, "-62.1054") field(FLNK, "QUAD:LTUS:725: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, "QUAD:LTUS:725:BDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntPhyDeltas") field(EGU, "kG") field(HOPR, "1") field(PREC, "7") field(BRSV, "INVALID") field(INPA, "QUAD:LTUS:725:BDES") field(INPB, "QUAD:LTUS:725:TRIMBTOL") field(INPC, "QUAD:LTUS:725:TRIMBTOLR") field(INPD, "QUAD:LTUS:725:CHCKBTOL") field(INPE, "QUAD:LTUS:725:CHCKBTOLR") field(F, "2.0") field(INPG, "30") field(INPH, "QUAD:LTUS:725:BACT.VAL") # # MPS absolute and relative tolerances field(INPP, "QUAD:LTUS:725:MPSBTOL") field(INPQ, "QUAD:LTUS:725:MPSBTOLR") field(FLNK, "QUAD:LTUS:725:BCONLIMITS") info(autosaveFields,"F") } # This record is processed by BDELTAS record(aSub, "QUAD:LTUS:725:BCONLIMITS") { field(DESC, "Config B-field Limits") field(INAM, "mgntInit") field(SNAM, "mgntBCONLimits") field(INPA, "QUAD:LTUS:725:BDES") field(INPB, "QUAD:LTUS:725:BDELTAS.I") field(INPG, "QUAD:LTUS:725:DEBUG.RVAL") field(FTA, "DOUBLE") field(FTB, "DOUBLE") field(FTG, "ULONG") field(OUTA, "QUAD:LTUS:725:BCON.HIGH") field(OUTB, "QUAD:LTUS:725:BCON.LOW") field(OUTC, "QUAD:LTUS:725:BCON.HIHI") field(OUTD, "QUAD:LTUS:725:BCON.LOLO PP") field(FTVA, "DOUBLE") field(FTVB, "DOUBLE") field(FTVC, "DOUBLE") field(FTVD, "DOUBLE") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:725:IDELTAS") } # The following PV is processed by :BACT # which is processed by :BACT # record(fanout, "QUAD:LTUS:725:BACTFO") { field(DESC, "BACT processing") field(SELM, "All") field(LNK1, "QUAD:LTUS:725:BDIFF") field(LNK2, "QUAD:LTUS:725:BADIFF") field(LNK3, "QUAD:LTUS:725:BRATIO") field(LNK4, "QUAD:LTUS:725:MPSLIMITS") field(LNK5, "QUAD:LTUS:725:I2BSTATUS") field(LNK6, "QUAD:LTUS:725:IACTFO.PROC") } record(calc, "QUAD:LTUS:725:BDIFF") { field(DESC, "BDES-BACT") field(CALC, "A-B") field(INPA, "QUAD:LTUS:725:BDES") field(INPB, "QUAD:LTUS:725:BACT") field(EGU, "kG") field(PREC, "7") } record(calc, "QUAD:LTUS:725:BADIFF") { field(DESC, "Absolute BDES-BACT") field(INPA, "QUAD:LTUS:725:BDIFF") field(EGU, "kG") field(PREC, "7") field(CALC, "A<0?ABS(A):A") } record(calc, "QUAD:LTUS:725:BRATIO") { field(DESC, "BACT Error") field(CALC, "B?A/B:0") field(INPA, "QUAD:LTUS:725:BDIFF") field(INPB, "QUAD:LTUS:725:BDES.HOPR") field(EGU, "kG") field(PREC, "7") } record(mbbi, "QUAD:LTUS:725: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, "QUAD:LTUS:725:BACT.J") } # Note: for a string slave set the MONFL # macro to the following: # MONFL=:IMONCALC MS record(sub, "QUAD:LTUS:725:BMON") { field(DESC, "Second Transductor") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "QUAD:LTUS:725:BMON") field(INPB, "QUAD:LTUS:725:POLYCOEF") field(INPC, "QUAD:LTUS:725:POLYCOEF.A") field(INPD, "QUAD:LTUS:725:POLYCOEF.B") field(INPE, "QUAD:LTUS:725:IMON MS") field(INPF, "QUAD:LTUS:725:BDELTAS.VAL") field(INPG, "100") field(EGU, "kG") field(HOPR, "-0.2086") field(LOPR, "-62.1054") field(HIHI, "-0.2086") field(LOLO, "-62.1054") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "-0.2086") field(LOW, "-62.1054") } # 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=PSC:LTUS:MG23:BDES CP record(ao, "QUAD:LTUS:725:BDES") { field(DESC, "Desired B-Field") field(PINI, "YES") field(DRVH, "-0.2086") field(DRVL, "-62.1054") field(HOPR, "-0.2086") field(LOPR, "-62.1054") field(PREC, "7") field(EGU, "kG") field(MDEL, "-1") field(OMSL, "supervisory") # field(DOL, "") field(OUT, "QUAD:LTUS:725:B2IDES PP") info(autosaveFields,"VAL") } record(sub, "QUAD:LTUS:725:B2IDES") { field(DESC, "Convert Desired B-Field to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:725:POLYCOEF") field(INPC, "QUAD:LTUS:725:POLYCOEF.A") field(INPD, "QUAD:LTUS:725:POLYCOEF.B") field(PREC, "7") field(EGU, "kG") field(HOPR, "-0.2086") field(LOPR, "-62.1054") field(MDEL, "-1") field(INPE, "QUAD:LTUS:725:BDES.DRVH") field(INPF, "QUAD:LTUS:725:BDES.DRVL") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:725:IDES") } record(sub, "QUAD:LTUS:725:BNOM") { field(DESC, "Nominal Field") field(PINI, "YES") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:725:POLYCOEF") field(INPC, "QUAD:LTUS:725:POLYCOEF.A") field(INPD, "QUAD:LTUS:725:POLYCOEF.B") field(INPE, "QUAD:LTUS:725:BDES.DRVH") field(INPF, "QUAD:LTUS:725:BDES.DRVL") field(EGU, "kG") field(HOPR, "-0.2086") field(LOPR, "-62.1054") field(PREC, "7") field(VAL, "0.0") field(FLNK, "QUAD:LTUS:725:INOM") } record(sub, "QUAD:LTUS:725:BACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:725:BDES.VAL") field(INPB, "QUAD:LTUS:725:BDES.DRVH") field(INPC, "QUAD:LTUS:725:BDES.DRVL") field(INPD, "QUAD:LTUS:725:BDELTAS.I") field(INPE, "QUAD:LTUS:725:BDELTAS.J") field(INPG, "QUAD:LTUS:725:STATE") field(INPH, "QUAD:LTUS:725:HSTA") field(EGU, "kG") field(HOPR, "-0.2086") field(LOPR, "-62.1054") field(PREC, "7") field(BRSV, "INVALID") } record(sub, "QUAD:LTUS:725:BMONLIMITS") { field(DESC, "MON Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:725:BDES.VAL") field(INPB, "QUAD:LTUS:725:BDES.DRVH") field(INPC, "QUAD:LTUS:725:BDES.DRVL") field(INPD, "QUAD:LTUS:725:BDELTAS.K") field(INPE, "QUAD:LTUS:725:BDELTAS.L") field(INPG, "QUAD:LTUS:725:STATE") field(INPH, "QUAD:LTUS:725:HSTA") field(EGU, "kG") field(HOPR, "-0.2086") field(LOPR, "-62.1054") field(PREC, "7") field(BRSV, "INVALID") } record(seq, "QUAD:LTUS:725:BLIMITS") { field(DESC, "ACT Limits") field(PREC, "7") field(DOL1, "QUAD:LTUS:725:BLIMITS") field(LNK1, "QUAD:LTUS:725:BACTLIMITS.F PP") field(DOL2, "QUAD:LTUS:725:BACTLIMITS.I") field(LNK2, "QUAD:LTUS:725:BACT.HIGH") field(DOL3, "QUAD:LTUS:725:BACTLIMITS.J") field(LNK3, "QUAD:LTUS:725:BACT.LOW") field(DOL4, "QUAD:LTUS:725:BACTLIMITS.K") field(LNK4, "QUAD:LTUS:725:BACT.HIHI") field(DOL5, "QUAD:LTUS:725:BACTLIMITS.L") field(LNK5, "QUAD:LTUS:725:BACT.LOLO") field(DOL6, "QUAD:LTUS:725:BLIMITS") field(LNK6, "QUAD:LTUS:725:BMONLIMITS.F PP") field(DOL7, "QUAD:LTUS:725:BMONLIMITS.I") field(LNK7, "QUAD:LTUS:725:BMON.HIGH") field(DOL8, "QUAD:LTUS:725:BMONLIMITS.J") field(LNK8, "QUAD:LTUS:725:BMON.LOW") field(DOL9, "QUAD:LTUS:725:BMONLIMITS.K") field(LNK9, "QUAD:LTUS:725:BMON.HIHI") field(DOLA, "QUAD:LTUS:725:BMONLIMITS.L") field(LNKA, "QUAD:LTUS:725:BMON.LOLO") field(FLNK, "QUAD:LTUS:725:ILIMITS") field(SCAN, "5 second") } record(ao, "QUAD:LTUS:725:BCTRL") { field(DESC, "B-Perturb") field(PREC, "7") field(EGU, "kG") field(DRVH, "-0.2086") field(DRVL, "-62.1054") field(HOPR, "-0.2086") field(LOPR, "-62.1054") # 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, "QUAD:LTUS:725: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, "QUAD:LTUS:725:BCTRLGO") { field(DESC, "Update DES and perturb") field(PREC, "7") # Disable BACT limits field(DOL1, "1") field(LNK1, "QUAD:LTUS:725:BLIMITS.VAL") # Update BDES with the BCTRL (slider) value field(DOL2, "QUAD:LTUS:725:BCTRL.VAL") field(LNK2, "QUAD:LTUS:725:BDES PP") field(DOL3, "1") field(LNK3, "QUAD:LTUS:725:IDIRECT.PROC PP") field(DOL4, "1") field(LNK4, "QUAD:LTUS:725:CHECKSTDZLOST.PROC PP") field(DOL5, "QUAD:LTUS:725:BCTRL.VAL") field(LNK5, "QUAD:LTUS:725:BCTRLSUB PP") # Re-enable BACT limits field(DOL6, "0") field(LNK6, "QUAD:LTUS:725:BLIMITS.VAL") } # Convert B-field to Current and output to ISETPT record(sub, "QUAD:LTUS:725:BCTRLSUB") { field(DESC, "Feedback") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:725:POLYCOEF") field(INPC, "QUAD:LTUS:725:POLYCOEF.A") field(INPD, "QUAD:LTUS:725:POLYCOEF.B") field(INPE, "QUAD:LTUS:725:BDES.DRVH") field(INPF, "QUAD:LTUS:725:BDES.DRVL") field(PREC, "7") field(EGU, "kG") field(HOPR, "-0.2086") field(LOPR, "-62.1054") field(MDEL, "-1") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:725:ISETPT") } record(ao, "QUAD:LTUS:725:BDESPREVTRIM") { field(DESC, "trim bdes for undo") field(DTYP, "Soft Channel") field(DRVH, "-0.2086") field(DRVL, "-62.1054") field(EGU, "kG") field(HOPR, "-0.2086") field(LOPR, "-62.1054") field(PREC, "7") field(PINI, "YES") info(autosaveFields,"VAL") } record(stringin, "QUAD:LTUS:725:MADNAME") { field(DESC, "MAD deck nomenclature") field(PINI, "YES") field(VAL, "QFXL1") } record(ai, "QUAD:LTUS:725: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, "3438.257876") } record(ao, "QUAD:LTUS:725:BMAX") { field(DESC, "Max B-Field") field(DTYP, "Soft Channel") field(DRVH, "-0.2086") field(DRVL, "-62.1054") field(EGU, "kG") field(HOPR, "-0.2086") field(LOPR, "-62.1054") field(PREC, "7") field(PINI, "YES") field(VAL, "-0.2086") field(FLNK, "QUAD:LTUS:725:BSTEP") } record(ao, "QUAD:LTUS:725:BMIN") { field(DESC, "Min B-Field") field(DTYP, "Soft Channel") field(DRVH, "-0.2086") field(DRVL, "-62.1054") field(EGU, "kG") field(HOPR, "-0.2086") field(LOPR, "-62.1054") field(PREC, "7") field(PINI, "YES") field(VAL, "-62.1054") field(FLNK, "QUAD:LTUS:725:BSTEP") } record(ao, "QUAD:LTUS:725:BDESSAVE") { field(DESC, "bdes for save/load") field(DTYP, "Soft Channel") field(DRVH, "-0.2086") field(DRVL, "-62.1054") field(EGU, "kG") field(HOPR, "-0.2086") field(LOPR, "-62.1054") field(PINI, "YES") field(PREC, "7") } # This record is processed by QUAD:LTUS:725: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, "QUAD:LTUS:725:BCON") { field(DESC, "Config B-Field ") field(DTYP, "Soft Channel") field(PREC, "7") field(EGU, "kG") field(HOPR, "-0.2086") field(LOPR, "-62.1054") field(DRVH, "-0.2086") field(DRVL, "-62.1054") # Set MINOR Alarm as the default, slaves will set NO_ALARM=0. field(HHSV, "MINOR") field(LLSV, "MINOR") field(HSV, "MINOR") field(LSV, "MINOR") # field(DOL , "") field(OMSL, "supervisory") field(OUT, "QUAD:LTUS:725:B2ICON PP") info(autosaveFields,"VAL") } record(sub, "QUAD:LTUS:725:B2ICON") { field(DESC, "Convert Desired ICon to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:725:POLYCOEF") field(INPC, "QUAD:LTUS:725:POLYCOEF.A") field(INPD, "QUAD:LTUS:725:POLYCOEF.B") field(PREC, "7") field(EGU, "kG") field(HOPR, "-0.2086") field(LOPR, "-62.1054") field(MDEL, "-1") field(INPE, "QUAD:LTUS:725:BCON.DRVH") field(INPF, "QUAD:LTUS:725:BCON.DRVL") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:725: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, "QUAD:LTUS:725:BSTEP") { field(DESC, "B-Field step size") field(CALC, "(C==3)||(D==3)?0:ABS(A-B)*0.005") field(INPA, "QUAD:LTUS:725:BMAX") field(INPB, "QUAD:LTUS:725:BMIN") field(INPC, "QUAD:LTUS:725:BMIN.SEVR") field(INPD, "QUAD:LTUS:725:BMAX.SEVR") field(EGU, "kG") 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,"QUAD:LTUS:725:BCTRLDISABLECALC") { field(DESC, "Calc for disabling BCTRL") field(ASG, "Internal") field(CALC, "A?2:1") field(INPA, "QUAD:LTUS:725:ONLINE CP") field(OUT, "QUAD:LTUS:725:BCTRLDISABLEFOUT PP") } record(fanout, "QUAD:LTUS:725:BCTRLDISABLEFOUT") { field(DESC, "Disable BCTRL fanout") field(SELM, "Specified") field(SELL, "QUAD:LTUS:725:BCTRLDISABLECALC") field(LNK1, "QUAD:LTUS:725:BCTRLDISABLE") field(LNK2, "QUAD:LTUS:725:BCTRLENABLE") } record(stringout, "QUAD:LTUS:725:BCTRLDISABLE") { field(DESC, "Disable BCTRL") field(DTYP, "Soft Channel") field(OUT, "QUAD:LTUS:725:BCTRL.ASG") field(VAL, "NOWRITE") field(FLNK, "QUAD:LTUS:725:BCTRLDISV_UPDATE") } record(stringout, "QUAD:LTUS:725:BCTRLENABLE") { field(DESC, "Enable BCTRL") field(DTYP, "Soft Channel") field(OUT, "QUAD:LTUS:725:BCTRL.ASG") field(VAL, "") field(FLNK, "QUAD:LTUS:725:BCTRLDISV_UPDATE") } record(calcout, "QUAD:LTUS:725:BCTRLDISV_UPDATE") { field(DESC, "Calc for updating BCTRL.DISV") field(ASG, "Internal") field(CALC, "A") field(INPA, "QUAD:LTUS:725:ONLINE") field(OUT, "QUAD:LTUS:725: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,"QUAD:LTUS:725:BACT and MON\n are processed via links from \n QUAD:LTUS:725:IACT (device raw value readback 1)\n and\n QUAD:LTUS:725: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 QUAD:LTUS:725:POLYCOEF\nC = First polynomial coefficient (offset if linear)\nD = Second polynomial coefficient (slope if linear)\nE = QUAD:LTUS:725: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,"QUAD:LTUS:725:BDES\n is processed when set by CA users or \n QUAD:LTUS:725: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,"QUAD:LTUS:725: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 QUAD:LTUS:725: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 (QUAD:LTUS:725: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,"QUAD:LTUS:725:B*LIMITS and QUAD:LTUS:725:BLIMITS:\n Calculate alarm and warning limits based on \n deltas from QUAD:LTUS:725: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,"QUAD:LTUS:725: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,"QUAD:LTUS:725: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, "QUAD:LTUS:725: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, "QUAD:LTUS:725:MPSBTOL") { field(DESC, "Absolute mps tol") field(EGU, "kG") field(PREC, "2") field(CALC, "ABS(A)*0.02") field(INPA, "QUAD:LTUS:725:BMAX") field(PINI, "YES") } # # 21-Aug-2013: K. Luchini # Set channel access security so that users # cannot easily change values. record(ao, "QUAD:LTUS:725:MPSBMAX") { field(DESC, "MPS Max B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "-0.2086") field(DRVL, "-62.1054") field(PINI, "YES") field(VAL, "-0.2086") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:725:MPSBMIN") { field(DESC, "MPS Min B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "-0.2086") field(DRVL, "-62.1054") field(PINI, "YES") field(VAL, "-62.1054") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:725:MPSBLLIM") { field(DESC, "MPS Low Limit B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "-0.2086") field(DRVL, "-62.1054") field(PINI, "YES") field(VAL, "-62.1054") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:725:MPSBLLIM2") { field(DESC, "MPS Low Limit #2 B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "-0.2086") field(DRVL, "-62.1054") field(PINI, "YES") field(VAL, "-62.1054") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } # Set the default to Std record(mbbo, "QUAD:LTUS:725: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, "QUAD:LTUS:725:MPSLIMITS.E PP") } record(aSub, "QUAD:LTUS:725: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, "QUAD:LTUS:725:MPS.RVAL") field(INPB, "QUAD:LTUS:725:BADIFF") field(INPC, "QUAD:LTUS:725:BDELTAS.N") field(INPD, "QUAD:LTUS:725:BACT") field(INPE, "QUAD:LTUS:725:MPSBITMASK.RVAL") field(INPF, "QUAD:LTUS:725:MPSBLLIM") field(INPG, "QUAD:LTUS:725:MPSBMIN") field(INPH, "QUAD:LTUS:725:MPSBMAX") field(INPI, "QUAD:LTUS:725: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, "QUAD:LTUS:725:INTOL.RVAL PP") field(OUTB, "QUAD:LTUS:725:INTOL_BMIN.RVAL PP") field(OUTC, "QUAD:LTUS:725:INTOL_BRANGE.RVAL PP") field(OUTD, "QUAD:LTUS:725: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, "QUAD:LTUS:725:INTOL") { field(DESC, "BACT within MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:725:MPSLIMITS.VALA") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "QUAD:LTUS:725:INTOL_BMIN") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:725:MPSLIMITS.VALB") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "QUAD:LTUS:725:INTOL_BMIN2") { field(DESC, "MPS tol #2") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:725:MPSLIMITS.VALD") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "QUAD:LTUS:725:INTOL_BRANGE") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:725: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, "QUAD:LTUS:725:CHCKITOL") { field(DESC, "Absolute Check I Tolerance") field(EGU, "A") field(FLNK, "QUAD:LTUS:725:TRIMITOL") field(CALC, "ABS(A*B)") field(INPA, "QUAD:LTUS:725:CHCKBTOL") field(INPB, "QUAD:LTUS:725:POLYCOEF.B") field(PREC, "9") } record(calc, "QUAD:LTUS:725:TRIMBTOL") { field(EGU, "kG") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(DESC, "Absolute Trim Tolerance") field(CALC, "ABS(A)/2") field(INPA, "QUAD:LTUS:725:CHCKBTOL") field(FLNK, "QUAD:LTUS:725:CHCKITOL") } record(calc, "QUAD:LTUS:725:CHCKBTOL") { field(DESC, "Check absolute tolerance") field(EGU, "A") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(FLNK, "QUAD:LTUS:725:TRIMBTOL") field(CALC, "MAX(ABS(A),ABS(C))*(B/1000000)") field(INPA, "QUAD:LTUS:725:BDES.HOPR") field(INPB, "QUAD:LTUS:725:STABILITY") field(INPC, "QUAD:LTUS:725:BDES.LOPR") } record(longout, "QUAD:LTUS:725: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, "QUAD:LTUS:725:CHCKBTOL") } record(calc, "QUAD:LTUS:725:TRIMITOL") { field(DESC, "Absolute Trim I Tolerance") field(EGU, "kG") field(CALC, "ABS(A*B)") field(INPA, "QUAD:LTUS:725:POLYCOEF.B") field(INPB, "QUAD:LTUS:725:TRIMBTOL") field(PREC, "9") } record(ai, "QUAD:LTUS:725:TRIMBTOLR") { field(DESC, "Relative trim tol") field(PREC, "4") field(EGU, "%") field(HOPR, "1.0") field(LOPR, "0.0") field(PINI, "YES") } record(ai, "QUAD:LTUS:725: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, "QUAD:LTUS:725:FBCKFCOM") { field(ZNAM, "CA") field(ONAM, "FCOM") field(DESC, "CA Mode") field(PINI, "YES") field(SDIS, "0") } record(bo, "QUAD:LTUS:725:PAU") { field(ZNAM, "NotConfigured") field(ONAM, "Configured") field(DESC, "PAU Present") field(PINI, "YES") field(SDIS, "0") field(FLNK, "QUAD:LTUS:725:PAUGO") } record(fanout, "QUAD:LTUS:725:PAUGO") { field(DESC, "PAU control") field(LNK1, "QUAD:LTUS:725:PAUSTOP") field(LNK2, "QUAD:LTUS:725: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, "QUAD:LTUS:725:PAUSTART") { field(DESC, "Setup for PAU On") field(SDIS, "QUAD:LTUS:725: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, "QUAD:LTUS:725:PAUSTOP") { field(DESC, "Setup for PAU Off") field(SDIS, "QUAD:LTUS:725: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, "QUAD:LTUS:725:MCORDEVNAME") { field(DESC, "PS device name") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, "PSC:LTUS:MG23:") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "QUAD:LTUS:725: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, "QUAD:LTUS:725:PSTYPE.RVAL") field(INPC, "QUAD:LTUS:725:TURNEDOFF.RVAL") field(INPD, "QUAD:LTUS:725:CONFIG.RVAL") field(INPE, "QUAD:LTUS:725:PSCATEGORY.RVAL") field(INPF, "QUAD:LTUS:725:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "QUAD:LTUS:725:AUTOCTRL.RVAL") field(INPJ, "QUAD:LTUS:725:OUTOFSERVICE.RVAL") field(INPL, "QUAD:LTUS:725:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "QUAD:LTUS:725:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "QUAD:LTUS:725:PAU") field(INPP, "QUAD:LTUS:725:CALBDISABLE.RVAL") field(INPQ, "QUAD:LTUS:725:PTRBDISABLE.RVAL") field(INPR, "QUAD:LTUS:725:TRIMDISABLE.RVAL") field(INPS, "QUAD:LTUS:725:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "QUAD:LTUS:725:FBCK") field(INPU, "QUAD:LTUS:725:TRIMTYPE.RVAL") field(INPV, "QUAD:LTUS:725:STDZDIRECT.RVAL") field(INPW, "QUAD:LTUS:725:DEGAUSENABLE.RVAL") field(FLNK, "QUAD:LTUS:725:HSTA") } record(longin, "QUAD:LTUS:725:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "QUAD:LTUS:725:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "QUAD:LTUS:725: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, "QUAD:LTUS:725: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, "QUAD:LTUS:725:CALBDISABLE") { field(DESC, "DAC Calb Disabled") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:725:PTRBDISABLE") { field(DESC, "Perturb Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:725:TRIMDISABLE") { field(DESC, "Trim Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:725: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 QUAD:LTUS:725:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses QUAD:LTUS:725:FBCK. # This PV should be replaced by QUAD:LTUS:725: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, "QUAD:LTUS:725: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, "QUAD:LTUS:725: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, "QUAD:LTUS:725: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, "") field(OMSL, "supervisory") field(FLNK, "QUAD:LTUS:725:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"QUAD:LTUS:725:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "QUAD:LTUS:725:OUTOFSERVICE NPP NMS") field(OUT, "QUAD:LTUS:725:ONLINE PP") } record(bo, "QUAD:LTUS:725:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "QUAD:LTUS:725: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, "1") } record(bo, "QUAD:LTUS:725: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, "1") } record(bo, "QUAD:LTUS:725: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, "QUAD:LTUS:725: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, "QUAD:LTUS:725: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, "QUAD:LTUS:725: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, "QUAD:LTUS:725: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, "QUAD:LTUS:725: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, "1") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:725: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, "1") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:725: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, "2") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:725: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, "0") field(ASG, "NOWRITE") field(FLNK, "QUAD:LTUS:725:TRIMTYPE") } record(stringout, "QUAD:LTUS:725:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "QUAD:LTUS:725:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "QUAD:LTUS:725:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "QUAD:LTUS:725:STATE.RVAL") field(INPB, "QUAD:LTUS:725:INTLKSUMY.RVAL") field(OUT, "QUAD:LTUS:725:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:LTUS:725: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, "QUAD:LTUS:725:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "QUAD:LTUS:725:STATE.RVAL") field(INPB, "QUAD:LTUS:725:INTLKSUMY.RVAL") field(OUT, "QUAD:LTUS:725:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:LTUS:725:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "QUAD:LTUS:725:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "QUAD:LTUS:725: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, "QUAD:LTUS:725:RAMPSTARTDLY") { field(DESC, "Tansition to ramp delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "2") } ######### For PSTYPE=2 Only ############# record(mbbo, "QUAD:LTUS:725: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, "QUAD:LTUS:725: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,"QUAD:LTUS:725: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("QUAD:LTUS:725:TURNEDOFF",3140,1907,0,1,"QUAD:LTUS:725:TURNEDOFF") #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "QUAD:LTUS:725:STATSUB") { field(DESC, "Build STATus ") field(INAM, "mgntInit") field(SNAM, "mgntSlcStat") field(INPA, "QUAD:LTUS:725:BACT.STAT") field(INPB, "QUAD:LTUS:725:BDES.STAT") field(INPC, "QUAD:LTUS:725:IRIPL.STAT") field(INPD, "PSC:LTUS:MG23:ISETPT.STAT") field(INPE, "PSC:LTUS:MG23:IACT.STAT") # 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, "QUAD:LTUS:725:BACT.SEVR") field(INPH, "QUAD:LTUS:725:BDES.SEVR") field(INPI, "QUAD:LTUS:725:IRIPL.SEVR") field(INPJ, "PSC:LTUS:MG23:ISETPT.SEVR") field(INPK, "PSC:LTUS:MG23:IACT.SEVR") # # 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, "QUAD:LTUS:725:STATE.RVAL") field(INPN, "QUAD:LTUS:725:STDZOK") field(INPO, "QUAD:LTUS:725:CALBOK") field(INPP, "QUAD:LTUS:725:OUTOFSERVICE.RVAL") field(INPQ, "QUAD:LTUS:725:CONFIG.RVAL") field(INPR, "QUAD:LTUS:725:HSTA") field(INPS, "QUAD:LTUS:725:CTRL.RVAL") field(INPT, "QUAD:LTUS:725:DEGAUSOK") field(INPV, "QUAD:LTUS:725: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, "QUAD:LTUS:725:STAT") } record(longout, "QUAD:LTUS:725:STAT") { field(DESC, "STAT sent to SLC") field(SCAN, "Passive") field(FLNK, "QUAD:LTUS:725:STATCTRLSUB") field(DOL, "QUAD:LTUS:725:STATSUB.VAL") field(OMSL, "closed_loop") } record(sSub, "QUAD:LTUS:725:STATCTRLSUB") { field(DESC, "Decode SLC STAT into mbbo") field(INAM, "mgntInit") field(SNAM, "mgntStatDecode") field(INPA, "QUAD:LTUS:725:STAT") field(INPB, "QUAD:LTUS:725:HSTA") field(INPD, "QUAD:LTUS:725:ONOFFCTRL.RVAL") field(FLNK, "QUAD:LTUS:725:STATMSG") } record(mbbo, "QUAD:LTUS:725: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, "QUAD:LTUS:725:UNAVAILGO") field(DOL, "QUAD:LTUS:725:STATCTRLSUB.W") } record(seq, "QUAD:LTUS:725:UNAVAILGO") { field(DESC, "Process UNAVAIL") field(DOL1, "QUAD:LTUS:725:STATSUB.U") field(LNK1, "QUAD:LTUS:725:UNAVAIL PP") } record(stringout, "QUAD:LTUS:725:SNLSTATMSG") { field(DTYP, "Soft Channel") } #! TextBox(TB0,820,1000,1200,1220,0,"Dialog",12,1,16777215,"QUAD:LTUS:725:STATUSSUB - future\nOverall device status - takes input from action snls, record sevrs, master snl(s) and outputs final status\n\nInputs:\nA - QUAD:LTUS:725:CTRLSTATUS - snl status\nB - MGNT:CTRLSTATUS - master list status\nC\nD - QUAD:LTUS:725: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,"QUAD:LTUS:725STATSUB\nformat control bo's into slc STAT\n\nInputs:\nA - QUAD:LTUS:725:STATUS\nC - QUAD:LTUS:725:ON\nD - QUAD:LTUS:725:STDZOK\nE - QUAD:LTUS:725:CALBOK\nF - QUAD:LTUS:725:BACTDRIFT (future)\nG -\nH- QUAD:LTUS:725:DACSTATUS\nI -QUAD:LTUS:725:ADCSTATUS\nJ - QUAD:LTUS:725:BACTSTATUS\nK - QUAD:LTUS:725:BDESSTATUS\nL - QUAD:LTUS:725:RIPLSTATUS\n\nOutput:\nP - QUAD:LTUS:725: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, "QUAD:LTUS:725: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, "QUAD:LTUS:725: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, "QUAD:LTUS:725: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, "QUAD:LTUS:725: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.6 #! DBDSTART #! DBD("../../../../dbd/mgntSoft.dbd") #! DBDEND record(stringout, "QUAD:LTUS:725:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:725:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "QUAD:LTUS:725:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "QUAD:LTUS:725:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "QUAD:LTUS:725:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "QUAD:LTUS:725:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "1") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "QUAD:LTUS:725: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, "QUAD:LTUS:725:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "QUAD:LTUS:725:TRIMTYPE.RVAL") field(INPB, "QUAD:LTUS:725:CONFIG.RVAL") field(OUT, "QUAD:LTUS:725:TRIMMAXNUM PP") } record(longout, "QUAD:LTUS:725: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, "QUAD:LTUS:725: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, "") field(OMSL, "supervisory") field(VAL, "20") field(OUT, "QUAD:LTUS:725:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "QUAD:LTUS:725: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, "") field(OMSL, "supervisory") field(VAL, "10") } record(bo, "QUAD:LTUS:725: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, "QUAD:LTUS:725: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, "QUAD:LTUS:725: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, "QUAD:LTUS:725:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "0") } record(ao, "QUAD:LTUS:725: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, "QUAD:LTUS:725:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "QUAD:LTUS:725: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, "QUAD:LTUS:725: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, "QUAD:LTUS:725:IMOVE") field(INPB, "QUAD:LTUS:725:IACT") field(INPC, "QUAD:LTUS:725:IRAMPRATE") field(INPD, "1.577") field(INPE, "QUAD:LTUS:725:TRIMDLYPCT") field(INPF, "QUAD:LTUS:725:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "QUAD:LTUS:725:RAMPTIME_LEFT PP") } record(longout, "QUAD:LTUS:725:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "QUAD:LTUS:725:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "QUAD:LTUS:725:RAMPDONE_CALC") } record(calc, "QUAD:LTUS:725:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "QUAD:LTUS:725:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "QUAD:LTUS:725:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "QUAD:LTUS:725: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, "QUAD:LTUS:725:RAMPTIME_LEFT") field(OUT, "QUAD:LTUS:725:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "QUAD:LTUS:725:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "QUAD:LTUS:725:RAMPTIME_LEFT NMS") field(OUT, "QUAD:LTUS:725:RAMPDONE PP") } record(bo, "QUAD:LTUS:725:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "QUAD:LTUS:725:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "QUAD:LTUS:725: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, "QUAD:LTUS:725: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(sSub, "QUAD:LTUS:725: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, "QUAD:LTUS:725:PSTYPE.RVAL") field(INPC, "QUAD:LTUS:725:TURNEDOFF.RVAL") field(INPD, "QUAD:LTUS:725:CONFIG.RVAL") field(INPE, "QUAD:LTUS:725:PSCATEGORY.RVAL") field(INPF, "QUAD:LTUS:725:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "QUAD:LTUS:725:AUTOCTRL.RVAL") field(INPJ, "QUAD:LTUS:725:OUTOFSERVICE.RVAL") field(INPL, "QUAD:LTUS:725:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "QUAD:LTUS:725:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "QUAD:LTUS:725:PAU") field(INPP, "QUAD:LTUS:725:CALBDISABLE.RVAL") field(INPQ, "QUAD:LTUS:725:PTRBDISABLE.RVAL") field(INPR, "QUAD:LTUS:725:TRIMDISABLE.RVAL") field(INPS, "QUAD:LTUS:725:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "QUAD:LTUS:725:FBCK") field(INPU, "QUAD:LTUS:725:TRIMTYPE.RVAL") field(INPV, "QUAD:LTUS:725:STDZDIRECT.RVAL") field(INPW, "QUAD:LTUS:725:DEGAUSENABLE.RVAL") field(FLNK, "QUAD:LTUS:725:HSTA") } record(longin, "QUAD:LTUS:725:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "QUAD:LTUS:725:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "QUAD:LTUS:725: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, "QUAD:LTUS:725: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, "QUAD:LTUS:725:CALBDISABLE") { field(DESC, "DAC Calb Disabled") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:725:PTRBDISABLE") { field(DESC, "Perturb Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:725:TRIMDISABLE") { field(DESC, "Trim Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:725:STDZDISABLE") { field(DTYP, "Raw Soft Channel") field(ZNAM, "NO") field(ONAM, "YES") field(DESC, "Standardize Function") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } # This PV has been replaced by QUAD:LTUS:725:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses QUAD:LTUS:725:FBCK. # This PV should be replaced by QUAD:LTUS:725: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, "QUAD:LTUS:725: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, "QUAD:LTUS:725: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, "QUAD:LTUS:725: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, "") field(OMSL, "supervisory") field(FLNK, "QUAD:LTUS:725:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"QUAD:LTUS:725:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "QUAD:LTUS:725:OUTOFSERVICE NPP NMS") field(OUT, "QUAD:LTUS:725:ONLINE PP") } record(bo, "QUAD:LTUS:725:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "QUAD:LTUS:725: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, "1") } record(bo, "QUAD:LTUS:725: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, "1") } record(bo, "QUAD:LTUS:725: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, "QUAD:LTUS:725: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, "QUAD:LTUS:725: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, "QUAD:LTUS:725: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, "QUAD:LTUS:725: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, "QUAD:LTUS:725: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, "1") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:725: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, "1") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:725: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, "2") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:725: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, "0") field(ASG, "NOWRITE") field(FLNK, "QUAD:LTUS:725:TRIMTYPE") } record(stringout, "QUAD:LTUS:725:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "QUAD:LTUS:725:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "QUAD:LTUS:725:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "QUAD:LTUS:725:STATE.RVAL") field(INPB, "QUAD:LTUS:725:INTLKSUMY.RVAL") field(OUT, "QUAD:LTUS:725:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:LTUS:725: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, "QUAD:LTUS:725:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "QUAD:LTUS:725:STATE.RVAL") field(INPB, "QUAD:LTUS:725:INTLKSUMY.RVAL") field(OUT, "QUAD:LTUS:725:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:LTUS:725:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "QUAD:LTUS:725:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "QUAD:LTUS:725: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, "QUAD:LTUS:725:RAMPSTARTDLY") { field(DESC, "Tansition to ramp delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "2") } ######### For PSTYPE=2 Only ############# record(mbbo, "QUAD:LTUS:725: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, "QUAD:LTUS:725: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,"QUAD:LTUS:725: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("QUAD:LTUS:725:TURNEDOFF",3140,1907,0,1,"QUAD:LTUS:725:TURNEDOFF") #! 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, "QUAD:LTUS:772:IACT") { field(DESC, "Current") field(INP, "PSC:LTUS:MG24:IACT") field(EGU, "A") field(HOPR, "110.0") field(LOPR, "0.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "QUAD:LTUS:772:BACT") info(autosaveFields,"HYST") } record(bi, "QUAD:LTUS:772:STATE") { field(DESC, "PS On/Off Status") field(DTYP, "Raw Soft Channel") field(INP, "PSC:LTUS:MG24:STATE NPP MS") field(ZSV, "MAJOR") field(ZNAM, "OFF") field(ONAM, "ON") } record(ao, "QUAD:LTUS:772:IDES") { field(DESC, "Desired Current") field(PREC, "3") field(EGU, "A") field(HOPR, "110.0") field(LOPR, "0.0") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(MDEL, "-1") field(HIHI, "110.0") field(LOLO, "0.0") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "QUAD:LTUS:772:BDELTAS") field(DRVH, "110.0") field(DRVL, "0.0") field(DOL, "QUAD:LTUS:772: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, "QUAD:LTUS:772:ICTRL PP") } # This record is processed by QUAD:LTUS:772:ICON") # Note: we are not setting alarms here. record(ao, "QUAD:LTUS:772:ICON") { field(DESC, "Config I") field(DTYP, "Soft Channel") field(PREC, "3") field(HOPR, "110.0") field(LOPR, "0.0") field(DRVH, "110.0") field(DRVL, "0.0") field(DOL, "QUAD:LTUS:772:B2ICON.K") field(OMSL, "closed_loop") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:772:INOM") { field(DESC, "Nominal Current") field(DOL, "QUAD:LTUS:772:BNOM.K") field(OMSL, "closed_loop") field(PREC, "3") field(EGU, "A") field(DRVH, "110.0") field(DRVL, "0.0") field(HOPR, "110.0") field(LOPR, "0.0") } record(ao, "QUAD:LTUS:772:ICTRL") { field(DESC, "Set Current") field(PREC, "3") field(EGU, "A") field(HOPR, "110.0") field(LOPR, "0.0") field(DRVH, "110.0") field(DRVL, "0.0") field(MDEL, "-1") field(FLNK, "QUAD:LTUS:772:ICTRLGO") field(OMSL, "supervisory") info(autosavefields,"VAL") } record(seq, "QUAD:LTUS:772:ICTRLGO") { field(DESC, "Process Current Setpoint") field(PREC, "3") # Set ISETPT to supervisory field(DOL1, "0") field(LNK1, "QUAD:LTUS:772:ISETPT.OMSL") field(DOL2, "QUAD:LTUS:772:ICTRL") field(LNK2, "QUAD:LTUS:772:ISETPT PP") # Set ISETPT to closed loop - get data from BCTRLSUB.K field(DOL3, "1") field(LNK3, "QUAD:LTUS:772:ISETPT.OMSL") } record(ao, "QUAD:LTUS:772:IMAX") { field(DESC, "Max I") field(DTYP, "Soft Channel") field(DRVH, "110.0") field(DRVL, "0.0") field(EGU, "A") field(HOPR, "110.0") field(LOPR, "0.0") field(PREC, "3") field(PINI, "YES") field(VAL, "110.0") field(FLNK, "QUAD:LTUS:772:IMIN") } record(ao, "QUAD:LTUS:772:IMIN") { field(DESC, "Min I") field(DTYP, "Soft Channel") field(DRVH, "110.0") field(DRVL, "0.0") field(EGU, "A") field(HOPR, "110.0") field(LOPR, "0.0") field(PREC, "3") field(VAL, "0.0") field(FLNK, "QUAD:LTUS:772:IRANGE") } record(sel, "QUAD:LTUS:772:IACTPREVOK") { field(DESC, "Last Good Current") field(EGU, "A") field(HOPR, "110.0") field(LOPR, "0.0") field(PREC, "3") field(NVL, "QUAD:LTUS:772:BACT.SEVR") field(INPA, "QUAD:LTUS:772:IACT NPP MS") field(INPB, "QUAD:LTUS:772:IACTPREVOK NPP MS") field(INPC, "QUAD:LTUS:772:IACTPREVOK NPP MS") field(INPD, "QUAD:LTUS:772:IACTPREVOK NPP MS") } record(sub, "QUAD:LTUS:772:IACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:772:IDES") field(INPB, "QUAD:LTUS:772:ISETPT.DRVH") field(INPC, "QUAD:LTUS:772:ISETPT.DRVL") field(INPD, "QUAD:LTUS:772:IDELTAS.I") field(INPE, "QUAD:LTUS:772:IDELTAS.J") field(INPG, "QUAD:LTUS:772:STATE") field(INPH, "QUAD:LTUS:772:HSTA") field(EGU, "A") field(HOPR, "110.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(sub, "QUAD:LTUS:772:IMONLIMITS") { field(DESC, "Aux Current Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:772:IDES") field(INPB, "QUAD:LTUS:772:ISETPT.DRVH") field(INPC, "QUAD:LTUS:772:ISETPT.DRVL") field(INPD, "QUAD:LTUS:772:IDELTAS.K") field(INPE, "QUAD:LTUS:772:IDELTAS.L") field(INPG, "QUAD:LTUS:772:STATE") field(INPH, "QUAD:LTUS:772:HSTA") field(EGU, "A") field(HOPR, "110.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(seq, "QUAD:LTUS:772:ILIMITS") { field(DESC, "Set ACT and MON Limits") field(PREC, "3") field(DOL1, "QUAD:LTUS:772:BLIMITS") field(LNK1, "QUAD:LTUS:772:IACTLIMITS.F PP") field(DOL2, "QUAD:LTUS:772:IACTLIMITS.I") field(LNK2, "QUAD:LTUS:772:IACT.HIGH") field(DOL3, "QUAD:LTUS:772:IACTLIMITS.J") field(LNK3, "QUAD:LTUS:772:IACT.LOW") field(DOL4, "QUAD:LTUS:772:IACTLIMITS.K") field(LNK4, "QUAD:LTUS:772:IACT.HIHI") field(DOL5, "QUAD:LTUS:772:IACTLIMITS.L") field(LNK5, "QUAD:LTUS:772:IACT.LOLO") field(DOL6, "QUAD:LTUS:772:BLIMITS") field(LNK6, "QUAD:LTUS:772:IMONLIMITS.F PP") field(DOL7, "QUAD:LTUS:772:IMONLIMITS.I") field(LNK7, "QUAD:LTUS:772:IMON.HIGH") field(DOL8, "QUAD:LTUS:772:IMONLIMITS.J") field(LNK8, "QUAD:LTUS:772:IMON.LOW") field(DOL9, "QUAD:LTUS:772:IMONLIMITS.K") field(LNK9, "QUAD:LTUS:772:IMON.HIHI") field(DOLA, "QUAD:LTUS:772:IMONLIMITS.L") field(LNKA, "QUAD:LTUS:772: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, "QUAD:LTUS:772:IDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntRawDeltas") field(INPD, "QUAD:LTUS:772:TRIMBTOL") field(INPE, "QUAD:LTUS:772:CHCKBTOL") field(INPF, "QUAD:LTUS:772:BDELTAS.K") field(INPG, "QUAD:LTUS:772:BDELTAS.L") field(INPH, "QUAD:LTUS:772: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, "QUAD:LTUS:772:STDZITOLR") field(INPC, "QUAD:LTUS:772:STDZITOL") field(FLNK, "") } # All ps controllers with on/off control will set the macro ONOF # as follows: # # ONOF = PSC:LTUS:MG24: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, "QUAD:LTUS:772:STATESETPT") { field(DESC, "PS On/Off") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFF") field(ONAM, "ON") field(OUT, "PSC:LTUS:MG24:STATESETPT PP") 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 = PSC:LTUS:MG24:RESET PP # record(bo, "QUAD:LTUS:772:RESET") { field(DESC, "Interlock Latch Reset") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFF") field(ONAM, "ON") field(HIGH, "1.0") field(OUT, "PSC:LTUS:MG24:RESET PP") } record(bo, "QUAD:LTUS:772:RAMPSTATE") { field(DESC, "PS Ramp Status") field(DTYP, "Soft Channel") field(DOL, "PSC:LTUS:MG24:RAMPSTATE NPP 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, "QUAD:LTUS:772: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, "QUAD:LTUS:772:TRIMRAMPRATE") field(OUT, "PSC:LTUS:MG24:IRAMPRATE PP") field(FLNK, "QUAD:LTUS:772:STDZDLY") } record(ao, "QUAD:LTUS:772:ISETPT") { field(DESC, "Current Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(EGU, "A") field(HOPR, "110.0") field(LOPR, "0.0") field(DRVH, "110.0") field(DRVL, "0.0") field(MDEL, "-1") field(OUT, "PSC:LTUS:MG24:ISETPT PP") field(DOL, "QUAD:LTUS:772: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, "QUAD:LTUS:772:IMON") { field(DESC, "Aux Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(INP, "PSC:LTUS:MG24:IMON") field(EGU, "A") field(HOPR, "110.0") field(LOPR, "0.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "QUAD:LTUS:772:BMON") } record(ao, "QUAD:LTUS:772:IRIPL") { field(DESC, "Ripple Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(DOL, "PSC:LTUS:MG24:IRIPL NPP NMS") field(OMSL, "closed_loop") field(EGU, "A") field(DRVH, "1.0") field(HOPR, "1.0") field(PREC, "3") field(FLNK, "QUAD:LTUS:772:IRIPLOK") } record(sub, "QUAD:LTUS:772:IRIPLOK") { field(DESC, "Ripple Current Status") field(INAM, "mgntInit") field(SNAM, "mgntRiplOK") field(INPA, "QUAD:LTUS:772:IRIPL.VAL") field(INPB, "QUAD:LTUS:772: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, "QUAD:LTUS:772:R") { field(DESC, "Resistance") field(EGU, "Ohms") field(PREC, "4") field(PINI, "YES") field(DOL, "PSC:LTUS:MG24:R NPP MS") 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, "QUAD:LTUS:772:IGND") { field(DESC, "Ground Current") field(EGU, "A") field(PREC, "6") field(PINI, "YES") field(DOL, "PSC:LTUS:MG24:IGND NPP MS") field(OMSL, "closed_loop") } record(bi, "QUAD:LTUS:772:INTLKSUMY") { field(DESC, "Interlock Summary") field(INP, "PSC:LTUS:MG24:INTLKSUMY NPP MS") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(ZNAM, "OK") field(ONAM, "FAULT") field(PINI, "NO") } record(mbbo, "QUAD:LTUS:772: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, "PSC:LTUS:MG24:COOLING") field(OMSL, "closed_loop") } # The following PV is processed by :BACTFO # which is processed by :BACT record(fanout, "QUAD:LTUS:772:IACTFO") { field(DESC, "IACT processing") field(SELM, "All") field(LNK1, "QUAD:LTUS:772:IACTPREVOK") field(LNK2, "QUAD:LTUS:772:IDIFF") field(LNK3, "QUAD:LTUS:772:IADIFF") field(LNK4, "QUAD:LTUS:772:IRATIO") field(LNK5, "QUAD:LTUS:772:IDIRECT") field(LNK6, "QUAD:LTUS:772:IACTPOL_CHECK") } record(calc, "QUAD:LTUS:772:IDIFF") { field(DESC, "IDES-IACT") field(CALC, "A-B") field(INPA, "QUAD:LTUS:772:IDES") field(INPB, "QUAD:LTUS:772:IACT") field(EGU, "A") field(PREC, "9") field(HOPR, "110.0") field(LOPR, "0.0") } record(calc, "QUAD:LTUS:772:IADIFF") { field(DESC, "Absolute IDES-IACT") field(CALC, "A<0?ABS(A):A") field(INPA, "QUAD:LTUS:772:IDIFF") field(PREC, "9") } record(calc, "QUAD:LTUS:772:IRATIO") { field(DESC, "IDES-IACT/IMAX") field(CALC, "B?A/B:0") field(INPA, "QUAD:LTUS:772:IDIFF") field(INPB, "QUAD:LTUS:772:IDES.DRVH") field(PREC, "9") } record(calcout, "QUAD:LTUS:772:IRANGE") { field(DESC, "Current Range") field(PINI, "YES") field(CALC, "ABS(A-B)") field(INPA, "QUAD:LTUS:772:IMIN") field(INPB, "QUAD:LTUS:772: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, "QUAD:LTUS:772: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, "QUAD:LTUS:772:IACT") field(FLNK, "QUAD:LTUS:772:IACTPOL") } record(bo, "QUAD:LTUS:772:IACTPOL") { field(DESC, "Actual I Polarity") field(DTYP, "Raw Soft Channel") field(DOL, "QUAD:LTUS:772: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,"QUAD:LTUS:772:I*LIMITS:\n Calculate alarm and warning limits based on \n deltas from QUAD:LTUS:772:IDELTAS and the\n QUAD:LTUS:772: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,"QUAD:LTUS:772:IACT: \n Get copy of QUAD:LTUS:772:I. \n",null) #! TextBox(TB12,1280,3100,1760,3200,0,"Dialog",12,1,16777215,"QUAD:LTUS:772: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,"QUAD:LTUS:772:IDES:\n Contains raw value calculated by \nQUAD:LTUS:772: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 \nQUAD:LTUS:772:BDELTAS.\n",null) #! TextBox(TB10,56,1940,316,2340,0,"Dialog",12,1,16777215,"QUAD:LTUS:772: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 QUAD:LTUS:772: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 QUAD:LTUS:772: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,"QUAD:LTUS:772:ISETPT:\n Sets the hardware. When fast feedback is set on, this record is\n set to closed loop mode by QUAD:LTUS:772:FBCKSTART sequence. When \n the loop is closed, this record takes input calculated by \n BFBCK only. When fast feedback is set off, QUAD:LTUS:772:FBCKSTOP \n will set it back to supervisory so that the value can be set by \n QUAD:LTUS:772: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, "QUAD:LTUS:772:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:772:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "QUAD:LTUS:772:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "QUAD:LTUS:772:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "QUAD:LTUS:772:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "QUAD:LTUS:772:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "1") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "QUAD:LTUS:772: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, "QUAD:LTUS:772:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "QUAD:LTUS:772:TRIMTYPE.RVAL") field(INPB, "QUAD:LTUS:772:CONFIG.RVAL") field(OUT, "QUAD:LTUS:772:TRIMMAXNUM PP") } record(longout, "QUAD:LTUS:772: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, "QUAD:LTUS:772: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, "") field(OMSL, "supervisory") field(VAL, "10") field(OUT, "QUAD:LTUS:772:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "QUAD:LTUS:772: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, "") field(OMSL, "supervisory") field(VAL, "10") } record(bo, "QUAD:LTUS:772: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, "QUAD:LTUS:772: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, "QUAD:LTUS:772: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, "QUAD:LTUS:772:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "0") } record(ao, "QUAD:LTUS:772: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, "QUAD:LTUS:772:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "QUAD:LTUS:772: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, "QUAD:LTUS:772: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, "QUAD:LTUS:772:IMOVE") field(INPB, "QUAD:LTUS:772:IACT") field(INPC, "QUAD:LTUS:772:IRAMPRATE") field(INPD, "1.577") field(INPE, "QUAD:LTUS:772:TRIMDLYPCT") field(INPF, "QUAD:LTUS:772:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "QUAD:LTUS:772:RAMPTIME_LEFT PP") } record(longout, "QUAD:LTUS:772:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "QUAD:LTUS:772:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "QUAD:LTUS:772:RAMPDONE_CALC") } record(calc, "QUAD:LTUS:772:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "QUAD:LTUS:772:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "QUAD:LTUS:772:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "QUAD:LTUS:772: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, "QUAD:LTUS:772:RAMPTIME_LEFT") field(OUT, "QUAD:LTUS:772:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "QUAD:LTUS:772:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "QUAD:LTUS:772:RAMPTIME_LEFT NMS") field(OUT, "QUAD:LTUS:772:RAMPDONE PP") } record(bo, "QUAD:LTUS:772:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "QUAD:LTUS:772:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "QUAD:LTUS:772: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, "QUAD:LTUS:772: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, "QUAD:LTUS:772:STDZINIT") { field(DESC, "Proc. Stdz PVs on boot") field(PINI, "YES") field(DOL1, "1") field(DOL2, "1") field(DOL3, "1") field(LNK1, "QUAD:LTUS:772:DEBUG.PROC PP") field(LNK2, "QUAD:LTUS:772:STDZCYCLENUM.PROC PP") field(LNK3, "QUAD:LTUS:772:STDZDISABLE.PROC PP") field(LNK4, "QUAD:LTUS:772: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, "QUAD:LTUS:772:STDZSUB") { field(DESC, "Stdz subroutine") field(INAM, "mgntStdzInit") field(SNAM, "mgntStdz") field(BRSV, "INVALID") field(INPA, "QUAD:LTUS:772:STDZIMIN NPP NMS") field(INPB, "QUAD:LTUS:772:STDZIMAX NPP NMS") field(INPC, "QUAD:LTUS:772:STDZIFINAL NPP NMS") field(INPD, "QUAD:LTUS:772:STDZCYCLENUM NPP NMS") field(INPE, "QUAD:LTUS:772:STDZDIRECT.RVAL NPP NMS") field(INPF, "QUAD:LTUS:772:STDZDISABLE.RVAL CPP NMS") field(INPG, "QUAD:LTUS:772: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, "QUAD:LTUS:772:STDZWF PP") field(OUTB, "QUAD:LTUS:772: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, "QUAD:LTUS:772:STDZWF") } record(mbbo, "QUAD:LTUS:772: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, "QUAD:LTUS:772: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, "QUAD:LTUS:772:STDZMAINPS") { field(DESC, "Stdz by main or self") field(PINI, "YES") field(DTYP, "Soft Channel") field(ZNAM, "SELF") field(ONAM, "MAIN") } record(bo, "QUAD:LTUS:772: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, "QUAD:LTUS:772: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, "QUAD:LTUS:772: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, "QUAD:LTUS:772:STDZTOD") { field(DESC, "Successful Standardize Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "QUAD:LTUS:772:STDZLOSTTOD") { field(DESC, "Standardize Lost Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(longout, "QUAD:LTUS:772:STDZCYCLECNT") { field(DESC, "Cycle Count") field(PINI, "YES") } record(longout, "QUAD:LTUS:772:STDZCYCLENUM") { field(DESC, "No. Standardize Cycles") field(VAL, "3") field(HOPR, "10") field(LOPR, "0") field(DRVH, "10") field(DRVL, "0") field(PINI, "YES") field(FLNK, "QUAD:LTUS:772:STDZDIRECT") } # The default standardize direction is "UP" for # all LCLS Magnets.. record(bo, "QUAD:LTUS:772:STDZDIRECT") { field(DESC, "Standardize Direction ") field(ZNAM, "UP") field(ONAM, "DOWN") field(VAL, "0") field(FLNK, "QUAD:LTUS:772:STDZIMIN") } record(ao, "QUAD:LTUS:772:STDZIMIN") { field(DESC, "Min-STDZ Current") field(PREC, "1") field(EGU, "A") field(HOPR, "110.0") field(LOPR, "0.0") field(VAL, "0.0") field(FLNK, "QUAD:LTUS:772:STDZIMAX") } record(ao, "QUAD:LTUS:772:STDZIMAX") { field(DESC, "Max. Standarize Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "110.0") field(LOPR, "0.0") field(VAL, "110.0") field(FLNK, "QUAD:LTUS:772:STDZIFINAL") } record(ao, "QUAD:LTUS:772:STDZIFINAL") { field(DESC, "Final SDTZ Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "110.0") field(LOPR, "0.0") field(VAL, "0.0") field(FLNK, "QUAD:LTUS:772: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, "QUAD:LTUS:772: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, "QUAD:LTUS:772:STDZITOL") { field(DESC, "Stdz min tolerance") field(PREC, "5") field(CALC, "MAX(ABS(A),ABS(B))*C") field(INPA, "QUAD:LTUS:772:STDZIMIN CP NMS") field(INPB, "QUAD:LTUS:772:STDZIMAX CP MMS") field(INPC, "0.05") field(INPD, "QUAD:LTUS:772:STDZITOLR CP MMS") field(EGU, "A") field(FLNK, "QUAD:LTUS:772:IDELTAS") field(PINI, "YES") } # D - factor (3.154/2 = 1.577) for EPSC, otherwise, set to 1.0 record(calc, "QUAD:LTUS:772:STDZDLY") { field(DESC, "Ramp time for stdz cycle") field(CALC, "C>0?MAX(1,ABS((A-B)/C)*D):0") field(INPA, "QUAD:LTUS:772:STDZIMIN CP NMS") field(INPB, "QUAD:LTUS:772:STDZIMAX CP NMS") field(INPC, "QUAD:LTUS:772:TRIMRAMPRATE CP NMS") field(INPD, "1.577") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") } record(calc, "QUAD:LTUS:772:STDZRAMPDLY") { field(DESC, "Ramp delay total") field(CALC, "MAX(1,((A/100)*B+B))") field(PREC, "5") field(INPA, "QUAD:LTUS:772:TRIMDLYPCT CP MS") field(INPB, "QUAD:LTUS:772: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, "QUAD:LTUS:772:STDZMINIDLY") { field(DESC, "Mini-stdz delay") field(CALC, "A") field(PREC, "5") field(A, "1.0") field(EGU, "sec") field(PINI, "YES") } record(ao, "QUAD:LTUS:772: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, "QUAD:LTUS:772:STDZMINIDELTA") { field(DESC, "Stdz mini % of IMAX") field(CALC, "(B/100)*(A-C)") field(INPA, "QUAD:LTUS:772:IDES.HOPR") field(INPB, "QUAD:LTUS:772:STDZMINIPCT CPP NMS") field(INPC, "QUAD:LTUS:772:IDES.LOPR") field(PREC, "5") } record(calc, "QUAD:LTUS:772:STDZMINISETPT") { field(DESC, "Mini Stdz delta") field(CALC, "C==0?MAX(E-D,B):MIN(E+D,A)") field(INPA, "QUAD:LTUS:772:IDES.HOPR") field(INPB, "QUAD:LTUS:772:IDES.LOPR") field(INPC, "QUAD:LTUS:772:STDZDIRECT.RVAL") field(INPD, "QUAD:LTUS:772:STDZMINIDELTA") field(INPE, "QUAD:LTUS:772:IDES") field(PREC, "5") field(FLNK, "QUAD:LTUS:772: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, "QUAD:LTUS:772:STDZMINISETPTOOR") { field(DESC, "Mini Stdz setpoint out of range") field(CALC, "C==0?(E-DA)") field(INPA, "QUAD:LTUS:772:IDES.HOPR") field(INPB, "QUAD:LTUS:772:IDES.LOPR") field(INPC, "QUAD:LTUS:772:STDZDIRECT.RVAL") field(INPD, "QUAD:LTUS:772:STDZMINIDELTA") field(INPE, "QUAD:LTUS:772: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, "QUAD:LTUS:772: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, "QUAD:LTUS:772:IADJUST.RVAL") field(INPB, "QUAD:LTUS:772:STDZDIRECT.RVAL") field(INPC, "QUAD:LTUS:772:STDZOK.RVAL") field(INPD, "QUAD:LTUS:772:STDZDISABLE.RVAL") field(INPE, "QUAD:LTUS:772:STATE.RVAL CPP NMS") field(INPF, "QUAD:LTUS:772:ICTRL.RVAL") field(INPG, "QUAD:LTUS:772:STATE.SEVR") field(INPH, "QUAD:LTUS:772:BDELTAS.M") field(INPI, "QUAD:LTUS:772:IACT.SEVR") field(OUT, "QUAD:LTUS:772:STDZLOSTGO.SELN PP NMS") field(OOPT, "Transition To Non-zero") } record(seq, "QUAD:LTUS:772:STDZLOSTGO") { field(DESC, "Process lost stdz") field(SELM, "Mask") field(DOL1, "1") field(DOL2, "0") field(LNK1, "QUAD:LTUS:772:STDZLOSTTOD.PROC") field(LNK2, "QUAD:LTUS:772:STDZOK PP") } # Record maximum current after standardize # Reset to IACT from sequence after trim # Disable processing during (mini-)standardize or trim record(calc, "QUAD:LTUS:772:STDZIACTMAX") { field(DESC, "Max act current after stdz") field(CALC, "MAX(A, B)") field(DISV, "0") field(SDIS, "QUAD:LTUS:772:CHECKPWRDIP_ENABLE") field(INPA, "QUAD:LTUS:772:IACT CP") field(INPB, "QUAD:LTUS:772:STDZIACTMAX") field(EGU, "A") field(FLNK, "QUAD:LTUS:772:CHECKPWRDIP") } # Detect power dip if STDZOK is YES, STDZ is enabled, and IACT is valid # If IACT drops below STDZIACTMAX by more than the trim tolerance, clear STDZOK # Warning: Take the absolute value of the trim tolerance, or else quads of # negative polarity will always lose STDZ since their IDELTAS.I are negative. # Note: Large quads and bends are prone to losing STDZ even if they are # perturbed toward higher current since their current tends to overshoot # by greater than the trim tolerance before settling down. record(calcout, "QUAD:LTUS:772:CHECKPWRDIP") { field(DESC, "Detect power dip") field(CALC, "(A-B>ABS(C))?3:0") field(DISV, "0") field(SDIS, "QUAD:LTUS:772:CHECKPWRDIP_ENABLE") field(INPA, "QUAD:LTUS:772:STDZIACTMAX") field(INPB, "QUAD:LTUS:772:IACT") field(INPC, "QUAD:LTUS:772:IDELTAS.I") field(OUT, "QUAD:LTUS:772:STDZLOSTGO.SELN PP NMS") field(OOPT, "When Non-zero") } # Enable processing of STDZIACTMAX and CHECKPWRDIP only if # STDZOK = YES, STDZDISABLE = NO, CTRL != Trim (2), and # CTRL != Stdz (4) record(calc, "QUAD:LTUS:772:CHECKPWRDIP_ENABLE") { field(CALC, "A&&!B&&(C#2)&&(C#4)") field(INPA, "QUAD:LTUS:772:STDZOK.RVAL CP") field(INPB, "QUAD:LTUS:772:STDZDISABLE.RVAL CP") field(INPC, "QUAD:LTUS:772:CTRL.RVAL CP") } #! 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, "QUAD:LTUS:772: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, "QUAD:LTUS:772:CALBOK") { field(DESC, "Successful Calibration") field(DTYP, "Raw Soft Channel") field(ZNAM, "NO") field(ONAM, "YES") field(DOL, "PSC:LTUS:MG24:CALBOK.RVAL") field(OMSL, "closed_loop") 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, "QUAD:LTUS:772:CALBSET") { field(DESC, "Use DAC Calbration") field(SCAN, "10 second") field(CALC, "A&&(B==0)&&C?31:960") field(INPA, "QUAD:LTUS:772:CALBOK") field(INPB, "QUAD:LTUS:772:CALBDISABLE") field(INPC, "QUAD:LTUS:772:CALBSLOPE") field(OOPT, "On Change") field(OUT, "QUAD:LTUS:772: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, "QUAD:LTUS:772:CALB_SEQ") { field(DESC, "Output Calib Values") field(SELM, "Mask") field(SELL, "QUAD:LTUS:772: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, "QUAD:LTUS:772:CALBSLOPE") field(DOL3, "QUAD:LTUS:772: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, "QUAD:LTUS:772:CALBTOD") { field(DESC, "Calibration Success Time") field(PINI, "YES") field(DOL, "PSC:LTUS:MG24:CALBTOD") field(OMSL, "closed_loop") field(DTYP, "Soft Channel") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:772: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, "QUAD:LTUS:772: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, "QUAD:LTUS:772: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, "QUAD:LTUS:772:CALBOFFSET") { field(DESC, "Calc DAC Offset") field(PREC, "6") field(EGU, "Counts") field(PINI, "YES") } record(bo, "QUAD:LTUS:772: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, "QUAD:LTUS:772:DACSLOPE") { field(DESC, "V to DAC slope") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "closed_loop") field(PINI, "YES") field(FLNK, "QUAD:LTUS:772:DACOFFSET") } # Default Offset used in conversion from Volts to DAC Counts record(ao, "QUAD:LTUS:772:DACOFFSET") { field(DESC, "V to DAC offset") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "closed_loop") field(PINI, "YES") field(FLNK, "QUAD:LTUS:772: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, "QUAD:LTUS:772: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, "QUAD:LTUS:772:IACT") field(INPD, "QUAD:LTUS:772:DACSLOPE") field(INPE, "QUAD:LTUS:772:DACOFFSET") field(EGU, "Counts") field(PREC, "6") } record(ao, "QUAD:LTUS:772:DAC") { field(DESC, "DAC Set point") field(EGU, "Counts") field(DOL, "") field(OMSL, "closed_loop") field(PREC, "6") field(PINI, "YES") } record(ao, "QUAD:LTUS:772:CALBIMIN") { field(DESC, "Calibration Min Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(DRVH, "110.0") field(HOPR, "110.0") field(DRVL, "0.0") field(LOPR, "0.0") field(PREC, "3") field(EGU, "A") field(VAL, "0.0") field(FLNK, "QUAD:LTUS:772:CALBIMAX") } record(ao, "QUAD:LTUS:772:CALBIMAX") { field(DESC, "Calibration Max Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(DRVH, "110.0") field(HOPR, "110.0") field(LOPR, "0.0") field(DRVL, "0.0") field(EGU, "A") field(VAL, "110.0") field(FLNK, "QUAD:LTUS:772:CALBSTEPNUM") } record(ao, "QUAD:LTUS:772:CALBIFINAL") { field(DESC, "Calibration Last Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(PREC, "3") field(EGU, "A") field(HOPR, "110.0") field(LOPR, "0.0") field(VAL, "0") } record(longout, "QUAD:LTUS:772: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, "QUAD:LTUS:772:CALBIDELTA") } record(calc, "QUAD:LTUS:772:CALBIDELTA") { field(DESC, "Step size for CALB") field(CALC, "C=0?0:ABS((A-B)/C)") field(INPA, "QUAD:LTUS:772:CALBIMAX") field(INPB, "QUAD:LTUS:772:CALBIMIN") field(INPC, "QUAD:LTUS:772: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, "QUAD:LTUS:772:CALBIMULT") { field(DESC, "IACT vs ISETPT mult") field(CALC, "C#0||A=0?1:ABS(B/A)") field(INPA, "PSC:LTUS:MG24:ISETPT.DRVH") field(INPB, "PSC:LTUS:MG24:IACT.HOPR") field(INPC, "QUAD:LTUS:772:PSCONTROLLER.RVAL CPP") field(EGU, "A") field(PINI, "YES") } # SNL dbputs DAC values here. 6-10 steps are possible. record(waveform, "QUAD:LTUS:772:CALBICTRLWF") { field(DESC, "ICTRL setpoint array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") } record(waveform, "QUAD:LTUS:772:DACWF") { field(DESC, "DAC count array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:772:DACSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:772:DACSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "QUAD:LTUS:772: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, "QUAD:LTUS:772:CALCDACWF") { field(DESC, "Calc DAC counts array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:772:CALCDACSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:772:CALCDACSA") { field(DESC, "Calc DAC counts") field(DTYP, "Soft Channel") field(INP, "QUAD:LTUS:772: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, "QUAD:LTUS:772:CALBYWF") { field(DESC, "mx + b") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:772:CALBYSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:772:CALBYSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "QUAD:LTUS:772:CALBYWF") field(MALM, "10") field(NELM, "6") field(INDX, "0") field(FTVL, "DOUBLE") } record(waveform, "QUAD:LTUS:772:CALBIACTWF") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:772:CALBIACTSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:772:CALBIACTSA") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(MALM, "10") field(NELM, "6") field(INP, "QUAD:LTUS:772:CALBIACTWF") field(INDX, "0") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:772:CALBLIMITS") } # Check that measured current during calibration is within # tolerance. record(aSub, "QUAD:LTUS:772: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, "QUAD:LTUS:772:CALBSTEPNUM") field(INPB, "QUAD:LTUS:772:CALBIACTWF") field(INPC, "QUAD:LTUS:772: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, "QUAD:LTUS:772: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, "QUAD:LTUS:772:STDZITOL") field(INPH, "QUAD:LTUS:772:DACSLOPE") field(INPI, "QUAD:LTUS:772: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, "QUAD:LTUS:772: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, "QUAD:LTUS:772:CALBSTEPNUM") field(INPB, "QUAD:LTUS:772:CALBIACTWF") field(INPC, "QUAD:LTUS:772:DACWF") field(INPF, "QUAD:LTUS:772: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 QUAD:LTUS:772CALBOK 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, "QUAD:LTUS:772:DEGAUSINIT") { field(DESC, "Proc. Degauss PVs on boot") field(PINI, "YES") field(DOL, "1") field(OUTA, "QUAD:LTUS:772:DEGAUSIMIN.PROC PP") field(OUTB, "QUAD:LTUS:772:DEGAUSIMAX.PROC PP") field(OUTC, "QUAD:LTUS:772:DEGAUSTYPE.PROC PP") field(OUTD, "QUAD:LTUS:772:DEGAUSSTEP.PROC PP") field(OUTE, "QUAD:LTUS:772:MADNAME.PROC PP") field(OUTF, "QUAD:LTUS:772:PSTYPE.PROC PP") field(OUTG, "QUAD:LTUS:772: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, "QUAD:LTUS:772:DEGAUSSUB") { field(DESC, "Degauss subroutine") field(INAM, "mgntDegaussInit") field(SNAM, "mgntDegauss") field(BRSV, "INVALID") field(INPA, "QUAD:LTUS:772:DEGAUSIMIN NPP NMS") field(INPB, "QUAD:LTUS:772:DEGAUSIMAX NPP NMS") field(INPC, "QUAD:LTUS:772:DEGAUSTYPE.RVAL NPP NMS") field(INPE, "QUAD:LTUS:772:DEGAUSMETHOD.RVAL NPP NMS") field(INPF, "QUAD:LTUS:772:PSTYPE NPP NMS") field(INPG, "QUAD:LTUS:772:DEBUG.RVAL NPP NMS") field(INPH, "QUAD:LTUS:772: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, "QUAD:LTUS:772:DEGAUSWF PP") field(OUTB, "QUAD:LTUS:772:DEGAUSMSG PP") field(OUTC, "QUAD:LTUS:772: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, "QUAD:LTUS:772:DEGAUSWF") { field(DESC, "Degauss Setpts") field(NELM, "60") field(FTVL, "DOUBLE") } record(mbbo,"QUAD:LTUS:772: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, "QUAD:LTUS:772: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, "QUAD:LTUS:772: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, "QUAD:LTUS:772: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, "QUAD:LTUS:772: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, "QUAD:LTUS:772:DEGAUSIMIN") { field(DESC, "Min. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "110.0") field(LOPR, "-110.0") field(DRVH, "110.0") field(DRVL, "-110.0") field(VAL, "-110.0") } record(ao, "QUAD:LTUS:772:DEGAUSIMAX") { field(DESC, "Max. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "110.0") field(LOPR, "-110.0") field(DRVH, "110.0") field(DRVL, "-110.0") field(VAL, "110.0") } # 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,"QUAD:LTUS:772: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, "QUAD:LTUS:772: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,"QUAD:LTUS:772: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, "QUAD:LTUS:772: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, "QUAD:LTUS:772: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, "QUAD:LTUS:772: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, "QUAD:LTUS:772:DEGAUSTOD") { field(DESC, "Successful Degauss Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "QUAD:LTUS:772:DEGAUSLOSTTOD") { field(DESC, "Degauss Lost Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:772:DEGAUSTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "QUAD:LTUS:772:DEGAUSTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "QUAD:LTUS:772: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, "QUAD:LTUS:772:DEGAUSGO") { field(DESC, "Set bdes of btrms to zero") field(ASG, "Internal") field(OUTA, "") field(OUTB, "") field(OUTC, "") field(OUTD, "") } # =========== CRYO ONLY =========== record(bo, "QUAD:LTUS:772: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, "QUAD:LTUS:772:DEGAUS_IMAX_CHECK") { field(DESC, "Check if imax shoud chg") field(CALC, "(C==4)&&(ABS(B)>ABS(A))?1:0") field(INPA, "QUAD:LTUS:772:DEGAUS_IMAX") field(INPB, "QUAD:LTUS:772:ISETPT") field(INPC, "QUAD:LTUS:772:DEGAUSTYPE.RVAL") field(OUT, "QUAD:LTUS:772:DEGAUS_IMAX_UPDATE.SELN") field(FLNK, "QUAD:LTUS:772:DEGAUS_IMAX_UPDATE") } record(seq, "QUAD:LTUS:772:DEGAUS_IMAX_UPDATE") { field(DESC, "Degauss IMAX Update") field(SELM, "Specified") field(DOL1, "QUAD:LTUS:772:ISETPT") field(LNK1, "QUAD:LTUS:772:DEGAUS_IMAX PP") } # Set the maximum current after a successful # degauss. This pv is updated by the # sequence. record(ao, "QUAD:LTUS:772:DEGAUS_IMAX") { field(DESC, "Max I set afer a degauss") field(EGU, "Amps") field(PINI, "YES") field(PREC, "6") field(HOPR, "110.0") field(LOPR, "-110.0") field(DRVH, "110.0") field(DRVL, "-110.0") field(VAL, "110.0") field(FLNK, "QUAD:LTUS:772:DEGAUS_IMAXPOL_CHECK") info(autosaveFields,"VAL,RVAL") } # Set the polarity if degauss_imax record(calcout, "QUAD:LTUS:772:DEGAUS_IMAXPOL_CHECK") { field(DESC, "Determine polarity of imax") field(CALC, "A>=0?0:1") field(INPA, "QUAD:LTUS:772:DEGAUS_IMAX") field(FLNK, "QUAD:LTUS:772:DEGAUS_IMAXPOL") } record(bo, "QUAD:LTUS:772:DEGAUS_IMAXPOL") { field(DESC, "Polarity of imax I") field(DTYP, "Raw Soft Channel") field(DOL, "QUAD:LTUS:772:DEGAUS_IMAXPOL_CHECK") field(OMSL, "closed_loop") field(ZNAM, "Positive") field(ONAM, "Negative") field(FLNK, "QUAD:LTUS:772: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, "QUAD:LTUS:772:DEGAUS_ABSIMAX") { field(DESC, "Absolute Max. Degauss I") field(CALC, "ABS(A)") field(INPA, "QUAD:LTUS:772:DEGAUS_IMAX") field(PREC, "6") field(EGU, "Amps") field(HOPR, "110.0") field(LOPR, "-110.0") info(autosaveFields,"VAL RVAL") } # IACT Polarity record(calcout, "QUAD:LTUS:772:IACTPOL_CHECK") { field(DESC, "Determine IACT polarity") field(SCAN, "5 second") field(CALC, "ABS(A-B)>C?(A>=0?0:1):D") field(INPA, "QUAD:LTUS:772:IACT") field(INPB, "QUAD:LTUS:772:IACTPOL_CHECK.LA") field(INPC, "0.0001") field(INPD, "QUAD:LTUS:772:IACTPOL_CHECK.PVAL") field(OOPT, "On Change") field(FLNK, "QUAD:LTUS:772:IACTPOL") } record(bo, "QUAD:LTUS:772: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,"QUAD:LTUS:772: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, "QUAD:LTUS:772:DEGAUSENABLE CP") field(INPB, "QUAD:LTUS:772:DEGAUSOK") field(INPC, "QUAD:LTUS:772:STATE CP") field(INPD, "QUAD:LTUS:772:STATE.SEVR") field(OUT, "QUAD:LTUS:772:DEGAUS_STATE_SEQ.SELN PP") field(ASG, "Internal") } record(seq, "QUAD:LTUS:772:DEGAUS_STATE_SEQ") { field(DESC, "Degauss State Sequence") field(SELM, "Specified") field(SELL, "QUAD:LTUS:772:DEGAUS_STATE_CHECK") field(LNK1, "QUAD:LTUS:772:DEGAUS_STATE_DISABLE.PROC PP") field(LNK2, "QUAD:LTUS:772:DEGAUS_STATE_LOST.PROC PP") field(LNK3, "QUAD:LTUS:772:DEGAUS_STATE_GOOD.PROC PP") field(LNK4, "QUAD:LTUS:772: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, "QUAD:LTUS:772:DEGAUS_STATE_DISABLE") { field(DESC, "Degauss not used") field(LNK1, "QUAD:LTUS:772:DEGAUSOK.ZSV") field(LNK2, "QUAD:LTUS:772: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, "QUAD:LTUS:772:STATMSG.FRSV") field(LNK4, "QUAD:LTUS:772: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, "QUAD:LTUS:772:DEGAUS_STATE_LOST") { field(DESC, "Degauss lost and ps On") field(DOL1, "1") field(LNK1, "QUAD:LTUS:772:DEGAUSOK.ZSV") field(LNK2, "QUAD:LTUS:772: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, "QUAD:LTUS:772:STATMSG.FRSV") field(LNK4, "QUAD:LTUS:772: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, "QUAD:LTUS:772:DEGAUS_STATE_OFF") { field(DESC, "Degaused lost and ps Off") field(DOL1, "2") field(LNK1, "QUAD:LTUS:772: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, "QUAD:LTUS:772:STATMSG.FRSV") field(LNK3, "QUAD:LTUS:772: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, "QUAD:LTUS:772:DEGAUS_STATE_GOOD") { field(DESC, "Degauss good") field(DOL1, "1") field(LNK1, "QUAD:LTUS:772: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, "QUAD:LTUS:772:STATMSG.FRSV PP") field(LNK3, "QUAD:LTUS:772:STATMSG.FVSV PP") field(LNK4, "") field(ASG, "Internal") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(mbbo, "QUAD:LTUS:772:FUNC") { field(DESC, "QUAD:LTUS:772 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, "1") field(THVL, "9") field(FRVL, "10") field(FVVL, "0") field(SXVL, "2") field(SVVL, "8") field(EIVL, "11") field(NIVL, "12") field(TEVL, "13") field(ELVL, "5") field(TVVL, "6") field(TTVL, "7") field(FTVL, "4") field(FFVL, "3") field(OUT, "QUAD:LTUS:772:CTRL CA") } # :CTRL pv is processed at boot in the # sequence mgntCtrl.st Processed in sequence # record(mbbo, "QUAD:LTUS:772:CTRL") { field(DESC, "QUAD:LTUS:772 Control") field(PINI, "NO") field(ZRST, "Ready") field(ONST, "TRIM") field(TWST, "PERTURB") field(THST, "BCON_TO_BDES") field(FRST, "BACT_TO_BDES") field(FVST, "SAVE_BDES") field(SXST, "LOAD_BDES") field(SVST, "UNDO_BDES") field(EIST, "DAC_ZERO") field(NIST, "CALB") field(TEST, "STDZ") field(ELST, "RESET") field(TVST, "TURN_ON") field(TTST, "TURN_OFF") field(FTST, "") field(FFST, "") field(ZRVL, "0") field(ONVL, "2") field(TWVL, "6") field(THVL, "15") field(FRVL, "14") field(FVVL, "11") field(SXVL, "12") field(SVVL, "13") field(EIVL, "7") field(NIVL, "3") field(TEVL, "4") field(ELVL, "8") field(TVVL, "9") field(TTVL, "10") field(FTVL, "0") field(FFVL, "0") field(OUT, "QUAD:LTUS:772:SELECTEN.A PP") field(SDIS, "0") } # If a function has been selected set this unit to busy record(calcout, "QUAD:LTUS:772:SELECTEN") { field(DESC, "Control Select Enable") field(CALC, "A>0?1:A") field(FLNK, "QUAD:LTUS:772:BUSY") } # Set to FREE on IOC reboot record(bo, "QUAD:LTUS:772:BUSY") { field(DESC, "QUAD:LTUS:772 Ctrl Done") field(DOL, "QUAD:LTUS:772:SELECTEN") field(ZNAM, "FREE") field(ONAM, "BUSY") field(PINI, "YES") field(FLNK, "QUAD:LTUS:772:SELECT") } record(bo, "QUAD:LTUS:772:SELECT") { field(ZNAM, "NO") field(ONAM, "YES") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") } record(bo, "QUAD:LTUS:772: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, "QUAD:LTUS:772:CTRLSTATE") { field(DESC, "QUAD:LTUS:772 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("QUAD:LTUS:772:CTRL",20,20,0,0,"QUAD:LTUS:772:CTRL") #! Field("QUAD:LTUS:772:CTRL.OUT",16777215,1,"QUAD:LTUS:772:CTRL.OUT") #! Link("QUAD:LTUS:772:CTRL.OUT","QUAD:LTUS:772:SELECTEN.A") #! Field("QUAD:LTUS:772:CTRL.VAL",16777215,1,"QUAD:LTUS:772:CTRL.VAL") #! Record("QUAD:LTUS:772:SELECTEN",321,381,0,0,"QUAD:LTUS:772:SELECTEN") #! Field("QUAD:LTUS:772:SELECTEN.A",16777215,0,"QUAD:LTUS:772:SELECTEN.A") #! Field("QUAD:LTUS:772:SELECTEN.FLNK",16777215,1,"QUAD:LTUS:772:SELECTEN.FLNK") #! Link("QUAD:LTUS:772:SELECTEN.FLNK","QUAD:LTUS:772:BUSY") #! Field("QUAD:LTUS:772:SELECTEN.VAL",16777215,1,"QUAD:LTUS:772:SELECTEN.VAL") #! Record("QUAD:LTUS:772:BUSY",623,274,0,0,"QUAD:LTUS:772:BUSY") #! Field("QUAD:LTUS:772:BUSY.DOL",16777215,0,"QUAD:LTUS:772:BUSY.DOL") #! Link("QUAD:LTUS:772:BUSY.DOL","QUAD:LTUS:772:SELECTEN.VAL") #! Field("QUAD:LTUS:772:BUSY.FLNK",16777215,1,"QUAD:LTUS:772:BUSY.FLNK") #! Link("QUAD:LTUS:772:BUSY.FLNK","QUAD:LTUS:772:SELECT") #! Record("QUAD:LTUS:772:SELECT",669,508,0,1,"QUAD:LTUS:772:SELECT") #! Record("QUAD:LTUS:772:FUNC",940,120,0,0,"QUAD:LTUS:772:FUNC") #! Field("QUAD:LTUS:772:FUNC.OUT",16777215,0,"QUAD:LTUS:772:FUNC.OUT") #! Link("QUAD:LTUS:772:FUNC.OUT","QUAD:LTUS:772:CTRL.VAL") #! Record("QUAD:LTUS:772:ABORT",193,41,0,0,"QUAD:LTUS:772:ABORT") #! Record("QUAD:LTUS:772:CTRLSTATE",369,34,0,0,"QUAD:LTUS:772: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,"QUAD:LTUS:772:SELECT is used for Multi-device selection.\nIt is enabled when associated QUAD:LTUS:772:CTRL is \"0\" (DONE).\nIt is disabled when associated QUAD:LTUS:772: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,"QUAD:LTUS:772: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, "QUAD:LTUS:772:BCTRL_INIT") { field(DESC, "Process BCTRL on boot") field(PINI, "YES") field(CALC, "A=3?1:0") field(INPA, "QUAD:LTUS:772:BCTRL.SEVR") field(OUT, "QUAD:LTUS:772: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, "QUAD:LTUS:772:BACT") { field(DESC, "Actual B") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "QUAD:LTUS:772:BACT") field(INPB, "QUAD:LTUS:772:POLYCOEF") field(INPC, "QUAD:LTUS:772:POLYCOEF.A") field(INPD, "QUAD:LTUS:772:POLYCOEF.B") field(INPE, "QUAD:LTUS:772:IACT MS") field(INPF, "QUAD:LTUS:772:BDELTAS PP") field(INPG, "100") field(EGU, "kG") field(HOPR, "-0.2114") field(LOPR, "-61.8229") field(HIHI, "-0.2114") field(LOLO, "-61.8229") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "-0.2114") field(LOW, "-61.8229") field(FLNK, "QUAD:LTUS:772: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, "QUAD:LTUS:772:BDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntPhyDeltas") field(EGU, "kG") field(HOPR, "1") field(PREC, "7") field(BRSV, "INVALID") field(INPA, "QUAD:LTUS:772:BDES") field(INPB, "QUAD:LTUS:772:TRIMBTOL") field(INPC, "QUAD:LTUS:772:TRIMBTOLR") field(INPD, "QUAD:LTUS:772:CHCKBTOL") field(INPE, "QUAD:LTUS:772:CHCKBTOLR") field(F, "2.0") field(INPG, "30") field(INPH, "QUAD:LTUS:772:BACT.VAL") # # MPS absolute and relative tolerances field(INPP, "QUAD:LTUS:772:MPSBTOL") field(INPQ, "QUAD:LTUS:772:MPSBTOLR") field(FLNK, "QUAD:LTUS:772:BCONLIMITS") info(autosaveFields,"F") } # This record is processed by BDELTAS record(aSub, "QUAD:LTUS:772:BCONLIMITS") { field(DESC, "Config B-field Limits") field(INAM, "mgntInit") field(SNAM, "mgntBCONLimits") field(INPA, "QUAD:LTUS:772:BDES") field(INPB, "QUAD:LTUS:772:BDELTAS.I") field(INPG, "QUAD:LTUS:772:DEBUG.RVAL") field(FTA, "DOUBLE") field(FTB, "DOUBLE") field(FTG, "ULONG") field(OUTA, "QUAD:LTUS:772:BCON.HIGH") field(OUTB, "QUAD:LTUS:772:BCON.LOW") field(OUTC, "QUAD:LTUS:772:BCON.HIHI") field(OUTD, "QUAD:LTUS:772:BCON.LOLO PP") field(FTVA, "DOUBLE") field(FTVB, "DOUBLE") field(FTVC, "DOUBLE") field(FTVD, "DOUBLE") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:772:IDELTAS") } # The following PV is processed by :BACT # which is processed by :BACT # record(fanout, "QUAD:LTUS:772:BACTFO") { field(DESC, "BACT processing") field(SELM, "All") field(LNK1, "QUAD:LTUS:772:BDIFF") field(LNK2, "QUAD:LTUS:772:BADIFF") field(LNK3, "QUAD:LTUS:772:BRATIO") field(LNK4, "QUAD:LTUS:772:MPSLIMITS") field(LNK5, "QUAD:LTUS:772:I2BSTATUS") field(LNK6, "QUAD:LTUS:772:IACTFO.PROC") } record(calc, "QUAD:LTUS:772:BDIFF") { field(DESC, "BDES-BACT") field(CALC, "A-B") field(INPA, "QUAD:LTUS:772:BDES") field(INPB, "QUAD:LTUS:772:BACT") field(EGU, "kG") field(PREC, "7") } record(calc, "QUAD:LTUS:772:BADIFF") { field(DESC, "Absolute BDES-BACT") field(INPA, "QUAD:LTUS:772:BDIFF") field(EGU, "kG") field(PREC, "7") field(CALC, "A<0?ABS(A):A") } record(calc, "QUAD:LTUS:772:BRATIO") { field(DESC, "BACT Error") field(CALC, "B?A/B:0") field(INPA, "QUAD:LTUS:772:BDIFF") field(INPB, "QUAD:LTUS:772:BDES.HOPR") field(EGU, "kG") field(PREC, "7") } record(mbbi, "QUAD:LTUS:772: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, "QUAD:LTUS:772:BACT.J") } # Note: for a string slave set the MONFL # macro to the following: # MONFL=:IMONCALC MS record(sub, "QUAD:LTUS:772:BMON") { field(DESC, "Second Transductor") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "QUAD:LTUS:772:BMON") field(INPB, "QUAD:LTUS:772:POLYCOEF") field(INPC, "QUAD:LTUS:772:POLYCOEF.A") field(INPD, "QUAD:LTUS:772:POLYCOEF.B") field(INPE, "QUAD:LTUS:772:IMON MS") field(INPF, "QUAD:LTUS:772:BDELTAS.VAL") field(INPG, "100") field(EGU, "kG") field(HOPR, "-0.2114") field(LOPR, "-61.8229") field(HIHI, "-0.2114") field(LOLO, "-61.8229") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "-0.2114") field(LOW, "-61.8229") } # 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=PSC:LTUS:MG24:BDES CP record(ao, "QUAD:LTUS:772:BDES") { field(DESC, "Desired B-Field") field(PINI, "YES") field(DRVH, "-0.2114") field(DRVL, "-61.8229") field(HOPR, "-0.2114") field(LOPR, "-61.8229") field(PREC, "7") field(EGU, "kG") field(MDEL, "-1") field(OMSL, "supervisory") # field(DOL, "") field(OUT, "QUAD:LTUS:772:B2IDES PP") info(autosaveFields,"VAL") } record(sub, "QUAD:LTUS:772:B2IDES") { field(DESC, "Convert Desired B-Field to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:772:POLYCOEF") field(INPC, "QUAD:LTUS:772:POLYCOEF.A") field(INPD, "QUAD:LTUS:772:POLYCOEF.B") field(PREC, "7") field(EGU, "kG") field(HOPR, "-0.2114") field(LOPR, "-61.8229") field(MDEL, "-1") field(INPE, "QUAD:LTUS:772:BDES.DRVH") field(INPF, "QUAD:LTUS:772:BDES.DRVL") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:772:IDES") } record(sub, "QUAD:LTUS:772:BNOM") { field(DESC, "Nominal Field") field(PINI, "YES") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:772:POLYCOEF") field(INPC, "QUAD:LTUS:772:POLYCOEF.A") field(INPD, "QUAD:LTUS:772:POLYCOEF.B") field(INPE, "QUAD:LTUS:772:BDES.DRVH") field(INPF, "QUAD:LTUS:772:BDES.DRVL") field(EGU, "kG") field(HOPR, "-0.2114") field(LOPR, "-61.8229") field(PREC, "7") field(VAL, "0.0") field(FLNK, "QUAD:LTUS:772:INOM") } record(sub, "QUAD:LTUS:772:BACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:772:BDES.VAL") field(INPB, "QUAD:LTUS:772:BDES.DRVH") field(INPC, "QUAD:LTUS:772:BDES.DRVL") field(INPD, "QUAD:LTUS:772:BDELTAS.I") field(INPE, "QUAD:LTUS:772:BDELTAS.J") field(INPG, "QUAD:LTUS:772:STATE") field(INPH, "QUAD:LTUS:772:HSTA") field(EGU, "kG") field(HOPR, "-0.2114") field(LOPR, "-61.8229") field(PREC, "7") field(BRSV, "INVALID") } record(sub, "QUAD:LTUS:772:BMONLIMITS") { field(DESC, "MON Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:772:BDES.VAL") field(INPB, "QUAD:LTUS:772:BDES.DRVH") field(INPC, "QUAD:LTUS:772:BDES.DRVL") field(INPD, "QUAD:LTUS:772:BDELTAS.K") field(INPE, "QUAD:LTUS:772:BDELTAS.L") field(INPG, "QUAD:LTUS:772:STATE") field(INPH, "QUAD:LTUS:772:HSTA") field(EGU, "kG") field(HOPR, "-0.2114") field(LOPR, "-61.8229") field(PREC, "7") field(BRSV, "INVALID") } record(seq, "QUAD:LTUS:772:BLIMITS") { field(DESC, "ACT Limits") field(PREC, "7") field(DOL1, "QUAD:LTUS:772:BLIMITS") field(LNK1, "QUAD:LTUS:772:BACTLIMITS.F PP") field(DOL2, "QUAD:LTUS:772:BACTLIMITS.I") field(LNK2, "QUAD:LTUS:772:BACT.HIGH") field(DOL3, "QUAD:LTUS:772:BACTLIMITS.J") field(LNK3, "QUAD:LTUS:772:BACT.LOW") field(DOL4, "QUAD:LTUS:772:BACTLIMITS.K") field(LNK4, "QUAD:LTUS:772:BACT.HIHI") field(DOL5, "QUAD:LTUS:772:BACTLIMITS.L") field(LNK5, "QUAD:LTUS:772:BACT.LOLO") field(DOL6, "QUAD:LTUS:772:BLIMITS") field(LNK6, "QUAD:LTUS:772:BMONLIMITS.F PP") field(DOL7, "QUAD:LTUS:772:BMONLIMITS.I") field(LNK7, "QUAD:LTUS:772:BMON.HIGH") field(DOL8, "QUAD:LTUS:772:BMONLIMITS.J") field(LNK8, "QUAD:LTUS:772:BMON.LOW") field(DOL9, "QUAD:LTUS:772:BMONLIMITS.K") field(LNK9, "QUAD:LTUS:772:BMON.HIHI") field(DOLA, "QUAD:LTUS:772:BMONLIMITS.L") field(LNKA, "QUAD:LTUS:772:BMON.LOLO") field(FLNK, "QUAD:LTUS:772:ILIMITS") field(SCAN, "5 second") } record(ao, "QUAD:LTUS:772:BCTRL") { field(DESC, "B-Perturb") field(PREC, "7") field(EGU, "kG") field(DRVH, "-0.2114") field(DRVL, "-61.8229") field(HOPR, "-0.2114") field(LOPR, "-61.8229") # 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, "QUAD:LTUS:772: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, "QUAD:LTUS:772:BCTRLGO") { field(DESC, "Update DES and perturb") field(PREC, "7") # Disable BACT limits field(DOL1, "1") field(LNK1, "QUAD:LTUS:772:BLIMITS.VAL") # Update BDES with the BCTRL (slider) value field(DOL2, "QUAD:LTUS:772:BCTRL.VAL") field(LNK2, "QUAD:LTUS:772:BDES PP") field(DOL3, "1") field(LNK3, "QUAD:LTUS:772:IDIRECT.PROC PP") field(DOL4, "1") field(LNK4, "QUAD:LTUS:772:CHECKSTDZLOST.PROC PP") field(DOL5, "QUAD:LTUS:772:BCTRL.VAL") field(LNK5, "QUAD:LTUS:772:BCTRLSUB PP") # Re-enable BACT limits field(DOL6, "0") field(LNK6, "QUAD:LTUS:772:BLIMITS.VAL") } # Convert B-field to Current and output to ISETPT record(sub, "QUAD:LTUS:772:BCTRLSUB") { field(DESC, "Feedback") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:772:POLYCOEF") field(INPC, "QUAD:LTUS:772:POLYCOEF.A") field(INPD, "QUAD:LTUS:772:POLYCOEF.B") field(INPE, "QUAD:LTUS:772:BDES.DRVH") field(INPF, "QUAD:LTUS:772:BDES.DRVL") field(PREC, "7") field(EGU, "kG") field(HOPR, "-0.2114") field(LOPR, "-61.8229") field(MDEL, "-1") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:772:ISETPT") } record(ao, "QUAD:LTUS:772:BDESPREVTRIM") { field(DESC, "trim bdes for undo") field(DTYP, "Soft Channel") field(DRVH, "-0.2114") field(DRVL, "-61.8229") field(EGU, "kG") field(HOPR, "-0.2114") field(LOPR, "-61.8229") field(PREC, "7") field(PINI, "YES") info(autosaveFields,"VAL") } record(stringin, "QUAD:LTUS:772:MADNAME") { field(DESC, "MAD deck nomenclature") field(PINI, "YES") field(VAL, "QFXL2") } record(ai, "QUAD:LTUS:772: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, "3515.105369") } record(ao, "QUAD:LTUS:772:BMAX") { field(DESC, "Max B-Field") field(DTYP, "Soft Channel") field(DRVH, "-0.2114") field(DRVL, "-61.8229") field(EGU, "kG") field(HOPR, "-0.2114") field(LOPR, "-61.8229") field(PREC, "7") field(PINI, "YES") field(VAL, "-0.2114") field(FLNK, "QUAD:LTUS:772:BSTEP") } record(ao, "QUAD:LTUS:772:BMIN") { field(DESC, "Min B-Field") field(DTYP, "Soft Channel") field(DRVH, "-0.2114") field(DRVL, "-61.8229") field(EGU, "kG") field(HOPR, "-0.2114") field(LOPR, "-61.8229") field(PREC, "7") field(PINI, "YES") field(VAL, "-61.8229") field(FLNK, "QUAD:LTUS:772:BSTEP") } record(ao, "QUAD:LTUS:772:BDESSAVE") { field(DESC, "bdes for save/load") field(DTYP, "Soft Channel") field(DRVH, "-0.2114") field(DRVL, "-61.8229") field(EGU, "kG") field(HOPR, "-0.2114") field(LOPR, "-61.8229") field(PINI, "YES") field(PREC, "7") } # This record is processed by QUAD:LTUS:772: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, "QUAD:LTUS:772:BCON") { field(DESC, "Config B-Field ") field(DTYP, "Soft Channel") field(PREC, "7") field(EGU, "kG") field(HOPR, "-0.2114") field(LOPR, "-61.8229") field(DRVH, "-0.2114") field(DRVL, "-61.8229") # Set MINOR Alarm as the default, slaves will set NO_ALARM=0. field(HHSV, "MINOR") field(LLSV, "MINOR") field(HSV, "MINOR") field(LSV, "MINOR") # field(DOL , "") field(OMSL, "supervisory") field(OUT, "QUAD:LTUS:772:B2ICON PP") info(autosaveFields,"VAL") } record(sub, "QUAD:LTUS:772:B2ICON") { field(DESC, "Convert Desired ICon to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:772:POLYCOEF") field(INPC, "QUAD:LTUS:772:POLYCOEF.A") field(INPD, "QUAD:LTUS:772:POLYCOEF.B") field(PREC, "7") field(EGU, "kG") field(HOPR, "-0.2114") field(LOPR, "-61.8229") field(MDEL, "-1") field(INPE, "QUAD:LTUS:772:BCON.DRVH") field(INPF, "QUAD:LTUS:772:BCON.DRVL") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:772: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, "QUAD:LTUS:772:BSTEP") { field(DESC, "B-Field step size") field(CALC, "(C==3)||(D==3)?0:ABS(A-B)*0.005") field(INPA, "QUAD:LTUS:772:BMAX") field(INPB, "QUAD:LTUS:772:BMIN") field(INPC, "QUAD:LTUS:772:BMIN.SEVR") field(INPD, "QUAD:LTUS:772:BMAX.SEVR") field(EGU, "kG") 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,"QUAD:LTUS:772:BCTRLDISABLECALC") { field(DESC, "Calc for disabling BCTRL") field(ASG, "Internal") field(CALC, "A?2:1") field(INPA, "QUAD:LTUS:772:ONLINE CP") field(OUT, "QUAD:LTUS:772:BCTRLDISABLEFOUT PP") } record(fanout, "QUAD:LTUS:772:BCTRLDISABLEFOUT") { field(DESC, "Disable BCTRL fanout") field(SELM, "Specified") field(SELL, "QUAD:LTUS:772:BCTRLDISABLECALC") field(LNK1, "QUAD:LTUS:772:BCTRLDISABLE") field(LNK2, "QUAD:LTUS:772:BCTRLENABLE") } record(stringout, "QUAD:LTUS:772:BCTRLDISABLE") { field(DESC, "Disable BCTRL") field(DTYP, "Soft Channel") field(OUT, "QUAD:LTUS:772:BCTRL.ASG") field(VAL, "NOWRITE") field(FLNK, "QUAD:LTUS:772:BCTRLDISV_UPDATE") } record(stringout, "QUAD:LTUS:772:BCTRLENABLE") { field(DESC, "Enable BCTRL") field(DTYP, "Soft Channel") field(OUT, "QUAD:LTUS:772:BCTRL.ASG") field(VAL, "") field(FLNK, "QUAD:LTUS:772:BCTRLDISV_UPDATE") } record(calcout, "QUAD:LTUS:772:BCTRLDISV_UPDATE") { field(DESC, "Calc for updating BCTRL.DISV") field(ASG, "Internal") field(CALC, "A") field(INPA, "QUAD:LTUS:772:ONLINE") field(OUT, "QUAD:LTUS:772: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,"QUAD:LTUS:772:BACT and MON\n are processed via links from \n QUAD:LTUS:772:IACT (device raw value readback 1)\n and\n QUAD:LTUS:772: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 QUAD:LTUS:772:POLYCOEF\nC = First polynomial coefficient (offset if linear)\nD = Second polynomial coefficient (slope if linear)\nE = QUAD:LTUS:772: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,"QUAD:LTUS:772:BDES\n is processed when set by CA users or \n QUAD:LTUS:772: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,"QUAD:LTUS:772: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 QUAD:LTUS:772: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 (QUAD:LTUS:772: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,"QUAD:LTUS:772:B*LIMITS and QUAD:LTUS:772:BLIMITS:\n Calculate alarm and warning limits based on \n deltas from QUAD:LTUS:772: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,"QUAD:LTUS:772: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,"QUAD:LTUS:772: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, "QUAD:LTUS:772: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, "QUAD:LTUS:772:MPSBTOL") { field(DESC, "Absolute mps tol") field(EGU, "kG") field(PREC, "2") field(CALC, "ABS(A)*0.02") field(INPA, "QUAD:LTUS:772:BMAX") field(PINI, "YES") } # # 21-Aug-2013: K. Luchini # Set channel access security so that users # cannot easily change values. record(ao, "QUAD:LTUS:772:MPSBMAX") { field(DESC, "MPS Max B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "-0.2114") field(DRVL, "-61.8229") field(PINI, "YES") field(VAL, "-0.2114") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:772:MPSBMIN") { field(DESC, "MPS Min B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "-0.2114") field(DRVL, "-61.8229") field(PINI, "YES") field(VAL, "-61.8229") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:772:MPSBLLIM") { field(DESC, "MPS Low Limit B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "-0.2114") field(DRVL, "-61.8229") field(PINI, "YES") field(VAL, "-61.8229") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:772:MPSBLLIM2") { field(DESC, "MPS Low Limit #2 B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "-0.2114") field(DRVL, "-61.8229") field(PINI, "YES") field(VAL, "-61.8229") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } # Set the default to Std record(mbbo, "QUAD:LTUS:772: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, "QUAD:LTUS:772:MPSLIMITS.E PP") } record(aSub, "QUAD:LTUS:772: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, "QUAD:LTUS:772:MPS.RVAL") field(INPB, "QUAD:LTUS:772:BADIFF") field(INPC, "QUAD:LTUS:772:BDELTAS.N") field(INPD, "QUAD:LTUS:772:BACT") field(INPE, "QUAD:LTUS:772:MPSBITMASK.RVAL") field(INPF, "QUAD:LTUS:772:MPSBLLIM") field(INPG, "QUAD:LTUS:772:MPSBMIN") field(INPH, "QUAD:LTUS:772:MPSBMAX") field(INPI, "QUAD:LTUS:772: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, "QUAD:LTUS:772:INTOL.RVAL PP") field(OUTB, "QUAD:LTUS:772:INTOL_BMIN.RVAL PP") field(OUTC, "QUAD:LTUS:772:INTOL_BRANGE.RVAL PP") field(OUTD, "QUAD:LTUS:772: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, "QUAD:LTUS:772:INTOL") { field(DESC, "BACT within MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:772:MPSLIMITS.VALA") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "QUAD:LTUS:772:INTOL_BMIN") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:772:MPSLIMITS.VALB") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "QUAD:LTUS:772:INTOL_BMIN2") { field(DESC, "MPS tol #2") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:772:MPSLIMITS.VALD") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "QUAD:LTUS:772:INTOL_BRANGE") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:772: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, "QUAD:LTUS:772:CHCKITOL") { field(DESC, "Absolute Check I Tolerance") field(EGU, "A") field(FLNK, "QUAD:LTUS:772:TRIMITOL") field(CALC, "ABS(A*B)") field(INPA, "QUAD:LTUS:772:CHCKBTOL") field(INPB, "QUAD:LTUS:772:POLYCOEF.B") field(PREC, "9") } record(calc, "QUAD:LTUS:772:TRIMBTOL") { field(EGU, "kG") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(DESC, "Absolute Trim Tolerance") field(CALC, "ABS(A)/2") field(INPA, "QUAD:LTUS:772:CHCKBTOL") field(FLNK, "QUAD:LTUS:772:CHCKITOL") } record(calc, "QUAD:LTUS:772:CHCKBTOL") { field(DESC, "Check absolute tolerance") field(EGU, "A") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(FLNK, "QUAD:LTUS:772:TRIMBTOL") field(CALC, "MAX(ABS(A),ABS(C))*(B/1000000)") field(INPA, "QUAD:LTUS:772:BDES.HOPR") field(INPB, "QUAD:LTUS:772:STABILITY") field(INPC, "QUAD:LTUS:772:BDES.LOPR") } record(longout, "QUAD:LTUS:772: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, "QUAD:LTUS:772:CHCKBTOL") } record(calc, "QUAD:LTUS:772:TRIMITOL") { field(DESC, "Absolute Trim I Tolerance") field(EGU, "kG") field(CALC, "ABS(A*B)") field(INPA, "QUAD:LTUS:772:POLYCOEF.B") field(INPB, "QUAD:LTUS:772:TRIMBTOL") field(PREC, "9") } record(ai, "QUAD:LTUS:772:TRIMBTOLR") { field(DESC, "Relative trim tol") field(PREC, "4") field(EGU, "%") field(HOPR, "1.0") field(LOPR, "0.0") field(PINI, "YES") } record(ai, "QUAD:LTUS:772: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, "QUAD:LTUS:772:FBCKFCOM") { field(ZNAM, "CA") field(ONAM, "FCOM") field(DESC, "CA Mode") field(PINI, "YES") field(SDIS, "0") } record(bo, "QUAD:LTUS:772:PAU") { field(ZNAM, "NotConfigured") field(ONAM, "Configured") field(DESC, "PAU Present") field(PINI, "YES") field(SDIS, "0") field(FLNK, "QUAD:LTUS:772:PAUGO") } record(fanout, "QUAD:LTUS:772:PAUGO") { field(DESC, "PAU control") field(LNK1, "QUAD:LTUS:772:PAUSTOP") field(LNK2, "QUAD:LTUS:772: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, "QUAD:LTUS:772:PAUSTART") { field(DESC, "Setup for PAU On") field(SDIS, "QUAD:LTUS:772: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, "QUAD:LTUS:772:PAUSTOP") { field(DESC, "Setup for PAU Off") field(SDIS, "QUAD:LTUS:772: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, "QUAD:LTUS:772:MCORDEVNAME") { field(DESC, "PS device name") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, "PSC:LTUS:MG24:") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "QUAD:LTUS:772: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, "QUAD:LTUS:772:PSTYPE.RVAL") field(INPC, "QUAD:LTUS:772:TURNEDOFF.RVAL") field(INPD, "QUAD:LTUS:772:CONFIG.RVAL") field(INPE, "QUAD:LTUS:772:PSCATEGORY.RVAL") field(INPF, "QUAD:LTUS:772:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "QUAD:LTUS:772:AUTOCTRL.RVAL") field(INPJ, "QUAD:LTUS:772:OUTOFSERVICE.RVAL") field(INPL, "QUAD:LTUS:772:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "QUAD:LTUS:772:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "QUAD:LTUS:772:PAU") field(INPP, "QUAD:LTUS:772:CALBDISABLE.RVAL") field(INPQ, "QUAD:LTUS:772:PTRBDISABLE.RVAL") field(INPR, "QUAD:LTUS:772:TRIMDISABLE.RVAL") field(INPS, "QUAD:LTUS:772:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "QUAD:LTUS:772:FBCK") field(INPU, "QUAD:LTUS:772:TRIMTYPE.RVAL") field(INPV, "QUAD:LTUS:772:STDZDIRECT.RVAL") field(INPW, "QUAD:LTUS:772:DEGAUSENABLE.RVAL") field(FLNK, "QUAD:LTUS:772:HSTA") } record(longin, "QUAD:LTUS:772:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "QUAD:LTUS:772:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "QUAD:LTUS:772: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, "QUAD:LTUS:772: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, "QUAD:LTUS:772:CALBDISABLE") { field(DESC, "DAC Calb Disabled") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:772:PTRBDISABLE") { field(DESC, "Perturb Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:772:TRIMDISABLE") { field(DESC, "Trim Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:772: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 QUAD:LTUS:772:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses QUAD:LTUS:772:FBCK. # This PV should be replaced by QUAD:LTUS:772: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, "QUAD:LTUS:772: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, "QUAD:LTUS:772: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, "QUAD:LTUS:772: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, "") field(OMSL, "supervisory") field(FLNK, "QUAD:LTUS:772:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"QUAD:LTUS:772:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "QUAD:LTUS:772:OUTOFSERVICE NPP NMS") field(OUT, "QUAD:LTUS:772:ONLINE PP") } record(bo, "QUAD:LTUS:772:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "QUAD:LTUS:772: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, "1") } record(bo, "QUAD:LTUS:772: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, "1") } record(bo, "QUAD:LTUS:772: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, "QUAD:LTUS:772: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, "QUAD:LTUS:772: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, "QUAD:LTUS:772: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, "QUAD:LTUS:772: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, "QUAD:LTUS:772: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, "1") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:772: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, "1") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:772: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, "2") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:772: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, "0") field(ASG, "NOWRITE") field(FLNK, "QUAD:LTUS:772:TRIMTYPE") } record(stringout, "QUAD:LTUS:772:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "QUAD:LTUS:772:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "QUAD:LTUS:772:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "QUAD:LTUS:772:STATE.RVAL") field(INPB, "QUAD:LTUS:772:INTLKSUMY.RVAL") field(OUT, "QUAD:LTUS:772:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:LTUS:772: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, "QUAD:LTUS:772:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "QUAD:LTUS:772:STATE.RVAL") field(INPB, "QUAD:LTUS:772:INTLKSUMY.RVAL") field(OUT, "QUAD:LTUS:772:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:LTUS:772:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "QUAD:LTUS:772:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "QUAD:LTUS:772: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, "QUAD:LTUS:772:RAMPSTARTDLY") { field(DESC, "Tansition to ramp delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "2") } ######### For PSTYPE=2 Only ############# record(mbbo, "QUAD:LTUS:772: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, "QUAD:LTUS:772: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,"QUAD:LTUS:772: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("QUAD:LTUS:772:TURNEDOFF",3140,1907,0,1,"QUAD:LTUS:772:TURNEDOFF") #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "QUAD:LTUS:772:STATSUB") { field(DESC, "Build STATus ") field(INAM, "mgntInit") field(SNAM, "mgntSlcStat") field(INPA, "QUAD:LTUS:772:BACT.STAT") field(INPB, "QUAD:LTUS:772:BDES.STAT") field(INPC, "QUAD:LTUS:772:IRIPL.STAT") field(INPD, "PSC:LTUS:MG24:ISETPT.STAT") field(INPE, "PSC:LTUS:MG24:IACT.STAT") # 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, "QUAD:LTUS:772:BACT.SEVR") field(INPH, "QUAD:LTUS:772:BDES.SEVR") field(INPI, "QUAD:LTUS:772:IRIPL.SEVR") field(INPJ, "PSC:LTUS:MG24:ISETPT.SEVR") field(INPK, "PSC:LTUS:MG24:IACT.SEVR") # # 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, "QUAD:LTUS:772:STATE.RVAL") field(INPN, "QUAD:LTUS:772:STDZOK") field(INPO, "QUAD:LTUS:772:CALBOK") field(INPP, "QUAD:LTUS:772:OUTOFSERVICE.RVAL") field(INPQ, "QUAD:LTUS:772:CONFIG.RVAL") field(INPR, "QUAD:LTUS:772:HSTA") field(INPS, "QUAD:LTUS:772:CTRL.RVAL") field(INPT, "QUAD:LTUS:772:DEGAUSOK") field(INPV, "QUAD:LTUS:772: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, "QUAD:LTUS:772:STAT") } record(longout, "QUAD:LTUS:772:STAT") { field(DESC, "STAT sent to SLC") field(SCAN, "Passive") field(FLNK, "QUAD:LTUS:772:STATCTRLSUB") field(DOL, "QUAD:LTUS:772:STATSUB.VAL") field(OMSL, "closed_loop") } record(sSub, "QUAD:LTUS:772:STATCTRLSUB") { field(DESC, "Decode SLC STAT into mbbo") field(INAM, "mgntInit") field(SNAM, "mgntStatDecode") field(INPA, "QUAD:LTUS:772:STAT") field(INPB, "QUAD:LTUS:772:HSTA") field(INPD, "QUAD:LTUS:772:ONOFFCTRL.RVAL") field(FLNK, "QUAD:LTUS:772:STATMSG") } record(mbbo, "QUAD:LTUS:772: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, "QUAD:LTUS:772:UNAVAILGO") field(DOL, "QUAD:LTUS:772:STATCTRLSUB.W") } record(seq, "QUAD:LTUS:772:UNAVAILGO") { field(DESC, "Process UNAVAIL") field(DOL1, "QUAD:LTUS:772:STATSUB.U") field(LNK1, "QUAD:LTUS:772:UNAVAIL PP") } record(stringout, "QUAD:LTUS:772:SNLSTATMSG") { field(DTYP, "Soft Channel") } #! TextBox(TB0,820,1000,1200,1220,0,"Dialog",12,1,16777215,"QUAD:LTUS:772:STATUSSUB - future\nOverall device status - takes input from action snls, record sevrs, master snl(s) and outputs final status\n\nInputs:\nA - QUAD:LTUS:772:CTRLSTATUS - snl status\nB - MGNT:CTRLSTATUS - master list status\nC\nD - QUAD:LTUS:772: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,"QUAD:LTUS:772STATSUB\nformat control bo's into slc STAT\n\nInputs:\nA - QUAD:LTUS:772:STATUS\nC - QUAD:LTUS:772:ON\nD - QUAD:LTUS:772:STDZOK\nE - QUAD:LTUS:772:CALBOK\nF - QUAD:LTUS:772:BACTDRIFT (future)\nG -\nH- QUAD:LTUS:772:DACSTATUS\nI -QUAD:LTUS:772:ADCSTATUS\nJ - QUAD:LTUS:772:BACTSTATUS\nK - QUAD:LTUS:772:BDESSTATUS\nL - QUAD:LTUS:772:RIPLSTATUS\n\nOutput:\nP - QUAD:LTUS:772: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, "QUAD:LTUS:772: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, "QUAD:LTUS:772: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, "QUAD:LTUS:772: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, "QUAD:LTUS:772: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.6 #! DBDSTART #! DBD("../../../../dbd/mgntSoft.dbd") #! DBDEND record(stringout, "QUAD:LTUS:772:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:772:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "QUAD:LTUS:772:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "QUAD:LTUS:772:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "QUAD:LTUS:772:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "QUAD:LTUS:772:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "1") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "QUAD:LTUS:772: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, "QUAD:LTUS:772:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "QUAD:LTUS:772:TRIMTYPE.RVAL") field(INPB, "QUAD:LTUS:772:CONFIG.RVAL") field(OUT, "QUAD:LTUS:772:TRIMMAXNUM PP") } record(longout, "QUAD:LTUS:772: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, "QUAD:LTUS:772: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, "") field(OMSL, "supervisory") field(VAL, "20") field(OUT, "QUAD:LTUS:772:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "QUAD:LTUS:772: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, "") field(OMSL, "supervisory") field(VAL, "10") } record(bo, "QUAD:LTUS:772: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, "QUAD:LTUS:772: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, "QUAD:LTUS:772: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, "QUAD:LTUS:772:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "0") } record(ao, "QUAD:LTUS:772: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, "QUAD:LTUS:772:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "QUAD:LTUS:772: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, "QUAD:LTUS:772: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, "QUAD:LTUS:772:IMOVE") field(INPB, "QUAD:LTUS:772:IACT") field(INPC, "QUAD:LTUS:772:IRAMPRATE") field(INPD, "1.577") field(INPE, "QUAD:LTUS:772:TRIMDLYPCT") field(INPF, "QUAD:LTUS:772:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "QUAD:LTUS:772:RAMPTIME_LEFT PP") } record(longout, "QUAD:LTUS:772:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "QUAD:LTUS:772:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "QUAD:LTUS:772:RAMPDONE_CALC") } record(calc, "QUAD:LTUS:772:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "QUAD:LTUS:772:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "QUAD:LTUS:772:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "QUAD:LTUS:772: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, "QUAD:LTUS:772:RAMPTIME_LEFT") field(OUT, "QUAD:LTUS:772:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "QUAD:LTUS:772:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "QUAD:LTUS:772:RAMPTIME_LEFT NMS") field(OUT, "QUAD:LTUS:772:RAMPDONE PP") } record(bo, "QUAD:LTUS:772:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "QUAD:LTUS:772:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "QUAD:LTUS:772: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, "QUAD:LTUS:772: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(sSub, "QUAD:LTUS:772: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, "QUAD:LTUS:772:PSTYPE.RVAL") field(INPC, "QUAD:LTUS:772:TURNEDOFF.RVAL") field(INPD, "QUAD:LTUS:772:CONFIG.RVAL") field(INPE, "QUAD:LTUS:772:PSCATEGORY.RVAL") field(INPF, "QUAD:LTUS:772:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "QUAD:LTUS:772:AUTOCTRL.RVAL") field(INPJ, "QUAD:LTUS:772:OUTOFSERVICE.RVAL") field(INPL, "QUAD:LTUS:772:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "QUAD:LTUS:772:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "QUAD:LTUS:772:PAU") field(INPP, "QUAD:LTUS:772:CALBDISABLE.RVAL") field(INPQ, "QUAD:LTUS:772:PTRBDISABLE.RVAL") field(INPR, "QUAD:LTUS:772:TRIMDISABLE.RVAL") field(INPS, "QUAD:LTUS:772:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "QUAD:LTUS:772:FBCK") field(INPU, "QUAD:LTUS:772:TRIMTYPE.RVAL") field(INPV, "QUAD:LTUS:772:STDZDIRECT.RVAL") field(INPW, "QUAD:LTUS:772:DEGAUSENABLE.RVAL") field(FLNK, "QUAD:LTUS:772:HSTA") } record(longin, "QUAD:LTUS:772:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "QUAD:LTUS:772:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "QUAD:LTUS:772: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, "QUAD:LTUS:772: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, "QUAD:LTUS:772:CALBDISABLE") { field(DESC, "DAC Calb Disabled") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:772:PTRBDISABLE") { field(DESC, "Perturb Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:772:TRIMDISABLE") { field(DESC, "Trim Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:772:STDZDISABLE") { field(DTYP, "Raw Soft Channel") field(ZNAM, "NO") field(ONAM, "YES") field(DESC, "Standardize Function") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } # This PV has been replaced by QUAD:LTUS:772:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses QUAD:LTUS:772:FBCK. # This PV should be replaced by QUAD:LTUS:772: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, "QUAD:LTUS:772: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, "QUAD:LTUS:772: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, "QUAD:LTUS:772: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, "") field(OMSL, "supervisory") field(FLNK, "QUAD:LTUS:772:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"QUAD:LTUS:772:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "QUAD:LTUS:772:OUTOFSERVICE NPP NMS") field(OUT, "QUAD:LTUS:772:ONLINE PP") } record(bo, "QUAD:LTUS:772:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "QUAD:LTUS:772: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, "1") } record(bo, "QUAD:LTUS:772: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, "1") } record(bo, "QUAD:LTUS:772: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, "QUAD:LTUS:772: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, "QUAD:LTUS:772: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, "QUAD:LTUS:772: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, "QUAD:LTUS:772: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, "QUAD:LTUS:772: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, "1") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:772: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, "1") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:772: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, "2") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:772: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, "0") field(ASG, "NOWRITE") field(FLNK, "QUAD:LTUS:772:TRIMTYPE") } record(stringout, "QUAD:LTUS:772:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "QUAD:LTUS:772:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "QUAD:LTUS:772:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "QUAD:LTUS:772:STATE.RVAL") field(INPB, "QUAD:LTUS:772:INTLKSUMY.RVAL") field(OUT, "QUAD:LTUS:772:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:LTUS:772: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, "QUAD:LTUS:772:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "QUAD:LTUS:772:STATE.RVAL") field(INPB, "QUAD:LTUS:772:INTLKSUMY.RVAL") field(OUT, "QUAD:LTUS:772:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:LTUS:772:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "QUAD:LTUS:772:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "QUAD:LTUS:772: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, "QUAD:LTUS:772:RAMPSTARTDLY") { field(DESC, "Tansition to ramp delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "2") } ######### For PSTYPE=2 Only ############# record(mbbo, "QUAD:LTUS:772: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, "QUAD:LTUS:772: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,"QUAD:LTUS:772: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("QUAD:LTUS:772:TURNEDOFF",3140,1907,0,1,"QUAD:LTUS:772:TURNEDOFF") #! 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, "QUAD:LTUS:820:IACT") { field(DESC, "Current") field(INP, "PSC:LTUS:MG18:IACT") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "QUAD:LTUS:820:BACT") info(autosaveFields,"HYST") } record(bi, "QUAD:LTUS:820:STATE") { field(DESC, "PS On/Off Status") field(DTYP, "Raw Soft Channel") field(INP, "PSC:LTUS:MG18:STATE NPP MS") field(ZSV, "MAJOR") field(ZNAM, "OFF") field(ONAM, "ON") } record(ao, "QUAD:LTUS:820:IDES") { field(DESC, "Desired Current") field(PREC, "3") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(MDEL, "-1") field(HIHI, "120.0") field(LOLO, "-120.0") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "QUAD:LTUS:820:BDELTAS") field(DRVH, "120.0") field(DRVL, "-120.0") field(DOL, "QUAD:LTUS:820: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, "QUAD:LTUS:820:ICTRL PP") } # This record is processed by QUAD:LTUS:820:ICON") # Note: we are not setting alarms here. record(ao, "QUAD:LTUS:820:ICON") { field(DESC, "Config I") field(DTYP, "Soft Channel") field(PREC, "3") field(HOPR, "120.0") field(LOPR, "-120.0") field(DRVH, "120.0") field(DRVL, "-120.0") field(DOL, "QUAD:LTUS:820:B2ICON.K") field(OMSL, "closed_loop") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:820:INOM") { field(DESC, "Nominal Current") field(DOL, "QUAD:LTUS:820:BNOM.K") field(OMSL, "closed_loop") field(PREC, "3") field(EGU, "A") field(DRVH, "120.0") field(DRVL, "-120.0") field(HOPR, "120.0") field(LOPR, "-120.0") } record(ao, "QUAD:LTUS:820:ICTRL") { field(DESC, "Set Current") field(PREC, "3") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(DRVH, "120.0") field(DRVL, "-120.0") field(MDEL, "-1") field(FLNK, "QUAD:LTUS:820:ICTRLGO") field(OMSL, "supervisory") info(autosavefields,"VAL") } record(seq, "QUAD:LTUS:820:ICTRLGO") { field(DESC, "Process Current Setpoint") field(PREC, "3") # Set ISETPT to supervisory field(DOL1, "0") field(LNK1, "QUAD:LTUS:820:ISETPT.OMSL") field(DOL2, "QUAD:LTUS:820:ICTRL") field(LNK2, "QUAD:LTUS:820:ISETPT PP") # Set ISETPT to closed loop - get data from BCTRLSUB.K field(DOL3, "1") field(LNK3, "QUAD:LTUS:820:ISETPT.OMSL") } record(ao, "QUAD:LTUS:820:IMAX") { field(DESC, "Max I") field(DTYP, "Soft Channel") field(DRVH, "120.0") field(DRVL, "-120.0") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(PREC, "3") field(PINI, "YES") field(VAL, "120.0") field(FLNK, "QUAD:LTUS:820:IMIN") } record(ao, "QUAD:LTUS:820:IMIN") { field(DESC, "Min I") field(DTYP, "Soft Channel") field(DRVH, "120.0") field(DRVL, "-120.0") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(PREC, "3") field(VAL, "-120.0") field(FLNK, "QUAD:LTUS:820:IRANGE") } record(sel, "QUAD:LTUS:820:IACTPREVOK") { field(DESC, "Last Good Current") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(PREC, "3") field(NVL, "QUAD:LTUS:820:BACT.SEVR") field(INPA, "QUAD:LTUS:820:IACT NPP MS") field(INPB, "QUAD:LTUS:820:IACTPREVOK NPP MS") field(INPC, "QUAD:LTUS:820:IACTPREVOK NPP MS") field(INPD, "QUAD:LTUS:820:IACTPREVOK NPP MS") } record(sub, "QUAD:LTUS:820:IACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:820:IDES") field(INPB, "QUAD:LTUS:820:ISETPT.DRVH") field(INPC, "QUAD:LTUS:820:ISETPT.DRVL") field(INPD, "QUAD:LTUS:820:IDELTAS.I") field(INPE, "QUAD:LTUS:820:IDELTAS.J") field(INPG, "QUAD:LTUS:820:STATE") field(INPH, "QUAD:LTUS:820:HSTA") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(PREC, "3") field(BRSV, "INVALID") } record(sub, "QUAD:LTUS:820:IMONLIMITS") { field(DESC, "Aux Current Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:820:IDES") field(INPB, "QUAD:LTUS:820:ISETPT.DRVH") field(INPC, "QUAD:LTUS:820:ISETPT.DRVL") field(INPD, "QUAD:LTUS:820:IDELTAS.K") field(INPE, "QUAD:LTUS:820:IDELTAS.L") field(INPG, "QUAD:LTUS:820:STATE") field(INPH, "QUAD:LTUS:820:HSTA") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(PREC, "3") field(BRSV, "INVALID") } record(seq, "QUAD:LTUS:820:ILIMITS") { field(DESC, "Set ACT and MON Limits") field(PREC, "3") field(DOL1, "QUAD:LTUS:820:BLIMITS") field(LNK1, "QUAD:LTUS:820:IACTLIMITS.F PP") field(DOL2, "QUAD:LTUS:820:IACTLIMITS.I") field(LNK2, "QUAD:LTUS:820:IACT.HIGH") field(DOL3, "QUAD:LTUS:820:IACTLIMITS.J") field(LNK3, "QUAD:LTUS:820:IACT.LOW") field(DOL4, "QUAD:LTUS:820:IACTLIMITS.K") field(LNK4, "QUAD:LTUS:820:IACT.HIHI") field(DOL5, "QUAD:LTUS:820:IACTLIMITS.L") field(LNK5, "QUAD:LTUS:820:IACT.LOLO") field(DOL6, "QUAD:LTUS:820:BLIMITS") field(LNK6, "QUAD:LTUS:820:IMONLIMITS.F PP") field(DOL7, "QUAD:LTUS:820:IMONLIMITS.I") field(LNK7, "QUAD:LTUS:820:IMON.HIGH") field(DOL8, "QUAD:LTUS:820:IMONLIMITS.J") field(LNK8, "QUAD:LTUS:820:IMON.LOW") field(DOL9, "QUAD:LTUS:820:IMONLIMITS.K") field(LNK9, "QUAD:LTUS:820:IMON.HIHI") field(DOLA, "QUAD:LTUS:820:IMONLIMITS.L") field(LNKA, "QUAD:LTUS:820: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, "QUAD:LTUS:820:IDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntRawDeltas") field(INPD, "QUAD:LTUS:820:TRIMBTOL") field(INPE, "QUAD:LTUS:820:CHCKBTOL") field(INPF, "QUAD:LTUS:820:BDELTAS.K") field(INPG, "QUAD:LTUS:820:BDELTAS.L") field(INPH, "QUAD:LTUS:820: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, "QUAD:LTUS:820:STDZITOLR") field(INPC, "QUAD:LTUS:820:STDZITOL") field(FLNK, "") } # All ps controllers with on/off control will set the macro ONOF # as follows: # # ONOF = PSC:LTUS:MG18: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, "QUAD:LTUS:820:STATESETPT") { field(DESC, "PS On/Off") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFF") field(ONAM, "ON") field(OUT, "PSC:LTUS:MG18:STATESETPT PP") 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 = PSC:LTUS:MG18:RESET PP # record(bo, "QUAD:LTUS:820:RESET") { field(DESC, "Interlock Latch Reset") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFF") field(ONAM, "ON") field(HIGH, "1.0") field(OUT, "PSC:LTUS:MG18:RESET PP") } record(bo, "QUAD:LTUS:820:RAMPSTATE") { field(DESC, "PS Ramp Status") field(DTYP, "Soft Channel") field(DOL, "PSC:LTUS:MG18:RAMPSTATE NPP 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, "QUAD:LTUS:820: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, "QUAD:LTUS:820:TRIMRAMPRATE") field(OUT, "PSC:LTUS:MG18:IRAMPRATE PP") field(FLNK, "QUAD:LTUS:820:STDZDLY") } record(ao, "QUAD:LTUS:820:ISETPT") { field(DESC, "Current Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(DRVH, "120.0") field(DRVL, "-120.0") field(MDEL, "-1") field(OUT, "PSC:LTUS:MG18:ISETPT PP") field(DOL, "QUAD:LTUS:820: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, "QUAD:LTUS:820:IMON") { field(DESC, "Aux Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(INP, "PSC:LTUS:MG18:IMON") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "QUAD:LTUS:820:BMON") } record(ao, "QUAD:LTUS:820:IRIPL") { field(DESC, "Ripple Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(DOL, "PSC:LTUS:MG18:IRIPL NPP NMS") field(OMSL, "closed_loop") field(EGU, "A") field(DRVH, "1.0") field(HOPR, "1.0") field(PREC, "3") field(FLNK, "QUAD:LTUS:820:IRIPLOK") } record(sub, "QUAD:LTUS:820:IRIPLOK") { field(DESC, "Ripple Current Status") field(INAM, "mgntInit") field(SNAM, "mgntRiplOK") field(INPA, "QUAD:LTUS:820:IRIPL.VAL") field(INPB, "QUAD:LTUS:820: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, "QUAD:LTUS:820:R") { field(DESC, "Resistance") field(EGU, "Ohms") field(PREC, "4") field(PINI, "YES") field(DOL, "PSC:LTUS:MG18:R NPP MS") 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, "QUAD:LTUS:820:IGND") { field(DESC, "Ground Current") field(EGU, "A") field(PREC, "6") field(PINI, "YES") field(DOL, "PSC:LTUS:MG18:IGND NPP MS") field(OMSL, "closed_loop") } record(bi, "QUAD:LTUS:820:INTLKSUMY") { field(DESC, "Interlock Summary") field(INP, "PSC:LTUS:MG18:INTLKSUMY NPP MS") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(ZNAM, "OK") field(ONAM, "FAULT") field(PINI, "NO") } record(mbbo, "QUAD:LTUS:820: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, "PSC:LTUS:MG18:COOLING") field(OMSL, "closed_loop") } # The following PV is processed by :BACTFO # which is processed by :BACT record(fanout, "QUAD:LTUS:820:IACTFO") { field(DESC, "IACT processing") field(SELM, "All") field(LNK1, "QUAD:LTUS:820:IACTPREVOK") field(LNK2, "QUAD:LTUS:820:IDIFF") field(LNK3, "QUAD:LTUS:820:IADIFF") field(LNK4, "QUAD:LTUS:820:IRATIO") field(LNK5, "QUAD:LTUS:820:IDIRECT") field(LNK6, "QUAD:LTUS:820:IACTPOL_CHECK") } record(calc, "QUAD:LTUS:820:IDIFF") { field(DESC, "IDES-IACT") field(CALC, "A-B") field(INPA, "QUAD:LTUS:820:IDES") field(INPB, "QUAD:LTUS:820:IACT") field(EGU, "A") field(PREC, "9") field(HOPR, "120.0") field(LOPR, "-120.0") } record(calc, "QUAD:LTUS:820:IADIFF") { field(DESC, "Absolute IDES-IACT") field(CALC, "A<0?ABS(A):A") field(INPA, "QUAD:LTUS:820:IDIFF") field(PREC, "9") } record(calc, "QUAD:LTUS:820:IRATIO") { field(DESC, "IDES-IACT/IMAX") field(CALC, "B?A/B:0") field(INPA, "QUAD:LTUS:820:IDIFF") field(INPB, "QUAD:LTUS:820:IDES.DRVH") field(PREC, "9") } record(calcout, "QUAD:LTUS:820:IRANGE") { field(DESC, "Current Range") field(PINI, "YES") field(CALC, "ABS(A-B)") field(INPA, "QUAD:LTUS:820:IMIN") field(INPB, "QUAD:LTUS:820: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, "QUAD:LTUS:820: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, "QUAD:LTUS:820:IACT") field(FLNK, "QUAD:LTUS:820:IACTPOL") } record(bo, "QUAD:LTUS:820:IACTPOL") { field(DESC, "Actual I Polarity") field(DTYP, "Raw Soft Channel") field(DOL, "QUAD:LTUS:820: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,"QUAD:LTUS:820:I*LIMITS:\n Calculate alarm and warning limits based on \n deltas from QUAD:LTUS:820:IDELTAS and the\n QUAD:LTUS:820: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,"QUAD:LTUS:820:IACT: \n Get copy of QUAD:LTUS:820:I. \n",null) #! TextBox(TB12,1280,3100,1760,3200,0,"Dialog",12,1,16777215,"QUAD:LTUS:820: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,"QUAD:LTUS:820:IDES:\n Contains raw value calculated by \nQUAD:LTUS:820: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 \nQUAD:LTUS:820:BDELTAS.\n",null) #! TextBox(TB10,56,1940,316,2340,0,"Dialog",12,1,16777215,"QUAD:LTUS:820: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 QUAD:LTUS:820: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 QUAD:LTUS:820: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,"QUAD:LTUS:820:ISETPT:\n Sets the hardware. When fast feedback is set on, this record is\n set to closed loop mode by QUAD:LTUS:820:FBCKSTART sequence. When \n the loop is closed, this record takes input calculated by \n BFBCK only. When fast feedback is set off, QUAD:LTUS:820:FBCKSTOP \n will set it back to supervisory so that the value can be set by \n QUAD:LTUS:820: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, "QUAD:LTUS:820:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:820:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "QUAD:LTUS:820:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "QUAD:LTUS:820:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "QUAD:LTUS:820:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "QUAD:LTUS:820:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "1") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "QUAD:LTUS:820: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, "QUAD:LTUS:820:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "QUAD:LTUS:820:TRIMTYPE.RVAL") field(INPB, "QUAD:LTUS:820:CONFIG.RVAL") field(OUT, "QUAD:LTUS:820:TRIMMAXNUM PP") } record(longout, "QUAD:LTUS:820: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, "QUAD:LTUS:820: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, "") field(OMSL, "supervisory") field(VAL, "10") field(OUT, "QUAD:LTUS:820:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "QUAD:LTUS:820: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, "") field(OMSL, "supervisory") field(VAL, "10") } record(bo, "QUAD:LTUS:820: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, "QUAD:LTUS:820: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, "QUAD:LTUS:820: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, "QUAD:LTUS:820:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "0") } record(ao, "QUAD:LTUS:820: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, "QUAD:LTUS:820:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "QUAD:LTUS:820: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, "QUAD:LTUS:820: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, "QUAD:LTUS:820:IMOVE") field(INPB, "QUAD:LTUS:820:IACT") field(INPC, "QUAD:LTUS:820:IRAMPRATE") field(INPD, "1.577") field(INPE, "QUAD:LTUS:820:TRIMDLYPCT") field(INPF, "QUAD:LTUS:820:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "QUAD:LTUS:820:RAMPTIME_LEFT PP") } record(longout, "QUAD:LTUS:820:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "QUAD:LTUS:820:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "QUAD:LTUS:820:RAMPDONE_CALC") } record(calc, "QUAD:LTUS:820:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "QUAD:LTUS:820:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "QUAD:LTUS:820:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "QUAD:LTUS:820: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, "QUAD:LTUS:820:RAMPTIME_LEFT") field(OUT, "QUAD:LTUS:820:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "QUAD:LTUS:820:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "QUAD:LTUS:820:RAMPTIME_LEFT NMS") field(OUT, "QUAD:LTUS:820:RAMPDONE PP") } record(bo, "QUAD:LTUS:820:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "QUAD:LTUS:820:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "QUAD:LTUS:820: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, "QUAD:LTUS:820: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, "QUAD:LTUS:820:STDZINIT") { field(DESC, "Proc. Stdz PVs on boot") field(PINI, "YES") field(DOL1, "1") field(DOL2, "1") field(DOL3, "1") field(LNK1, "QUAD:LTUS:820:DEBUG.PROC PP") field(LNK2, "QUAD:LTUS:820:STDZCYCLENUM.PROC PP") field(LNK3, "QUAD:LTUS:820:STDZDISABLE.PROC PP") field(LNK4, "QUAD:LTUS:820: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, "QUAD:LTUS:820:STDZSUB") { field(DESC, "Stdz subroutine") field(INAM, "mgntStdzInit") field(SNAM, "mgntStdz") field(BRSV, "INVALID") field(INPA, "QUAD:LTUS:820:STDZIMIN NPP NMS") field(INPB, "QUAD:LTUS:820:STDZIMAX NPP NMS") field(INPC, "QUAD:LTUS:820:STDZIFINAL NPP NMS") field(INPD, "QUAD:LTUS:820:STDZCYCLENUM NPP NMS") field(INPE, "QUAD:LTUS:820:STDZDIRECT.RVAL NPP NMS") field(INPF, "QUAD:LTUS:820:STDZDISABLE.RVAL CPP NMS") field(INPG, "QUAD:LTUS:820: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, "QUAD:LTUS:820:STDZWF PP") field(OUTB, "QUAD:LTUS:820: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, "QUAD:LTUS:820:STDZWF") } record(mbbo, "QUAD:LTUS:820: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, "QUAD:LTUS:820: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, "QUAD:LTUS:820:STDZMAINPS") { field(DESC, "Stdz by main or self") field(PINI, "YES") field(DTYP, "Soft Channel") field(ZNAM, "SELF") field(ONAM, "MAIN") } record(bo, "QUAD:LTUS:820: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, "QUAD:LTUS:820: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, "QUAD:LTUS:820: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, "QUAD:LTUS:820:STDZTOD") { field(DESC, "Successful Standardize Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "QUAD:LTUS:820:STDZLOSTTOD") { field(DESC, "Standardize Lost Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(longout, "QUAD:LTUS:820:STDZCYCLECNT") { field(DESC, "Cycle Count") field(PINI, "YES") } record(longout, "QUAD:LTUS:820:STDZCYCLENUM") { field(DESC, "No. Standardize Cycles") field(VAL, "3") field(HOPR, "10") field(LOPR, "0") field(DRVH, "10") field(DRVL, "0") field(PINI, "YES") field(FLNK, "QUAD:LTUS:820:STDZDIRECT") } # The default standardize direction is "UP" for # all LCLS Magnets.. record(bo, "QUAD:LTUS:820:STDZDIRECT") { field(DESC, "Standardize Direction ") field(ZNAM, "UP") field(ONAM, "DOWN") field(VAL, "0") field(FLNK, "QUAD:LTUS:820:STDZIMIN") } record(ao, "QUAD:LTUS:820:STDZIMIN") { field(DESC, "Min-STDZ Current") field(PREC, "1") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(VAL, "-120.0") field(FLNK, "QUAD:LTUS:820:STDZIMAX") } record(ao, "QUAD:LTUS:820:STDZIMAX") { field(DESC, "Max. Standarize Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(VAL, "120.0") field(FLNK, "QUAD:LTUS:820:STDZIFINAL") } record(ao, "QUAD:LTUS:820:STDZIFINAL") { field(DESC, "Final SDTZ Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(VAL, "-120.0") field(FLNK, "QUAD:LTUS:820: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, "QUAD:LTUS:820: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, "QUAD:LTUS:820:STDZITOL") { field(DESC, "Stdz min tolerance") field(PREC, "5") field(CALC, "MAX(ABS(A),ABS(B))*C") field(INPA, "QUAD:LTUS:820:STDZIMIN CP NMS") field(INPB, "QUAD:LTUS:820:STDZIMAX CP MMS") field(INPC, "0.05") field(INPD, "QUAD:LTUS:820:STDZITOLR CP MMS") field(EGU, "A") field(FLNK, "QUAD:LTUS:820:IDELTAS") field(PINI, "YES") } # D - factor (3.154/2 = 1.577) for EPSC, otherwise, set to 1.0 record(calc, "QUAD:LTUS:820:STDZDLY") { field(DESC, "Ramp time for stdz cycle") field(CALC, "C>0?MAX(1,ABS((A-B)/C)*D):0") field(INPA, "QUAD:LTUS:820:STDZIMIN CP NMS") field(INPB, "QUAD:LTUS:820:STDZIMAX CP NMS") field(INPC, "QUAD:LTUS:820:TRIMRAMPRATE CP NMS") field(INPD, "1.577") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") } record(calc, "QUAD:LTUS:820:STDZRAMPDLY") { field(DESC, "Ramp delay total") field(CALC, "MAX(1,((A/100)*B+B))") field(PREC, "5") field(INPA, "QUAD:LTUS:820:TRIMDLYPCT CP MS") field(INPB, "QUAD:LTUS:820: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, "QUAD:LTUS:820:STDZMINIDLY") { field(DESC, "Mini-stdz delay") field(CALC, "A") field(PREC, "5") field(A, "1.0") field(EGU, "sec") field(PINI, "YES") } record(ao, "QUAD:LTUS:820: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, "QUAD:LTUS:820:STDZMINIDELTA") { field(DESC, "Stdz mini % of IMAX") field(CALC, "(B/100)*(A-C)") field(INPA, "QUAD:LTUS:820:IDES.HOPR") field(INPB, "QUAD:LTUS:820:STDZMINIPCT CPP NMS") field(INPC, "QUAD:LTUS:820:IDES.LOPR") field(PREC, "5") } record(calc, "QUAD:LTUS:820:STDZMINISETPT") { field(DESC, "Mini Stdz delta") field(CALC, "C==0?MAX(E-D,B):MIN(E+D,A)") field(INPA, "QUAD:LTUS:820:IDES.HOPR") field(INPB, "QUAD:LTUS:820:IDES.LOPR") field(INPC, "QUAD:LTUS:820:STDZDIRECT.RVAL") field(INPD, "QUAD:LTUS:820:STDZMINIDELTA") field(INPE, "QUAD:LTUS:820:IDES") field(PREC, "5") field(FLNK, "QUAD:LTUS:820: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, "QUAD:LTUS:820:STDZMINISETPTOOR") { field(DESC, "Mini Stdz setpoint out of range") field(CALC, "C==0?(E-DA)") field(INPA, "QUAD:LTUS:820:IDES.HOPR") field(INPB, "QUAD:LTUS:820:IDES.LOPR") field(INPC, "QUAD:LTUS:820:STDZDIRECT.RVAL") field(INPD, "QUAD:LTUS:820:STDZMINIDELTA") field(INPE, "QUAD:LTUS:820: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, "QUAD:LTUS:820: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, "QUAD:LTUS:820:IADJUST.RVAL") field(INPB, "QUAD:LTUS:820:STDZDIRECT.RVAL") field(INPC, "QUAD:LTUS:820:STDZOK.RVAL") field(INPD, "QUAD:LTUS:820:STDZDISABLE.RVAL") field(INPE, "QUAD:LTUS:820:STATE.RVAL CPP NMS") field(INPF, "QUAD:LTUS:820:ICTRL.RVAL") field(INPG, "QUAD:LTUS:820:STATE.SEVR") field(INPH, "QUAD:LTUS:820:BDELTAS.M") field(INPI, "QUAD:LTUS:820:IACT.SEVR") field(OUT, "QUAD:LTUS:820:STDZLOSTGO.SELN PP NMS") field(OOPT, "Transition To Non-zero") } record(seq, "QUAD:LTUS:820:STDZLOSTGO") { field(DESC, "Process lost stdz") field(SELM, "Mask") field(DOL1, "1") field(DOL2, "0") field(LNK1, "QUAD:LTUS:820:STDZLOSTTOD.PROC") field(LNK2, "QUAD:LTUS:820:STDZOK PP") } # Record maximum current after standardize # Reset to IACT from sequence after trim # Disable processing during (mini-)standardize or trim record(calc, "QUAD:LTUS:820:STDZIACTMAX") { field(DESC, "Max act current after stdz") field(CALC, "MAX(A, B)") field(DISV, "0") field(SDIS, "QUAD:LTUS:820:CHECKPWRDIP_ENABLE") field(INPA, "QUAD:LTUS:820:IACT CP") field(INPB, "QUAD:LTUS:820:STDZIACTMAX") field(EGU, "A") field(FLNK, "QUAD:LTUS:820:CHECKPWRDIP") } # Detect power dip if STDZOK is YES, STDZ is enabled, and IACT is valid # If IACT drops below STDZIACTMAX by more than the trim tolerance, clear STDZOK # Warning: Take the absolute value of the trim tolerance, or else quads of # negative polarity will always lose STDZ since their IDELTAS.I are negative. # Note: Large quads and bends are prone to losing STDZ even if they are # perturbed toward higher current since their current tends to overshoot # by greater than the trim tolerance before settling down. record(calcout, "QUAD:LTUS:820:CHECKPWRDIP") { field(DESC, "Detect power dip") field(CALC, "(A-B>ABS(C))?3:0") field(DISV, "0") field(SDIS, "QUAD:LTUS:820:CHECKPWRDIP_ENABLE") field(INPA, "QUAD:LTUS:820:STDZIACTMAX") field(INPB, "QUAD:LTUS:820:IACT") field(INPC, "QUAD:LTUS:820:IDELTAS.I") field(OUT, "QUAD:LTUS:820:STDZLOSTGO.SELN PP NMS") field(OOPT, "When Non-zero") } # Enable processing of STDZIACTMAX and CHECKPWRDIP only if # STDZOK = YES, STDZDISABLE = NO, CTRL != Trim (2), and # CTRL != Stdz (4) record(calc, "QUAD:LTUS:820:CHECKPWRDIP_ENABLE") { field(CALC, "A&&!B&&(C#2)&&(C#4)") field(INPA, "QUAD:LTUS:820:STDZOK.RVAL CP") field(INPB, "QUAD:LTUS:820:STDZDISABLE.RVAL CP") field(INPC, "QUAD:LTUS:820:CTRL.RVAL CP") } #! 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, "QUAD:LTUS:820: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, "QUAD:LTUS:820:CALBOK") { field(DESC, "Successful Calibration") field(DTYP, "Raw Soft Channel") field(ZNAM, "NO") field(ONAM, "YES") field(DOL, "PSC:LTUS:MG18:CALBOK.RVAL") field(OMSL, "closed_loop") 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, "QUAD:LTUS:820:CALBSET") { field(DESC, "Use DAC Calbration") field(SCAN, "10 second") field(CALC, "A&&(B==0)&&C?31:960") field(INPA, "QUAD:LTUS:820:CALBOK") field(INPB, "QUAD:LTUS:820:CALBDISABLE") field(INPC, "QUAD:LTUS:820:CALBSLOPE") field(OOPT, "On Change") field(OUT, "QUAD:LTUS:820: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, "QUAD:LTUS:820:CALB_SEQ") { field(DESC, "Output Calib Values") field(SELM, "Mask") field(SELL, "QUAD:LTUS:820: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, "QUAD:LTUS:820:CALBSLOPE") field(DOL3, "QUAD:LTUS:820: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, "QUAD:LTUS:820:CALBTOD") { field(DESC, "Calibration Success Time") field(PINI, "YES") field(DOL, "PSC:LTUS:MG18:CALBTOD") field(OMSL, "closed_loop") field(DTYP, "Soft Channel") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:820: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, "QUAD:LTUS:820: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, "QUAD:LTUS:820: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, "QUAD:LTUS:820:CALBOFFSET") { field(DESC, "Calc DAC Offset") field(PREC, "6") field(EGU, "Counts") field(PINI, "YES") } record(bo, "QUAD:LTUS:820: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, "QUAD:LTUS:820:DACSLOPE") { field(DESC, "V to DAC slope") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "closed_loop") field(PINI, "YES") field(FLNK, "QUAD:LTUS:820:DACOFFSET") } # Default Offset used in conversion from Volts to DAC Counts record(ao, "QUAD:LTUS:820:DACOFFSET") { field(DESC, "V to DAC offset") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "closed_loop") field(PINI, "YES") field(FLNK, "QUAD:LTUS:820: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, "QUAD:LTUS:820: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, "QUAD:LTUS:820:IACT") field(INPD, "QUAD:LTUS:820:DACSLOPE") field(INPE, "QUAD:LTUS:820:DACOFFSET") field(EGU, "Counts") field(PREC, "6") } record(ao, "QUAD:LTUS:820:DAC") { field(DESC, "DAC Set point") field(EGU, "Counts") field(DOL, "") field(OMSL, "closed_loop") field(PREC, "6") field(PINI, "YES") } record(ao, "QUAD:LTUS:820:CALBIMIN") { field(DESC, "Calibration Min Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(DRVH, "120.0") field(HOPR, "120.0") field(DRVL, "-120.0") field(LOPR, "-120.0") field(PREC, "3") field(EGU, "A") field(VAL, "0.0") field(FLNK, "QUAD:LTUS:820:CALBIMAX") } record(ao, "QUAD:LTUS:820:CALBIMAX") { field(DESC, "Calibration Max Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(DRVH, "120.0") field(HOPR, "120.0") field(LOPR, "-120.0") field(DRVL, "-120.0") field(EGU, "A") field(VAL, "120.0") field(FLNK, "QUAD:LTUS:820:CALBSTEPNUM") } record(ao, "QUAD:LTUS:820:CALBIFINAL") { field(DESC, "Calibration Last Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(PREC, "3") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(VAL, "0") } record(longout, "QUAD:LTUS:820: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, "QUAD:LTUS:820:CALBIDELTA") } record(calc, "QUAD:LTUS:820:CALBIDELTA") { field(DESC, "Step size for CALB") field(CALC, "C=0?0:ABS((A-B)/C)") field(INPA, "QUAD:LTUS:820:CALBIMAX") field(INPB, "QUAD:LTUS:820:CALBIMIN") field(INPC, "QUAD:LTUS:820: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, "QUAD:LTUS:820:CALBIMULT") { field(DESC, "IACT vs ISETPT mult") field(CALC, "C#0||A=0?1:ABS(B/A)") field(INPA, "PSC:LTUS:MG18:ISETPT.DRVH") field(INPB, "PSC:LTUS:MG18:IACT.HOPR") field(INPC, "QUAD:LTUS:820:PSCONTROLLER.RVAL CPP") field(EGU, "A") field(PINI, "YES") } # SNL dbputs DAC values here. 6-10 steps are possible. record(waveform, "QUAD:LTUS:820:CALBICTRLWF") { field(DESC, "ICTRL setpoint array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") } record(waveform, "QUAD:LTUS:820:DACWF") { field(DESC, "DAC count array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:820:DACSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:820:DACSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "QUAD:LTUS:820: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, "QUAD:LTUS:820:CALCDACWF") { field(DESC, "Calc DAC counts array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:820:CALCDACSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:820:CALCDACSA") { field(DESC, "Calc DAC counts") field(DTYP, "Soft Channel") field(INP, "QUAD:LTUS:820: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, "QUAD:LTUS:820:CALBYWF") { field(DESC, "mx + b") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:820:CALBYSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:820:CALBYSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "QUAD:LTUS:820:CALBYWF") field(MALM, "10") field(NELM, "6") field(INDX, "0") field(FTVL, "DOUBLE") } record(waveform, "QUAD:LTUS:820:CALBIACTWF") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:820:CALBIACTSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:820:CALBIACTSA") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(MALM, "10") field(NELM, "6") field(INP, "QUAD:LTUS:820:CALBIACTWF") field(INDX, "0") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:820:CALBLIMITS") } # Check that measured current during calibration is within # tolerance. record(aSub, "QUAD:LTUS:820: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, "QUAD:LTUS:820:CALBSTEPNUM") field(INPB, "QUAD:LTUS:820:CALBIACTWF") field(INPC, "QUAD:LTUS:820: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, "QUAD:LTUS:820: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, "QUAD:LTUS:820:STDZITOL") field(INPH, "QUAD:LTUS:820:DACSLOPE") field(INPI, "QUAD:LTUS:820: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, "QUAD:LTUS:820: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, "QUAD:LTUS:820:CALBSTEPNUM") field(INPB, "QUAD:LTUS:820:CALBIACTWF") field(INPC, "QUAD:LTUS:820:DACWF") field(INPF, "QUAD:LTUS:820: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 QUAD:LTUS:820CALBOK 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, "QUAD:LTUS:820:DEGAUSINIT") { field(DESC, "Proc. Degauss PVs on boot") field(PINI, "YES") field(DOL, "1") field(OUTA, "QUAD:LTUS:820:DEGAUSIMIN.PROC PP") field(OUTB, "QUAD:LTUS:820:DEGAUSIMAX.PROC PP") field(OUTC, "QUAD:LTUS:820:DEGAUSTYPE.PROC PP") field(OUTD, "QUAD:LTUS:820:DEGAUSSTEP.PROC PP") field(OUTE, "QUAD:LTUS:820:MADNAME.PROC PP") field(OUTF, "QUAD:LTUS:820:PSTYPE.PROC PP") field(OUTG, "QUAD:LTUS:820: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, "QUAD:LTUS:820:DEGAUSSUB") { field(DESC, "Degauss subroutine") field(INAM, "mgntDegaussInit") field(SNAM, "mgntDegauss") field(BRSV, "INVALID") field(INPA, "QUAD:LTUS:820:DEGAUSIMIN NPP NMS") field(INPB, "QUAD:LTUS:820:DEGAUSIMAX NPP NMS") field(INPC, "QUAD:LTUS:820:DEGAUSTYPE.RVAL NPP NMS") field(INPE, "QUAD:LTUS:820:DEGAUSMETHOD.RVAL NPP NMS") field(INPF, "QUAD:LTUS:820:PSTYPE NPP NMS") field(INPG, "QUAD:LTUS:820:DEBUG.RVAL NPP NMS") field(INPH, "QUAD:LTUS:820: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, "QUAD:LTUS:820:DEGAUSWF PP") field(OUTB, "QUAD:LTUS:820:DEGAUSMSG PP") field(OUTC, "QUAD:LTUS:820: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, "QUAD:LTUS:820:DEGAUSWF") { field(DESC, "Degauss Setpts") field(NELM, "60") field(FTVL, "DOUBLE") } record(mbbo,"QUAD:LTUS:820: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, "QUAD:LTUS:820: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, "QUAD:LTUS:820: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, "QUAD:LTUS:820: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, "QUAD:LTUS:820: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, "QUAD:LTUS:820:DEGAUSIMIN") { field(DESC, "Min. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "120.0") field(LOPR, "-120.0") field(DRVH, "120.0") field(DRVL, "-120.0") field(VAL, "-120.0") } record(ao, "QUAD:LTUS:820:DEGAUSIMAX") { field(DESC, "Max. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "120.0") field(LOPR, "-120.0") field(DRVH, "120.0") field(DRVL, "-120.0") field(VAL, "120.0") } # 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,"QUAD:LTUS:820: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, "QUAD:LTUS:820: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,"QUAD:LTUS:820: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, "QUAD:LTUS:820: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, "QUAD:LTUS:820: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, "QUAD:LTUS:820: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, "QUAD:LTUS:820:DEGAUSTOD") { field(DESC, "Successful Degauss Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "QUAD:LTUS:820:DEGAUSLOSTTOD") { field(DESC, "Degauss Lost Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:820:DEGAUSTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "QUAD:LTUS:820:DEGAUSTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "QUAD:LTUS:820: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, "QUAD:LTUS:820:DEGAUSGO") { field(DESC, "Set bdes of btrms to zero") field(ASG, "Internal") field(OUTA, "") field(OUTB, "") field(OUTC, "") field(OUTD, "") } # =========== CRYO ONLY =========== record(bo, "QUAD:LTUS:820: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, "QUAD:LTUS:820:DEGAUS_IMAX_CHECK") { field(DESC, "Check if imax shoud chg") field(CALC, "(C==4)&&(ABS(B)>ABS(A))?1:0") field(INPA, "QUAD:LTUS:820:DEGAUS_IMAX") field(INPB, "QUAD:LTUS:820:ISETPT") field(INPC, "QUAD:LTUS:820:DEGAUSTYPE.RVAL") field(OUT, "QUAD:LTUS:820:DEGAUS_IMAX_UPDATE.SELN") field(FLNK, "QUAD:LTUS:820:DEGAUS_IMAX_UPDATE") } record(seq, "QUAD:LTUS:820:DEGAUS_IMAX_UPDATE") { field(DESC, "Degauss IMAX Update") field(SELM, "Specified") field(DOL1, "QUAD:LTUS:820:ISETPT") field(LNK1, "QUAD:LTUS:820:DEGAUS_IMAX PP") } # Set the maximum current after a successful # degauss. This pv is updated by the # sequence. record(ao, "QUAD:LTUS:820:DEGAUS_IMAX") { field(DESC, "Max I set afer a degauss") field(EGU, "Amps") field(PINI, "YES") field(PREC, "6") field(HOPR, "120.0") field(LOPR, "-120.0") field(DRVH, "120.0") field(DRVL, "-120.0") field(VAL, "120.0") field(FLNK, "QUAD:LTUS:820:DEGAUS_IMAXPOL_CHECK") info(autosaveFields,"VAL,RVAL") } # Set the polarity if degauss_imax record(calcout, "QUAD:LTUS:820:DEGAUS_IMAXPOL_CHECK") { field(DESC, "Determine polarity of imax") field(CALC, "A>=0?0:1") field(INPA, "QUAD:LTUS:820:DEGAUS_IMAX") field(FLNK, "QUAD:LTUS:820:DEGAUS_IMAXPOL") } record(bo, "QUAD:LTUS:820:DEGAUS_IMAXPOL") { field(DESC, "Polarity of imax I") field(DTYP, "Raw Soft Channel") field(DOL, "QUAD:LTUS:820:DEGAUS_IMAXPOL_CHECK") field(OMSL, "closed_loop") field(ZNAM, "Positive") field(ONAM, "Negative") field(FLNK, "QUAD:LTUS:820: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, "QUAD:LTUS:820:DEGAUS_ABSIMAX") { field(DESC, "Absolute Max. Degauss I") field(CALC, "ABS(A)") field(INPA, "QUAD:LTUS:820:DEGAUS_IMAX") field(PREC, "6") field(EGU, "Amps") field(HOPR, "120.0") field(LOPR, "-120.0") info(autosaveFields,"VAL RVAL") } # IACT Polarity record(calcout, "QUAD:LTUS:820:IACTPOL_CHECK") { field(DESC, "Determine IACT polarity") field(SCAN, "5 second") field(CALC, "ABS(A-B)>C?(A>=0?0:1):D") field(INPA, "QUAD:LTUS:820:IACT") field(INPB, "QUAD:LTUS:820:IACTPOL_CHECK.LA") field(INPC, "0.0001") field(INPD, "QUAD:LTUS:820:IACTPOL_CHECK.PVAL") field(OOPT, "On Change") field(FLNK, "QUAD:LTUS:820:IACTPOL") } record(bo, "QUAD:LTUS:820: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,"QUAD:LTUS:820: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, "QUAD:LTUS:820:DEGAUSENABLE CP") field(INPB, "QUAD:LTUS:820:DEGAUSOK") field(INPC, "QUAD:LTUS:820:STATE CP") field(INPD, "QUAD:LTUS:820:STATE.SEVR") field(OUT, "QUAD:LTUS:820:DEGAUS_STATE_SEQ.SELN PP") field(ASG, "Internal") } record(seq, "QUAD:LTUS:820:DEGAUS_STATE_SEQ") { field(DESC, "Degauss State Sequence") field(SELM, "Specified") field(SELL, "QUAD:LTUS:820:DEGAUS_STATE_CHECK") field(LNK1, "QUAD:LTUS:820:DEGAUS_STATE_DISABLE.PROC PP") field(LNK2, "QUAD:LTUS:820:DEGAUS_STATE_LOST.PROC PP") field(LNK3, "QUAD:LTUS:820:DEGAUS_STATE_GOOD.PROC PP") field(LNK4, "QUAD:LTUS:820: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, "QUAD:LTUS:820:DEGAUS_STATE_DISABLE") { field(DESC, "Degauss not used") field(LNK1, "QUAD:LTUS:820:DEGAUSOK.ZSV") field(LNK2, "QUAD:LTUS:820: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, "QUAD:LTUS:820:STATMSG.FRSV") field(LNK4, "QUAD:LTUS:820: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, "QUAD:LTUS:820:DEGAUS_STATE_LOST") { field(DESC, "Degauss lost and ps On") field(DOL1, "1") field(LNK1, "QUAD:LTUS:820:DEGAUSOK.ZSV") field(LNK2, "QUAD:LTUS:820: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, "QUAD:LTUS:820:STATMSG.FRSV") field(LNK4, "QUAD:LTUS:820: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, "QUAD:LTUS:820:DEGAUS_STATE_OFF") { field(DESC, "Degaused lost and ps Off") field(DOL1, "2") field(LNK1, "QUAD:LTUS:820: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, "QUAD:LTUS:820:STATMSG.FRSV") field(LNK3, "QUAD:LTUS:820: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, "QUAD:LTUS:820:DEGAUS_STATE_GOOD") { field(DESC, "Degauss good") field(DOL1, "1") field(LNK1, "QUAD:LTUS:820: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, "QUAD:LTUS:820:STATMSG.FRSV PP") field(LNK3, "QUAD:LTUS:820:STATMSG.FVSV PP") field(LNK4, "") field(ASG, "Internal") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(mbbo, "QUAD:LTUS:820:FUNC") { field(DESC, "QUAD:LTUS:820 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, "1") field(THVL, "9") field(FRVL, "10") field(FVVL, "0") field(SXVL, "2") field(SVVL, "8") field(EIVL, "11") field(NIVL, "12") field(TEVL, "13") field(ELVL, "5") field(TVVL, "6") field(TTVL, "7") field(FTVL, "4") field(FFVL, "3") field(OUT, "QUAD:LTUS:820:CTRL CA") } # :CTRL pv is processed at boot in the # sequence mgntCtrl.st Processed in sequence # record(mbbo, "QUAD:LTUS:820:CTRL") { field(DESC, "QUAD:LTUS:820 Control") field(PINI, "NO") field(ZRST, "Ready") field(ONST, "TRIM") field(TWST, "PERTURB") field(THST, "BCON_TO_BDES") field(FRST, "BACT_TO_BDES") field(FVST, "SAVE_BDES") field(SXST, "LOAD_BDES") field(SVST, "UNDO_BDES") field(EIST, "DAC_ZERO") field(NIST, "CALB") field(TEST, "STDZ") field(ELST, "RESET") field(TVST, "TURN_ON") field(TTST, "TURN_OFF") field(FTST, "") field(FFST, "") field(ZRVL, "0") field(ONVL, "2") field(TWVL, "6") field(THVL, "15") field(FRVL, "14") field(FVVL, "11") field(SXVL, "12") field(SVVL, "13") field(EIVL, "7") field(NIVL, "3") field(TEVL, "4") field(ELVL, "8") field(TVVL, "9") field(TTVL, "10") field(FTVL, "0") field(FFVL, "0") field(OUT, "QUAD:LTUS:820:SELECTEN.A PP") field(SDIS, "0") } # If a function has been selected set this unit to busy record(calcout, "QUAD:LTUS:820:SELECTEN") { field(DESC, "Control Select Enable") field(CALC, "A>0?1:A") field(FLNK, "QUAD:LTUS:820:BUSY") } # Set to FREE on IOC reboot record(bo, "QUAD:LTUS:820:BUSY") { field(DESC, "QUAD:LTUS:820 Ctrl Done") field(DOL, "QUAD:LTUS:820:SELECTEN") field(ZNAM, "FREE") field(ONAM, "BUSY") field(PINI, "YES") field(FLNK, "QUAD:LTUS:820:SELECT") } record(bo, "QUAD:LTUS:820:SELECT") { field(ZNAM, "NO") field(ONAM, "YES") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") } record(bo, "QUAD:LTUS:820: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, "QUAD:LTUS:820:CTRLSTATE") { field(DESC, "QUAD:LTUS:820 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("QUAD:LTUS:820:CTRL",20,20,0,0,"QUAD:LTUS:820:CTRL") #! Field("QUAD:LTUS:820:CTRL.OUT",16777215,1,"QUAD:LTUS:820:CTRL.OUT") #! Link("QUAD:LTUS:820:CTRL.OUT","QUAD:LTUS:820:SELECTEN.A") #! Field("QUAD:LTUS:820:CTRL.VAL",16777215,1,"QUAD:LTUS:820:CTRL.VAL") #! Record("QUAD:LTUS:820:SELECTEN",321,381,0,0,"QUAD:LTUS:820:SELECTEN") #! Field("QUAD:LTUS:820:SELECTEN.A",16777215,0,"QUAD:LTUS:820:SELECTEN.A") #! Field("QUAD:LTUS:820:SELECTEN.FLNK",16777215,1,"QUAD:LTUS:820:SELECTEN.FLNK") #! Link("QUAD:LTUS:820:SELECTEN.FLNK","QUAD:LTUS:820:BUSY") #! Field("QUAD:LTUS:820:SELECTEN.VAL",16777215,1,"QUAD:LTUS:820:SELECTEN.VAL") #! Record("QUAD:LTUS:820:BUSY",623,274,0,0,"QUAD:LTUS:820:BUSY") #! Field("QUAD:LTUS:820:BUSY.DOL",16777215,0,"QUAD:LTUS:820:BUSY.DOL") #! Link("QUAD:LTUS:820:BUSY.DOL","QUAD:LTUS:820:SELECTEN.VAL") #! Field("QUAD:LTUS:820:BUSY.FLNK",16777215,1,"QUAD:LTUS:820:BUSY.FLNK") #! Link("QUAD:LTUS:820:BUSY.FLNK","QUAD:LTUS:820:SELECT") #! Record("QUAD:LTUS:820:SELECT",669,508,0,1,"QUAD:LTUS:820:SELECT") #! Record("QUAD:LTUS:820:FUNC",940,120,0,0,"QUAD:LTUS:820:FUNC") #! Field("QUAD:LTUS:820:FUNC.OUT",16777215,0,"QUAD:LTUS:820:FUNC.OUT") #! Link("QUAD:LTUS:820:FUNC.OUT","QUAD:LTUS:820:CTRL.VAL") #! Record("QUAD:LTUS:820:ABORT",193,41,0,0,"QUAD:LTUS:820:ABORT") #! Record("QUAD:LTUS:820:CTRLSTATE",369,34,0,0,"QUAD:LTUS:820: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,"QUAD:LTUS:820:SELECT is used for Multi-device selection.\nIt is enabled when associated QUAD:LTUS:820:CTRL is \"0\" (DONE).\nIt is disabled when associated QUAD:LTUS:820: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,"QUAD:LTUS:820: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, "QUAD:LTUS:820:BCTRL_INIT") { field(DESC, "Process BCTRL on boot") field(PINI, "YES") field(CALC, "A=3?1:0") field(INPA, "QUAD:LTUS:820:BCTRL.SEVR") field(OUT, "QUAD:LTUS:820: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, "QUAD:LTUS:820:BACT") { field(DESC, "Actual B") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "QUAD:LTUS:820:BACT") field(INPB, "QUAD:LTUS:820:POLYCOEF") field(INPC, "QUAD:LTUS:820:POLYCOEF.A") field(INPD, "QUAD:LTUS:820:POLYCOEF.B") field(INPE, "QUAD:LTUS:820:IACT MS") field(INPF, "QUAD:LTUS:820:BDELTAS PP") field(INPG, "100") field(EGU, "kG") field(HOPR, "67.4835") field(LOPR, "-67.6441") field(HIHI, "67.4835") field(LOLO, "-67.6441") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "67.4835") field(LOW, "-67.6441") field(FLNK, "QUAD:LTUS:820: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, "QUAD:LTUS:820:BDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntPhyDeltas") field(EGU, "kG") field(HOPR, "1") field(PREC, "7") field(BRSV, "INVALID") field(INPA, "QUAD:LTUS:820:BDES") field(INPB, "QUAD:LTUS:820:TRIMBTOL") field(INPC, "QUAD:LTUS:820:TRIMBTOLR") field(INPD, "QUAD:LTUS:820:CHCKBTOL") field(INPE, "QUAD:LTUS:820:CHCKBTOLR") field(F, "2.0") field(INPG, "30") field(INPH, "QUAD:LTUS:820:BACT.VAL") # # MPS absolute and relative tolerances field(INPP, "QUAD:LTUS:820:MPSBTOL") field(INPQ, "QUAD:LTUS:820:MPSBTOLR") field(FLNK, "QUAD:LTUS:820:BCONLIMITS") info(autosaveFields,"F") } # This record is processed by BDELTAS record(aSub, "QUAD:LTUS:820:BCONLIMITS") { field(DESC, "Config B-field Limits") field(INAM, "mgntInit") field(SNAM, "mgntBCONLimits") field(INPA, "QUAD:LTUS:820:BDES") field(INPB, "QUAD:LTUS:820:BDELTAS.I") field(INPG, "QUAD:LTUS:820:DEBUG.RVAL") field(FTA, "DOUBLE") field(FTB, "DOUBLE") field(FTG, "ULONG") field(OUTA, "QUAD:LTUS:820:BCON.HIGH") field(OUTB, "QUAD:LTUS:820:BCON.LOW") field(OUTC, "QUAD:LTUS:820:BCON.HIHI") field(OUTD, "QUAD:LTUS:820:BCON.LOLO PP") field(FTVA, "DOUBLE") field(FTVB, "DOUBLE") field(FTVC, "DOUBLE") field(FTVD, "DOUBLE") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:820:IDELTAS") } # The following PV is processed by :BACT # which is processed by :BACT # record(fanout, "QUAD:LTUS:820:BACTFO") { field(DESC, "BACT processing") field(SELM, "All") field(LNK1, "QUAD:LTUS:820:BDIFF") field(LNK2, "QUAD:LTUS:820:BADIFF") field(LNK3, "QUAD:LTUS:820:BRATIO") field(LNK4, "QUAD:LTUS:820:MPSLIMITS") field(LNK5, "QUAD:LTUS:820:I2BSTATUS") field(LNK6, "QUAD:LTUS:820:IACTFO.PROC") } record(calc, "QUAD:LTUS:820:BDIFF") { field(DESC, "BDES-BACT") field(CALC, "A-B") field(INPA, "QUAD:LTUS:820:BDES") field(INPB, "QUAD:LTUS:820:BACT") field(EGU, "kG") field(PREC, "7") } record(calc, "QUAD:LTUS:820:BADIFF") { field(DESC, "Absolute BDES-BACT") field(INPA, "QUAD:LTUS:820:BDIFF") field(EGU, "kG") field(PREC, "7") field(CALC, "A<0?ABS(A):A") } record(calc, "QUAD:LTUS:820:BRATIO") { field(DESC, "BACT Error") field(CALC, "B?A/B:0") field(INPA, "QUAD:LTUS:820:BDIFF") field(INPB, "QUAD:LTUS:820:BDES.HOPR") field(EGU, "kG") field(PREC, "7") } record(mbbi, "QUAD:LTUS:820: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, "QUAD:LTUS:820:BACT.J") } # Note: for a string slave set the MONFL # macro to the following: # MONFL=:IMONCALC MS record(sub, "QUAD:LTUS:820:BMON") { field(DESC, "Second Transductor") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "QUAD:LTUS:820:BMON") field(INPB, "QUAD:LTUS:820:POLYCOEF") field(INPC, "QUAD:LTUS:820:POLYCOEF.A") field(INPD, "QUAD:LTUS:820:POLYCOEF.B") field(INPE, "QUAD:LTUS:820:IMON MS") field(INPF, "QUAD:LTUS:820:BDELTAS.VAL") field(INPG, "100") field(EGU, "kG") field(HOPR, "67.4835") field(LOPR, "-67.6441") field(HIHI, "67.4835") field(LOLO, "-67.6441") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "67.4835") field(LOW, "-67.6441") } # 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=PSC:LTUS:MG18:BDES CP record(ao, "QUAD:LTUS:820:BDES") { field(DESC, "Desired B-Field") field(PINI, "YES") field(DRVH, "67.4835") field(DRVL, "-67.6441") field(HOPR, "67.4835") field(LOPR, "-67.6441") field(PREC, "7") field(EGU, "kG") field(MDEL, "-1") field(OMSL, "supervisory") # field(DOL, "") field(OUT, "QUAD:LTUS:820:B2IDES PP") info(autosaveFields,"VAL") } record(sub, "QUAD:LTUS:820:B2IDES") { field(DESC, "Convert Desired B-Field to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:820:POLYCOEF") field(INPC, "QUAD:LTUS:820:POLYCOEF.A") field(INPD, "QUAD:LTUS:820:POLYCOEF.B") field(PREC, "7") field(EGU, "kG") field(HOPR, "67.4835") field(LOPR, "-67.6441") field(MDEL, "-1") field(INPE, "QUAD:LTUS:820:BDES.DRVH") field(INPF, "QUAD:LTUS:820:BDES.DRVL") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:820:IDES") } record(sub, "QUAD:LTUS:820:BNOM") { field(DESC, "Nominal Field") field(PINI, "YES") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:820:POLYCOEF") field(INPC, "QUAD:LTUS:820:POLYCOEF.A") field(INPD, "QUAD:LTUS:820:POLYCOEF.B") field(INPE, "QUAD:LTUS:820:BDES.DRVH") field(INPF, "QUAD:LTUS:820:BDES.DRVL") field(EGU, "kG") field(HOPR, "67.4835") field(LOPR, "-67.6441") field(PREC, "7") field(VAL, "0.0") field(FLNK, "QUAD:LTUS:820:INOM") } record(sub, "QUAD:LTUS:820:BACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:820:BDES.VAL") field(INPB, "QUAD:LTUS:820:BDES.DRVH") field(INPC, "QUAD:LTUS:820:BDES.DRVL") field(INPD, "QUAD:LTUS:820:BDELTAS.I") field(INPE, "QUAD:LTUS:820:BDELTAS.J") field(INPG, "QUAD:LTUS:820:STATE") field(INPH, "QUAD:LTUS:820:HSTA") field(EGU, "kG") field(HOPR, "67.4835") field(LOPR, "-67.6441") field(PREC, "7") field(BRSV, "INVALID") } record(sub, "QUAD:LTUS:820:BMONLIMITS") { field(DESC, "MON Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:820:BDES.VAL") field(INPB, "QUAD:LTUS:820:BDES.DRVH") field(INPC, "QUAD:LTUS:820:BDES.DRVL") field(INPD, "QUAD:LTUS:820:BDELTAS.K") field(INPE, "QUAD:LTUS:820:BDELTAS.L") field(INPG, "QUAD:LTUS:820:STATE") field(INPH, "QUAD:LTUS:820:HSTA") field(EGU, "kG") field(HOPR, "67.4835") field(LOPR, "-67.6441") field(PREC, "7") field(BRSV, "INVALID") } record(seq, "QUAD:LTUS:820:BLIMITS") { field(DESC, "ACT Limits") field(PREC, "7") field(DOL1, "QUAD:LTUS:820:BLIMITS") field(LNK1, "QUAD:LTUS:820:BACTLIMITS.F PP") field(DOL2, "QUAD:LTUS:820:BACTLIMITS.I") field(LNK2, "QUAD:LTUS:820:BACT.HIGH") field(DOL3, "QUAD:LTUS:820:BACTLIMITS.J") field(LNK3, "QUAD:LTUS:820:BACT.LOW") field(DOL4, "QUAD:LTUS:820:BACTLIMITS.K") field(LNK4, "QUAD:LTUS:820:BACT.HIHI") field(DOL5, "QUAD:LTUS:820:BACTLIMITS.L") field(LNK5, "QUAD:LTUS:820:BACT.LOLO") field(DOL6, "QUAD:LTUS:820:BLIMITS") field(LNK6, "QUAD:LTUS:820:BMONLIMITS.F PP") field(DOL7, "QUAD:LTUS:820:BMONLIMITS.I") field(LNK7, "QUAD:LTUS:820:BMON.HIGH") field(DOL8, "QUAD:LTUS:820:BMONLIMITS.J") field(LNK8, "QUAD:LTUS:820:BMON.LOW") field(DOL9, "QUAD:LTUS:820:BMONLIMITS.K") field(LNK9, "QUAD:LTUS:820:BMON.HIHI") field(DOLA, "QUAD:LTUS:820:BMONLIMITS.L") field(LNKA, "QUAD:LTUS:820:BMON.LOLO") field(FLNK, "QUAD:LTUS:820:ILIMITS") field(SCAN, "5 second") } record(ao, "QUAD:LTUS:820:BCTRL") { field(DESC, "B-Perturb") field(PREC, "7") field(EGU, "kG") field(DRVH, "67.4835") field(DRVL, "-67.6441") field(HOPR, "67.4835") field(LOPR, "-67.6441") # 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, "QUAD:LTUS:820: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, "QUAD:LTUS:820:BCTRLGO") { field(DESC, "Update DES and perturb") field(PREC, "7") # Disable BACT limits field(DOL1, "1") field(LNK1, "QUAD:LTUS:820:BLIMITS.VAL") # Update BDES with the BCTRL (slider) value field(DOL2, "QUAD:LTUS:820:BCTRL.VAL") field(LNK2, "QUAD:LTUS:820:BDES PP") field(DOL3, "1") field(LNK3, "QUAD:LTUS:820:IDIRECT.PROC PP") field(DOL4, "1") field(LNK4, "QUAD:LTUS:820:CHECKSTDZLOST.PROC PP") field(DOL5, "QUAD:LTUS:820:BCTRL.VAL") field(LNK5, "QUAD:LTUS:820:BCTRLSUB PP") # Re-enable BACT limits field(DOL6, "0") field(LNK6, "QUAD:LTUS:820:BLIMITS.VAL") } # Convert B-field to Current and output to ISETPT record(sub, "QUAD:LTUS:820:BCTRLSUB") { field(DESC, "Feedback") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:820:POLYCOEF") field(INPC, "QUAD:LTUS:820:POLYCOEF.A") field(INPD, "QUAD:LTUS:820:POLYCOEF.B") field(INPE, "QUAD:LTUS:820:BDES.DRVH") field(INPF, "QUAD:LTUS:820:BDES.DRVL") field(PREC, "7") field(EGU, "kG") field(HOPR, "67.4835") field(LOPR, "-67.6441") field(MDEL, "-1") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:820:ISETPT") } record(ao, "QUAD:LTUS:820:BDESPREVTRIM") { field(DESC, "trim bdes for undo") field(DTYP, "Soft Channel") field(DRVH, "67.4835") field(DRVL, "-67.6441") field(EGU, "kG") field(HOPR, "67.4835") field(LOPR, "-67.6441") field(PREC, "7") field(PINI, "YES") info(autosaveFields,"VAL") } record(stringin, "QUAD:LTUS:820:MADNAME") { field(DESC, "MAD deck nomenclature") field(PINI, "YES") field(VAL, "QUM1B") } record(ai, "QUAD:LTUS:820: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, "3537.636213") } record(ao, "QUAD:LTUS:820:BMAX") { field(DESC, "Max B-Field") field(DTYP, "Soft Channel") field(DRVH, "67.4835") field(DRVL, "-67.6441") field(EGU, "kG") field(HOPR, "67.4835") field(LOPR, "-67.6441") field(PREC, "7") field(PINI, "YES") field(VAL, "67.4835") field(FLNK, "QUAD:LTUS:820:BSTEP") } record(ao, "QUAD:LTUS:820:BMIN") { field(DESC, "Min B-Field") field(DTYP, "Soft Channel") field(DRVH, "67.4835") field(DRVL, "-67.6441") field(EGU, "kG") field(HOPR, "67.4835") field(LOPR, "-67.6441") field(PREC, "7") field(PINI, "YES") field(VAL, "-67.6441") field(FLNK, "QUAD:LTUS:820:BSTEP") } record(ao, "QUAD:LTUS:820:BDESSAVE") { field(DESC, "bdes for save/load") field(DTYP, "Soft Channel") field(DRVH, "67.4835") field(DRVL, "-67.6441") field(EGU, "kG") field(HOPR, "67.4835") field(LOPR, "-67.6441") field(PINI, "YES") field(PREC, "7") } # This record is processed by QUAD:LTUS:820: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, "QUAD:LTUS:820:BCON") { field(DESC, "Config B-Field ") field(DTYP, "Soft Channel") field(PREC, "7") field(EGU, "kG") field(HOPR, "67.4835") field(LOPR, "-67.6441") field(DRVH, "67.4835") field(DRVL, "-67.6441") # Set MINOR Alarm as the default, slaves will set NO_ALARM=0. field(HHSV, "MINOR") field(LLSV, "MINOR") field(HSV, "MINOR") field(LSV, "MINOR") # field(DOL , "") field(OMSL, "supervisory") field(OUT, "QUAD:LTUS:820:B2ICON PP") info(autosaveFields,"VAL") } record(sub, "QUAD:LTUS:820:B2ICON") { field(DESC, "Convert Desired ICon to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:820:POLYCOEF") field(INPC, "QUAD:LTUS:820:POLYCOEF.A") field(INPD, "QUAD:LTUS:820:POLYCOEF.B") field(PREC, "7") field(EGU, "kG") field(HOPR, "67.4835") field(LOPR, "-67.6441") field(MDEL, "-1") field(INPE, "QUAD:LTUS:820:BCON.DRVH") field(INPF, "QUAD:LTUS:820:BCON.DRVL") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:820: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, "QUAD:LTUS:820:BSTEP") { field(DESC, "B-Field step size") field(CALC, "(C==3)||(D==3)?0:ABS(A-B)*0.005") field(INPA, "QUAD:LTUS:820:BMAX") field(INPB, "QUAD:LTUS:820:BMIN") field(INPC, "QUAD:LTUS:820:BMIN.SEVR") field(INPD, "QUAD:LTUS:820:BMAX.SEVR") field(EGU, "kG") 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,"QUAD:LTUS:820:BCTRLDISABLECALC") { field(DESC, "Calc for disabling BCTRL") field(ASG, "Internal") field(CALC, "A?2:1") field(INPA, "QUAD:LTUS:820:ONLINE CP") field(OUT, "QUAD:LTUS:820:BCTRLDISABLEFOUT PP") } record(fanout, "QUAD:LTUS:820:BCTRLDISABLEFOUT") { field(DESC, "Disable BCTRL fanout") field(SELM, "Specified") field(SELL, "QUAD:LTUS:820:BCTRLDISABLECALC") field(LNK1, "QUAD:LTUS:820:BCTRLDISABLE") field(LNK2, "QUAD:LTUS:820:BCTRLENABLE") } record(stringout, "QUAD:LTUS:820:BCTRLDISABLE") { field(DESC, "Disable BCTRL") field(DTYP, "Soft Channel") field(OUT, "QUAD:LTUS:820:BCTRL.ASG") field(VAL, "NOWRITE") field(FLNK, "QUAD:LTUS:820:BCTRLDISV_UPDATE") } record(stringout, "QUAD:LTUS:820:BCTRLENABLE") { field(DESC, "Enable BCTRL") field(DTYP, "Soft Channel") field(OUT, "QUAD:LTUS:820:BCTRL.ASG") field(VAL, "") field(FLNK, "QUAD:LTUS:820:BCTRLDISV_UPDATE") } record(calcout, "QUAD:LTUS:820:BCTRLDISV_UPDATE") { field(DESC, "Calc for updating BCTRL.DISV") field(ASG, "Internal") field(CALC, "A") field(INPA, "QUAD:LTUS:820:ONLINE") field(OUT, "QUAD:LTUS:820: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,"QUAD:LTUS:820:BACT and MON\n are processed via links from \n QUAD:LTUS:820:IACT (device raw value readback 1)\n and\n QUAD:LTUS:820: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 QUAD:LTUS:820:POLYCOEF\nC = First polynomial coefficient (offset if linear)\nD = Second polynomial coefficient (slope if linear)\nE = QUAD:LTUS:820: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,"QUAD:LTUS:820:BDES\n is processed when set by CA users or \n QUAD:LTUS:820: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,"QUAD:LTUS:820: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 QUAD:LTUS:820: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 (QUAD:LTUS:820: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,"QUAD:LTUS:820:B*LIMITS and QUAD:LTUS:820:BLIMITS:\n Calculate alarm and warning limits based on \n deltas from QUAD:LTUS:820: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,"QUAD:LTUS:820: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,"QUAD:LTUS:820: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, "QUAD:LTUS:820: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, "QUAD:LTUS:820:MPSBTOL") { field(DESC, "Absolute mps tol") field(EGU, "kG") field(PREC, "2") field(CALC, "ABS(A)*0.02") field(INPA, "QUAD:LTUS:820:BMAX") field(PINI, "YES") } # # 21-Aug-2013: K. Luchini # Set channel access security so that users # cannot easily change values. record(ao, "QUAD:LTUS:820:MPSBMAX") { field(DESC, "MPS Max B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "67.4835") field(DRVL, "-67.6441") field(PINI, "YES") field(VAL, "67.4835") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:820:MPSBMIN") { field(DESC, "MPS Min B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "67.4835") field(DRVL, "-67.6441") field(PINI, "YES") field(VAL, "-67.6441") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:820:MPSBLLIM") { field(DESC, "MPS Low Limit B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "67.4835") field(DRVL, "-67.6441") field(PINI, "YES") field(VAL, "-67.6441") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:820:MPSBLLIM2") { field(DESC, "MPS Low Limit #2 B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "67.4835") field(DRVL, "-67.6441") field(PINI, "YES") field(VAL, "-67.6441") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } # Set the default to Std record(mbbo, "QUAD:LTUS:820: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, "QUAD:LTUS:820:MPSLIMITS.E PP") } record(aSub, "QUAD:LTUS:820: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, "QUAD:LTUS:820:MPS.RVAL") field(INPB, "QUAD:LTUS:820:BADIFF") field(INPC, "QUAD:LTUS:820:BDELTAS.N") field(INPD, "QUAD:LTUS:820:BACT") field(INPE, "QUAD:LTUS:820:MPSBITMASK.RVAL") field(INPF, "QUAD:LTUS:820:MPSBLLIM") field(INPG, "QUAD:LTUS:820:MPSBMIN") field(INPH, "QUAD:LTUS:820:MPSBMAX") field(INPI, "QUAD:LTUS:820: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, "QUAD:LTUS:820:INTOL.RVAL PP") field(OUTB, "QUAD:LTUS:820:INTOL_BMIN.RVAL PP") field(OUTC, "QUAD:LTUS:820:INTOL_BRANGE.RVAL PP") field(OUTD, "QUAD:LTUS:820: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, "QUAD:LTUS:820:INTOL") { field(DESC, "BACT within MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:820:MPSLIMITS.VALA") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "QUAD:LTUS:820:INTOL_BMIN") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:820:MPSLIMITS.VALB") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "QUAD:LTUS:820:INTOL_BMIN2") { field(DESC, "MPS tol #2") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:820:MPSLIMITS.VALD") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "QUAD:LTUS:820:INTOL_BRANGE") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:820: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, "QUAD:LTUS:820:CHCKITOL") { field(DESC, "Absolute Check I Tolerance") field(EGU, "A") field(FLNK, "QUAD:LTUS:820:TRIMITOL") field(CALC, "ABS(A*B)") field(INPA, "QUAD:LTUS:820:CHCKBTOL") field(INPB, "QUAD:LTUS:820:POLYCOEF.B") field(PREC, "9") } record(calc, "QUAD:LTUS:820:TRIMBTOL") { field(EGU, "kG") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(DESC, "Absolute Trim Tolerance") field(CALC, "ABS(A)/2") field(INPA, "QUAD:LTUS:820:CHCKBTOL") field(FLNK, "QUAD:LTUS:820:CHCKITOL") } record(calc, "QUAD:LTUS:820:CHCKBTOL") { field(DESC, "Check absolute tolerance") field(EGU, "A") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(FLNK, "QUAD:LTUS:820:TRIMBTOL") field(CALC, "MAX(ABS(A),ABS(C))*(B/1000000)") field(INPA, "QUAD:LTUS:820:BDES.HOPR") field(INPB, "QUAD:LTUS:820:STABILITY") field(INPC, "QUAD:LTUS:820:BDES.LOPR") } record(longout, "QUAD:LTUS:820: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, "QUAD:LTUS:820:CHCKBTOL") } record(calc, "QUAD:LTUS:820:TRIMITOL") { field(DESC, "Absolute Trim I Tolerance") field(EGU, "kG") field(CALC, "ABS(A*B)") field(INPA, "QUAD:LTUS:820:POLYCOEF.B") field(INPB, "QUAD:LTUS:820:TRIMBTOL") field(PREC, "9") } record(ai, "QUAD:LTUS:820:TRIMBTOLR") { field(DESC, "Relative trim tol") field(PREC, "4") field(EGU, "%") field(HOPR, "1.0") field(LOPR, "0.0") field(PINI, "YES") } record(ai, "QUAD:LTUS:820: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, "QUAD:LTUS:820:FBCKFCOM") { field(ZNAM, "CA") field(ONAM, "FCOM") field(DESC, "CA Mode") field(PINI, "YES") field(SDIS, "0") } record(bo, "QUAD:LTUS:820:PAU") { field(ZNAM, "NotConfigured") field(ONAM, "Configured") field(DESC, "PAU Present") field(PINI, "YES") field(SDIS, "0") field(FLNK, "QUAD:LTUS:820:PAUGO") } record(fanout, "QUAD:LTUS:820:PAUGO") { field(DESC, "PAU control") field(LNK1, "QUAD:LTUS:820:PAUSTOP") field(LNK2, "QUAD:LTUS:820: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, "QUAD:LTUS:820:PAUSTART") { field(DESC, "Setup for PAU On") field(SDIS, "QUAD:LTUS:820: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, "QUAD:LTUS:820:PAUSTOP") { field(DESC, "Setup for PAU Off") field(SDIS, "QUAD:LTUS:820: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, "QUAD:LTUS:820:MCORDEVNAME") { field(DESC, "PS device name") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, "PSC:LTUS:MG18:") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "QUAD:LTUS:820: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, "QUAD:LTUS:820:PSTYPE.RVAL") field(INPC, "QUAD:LTUS:820:TURNEDOFF.RVAL") field(INPD, "QUAD:LTUS:820:CONFIG.RVAL") field(INPE, "QUAD:LTUS:820:PSCATEGORY.RVAL") field(INPF, "QUAD:LTUS:820:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "QUAD:LTUS:820:AUTOCTRL.RVAL") field(INPJ, "QUAD:LTUS:820:OUTOFSERVICE.RVAL") field(INPL, "QUAD:LTUS:820:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "QUAD:LTUS:820:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "QUAD:LTUS:820:PAU") field(INPP, "QUAD:LTUS:820:CALBDISABLE.RVAL") field(INPQ, "QUAD:LTUS:820:PTRBDISABLE.RVAL") field(INPR, "QUAD:LTUS:820:TRIMDISABLE.RVAL") field(INPS, "QUAD:LTUS:820:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "QUAD:LTUS:820:FBCK") field(INPU, "QUAD:LTUS:820:TRIMTYPE.RVAL") field(INPV, "QUAD:LTUS:820:STDZDIRECT.RVAL") field(INPW, "QUAD:LTUS:820:DEGAUSENABLE.RVAL") field(FLNK, "QUAD:LTUS:820:HSTA") } record(longin, "QUAD:LTUS:820:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "QUAD:LTUS:820:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "QUAD:LTUS:820: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, "QUAD:LTUS:820: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, "QUAD:LTUS:820:CALBDISABLE") { field(DESC, "DAC Calb Disabled") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:820:PTRBDISABLE") { field(DESC, "Perturb Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:820:TRIMDISABLE") { field(DESC, "Trim Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:820: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 QUAD:LTUS:820:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses QUAD:LTUS:820:FBCK. # This PV should be replaced by QUAD:LTUS:820: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, "QUAD:LTUS:820: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, "QUAD:LTUS:820: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, "QUAD:LTUS:820: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, "") field(OMSL, "supervisory") field(FLNK, "QUAD:LTUS:820:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"QUAD:LTUS:820:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "QUAD:LTUS:820:OUTOFSERVICE NPP NMS") field(OUT, "QUAD:LTUS:820:ONLINE PP") } record(bo, "QUAD:LTUS:820:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "QUAD:LTUS:820: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, "1") } record(bo, "QUAD:LTUS:820: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, "1") } record(bo, "QUAD:LTUS:820: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, "QUAD:LTUS:820: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, "QUAD:LTUS:820: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, "QUAD:LTUS:820: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, "QUAD:LTUS:820: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, "QUAD:LTUS:820: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, "1") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:820: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, "1") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:820: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, "2") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:820: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, "0") field(ASG, "NOWRITE") field(FLNK, "QUAD:LTUS:820:TRIMTYPE") } record(stringout, "QUAD:LTUS:820:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "QUAD:LTUS:820:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "QUAD:LTUS:820:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "QUAD:LTUS:820:STATE.RVAL") field(INPB, "QUAD:LTUS:820:INTLKSUMY.RVAL") field(OUT, "QUAD:LTUS:820:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:LTUS:820: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, "QUAD:LTUS:820:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "QUAD:LTUS:820:STATE.RVAL") field(INPB, "QUAD:LTUS:820:INTLKSUMY.RVAL") field(OUT, "QUAD:LTUS:820:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:LTUS:820:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "QUAD:LTUS:820:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "QUAD:LTUS:820: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, "QUAD:LTUS:820:RAMPSTARTDLY") { field(DESC, "Tansition to ramp delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "2") } ######### For PSTYPE=2 Only ############# record(mbbo, "QUAD:LTUS:820: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, "QUAD:LTUS:820: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,"QUAD:LTUS:820: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("QUAD:LTUS:820:TURNEDOFF",3140,1907,0,1,"QUAD:LTUS:820:TURNEDOFF") #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "QUAD:LTUS:820:STATSUB") { field(DESC, "Build STATus ") field(INAM, "mgntInit") field(SNAM, "mgntSlcStat") field(INPA, "QUAD:LTUS:820:BACT.STAT") field(INPB, "QUAD:LTUS:820:BDES.STAT") field(INPC, "QUAD:LTUS:820:IRIPL.STAT") field(INPD, "PSC:LTUS:MG18:ISETPT.STAT") field(INPE, "PSC:LTUS:MG18:IACT.STAT") # 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, "QUAD:LTUS:820:BACT.SEVR") field(INPH, "QUAD:LTUS:820:BDES.SEVR") field(INPI, "QUAD:LTUS:820:IRIPL.SEVR") field(INPJ, "PSC:LTUS:MG18:ISETPT.SEVR") field(INPK, "PSC:LTUS:MG18:IACT.SEVR") # # 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, "QUAD:LTUS:820:STATE.RVAL") field(INPN, "QUAD:LTUS:820:STDZOK") field(INPO, "QUAD:LTUS:820:CALBOK") field(INPP, "QUAD:LTUS:820:OUTOFSERVICE.RVAL") field(INPQ, "QUAD:LTUS:820:CONFIG.RVAL") field(INPR, "QUAD:LTUS:820:HSTA") field(INPS, "QUAD:LTUS:820:CTRL.RVAL") field(INPT, "QUAD:LTUS:820:DEGAUSOK") field(INPV, "QUAD:LTUS:820: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, "QUAD:LTUS:820:STAT") } record(longout, "QUAD:LTUS:820:STAT") { field(DESC, "STAT sent to SLC") field(SCAN, "Passive") field(FLNK, "QUAD:LTUS:820:STATCTRLSUB") field(DOL, "QUAD:LTUS:820:STATSUB.VAL") field(OMSL, "closed_loop") } record(sSub, "QUAD:LTUS:820:STATCTRLSUB") { field(DESC, "Decode SLC STAT into mbbo") field(INAM, "mgntInit") field(SNAM, "mgntStatDecode") field(INPA, "QUAD:LTUS:820:STAT") field(INPB, "QUAD:LTUS:820:HSTA") field(INPD, "QUAD:LTUS:820:ONOFFCTRL.RVAL") field(FLNK, "QUAD:LTUS:820:STATMSG") } record(mbbo, "QUAD:LTUS:820: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, "QUAD:LTUS:820:UNAVAILGO") field(DOL, "QUAD:LTUS:820:STATCTRLSUB.W") } record(seq, "QUAD:LTUS:820:UNAVAILGO") { field(DESC, "Process UNAVAIL") field(DOL1, "QUAD:LTUS:820:STATSUB.U") field(LNK1, "QUAD:LTUS:820:UNAVAIL PP") } record(stringout, "QUAD:LTUS:820:SNLSTATMSG") { field(DTYP, "Soft Channel") } #! TextBox(TB0,820,1000,1200,1220,0,"Dialog",12,1,16777215,"QUAD:LTUS:820:STATUSSUB - future\nOverall device status - takes input from action snls, record sevrs, master snl(s) and outputs final status\n\nInputs:\nA - QUAD:LTUS:820:CTRLSTATUS - snl status\nB - MGNT:CTRLSTATUS - master list status\nC\nD - QUAD:LTUS:820: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,"QUAD:LTUS:820STATSUB\nformat control bo's into slc STAT\n\nInputs:\nA - QUAD:LTUS:820:STATUS\nC - QUAD:LTUS:820:ON\nD - QUAD:LTUS:820:STDZOK\nE - QUAD:LTUS:820:CALBOK\nF - QUAD:LTUS:820:BACTDRIFT (future)\nG -\nH- QUAD:LTUS:820:DACSTATUS\nI -QUAD:LTUS:820:ADCSTATUS\nJ - QUAD:LTUS:820:BACTSTATUS\nK - QUAD:LTUS:820:BDESSTATUS\nL - QUAD:LTUS:820:RIPLSTATUS\n\nOutput:\nP - QUAD:LTUS:820: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, "QUAD:LTUS:820: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, "QUAD:LTUS:820: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, "QUAD:LTUS:820: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, "QUAD:LTUS:820: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.6 #! DBDSTART #! DBD("../../../../dbd/mgntSoft.dbd") #! DBDEND record(stringout, "QUAD:LTUS:820:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:820:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "QUAD:LTUS:820:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "QUAD:LTUS:820:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "QUAD:LTUS:820:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "QUAD:LTUS:820:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "1") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "QUAD:LTUS:820: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, "QUAD:LTUS:820:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "QUAD:LTUS:820:TRIMTYPE.RVAL") field(INPB, "QUAD:LTUS:820:CONFIG.RVAL") field(OUT, "QUAD:LTUS:820:TRIMMAXNUM PP") } record(longout, "QUAD:LTUS:820: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, "QUAD:LTUS:820: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, "") field(OMSL, "supervisory") field(VAL, "20") field(OUT, "QUAD:LTUS:820:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "QUAD:LTUS:820: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, "") field(OMSL, "supervisory") field(VAL, "10") } record(bo, "QUAD:LTUS:820: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, "QUAD:LTUS:820: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, "QUAD:LTUS:820: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, "QUAD:LTUS:820:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "0") } record(ao, "QUAD:LTUS:820: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, "QUAD:LTUS:820:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "QUAD:LTUS:820: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, "QUAD:LTUS:820: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, "QUAD:LTUS:820:IMOVE") field(INPB, "QUAD:LTUS:820:IACT") field(INPC, "QUAD:LTUS:820:IRAMPRATE") field(INPD, "1.577") field(INPE, "QUAD:LTUS:820:TRIMDLYPCT") field(INPF, "QUAD:LTUS:820:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "QUAD:LTUS:820:RAMPTIME_LEFT PP") } record(longout, "QUAD:LTUS:820:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "QUAD:LTUS:820:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "QUAD:LTUS:820:RAMPDONE_CALC") } record(calc, "QUAD:LTUS:820:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "QUAD:LTUS:820:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "QUAD:LTUS:820:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "QUAD:LTUS:820: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, "QUAD:LTUS:820:RAMPTIME_LEFT") field(OUT, "QUAD:LTUS:820:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "QUAD:LTUS:820:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "QUAD:LTUS:820:RAMPTIME_LEFT NMS") field(OUT, "QUAD:LTUS:820:RAMPDONE PP") } record(bo, "QUAD:LTUS:820:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "QUAD:LTUS:820:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "QUAD:LTUS:820: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, "QUAD:LTUS:820: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(sSub, "QUAD:LTUS:820: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, "QUAD:LTUS:820:PSTYPE.RVAL") field(INPC, "QUAD:LTUS:820:TURNEDOFF.RVAL") field(INPD, "QUAD:LTUS:820:CONFIG.RVAL") field(INPE, "QUAD:LTUS:820:PSCATEGORY.RVAL") field(INPF, "QUAD:LTUS:820:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "QUAD:LTUS:820:AUTOCTRL.RVAL") field(INPJ, "QUAD:LTUS:820:OUTOFSERVICE.RVAL") field(INPL, "QUAD:LTUS:820:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "QUAD:LTUS:820:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "QUAD:LTUS:820:PAU") field(INPP, "QUAD:LTUS:820:CALBDISABLE.RVAL") field(INPQ, "QUAD:LTUS:820:PTRBDISABLE.RVAL") field(INPR, "QUAD:LTUS:820:TRIMDISABLE.RVAL") field(INPS, "QUAD:LTUS:820:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "QUAD:LTUS:820:FBCK") field(INPU, "QUAD:LTUS:820:TRIMTYPE.RVAL") field(INPV, "QUAD:LTUS:820:STDZDIRECT.RVAL") field(INPW, "QUAD:LTUS:820:DEGAUSENABLE.RVAL") field(FLNK, "QUAD:LTUS:820:HSTA") } record(longin, "QUAD:LTUS:820:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "QUAD:LTUS:820:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "QUAD:LTUS:820: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, "QUAD:LTUS:820: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, "QUAD:LTUS:820:CALBDISABLE") { field(DESC, "DAC Calb Disabled") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:820:PTRBDISABLE") { field(DESC, "Perturb Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:820:TRIMDISABLE") { field(DESC, "Trim Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:820:STDZDISABLE") { field(DTYP, "Raw Soft Channel") field(ZNAM, "NO") field(ONAM, "YES") field(DESC, "Standardize Function") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } # This PV has been replaced by QUAD:LTUS:820:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses QUAD:LTUS:820:FBCK. # This PV should be replaced by QUAD:LTUS:820: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, "QUAD:LTUS:820: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, "QUAD:LTUS:820: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, "QUAD:LTUS:820: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, "") field(OMSL, "supervisory") field(FLNK, "QUAD:LTUS:820:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"QUAD:LTUS:820:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "QUAD:LTUS:820:OUTOFSERVICE NPP NMS") field(OUT, "QUAD:LTUS:820:ONLINE PP") } record(bo, "QUAD:LTUS:820:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "QUAD:LTUS:820: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, "1") } record(bo, "QUAD:LTUS:820: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, "1") } record(bo, "QUAD:LTUS:820: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, "QUAD:LTUS:820: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, "QUAD:LTUS:820: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, "QUAD:LTUS:820: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, "QUAD:LTUS:820: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, "QUAD:LTUS:820: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, "1") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:820: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, "1") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:820: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, "2") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:820: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, "0") field(ASG, "NOWRITE") field(FLNK, "QUAD:LTUS:820:TRIMTYPE") } record(stringout, "QUAD:LTUS:820:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "QUAD:LTUS:820:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "QUAD:LTUS:820:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "QUAD:LTUS:820:STATE.RVAL") field(INPB, "QUAD:LTUS:820:INTLKSUMY.RVAL") field(OUT, "QUAD:LTUS:820:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:LTUS:820: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, "QUAD:LTUS:820:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "QUAD:LTUS:820:STATE.RVAL") field(INPB, "QUAD:LTUS:820:INTLKSUMY.RVAL") field(OUT, "QUAD:LTUS:820:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:LTUS:820:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "QUAD:LTUS:820:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "QUAD:LTUS:820: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, "QUAD:LTUS:820:RAMPSTARTDLY") { field(DESC, "Tansition to ramp delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "2") } ######### For PSTYPE=2 Only ############# record(mbbo, "QUAD:LTUS:820: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, "QUAD:LTUS:820: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,"QUAD:LTUS:820: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("QUAD:LTUS:820:TURNEDOFF",3140,1907,0,1,"QUAD:LTUS:820:TURNEDOFF") #! 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, "QUAD:LTUS:840:IACT") { field(DESC, "Current") field(INP, "PSC:LTUS:MG19:IACT") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "QUAD:LTUS:840:BACT") info(autosaveFields,"HYST") } record(bi, "QUAD:LTUS:840:STATE") { field(DESC, "PS On/Off Status") field(DTYP, "Raw Soft Channel") field(INP, "PSC:LTUS:MG19:STATE NPP MS") field(ZSV, "MAJOR") field(ZNAM, "OFF") field(ONAM, "ON") } record(ao, "QUAD:LTUS:840:IDES") { field(DESC, "Desired Current") field(PREC, "3") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(MDEL, "-1") field(HIHI, "120.0") field(LOLO, "-120.0") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "QUAD:LTUS:840:BDELTAS") field(DRVH, "120.0") field(DRVL, "-120.0") field(DOL, "QUAD:LTUS:840: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, "QUAD:LTUS:840:ICTRL PP") } # This record is processed by QUAD:LTUS:840:ICON") # Note: we are not setting alarms here. record(ao, "QUAD:LTUS:840:ICON") { field(DESC, "Config I") field(DTYP, "Soft Channel") field(PREC, "3") field(HOPR, "120.0") field(LOPR, "-120.0") field(DRVH, "120.0") field(DRVL, "-120.0") field(DOL, "QUAD:LTUS:840:B2ICON.K") field(OMSL, "closed_loop") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:840:INOM") { field(DESC, "Nominal Current") field(DOL, "QUAD:LTUS:840:BNOM.K") field(OMSL, "closed_loop") field(PREC, "3") field(EGU, "A") field(DRVH, "120.0") field(DRVL, "-120.0") field(HOPR, "120.0") field(LOPR, "-120.0") } record(ao, "QUAD:LTUS:840:ICTRL") { field(DESC, "Set Current") field(PREC, "3") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(DRVH, "120.0") field(DRVL, "-120.0") field(MDEL, "-1") field(FLNK, "QUAD:LTUS:840:ICTRLGO") field(OMSL, "supervisory") info(autosavefields,"VAL") } record(seq, "QUAD:LTUS:840:ICTRLGO") { field(DESC, "Process Current Setpoint") field(PREC, "3") # Set ISETPT to supervisory field(DOL1, "0") field(LNK1, "QUAD:LTUS:840:ISETPT.OMSL") field(DOL2, "QUAD:LTUS:840:ICTRL") field(LNK2, "QUAD:LTUS:840:ISETPT PP") # Set ISETPT to closed loop - get data from BCTRLSUB.K field(DOL3, "1") field(LNK3, "QUAD:LTUS:840:ISETPT.OMSL") } record(ao, "QUAD:LTUS:840:IMAX") { field(DESC, "Max I") field(DTYP, "Soft Channel") field(DRVH, "120.0") field(DRVL, "-120.0") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(PREC, "3") field(PINI, "YES") field(VAL, "120.0") field(FLNK, "QUAD:LTUS:840:IMIN") } record(ao, "QUAD:LTUS:840:IMIN") { field(DESC, "Min I") field(DTYP, "Soft Channel") field(DRVH, "120.0") field(DRVL, "-120.0") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(PREC, "3") field(VAL, "-120.0") field(FLNK, "QUAD:LTUS:840:IRANGE") } record(sel, "QUAD:LTUS:840:IACTPREVOK") { field(DESC, "Last Good Current") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(PREC, "3") field(NVL, "QUAD:LTUS:840:BACT.SEVR") field(INPA, "QUAD:LTUS:840:IACT NPP MS") field(INPB, "QUAD:LTUS:840:IACTPREVOK NPP MS") field(INPC, "QUAD:LTUS:840:IACTPREVOK NPP MS") field(INPD, "QUAD:LTUS:840:IACTPREVOK NPP MS") } record(sub, "QUAD:LTUS:840:IACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:840:IDES") field(INPB, "QUAD:LTUS:840:ISETPT.DRVH") field(INPC, "QUAD:LTUS:840:ISETPT.DRVL") field(INPD, "QUAD:LTUS:840:IDELTAS.I") field(INPE, "QUAD:LTUS:840:IDELTAS.J") field(INPG, "QUAD:LTUS:840:STATE") field(INPH, "QUAD:LTUS:840:HSTA") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(PREC, "3") field(BRSV, "INVALID") } record(sub, "QUAD:LTUS:840:IMONLIMITS") { field(DESC, "Aux Current Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:840:IDES") field(INPB, "QUAD:LTUS:840:ISETPT.DRVH") field(INPC, "QUAD:LTUS:840:ISETPT.DRVL") field(INPD, "QUAD:LTUS:840:IDELTAS.K") field(INPE, "QUAD:LTUS:840:IDELTAS.L") field(INPG, "QUAD:LTUS:840:STATE") field(INPH, "QUAD:LTUS:840:HSTA") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(PREC, "3") field(BRSV, "INVALID") } record(seq, "QUAD:LTUS:840:ILIMITS") { field(DESC, "Set ACT and MON Limits") field(PREC, "3") field(DOL1, "QUAD:LTUS:840:BLIMITS") field(LNK1, "QUAD:LTUS:840:IACTLIMITS.F PP") field(DOL2, "QUAD:LTUS:840:IACTLIMITS.I") field(LNK2, "QUAD:LTUS:840:IACT.HIGH") field(DOL3, "QUAD:LTUS:840:IACTLIMITS.J") field(LNK3, "QUAD:LTUS:840:IACT.LOW") field(DOL4, "QUAD:LTUS:840:IACTLIMITS.K") field(LNK4, "QUAD:LTUS:840:IACT.HIHI") field(DOL5, "QUAD:LTUS:840:IACTLIMITS.L") field(LNK5, "QUAD:LTUS:840:IACT.LOLO") field(DOL6, "QUAD:LTUS:840:BLIMITS") field(LNK6, "QUAD:LTUS:840:IMONLIMITS.F PP") field(DOL7, "QUAD:LTUS:840:IMONLIMITS.I") field(LNK7, "QUAD:LTUS:840:IMON.HIGH") field(DOL8, "QUAD:LTUS:840:IMONLIMITS.J") field(LNK8, "QUAD:LTUS:840:IMON.LOW") field(DOL9, "QUAD:LTUS:840:IMONLIMITS.K") field(LNK9, "QUAD:LTUS:840:IMON.HIHI") field(DOLA, "QUAD:LTUS:840:IMONLIMITS.L") field(LNKA, "QUAD:LTUS:840: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, "QUAD:LTUS:840:IDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntRawDeltas") field(INPD, "QUAD:LTUS:840:TRIMBTOL") field(INPE, "QUAD:LTUS:840:CHCKBTOL") field(INPF, "QUAD:LTUS:840:BDELTAS.K") field(INPG, "QUAD:LTUS:840:BDELTAS.L") field(INPH, "QUAD:LTUS:840: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, "QUAD:LTUS:840:STDZITOLR") field(INPC, "QUAD:LTUS:840:STDZITOL") field(FLNK, "") } # All ps controllers with on/off control will set the macro ONOF # as follows: # # ONOF = PSC:LTUS:MG19: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, "QUAD:LTUS:840:STATESETPT") { field(DESC, "PS On/Off") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFF") field(ONAM, "ON") field(OUT, "PSC:LTUS:MG19:STATESETPT PP") 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 = PSC:LTUS:MG19:RESET PP # record(bo, "QUAD:LTUS:840:RESET") { field(DESC, "Interlock Latch Reset") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFF") field(ONAM, "ON") field(HIGH, "1.0") field(OUT, "PSC:LTUS:MG19:RESET PP") } record(bo, "QUAD:LTUS:840:RAMPSTATE") { field(DESC, "PS Ramp Status") field(DTYP, "Soft Channel") field(DOL, "PSC:LTUS:MG19:RAMPSTATE NPP 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, "QUAD:LTUS:840: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, "QUAD:LTUS:840:TRIMRAMPRATE") field(OUT, "PSC:LTUS:MG19:IRAMPRATE PP") field(FLNK, "QUAD:LTUS:840:STDZDLY") } record(ao, "QUAD:LTUS:840:ISETPT") { field(DESC, "Current Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(DRVH, "120.0") field(DRVL, "-120.0") field(MDEL, "-1") field(OUT, "PSC:LTUS:MG19:ISETPT PP") field(DOL, "QUAD:LTUS:840: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, "QUAD:LTUS:840:IMON") { field(DESC, "Aux Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(INP, "PSC:LTUS:MG19:IMON") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "QUAD:LTUS:840:BMON") } record(ao, "QUAD:LTUS:840:IRIPL") { field(DESC, "Ripple Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(DOL, "PSC:LTUS:MG19:IRIPL NPP NMS") field(OMSL, "closed_loop") field(EGU, "A") field(DRVH, "1.0") field(HOPR, "1.0") field(PREC, "3") field(FLNK, "QUAD:LTUS:840:IRIPLOK") } record(sub, "QUAD:LTUS:840:IRIPLOK") { field(DESC, "Ripple Current Status") field(INAM, "mgntInit") field(SNAM, "mgntRiplOK") field(INPA, "QUAD:LTUS:840:IRIPL.VAL") field(INPB, "QUAD:LTUS:840: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, "QUAD:LTUS:840:R") { field(DESC, "Resistance") field(EGU, "Ohms") field(PREC, "4") field(PINI, "YES") field(DOL, "PSC:LTUS:MG19:R NPP MS") 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, "QUAD:LTUS:840:IGND") { field(DESC, "Ground Current") field(EGU, "A") field(PREC, "6") field(PINI, "YES") field(DOL, "PSC:LTUS:MG19:IGND NPP MS") field(OMSL, "closed_loop") } record(bi, "QUAD:LTUS:840:INTLKSUMY") { field(DESC, "Interlock Summary") field(INP, "PSC:LTUS:MG19:INTLKSUMY NPP MS") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(ZNAM, "OK") field(ONAM, "FAULT") field(PINI, "NO") } record(mbbo, "QUAD:LTUS:840: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, "PSC:LTUS:MG19:COOLING") field(OMSL, "closed_loop") } # The following PV is processed by :BACTFO # which is processed by :BACT record(fanout, "QUAD:LTUS:840:IACTFO") { field(DESC, "IACT processing") field(SELM, "All") field(LNK1, "QUAD:LTUS:840:IACTPREVOK") field(LNK2, "QUAD:LTUS:840:IDIFF") field(LNK3, "QUAD:LTUS:840:IADIFF") field(LNK4, "QUAD:LTUS:840:IRATIO") field(LNK5, "QUAD:LTUS:840:IDIRECT") field(LNK6, "QUAD:LTUS:840:IACTPOL_CHECK") } record(calc, "QUAD:LTUS:840:IDIFF") { field(DESC, "IDES-IACT") field(CALC, "A-B") field(INPA, "QUAD:LTUS:840:IDES") field(INPB, "QUAD:LTUS:840:IACT") field(EGU, "A") field(PREC, "9") field(HOPR, "120.0") field(LOPR, "-120.0") } record(calc, "QUAD:LTUS:840:IADIFF") { field(DESC, "Absolute IDES-IACT") field(CALC, "A<0?ABS(A):A") field(INPA, "QUAD:LTUS:840:IDIFF") field(PREC, "9") } record(calc, "QUAD:LTUS:840:IRATIO") { field(DESC, "IDES-IACT/IMAX") field(CALC, "B?A/B:0") field(INPA, "QUAD:LTUS:840:IDIFF") field(INPB, "QUAD:LTUS:840:IDES.DRVH") field(PREC, "9") } record(calcout, "QUAD:LTUS:840:IRANGE") { field(DESC, "Current Range") field(PINI, "YES") field(CALC, "ABS(A-B)") field(INPA, "QUAD:LTUS:840:IMIN") field(INPB, "QUAD:LTUS:840: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, "QUAD:LTUS:840: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, "QUAD:LTUS:840:IACT") field(FLNK, "QUAD:LTUS:840:IACTPOL") } record(bo, "QUAD:LTUS:840:IACTPOL") { field(DESC, "Actual I Polarity") field(DTYP, "Raw Soft Channel") field(DOL, "QUAD:LTUS:840: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,"QUAD:LTUS:840:I*LIMITS:\n Calculate alarm and warning limits based on \n deltas from QUAD:LTUS:840:IDELTAS and the\n QUAD:LTUS:840: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,"QUAD:LTUS:840:IACT: \n Get copy of QUAD:LTUS:840:I. \n",null) #! TextBox(TB12,1280,3100,1760,3200,0,"Dialog",12,1,16777215,"QUAD:LTUS:840: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,"QUAD:LTUS:840:IDES:\n Contains raw value calculated by \nQUAD:LTUS:840: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 \nQUAD:LTUS:840:BDELTAS.\n",null) #! TextBox(TB10,56,1940,316,2340,0,"Dialog",12,1,16777215,"QUAD:LTUS:840: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 QUAD:LTUS:840: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 QUAD:LTUS:840: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,"QUAD:LTUS:840:ISETPT:\n Sets the hardware. When fast feedback is set on, this record is\n set to closed loop mode by QUAD:LTUS:840:FBCKSTART sequence. When \n the loop is closed, this record takes input calculated by \n BFBCK only. When fast feedback is set off, QUAD:LTUS:840:FBCKSTOP \n will set it back to supervisory so that the value can be set by \n QUAD:LTUS:840: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, "QUAD:LTUS:840:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:840:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "QUAD:LTUS:840:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "QUAD:LTUS:840:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "QUAD:LTUS:840:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "QUAD:LTUS:840:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "1") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "QUAD:LTUS:840: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, "QUAD:LTUS:840:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "QUAD:LTUS:840:TRIMTYPE.RVAL") field(INPB, "QUAD:LTUS:840:CONFIG.RVAL") field(OUT, "QUAD:LTUS:840:TRIMMAXNUM PP") } record(longout, "QUAD:LTUS:840: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, "QUAD:LTUS:840: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, "") field(OMSL, "supervisory") field(VAL, "10") field(OUT, "QUAD:LTUS:840:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "QUAD:LTUS:840: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, "") field(OMSL, "supervisory") field(VAL, "10") } record(bo, "QUAD:LTUS:840: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, "QUAD:LTUS:840: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, "QUAD:LTUS:840: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, "QUAD:LTUS:840:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "0") } record(ao, "QUAD:LTUS:840: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, "QUAD:LTUS:840:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "QUAD:LTUS:840: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, "QUAD:LTUS:840: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, "QUAD:LTUS:840:IMOVE") field(INPB, "QUAD:LTUS:840:IACT") field(INPC, "QUAD:LTUS:840:IRAMPRATE") field(INPD, "1.577") field(INPE, "QUAD:LTUS:840:TRIMDLYPCT") field(INPF, "QUAD:LTUS:840:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "QUAD:LTUS:840:RAMPTIME_LEFT PP") } record(longout, "QUAD:LTUS:840:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "QUAD:LTUS:840:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "QUAD:LTUS:840:RAMPDONE_CALC") } record(calc, "QUAD:LTUS:840:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "QUAD:LTUS:840:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "QUAD:LTUS:840:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "QUAD:LTUS:840: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, "QUAD:LTUS:840:RAMPTIME_LEFT") field(OUT, "QUAD:LTUS:840:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "QUAD:LTUS:840:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "QUAD:LTUS:840:RAMPTIME_LEFT NMS") field(OUT, "QUAD:LTUS:840:RAMPDONE PP") } record(bo, "QUAD:LTUS:840:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "QUAD:LTUS:840:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "QUAD:LTUS:840: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, "QUAD:LTUS:840: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, "QUAD:LTUS:840:STDZINIT") { field(DESC, "Proc. Stdz PVs on boot") field(PINI, "YES") field(DOL1, "1") field(DOL2, "1") field(DOL3, "1") field(LNK1, "QUAD:LTUS:840:DEBUG.PROC PP") field(LNK2, "QUAD:LTUS:840:STDZCYCLENUM.PROC PP") field(LNK3, "QUAD:LTUS:840:STDZDISABLE.PROC PP") field(LNK4, "QUAD:LTUS:840: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, "QUAD:LTUS:840:STDZSUB") { field(DESC, "Stdz subroutine") field(INAM, "mgntStdzInit") field(SNAM, "mgntStdz") field(BRSV, "INVALID") field(INPA, "QUAD:LTUS:840:STDZIMIN NPP NMS") field(INPB, "QUAD:LTUS:840:STDZIMAX NPP NMS") field(INPC, "QUAD:LTUS:840:STDZIFINAL NPP NMS") field(INPD, "QUAD:LTUS:840:STDZCYCLENUM NPP NMS") field(INPE, "QUAD:LTUS:840:STDZDIRECT.RVAL NPP NMS") field(INPF, "QUAD:LTUS:840:STDZDISABLE.RVAL CPP NMS") field(INPG, "QUAD:LTUS:840: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, "QUAD:LTUS:840:STDZWF PP") field(OUTB, "QUAD:LTUS:840: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, "QUAD:LTUS:840:STDZWF") } record(mbbo, "QUAD:LTUS:840: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, "QUAD:LTUS:840: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, "QUAD:LTUS:840:STDZMAINPS") { field(DESC, "Stdz by main or self") field(PINI, "YES") field(DTYP, "Soft Channel") field(ZNAM, "SELF") field(ONAM, "MAIN") } record(bo, "QUAD:LTUS:840: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, "QUAD:LTUS:840: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, "QUAD:LTUS:840: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, "QUAD:LTUS:840:STDZTOD") { field(DESC, "Successful Standardize Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "QUAD:LTUS:840:STDZLOSTTOD") { field(DESC, "Standardize Lost Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(longout, "QUAD:LTUS:840:STDZCYCLECNT") { field(DESC, "Cycle Count") field(PINI, "YES") } record(longout, "QUAD:LTUS:840:STDZCYCLENUM") { field(DESC, "No. Standardize Cycles") field(VAL, "3") field(HOPR, "10") field(LOPR, "0") field(DRVH, "10") field(DRVL, "0") field(PINI, "YES") field(FLNK, "QUAD:LTUS:840:STDZDIRECT") } # The default standardize direction is "UP" for # all LCLS Magnets.. record(bo, "QUAD:LTUS:840:STDZDIRECT") { field(DESC, "Standardize Direction ") field(ZNAM, "UP") field(ONAM, "DOWN") field(VAL, "0") field(FLNK, "QUAD:LTUS:840:STDZIMIN") } record(ao, "QUAD:LTUS:840:STDZIMIN") { field(DESC, "Min-STDZ Current") field(PREC, "1") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(VAL, "-120.0") field(FLNK, "QUAD:LTUS:840:STDZIMAX") } record(ao, "QUAD:LTUS:840:STDZIMAX") { field(DESC, "Max. Standarize Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(VAL, "120.0") field(FLNK, "QUAD:LTUS:840:STDZIFINAL") } record(ao, "QUAD:LTUS:840:STDZIFINAL") { field(DESC, "Final SDTZ Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(VAL, "-120.0") field(FLNK, "QUAD:LTUS:840: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, "QUAD:LTUS:840: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, "QUAD:LTUS:840:STDZITOL") { field(DESC, "Stdz min tolerance") field(PREC, "5") field(CALC, "MAX(ABS(A),ABS(B))*C") field(INPA, "QUAD:LTUS:840:STDZIMIN CP NMS") field(INPB, "QUAD:LTUS:840:STDZIMAX CP MMS") field(INPC, "0.05") field(INPD, "QUAD:LTUS:840:STDZITOLR CP MMS") field(EGU, "A") field(FLNK, "QUAD:LTUS:840:IDELTAS") field(PINI, "YES") } # D - factor (3.154/2 = 1.577) for EPSC, otherwise, set to 1.0 record(calc, "QUAD:LTUS:840:STDZDLY") { field(DESC, "Ramp time for stdz cycle") field(CALC, "C>0?MAX(1,ABS((A-B)/C)*D):0") field(INPA, "QUAD:LTUS:840:STDZIMIN CP NMS") field(INPB, "QUAD:LTUS:840:STDZIMAX CP NMS") field(INPC, "QUAD:LTUS:840:TRIMRAMPRATE CP NMS") field(INPD, "1.577") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") } record(calc, "QUAD:LTUS:840:STDZRAMPDLY") { field(DESC, "Ramp delay total") field(CALC, "MAX(1,((A/100)*B+B))") field(PREC, "5") field(INPA, "QUAD:LTUS:840:TRIMDLYPCT CP MS") field(INPB, "QUAD:LTUS:840: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, "QUAD:LTUS:840:STDZMINIDLY") { field(DESC, "Mini-stdz delay") field(CALC, "A") field(PREC, "5") field(A, "1.0") field(EGU, "sec") field(PINI, "YES") } record(ao, "QUAD:LTUS:840: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, "QUAD:LTUS:840:STDZMINIDELTA") { field(DESC, "Stdz mini % of IMAX") field(CALC, "(B/100)*(A-C)") field(INPA, "QUAD:LTUS:840:IDES.HOPR") field(INPB, "QUAD:LTUS:840:STDZMINIPCT CPP NMS") field(INPC, "QUAD:LTUS:840:IDES.LOPR") field(PREC, "5") } record(calc, "QUAD:LTUS:840:STDZMINISETPT") { field(DESC, "Mini Stdz delta") field(CALC, "C==0?MAX(E-D,B):MIN(E+D,A)") field(INPA, "QUAD:LTUS:840:IDES.HOPR") field(INPB, "QUAD:LTUS:840:IDES.LOPR") field(INPC, "QUAD:LTUS:840:STDZDIRECT.RVAL") field(INPD, "QUAD:LTUS:840:STDZMINIDELTA") field(INPE, "QUAD:LTUS:840:IDES") field(PREC, "5") field(FLNK, "QUAD:LTUS:840: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, "QUAD:LTUS:840:STDZMINISETPTOOR") { field(DESC, "Mini Stdz setpoint out of range") field(CALC, "C==0?(E-DA)") field(INPA, "QUAD:LTUS:840:IDES.HOPR") field(INPB, "QUAD:LTUS:840:IDES.LOPR") field(INPC, "QUAD:LTUS:840:STDZDIRECT.RVAL") field(INPD, "QUAD:LTUS:840:STDZMINIDELTA") field(INPE, "QUAD:LTUS:840: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, "QUAD:LTUS:840: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, "QUAD:LTUS:840:IADJUST.RVAL") field(INPB, "QUAD:LTUS:840:STDZDIRECT.RVAL") field(INPC, "QUAD:LTUS:840:STDZOK.RVAL") field(INPD, "QUAD:LTUS:840:STDZDISABLE.RVAL") field(INPE, "QUAD:LTUS:840:STATE.RVAL CPP NMS") field(INPF, "QUAD:LTUS:840:ICTRL.RVAL") field(INPG, "QUAD:LTUS:840:STATE.SEVR") field(INPH, "QUAD:LTUS:840:BDELTAS.M") field(INPI, "QUAD:LTUS:840:IACT.SEVR") field(OUT, "QUAD:LTUS:840:STDZLOSTGO.SELN PP NMS") field(OOPT, "Transition To Non-zero") } record(seq, "QUAD:LTUS:840:STDZLOSTGO") { field(DESC, "Process lost stdz") field(SELM, "Mask") field(DOL1, "1") field(DOL2, "0") field(LNK1, "QUAD:LTUS:840:STDZLOSTTOD.PROC") field(LNK2, "QUAD:LTUS:840:STDZOK PP") } # Record maximum current after standardize # Reset to IACT from sequence after trim # Disable processing during (mini-)standardize or trim record(calc, "QUAD:LTUS:840:STDZIACTMAX") { field(DESC, "Max act current after stdz") field(CALC, "MAX(A, B)") field(DISV, "0") field(SDIS, "QUAD:LTUS:840:CHECKPWRDIP_ENABLE") field(INPA, "QUAD:LTUS:840:IACT CP") field(INPB, "QUAD:LTUS:840:STDZIACTMAX") field(EGU, "A") field(FLNK, "QUAD:LTUS:840:CHECKPWRDIP") } # Detect power dip if STDZOK is YES, STDZ is enabled, and IACT is valid # If IACT drops below STDZIACTMAX by more than the trim tolerance, clear STDZOK # Warning: Take the absolute value of the trim tolerance, or else quads of # negative polarity will always lose STDZ since their IDELTAS.I are negative. # Note: Large quads and bends are prone to losing STDZ even if they are # perturbed toward higher current since their current tends to overshoot # by greater than the trim tolerance before settling down. record(calcout, "QUAD:LTUS:840:CHECKPWRDIP") { field(DESC, "Detect power dip") field(CALC, "(A-B>ABS(C))?3:0") field(DISV, "0") field(SDIS, "QUAD:LTUS:840:CHECKPWRDIP_ENABLE") field(INPA, "QUAD:LTUS:840:STDZIACTMAX") field(INPB, "QUAD:LTUS:840:IACT") field(INPC, "QUAD:LTUS:840:IDELTAS.I") field(OUT, "QUAD:LTUS:840:STDZLOSTGO.SELN PP NMS") field(OOPT, "When Non-zero") } # Enable processing of STDZIACTMAX and CHECKPWRDIP only if # STDZOK = YES, STDZDISABLE = NO, CTRL != Trim (2), and # CTRL != Stdz (4) record(calc, "QUAD:LTUS:840:CHECKPWRDIP_ENABLE") { field(CALC, "A&&!B&&(C#2)&&(C#4)") field(INPA, "QUAD:LTUS:840:STDZOK.RVAL CP") field(INPB, "QUAD:LTUS:840:STDZDISABLE.RVAL CP") field(INPC, "QUAD:LTUS:840:CTRL.RVAL CP") } #! 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, "QUAD:LTUS:840: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, "QUAD:LTUS:840:CALBOK") { field(DESC, "Successful Calibration") field(DTYP, "Raw Soft Channel") field(ZNAM, "NO") field(ONAM, "YES") field(DOL, "PSC:LTUS:MG19:CALBOK.RVAL") field(OMSL, "closed_loop") 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, "QUAD:LTUS:840:CALBSET") { field(DESC, "Use DAC Calbration") field(SCAN, "10 second") field(CALC, "A&&(B==0)&&C?31:960") field(INPA, "QUAD:LTUS:840:CALBOK") field(INPB, "QUAD:LTUS:840:CALBDISABLE") field(INPC, "QUAD:LTUS:840:CALBSLOPE") field(OOPT, "On Change") field(OUT, "QUAD:LTUS:840: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, "QUAD:LTUS:840:CALB_SEQ") { field(DESC, "Output Calib Values") field(SELM, "Mask") field(SELL, "QUAD:LTUS:840: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, "QUAD:LTUS:840:CALBSLOPE") field(DOL3, "QUAD:LTUS:840: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, "QUAD:LTUS:840:CALBTOD") { field(DESC, "Calibration Success Time") field(PINI, "YES") field(DOL, "PSC:LTUS:MG19:CALBTOD") field(OMSL, "closed_loop") field(DTYP, "Soft Channel") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:840: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, "QUAD:LTUS:840: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, "QUAD:LTUS:840: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, "QUAD:LTUS:840:CALBOFFSET") { field(DESC, "Calc DAC Offset") field(PREC, "6") field(EGU, "Counts") field(PINI, "YES") } record(bo, "QUAD:LTUS:840: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, "QUAD:LTUS:840:DACSLOPE") { field(DESC, "V to DAC slope") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "closed_loop") field(PINI, "YES") field(FLNK, "QUAD:LTUS:840:DACOFFSET") } # Default Offset used in conversion from Volts to DAC Counts record(ao, "QUAD:LTUS:840:DACOFFSET") { field(DESC, "V to DAC offset") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "closed_loop") field(PINI, "YES") field(FLNK, "QUAD:LTUS:840: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, "QUAD:LTUS:840: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, "QUAD:LTUS:840:IACT") field(INPD, "QUAD:LTUS:840:DACSLOPE") field(INPE, "QUAD:LTUS:840:DACOFFSET") field(EGU, "Counts") field(PREC, "6") } record(ao, "QUAD:LTUS:840:DAC") { field(DESC, "DAC Set point") field(EGU, "Counts") field(DOL, "") field(OMSL, "closed_loop") field(PREC, "6") field(PINI, "YES") } record(ao, "QUAD:LTUS:840:CALBIMIN") { field(DESC, "Calibration Min Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(DRVH, "120.0") field(HOPR, "120.0") field(DRVL, "-120.0") field(LOPR, "-120.0") field(PREC, "3") field(EGU, "A") field(VAL, "0.0") field(FLNK, "QUAD:LTUS:840:CALBIMAX") } record(ao, "QUAD:LTUS:840:CALBIMAX") { field(DESC, "Calibration Max Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(DRVH, "120.0") field(HOPR, "120.0") field(LOPR, "-120.0") field(DRVL, "-120.0") field(EGU, "A") field(VAL, "120.0") field(FLNK, "QUAD:LTUS:840:CALBSTEPNUM") } record(ao, "QUAD:LTUS:840:CALBIFINAL") { field(DESC, "Calibration Last Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(PREC, "3") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(VAL, "0") } record(longout, "QUAD:LTUS:840: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, "QUAD:LTUS:840:CALBIDELTA") } record(calc, "QUAD:LTUS:840:CALBIDELTA") { field(DESC, "Step size for CALB") field(CALC, "C=0?0:ABS((A-B)/C)") field(INPA, "QUAD:LTUS:840:CALBIMAX") field(INPB, "QUAD:LTUS:840:CALBIMIN") field(INPC, "QUAD:LTUS:840: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, "QUAD:LTUS:840:CALBIMULT") { field(DESC, "IACT vs ISETPT mult") field(CALC, "C#0||A=0?1:ABS(B/A)") field(INPA, "PSC:LTUS:MG19:ISETPT.DRVH") field(INPB, "PSC:LTUS:MG19:IACT.HOPR") field(INPC, "QUAD:LTUS:840:PSCONTROLLER.RVAL CPP") field(EGU, "A") field(PINI, "YES") } # SNL dbputs DAC values here. 6-10 steps are possible. record(waveform, "QUAD:LTUS:840:CALBICTRLWF") { field(DESC, "ICTRL setpoint array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") } record(waveform, "QUAD:LTUS:840:DACWF") { field(DESC, "DAC count array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:840:DACSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:840:DACSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "QUAD:LTUS:840: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, "QUAD:LTUS:840:CALCDACWF") { field(DESC, "Calc DAC counts array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:840:CALCDACSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:840:CALCDACSA") { field(DESC, "Calc DAC counts") field(DTYP, "Soft Channel") field(INP, "QUAD:LTUS:840: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, "QUAD:LTUS:840:CALBYWF") { field(DESC, "mx + b") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:840:CALBYSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:840:CALBYSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "QUAD:LTUS:840:CALBYWF") field(MALM, "10") field(NELM, "6") field(INDX, "0") field(FTVL, "DOUBLE") } record(waveform, "QUAD:LTUS:840:CALBIACTWF") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:840:CALBIACTSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:840:CALBIACTSA") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(MALM, "10") field(NELM, "6") field(INP, "QUAD:LTUS:840:CALBIACTWF") field(INDX, "0") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:840:CALBLIMITS") } # Check that measured current during calibration is within # tolerance. record(aSub, "QUAD:LTUS:840: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, "QUAD:LTUS:840:CALBSTEPNUM") field(INPB, "QUAD:LTUS:840:CALBIACTWF") field(INPC, "QUAD:LTUS:840: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, "QUAD:LTUS:840: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, "QUAD:LTUS:840:STDZITOL") field(INPH, "QUAD:LTUS:840:DACSLOPE") field(INPI, "QUAD:LTUS:840: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, "QUAD:LTUS:840: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, "QUAD:LTUS:840:CALBSTEPNUM") field(INPB, "QUAD:LTUS:840:CALBIACTWF") field(INPC, "QUAD:LTUS:840:DACWF") field(INPF, "QUAD:LTUS:840: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 QUAD:LTUS:840CALBOK 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, "QUAD:LTUS:840:DEGAUSINIT") { field(DESC, "Proc. Degauss PVs on boot") field(PINI, "YES") field(DOL, "1") field(OUTA, "QUAD:LTUS:840:DEGAUSIMIN.PROC PP") field(OUTB, "QUAD:LTUS:840:DEGAUSIMAX.PROC PP") field(OUTC, "QUAD:LTUS:840:DEGAUSTYPE.PROC PP") field(OUTD, "QUAD:LTUS:840:DEGAUSSTEP.PROC PP") field(OUTE, "QUAD:LTUS:840:MADNAME.PROC PP") field(OUTF, "QUAD:LTUS:840:PSTYPE.PROC PP") field(OUTG, "QUAD:LTUS:840: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, "QUAD:LTUS:840:DEGAUSSUB") { field(DESC, "Degauss subroutine") field(INAM, "mgntDegaussInit") field(SNAM, "mgntDegauss") field(BRSV, "INVALID") field(INPA, "QUAD:LTUS:840:DEGAUSIMIN NPP NMS") field(INPB, "QUAD:LTUS:840:DEGAUSIMAX NPP NMS") field(INPC, "QUAD:LTUS:840:DEGAUSTYPE.RVAL NPP NMS") field(INPE, "QUAD:LTUS:840:DEGAUSMETHOD.RVAL NPP NMS") field(INPF, "QUAD:LTUS:840:PSTYPE NPP NMS") field(INPG, "QUAD:LTUS:840:DEBUG.RVAL NPP NMS") field(INPH, "QUAD:LTUS:840: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, "QUAD:LTUS:840:DEGAUSWF PP") field(OUTB, "QUAD:LTUS:840:DEGAUSMSG PP") field(OUTC, "QUAD:LTUS:840: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, "QUAD:LTUS:840:DEGAUSWF") { field(DESC, "Degauss Setpts") field(NELM, "60") field(FTVL, "DOUBLE") } record(mbbo,"QUAD:LTUS:840: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, "QUAD:LTUS:840: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, "QUAD:LTUS:840: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, "QUAD:LTUS:840: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, "QUAD:LTUS:840: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, "QUAD:LTUS:840:DEGAUSIMIN") { field(DESC, "Min. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "120.0") field(LOPR, "-120.0") field(DRVH, "120.0") field(DRVL, "-120.0") field(VAL, "-120.0") } record(ao, "QUAD:LTUS:840:DEGAUSIMAX") { field(DESC, "Max. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "120.0") field(LOPR, "-120.0") field(DRVH, "120.0") field(DRVL, "-120.0") field(VAL, "120.0") } # 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,"QUAD:LTUS:840: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, "QUAD:LTUS:840: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,"QUAD:LTUS:840: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, "QUAD:LTUS:840: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, "QUAD:LTUS:840: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, "QUAD:LTUS:840: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, "QUAD:LTUS:840:DEGAUSTOD") { field(DESC, "Successful Degauss Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "QUAD:LTUS:840:DEGAUSLOSTTOD") { field(DESC, "Degauss Lost Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:840:DEGAUSTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "QUAD:LTUS:840:DEGAUSTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "QUAD:LTUS:840: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, "QUAD:LTUS:840:DEGAUSGO") { field(DESC, "Set bdes of btrms to zero") field(ASG, "Internal") field(OUTA, "") field(OUTB, "") field(OUTC, "") field(OUTD, "") } # =========== CRYO ONLY =========== record(bo, "QUAD:LTUS:840: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, "QUAD:LTUS:840:DEGAUS_IMAX_CHECK") { field(DESC, "Check if imax shoud chg") field(CALC, "(C==4)&&(ABS(B)>ABS(A))?1:0") field(INPA, "QUAD:LTUS:840:DEGAUS_IMAX") field(INPB, "QUAD:LTUS:840:ISETPT") field(INPC, "QUAD:LTUS:840:DEGAUSTYPE.RVAL") field(OUT, "QUAD:LTUS:840:DEGAUS_IMAX_UPDATE.SELN") field(FLNK, "QUAD:LTUS:840:DEGAUS_IMAX_UPDATE") } record(seq, "QUAD:LTUS:840:DEGAUS_IMAX_UPDATE") { field(DESC, "Degauss IMAX Update") field(SELM, "Specified") field(DOL1, "QUAD:LTUS:840:ISETPT") field(LNK1, "QUAD:LTUS:840:DEGAUS_IMAX PP") } # Set the maximum current after a successful # degauss. This pv is updated by the # sequence. record(ao, "QUAD:LTUS:840:DEGAUS_IMAX") { field(DESC, "Max I set afer a degauss") field(EGU, "Amps") field(PINI, "YES") field(PREC, "6") field(HOPR, "120.0") field(LOPR, "-120.0") field(DRVH, "120.0") field(DRVL, "-120.0") field(VAL, "120.0") field(FLNK, "QUAD:LTUS:840:DEGAUS_IMAXPOL_CHECK") info(autosaveFields,"VAL,RVAL") } # Set the polarity if degauss_imax record(calcout, "QUAD:LTUS:840:DEGAUS_IMAXPOL_CHECK") { field(DESC, "Determine polarity of imax") field(CALC, "A>=0?0:1") field(INPA, "QUAD:LTUS:840:DEGAUS_IMAX") field(FLNK, "QUAD:LTUS:840:DEGAUS_IMAXPOL") } record(bo, "QUAD:LTUS:840:DEGAUS_IMAXPOL") { field(DESC, "Polarity of imax I") field(DTYP, "Raw Soft Channel") field(DOL, "QUAD:LTUS:840:DEGAUS_IMAXPOL_CHECK") field(OMSL, "closed_loop") field(ZNAM, "Positive") field(ONAM, "Negative") field(FLNK, "QUAD:LTUS:840: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, "QUAD:LTUS:840:DEGAUS_ABSIMAX") { field(DESC, "Absolute Max. Degauss I") field(CALC, "ABS(A)") field(INPA, "QUAD:LTUS:840:DEGAUS_IMAX") field(PREC, "6") field(EGU, "Amps") field(HOPR, "120.0") field(LOPR, "-120.0") info(autosaveFields,"VAL RVAL") } # IACT Polarity record(calcout, "QUAD:LTUS:840:IACTPOL_CHECK") { field(DESC, "Determine IACT polarity") field(SCAN, "5 second") field(CALC, "ABS(A-B)>C?(A>=0?0:1):D") field(INPA, "QUAD:LTUS:840:IACT") field(INPB, "QUAD:LTUS:840:IACTPOL_CHECK.LA") field(INPC, "0.0001") field(INPD, "QUAD:LTUS:840:IACTPOL_CHECK.PVAL") field(OOPT, "On Change") field(FLNK, "QUAD:LTUS:840:IACTPOL") } record(bo, "QUAD:LTUS:840: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,"QUAD:LTUS:840: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, "QUAD:LTUS:840:DEGAUSENABLE CP") field(INPB, "QUAD:LTUS:840:DEGAUSOK") field(INPC, "QUAD:LTUS:840:STATE CP") field(INPD, "QUAD:LTUS:840:STATE.SEVR") field(OUT, "QUAD:LTUS:840:DEGAUS_STATE_SEQ.SELN PP") field(ASG, "Internal") } record(seq, "QUAD:LTUS:840:DEGAUS_STATE_SEQ") { field(DESC, "Degauss State Sequence") field(SELM, "Specified") field(SELL, "QUAD:LTUS:840:DEGAUS_STATE_CHECK") field(LNK1, "QUAD:LTUS:840:DEGAUS_STATE_DISABLE.PROC PP") field(LNK2, "QUAD:LTUS:840:DEGAUS_STATE_LOST.PROC PP") field(LNK3, "QUAD:LTUS:840:DEGAUS_STATE_GOOD.PROC PP") field(LNK4, "QUAD:LTUS:840: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, "QUAD:LTUS:840:DEGAUS_STATE_DISABLE") { field(DESC, "Degauss not used") field(LNK1, "QUAD:LTUS:840:DEGAUSOK.ZSV") field(LNK2, "QUAD:LTUS:840: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, "QUAD:LTUS:840:STATMSG.FRSV") field(LNK4, "QUAD:LTUS:840: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, "QUAD:LTUS:840:DEGAUS_STATE_LOST") { field(DESC, "Degauss lost and ps On") field(DOL1, "1") field(LNK1, "QUAD:LTUS:840:DEGAUSOK.ZSV") field(LNK2, "QUAD:LTUS:840: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, "QUAD:LTUS:840:STATMSG.FRSV") field(LNK4, "QUAD:LTUS:840: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, "QUAD:LTUS:840:DEGAUS_STATE_OFF") { field(DESC, "Degaused lost and ps Off") field(DOL1, "2") field(LNK1, "QUAD:LTUS:840: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, "QUAD:LTUS:840:STATMSG.FRSV") field(LNK3, "QUAD:LTUS:840: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, "QUAD:LTUS:840:DEGAUS_STATE_GOOD") { field(DESC, "Degauss good") field(DOL1, "1") field(LNK1, "QUAD:LTUS:840: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, "QUAD:LTUS:840:STATMSG.FRSV PP") field(LNK3, "QUAD:LTUS:840:STATMSG.FVSV PP") field(LNK4, "") field(ASG, "Internal") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(mbbo, "QUAD:LTUS:840:FUNC") { field(DESC, "QUAD:LTUS:840 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, "1") field(THVL, "9") field(FRVL, "10") field(FVVL, "0") field(SXVL, "2") field(SVVL, "8") field(EIVL, "11") field(NIVL, "12") field(TEVL, "13") field(ELVL, "5") field(TVVL, "6") field(TTVL, "7") field(FTVL, "4") field(FFVL, "3") field(OUT, "QUAD:LTUS:840:CTRL CA") } # :CTRL pv is processed at boot in the # sequence mgntCtrl.st Processed in sequence # record(mbbo, "QUAD:LTUS:840:CTRL") { field(DESC, "QUAD:LTUS:840 Control") field(PINI, "NO") field(ZRST, "Ready") field(ONST, "TRIM") field(TWST, "PERTURB") field(THST, "BCON_TO_BDES") field(FRST, "BACT_TO_BDES") field(FVST, "SAVE_BDES") field(SXST, "LOAD_BDES") field(SVST, "UNDO_BDES") field(EIST, "DAC_ZERO") field(NIST, "CALB") field(TEST, "STDZ") field(ELST, "RESET") field(TVST, "TURN_ON") field(TTST, "TURN_OFF") field(FTST, "") field(FFST, "") field(ZRVL, "0") field(ONVL, "2") field(TWVL, "6") field(THVL, "15") field(FRVL, "14") field(FVVL, "11") field(SXVL, "12") field(SVVL, "13") field(EIVL, "7") field(NIVL, "3") field(TEVL, "4") field(ELVL, "8") field(TVVL, "9") field(TTVL, "10") field(FTVL, "0") field(FFVL, "0") field(OUT, "QUAD:LTUS:840:SELECTEN.A PP") field(SDIS, "0") } # If a function has been selected set this unit to busy record(calcout, "QUAD:LTUS:840:SELECTEN") { field(DESC, "Control Select Enable") field(CALC, "A>0?1:A") field(FLNK, "QUAD:LTUS:840:BUSY") } # Set to FREE on IOC reboot record(bo, "QUAD:LTUS:840:BUSY") { field(DESC, "QUAD:LTUS:840 Ctrl Done") field(DOL, "QUAD:LTUS:840:SELECTEN") field(ZNAM, "FREE") field(ONAM, "BUSY") field(PINI, "YES") field(FLNK, "QUAD:LTUS:840:SELECT") } record(bo, "QUAD:LTUS:840:SELECT") { field(ZNAM, "NO") field(ONAM, "YES") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") } record(bo, "QUAD:LTUS:840: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, "QUAD:LTUS:840:CTRLSTATE") { field(DESC, "QUAD:LTUS:840 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("QUAD:LTUS:840:CTRL",20,20,0,0,"QUAD:LTUS:840:CTRL") #! Field("QUAD:LTUS:840:CTRL.OUT",16777215,1,"QUAD:LTUS:840:CTRL.OUT") #! Link("QUAD:LTUS:840:CTRL.OUT","QUAD:LTUS:840:SELECTEN.A") #! Field("QUAD:LTUS:840:CTRL.VAL",16777215,1,"QUAD:LTUS:840:CTRL.VAL") #! Record("QUAD:LTUS:840:SELECTEN",321,381,0,0,"QUAD:LTUS:840:SELECTEN") #! Field("QUAD:LTUS:840:SELECTEN.A",16777215,0,"QUAD:LTUS:840:SELECTEN.A") #! Field("QUAD:LTUS:840:SELECTEN.FLNK",16777215,1,"QUAD:LTUS:840:SELECTEN.FLNK") #! Link("QUAD:LTUS:840:SELECTEN.FLNK","QUAD:LTUS:840:BUSY") #! Field("QUAD:LTUS:840:SELECTEN.VAL",16777215,1,"QUAD:LTUS:840:SELECTEN.VAL") #! Record("QUAD:LTUS:840:BUSY",623,274,0,0,"QUAD:LTUS:840:BUSY") #! Field("QUAD:LTUS:840:BUSY.DOL",16777215,0,"QUAD:LTUS:840:BUSY.DOL") #! Link("QUAD:LTUS:840:BUSY.DOL","QUAD:LTUS:840:SELECTEN.VAL") #! Field("QUAD:LTUS:840:BUSY.FLNK",16777215,1,"QUAD:LTUS:840:BUSY.FLNK") #! Link("QUAD:LTUS:840:BUSY.FLNK","QUAD:LTUS:840:SELECT") #! Record("QUAD:LTUS:840:SELECT",669,508,0,1,"QUAD:LTUS:840:SELECT") #! Record("QUAD:LTUS:840:FUNC",940,120,0,0,"QUAD:LTUS:840:FUNC") #! Field("QUAD:LTUS:840:FUNC.OUT",16777215,0,"QUAD:LTUS:840:FUNC.OUT") #! Link("QUAD:LTUS:840:FUNC.OUT","QUAD:LTUS:840:CTRL.VAL") #! Record("QUAD:LTUS:840:ABORT",193,41,0,0,"QUAD:LTUS:840:ABORT") #! Record("QUAD:LTUS:840:CTRLSTATE",369,34,0,0,"QUAD:LTUS:840: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,"QUAD:LTUS:840:SELECT is used for Multi-device selection.\nIt is enabled when associated QUAD:LTUS:840:CTRL is \"0\" (DONE).\nIt is disabled when associated QUAD:LTUS:840: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,"QUAD:LTUS:840: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, "QUAD:LTUS:840:BCTRL_INIT") { field(DESC, "Process BCTRL on boot") field(PINI, "YES") field(CALC, "A=3?1:0") field(INPA, "QUAD:LTUS:840:BCTRL.SEVR") field(OUT, "QUAD:LTUS:840: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, "QUAD:LTUS:840:BACT") { field(DESC, "Actual B") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "QUAD:LTUS:840:BACT") field(INPB, "QUAD:LTUS:840:POLYCOEF") field(INPC, "QUAD:LTUS:840:POLYCOEF.A") field(INPD, "QUAD:LTUS:840:POLYCOEF.B") field(INPE, "QUAD:LTUS:840:IACT MS") field(INPF, "QUAD:LTUS:840:BDELTAS PP") field(INPG, "100") field(EGU, "kG") field(HOPR, "67.5062") field(LOPR, "-67.7201") field(HIHI, "67.5062") field(LOLO, "-67.7201") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "67.5062") field(LOW, "-67.7201") field(FLNK, "QUAD:LTUS:840: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, "QUAD:LTUS:840:BDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntPhyDeltas") field(EGU, "kG") field(HOPR, "1") field(PREC, "7") field(BRSV, "INVALID") field(INPA, "QUAD:LTUS:840:BDES") field(INPB, "QUAD:LTUS:840:TRIMBTOL") field(INPC, "QUAD:LTUS:840:TRIMBTOLR") field(INPD, "QUAD:LTUS:840:CHCKBTOL") field(INPE, "QUAD:LTUS:840:CHCKBTOLR") field(F, "2.0") field(INPG, "30") field(INPH, "QUAD:LTUS:840:BACT.VAL") # # MPS absolute and relative tolerances field(INPP, "QUAD:LTUS:840:MPSBTOL") field(INPQ, "QUAD:LTUS:840:MPSBTOLR") field(FLNK, "QUAD:LTUS:840:BCONLIMITS") info(autosaveFields,"F") } # This record is processed by BDELTAS record(aSub, "QUAD:LTUS:840:BCONLIMITS") { field(DESC, "Config B-field Limits") field(INAM, "mgntInit") field(SNAM, "mgntBCONLimits") field(INPA, "QUAD:LTUS:840:BDES") field(INPB, "QUAD:LTUS:840:BDELTAS.I") field(INPG, "QUAD:LTUS:840:DEBUG.RVAL") field(FTA, "DOUBLE") field(FTB, "DOUBLE") field(FTG, "ULONG") field(OUTA, "QUAD:LTUS:840:BCON.HIGH") field(OUTB, "QUAD:LTUS:840:BCON.LOW") field(OUTC, "QUAD:LTUS:840:BCON.HIHI") field(OUTD, "QUAD:LTUS:840:BCON.LOLO PP") field(FTVA, "DOUBLE") field(FTVB, "DOUBLE") field(FTVC, "DOUBLE") field(FTVD, "DOUBLE") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:840:IDELTAS") } # The following PV is processed by :BACT # which is processed by :BACT # record(fanout, "QUAD:LTUS:840:BACTFO") { field(DESC, "BACT processing") field(SELM, "All") field(LNK1, "QUAD:LTUS:840:BDIFF") field(LNK2, "QUAD:LTUS:840:BADIFF") field(LNK3, "QUAD:LTUS:840:BRATIO") field(LNK4, "QUAD:LTUS:840:MPSLIMITS") field(LNK5, "QUAD:LTUS:840:I2BSTATUS") field(LNK6, "QUAD:LTUS:840:IACTFO.PROC") } record(calc, "QUAD:LTUS:840:BDIFF") { field(DESC, "BDES-BACT") field(CALC, "A-B") field(INPA, "QUAD:LTUS:840:BDES") field(INPB, "QUAD:LTUS:840:BACT") field(EGU, "kG") field(PREC, "7") } record(calc, "QUAD:LTUS:840:BADIFF") { field(DESC, "Absolute BDES-BACT") field(INPA, "QUAD:LTUS:840:BDIFF") field(EGU, "kG") field(PREC, "7") field(CALC, "A<0?ABS(A):A") } record(calc, "QUAD:LTUS:840:BRATIO") { field(DESC, "BACT Error") field(CALC, "B?A/B:0") field(INPA, "QUAD:LTUS:840:BDIFF") field(INPB, "QUAD:LTUS:840:BDES.HOPR") field(EGU, "kG") field(PREC, "7") } record(mbbi, "QUAD:LTUS:840: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, "QUAD:LTUS:840:BACT.J") } # Note: for a string slave set the MONFL # macro to the following: # MONFL=:IMONCALC MS record(sub, "QUAD:LTUS:840:BMON") { field(DESC, "Second Transductor") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "QUAD:LTUS:840:BMON") field(INPB, "QUAD:LTUS:840:POLYCOEF") field(INPC, "QUAD:LTUS:840:POLYCOEF.A") field(INPD, "QUAD:LTUS:840:POLYCOEF.B") field(INPE, "QUAD:LTUS:840:IMON MS") field(INPF, "QUAD:LTUS:840:BDELTAS.VAL") field(INPG, "100") field(EGU, "kG") field(HOPR, "67.5062") field(LOPR, "-67.7201") field(HIHI, "67.5062") field(LOLO, "-67.7201") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "67.5062") field(LOW, "-67.7201") } # 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=PSC:LTUS:MG19:BDES CP record(ao, "QUAD:LTUS:840:BDES") { field(DESC, "Desired B-Field") field(PINI, "YES") field(DRVH, "67.5062") field(DRVL, "-67.7201") field(HOPR, "67.5062") field(LOPR, "-67.7201") field(PREC, "7") field(EGU, "kG") field(MDEL, "-1") field(OMSL, "supervisory") # field(DOL, "") field(OUT, "QUAD:LTUS:840:B2IDES PP") info(autosaveFields,"VAL") } record(sub, "QUAD:LTUS:840:B2IDES") { field(DESC, "Convert Desired B-Field to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:840:POLYCOEF") field(INPC, "QUAD:LTUS:840:POLYCOEF.A") field(INPD, "QUAD:LTUS:840:POLYCOEF.B") field(PREC, "7") field(EGU, "kG") field(HOPR, "67.5062") field(LOPR, "-67.7201") field(MDEL, "-1") field(INPE, "QUAD:LTUS:840:BDES.DRVH") field(INPF, "QUAD:LTUS:840:BDES.DRVL") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:840:IDES") } record(sub, "QUAD:LTUS:840:BNOM") { field(DESC, "Nominal Field") field(PINI, "YES") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:840:POLYCOEF") field(INPC, "QUAD:LTUS:840:POLYCOEF.A") field(INPD, "QUAD:LTUS:840:POLYCOEF.B") field(INPE, "QUAD:LTUS:840:BDES.DRVH") field(INPF, "QUAD:LTUS:840:BDES.DRVL") field(EGU, "kG") field(HOPR, "67.5062") field(LOPR, "-67.7201") field(PREC, "7") field(VAL, "0.0") field(FLNK, "QUAD:LTUS:840:INOM") } record(sub, "QUAD:LTUS:840:BACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:840:BDES.VAL") field(INPB, "QUAD:LTUS:840:BDES.DRVH") field(INPC, "QUAD:LTUS:840:BDES.DRVL") field(INPD, "QUAD:LTUS:840:BDELTAS.I") field(INPE, "QUAD:LTUS:840:BDELTAS.J") field(INPG, "QUAD:LTUS:840:STATE") field(INPH, "QUAD:LTUS:840:HSTA") field(EGU, "kG") field(HOPR, "67.5062") field(LOPR, "-67.7201") field(PREC, "7") field(BRSV, "INVALID") } record(sub, "QUAD:LTUS:840:BMONLIMITS") { field(DESC, "MON Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:840:BDES.VAL") field(INPB, "QUAD:LTUS:840:BDES.DRVH") field(INPC, "QUAD:LTUS:840:BDES.DRVL") field(INPD, "QUAD:LTUS:840:BDELTAS.K") field(INPE, "QUAD:LTUS:840:BDELTAS.L") field(INPG, "QUAD:LTUS:840:STATE") field(INPH, "QUAD:LTUS:840:HSTA") field(EGU, "kG") field(HOPR, "67.5062") field(LOPR, "-67.7201") field(PREC, "7") field(BRSV, "INVALID") } record(seq, "QUAD:LTUS:840:BLIMITS") { field(DESC, "ACT Limits") field(PREC, "7") field(DOL1, "QUAD:LTUS:840:BLIMITS") field(LNK1, "QUAD:LTUS:840:BACTLIMITS.F PP") field(DOL2, "QUAD:LTUS:840:BACTLIMITS.I") field(LNK2, "QUAD:LTUS:840:BACT.HIGH") field(DOL3, "QUAD:LTUS:840:BACTLIMITS.J") field(LNK3, "QUAD:LTUS:840:BACT.LOW") field(DOL4, "QUAD:LTUS:840:BACTLIMITS.K") field(LNK4, "QUAD:LTUS:840:BACT.HIHI") field(DOL5, "QUAD:LTUS:840:BACTLIMITS.L") field(LNK5, "QUAD:LTUS:840:BACT.LOLO") field(DOL6, "QUAD:LTUS:840:BLIMITS") field(LNK6, "QUAD:LTUS:840:BMONLIMITS.F PP") field(DOL7, "QUAD:LTUS:840:BMONLIMITS.I") field(LNK7, "QUAD:LTUS:840:BMON.HIGH") field(DOL8, "QUAD:LTUS:840:BMONLIMITS.J") field(LNK8, "QUAD:LTUS:840:BMON.LOW") field(DOL9, "QUAD:LTUS:840:BMONLIMITS.K") field(LNK9, "QUAD:LTUS:840:BMON.HIHI") field(DOLA, "QUAD:LTUS:840:BMONLIMITS.L") field(LNKA, "QUAD:LTUS:840:BMON.LOLO") field(FLNK, "QUAD:LTUS:840:ILIMITS") field(SCAN, "5 second") } record(ao, "QUAD:LTUS:840:BCTRL") { field(DESC, "B-Perturb") field(PREC, "7") field(EGU, "kG") field(DRVH, "67.5062") field(DRVL, "-67.7201") field(HOPR, "67.5062") field(LOPR, "-67.7201") # 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, "QUAD:LTUS:840: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, "QUAD:LTUS:840:BCTRLGO") { field(DESC, "Update DES and perturb") field(PREC, "7") # Disable BACT limits field(DOL1, "1") field(LNK1, "QUAD:LTUS:840:BLIMITS.VAL") # Update BDES with the BCTRL (slider) value field(DOL2, "QUAD:LTUS:840:BCTRL.VAL") field(LNK2, "QUAD:LTUS:840:BDES PP") field(DOL3, "1") field(LNK3, "QUAD:LTUS:840:IDIRECT.PROC PP") field(DOL4, "1") field(LNK4, "QUAD:LTUS:840:CHECKSTDZLOST.PROC PP") field(DOL5, "QUAD:LTUS:840:BCTRL.VAL") field(LNK5, "QUAD:LTUS:840:BCTRLSUB PP") # Re-enable BACT limits field(DOL6, "0") field(LNK6, "QUAD:LTUS:840:BLIMITS.VAL") } # Convert B-field to Current and output to ISETPT record(sub, "QUAD:LTUS:840:BCTRLSUB") { field(DESC, "Feedback") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:840:POLYCOEF") field(INPC, "QUAD:LTUS:840:POLYCOEF.A") field(INPD, "QUAD:LTUS:840:POLYCOEF.B") field(INPE, "QUAD:LTUS:840:BDES.DRVH") field(INPF, "QUAD:LTUS:840:BDES.DRVL") field(PREC, "7") field(EGU, "kG") field(HOPR, "67.5062") field(LOPR, "-67.7201") field(MDEL, "-1") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:840:ISETPT") } record(ao, "QUAD:LTUS:840:BDESPREVTRIM") { field(DESC, "trim bdes for undo") field(DTYP, "Soft Channel") field(DRVH, "67.5062") field(DRVL, "-67.7201") field(EGU, "kG") field(HOPR, "67.5062") field(LOPR, "-67.7201") field(PREC, "7") field(PINI, "YES") info(autosaveFields,"VAL") } record(stringin, "QUAD:LTUS:840:MADNAME") { field(DESC, "MAD deck nomenclature") field(PINI, "YES") field(VAL, "QUM2B") } record(ai, "QUAD:LTUS:840: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, "3542.847076") } record(ao, "QUAD:LTUS:840:BMAX") { field(DESC, "Max B-Field") field(DTYP, "Soft Channel") field(DRVH, "67.5062") field(DRVL, "-67.7201") field(EGU, "kG") field(HOPR, "67.5062") field(LOPR, "-67.7201") field(PREC, "7") field(PINI, "YES") field(VAL, "67.5062") field(FLNK, "QUAD:LTUS:840:BSTEP") } record(ao, "QUAD:LTUS:840:BMIN") { field(DESC, "Min B-Field") field(DTYP, "Soft Channel") field(DRVH, "67.5062") field(DRVL, "-67.7201") field(EGU, "kG") field(HOPR, "67.5062") field(LOPR, "-67.7201") field(PREC, "7") field(PINI, "YES") field(VAL, "-67.7201") field(FLNK, "QUAD:LTUS:840:BSTEP") } record(ao, "QUAD:LTUS:840:BDESSAVE") { field(DESC, "bdes for save/load") field(DTYP, "Soft Channel") field(DRVH, "67.5062") field(DRVL, "-67.7201") field(EGU, "kG") field(HOPR, "67.5062") field(LOPR, "-67.7201") field(PINI, "YES") field(PREC, "7") } # This record is processed by QUAD:LTUS:840: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, "QUAD:LTUS:840:BCON") { field(DESC, "Config B-Field ") field(DTYP, "Soft Channel") field(PREC, "7") field(EGU, "kG") field(HOPR, "67.5062") field(LOPR, "-67.7201") field(DRVH, "67.5062") field(DRVL, "-67.7201") # Set MINOR Alarm as the default, slaves will set NO_ALARM=0. field(HHSV, "MINOR") field(LLSV, "MINOR") field(HSV, "MINOR") field(LSV, "MINOR") # field(DOL , "") field(OMSL, "supervisory") field(OUT, "QUAD:LTUS:840:B2ICON PP") info(autosaveFields,"VAL") } record(sub, "QUAD:LTUS:840:B2ICON") { field(DESC, "Convert Desired ICon to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:840:POLYCOEF") field(INPC, "QUAD:LTUS:840:POLYCOEF.A") field(INPD, "QUAD:LTUS:840:POLYCOEF.B") field(PREC, "7") field(EGU, "kG") field(HOPR, "67.5062") field(LOPR, "-67.7201") field(MDEL, "-1") field(INPE, "QUAD:LTUS:840:BCON.DRVH") field(INPF, "QUAD:LTUS:840:BCON.DRVL") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:840: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, "QUAD:LTUS:840:BSTEP") { field(DESC, "B-Field step size") field(CALC, "(C==3)||(D==3)?0:ABS(A-B)*0.005") field(INPA, "QUAD:LTUS:840:BMAX") field(INPB, "QUAD:LTUS:840:BMIN") field(INPC, "QUAD:LTUS:840:BMIN.SEVR") field(INPD, "QUAD:LTUS:840:BMAX.SEVR") field(EGU, "kG") 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,"QUAD:LTUS:840:BCTRLDISABLECALC") { field(DESC, "Calc for disabling BCTRL") field(ASG, "Internal") field(CALC, "A?2:1") field(INPA, "QUAD:LTUS:840:ONLINE CP") field(OUT, "QUAD:LTUS:840:BCTRLDISABLEFOUT PP") } record(fanout, "QUAD:LTUS:840:BCTRLDISABLEFOUT") { field(DESC, "Disable BCTRL fanout") field(SELM, "Specified") field(SELL, "QUAD:LTUS:840:BCTRLDISABLECALC") field(LNK1, "QUAD:LTUS:840:BCTRLDISABLE") field(LNK2, "QUAD:LTUS:840:BCTRLENABLE") } record(stringout, "QUAD:LTUS:840:BCTRLDISABLE") { field(DESC, "Disable BCTRL") field(DTYP, "Soft Channel") field(OUT, "QUAD:LTUS:840:BCTRL.ASG") field(VAL, "NOWRITE") field(FLNK, "QUAD:LTUS:840:BCTRLDISV_UPDATE") } record(stringout, "QUAD:LTUS:840:BCTRLENABLE") { field(DESC, "Enable BCTRL") field(DTYP, "Soft Channel") field(OUT, "QUAD:LTUS:840:BCTRL.ASG") field(VAL, "") field(FLNK, "QUAD:LTUS:840:BCTRLDISV_UPDATE") } record(calcout, "QUAD:LTUS:840:BCTRLDISV_UPDATE") { field(DESC, "Calc for updating BCTRL.DISV") field(ASG, "Internal") field(CALC, "A") field(INPA, "QUAD:LTUS:840:ONLINE") field(OUT, "QUAD:LTUS:840: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,"QUAD:LTUS:840:BACT and MON\n are processed via links from \n QUAD:LTUS:840:IACT (device raw value readback 1)\n and\n QUAD:LTUS:840: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 QUAD:LTUS:840:POLYCOEF\nC = First polynomial coefficient (offset if linear)\nD = Second polynomial coefficient (slope if linear)\nE = QUAD:LTUS:840: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,"QUAD:LTUS:840:BDES\n is processed when set by CA users or \n QUAD:LTUS:840: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,"QUAD:LTUS:840: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 QUAD:LTUS:840: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 (QUAD:LTUS:840: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,"QUAD:LTUS:840:B*LIMITS and QUAD:LTUS:840:BLIMITS:\n Calculate alarm and warning limits based on \n deltas from QUAD:LTUS:840: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,"QUAD:LTUS:840: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,"QUAD:LTUS:840: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, "QUAD:LTUS:840: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, "QUAD:LTUS:840:MPSBTOL") { field(DESC, "Absolute mps tol") field(EGU, "kG") field(PREC, "2") field(CALC, "ABS(A)*0.02") field(INPA, "QUAD:LTUS:840:BMAX") field(PINI, "YES") } # # 21-Aug-2013: K. Luchini # Set channel access security so that users # cannot easily change values. record(ao, "QUAD:LTUS:840:MPSBMAX") { field(DESC, "MPS Max B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "67.5062") field(DRVL, "-67.7201") field(PINI, "YES") field(VAL, "67.5062") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:840:MPSBMIN") { field(DESC, "MPS Min B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "67.5062") field(DRVL, "-67.7201") field(PINI, "YES") field(VAL, "-67.7201") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:840:MPSBLLIM") { field(DESC, "MPS Low Limit B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "67.5062") field(DRVL, "-67.7201") field(PINI, "YES") field(VAL, "-67.7201") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:840:MPSBLLIM2") { field(DESC, "MPS Low Limit #2 B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "67.5062") field(DRVL, "-67.7201") field(PINI, "YES") field(VAL, "-67.7201") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } # Set the default to Std record(mbbo, "QUAD:LTUS:840: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, "QUAD:LTUS:840:MPSLIMITS.E PP") } record(aSub, "QUAD:LTUS:840: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, "QUAD:LTUS:840:MPS.RVAL") field(INPB, "QUAD:LTUS:840:BADIFF") field(INPC, "QUAD:LTUS:840:BDELTAS.N") field(INPD, "QUAD:LTUS:840:BACT") field(INPE, "QUAD:LTUS:840:MPSBITMASK.RVAL") field(INPF, "QUAD:LTUS:840:MPSBLLIM") field(INPG, "QUAD:LTUS:840:MPSBMIN") field(INPH, "QUAD:LTUS:840:MPSBMAX") field(INPI, "QUAD:LTUS:840: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, "QUAD:LTUS:840:INTOL.RVAL PP") field(OUTB, "QUAD:LTUS:840:INTOL_BMIN.RVAL PP") field(OUTC, "QUAD:LTUS:840:INTOL_BRANGE.RVAL PP") field(OUTD, "QUAD:LTUS:840: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, "QUAD:LTUS:840:INTOL") { field(DESC, "BACT within MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:840:MPSLIMITS.VALA") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "QUAD:LTUS:840:INTOL_BMIN") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:840:MPSLIMITS.VALB") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "QUAD:LTUS:840:INTOL_BMIN2") { field(DESC, "MPS tol #2") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:840:MPSLIMITS.VALD") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "QUAD:LTUS:840:INTOL_BRANGE") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:840: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, "QUAD:LTUS:840:CHCKITOL") { field(DESC, "Absolute Check I Tolerance") field(EGU, "A") field(FLNK, "QUAD:LTUS:840:TRIMITOL") field(CALC, "ABS(A*B)") field(INPA, "QUAD:LTUS:840:CHCKBTOL") field(INPB, "QUAD:LTUS:840:POLYCOEF.B") field(PREC, "9") } record(calc, "QUAD:LTUS:840:TRIMBTOL") { field(EGU, "kG") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(DESC, "Absolute Trim Tolerance") field(CALC, "ABS(A)/2") field(INPA, "QUAD:LTUS:840:CHCKBTOL") field(FLNK, "QUAD:LTUS:840:CHCKITOL") } record(calc, "QUAD:LTUS:840:CHCKBTOL") { field(DESC, "Check absolute tolerance") field(EGU, "A") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(FLNK, "QUAD:LTUS:840:TRIMBTOL") field(CALC, "MAX(ABS(A),ABS(C))*(B/1000000)") field(INPA, "QUAD:LTUS:840:BDES.HOPR") field(INPB, "QUAD:LTUS:840:STABILITY") field(INPC, "QUAD:LTUS:840:BDES.LOPR") } record(longout, "QUAD:LTUS:840: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, "QUAD:LTUS:840:CHCKBTOL") } record(calc, "QUAD:LTUS:840:TRIMITOL") { field(DESC, "Absolute Trim I Tolerance") field(EGU, "kG") field(CALC, "ABS(A*B)") field(INPA, "QUAD:LTUS:840:POLYCOEF.B") field(INPB, "QUAD:LTUS:840:TRIMBTOL") field(PREC, "9") } record(ai, "QUAD:LTUS:840:TRIMBTOLR") { field(DESC, "Relative trim tol") field(PREC, "4") field(EGU, "%") field(HOPR, "1.0") field(LOPR, "0.0") field(PINI, "YES") } record(ai, "QUAD:LTUS:840: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, "QUAD:LTUS:840:FBCKFCOM") { field(ZNAM, "CA") field(ONAM, "FCOM") field(DESC, "CA Mode") field(PINI, "YES") field(SDIS, "0") } record(bo, "QUAD:LTUS:840:PAU") { field(ZNAM, "NotConfigured") field(ONAM, "Configured") field(DESC, "PAU Present") field(PINI, "YES") field(SDIS, "0") field(FLNK, "QUAD:LTUS:840:PAUGO") } record(fanout, "QUAD:LTUS:840:PAUGO") { field(DESC, "PAU control") field(LNK1, "QUAD:LTUS:840:PAUSTOP") field(LNK2, "QUAD:LTUS:840: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, "QUAD:LTUS:840:PAUSTART") { field(DESC, "Setup for PAU On") field(SDIS, "QUAD:LTUS:840: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, "QUAD:LTUS:840:PAUSTOP") { field(DESC, "Setup for PAU Off") field(SDIS, "QUAD:LTUS:840: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, "QUAD:LTUS:840:MCORDEVNAME") { field(DESC, "PS device name") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, "PSC:LTUS:MG19:") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "QUAD:LTUS:840: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, "QUAD:LTUS:840:PSTYPE.RVAL") field(INPC, "QUAD:LTUS:840:TURNEDOFF.RVAL") field(INPD, "QUAD:LTUS:840:CONFIG.RVAL") field(INPE, "QUAD:LTUS:840:PSCATEGORY.RVAL") field(INPF, "QUAD:LTUS:840:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "QUAD:LTUS:840:AUTOCTRL.RVAL") field(INPJ, "QUAD:LTUS:840:OUTOFSERVICE.RVAL") field(INPL, "QUAD:LTUS:840:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "QUAD:LTUS:840:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "QUAD:LTUS:840:PAU") field(INPP, "QUAD:LTUS:840:CALBDISABLE.RVAL") field(INPQ, "QUAD:LTUS:840:PTRBDISABLE.RVAL") field(INPR, "QUAD:LTUS:840:TRIMDISABLE.RVAL") field(INPS, "QUAD:LTUS:840:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "QUAD:LTUS:840:FBCK") field(INPU, "QUAD:LTUS:840:TRIMTYPE.RVAL") field(INPV, "QUAD:LTUS:840:STDZDIRECT.RVAL") field(INPW, "QUAD:LTUS:840:DEGAUSENABLE.RVAL") field(FLNK, "QUAD:LTUS:840:HSTA") } record(longin, "QUAD:LTUS:840:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "QUAD:LTUS:840:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "QUAD:LTUS:840: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, "QUAD:LTUS:840: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, "QUAD:LTUS:840:CALBDISABLE") { field(DESC, "DAC Calb Disabled") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:840:PTRBDISABLE") { field(DESC, "Perturb Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:840:TRIMDISABLE") { field(DESC, "Trim Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:840: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 QUAD:LTUS:840:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses QUAD:LTUS:840:FBCK. # This PV should be replaced by QUAD:LTUS:840: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, "QUAD:LTUS:840: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, "QUAD:LTUS:840: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, "QUAD:LTUS:840: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, "") field(OMSL, "supervisory") field(FLNK, "QUAD:LTUS:840:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"QUAD:LTUS:840:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "QUAD:LTUS:840:OUTOFSERVICE NPP NMS") field(OUT, "QUAD:LTUS:840:ONLINE PP") } record(bo, "QUAD:LTUS:840:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "QUAD:LTUS:840: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, "1") } record(bo, "QUAD:LTUS:840: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, "1") } record(bo, "QUAD:LTUS:840: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, "QUAD:LTUS:840: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, "QUAD:LTUS:840: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, "QUAD:LTUS:840: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, "QUAD:LTUS:840: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, "QUAD:LTUS:840: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, "1") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:840: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, "1") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:840: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, "2") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:840: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, "0") field(ASG, "NOWRITE") field(FLNK, "QUAD:LTUS:840:TRIMTYPE") } record(stringout, "QUAD:LTUS:840:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "QUAD:LTUS:840:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "QUAD:LTUS:840:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "QUAD:LTUS:840:STATE.RVAL") field(INPB, "QUAD:LTUS:840:INTLKSUMY.RVAL") field(OUT, "QUAD:LTUS:840:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:LTUS:840: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, "QUAD:LTUS:840:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "QUAD:LTUS:840:STATE.RVAL") field(INPB, "QUAD:LTUS:840:INTLKSUMY.RVAL") field(OUT, "QUAD:LTUS:840:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:LTUS:840:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "QUAD:LTUS:840:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "QUAD:LTUS:840: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, "QUAD:LTUS:840:RAMPSTARTDLY") { field(DESC, "Tansition to ramp delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "2") } ######### For PSTYPE=2 Only ############# record(mbbo, "QUAD:LTUS:840: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, "QUAD:LTUS:840: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,"QUAD:LTUS:840: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("QUAD:LTUS:840:TURNEDOFF",3140,1907,0,1,"QUAD:LTUS:840:TURNEDOFF") #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "QUAD:LTUS:840:STATSUB") { field(DESC, "Build STATus ") field(INAM, "mgntInit") field(SNAM, "mgntSlcStat") field(INPA, "QUAD:LTUS:840:BACT.STAT") field(INPB, "QUAD:LTUS:840:BDES.STAT") field(INPC, "QUAD:LTUS:840:IRIPL.STAT") field(INPD, "PSC:LTUS:MG19:ISETPT.STAT") field(INPE, "PSC:LTUS:MG19:IACT.STAT") # 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, "QUAD:LTUS:840:BACT.SEVR") field(INPH, "QUAD:LTUS:840:BDES.SEVR") field(INPI, "QUAD:LTUS:840:IRIPL.SEVR") field(INPJ, "PSC:LTUS:MG19:ISETPT.SEVR") field(INPK, "PSC:LTUS:MG19:IACT.SEVR") # # 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, "QUAD:LTUS:840:STATE.RVAL") field(INPN, "QUAD:LTUS:840:STDZOK") field(INPO, "QUAD:LTUS:840:CALBOK") field(INPP, "QUAD:LTUS:840:OUTOFSERVICE.RVAL") field(INPQ, "QUAD:LTUS:840:CONFIG.RVAL") field(INPR, "QUAD:LTUS:840:HSTA") field(INPS, "QUAD:LTUS:840:CTRL.RVAL") field(INPT, "QUAD:LTUS:840:DEGAUSOK") field(INPV, "QUAD:LTUS:840: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, "QUAD:LTUS:840:STAT") } record(longout, "QUAD:LTUS:840:STAT") { field(DESC, "STAT sent to SLC") field(SCAN, "Passive") field(FLNK, "QUAD:LTUS:840:STATCTRLSUB") field(DOL, "QUAD:LTUS:840:STATSUB.VAL") field(OMSL, "closed_loop") } record(sSub, "QUAD:LTUS:840:STATCTRLSUB") { field(DESC, "Decode SLC STAT into mbbo") field(INAM, "mgntInit") field(SNAM, "mgntStatDecode") field(INPA, "QUAD:LTUS:840:STAT") field(INPB, "QUAD:LTUS:840:HSTA") field(INPD, "QUAD:LTUS:840:ONOFFCTRL.RVAL") field(FLNK, "QUAD:LTUS:840:STATMSG") } record(mbbo, "QUAD:LTUS:840: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, "QUAD:LTUS:840:UNAVAILGO") field(DOL, "QUAD:LTUS:840:STATCTRLSUB.W") } record(seq, "QUAD:LTUS:840:UNAVAILGO") { field(DESC, "Process UNAVAIL") field(DOL1, "QUAD:LTUS:840:STATSUB.U") field(LNK1, "QUAD:LTUS:840:UNAVAIL PP") } record(stringout, "QUAD:LTUS:840:SNLSTATMSG") { field(DTYP, "Soft Channel") } #! TextBox(TB0,820,1000,1200,1220,0,"Dialog",12,1,16777215,"QUAD:LTUS:840:STATUSSUB - future\nOverall device status - takes input from action snls, record sevrs, master snl(s) and outputs final status\n\nInputs:\nA - QUAD:LTUS:840:CTRLSTATUS - snl status\nB - MGNT:CTRLSTATUS - master list status\nC\nD - QUAD:LTUS:840: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,"QUAD:LTUS:840STATSUB\nformat control bo's into slc STAT\n\nInputs:\nA - QUAD:LTUS:840:STATUS\nC - QUAD:LTUS:840:ON\nD - QUAD:LTUS:840:STDZOK\nE - QUAD:LTUS:840:CALBOK\nF - QUAD:LTUS:840:BACTDRIFT (future)\nG -\nH- QUAD:LTUS:840:DACSTATUS\nI -QUAD:LTUS:840:ADCSTATUS\nJ - QUAD:LTUS:840:BACTSTATUS\nK - QUAD:LTUS:840:BDESSTATUS\nL - QUAD:LTUS:840:RIPLSTATUS\n\nOutput:\nP - QUAD:LTUS:840: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, "QUAD:LTUS:840: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, "QUAD:LTUS:840: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, "QUAD:LTUS:840: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, "QUAD:LTUS:840: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.6 #! DBDSTART #! DBD("../../../../dbd/mgntSoft.dbd") #! DBDEND record(stringout, "QUAD:LTUS:840:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:840:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "QUAD:LTUS:840:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "QUAD:LTUS:840:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "QUAD:LTUS:840:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "QUAD:LTUS:840:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "1") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "QUAD:LTUS:840: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, "QUAD:LTUS:840:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "QUAD:LTUS:840:TRIMTYPE.RVAL") field(INPB, "QUAD:LTUS:840:CONFIG.RVAL") field(OUT, "QUAD:LTUS:840:TRIMMAXNUM PP") } record(longout, "QUAD:LTUS:840: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, "QUAD:LTUS:840: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, "") field(OMSL, "supervisory") field(VAL, "20") field(OUT, "QUAD:LTUS:840:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "QUAD:LTUS:840: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, "") field(OMSL, "supervisory") field(VAL, "10") } record(bo, "QUAD:LTUS:840: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, "QUAD:LTUS:840: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, "QUAD:LTUS:840: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, "QUAD:LTUS:840:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "0") } record(ao, "QUAD:LTUS:840: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, "QUAD:LTUS:840:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "QUAD:LTUS:840: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, "QUAD:LTUS:840: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, "QUAD:LTUS:840:IMOVE") field(INPB, "QUAD:LTUS:840:IACT") field(INPC, "QUAD:LTUS:840:IRAMPRATE") field(INPD, "1.577") field(INPE, "QUAD:LTUS:840:TRIMDLYPCT") field(INPF, "QUAD:LTUS:840:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "QUAD:LTUS:840:RAMPTIME_LEFT PP") } record(longout, "QUAD:LTUS:840:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "QUAD:LTUS:840:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "QUAD:LTUS:840:RAMPDONE_CALC") } record(calc, "QUAD:LTUS:840:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "QUAD:LTUS:840:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "QUAD:LTUS:840:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "QUAD:LTUS:840: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, "QUAD:LTUS:840:RAMPTIME_LEFT") field(OUT, "QUAD:LTUS:840:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "QUAD:LTUS:840:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "QUAD:LTUS:840:RAMPTIME_LEFT NMS") field(OUT, "QUAD:LTUS:840:RAMPDONE PP") } record(bo, "QUAD:LTUS:840:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "QUAD:LTUS:840:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "QUAD:LTUS:840: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, "QUAD:LTUS:840: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(sSub, "QUAD:LTUS:840: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, "QUAD:LTUS:840:PSTYPE.RVAL") field(INPC, "QUAD:LTUS:840:TURNEDOFF.RVAL") field(INPD, "QUAD:LTUS:840:CONFIG.RVAL") field(INPE, "QUAD:LTUS:840:PSCATEGORY.RVAL") field(INPF, "QUAD:LTUS:840:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "QUAD:LTUS:840:AUTOCTRL.RVAL") field(INPJ, "QUAD:LTUS:840:OUTOFSERVICE.RVAL") field(INPL, "QUAD:LTUS:840:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "QUAD:LTUS:840:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "QUAD:LTUS:840:PAU") field(INPP, "QUAD:LTUS:840:CALBDISABLE.RVAL") field(INPQ, "QUAD:LTUS:840:PTRBDISABLE.RVAL") field(INPR, "QUAD:LTUS:840:TRIMDISABLE.RVAL") field(INPS, "QUAD:LTUS:840:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "QUAD:LTUS:840:FBCK") field(INPU, "QUAD:LTUS:840:TRIMTYPE.RVAL") field(INPV, "QUAD:LTUS:840:STDZDIRECT.RVAL") field(INPW, "QUAD:LTUS:840:DEGAUSENABLE.RVAL") field(FLNK, "QUAD:LTUS:840:HSTA") } record(longin, "QUAD:LTUS:840:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "QUAD:LTUS:840:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "QUAD:LTUS:840: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, "QUAD:LTUS:840: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, "QUAD:LTUS:840:CALBDISABLE") { field(DESC, "DAC Calb Disabled") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:840:PTRBDISABLE") { field(DESC, "Perturb Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:840:TRIMDISABLE") { field(DESC, "Trim Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:840:STDZDISABLE") { field(DTYP, "Raw Soft Channel") field(ZNAM, "NO") field(ONAM, "YES") field(DESC, "Standardize Function") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } # This PV has been replaced by QUAD:LTUS:840:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses QUAD:LTUS:840:FBCK. # This PV should be replaced by QUAD:LTUS:840: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, "QUAD:LTUS:840: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, "QUAD:LTUS:840: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, "QUAD:LTUS:840: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, "") field(OMSL, "supervisory") field(FLNK, "QUAD:LTUS:840:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"QUAD:LTUS:840:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "QUAD:LTUS:840:OUTOFSERVICE NPP NMS") field(OUT, "QUAD:LTUS:840:ONLINE PP") } record(bo, "QUAD:LTUS:840:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "QUAD:LTUS:840: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, "1") } record(bo, "QUAD:LTUS:840: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, "1") } record(bo, "QUAD:LTUS:840: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, "QUAD:LTUS:840: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, "QUAD:LTUS:840: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, "QUAD:LTUS:840: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, "QUAD:LTUS:840: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, "QUAD:LTUS:840: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, "1") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:840: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, "1") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:840: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, "2") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:840: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, "0") field(ASG, "NOWRITE") field(FLNK, "QUAD:LTUS:840:TRIMTYPE") } record(stringout, "QUAD:LTUS:840:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "QUAD:LTUS:840:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "QUAD:LTUS:840:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "QUAD:LTUS:840:STATE.RVAL") field(INPB, "QUAD:LTUS:840:INTLKSUMY.RVAL") field(OUT, "QUAD:LTUS:840:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:LTUS:840: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, "QUAD:LTUS:840:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "QUAD:LTUS:840:STATE.RVAL") field(INPB, "QUAD:LTUS:840:INTLKSUMY.RVAL") field(OUT, "QUAD:LTUS:840:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:LTUS:840:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "QUAD:LTUS:840:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "QUAD:LTUS:840: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, "QUAD:LTUS:840:RAMPSTARTDLY") { field(DESC, "Tansition to ramp delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "2") } ######### For PSTYPE=2 Only ############# record(mbbo, "QUAD:LTUS:840: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, "QUAD:LTUS:840: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,"QUAD:LTUS:840: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("QUAD:LTUS:840:TURNEDOFF",3140,1907,0,1,"QUAD:LTUS:840:TURNEDOFF") #! 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, "QUAD:LTUS:860:IACT") { field(DESC, "Current") field(INP, "PSC:LTUS:MG20:IACT") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "QUAD:LTUS:860:BACT") info(autosaveFields,"HYST") } record(bi, "QUAD:LTUS:860:STATE") { field(DESC, "PS On/Off Status") field(DTYP, "Raw Soft Channel") field(INP, "PSC:LTUS:MG20:STATE NPP MS") field(ZSV, "MAJOR") field(ZNAM, "OFF") field(ONAM, "ON") } record(ao, "QUAD:LTUS:860:IDES") { field(DESC, "Desired Current") field(PREC, "3") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(MDEL, "-1") field(HIHI, "120.0") field(LOLO, "-120.0") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "QUAD:LTUS:860:BDELTAS") field(DRVH, "120.0") field(DRVL, "-120.0") field(DOL, "QUAD:LTUS:860: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, "QUAD:LTUS:860:ICTRL PP") } # This record is processed by QUAD:LTUS:860:ICON") # Note: we are not setting alarms here. record(ao, "QUAD:LTUS:860:ICON") { field(DESC, "Config I") field(DTYP, "Soft Channel") field(PREC, "3") field(HOPR, "120.0") field(LOPR, "-120.0") field(DRVH, "120.0") field(DRVL, "-120.0") field(DOL, "QUAD:LTUS:860:B2ICON.K") field(OMSL, "closed_loop") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:860:INOM") { field(DESC, "Nominal Current") field(DOL, "QUAD:LTUS:860:BNOM.K") field(OMSL, "closed_loop") field(PREC, "3") field(EGU, "A") field(DRVH, "120.0") field(DRVL, "-120.0") field(HOPR, "120.0") field(LOPR, "-120.0") } record(ao, "QUAD:LTUS:860:ICTRL") { field(DESC, "Set Current") field(PREC, "3") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(DRVH, "120.0") field(DRVL, "-120.0") field(MDEL, "-1") field(FLNK, "QUAD:LTUS:860:ICTRLGO") field(OMSL, "supervisory") info(autosavefields,"VAL") } record(seq, "QUAD:LTUS:860:ICTRLGO") { field(DESC, "Process Current Setpoint") field(PREC, "3") # Set ISETPT to supervisory field(DOL1, "0") field(LNK1, "QUAD:LTUS:860:ISETPT.OMSL") field(DOL2, "QUAD:LTUS:860:ICTRL") field(LNK2, "QUAD:LTUS:860:ISETPT PP") # Set ISETPT to closed loop - get data from BCTRLSUB.K field(DOL3, "1") field(LNK3, "QUAD:LTUS:860:ISETPT.OMSL") } record(ao, "QUAD:LTUS:860:IMAX") { field(DESC, "Max I") field(DTYP, "Soft Channel") field(DRVH, "120.0") field(DRVL, "-120.0") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(PREC, "3") field(PINI, "YES") field(VAL, "120.0") field(FLNK, "QUAD:LTUS:860:IMIN") } record(ao, "QUAD:LTUS:860:IMIN") { field(DESC, "Min I") field(DTYP, "Soft Channel") field(DRVH, "120.0") field(DRVL, "-120.0") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(PREC, "3") field(VAL, "-120.0") field(FLNK, "QUAD:LTUS:860:IRANGE") } record(sel, "QUAD:LTUS:860:IACTPREVOK") { field(DESC, "Last Good Current") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(PREC, "3") field(NVL, "QUAD:LTUS:860:BACT.SEVR") field(INPA, "QUAD:LTUS:860:IACT NPP MS") field(INPB, "QUAD:LTUS:860:IACTPREVOK NPP MS") field(INPC, "QUAD:LTUS:860:IACTPREVOK NPP MS") field(INPD, "QUAD:LTUS:860:IACTPREVOK NPP MS") } record(sub, "QUAD:LTUS:860:IACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:860:IDES") field(INPB, "QUAD:LTUS:860:ISETPT.DRVH") field(INPC, "QUAD:LTUS:860:ISETPT.DRVL") field(INPD, "QUAD:LTUS:860:IDELTAS.I") field(INPE, "QUAD:LTUS:860:IDELTAS.J") field(INPG, "QUAD:LTUS:860:STATE") field(INPH, "QUAD:LTUS:860:HSTA") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(PREC, "3") field(BRSV, "INVALID") } record(sub, "QUAD:LTUS:860:IMONLIMITS") { field(DESC, "Aux Current Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:860:IDES") field(INPB, "QUAD:LTUS:860:ISETPT.DRVH") field(INPC, "QUAD:LTUS:860:ISETPT.DRVL") field(INPD, "QUAD:LTUS:860:IDELTAS.K") field(INPE, "QUAD:LTUS:860:IDELTAS.L") field(INPG, "QUAD:LTUS:860:STATE") field(INPH, "QUAD:LTUS:860:HSTA") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(PREC, "3") field(BRSV, "INVALID") } record(seq, "QUAD:LTUS:860:ILIMITS") { field(DESC, "Set ACT and MON Limits") field(PREC, "3") field(DOL1, "QUAD:LTUS:860:BLIMITS") field(LNK1, "QUAD:LTUS:860:IACTLIMITS.F PP") field(DOL2, "QUAD:LTUS:860:IACTLIMITS.I") field(LNK2, "QUAD:LTUS:860:IACT.HIGH") field(DOL3, "QUAD:LTUS:860:IACTLIMITS.J") field(LNK3, "QUAD:LTUS:860:IACT.LOW") field(DOL4, "QUAD:LTUS:860:IACTLIMITS.K") field(LNK4, "QUAD:LTUS:860:IACT.HIHI") field(DOL5, "QUAD:LTUS:860:IACTLIMITS.L") field(LNK5, "QUAD:LTUS:860:IACT.LOLO") field(DOL6, "QUAD:LTUS:860:BLIMITS") field(LNK6, "QUAD:LTUS:860:IMONLIMITS.F PP") field(DOL7, "QUAD:LTUS:860:IMONLIMITS.I") field(LNK7, "QUAD:LTUS:860:IMON.HIGH") field(DOL8, "QUAD:LTUS:860:IMONLIMITS.J") field(LNK8, "QUAD:LTUS:860:IMON.LOW") field(DOL9, "QUAD:LTUS:860:IMONLIMITS.K") field(LNK9, "QUAD:LTUS:860:IMON.HIHI") field(DOLA, "QUAD:LTUS:860:IMONLIMITS.L") field(LNKA, "QUAD:LTUS:860: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, "QUAD:LTUS:860:IDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntRawDeltas") field(INPD, "QUAD:LTUS:860:TRIMBTOL") field(INPE, "QUAD:LTUS:860:CHCKBTOL") field(INPF, "QUAD:LTUS:860:BDELTAS.K") field(INPG, "QUAD:LTUS:860:BDELTAS.L") field(INPH, "QUAD:LTUS:860: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, "QUAD:LTUS:860:STDZITOLR") field(INPC, "QUAD:LTUS:860:STDZITOL") field(FLNK, "") } # All ps controllers with on/off control will set the macro ONOF # as follows: # # ONOF = PSC:LTUS:MG20: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, "QUAD:LTUS:860:STATESETPT") { field(DESC, "PS On/Off") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFF") field(ONAM, "ON") field(OUT, "PSC:LTUS:MG20:STATESETPT PP") 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 = PSC:LTUS:MG20:RESET PP # record(bo, "QUAD:LTUS:860:RESET") { field(DESC, "Interlock Latch Reset") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFF") field(ONAM, "ON") field(HIGH, "1.0") field(OUT, "PSC:LTUS:MG20:RESET PP") } record(bo, "QUAD:LTUS:860:RAMPSTATE") { field(DESC, "PS Ramp Status") field(DTYP, "Soft Channel") field(DOL, "PSC:LTUS:MG20:RAMPSTATE NPP 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, "QUAD:LTUS:860: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, "QUAD:LTUS:860:TRIMRAMPRATE") field(OUT, "PSC:LTUS:MG20:IRAMPRATE PP") field(FLNK, "QUAD:LTUS:860:STDZDLY") } record(ao, "QUAD:LTUS:860:ISETPT") { field(DESC, "Current Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(DRVH, "120.0") field(DRVL, "-120.0") field(MDEL, "-1") field(OUT, "PSC:LTUS:MG20:ISETPT PP") field(DOL, "QUAD:LTUS:860: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, "QUAD:LTUS:860:IMON") { field(DESC, "Aux Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(INP, "PSC:LTUS:MG20:IMON") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "QUAD:LTUS:860:BMON") } record(ao, "QUAD:LTUS:860:IRIPL") { field(DESC, "Ripple Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(DOL, "PSC:LTUS:MG20:IRIPL NPP NMS") field(OMSL, "closed_loop") field(EGU, "A") field(DRVH, "1.0") field(HOPR, "1.0") field(PREC, "3") field(FLNK, "QUAD:LTUS:860:IRIPLOK") } record(sub, "QUAD:LTUS:860:IRIPLOK") { field(DESC, "Ripple Current Status") field(INAM, "mgntInit") field(SNAM, "mgntRiplOK") field(INPA, "QUAD:LTUS:860:IRIPL.VAL") field(INPB, "QUAD:LTUS:860: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, "QUAD:LTUS:860:R") { field(DESC, "Resistance") field(EGU, "Ohms") field(PREC, "4") field(PINI, "YES") field(DOL, "PSC:LTUS:MG20:R NPP MS") 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, "QUAD:LTUS:860:IGND") { field(DESC, "Ground Current") field(EGU, "A") field(PREC, "6") field(PINI, "YES") field(DOL, "PSC:LTUS:MG20:IGND NPP MS") field(OMSL, "closed_loop") } record(bi, "QUAD:LTUS:860:INTLKSUMY") { field(DESC, "Interlock Summary") field(INP, "PSC:LTUS:MG20:INTLKSUMY NPP MS") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(ZNAM, "OK") field(ONAM, "FAULT") field(PINI, "NO") } record(mbbo, "QUAD:LTUS:860: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, "PSC:LTUS:MG20:COOLING") field(OMSL, "closed_loop") } # The following PV is processed by :BACTFO # which is processed by :BACT record(fanout, "QUAD:LTUS:860:IACTFO") { field(DESC, "IACT processing") field(SELM, "All") field(LNK1, "QUAD:LTUS:860:IACTPREVOK") field(LNK2, "QUAD:LTUS:860:IDIFF") field(LNK3, "QUAD:LTUS:860:IADIFF") field(LNK4, "QUAD:LTUS:860:IRATIO") field(LNK5, "QUAD:LTUS:860:IDIRECT") field(LNK6, "QUAD:LTUS:860:IACTPOL_CHECK") } record(calc, "QUAD:LTUS:860:IDIFF") { field(DESC, "IDES-IACT") field(CALC, "A-B") field(INPA, "QUAD:LTUS:860:IDES") field(INPB, "QUAD:LTUS:860:IACT") field(EGU, "A") field(PREC, "9") field(HOPR, "120.0") field(LOPR, "-120.0") } record(calc, "QUAD:LTUS:860:IADIFF") { field(DESC, "Absolute IDES-IACT") field(CALC, "A<0?ABS(A):A") field(INPA, "QUAD:LTUS:860:IDIFF") field(PREC, "9") } record(calc, "QUAD:LTUS:860:IRATIO") { field(DESC, "IDES-IACT/IMAX") field(CALC, "B?A/B:0") field(INPA, "QUAD:LTUS:860:IDIFF") field(INPB, "QUAD:LTUS:860:IDES.DRVH") field(PREC, "9") } record(calcout, "QUAD:LTUS:860:IRANGE") { field(DESC, "Current Range") field(PINI, "YES") field(CALC, "ABS(A-B)") field(INPA, "QUAD:LTUS:860:IMIN") field(INPB, "QUAD:LTUS:860: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, "QUAD:LTUS:860: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, "QUAD:LTUS:860:IACT") field(FLNK, "QUAD:LTUS:860:IACTPOL") } record(bo, "QUAD:LTUS:860:IACTPOL") { field(DESC, "Actual I Polarity") field(DTYP, "Raw Soft Channel") field(DOL, "QUAD:LTUS:860: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,"QUAD:LTUS:860:I*LIMITS:\n Calculate alarm and warning limits based on \n deltas from QUAD:LTUS:860:IDELTAS and the\n QUAD:LTUS:860: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,"QUAD:LTUS:860:IACT: \n Get copy of QUAD:LTUS:860:I. \n",null) #! TextBox(TB12,1280,3100,1760,3200,0,"Dialog",12,1,16777215,"QUAD:LTUS:860: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,"QUAD:LTUS:860:IDES:\n Contains raw value calculated by \nQUAD:LTUS:860: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 \nQUAD:LTUS:860:BDELTAS.\n",null) #! TextBox(TB10,56,1940,316,2340,0,"Dialog",12,1,16777215,"QUAD:LTUS:860: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 QUAD:LTUS:860: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 QUAD:LTUS:860: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,"QUAD:LTUS:860:ISETPT:\n Sets the hardware. When fast feedback is set on, this record is\n set to closed loop mode by QUAD:LTUS:860:FBCKSTART sequence. When \n the loop is closed, this record takes input calculated by \n BFBCK only. When fast feedback is set off, QUAD:LTUS:860:FBCKSTOP \n will set it back to supervisory so that the value can be set by \n QUAD:LTUS:860: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, "QUAD:LTUS:860:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:860:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "QUAD:LTUS:860:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "QUAD:LTUS:860:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "QUAD:LTUS:860:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "QUAD:LTUS:860:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "1") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "QUAD:LTUS:860: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, "QUAD:LTUS:860:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "QUAD:LTUS:860:TRIMTYPE.RVAL") field(INPB, "QUAD:LTUS:860:CONFIG.RVAL") field(OUT, "QUAD:LTUS:860:TRIMMAXNUM PP") } record(longout, "QUAD:LTUS:860: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, "QUAD:LTUS:860: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, "") field(OMSL, "supervisory") field(VAL, "10") field(OUT, "QUAD:LTUS:860:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "QUAD:LTUS:860: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, "") field(OMSL, "supervisory") field(VAL, "10") } record(bo, "QUAD:LTUS:860: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, "QUAD:LTUS:860: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, "QUAD:LTUS:860: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, "QUAD:LTUS:860:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "0") } record(ao, "QUAD:LTUS:860: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, "QUAD:LTUS:860:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "QUAD:LTUS:860: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, "QUAD:LTUS:860: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, "QUAD:LTUS:860:IMOVE") field(INPB, "QUAD:LTUS:860:IACT") field(INPC, "QUAD:LTUS:860:IRAMPRATE") field(INPD, "1.577") field(INPE, "QUAD:LTUS:860:TRIMDLYPCT") field(INPF, "QUAD:LTUS:860:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "QUAD:LTUS:860:RAMPTIME_LEFT PP") } record(longout, "QUAD:LTUS:860:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "QUAD:LTUS:860:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "QUAD:LTUS:860:RAMPDONE_CALC") } record(calc, "QUAD:LTUS:860:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "QUAD:LTUS:860:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "QUAD:LTUS:860:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "QUAD:LTUS:860: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, "QUAD:LTUS:860:RAMPTIME_LEFT") field(OUT, "QUAD:LTUS:860:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "QUAD:LTUS:860:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "QUAD:LTUS:860:RAMPTIME_LEFT NMS") field(OUT, "QUAD:LTUS:860:RAMPDONE PP") } record(bo, "QUAD:LTUS:860:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "QUAD:LTUS:860:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "QUAD:LTUS:860: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, "QUAD:LTUS:860: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, "QUAD:LTUS:860:STDZINIT") { field(DESC, "Proc. Stdz PVs on boot") field(PINI, "YES") field(DOL1, "1") field(DOL2, "1") field(DOL3, "1") field(LNK1, "QUAD:LTUS:860:DEBUG.PROC PP") field(LNK2, "QUAD:LTUS:860:STDZCYCLENUM.PROC PP") field(LNK3, "QUAD:LTUS:860:STDZDISABLE.PROC PP") field(LNK4, "QUAD:LTUS:860: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, "QUAD:LTUS:860:STDZSUB") { field(DESC, "Stdz subroutine") field(INAM, "mgntStdzInit") field(SNAM, "mgntStdz") field(BRSV, "INVALID") field(INPA, "QUAD:LTUS:860:STDZIMIN NPP NMS") field(INPB, "QUAD:LTUS:860:STDZIMAX NPP NMS") field(INPC, "QUAD:LTUS:860:STDZIFINAL NPP NMS") field(INPD, "QUAD:LTUS:860:STDZCYCLENUM NPP NMS") field(INPE, "QUAD:LTUS:860:STDZDIRECT.RVAL NPP NMS") field(INPF, "QUAD:LTUS:860:STDZDISABLE.RVAL CPP NMS") field(INPG, "QUAD:LTUS:860: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, "QUAD:LTUS:860:STDZWF PP") field(OUTB, "QUAD:LTUS:860: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, "QUAD:LTUS:860:STDZWF") } record(mbbo, "QUAD:LTUS:860: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, "QUAD:LTUS:860: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, "QUAD:LTUS:860:STDZMAINPS") { field(DESC, "Stdz by main or self") field(PINI, "YES") field(DTYP, "Soft Channel") field(ZNAM, "SELF") field(ONAM, "MAIN") } record(bo, "QUAD:LTUS:860: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, "QUAD:LTUS:860: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, "QUAD:LTUS:860: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, "QUAD:LTUS:860:STDZTOD") { field(DESC, "Successful Standardize Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "QUAD:LTUS:860:STDZLOSTTOD") { field(DESC, "Standardize Lost Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(longout, "QUAD:LTUS:860:STDZCYCLECNT") { field(DESC, "Cycle Count") field(PINI, "YES") } record(longout, "QUAD:LTUS:860:STDZCYCLENUM") { field(DESC, "No. Standardize Cycles") field(VAL, "3") field(HOPR, "10") field(LOPR, "0") field(DRVH, "10") field(DRVL, "0") field(PINI, "YES") field(FLNK, "QUAD:LTUS:860:STDZDIRECT") } # The default standardize direction is "UP" for # all LCLS Magnets.. record(bo, "QUAD:LTUS:860:STDZDIRECT") { field(DESC, "Standardize Direction ") field(ZNAM, "UP") field(ONAM, "DOWN") field(VAL, "0") field(FLNK, "QUAD:LTUS:860:STDZIMIN") } record(ao, "QUAD:LTUS:860:STDZIMIN") { field(DESC, "Min-STDZ Current") field(PREC, "1") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(VAL, "-120.0") field(FLNK, "QUAD:LTUS:860:STDZIMAX") } record(ao, "QUAD:LTUS:860:STDZIMAX") { field(DESC, "Max. Standarize Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(VAL, "120.0") field(FLNK, "QUAD:LTUS:860:STDZIFINAL") } record(ao, "QUAD:LTUS:860:STDZIFINAL") { field(DESC, "Final SDTZ Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(VAL, "-120.0") field(FLNK, "QUAD:LTUS:860: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, "QUAD:LTUS:860: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, "QUAD:LTUS:860:STDZITOL") { field(DESC, "Stdz min tolerance") field(PREC, "5") field(CALC, "MAX(ABS(A),ABS(B))*C") field(INPA, "QUAD:LTUS:860:STDZIMIN CP NMS") field(INPB, "QUAD:LTUS:860:STDZIMAX CP MMS") field(INPC, "0.05") field(INPD, "QUAD:LTUS:860:STDZITOLR CP MMS") field(EGU, "A") field(FLNK, "QUAD:LTUS:860:IDELTAS") field(PINI, "YES") } # D - factor (3.154/2 = 1.577) for EPSC, otherwise, set to 1.0 record(calc, "QUAD:LTUS:860:STDZDLY") { field(DESC, "Ramp time for stdz cycle") field(CALC, "C>0?MAX(1,ABS((A-B)/C)*D):0") field(INPA, "QUAD:LTUS:860:STDZIMIN CP NMS") field(INPB, "QUAD:LTUS:860:STDZIMAX CP NMS") field(INPC, "QUAD:LTUS:860:TRIMRAMPRATE CP NMS") field(INPD, "1.577") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") } record(calc, "QUAD:LTUS:860:STDZRAMPDLY") { field(DESC, "Ramp delay total") field(CALC, "MAX(1,((A/100)*B+B))") field(PREC, "5") field(INPA, "QUAD:LTUS:860:TRIMDLYPCT CP MS") field(INPB, "QUAD:LTUS:860: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, "QUAD:LTUS:860:STDZMINIDLY") { field(DESC, "Mini-stdz delay") field(CALC, "A") field(PREC, "5") field(A, "1.0") field(EGU, "sec") field(PINI, "YES") } record(ao, "QUAD:LTUS:860: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, "QUAD:LTUS:860:STDZMINIDELTA") { field(DESC, "Stdz mini % of IMAX") field(CALC, "(B/100)*(A-C)") field(INPA, "QUAD:LTUS:860:IDES.HOPR") field(INPB, "QUAD:LTUS:860:STDZMINIPCT CPP NMS") field(INPC, "QUAD:LTUS:860:IDES.LOPR") field(PREC, "5") } record(calc, "QUAD:LTUS:860:STDZMINISETPT") { field(DESC, "Mini Stdz delta") field(CALC, "C==0?MAX(E-D,B):MIN(E+D,A)") field(INPA, "QUAD:LTUS:860:IDES.HOPR") field(INPB, "QUAD:LTUS:860:IDES.LOPR") field(INPC, "QUAD:LTUS:860:STDZDIRECT.RVAL") field(INPD, "QUAD:LTUS:860:STDZMINIDELTA") field(INPE, "QUAD:LTUS:860:IDES") field(PREC, "5") field(FLNK, "QUAD:LTUS:860: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, "QUAD:LTUS:860:STDZMINISETPTOOR") { field(DESC, "Mini Stdz setpoint out of range") field(CALC, "C==0?(E-DA)") field(INPA, "QUAD:LTUS:860:IDES.HOPR") field(INPB, "QUAD:LTUS:860:IDES.LOPR") field(INPC, "QUAD:LTUS:860:STDZDIRECT.RVAL") field(INPD, "QUAD:LTUS:860:STDZMINIDELTA") field(INPE, "QUAD:LTUS:860: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, "QUAD:LTUS:860: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, "QUAD:LTUS:860:IADJUST.RVAL") field(INPB, "QUAD:LTUS:860:STDZDIRECT.RVAL") field(INPC, "QUAD:LTUS:860:STDZOK.RVAL") field(INPD, "QUAD:LTUS:860:STDZDISABLE.RVAL") field(INPE, "QUAD:LTUS:860:STATE.RVAL CPP NMS") field(INPF, "QUAD:LTUS:860:ICTRL.RVAL") field(INPG, "QUAD:LTUS:860:STATE.SEVR") field(INPH, "QUAD:LTUS:860:BDELTAS.M") field(INPI, "QUAD:LTUS:860:IACT.SEVR") field(OUT, "QUAD:LTUS:860:STDZLOSTGO.SELN PP NMS") field(OOPT, "Transition To Non-zero") } record(seq, "QUAD:LTUS:860:STDZLOSTGO") { field(DESC, "Process lost stdz") field(SELM, "Mask") field(DOL1, "1") field(DOL2, "0") field(LNK1, "QUAD:LTUS:860:STDZLOSTTOD.PROC") field(LNK2, "QUAD:LTUS:860:STDZOK PP") } # Record maximum current after standardize # Reset to IACT from sequence after trim # Disable processing during (mini-)standardize or trim record(calc, "QUAD:LTUS:860:STDZIACTMAX") { field(DESC, "Max act current after stdz") field(CALC, "MAX(A, B)") field(DISV, "0") field(SDIS, "QUAD:LTUS:860:CHECKPWRDIP_ENABLE") field(INPA, "QUAD:LTUS:860:IACT CP") field(INPB, "QUAD:LTUS:860:STDZIACTMAX") field(EGU, "A") field(FLNK, "QUAD:LTUS:860:CHECKPWRDIP") } # Detect power dip if STDZOK is YES, STDZ is enabled, and IACT is valid # If IACT drops below STDZIACTMAX by more than the trim tolerance, clear STDZOK # Warning: Take the absolute value of the trim tolerance, or else quads of # negative polarity will always lose STDZ since their IDELTAS.I are negative. # Note: Large quads and bends are prone to losing STDZ even if they are # perturbed toward higher current since their current tends to overshoot # by greater than the trim tolerance before settling down. record(calcout, "QUAD:LTUS:860:CHECKPWRDIP") { field(DESC, "Detect power dip") field(CALC, "(A-B>ABS(C))?3:0") field(DISV, "0") field(SDIS, "QUAD:LTUS:860:CHECKPWRDIP_ENABLE") field(INPA, "QUAD:LTUS:860:STDZIACTMAX") field(INPB, "QUAD:LTUS:860:IACT") field(INPC, "QUAD:LTUS:860:IDELTAS.I") field(OUT, "QUAD:LTUS:860:STDZLOSTGO.SELN PP NMS") field(OOPT, "When Non-zero") } # Enable processing of STDZIACTMAX and CHECKPWRDIP only if # STDZOK = YES, STDZDISABLE = NO, CTRL != Trim (2), and # CTRL != Stdz (4) record(calc, "QUAD:LTUS:860:CHECKPWRDIP_ENABLE") { field(CALC, "A&&!B&&(C#2)&&(C#4)") field(INPA, "QUAD:LTUS:860:STDZOK.RVAL CP") field(INPB, "QUAD:LTUS:860:STDZDISABLE.RVAL CP") field(INPC, "QUAD:LTUS:860:CTRL.RVAL CP") } #! 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, "QUAD:LTUS:860: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, "QUAD:LTUS:860:CALBOK") { field(DESC, "Successful Calibration") field(DTYP, "Raw Soft Channel") field(ZNAM, "NO") field(ONAM, "YES") field(DOL, "PSC:LTUS:MG20:CALBOK.RVAL") field(OMSL, "closed_loop") 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, "QUAD:LTUS:860:CALBSET") { field(DESC, "Use DAC Calbration") field(SCAN, "10 second") field(CALC, "A&&(B==0)&&C?31:960") field(INPA, "QUAD:LTUS:860:CALBOK") field(INPB, "QUAD:LTUS:860:CALBDISABLE") field(INPC, "QUAD:LTUS:860:CALBSLOPE") field(OOPT, "On Change") field(OUT, "QUAD:LTUS:860: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, "QUAD:LTUS:860:CALB_SEQ") { field(DESC, "Output Calib Values") field(SELM, "Mask") field(SELL, "QUAD:LTUS:860: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, "QUAD:LTUS:860:CALBSLOPE") field(DOL3, "QUAD:LTUS:860: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, "QUAD:LTUS:860:CALBTOD") { field(DESC, "Calibration Success Time") field(PINI, "YES") field(DOL, "PSC:LTUS:MG20:CALBTOD") field(OMSL, "closed_loop") field(DTYP, "Soft Channel") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:860: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, "QUAD:LTUS:860: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, "QUAD:LTUS:860: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, "QUAD:LTUS:860:CALBOFFSET") { field(DESC, "Calc DAC Offset") field(PREC, "6") field(EGU, "Counts") field(PINI, "YES") } record(bo, "QUAD:LTUS:860: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, "QUAD:LTUS:860:DACSLOPE") { field(DESC, "V to DAC slope") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "closed_loop") field(PINI, "YES") field(FLNK, "QUAD:LTUS:860:DACOFFSET") } # Default Offset used in conversion from Volts to DAC Counts record(ao, "QUAD:LTUS:860:DACOFFSET") { field(DESC, "V to DAC offset") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "closed_loop") field(PINI, "YES") field(FLNK, "QUAD:LTUS:860: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, "QUAD:LTUS:860: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, "QUAD:LTUS:860:IACT") field(INPD, "QUAD:LTUS:860:DACSLOPE") field(INPE, "QUAD:LTUS:860:DACOFFSET") field(EGU, "Counts") field(PREC, "6") } record(ao, "QUAD:LTUS:860:DAC") { field(DESC, "DAC Set point") field(EGU, "Counts") field(DOL, "") field(OMSL, "closed_loop") field(PREC, "6") field(PINI, "YES") } record(ao, "QUAD:LTUS:860:CALBIMIN") { field(DESC, "Calibration Min Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(DRVH, "120.0") field(HOPR, "120.0") field(DRVL, "-120.0") field(LOPR, "-120.0") field(PREC, "3") field(EGU, "A") field(VAL, "0.0") field(FLNK, "QUAD:LTUS:860:CALBIMAX") } record(ao, "QUAD:LTUS:860:CALBIMAX") { field(DESC, "Calibration Max Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(DRVH, "120.0") field(HOPR, "120.0") field(LOPR, "-120.0") field(DRVL, "-120.0") field(EGU, "A") field(VAL, "120.0") field(FLNK, "QUAD:LTUS:860:CALBSTEPNUM") } record(ao, "QUAD:LTUS:860:CALBIFINAL") { field(DESC, "Calibration Last Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(PREC, "3") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(VAL, "0") } record(longout, "QUAD:LTUS:860: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, "QUAD:LTUS:860:CALBIDELTA") } record(calc, "QUAD:LTUS:860:CALBIDELTA") { field(DESC, "Step size for CALB") field(CALC, "C=0?0:ABS((A-B)/C)") field(INPA, "QUAD:LTUS:860:CALBIMAX") field(INPB, "QUAD:LTUS:860:CALBIMIN") field(INPC, "QUAD:LTUS:860: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, "QUAD:LTUS:860:CALBIMULT") { field(DESC, "IACT vs ISETPT mult") field(CALC, "C#0||A=0?1:ABS(B/A)") field(INPA, "PSC:LTUS:MG20:ISETPT.DRVH") field(INPB, "PSC:LTUS:MG20:IACT.HOPR") field(INPC, "QUAD:LTUS:860:PSCONTROLLER.RVAL CPP") field(EGU, "A") field(PINI, "YES") } # SNL dbputs DAC values here. 6-10 steps are possible. record(waveform, "QUAD:LTUS:860:CALBICTRLWF") { field(DESC, "ICTRL setpoint array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") } record(waveform, "QUAD:LTUS:860:DACWF") { field(DESC, "DAC count array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:860:DACSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:860:DACSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "QUAD:LTUS:860: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, "QUAD:LTUS:860:CALCDACWF") { field(DESC, "Calc DAC counts array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:860:CALCDACSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:860:CALCDACSA") { field(DESC, "Calc DAC counts") field(DTYP, "Soft Channel") field(INP, "QUAD:LTUS:860: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, "QUAD:LTUS:860:CALBYWF") { field(DESC, "mx + b") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:860:CALBYSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:860:CALBYSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "QUAD:LTUS:860:CALBYWF") field(MALM, "10") field(NELM, "6") field(INDX, "0") field(FTVL, "DOUBLE") } record(waveform, "QUAD:LTUS:860:CALBIACTWF") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:860:CALBIACTSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:860:CALBIACTSA") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(MALM, "10") field(NELM, "6") field(INP, "QUAD:LTUS:860:CALBIACTWF") field(INDX, "0") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:860:CALBLIMITS") } # Check that measured current during calibration is within # tolerance. record(aSub, "QUAD:LTUS:860: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, "QUAD:LTUS:860:CALBSTEPNUM") field(INPB, "QUAD:LTUS:860:CALBIACTWF") field(INPC, "QUAD:LTUS:860: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, "QUAD:LTUS:860: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, "QUAD:LTUS:860:STDZITOL") field(INPH, "QUAD:LTUS:860:DACSLOPE") field(INPI, "QUAD:LTUS:860: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, "QUAD:LTUS:860: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, "QUAD:LTUS:860:CALBSTEPNUM") field(INPB, "QUAD:LTUS:860:CALBIACTWF") field(INPC, "QUAD:LTUS:860:DACWF") field(INPF, "QUAD:LTUS:860: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 QUAD:LTUS:860CALBOK 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, "QUAD:LTUS:860:DEGAUSINIT") { field(DESC, "Proc. Degauss PVs on boot") field(PINI, "YES") field(DOL, "1") field(OUTA, "QUAD:LTUS:860:DEGAUSIMIN.PROC PP") field(OUTB, "QUAD:LTUS:860:DEGAUSIMAX.PROC PP") field(OUTC, "QUAD:LTUS:860:DEGAUSTYPE.PROC PP") field(OUTD, "QUAD:LTUS:860:DEGAUSSTEP.PROC PP") field(OUTE, "QUAD:LTUS:860:MADNAME.PROC PP") field(OUTF, "QUAD:LTUS:860:PSTYPE.PROC PP") field(OUTG, "QUAD:LTUS:860: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, "QUAD:LTUS:860:DEGAUSSUB") { field(DESC, "Degauss subroutine") field(INAM, "mgntDegaussInit") field(SNAM, "mgntDegauss") field(BRSV, "INVALID") field(INPA, "QUAD:LTUS:860:DEGAUSIMIN NPP NMS") field(INPB, "QUAD:LTUS:860:DEGAUSIMAX NPP NMS") field(INPC, "QUAD:LTUS:860:DEGAUSTYPE.RVAL NPP NMS") field(INPE, "QUAD:LTUS:860:DEGAUSMETHOD.RVAL NPP NMS") field(INPF, "QUAD:LTUS:860:PSTYPE NPP NMS") field(INPG, "QUAD:LTUS:860:DEBUG.RVAL NPP NMS") field(INPH, "QUAD:LTUS:860: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, "QUAD:LTUS:860:DEGAUSWF PP") field(OUTB, "QUAD:LTUS:860:DEGAUSMSG PP") field(OUTC, "QUAD:LTUS:860: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, "QUAD:LTUS:860:DEGAUSWF") { field(DESC, "Degauss Setpts") field(NELM, "60") field(FTVL, "DOUBLE") } record(mbbo,"QUAD:LTUS:860: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, "QUAD:LTUS:860: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, "QUAD:LTUS:860: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, "QUAD:LTUS:860: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, "QUAD:LTUS:860: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, "QUAD:LTUS:860:DEGAUSIMIN") { field(DESC, "Min. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "120.0") field(LOPR, "-120.0") field(DRVH, "120.0") field(DRVL, "-120.0") field(VAL, "-120.0") } record(ao, "QUAD:LTUS:860:DEGAUSIMAX") { field(DESC, "Max. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "120.0") field(LOPR, "-120.0") field(DRVH, "120.0") field(DRVL, "-120.0") field(VAL, "120.0") } # 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,"QUAD:LTUS:860: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, "QUAD:LTUS:860: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,"QUAD:LTUS:860: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, "QUAD:LTUS:860: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, "QUAD:LTUS:860: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, "QUAD:LTUS:860: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, "QUAD:LTUS:860:DEGAUSTOD") { field(DESC, "Successful Degauss Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "QUAD:LTUS:860:DEGAUSLOSTTOD") { field(DESC, "Degauss Lost Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:860:DEGAUSTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "QUAD:LTUS:860:DEGAUSTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "QUAD:LTUS:860: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, "QUAD:LTUS:860:DEGAUSGO") { field(DESC, "Set bdes of btrms to zero") field(ASG, "Internal") field(OUTA, "") field(OUTB, "") field(OUTC, "") field(OUTD, "") } # =========== CRYO ONLY =========== record(bo, "QUAD:LTUS:860: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, "QUAD:LTUS:860:DEGAUS_IMAX_CHECK") { field(DESC, "Check if imax shoud chg") field(CALC, "(C==4)&&(ABS(B)>ABS(A))?1:0") field(INPA, "QUAD:LTUS:860:DEGAUS_IMAX") field(INPB, "QUAD:LTUS:860:ISETPT") field(INPC, "QUAD:LTUS:860:DEGAUSTYPE.RVAL") field(OUT, "QUAD:LTUS:860:DEGAUS_IMAX_UPDATE.SELN") field(FLNK, "QUAD:LTUS:860:DEGAUS_IMAX_UPDATE") } record(seq, "QUAD:LTUS:860:DEGAUS_IMAX_UPDATE") { field(DESC, "Degauss IMAX Update") field(SELM, "Specified") field(DOL1, "QUAD:LTUS:860:ISETPT") field(LNK1, "QUAD:LTUS:860:DEGAUS_IMAX PP") } # Set the maximum current after a successful # degauss. This pv is updated by the # sequence. record(ao, "QUAD:LTUS:860:DEGAUS_IMAX") { field(DESC, "Max I set afer a degauss") field(EGU, "Amps") field(PINI, "YES") field(PREC, "6") field(HOPR, "120.0") field(LOPR, "-120.0") field(DRVH, "120.0") field(DRVL, "-120.0") field(VAL, "120.0") field(FLNK, "QUAD:LTUS:860:DEGAUS_IMAXPOL_CHECK") info(autosaveFields,"VAL,RVAL") } # Set the polarity if degauss_imax record(calcout, "QUAD:LTUS:860:DEGAUS_IMAXPOL_CHECK") { field(DESC, "Determine polarity of imax") field(CALC, "A>=0?0:1") field(INPA, "QUAD:LTUS:860:DEGAUS_IMAX") field(FLNK, "QUAD:LTUS:860:DEGAUS_IMAXPOL") } record(bo, "QUAD:LTUS:860:DEGAUS_IMAXPOL") { field(DESC, "Polarity of imax I") field(DTYP, "Raw Soft Channel") field(DOL, "QUAD:LTUS:860:DEGAUS_IMAXPOL_CHECK") field(OMSL, "closed_loop") field(ZNAM, "Positive") field(ONAM, "Negative") field(FLNK, "QUAD:LTUS:860: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, "QUAD:LTUS:860:DEGAUS_ABSIMAX") { field(DESC, "Absolute Max. Degauss I") field(CALC, "ABS(A)") field(INPA, "QUAD:LTUS:860:DEGAUS_IMAX") field(PREC, "6") field(EGU, "Amps") field(HOPR, "120.0") field(LOPR, "-120.0") info(autosaveFields,"VAL RVAL") } # IACT Polarity record(calcout, "QUAD:LTUS:860:IACTPOL_CHECK") { field(DESC, "Determine IACT polarity") field(SCAN, "5 second") field(CALC, "ABS(A-B)>C?(A>=0?0:1):D") field(INPA, "QUAD:LTUS:860:IACT") field(INPB, "QUAD:LTUS:860:IACTPOL_CHECK.LA") field(INPC, "0.0001") field(INPD, "QUAD:LTUS:860:IACTPOL_CHECK.PVAL") field(OOPT, "On Change") field(FLNK, "QUAD:LTUS:860:IACTPOL") } record(bo, "QUAD:LTUS:860: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,"QUAD:LTUS:860: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, "QUAD:LTUS:860:DEGAUSENABLE CP") field(INPB, "QUAD:LTUS:860:DEGAUSOK") field(INPC, "QUAD:LTUS:860:STATE CP") field(INPD, "QUAD:LTUS:860:STATE.SEVR") field(OUT, "QUAD:LTUS:860:DEGAUS_STATE_SEQ.SELN PP") field(ASG, "Internal") } record(seq, "QUAD:LTUS:860:DEGAUS_STATE_SEQ") { field(DESC, "Degauss State Sequence") field(SELM, "Specified") field(SELL, "QUAD:LTUS:860:DEGAUS_STATE_CHECK") field(LNK1, "QUAD:LTUS:860:DEGAUS_STATE_DISABLE.PROC PP") field(LNK2, "QUAD:LTUS:860:DEGAUS_STATE_LOST.PROC PP") field(LNK3, "QUAD:LTUS:860:DEGAUS_STATE_GOOD.PROC PP") field(LNK4, "QUAD:LTUS:860: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, "QUAD:LTUS:860:DEGAUS_STATE_DISABLE") { field(DESC, "Degauss not used") field(LNK1, "QUAD:LTUS:860:DEGAUSOK.ZSV") field(LNK2, "QUAD:LTUS:860: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, "QUAD:LTUS:860:STATMSG.FRSV") field(LNK4, "QUAD:LTUS:860: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, "QUAD:LTUS:860:DEGAUS_STATE_LOST") { field(DESC, "Degauss lost and ps On") field(DOL1, "1") field(LNK1, "QUAD:LTUS:860:DEGAUSOK.ZSV") field(LNK2, "QUAD:LTUS:860: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, "QUAD:LTUS:860:STATMSG.FRSV") field(LNK4, "QUAD:LTUS:860: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, "QUAD:LTUS:860:DEGAUS_STATE_OFF") { field(DESC, "Degaused lost and ps Off") field(DOL1, "2") field(LNK1, "QUAD:LTUS:860: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, "QUAD:LTUS:860:STATMSG.FRSV") field(LNK3, "QUAD:LTUS:860: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, "QUAD:LTUS:860:DEGAUS_STATE_GOOD") { field(DESC, "Degauss good") field(DOL1, "1") field(LNK1, "QUAD:LTUS:860: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, "QUAD:LTUS:860:STATMSG.FRSV PP") field(LNK3, "QUAD:LTUS:860:STATMSG.FVSV PP") field(LNK4, "") field(ASG, "Internal") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(mbbo, "QUAD:LTUS:860:FUNC") { field(DESC, "QUAD:LTUS:860 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, "1") field(THVL, "9") field(FRVL, "10") field(FVVL, "0") field(SXVL, "2") field(SVVL, "8") field(EIVL, "11") field(NIVL, "12") field(TEVL, "13") field(ELVL, "5") field(TVVL, "6") field(TTVL, "7") field(FTVL, "4") field(FFVL, "3") field(OUT, "QUAD:LTUS:860:CTRL CA") } # :CTRL pv is processed at boot in the # sequence mgntCtrl.st Processed in sequence # record(mbbo, "QUAD:LTUS:860:CTRL") { field(DESC, "QUAD:LTUS:860 Control") field(PINI, "NO") field(ZRST, "Ready") field(ONST, "TRIM") field(TWST, "PERTURB") field(THST, "BCON_TO_BDES") field(FRST, "BACT_TO_BDES") field(FVST, "SAVE_BDES") field(SXST, "LOAD_BDES") field(SVST, "UNDO_BDES") field(EIST, "DAC_ZERO") field(NIST, "CALB") field(TEST, "STDZ") field(ELST, "RESET") field(TVST, "TURN_ON") field(TTST, "TURN_OFF") field(FTST, "") field(FFST, "") field(ZRVL, "0") field(ONVL, "2") field(TWVL, "6") field(THVL, "15") field(FRVL, "14") field(FVVL, "11") field(SXVL, "12") field(SVVL, "13") field(EIVL, "7") field(NIVL, "3") field(TEVL, "4") field(ELVL, "8") field(TVVL, "9") field(TTVL, "10") field(FTVL, "0") field(FFVL, "0") field(OUT, "QUAD:LTUS:860:SELECTEN.A PP") field(SDIS, "0") } # If a function has been selected set this unit to busy record(calcout, "QUAD:LTUS:860:SELECTEN") { field(DESC, "Control Select Enable") field(CALC, "A>0?1:A") field(FLNK, "QUAD:LTUS:860:BUSY") } # Set to FREE on IOC reboot record(bo, "QUAD:LTUS:860:BUSY") { field(DESC, "QUAD:LTUS:860 Ctrl Done") field(DOL, "QUAD:LTUS:860:SELECTEN") field(ZNAM, "FREE") field(ONAM, "BUSY") field(PINI, "YES") field(FLNK, "QUAD:LTUS:860:SELECT") } record(bo, "QUAD:LTUS:860:SELECT") { field(ZNAM, "NO") field(ONAM, "YES") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") } record(bo, "QUAD:LTUS:860: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, "QUAD:LTUS:860:CTRLSTATE") { field(DESC, "QUAD:LTUS:860 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("QUAD:LTUS:860:CTRL",20,20,0,0,"QUAD:LTUS:860:CTRL") #! Field("QUAD:LTUS:860:CTRL.OUT",16777215,1,"QUAD:LTUS:860:CTRL.OUT") #! Link("QUAD:LTUS:860:CTRL.OUT","QUAD:LTUS:860:SELECTEN.A") #! Field("QUAD:LTUS:860:CTRL.VAL",16777215,1,"QUAD:LTUS:860:CTRL.VAL") #! Record("QUAD:LTUS:860:SELECTEN",321,381,0,0,"QUAD:LTUS:860:SELECTEN") #! Field("QUAD:LTUS:860:SELECTEN.A",16777215,0,"QUAD:LTUS:860:SELECTEN.A") #! Field("QUAD:LTUS:860:SELECTEN.FLNK",16777215,1,"QUAD:LTUS:860:SELECTEN.FLNK") #! Link("QUAD:LTUS:860:SELECTEN.FLNK","QUAD:LTUS:860:BUSY") #! Field("QUAD:LTUS:860:SELECTEN.VAL",16777215,1,"QUAD:LTUS:860:SELECTEN.VAL") #! Record("QUAD:LTUS:860:BUSY",623,274,0,0,"QUAD:LTUS:860:BUSY") #! Field("QUAD:LTUS:860:BUSY.DOL",16777215,0,"QUAD:LTUS:860:BUSY.DOL") #! Link("QUAD:LTUS:860:BUSY.DOL","QUAD:LTUS:860:SELECTEN.VAL") #! Field("QUAD:LTUS:860:BUSY.FLNK",16777215,1,"QUAD:LTUS:860:BUSY.FLNK") #! Link("QUAD:LTUS:860:BUSY.FLNK","QUAD:LTUS:860:SELECT") #! Record("QUAD:LTUS:860:SELECT",669,508,0,1,"QUAD:LTUS:860:SELECT") #! Record("QUAD:LTUS:860:FUNC",940,120,0,0,"QUAD:LTUS:860:FUNC") #! Field("QUAD:LTUS:860:FUNC.OUT",16777215,0,"QUAD:LTUS:860:FUNC.OUT") #! Link("QUAD:LTUS:860:FUNC.OUT","QUAD:LTUS:860:CTRL.VAL") #! Record("QUAD:LTUS:860:ABORT",193,41,0,0,"QUAD:LTUS:860:ABORT") #! Record("QUAD:LTUS:860:CTRLSTATE",369,34,0,0,"QUAD:LTUS:860: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,"QUAD:LTUS:860:SELECT is used for Multi-device selection.\nIt is enabled when associated QUAD:LTUS:860:CTRL is \"0\" (DONE).\nIt is disabled when associated QUAD:LTUS:860: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,"QUAD:LTUS:860: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, "QUAD:LTUS:860:BCTRL_INIT") { field(DESC, "Process BCTRL on boot") field(PINI, "YES") field(CALC, "A=3?1:0") field(INPA, "QUAD:LTUS:860:BCTRL.SEVR") field(OUT, "QUAD:LTUS:860: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, "QUAD:LTUS:860:BACT") { field(DESC, "Actual B") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "QUAD:LTUS:860:BACT") field(INPB, "QUAD:LTUS:860:POLYCOEF") field(INPC, "QUAD:LTUS:860:POLYCOEF.A") field(INPD, "QUAD:LTUS:860:POLYCOEF.B") field(INPE, "QUAD:LTUS:860:IACT MS") field(INPF, "QUAD:LTUS:860:BDELTAS PP") field(INPG, "100") field(EGU, "kG") field(HOPR, "67.8484") field(LOPR, "-67.0752") field(HIHI, "67.8484") field(LOLO, "-67.0752") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "67.8484") field(LOW, "-67.0752") field(FLNK, "QUAD:LTUS:860: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, "QUAD:LTUS:860:BDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntPhyDeltas") field(EGU, "kG") field(HOPR, "1") field(PREC, "7") field(BRSV, "INVALID") field(INPA, "QUAD:LTUS:860:BDES") field(INPB, "QUAD:LTUS:860:TRIMBTOL") field(INPC, "QUAD:LTUS:860:TRIMBTOLR") field(INPD, "QUAD:LTUS:860:CHCKBTOL") field(INPE, "QUAD:LTUS:860:CHCKBTOLR") field(F, "2.0") field(INPG, "30") field(INPH, "QUAD:LTUS:860:BACT.VAL") # # MPS absolute and relative tolerances field(INPP, "QUAD:LTUS:860:MPSBTOL") field(INPQ, "QUAD:LTUS:860:MPSBTOLR") field(FLNK, "QUAD:LTUS:860:BCONLIMITS") info(autosaveFields,"F") } # This record is processed by BDELTAS record(aSub, "QUAD:LTUS:860:BCONLIMITS") { field(DESC, "Config B-field Limits") field(INAM, "mgntInit") field(SNAM, "mgntBCONLimits") field(INPA, "QUAD:LTUS:860:BDES") field(INPB, "QUAD:LTUS:860:BDELTAS.I") field(INPG, "QUAD:LTUS:860:DEBUG.RVAL") field(FTA, "DOUBLE") field(FTB, "DOUBLE") field(FTG, "ULONG") field(OUTA, "QUAD:LTUS:860:BCON.HIGH") field(OUTB, "QUAD:LTUS:860:BCON.LOW") field(OUTC, "QUAD:LTUS:860:BCON.HIHI") field(OUTD, "QUAD:LTUS:860:BCON.LOLO PP") field(FTVA, "DOUBLE") field(FTVB, "DOUBLE") field(FTVC, "DOUBLE") field(FTVD, "DOUBLE") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:860:IDELTAS") } # The following PV is processed by :BACT # which is processed by :BACT # record(fanout, "QUAD:LTUS:860:BACTFO") { field(DESC, "BACT processing") field(SELM, "All") field(LNK1, "QUAD:LTUS:860:BDIFF") field(LNK2, "QUAD:LTUS:860:BADIFF") field(LNK3, "QUAD:LTUS:860:BRATIO") field(LNK4, "QUAD:LTUS:860:MPSLIMITS") field(LNK5, "QUAD:LTUS:860:I2BSTATUS") field(LNK6, "QUAD:LTUS:860:IACTFO.PROC") } record(calc, "QUAD:LTUS:860:BDIFF") { field(DESC, "BDES-BACT") field(CALC, "A-B") field(INPA, "QUAD:LTUS:860:BDES") field(INPB, "QUAD:LTUS:860:BACT") field(EGU, "kG") field(PREC, "7") } record(calc, "QUAD:LTUS:860:BADIFF") { field(DESC, "Absolute BDES-BACT") field(INPA, "QUAD:LTUS:860:BDIFF") field(EGU, "kG") field(PREC, "7") field(CALC, "A<0?ABS(A):A") } record(calc, "QUAD:LTUS:860:BRATIO") { field(DESC, "BACT Error") field(CALC, "B?A/B:0") field(INPA, "QUAD:LTUS:860:BDIFF") field(INPB, "QUAD:LTUS:860:BDES.HOPR") field(EGU, "kG") field(PREC, "7") } record(mbbi, "QUAD:LTUS:860: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, "QUAD:LTUS:860:BACT.J") } # Note: for a string slave set the MONFL # macro to the following: # MONFL=:IMONCALC MS record(sub, "QUAD:LTUS:860:BMON") { field(DESC, "Second Transductor") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "QUAD:LTUS:860:BMON") field(INPB, "QUAD:LTUS:860:POLYCOEF") field(INPC, "QUAD:LTUS:860:POLYCOEF.A") field(INPD, "QUAD:LTUS:860:POLYCOEF.B") field(INPE, "QUAD:LTUS:860:IMON MS") field(INPF, "QUAD:LTUS:860:BDELTAS.VAL") field(INPG, "100") field(EGU, "kG") field(HOPR, "67.8484") field(LOPR, "-67.0752") field(HIHI, "67.8484") field(LOLO, "-67.0752") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "67.8484") field(LOW, "-67.0752") } # 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=PSC:LTUS:MG20:BDES CP record(ao, "QUAD:LTUS:860:BDES") { field(DESC, "Desired B-Field") field(PINI, "YES") field(DRVH, "67.8484") field(DRVL, "-67.0752") field(HOPR, "67.8484") field(LOPR, "-67.0752") field(PREC, "7") field(EGU, "kG") field(MDEL, "-1") field(OMSL, "supervisory") # field(DOL, "") field(OUT, "QUAD:LTUS:860:B2IDES PP") info(autosaveFields,"VAL") } record(sub, "QUAD:LTUS:860:B2IDES") { field(DESC, "Convert Desired B-Field to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:860:POLYCOEF") field(INPC, "QUAD:LTUS:860:POLYCOEF.A") field(INPD, "QUAD:LTUS:860:POLYCOEF.B") field(PREC, "7") field(EGU, "kG") field(HOPR, "67.8484") field(LOPR, "-67.0752") field(MDEL, "-1") field(INPE, "QUAD:LTUS:860:BDES.DRVH") field(INPF, "QUAD:LTUS:860:BDES.DRVL") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:860:IDES") } record(sub, "QUAD:LTUS:860:BNOM") { field(DESC, "Nominal Field") field(PINI, "YES") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:860:POLYCOEF") field(INPC, "QUAD:LTUS:860:POLYCOEF.A") field(INPD, "QUAD:LTUS:860:POLYCOEF.B") field(INPE, "QUAD:LTUS:860:BDES.DRVH") field(INPF, "QUAD:LTUS:860:BDES.DRVL") field(EGU, "kG") field(HOPR, "67.8484") field(LOPR, "-67.0752") field(PREC, "7") field(VAL, "0.0") field(FLNK, "QUAD:LTUS:860:INOM") } record(sub, "QUAD:LTUS:860:BACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:860:BDES.VAL") field(INPB, "QUAD:LTUS:860:BDES.DRVH") field(INPC, "QUAD:LTUS:860:BDES.DRVL") field(INPD, "QUAD:LTUS:860:BDELTAS.I") field(INPE, "QUAD:LTUS:860:BDELTAS.J") field(INPG, "QUAD:LTUS:860:STATE") field(INPH, "QUAD:LTUS:860:HSTA") field(EGU, "kG") field(HOPR, "67.8484") field(LOPR, "-67.0752") field(PREC, "7") field(BRSV, "INVALID") } record(sub, "QUAD:LTUS:860:BMONLIMITS") { field(DESC, "MON Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:860:BDES.VAL") field(INPB, "QUAD:LTUS:860:BDES.DRVH") field(INPC, "QUAD:LTUS:860:BDES.DRVL") field(INPD, "QUAD:LTUS:860:BDELTAS.K") field(INPE, "QUAD:LTUS:860:BDELTAS.L") field(INPG, "QUAD:LTUS:860:STATE") field(INPH, "QUAD:LTUS:860:HSTA") field(EGU, "kG") field(HOPR, "67.8484") field(LOPR, "-67.0752") field(PREC, "7") field(BRSV, "INVALID") } record(seq, "QUAD:LTUS:860:BLIMITS") { field(DESC, "ACT Limits") field(PREC, "7") field(DOL1, "QUAD:LTUS:860:BLIMITS") field(LNK1, "QUAD:LTUS:860:BACTLIMITS.F PP") field(DOL2, "QUAD:LTUS:860:BACTLIMITS.I") field(LNK2, "QUAD:LTUS:860:BACT.HIGH") field(DOL3, "QUAD:LTUS:860:BACTLIMITS.J") field(LNK3, "QUAD:LTUS:860:BACT.LOW") field(DOL4, "QUAD:LTUS:860:BACTLIMITS.K") field(LNK4, "QUAD:LTUS:860:BACT.HIHI") field(DOL5, "QUAD:LTUS:860:BACTLIMITS.L") field(LNK5, "QUAD:LTUS:860:BACT.LOLO") field(DOL6, "QUAD:LTUS:860:BLIMITS") field(LNK6, "QUAD:LTUS:860:BMONLIMITS.F PP") field(DOL7, "QUAD:LTUS:860:BMONLIMITS.I") field(LNK7, "QUAD:LTUS:860:BMON.HIGH") field(DOL8, "QUAD:LTUS:860:BMONLIMITS.J") field(LNK8, "QUAD:LTUS:860:BMON.LOW") field(DOL9, "QUAD:LTUS:860:BMONLIMITS.K") field(LNK9, "QUAD:LTUS:860:BMON.HIHI") field(DOLA, "QUAD:LTUS:860:BMONLIMITS.L") field(LNKA, "QUAD:LTUS:860:BMON.LOLO") field(FLNK, "QUAD:LTUS:860:ILIMITS") field(SCAN, "5 second") } record(ao, "QUAD:LTUS:860:BCTRL") { field(DESC, "B-Perturb") field(PREC, "7") field(EGU, "kG") field(DRVH, "67.8484") field(DRVL, "-67.0752") field(HOPR, "67.8484") field(LOPR, "-67.0752") # 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, "QUAD:LTUS:860: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, "QUAD:LTUS:860:BCTRLGO") { field(DESC, "Update DES and perturb") field(PREC, "7") # Disable BACT limits field(DOL1, "1") field(LNK1, "QUAD:LTUS:860:BLIMITS.VAL") # Update BDES with the BCTRL (slider) value field(DOL2, "QUAD:LTUS:860:BCTRL.VAL") field(LNK2, "QUAD:LTUS:860:BDES PP") field(DOL3, "1") field(LNK3, "QUAD:LTUS:860:IDIRECT.PROC PP") field(DOL4, "1") field(LNK4, "QUAD:LTUS:860:CHECKSTDZLOST.PROC PP") field(DOL5, "QUAD:LTUS:860:BCTRL.VAL") field(LNK5, "QUAD:LTUS:860:BCTRLSUB PP") # Re-enable BACT limits field(DOL6, "0") field(LNK6, "QUAD:LTUS:860:BLIMITS.VAL") } # Convert B-field to Current and output to ISETPT record(sub, "QUAD:LTUS:860:BCTRLSUB") { field(DESC, "Feedback") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:860:POLYCOEF") field(INPC, "QUAD:LTUS:860:POLYCOEF.A") field(INPD, "QUAD:LTUS:860:POLYCOEF.B") field(INPE, "QUAD:LTUS:860:BDES.DRVH") field(INPF, "QUAD:LTUS:860:BDES.DRVL") field(PREC, "7") field(EGU, "kG") field(HOPR, "67.8484") field(LOPR, "-67.0752") field(MDEL, "-1") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:860:ISETPT") } record(ao, "QUAD:LTUS:860:BDESPREVTRIM") { field(DESC, "trim bdes for undo") field(DTYP, "Soft Channel") field(DRVH, "67.8484") field(DRVL, "-67.0752") field(EGU, "kG") field(HOPR, "67.8484") field(LOPR, "-67.0752") field(PREC, "7") field(PINI, "YES") info(autosaveFields,"VAL") } record(stringin, "QUAD:LTUS:860:MADNAME") { field(DESC, "MAD deck nomenclature") field(PINI, "YES") field(VAL, "QUM3B") } record(ai, "QUAD:LTUS:860: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, "3551.307904") } record(ao, "QUAD:LTUS:860:BMAX") { field(DESC, "Max B-Field") field(DTYP, "Soft Channel") field(DRVH, "67.8484") field(DRVL, "-67.0752") field(EGU, "kG") field(HOPR, "67.8484") field(LOPR, "-67.0752") field(PREC, "7") field(PINI, "YES") field(VAL, "67.8484") field(FLNK, "QUAD:LTUS:860:BSTEP") } record(ao, "QUAD:LTUS:860:BMIN") { field(DESC, "Min B-Field") field(DTYP, "Soft Channel") field(DRVH, "67.8484") field(DRVL, "-67.0752") field(EGU, "kG") field(HOPR, "67.8484") field(LOPR, "-67.0752") field(PREC, "7") field(PINI, "YES") field(VAL, "-67.0752") field(FLNK, "QUAD:LTUS:860:BSTEP") } record(ao, "QUAD:LTUS:860:BDESSAVE") { field(DESC, "bdes for save/load") field(DTYP, "Soft Channel") field(DRVH, "67.8484") field(DRVL, "-67.0752") field(EGU, "kG") field(HOPR, "67.8484") field(LOPR, "-67.0752") field(PINI, "YES") field(PREC, "7") } # This record is processed by QUAD:LTUS:860: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, "QUAD:LTUS:860:BCON") { field(DESC, "Config B-Field ") field(DTYP, "Soft Channel") field(PREC, "7") field(EGU, "kG") field(HOPR, "67.8484") field(LOPR, "-67.0752") field(DRVH, "67.8484") field(DRVL, "-67.0752") # Set MINOR Alarm as the default, slaves will set NO_ALARM=0. field(HHSV, "MINOR") field(LLSV, "MINOR") field(HSV, "MINOR") field(LSV, "MINOR") # field(DOL , "") field(OMSL, "supervisory") field(OUT, "QUAD:LTUS:860:B2ICON PP") info(autosaveFields,"VAL") } record(sub, "QUAD:LTUS:860:B2ICON") { field(DESC, "Convert Desired ICon to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:860:POLYCOEF") field(INPC, "QUAD:LTUS:860:POLYCOEF.A") field(INPD, "QUAD:LTUS:860:POLYCOEF.B") field(PREC, "7") field(EGU, "kG") field(HOPR, "67.8484") field(LOPR, "-67.0752") field(MDEL, "-1") field(INPE, "QUAD:LTUS:860:BCON.DRVH") field(INPF, "QUAD:LTUS:860:BCON.DRVL") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:860: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, "QUAD:LTUS:860:BSTEP") { field(DESC, "B-Field step size") field(CALC, "(C==3)||(D==3)?0:ABS(A-B)*0.005") field(INPA, "QUAD:LTUS:860:BMAX") field(INPB, "QUAD:LTUS:860:BMIN") field(INPC, "QUAD:LTUS:860:BMIN.SEVR") field(INPD, "QUAD:LTUS:860:BMAX.SEVR") field(EGU, "kG") 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,"QUAD:LTUS:860:BCTRLDISABLECALC") { field(DESC, "Calc for disabling BCTRL") field(ASG, "Internal") field(CALC, "A?2:1") field(INPA, "QUAD:LTUS:860:ONLINE CP") field(OUT, "QUAD:LTUS:860:BCTRLDISABLEFOUT PP") } record(fanout, "QUAD:LTUS:860:BCTRLDISABLEFOUT") { field(DESC, "Disable BCTRL fanout") field(SELM, "Specified") field(SELL, "QUAD:LTUS:860:BCTRLDISABLECALC") field(LNK1, "QUAD:LTUS:860:BCTRLDISABLE") field(LNK2, "QUAD:LTUS:860:BCTRLENABLE") } record(stringout, "QUAD:LTUS:860:BCTRLDISABLE") { field(DESC, "Disable BCTRL") field(DTYP, "Soft Channel") field(OUT, "QUAD:LTUS:860:BCTRL.ASG") field(VAL, "NOWRITE") field(FLNK, "QUAD:LTUS:860:BCTRLDISV_UPDATE") } record(stringout, "QUAD:LTUS:860:BCTRLENABLE") { field(DESC, "Enable BCTRL") field(DTYP, "Soft Channel") field(OUT, "QUAD:LTUS:860:BCTRL.ASG") field(VAL, "") field(FLNK, "QUAD:LTUS:860:BCTRLDISV_UPDATE") } record(calcout, "QUAD:LTUS:860:BCTRLDISV_UPDATE") { field(DESC, "Calc for updating BCTRL.DISV") field(ASG, "Internal") field(CALC, "A") field(INPA, "QUAD:LTUS:860:ONLINE") field(OUT, "QUAD:LTUS:860: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,"QUAD:LTUS:860:BACT and MON\n are processed via links from \n QUAD:LTUS:860:IACT (device raw value readback 1)\n and\n QUAD:LTUS:860: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 QUAD:LTUS:860:POLYCOEF\nC = First polynomial coefficient (offset if linear)\nD = Second polynomial coefficient (slope if linear)\nE = QUAD:LTUS:860: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,"QUAD:LTUS:860:BDES\n is processed when set by CA users or \n QUAD:LTUS:860: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,"QUAD:LTUS:860: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 QUAD:LTUS:860: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 (QUAD:LTUS:860: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,"QUAD:LTUS:860:B*LIMITS and QUAD:LTUS:860:BLIMITS:\n Calculate alarm and warning limits based on \n deltas from QUAD:LTUS:860: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,"QUAD:LTUS:860: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,"QUAD:LTUS:860: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, "QUAD:LTUS:860: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, "QUAD:LTUS:860:MPSBTOL") { field(DESC, "Absolute mps tol") field(EGU, "kG") field(PREC, "2") field(CALC, "ABS(A)*0.02") field(INPA, "QUAD:LTUS:860:BMAX") field(PINI, "YES") } # # 21-Aug-2013: K. Luchini # Set channel access security so that users # cannot easily change values. record(ao, "QUAD:LTUS:860:MPSBMAX") { field(DESC, "MPS Max B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "67.8484") field(DRVL, "-67.0752") field(PINI, "YES") field(VAL, "67.8484") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:860:MPSBMIN") { field(DESC, "MPS Min B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "67.8484") field(DRVL, "-67.0752") field(PINI, "YES") field(VAL, "-67.0752") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:860:MPSBLLIM") { field(DESC, "MPS Low Limit B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "67.8484") field(DRVL, "-67.0752") field(PINI, "YES") field(VAL, "-67.0752") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:860:MPSBLLIM2") { field(DESC, "MPS Low Limit #2 B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "67.8484") field(DRVL, "-67.0752") field(PINI, "YES") field(VAL, "-67.0752") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } # Set the default to Std record(mbbo, "QUAD:LTUS:860: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, "QUAD:LTUS:860:MPSLIMITS.E PP") } record(aSub, "QUAD:LTUS:860: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, "QUAD:LTUS:860:MPS.RVAL") field(INPB, "QUAD:LTUS:860:BADIFF") field(INPC, "QUAD:LTUS:860:BDELTAS.N") field(INPD, "QUAD:LTUS:860:BACT") field(INPE, "QUAD:LTUS:860:MPSBITMASK.RVAL") field(INPF, "QUAD:LTUS:860:MPSBLLIM") field(INPG, "QUAD:LTUS:860:MPSBMIN") field(INPH, "QUAD:LTUS:860:MPSBMAX") field(INPI, "QUAD:LTUS:860: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, "QUAD:LTUS:860:INTOL.RVAL PP") field(OUTB, "QUAD:LTUS:860:INTOL_BMIN.RVAL PP") field(OUTC, "QUAD:LTUS:860:INTOL_BRANGE.RVAL PP") field(OUTD, "QUAD:LTUS:860: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, "QUAD:LTUS:860:INTOL") { field(DESC, "BACT within MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:860:MPSLIMITS.VALA") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "QUAD:LTUS:860:INTOL_BMIN") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:860:MPSLIMITS.VALB") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "QUAD:LTUS:860:INTOL_BMIN2") { field(DESC, "MPS tol #2") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:860:MPSLIMITS.VALD") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "QUAD:LTUS:860:INTOL_BRANGE") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:860: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, "QUAD:LTUS:860:CHCKITOL") { field(DESC, "Absolute Check I Tolerance") field(EGU, "A") field(FLNK, "QUAD:LTUS:860:TRIMITOL") field(CALC, "ABS(A*B)") field(INPA, "QUAD:LTUS:860:CHCKBTOL") field(INPB, "QUAD:LTUS:860:POLYCOEF.B") field(PREC, "9") } record(calc, "QUAD:LTUS:860:TRIMBTOL") { field(EGU, "kG") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(DESC, "Absolute Trim Tolerance") field(CALC, "ABS(A)/2") field(INPA, "QUAD:LTUS:860:CHCKBTOL") field(FLNK, "QUAD:LTUS:860:CHCKITOL") } record(calc, "QUAD:LTUS:860:CHCKBTOL") { field(DESC, "Check absolute tolerance") field(EGU, "A") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(FLNK, "QUAD:LTUS:860:TRIMBTOL") field(CALC, "MAX(ABS(A),ABS(C))*(B/1000000)") field(INPA, "QUAD:LTUS:860:BDES.HOPR") field(INPB, "QUAD:LTUS:860:STABILITY") field(INPC, "QUAD:LTUS:860:BDES.LOPR") } record(longout, "QUAD:LTUS:860: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, "QUAD:LTUS:860:CHCKBTOL") } record(calc, "QUAD:LTUS:860:TRIMITOL") { field(DESC, "Absolute Trim I Tolerance") field(EGU, "kG") field(CALC, "ABS(A*B)") field(INPA, "QUAD:LTUS:860:POLYCOEF.B") field(INPB, "QUAD:LTUS:860:TRIMBTOL") field(PREC, "9") } record(ai, "QUAD:LTUS:860:TRIMBTOLR") { field(DESC, "Relative trim tol") field(PREC, "4") field(EGU, "%") field(HOPR, "1.0") field(LOPR, "0.0") field(PINI, "YES") } record(ai, "QUAD:LTUS:860: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, "QUAD:LTUS:860:FBCKFCOM") { field(ZNAM, "CA") field(ONAM, "FCOM") field(DESC, "CA Mode") field(PINI, "YES") field(SDIS, "0") } record(bo, "QUAD:LTUS:860:PAU") { field(ZNAM, "NotConfigured") field(ONAM, "Configured") field(DESC, "PAU Present") field(PINI, "YES") field(SDIS, "0") field(FLNK, "QUAD:LTUS:860:PAUGO") } record(fanout, "QUAD:LTUS:860:PAUGO") { field(DESC, "PAU control") field(LNK1, "QUAD:LTUS:860:PAUSTOP") field(LNK2, "QUAD:LTUS:860: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, "QUAD:LTUS:860:PAUSTART") { field(DESC, "Setup for PAU On") field(SDIS, "QUAD:LTUS:860: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, "QUAD:LTUS:860:PAUSTOP") { field(DESC, "Setup for PAU Off") field(SDIS, "QUAD:LTUS:860: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, "QUAD:LTUS:860:MCORDEVNAME") { field(DESC, "PS device name") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, "PSC:LTUS:MG20:") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "QUAD:LTUS:860: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, "QUAD:LTUS:860:PSTYPE.RVAL") field(INPC, "QUAD:LTUS:860:TURNEDOFF.RVAL") field(INPD, "QUAD:LTUS:860:CONFIG.RVAL") field(INPE, "QUAD:LTUS:860:PSCATEGORY.RVAL") field(INPF, "QUAD:LTUS:860:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "QUAD:LTUS:860:AUTOCTRL.RVAL") field(INPJ, "QUAD:LTUS:860:OUTOFSERVICE.RVAL") field(INPL, "QUAD:LTUS:860:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "QUAD:LTUS:860:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "QUAD:LTUS:860:PAU") field(INPP, "QUAD:LTUS:860:CALBDISABLE.RVAL") field(INPQ, "QUAD:LTUS:860:PTRBDISABLE.RVAL") field(INPR, "QUAD:LTUS:860:TRIMDISABLE.RVAL") field(INPS, "QUAD:LTUS:860:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "QUAD:LTUS:860:FBCK") field(INPU, "QUAD:LTUS:860:TRIMTYPE.RVAL") field(INPV, "QUAD:LTUS:860:STDZDIRECT.RVAL") field(INPW, "QUAD:LTUS:860:DEGAUSENABLE.RVAL") field(FLNK, "QUAD:LTUS:860:HSTA") } record(longin, "QUAD:LTUS:860:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "QUAD:LTUS:860:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "QUAD:LTUS:860: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, "QUAD:LTUS:860: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, "QUAD:LTUS:860:CALBDISABLE") { field(DESC, "DAC Calb Disabled") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:860:PTRBDISABLE") { field(DESC, "Perturb Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:860:TRIMDISABLE") { field(DESC, "Trim Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:860: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 QUAD:LTUS:860:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses QUAD:LTUS:860:FBCK. # This PV should be replaced by QUAD:LTUS:860: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, "QUAD:LTUS:860: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, "QUAD:LTUS:860: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, "QUAD:LTUS:860: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, "") field(OMSL, "supervisory") field(FLNK, "QUAD:LTUS:860:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"QUAD:LTUS:860:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "QUAD:LTUS:860:OUTOFSERVICE NPP NMS") field(OUT, "QUAD:LTUS:860:ONLINE PP") } record(bo, "QUAD:LTUS:860:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "QUAD:LTUS:860: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, "1") } record(bo, "QUAD:LTUS:860: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, "1") } record(bo, "QUAD:LTUS:860: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, "QUAD:LTUS:860: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, "QUAD:LTUS:860: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, "QUAD:LTUS:860: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, "QUAD:LTUS:860: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, "QUAD:LTUS:860: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, "1") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:860: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, "1") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:860: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, "2") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:860: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, "0") field(ASG, "NOWRITE") field(FLNK, "QUAD:LTUS:860:TRIMTYPE") } record(stringout, "QUAD:LTUS:860:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "QUAD:LTUS:860:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "QUAD:LTUS:860:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "QUAD:LTUS:860:STATE.RVAL") field(INPB, "QUAD:LTUS:860:INTLKSUMY.RVAL") field(OUT, "QUAD:LTUS:860:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:LTUS:860: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, "QUAD:LTUS:860:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "QUAD:LTUS:860:STATE.RVAL") field(INPB, "QUAD:LTUS:860:INTLKSUMY.RVAL") field(OUT, "QUAD:LTUS:860:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:LTUS:860:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "QUAD:LTUS:860:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "QUAD:LTUS:860: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, "QUAD:LTUS:860:RAMPSTARTDLY") { field(DESC, "Tansition to ramp delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "2") } ######### For PSTYPE=2 Only ############# record(mbbo, "QUAD:LTUS:860: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, "QUAD:LTUS:860: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,"QUAD:LTUS:860: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("QUAD:LTUS:860:TURNEDOFF",3140,1907,0,1,"QUAD:LTUS:860:TURNEDOFF") #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "QUAD:LTUS:860:STATSUB") { field(DESC, "Build STATus ") field(INAM, "mgntInit") field(SNAM, "mgntSlcStat") field(INPA, "QUAD:LTUS:860:BACT.STAT") field(INPB, "QUAD:LTUS:860:BDES.STAT") field(INPC, "QUAD:LTUS:860:IRIPL.STAT") field(INPD, "PSC:LTUS:MG20:ISETPT.STAT") field(INPE, "PSC:LTUS:MG20:IACT.STAT") # 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, "QUAD:LTUS:860:BACT.SEVR") field(INPH, "QUAD:LTUS:860:BDES.SEVR") field(INPI, "QUAD:LTUS:860:IRIPL.SEVR") field(INPJ, "PSC:LTUS:MG20:ISETPT.SEVR") field(INPK, "PSC:LTUS:MG20:IACT.SEVR") # # 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, "QUAD:LTUS:860:STATE.RVAL") field(INPN, "QUAD:LTUS:860:STDZOK") field(INPO, "QUAD:LTUS:860:CALBOK") field(INPP, "QUAD:LTUS:860:OUTOFSERVICE.RVAL") field(INPQ, "QUAD:LTUS:860:CONFIG.RVAL") field(INPR, "QUAD:LTUS:860:HSTA") field(INPS, "QUAD:LTUS:860:CTRL.RVAL") field(INPT, "QUAD:LTUS:860:DEGAUSOK") field(INPV, "QUAD:LTUS:860: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, "QUAD:LTUS:860:STAT") } record(longout, "QUAD:LTUS:860:STAT") { field(DESC, "STAT sent to SLC") field(SCAN, "Passive") field(FLNK, "QUAD:LTUS:860:STATCTRLSUB") field(DOL, "QUAD:LTUS:860:STATSUB.VAL") field(OMSL, "closed_loop") } record(sSub, "QUAD:LTUS:860:STATCTRLSUB") { field(DESC, "Decode SLC STAT into mbbo") field(INAM, "mgntInit") field(SNAM, "mgntStatDecode") field(INPA, "QUAD:LTUS:860:STAT") field(INPB, "QUAD:LTUS:860:HSTA") field(INPD, "QUAD:LTUS:860:ONOFFCTRL.RVAL") field(FLNK, "QUAD:LTUS:860:STATMSG") } record(mbbo, "QUAD:LTUS:860: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, "QUAD:LTUS:860:UNAVAILGO") field(DOL, "QUAD:LTUS:860:STATCTRLSUB.W") } record(seq, "QUAD:LTUS:860:UNAVAILGO") { field(DESC, "Process UNAVAIL") field(DOL1, "QUAD:LTUS:860:STATSUB.U") field(LNK1, "QUAD:LTUS:860:UNAVAIL PP") } record(stringout, "QUAD:LTUS:860:SNLSTATMSG") { field(DTYP, "Soft Channel") } #! TextBox(TB0,820,1000,1200,1220,0,"Dialog",12,1,16777215,"QUAD:LTUS:860:STATUSSUB - future\nOverall device status - takes input from action snls, record sevrs, master snl(s) and outputs final status\n\nInputs:\nA - QUAD:LTUS:860:CTRLSTATUS - snl status\nB - MGNT:CTRLSTATUS - master list status\nC\nD - QUAD:LTUS:860: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,"QUAD:LTUS:860STATSUB\nformat control bo's into slc STAT\n\nInputs:\nA - QUAD:LTUS:860:STATUS\nC - QUAD:LTUS:860:ON\nD - QUAD:LTUS:860:STDZOK\nE - QUAD:LTUS:860:CALBOK\nF - QUAD:LTUS:860:BACTDRIFT (future)\nG -\nH- QUAD:LTUS:860:DACSTATUS\nI -QUAD:LTUS:860:ADCSTATUS\nJ - QUAD:LTUS:860:BACTSTATUS\nK - QUAD:LTUS:860:BDESSTATUS\nL - QUAD:LTUS:860:RIPLSTATUS\n\nOutput:\nP - QUAD:LTUS:860: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, "QUAD:LTUS:860: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, "QUAD:LTUS:860: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, "QUAD:LTUS:860: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, "QUAD:LTUS:860: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.6 #! DBDSTART #! DBD("../../../../dbd/mgntSoft.dbd") #! DBDEND record(stringout, "QUAD:LTUS:860:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:860:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "QUAD:LTUS:860:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "QUAD:LTUS:860:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "QUAD:LTUS:860:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "QUAD:LTUS:860:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "1") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "QUAD:LTUS:860: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, "QUAD:LTUS:860:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "QUAD:LTUS:860:TRIMTYPE.RVAL") field(INPB, "QUAD:LTUS:860:CONFIG.RVAL") field(OUT, "QUAD:LTUS:860:TRIMMAXNUM PP") } record(longout, "QUAD:LTUS:860: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, "QUAD:LTUS:860: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, "") field(OMSL, "supervisory") field(VAL, "20") field(OUT, "QUAD:LTUS:860:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "QUAD:LTUS:860: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, "") field(OMSL, "supervisory") field(VAL, "10") } record(bo, "QUAD:LTUS:860: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, "QUAD:LTUS:860: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, "QUAD:LTUS:860: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, "QUAD:LTUS:860:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "0") } record(ao, "QUAD:LTUS:860: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, "QUAD:LTUS:860:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "QUAD:LTUS:860: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, "QUAD:LTUS:860: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, "QUAD:LTUS:860:IMOVE") field(INPB, "QUAD:LTUS:860:IACT") field(INPC, "QUAD:LTUS:860:IRAMPRATE") field(INPD, "1.577") field(INPE, "QUAD:LTUS:860:TRIMDLYPCT") field(INPF, "QUAD:LTUS:860:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "QUAD:LTUS:860:RAMPTIME_LEFT PP") } record(longout, "QUAD:LTUS:860:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "QUAD:LTUS:860:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "QUAD:LTUS:860:RAMPDONE_CALC") } record(calc, "QUAD:LTUS:860:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "QUAD:LTUS:860:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "QUAD:LTUS:860:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "QUAD:LTUS:860: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, "QUAD:LTUS:860:RAMPTIME_LEFT") field(OUT, "QUAD:LTUS:860:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "QUAD:LTUS:860:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "QUAD:LTUS:860:RAMPTIME_LEFT NMS") field(OUT, "QUAD:LTUS:860:RAMPDONE PP") } record(bo, "QUAD:LTUS:860:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "QUAD:LTUS:860:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "QUAD:LTUS:860: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, "QUAD:LTUS:860: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(sSub, "QUAD:LTUS:860: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, "QUAD:LTUS:860:PSTYPE.RVAL") field(INPC, "QUAD:LTUS:860:TURNEDOFF.RVAL") field(INPD, "QUAD:LTUS:860:CONFIG.RVAL") field(INPE, "QUAD:LTUS:860:PSCATEGORY.RVAL") field(INPF, "QUAD:LTUS:860:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "QUAD:LTUS:860:AUTOCTRL.RVAL") field(INPJ, "QUAD:LTUS:860:OUTOFSERVICE.RVAL") field(INPL, "QUAD:LTUS:860:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "QUAD:LTUS:860:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "QUAD:LTUS:860:PAU") field(INPP, "QUAD:LTUS:860:CALBDISABLE.RVAL") field(INPQ, "QUAD:LTUS:860:PTRBDISABLE.RVAL") field(INPR, "QUAD:LTUS:860:TRIMDISABLE.RVAL") field(INPS, "QUAD:LTUS:860:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "QUAD:LTUS:860:FBCK") field(INPU, "QUAD:LTUS:860:TRIMTYPE.RVAL") field(INPV, "QUAD:LTUS:860:STDZDIRECT.RVAL") field(INPW, "QUAD:LTUS:860:DEGAUSENABLE.RVAL") field(FLNK, "QUAD:LTUS:860:HSTA") } record(longin, "QUAD:LTUS:860:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "QUAD:LTUS:860:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "QUAD:LTUS:860: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, "QUAD:LTUS:860: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, "QUAD:LTUS:860:CALBDISABLE") { field(DESC, "DAC Calb Disabled") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:860:PTRBDISABLE") { field(DESC, "Perturb Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:860:TRIMDISABLE") { field(DESC, "Trim Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:860:STDZDISABLE") { field(DTYP, "Raw Soft Channel") field(ZNAM, "NO") field(ONAM, "YES") field(DESC, "Standardize Function") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } # This PV has been replaced by QUAD:LTUS:860:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses QUAD:LTUS:860:FBCK. # This PV should be replaced by QUAD:LTUS:860: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, "QUAD:LTUS:860: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, "QUAD:LTUS:860: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, "QUAD:LTUS:860: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, "") field(OMSL, "supervisory") field(FLNK, "QUAD:LTUS:860:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"QUAD:LTUS:860:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "QUAD:LTUS:860:OUTOFSERVICE NPP NMS") field(OUT, "QUAD:LTUS:860:ONLINE PP") } record(bo, "QUAD:LTUS:860:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "QUAD:LTUS:860: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, "1") } record(bo, "QUAD:LTUS:860: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, "1") } record(bo, "QUAD:LTUS:860: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, "QUAD:LTUS:860: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, "QUAD:LTUS:860: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, "QUAD:LTUS:860: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, "QUAD:LTUS:860: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, "QUAD:LTUS:860: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, "1") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:860: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, "1") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:860: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, "2") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:860: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, "0") field(ASG, "NOWRITE") field(FLNK, "QUAD:LTUS:860:TRIMTYPE") } record(stringout, "QUAD:LTUS:860:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "QUAD:LTUS:860:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "QUAD:LTUS:860:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "QUAD:LTUS:860:STATE.RVAL") field(INPB, "QUAD:LTUS:860:INTLKSUMY.RVAL") field(OUT, "QUAD:LTUS:860:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:LTUS:860: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, "QUAD:LTUS:860:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "QUAD:LTUS:860:STATE.RVAL") field(INPB, "QUAD:LTUS:860:INTLKSUMY.RVAL") field(OUT, "QUAD:LTUS:860:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:LTUS:860:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "QUAD:LTUS:860:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "QUAD:LTUS:860: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, "QUAD:LTUS:860:RAMPSTARTDLY") { field(DESC, "Tansition to ramp delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "2") } ######### For PSTYPE=2 Only ############# record(mbbo, "QUAD:LTUS:860: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, "QUAD:LTUS:860: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,"QUAD:LTUS:860: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("QUAD:LTUS:860:TURNEDOFF",3140,1907,0,1,"QUAD:LTUS:860:TURNEDOFF") #! 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, "QUAD:LTUS:880:IACT") { field(DESC, "Current") field(INP, "PSC:LTUS:MG21:IACT") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "QUAD:LTUS:880:BACT") info(autosaveFields,"HYST") } record(bi, "QUAD:LTUS:880:STATE") { field(DESC, "PS On/Off Status") field(DTYP, "Raw Soft Channel") field(INP, "PSC:LTUS:MG21:STATE NPP MS") field(ZSV, "MAJOR") field(ZNAM, "OFF") field(ONAM, "ON") } record(ao, "QUAD:LTUS:880:IDES") { field(DESC, "Desired Current") field(PREC, "3") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(MDEL, "-1") field(HIHI, "120.0") field(LOLO, "-120.0") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "QUAD:LTUS:880:BDELTAS") field(DRVH, "120.0") field(DRVL, "-120.0") field(DOL, "QUAD:LTUS:880: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, "QUAD:LTUS:880:ICTRL PP") } # This record is processed by QUAD:LTUS:880:ICON") # Note: we are not setting alarms here. record(ao, "QUAD:LTUS:880:ICON") { field(DESC, "Config I") field(DTYP, "Soft Channel") field(PREC, "3") field(HOPR, "120.0") field(LOPR, "-120.0") field(DRVH, "120.0") field(DRVL, "-120.0") field(DOL, "QUAD:LTUS:880:B2ICON.K") field(OMSL, "closed_loop") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:880:INOM") { field(DESC, "Nominal Current") field(DOL, "QUAD:LTUS:880:BNOM.K") field(OMSL, "closed_loop") field(PREC, "3") field(EGU, "A") field(DRVH, "120.0") field(DRVL, "-120.0") field(HOPR, "120.0") field(LOPR, "-120.0") } record(ao, "QUAD:LTUS:880:ICTRL") { field(DESC, "Set Current") field(PREC, "3") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(DRVH, "120.0") field(DRVL, "-120.0") field(MDEL, "-1") field(FLNK, "QUAD:LTUS:880:ICTRLGO") field(OMSL, "supervisory") info(autosavefields,"VAL") } record(seq, "QUAD:LTUS:880:ICTRLGO") { field(DESC, "Process Current Setpoint") field(PREC, "3") # Set ISETPT to supervisory field(DOL1, "0") field(LNK1, "QUAD:LTUS:880:ISETPT.OMSL") field(DOL2, "QUAD:LTUS:880:ICTRL") field(LNK2, "QUAD:LTUS:880:ISETPT PP") # Set ISETPT to closed loop - get data from BCTRLSUB.K field(DOL3, "1") field(LNK3, "QUAD:LTUS:880:ISETPT.OMSL") } record(ao, "QUAD:LTUS:880:IMAX") { field(DESC, "Max I") field(DTYP, "Soft Channel") field(DRVH, "120.0") field(DRVL, "-120.0") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(PREC, "3") field(PINI, "YES") field(VAL, "120.0") field(FLNK, "QUAD:LTUS:880:IMIN") } record(ao, "QUAD:LTUS:880:IMIN") { field(DESC, "Min I") field(DTYP, "Soft Channel") field(DRVH, "120.0") field(DRVL, "-120.0") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(PREC, "3") field(VAL, "-120.0") field(FLNK, "QUAD:LTUS:880:IRANGE") } record(sel, "QUAD:LTUS:880:IACTPREVOK") { field(DESC, "Last Good Current") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(PREC, "3") field(NVL, "QUAD:LTUS:880:BACT.SEVR") field(INPA, "QUAD:LTUS:880:IACT NPP MS") field(INPB, "QUAD:LTUS:880:IACTPREVOK NPP MS") field(INPC, "QUAD:LTUS:880:IACTPREVOK NPP MS") field(INPD, "QUAD:LTUS:880:IACTPREVOK NPP MS") } record(sub, "QUAD:LTUS:880:IACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:880:IDES") field(INPB, "QUAD:LTUS:880:ISETPT.DRVH") field(INPC, "QUAD:LTUS:880:ISETPT.DRVL") field(INPD, "QUAD:LTUS:880:IDELTAS.I") field(INPE, "QUAD:LTUS:880:IDELTAS.J") field(INPG, "QUAD:LTUS:880:STATE") field(INPH, "QUAD:LTUS:880:HSTA") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(PREC, "3") field(BRSV, "INVALID") } record(sub, "QUAD:LTUS:880:IMONLIMITS") { field(DESC, "Aux Current Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:880:IDES") field(INPB, "QUAD:LTUS:880:ISETPT.DRVH") field(INPC, "QUAD:LTUS:880:ISETPT.DRVL") field(INPD, "QUAD:LTUS:880:IDELTAS.K") field(INPE, "QUAD:LTUS:880:IDELTAS.L") field(INPG, "QUAD:LTUS:880:STATE") field(INPH, "QUAD:LTUS:880:HSTA") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(PREC, "3") field(BRSV, "INVALID") } record(seq, "QUAD:LTUS:880:ILIMITS") { field(DESC, "Set ACT and MON Limits") field(PREC, "3") field(DOL1, "QUAD:LTUS:880:BLIMITS") field(LNK1, "QUAD:LTUS:880:IACTLIMITS.F PP") field(DOL2, "QUAD:LTUS:880:IACTLIMITS.I") field(LNK2, "QUAD:LTUS:880:IACT.HIGH") field(DOL3, "QUAD:LTUS:880:IACTLIMITS.J") field(LNK3, "QUAD:LTUS:880:IACT.LOW") field(DOL4, "QUAD:LTUS:880:IACTLIMITS.K") field(LNK4, "QUAD:LTUS:880:IACT.HIHI") field(DOL5, "QUAD:LTUS:880:IACTLIMITS.L") field(LNK5, "QUAD:LTUS:880:IACT.LOLO") field(DOL6, "QUAD:LTUS:880:BLIMITS") field(LNK6, "QUAD:LTUS:880:IMONLIMITS.F PP") field(DOL7, "QUAD:LTUS:880:IMONLIMITS.I") field(LNK7, "QUAD:LTUS:880:IMON.HIGH") field(DOL8, "QUAD:LTUS:880:IMONLIMITS.J") field(LNK8, "QUAD:LTUS:880:IMON.LOW") field(DOL9, "QUAD:LTUS:880:IMONLIMITS.K") field(LNK9, "QUAD:LTUS:880:IMON.HIHI") field(DOLA, "QUAD:LTUS:880:IMONLIMITS.L") field(LNKA, "QUAD:LTUS:880: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, "QUAD:LTUS:880:IDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntRawDeltas") field(INPD, "QUAD:LTUS:880:TRIMBTOL") field(INPE, "QUAD:LTUS:880:CHCKBTOL") field(INPF, "QUAD:LTUS:880:BDELTAS.K") field(INPG, "QUAD:LTUS:880:BDELTAS.L") field(INPH, "QUAD:LTUS:880: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, "QUAD:LTUS:880:STDZITOLR") field(INPC, "QUAD:LTUS:880:STDZITOL") field(FLNK, "") } # All ps controllers with on/off control will set the macro ONOF # as follows: # # ONOF = PSC:LTUS:MG21: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, "QUAD:LTUS:880:STATESETPT") { field(DESC, "PS On/Off") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFF") field(ONAM, "ON") field(OUT, "PSC:LTUS:MG21:STATESETPT PP") 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 = PSC:LTUS:MG21:RESET PP # record(bo, "QUAD:LTUS:880:RESET") { field(DESC, "Interlock Latch Reset") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFF") field(ONAM, "ON") field(HIGH, "1.0") field(OUT, "PSC:LTUS:MG21:RESET PP") } record(bo, "QUAD:LTUS:880:RAMPSTATE") { field(DESC, "PS Ramp Status") field(DTYP, "Soft Channel") field(DOL, "PSC:LTUS:MG21:RAMPSTATE NPP 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, "QUAD:LTUS:880: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, "QUAD:LTUS:880:TRIMRAMPRATE") field(OUT, "PSC:LTUS:MG21:IRAMPRATE PP") field(FLNK, "QUAD:LTUS:880:STDZDLY") } record(ao, "QUAD:LTUS:880:ISETPT") { field(DESC, "Current Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(DRVH, "120.0") field(DRVL, "-120.0") field(MDEL, "-1") field(OUT, "PSC:LTUS:MG21:ISETPT PP") field(DOL, "QUAD:LTUS:880: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, "QUAD:LTUS:880:IMON") { field(DESC, "Aux Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(INP, "PSC:LTUS:MG21:IMON") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "QUAD:LTUS:880:BMON") } record(ao, "QUAD:LTUS:880:IRIPL") { field(DESC, "Ripple Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(DOL, "PSC:LTUS:MG21:IRIPL NPP NMS") field(OMSL, "closed_loop") field(EGU, "A") field(DRVH, "1.0") field(HOPR, "1.0") field(PREC, "3") field(FLNK, "QUAD:LTUS:880:IRIPLOK") } record(sub, "QUAD:LTUS:880:IRIPLOK") { field(DESC, "Ripple Current Status") field(INAM, "mgntInit") field(SNAM, "mgntRiplOK") field(INPA, "QUAD:LTUS:880:IRIPL.VAL") field(INPB, "QUAD:LTUS:880: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, "QUAD:LTUS:880:R") { field(DESC, "Resistance") field(EGU, "Ohms") field(PREC, "4") field(PINI, "YES") field(DOL, "PSC:LTUS:MG21:R NPP MS") 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, "QUAD:LTUS:880:IGND") { field(DESC, "Ground Current") field(EGU, "A") field(PREC, "6") field(PINI, "YES") field(DOL, "PSC:LTUS:MG21:IGND NPP MS") field(OMSL, "closed_loop") } record(bi, "QUAD:LTUS:880:INTLKSUMY") { field(DESC, "Interlock Summary") field(INP, "PSC:LTUS:MG21:INTLKSUMY NPP MS") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(ZNAM, "OK") field(ONAM, "FAULT") field(PINI, "NO") } record(mbbo, "QUAD:LTUS:880: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, "PSC:LTUS:MG21:COOLING") field(OMSL, "closed_loop") } # The following PV is processed by :BACTFO # which is processed by :BACT record(fanout, "QUAD:LTUS:880:IACTFO") { field(DESC, "IACT processing") field(SELM, "All") field(LNK1, "QUAD:LTUS:880:IACTPREVOK") field(LNK2, "QUAD:LTUS:880:IDIFF") field(LNK3, "QUAD:LTUS:880:IADIFF") field(LNK4, "QUAD:LTUS:880:IRATIO") field(LNK5, "QUAD:LTUS:880:IDIRECT") field(LNK6, "QUAD:LTUS:880:IACTPOL_CHECK") } record(calc, "QUAD:LTUS:880:IDIFF") { field(DESC, "IDES-IACT") field(CALC, "A-B") field(INPA, "QUAD:LTUS:880:IDES") field(INPB, "QUAD:LTUS:880:IACT") field(EGU, "A") field(PREC, "9") field(HOPR, "120.0") field(LOPR, "-120.0") } record(calc, "QUAD:LTUS:880:IADIFF") { field(DESC, "Absolute IDES-IACT") field(CALC, "A<0?ABS(A):A") field(INPA, "QUAD:LTUS:880:IDIFF") field(PREC, "9") } record(calc, "QUAD:LTUS:880:IRATIO") { field(DESC, "IDES-IACT/IMAX") field(CALC, "B?A/B:0") field(INPA, "QUAD:LTUS:880:IDIFF") field(INPB, "QUAD:LTUS:880:IDES.DRVH") field(PREC, "9") } record(calcout, "QUAD:LTUS:880:IRANGE") { field(DESC, "Current Range") field(PINI, "YES") field(CALC, "ABS(A-B)") field(INPA, "QUAD:LTUS:880:IMIN") field(INPB, "QUAD:LTUS:880: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, "QUAD:LTUS:880: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, "QUAD:LTUS:880:IACT") field(FLNK, "QUAD:LTUS:880:IACTPOL") } record(bo, "QUAD:LTUS:880:IACTPOL") { field(DESC, "Actual I Polarity") field(DTYP, "Raw Soft Channel") field(DOL, "QUAD:LTUS:880: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,"QUAD:LTUS:880:I*LIMITS:\n Calculate alarm and warning limits based on \n deltas from QUAD:LTUS:880:IDELTAS and the\n QUAD:LTUS:880: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,"QUAD:LTUS:880:IACT: \n Get copy of QUAD:LTUS:880:I. \n",null) #! TextBox(TB12,1280,3100,1760,3200,0,"Dialog",12,1,16777215,"QUAD:LTUS:880: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,"QUAD:LTUS:880:IDES:\n Contains raw value calculated by \nQUAD:LTUS:880: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 \nQUAD:LTUS:880:BDELTAS.\n",null) #! TextBox(TB10,56,1940,316,2340,0,"Dialog",12,1,16777215,"QUAD:LTUS:880: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 QUAD:LTUS:880: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 QUAD:LTUS:880: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,"QUAD:LTUS:880:ISETPT:\n Sets the hardware. When fast feedback is set on, this record is\n set to closed loop mode by QUAD:LTUS:880:FBCKSTART sequence. When \n the loop is closed, this record takes input calculated by \n BFBCK only. When fast feedback is set off, QUAD:LTUS:880:FBCKSTOP \n will set it back to supervisory so that the value can be set by \n QUAD:LTUS:880: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, "QUAD:LTUS:880:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:880:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "QUAD:LTUS:880:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "QUAD:LTUS:880:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "QUAD:LTUS:880:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "QUAD:LTUS:880:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "1") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "QUAD:LTUS:880: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, "QUAD:LTUS:880:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "QUAD:LTUS:880:TRIMTYPE.RVAL") field(INPB, "QUAD:LTUS:880:CONFIG.RVAL") field(OUT, "QUAD:LTUS:880:TRIMMAXNUM PP") } record(longout, "QUAD:LTUS:880: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, "QUAD:LTUS:880: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, "") field(OMSL, "supervisory") field(VAL, "10") field(OUT, "QUAD:LTUS:880:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "QUAD:LTUS:880: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, "") field(OMSL, "supervisory") field(VAL, "10") } record(bo, "QUAD:LTUS:880: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, "QUAD:LTUS:880: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, "QUAD:LTUS:880: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, "QUAD:LTUS:880:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "0") } record(ao, "QUAD:LTUS:880: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, "QUAD:LTUS:880:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "QUAD:LTUS:880: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, "QUAD:LTUS:880: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, "QUAD:LTUS:880:IMOVE") field(INPB, "QUAD:LTUS:880:IACT") field(INPC, "QUAD:LTUS:880:IRAMPRATE") field(INPD, "1.577") field(INPE, "QUAD:LTUS:880:TRIMDLYPCT") field(INPF, "QUAD:LTUS:880:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "QUAD:LTUS:880:RAMPTIME_LEFT PP") } record(longout, "QUAD:LTUS:880:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "QUAD:LTUS:880:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "QUAD:LTUS:880:RAMPDONE_CALC") } record(calc, "QUAD:LTUS:880:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "QUAD:LTUS:880:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "QUAD:LTUS:880:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "QUAD:LTUS:880: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, "QUAD:LTUS:880:RAMPTIME_LEFT") field(OUT, "QUAD:LTUS:880:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "QUAD:LTUS:880:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "QUAD:LTUS:880:RAMPTIME_LEFT NMS") field(OUT, "QUAD:LTUS:880:RAMPDONE PP") } record(bo, "QUAD:LTUS:880:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "QUAD:LTUS:880:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "QUAD:LTUS:880: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, "QUAD:LTUS:880: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, "QUAD:LTUS:880:STDZINIT") { field(DESC, "Proc. Stdz PVs on boot") field(PINI, "YES") field(DOL1, "1") field(DOL2, "1") field(DOL3, "1") field(LNK1, "QUAD:LTUS:880:DEBUG.PROC PP") field(LNK2, "QUAD:LTUS:880:STDZCYCLENUM.PROC PP") field(LNK3, "QUAD:LTUS:880:STDZDISABLE.PROC PP") field(LNK4, "QUAD:LTUS:880: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, "QUAD:LTUS:880:STDZSUB") { field(DESC, "Stdz subroutine") field(INAM, "mgntStdzInit") field(SNAM, "mgntStdz") field(BRSV, "INVALID") field(INPA, "QUAD:LTUS:880:STDZIMIN NPP NMS") field(INPB, "QUAD:LTUS:880:STDZIMAX NPP NMS") field(INPC, "QUAD:LTUS:880:STDZIFINAL NPP NMS") field(INPD, "QUAD:LTUS:880:STDZCYCLENUM NPP NMS") field(INPE, "QUAD:LTUS:880:STDZDIRECT.RVAL NPP NMS") field(INPF, "QUAD:LTUS:880:STDZDISABLE.RVAL CPP NMS") field(INPG, "QUAD:LTUS:880: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, "QUAD:LTUS:880:STDZWF PP") field(OUTB, "QUAD:LTUS:880: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, "QUAD:LTUS:880:STDZWF") } record(mbbo, "QUAD:LTUS:880: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, "QUAD:LTUS:880: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, "QUAD:LTUS:880:STDZMAINPS") { field(DESC, "Stdz by main or self") field(PINI, "YES") field(DTYP, "Soft Channel") field(ZNAM, "SELF") field(ONAM, "MAIN") } record(bo, "QUAD:LTUS:880: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, "QUAD:LTUS:880: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, "QUAD:LTUS:880: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, "QUAD:LTUS:880:STDZTOD") { field(DESC, "Successful Standardize Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "QUAD:LTUS:880:STDZLOSTTOD") { field(DESC, "Standardize Lost Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(longout, "QUAD:LTUS:880:STDZCYCLECNT") { field(DESC, "Cycle Count") field(PINI, "YES") } record(longout, "QUAD:LTUS:880:STDZCYCLENUM") { field(DESC, "No. Standardize Cycles") field(VAL, "3") field(HOPR, "10") field(LOPR, "0") field(DRVH, "10") field(DRVL, "0") field(PINI, "YES") field(FLNK, "QUAD:LTUS:880:STDZDIRECT") } # The default standardize direction is "UP" for # all LCLS Magnets.. record(bo, "QUAD:LTUS:880:STDZDIRECT") { field(DESC, "Standardize Direction ") field(ZNAM, "UP") field(ONAM, "DOWN") field(VAL, "0") field(FLNK, "QUAD:LTUS:880:STDZIMIN") } record(ao, "QUAD:LTUS:880:STDZIMIN") { field(DESC, "Min-STDZ Current") field(PREC, "1") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(VAL, "-120.0") field(FLNK, "QUAD:LTUS:880:STDZIMAX") } record(ao, "QUAD:LTUS:880:STDZIMAX") { field(DESC, "Max. Standarize Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(VAL, "120.0") field(FLNK, "QUAD:LTUS:880:STDZIFINAL") } record(ao, "QUAD:LTUS:880:STDZIFINAL") { field(DESC, "Final SDTZ Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(VAL, "-120.0") field(FLNK, "QUAD:LTUS:880: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, "QUAD:LTUS:880: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, "QUAD:LTUS:880:STDZITOL") { field(DESC, "Stdz min tolerance") field(PREC, "5") field(CALC, "MAX(ABS(A),ABS(B))*C") field(INPA, "QUAD:LTUS:880:STDZIMIN CP NMS") field(INPB, "QUAD:LTUS:880:STDZIMAX CP MMS") field(INPC, "0.05") field(INPD, "QUAD:LTUS:880:STDZITOLR CP MMS") field(EGU, "A") field(FLNK, "QUAD:LTUS:880:IDELTAS") field(PINI, "YES") } # D - factor (3.154/2 = 1.577) for EPSC, otherwise, set to 1.0 record(calc, "QUAD:LTUS:880:STDZDLY") { field(DESC, "Ramp time for stdz cycle") field(CALC, "C>0?MAX(1,ABS((A-B)/C)*D):0") field(INPA, "QUAD:LTUS:880:STDZIMIN CP NMS") field(INPB, "QUAD:LTUS:880:STDZIMAX CP NMS") field(INPC, "QUAD:LTUS:880:TRIMRAMPRATE CP NMS") field(INPD, "1.577") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") } record(calc, "QUAD:LTUS:880:STDZRAMPDLY") { field(DESC, "Ramp delay total") field(CALC, "MAX(1,((A/100)*B+B))") field(PREC, "5") field(INPA, "QUAD:LTUS:880:TRIMDLYPCT CP MS") field(INPB, "QUAD:LTUS:880: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, "QUAD:LTUS:880:STDZMINIDLY") { field(DESC, "Mini-stdz delay") field(CALC, "A") field(PREC, "5") field(A, "1.0") field(EGU, "sec") field(PINI, "YES") } record(ao, "QUAD:LTUS:880: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, "QUAD:LTUS:880:STDZMINIDELTA") { field(DESC, "Stdz mini % of IMAX") field(CALC, "(B/100)*(A-C)") field(INPA, "QUAD:LTUS:880:IDES.HOPR") field(INPB, "QUAD:LTUS:880:STDZMINIPCT CPP NMS") field(INPC, "QUAD:LTUS:880:IDES.LOPR") field(PREC, "5") } record(calc, "QUAD:LTUS:880:STDZMINISETPT") { field(DESC, "Mini Stdz delta") field(CALC, "C==0?MAX(E-D,B):MIN(E+D,A)") field(INPA, "QUAD:LTUS:880:IDES.HOPR") field(INPB, "QUAD:LTUS:880:IDES.LOPR") field(INPC, "QUAD:LTUS:880:STDZDIRECT.RVAL") field(INPD, "QUAD:LTUS:880:STDZMINIDELTA") field(INPE, "QUAD:LTUS:880:IDES") field(PREC, "5") field(FLNK, "QUAD:LTUS:880: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, "QUAD:LTUS:880:STDZMINISETPTOOR") { field(DESC, "Mini Stdz setpoint out of range") field(CALC, "C==0?(E-DA)") field(INPA, "QUAD:LTUS:880:IDES.HOPR") field(INPB, "QUAD:LTUS:880:IDES.LOPR") field(INPC, "QUAD:LTUS:880:STDZDIRECT.RVAL") field(INPD, "QUAD:LTUS:880:STDZMINIDELTA") field(INPE, "QUAD:LTUS:880: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, "QUAD:LTUS:880: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, "QUAD:LTUS:880:IADJUST.RVAL") field(INPB, "QUAD:LTUS:880:STDZDIRECT.RVAL") field(INPC, "QUAD:LTUS:880:STDZOK.RVAL") field(INPD, "QUAD:LTUS:880:STDZDISABLE.RVAL") field(INPE, "QUAD:LTUS:880:STATE.RVAL CPP NMS") field(INPF, "QUAD:LTUS:880:ICTRL.RVAL") field(INPG, "QUAD:LTUS:880:STATE.SEVR") field(INPH, "QUAD:LTUS:880:BDELTAS.M") field(INPI, "QUAD:LTUS:880:IACT.SEVR") field(OUT, "QUAD:LTUS:880:STDZLOSTGO.SELN PP NMS") field(OOPT, "Transition To Non-zero") } record(seq, "QUAD:LTUS:880:STDZLOSTGO") { field(DESC, "Process lost stdz") field(SELM, "Mask") field(DOL1, "1") field(DOL2, "0") field(LNK1, "QUAD:LTUS:880:STDZLOSTTOD.PROC") field(LNK2, "QUAD:LTUS:880:STDZOK PP") } # Record maximum current after standardize # Reset to IACT from sequence after trim # Disable processing during (mini-)standardize or trim record(calc, "QUAD:LTUS:880:STDZIACTMAX") { field(DESC, "Max act current after stdz") field(CALC, "MAX(A, B)") field(DISV, "0") field(SDIS, "QUAD:LTUS:880:CHECKPWRDIP_ENABLE") field(INPA, "QUAD:LTUS:880:IACT CP") field(INPB, "QUAD:LTUS:880:STDZIACTMAX") field(EGU, "A") field(FLNK, "QUAD:LTUS:880:CHECKPWRDIP") } # Detect power dip if STDZOK is YES, STDZ is enabled, and IACT is valid # If IACT drops below STDZIACTMAX by more than the trim tolerance, clear STDZOK # Warning: Take the absolute value of the trim tolerance, or else quads of # negative polarity will always lose STDZ since their IDELTAS.I are negative. # Note: Large quads and bends are prone to losing STDZ even if they are # perturbed toward higher current since their current tends to overshoot # by greater than the trim tolerance before settling down. record(calcout, "QUAD:LTUS:880:CHECKPWRDIP") { field(DESC, "Detect power dip") field(CALC, "(A-B>ABS(C))?3:0") field(DISV, "0") field(SDIS, "QUAD:LTUS:880:CHECKPWRDIP_ENABLE") field(INPA, "QUAD:LTUS:880:STDZIACTMAX") field(INPB, "QUAD:LTUS:880:IACT") field(INPC, "QUAD:LTUS:880:IDELTAS.I") field(OUT, "QUAD:LTUS:880:STDZLOSTGO.SELN PP NMS") field(OOPT, "When Non-zero") } # Enable processing of STDZIACTMAX and CHECKPWRDIP only if # STDZOK = YES, STDZDISABLE = NO, CTRL != Trim (2), and # CTRL != Stdz (4) record(calc, "QUAD:LTUS:880:CHECKPWRDIP_ENABLE") { field(CALC, "A&&!B&&(C#2)&&(C#4)") field(INPA, "QUAD:LTUS:880:STDZOK.RVAL CP") field(INPB, "QUAD:LTUS:880:STDZDISABLE.RVAL CP") field(INPC, "QUAD:LTUS:880:CTRL.RVAL CP") } #! 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, "QUAD:LTUS:880: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, "QUAD:LTUS:880:CALBOK") { field(DESC, "Successful Calibration") field(DTYP, "Raw Soft Channel") field(ZNAM, "NO") field(ONAM, "YES") field(DOL, "PSC:LTUS:MG21:CALBOK.RVAL") field(OMSL, "closed_loop") 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, "QUAD:LTUS:880:CALBSET") { field(DESC, "Use DAC Calbration") field(SCAN, "10 second") field(CALC, "A&&(B==0)&&C?31:960") field(INPA, "QUAD:LTUS:880:CALBOK") field(INPB, "QUAD:LTUS:880:CALBDISABLE") field(INPC, "QUAD:LTUS:880:CALBSLOPE") field(OOPT, "On Change") field(OUT, "QUAD:LTUS:880: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, "QUAD:LTUS:880:CALB_SEQ") { field(DESC, "Output Calib Values") field(SELM, "Mask") field(SELL, "QUAD:LTUS:880: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, "QUAD:LTUS:880:CALBSLOPE") field(DOL3, "QUAD:LTUS:880: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, "QUAD:LTUS:880:CALBTOD") { field(DESC, "Calibration Success Time") field(PINI, "YES") field(DOL, "PSC:LTUS:MG21:CALBTOD") field(OMSL, "closed_loop") field(DTYP, "Soft Channel") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:880: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, "QUAD:LTUS:880: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, "QUAD:LTUS:880: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, "QUAD:LTUS:880:CALBOFFSET") { field(DESC, "Calc DAC Offset") field(PREC, "6") field(EGU, "Counts") field(PINI, "YES") } record(bo, "QUAD:LTUS:880: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, "QUAD:LTUS:880:DACSLOPE") { field(DESC, "V to DAC slope") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "closed_loop") field(PINI, "YES") field(FLNK, "QUAD:LTUS:880:DACOFFSET") } # Default Offset used in conversion from Volts to DAC Counts record(ao, "QUAD:LTUS:880:DACOFFSET") { field(DESC, "V to DAC offset") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "closed_loop") field(PINI, "YES") field(FLNK, "QUAD:LTUS:880: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, "QUAD:LTUS:880: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, "QUAD:LTUS:880:IACT") field(INPD, "QUAD:LTUS:880:DACSLOPE") field(INPE, "QUAD:LTUS:880:DACOFFSET") field(EGU, "Counts") field(PREC, "6") } record(ao, "QUAD:LTUS:880:DAC") { field(DESC, "DAC Set point") field(EGU, "Counts") field(DOL, "") field(OMSL, "closed_loop") field(PREC, "6") field(PINI, "YES") } record(ao, "QUAD:LTUS:880:CALBIMIN") { field(DESC, "Calibration Min Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(DRVH, "120.0") field(HOPR, "120.0") field(DRVL, "-120.0") field(LOPR, "-120.0") field(PREC, "3") field(EGU, "A") field(VAL, "0.0") field(FLNK, "QUAD:LTUS:880:CALBIMAX") } record(ao, "QUAD:LTUS:880:CALBIMAX") { field(DESC, "Calibration Max Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(DRVH, "120.0") field(HOPR, "120.0") field(LOPR, "-120.0") field(DRVL, "-120.0") field(EGU, "A") field(VAL, "120.0") field(FLNK, "QUAD:LTUS:880:CALBSTEPNUM") } record(ao, "QUAD:LTUS:880:CALBIFINAL") { field(DESC, "Calibration Last Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(PREC, "3") field(EGU, "A") field(HOPR, "120.0") field(LOPR, "-120.0") field(VAL, "0") } record(longout, "QUAD:LTUS:880: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, "QUAD:LTUS:880:CALBIDELTA") } record(calc, "QUAD:LTUS:880:CALBIDELTA") { field(DESC, "Step size for CALB") field(CALC, "C=0?0:ABS((A-B)/C)") field(INPA, "QUAD:LTUS:880:CALBIMAX") field(INPB, "QUAD:LTUS:880:CALBIMIN") field(INPC, "QUAD:LTUS:880: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, "QUAD:LTUS:880:CALBIMULT") { field(DESC, "IACT vs ISETPT mult") field(CALC, "C#0||A=0?1:ABS(B/A)") field(INPA, "PSC:LTUS:MG21:ISETPT.DRVH") field(INPB, "PSC:LTUS:MG21:IACT.HOPR") field(INPC, "QUAD:LTUS:880:PSCONTROLLER.RVAL CPP") field(EGU, "A") field(PINI, "YES") } # SNL dbputs DAC values here. 6-10 steps are possible. record(waveform, "QUAD:LTUS:880:CALBICTRLWF") { field(DESC, "ICTRL setpoint array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") } record(waveform, "QUAD:LTUS:880:DACWF") { field(DESC, "DAC count array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:880:DACSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:880:DACSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "QUAD:LTUS:880: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, "QUAD:LTUS:880:CALCDACWF") { field(DESC, "Calc DAC counts array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:880:CALCDACSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:880:CALCDACSA") { field(DESC, "Calc DAC counts") field(DTYP, "Soft Channel") field(INP, "QUAD:LTUS:880: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, "QUAD:LTUS:880:CALBYWF") { field(DESC, "mx + b") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:880:CALBYSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:880:CALBYSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "QUAD:LTUS:880:CALBYWF") field(MALM, "10") field(NELM, "6") field(INDX, "0") field(FTVL, "DOUBLE") } record(waveform, "QUAD:LTUS:880:CALBIACTWF") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:880:CALBIACTSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:880:CALBIACTSA") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(MALM, "10") field(NELM, "6") field(INP, "QUAD:LTUS:880:CALBIACTWF") field(INDX, "0") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:880:CALBLIMITS") } # Check that measured current during calibration is within # tolerance. record(aSub, "QUAD:LTUS:880: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, "QUAD:LTUS:880:CALBSTEPNUM") field(INPB, "QUAD:LTUS:880:CALBIACTWF") field(INPC, "QUAD:LTUS:880: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, "QUAD:LTUS:880: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, "QUAD:LTUS:880:STDZITOL") field(INPH, "QUAD:LTUS:880:DACSLOPE") field(INPI, "QUAD:LTUS:880: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, "QUAD:LTUS:880: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, "QUAD:LTUS:880:CALBSTEPNUM") field(INPB, "QUAD:LTUS:880:CALBIACTWF") field(INPC, "QUAD:LTUS:880:DACWF") field(INPF, "QUAD:LTUS:880: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 QUAD:LTUS:880CALBOK 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, "QUAD:LTUS:880:DEGAUSINIT") { field(DESC, "Proc. Degauss PVs on boot") field(PINI, "YES") field(DOL, "1") field(OUTA, "QUAD:LTUS:880:DEGAUSIMIN.PROC PP") field(OUTB, "QUAD:LTUS:880:DEGAUSIMAX.PROC PP") field(OUTC, "QUAD:LTUS:880:DEGAUSTYPE.PROC PP") field(OUTD, "QUAD:LTUS:880:DEGAUSSTEP.PROC PP") field(OUTE, "QUAD:LTUS:880:MADNAME.PROC PP") field(OUTF, "QUAD:LTUS:880:PSTYPE.PROC PP") field(OUTG, "QUAD:LTUS:880: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, "QUAD:LTUS:880:DEGAUSSUB") { field(DESC, "Degauss subroutine") field(INAM, "mgntDegaussInit") field(SNAM, "mgntDegauss") field(BRSV, "INVALID") field(INPA, "QUAD:LTUS:880:DEGAUSIMIN NPP NMS") field(INPB, "QUAD:LTUS:880:DEGAUSIMAX NPP NMS") field(INPC, "QUAD:LTUS:880:DEGAUSTYPE.RVAL NPP NMS") field(INPE, "QUAD:LTUS:880:DEGAUSMETHOD.RVAL NPP NMS") field(INPF, "QUAD:LTUS:880:PSTYPE NPP NMS") field(INPG, "QUAD:LTUS:880:DEBUG.RVAL NPP NMS") field(INPH, "QUAD:LTUS:880: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, "QUAD:LTUS:880:DEGAUSWF PP") field(OUTB, "QUAD:LTUS:880:DEGAUSMSG PP") field(OUTC, "QUAD:LTUS:880: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, "QUAD:LTUS:880:DEGAUSWF") { field(DESC, "Degauss Setpts") field(NELM, "60") field(FTVL, "DOUBLE") } record(mbbo,"QUAD:LTUS:880: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, "QUAD:LTUS:880: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, "QUAD:LTUS:880: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, "QUAD:LTUS:880: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, "QUAD:LTUS:880: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, "QUAD:LTUS:880:DEGAUSIMIN") { field(DESC, "Min. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "120.0") field(LOPR, "-120.0") field(DRVH, "120.0") field(DRVL, "-120.0") field(VAL, "-120.0") } record(ao, "QUAD:LTUS:880:DEGAUSIMAX") { field(DESC, "Max. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "120.0") field(LOPR, "-120.0") field(DRVH, "120.0") field(DRVL, "-120.0") field(VAL, "120.0") } # 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,"QUAD:LTUS:880: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, "QUAD:LTUS:880: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,"QUAD:LTUS:880: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, "QUAD:LTUS:880: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, "QUAD:LTUS:880: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, "QUAD:LTUS:880: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, "QUAD:LTUS:880:DEGAUSTOD") { field(DESC, "Successful Degauss Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "QUAD:LTUS:880:DEGAUSLOSTTOD") { field(DESC, "Degauss Lost Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:880:DEGAUSTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "QUAD:LTUS:880:DEGAUSTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "QUAD:LTUS:880: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, "QUAD:LTUS:880:DEGAUSGO") { field(DESC, "Set bdes of btrms to zero") field(ASG, "Internal") field(OUTA, "") field(OUTB, "") field(OUTC, "") field(OUTD, "") } # =========== CRYO ONLY =========== record(bo, "QUAD:LTUS:880: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, "QUAD:LTUS:880:DEGAUS_IMAX_CHECK") { field(DESC, "Check if imax shoud chg") field(CALC, "(C==4)&&(ABS(B)>ABS(A))?1:0") field(INPA, "QUAD:LTUS:880:DEGAUS_IMAX") field(INPB, "QUAD:LTUS:880:ISETPT") field(INPC, "QUAD:LTUS:880:DEGAUSTYPE.RVAL") field(OUT, "QUAD:LTUS:880:DEGAUS_IMAX_UPDATE.SELN") field(FLNK, "QUAD:LTUS:880:DEGAUS_IMAX_UPDATE") } record(seq, "QUAD:LTUS:880:DEGAUS_IMAX_UPDATE") { field(DESC, "Degauss IMAX Update") field(SELM, "Specified") field(DOL1, "QUAD:LTUS:880:ISETPT") field(LNK1, "QUAD:LTUS:880:DEGAUS_IMAX PP") } # Set the maximum current after a successful # degauss. This pv is updated by the # sequence. record(ao, "QUAD:LTUS:880:DEGAUS_IMAX") { field(DESC, "Max I set afer a degauss") field(EGU, "Amps") field(PINI, "YES") field(PREC, "6") field(HOPR, "120.0") field(LOPR, "-120.0") field(DRVH, "120.0") field(DRVL, "-120.0") field(VAL, "120.0") field(FLNK, "QUAD:LTUS:880:DEGAUS_IMAXPOL_CHECK") info(autosaveFields,"VAL,RVAL") } # Set the polarity if degauss_imax record(calcout, "QUAD:LTUS:880:DEGAUS_IMAXPOL_CHECK") { field(DESC, "Determine polarity of imax") field(CALC, "A>=0?0:1") field(INPA, "QUAD:LTUS:880:DEGAUS_IMAX") field(FLNK, "QUAD:LTUS:880:DEGAUS_IMAXPOL") } record(bo, "QUAD:LTUS:880:DEGAUS_IMAXPOL") { field(DESC, "Polarity of imax I") field(DTYP, "Raw Soft Channel") field(DOL, "QUAD:LTUS:880:DEGAUS_IMAXPOL_CHECK") field(OMSL, "closed_loop") field(ZNAM, "Positive") field(ONAM, "Negative") field(FLNK, "QUAD:LTUS:880: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, "QUAD:LTUS:880:DEGAUS_ABSIMAX") { field(DESC, "Absolute Max. Degauss I") field(CALC, "ABS(A)") field(INPA, "QUAD:LTUS:880:DEGAUS_IMAX") field(PREC, "6") field(EGU, "Amps") field(HOPR, "120.0") field(LOPR, "-120.0") info(autosaveFields,"VAL RVAL") } # IACT Polarity record(calcout, "QUAD:LTUS:880:IACTPOL_CHECK") { field(DESC, "Determine IACT polarity") field(SCAN, "5 second") field(CALC, "ABS(A-B)>C?(A>=0?0:1):D") field(INPA, "QUAD:LTUS:880:IACT") field(INPB, "QUAD:LTUS:880:IACTPOL_CHECK.LA") field(INPC, "0.0001") field(INPD, "QUAD:LTUS:880:IACTPOL_CHECK.PVAL") field(OOPT, "On Change") field(FLNK, "QUAD:LTUS:880:IACTPOL") } record(bo, "QUAD:LTUS:880: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,"QUAD:LTUS:880: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, "QUAD:LTUS:880:DEGAUSENABLE CP") field(INPB, "QUAD:LTUS:880:DEGAUSOK") field(INPC, "QUAD:LTUS:880:STATE CP") field(INPD, "QUAD:LTUS:880:STATE.SEVR") field(OUT, "QUAD:LTUS:880:DEGAUS_STATE_SEQ.SELN PP") field(ASG, "Internal") } record(seq, "QUAD:LTUS:880:DEGAUS_STATE_SEQ") { field(DESC, "Degauss State Sequence") field(SELM, "Specified") field(SELL, "QUAD:LTUS:880:DEGAUS_STATE_CHECK") field(LNK1, "QUAD:LTUS:880:DEGAUS_STATE_DISABLE.PROC PP") field(LNK2, "QUAD:LTUS:880:DEGAUS_STATE_LOST.PROC PP") field(LNK3, "QUAD:LTUS:880:DEGAUS_STATE_GOOD.PROC PP") field(LNK4, "QUAD:LTUS:880: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, "QUAD:LTUS:880:DEGAUS_STATE_DISABLE") { field(DESC, "Degauss not used") field(LNK1, "QUAD:LTUS:880:DEGAUSOK.ZSV") field(LNK2, "QUAD:LTUS:880: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, "QUAD:LTUS:880:STATMSG.FRSV") field(LNK4, "QUAD:LTUS:880: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, "QUAD:LTUS:880:DEGAUS_STATE_LOST") { field(DESC, "Degauss lost and ps On") field(DOL1, "1") field(LNK1, "QUAD:LTUS:880:DEGAUSOK.ZSV") field(LNK2, "QUAD:LTUS:880: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, "QUAD:LTUS:880:STATMSG.FRSV") field(LNK4, "QUAD:LTUS:880: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, "QUAD:LTUS:880:DEGAUS_STATE_OFF") { field(DESC, "Degaused lost and ps Off") field(DOL1, "2") field(LNK1, "QUAD:LTUS:880: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, "QUAD:LTUS:880:STATMSG.FRSV") field(LNK3, "QUAD:LTUS:880: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, "QUAD:LTUS:880:DEGAUS_STATE_GOOD") { field(DESC, "Degauss good") field(DOL1, "1") field(LNK1, "QUAD:LTUS:880: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, "QUAD:LTUS:880:STATMSG.FRSV PP") field(LNK3, "QUAD:LTUS:880:STATMSG.FVSV PP") field(LNK4, "") field(ASG, "Internal") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(mbbo, "QUAD:LTUS:880:FUNC") { field(DESC, "QUAD:LTUS:880 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, "1") field(THVL, "9") field(FRVL, "10") field(FVVL, "0") field(SXVL, "2") field(SVVL, "8") field(EIVL, "11") field(NIVL, "12") field(TEVL, "13") field(ELVL, "5") field(TVVL, "6") field(TTVL, "7") field(FTVL, "4") field(FFVL, "3") field(OUT, "QUAD:LTUS:880:CTRL CA") } # :CTRL pv is processed at boot in the # sequence mgntCtrl.st Processed in sequence # record(mbbo, "QUAD:LTUS:880:CTRL") { field(DESC, "QUAD:LTUS:880 Control") field(PINI, "NO") field(ZRST, "Ready") field(ONST, "TRIM") field(TWST, "PERTURB") field(THST, "BCON_TO_BDES") field(FRST, "BACT_TO_BDES") field(FVST, "SAVE_BDES") field(SXST, "LOAD_BDES") field(SVST, "UNDO_BDES") field(EIST, "DAC_ZERO") field(NIST, "CALB") field(TEST, "STDZ") field(ELST, "RESET") field(TVST, "TURN_ON") field(TTST, "TURN_OFF") field(FTST, "") field(FFST, "") field(ZRVL, "0") field(ONVL, "2") field(TWVL, "6") field(THVL, "15") field(FRVL, "14") field(FVVL, "11") field(SXVL, "12") field(SVVL, "13") field(EIVL, "7") field(NIVL, "3") field(TEVL, "4") field(ELVL, "8") field(TVVL, "9") field(TTVL, "10") field(FTVL, "0") field(FFVL, "0") field(OUT, "QUAD:LTUS:880:SELECTEN.A PP") field(SDIS, "0") } # If a function has been selected set this unit to busy record(calcout, "QUAD:LTUS:880:SELECTEN") { field(DESC, "Control Select Enable") field(CALC, "A>0?1:A") field(FLNK, "QUAD:LTUS:880:BUSY") } # Set to FREE on IOC reboot record(bo, "QUAD:LTUS:880:BUSY") { field(DESC, "QUAD:LTUS:880 Ctrl Done") field(DOL, "QUAD:LTUS:880:SELECTEN") field(ZNAM, "FREE") field(ONAM, "BUSY") field(PINI, "YES") field(FLNK, "QUAD:LTUS:880:SELECT") } record(bo, "QUAD:LTUS:880:SELECT") { field(ZNAM, "NO") field(ONAM, "YES") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") } record(bo, "QUAD:LTUS:880: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, "QUAD:LTUS:880:CTRLSTATE") { field(DESC, "QUAD:LTUS:880 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("QUAD:LTUS:880:CTRL",20,20,0,0,"QUAD:LTUS:880:CTRL") #! Field("QUAD:LTUS:880:CTRL.OUT",16777215,1,"QUAD:LTUS:880:CTRL.OUT") #! Link("QUAD:LTUS:880:CTRL.OUT","QUAD:LTUS:880:SELECTEN.A") #! Field("QUAD:LTUS:880:CTRL.VAL",16777215,1,"QUAD:LTUS:880:CTRL.VAL") #! Record("QUAD:LTUS:880:SELECTEN",321,381,0,0,"QUAD:LTUS:880:SELECTEN") #! Field("QUAD:LTUS:880:SELECTEN.A",16777215,0,"QUAD:LTUS:880:SELECTEN.A") #! Field("QUAD:LTUS:880:SELECTEN.FLNK",16777215,1,"QUAD:LTUS:880:SELECTEN.FLNK") #! Link("QUAD:LTUS:880:SELECTEN.FLNK","QUAD:LTUS:880:BUSY") #! Field("QUAD:LTUS:880:SELECTEN.VAL",16777215,1,"QUAD:LTUS:880:SELECTEN.VAL") #! Record("QUAD:LTUS:880:BUSY",623,274,0,0,"QUAD:LTUS:880:BUSY") #! Field("QUAD:LTUS:880:BUSY.DOL",16777215,0,"QUAD:LTUS:880:BUSY.DOL") #! Link("QUAD:LTUS:880:BUSY.DOL","QUAD:LTUS:880:SELECTEN.VAL") #! Field("QUAD:LTUS:880:BUSY.FLNK",16777215,1,"QUAD:LTUS:880:BUSY.FLNK") #! Link("QUAD:LTUS:880:BUSY.FLNK","QUAD:LTUS:880:SELECT") #! Record("QUAD:LTUS:880:SELECT",669,508,0,1,"QUAD:LTUS:880:SELECT") #! Record("QUAD:LTUS:880:FUNC",940,120,0,0,"QUAD:LTUS:880:FUNC") #! Field("QUAD:LTUS:880:FUNC.OUT",16777215,0,"QUAD:LTUS:880:FUNC.OUT") #! Link("QUAD:LTUS:880:FUNC.OUT","QUAD:LTUS:880:CTRL.VAL") #! Record("QUAD:LTUS:880:ABORT",193,41,0,0,"QUAD:LTUS:880:ABORT") #! Record("QUAD:LTUS:880:CTRLSTATE",369,34,0,0,"QUAD:LTUS:880: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,"QUAD:LTUS:880:SELECT is used for Multi-device selection.\nIt is enabled when associated QUAD:LTUS:880:CTRL is \"0\" (DONE).\nIt is disabled when associated QUAD:LTUS:880: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,"QUAD:LTUS:880: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, "QUAD:LTUS:880:BCTRL_INIT") { field(DESC, "Process BCTRL on boot") field(PINI, "YES") field(CALC, "A=3?1:0") field(INPA, "QUAD:LTUS:880:BCTRL.SEVR") field(OUT, "QUAD:LTUS:880: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, "QUAD:LTUS:880:BACT") { field(DESC, "Actual B") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "QUAD:LTUS:880:BACT") field(INPB, "QUAD:LTUS:880:POLYCOEF") field(INPC, "QUAD:LTUS:880:POLYCOEF.A") field(INPD, "QUAD:LTUS:880:POLYCOEF.B") field(INPE, "QUAD:LTUS:880:IACT MS") field(INPF, "QUAD:LTUS:880:BDELTAS PP") field(INPG, "100") field(EGU, "kG") field(HOPR, "67.1881") field(LOPR, "-67.4262") field(HIHI, "67.1881") field(LOLO, "-67.4262") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "67.1881") field(LOW, "-67.4262") field(FLNK, "QUAD:LTUS:880: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, "QUAD:LTUS:880:BDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntPhyDeltas") field(EGU, "kG") field(HOPR, "1") field(PREC, "7") field(BRSV, "INVALID") field(INPA, "QUAD:LTUS:880:BDES") field(INPB, "QUAD:LTUS:880:TRIMBTOL") field(INPC, "QUAD:LTUS:880:TRIMBTOLR") field(INPD, "QUAD:LTUS:880:CHCKBTOL") field(INPE, "QUAD:LTUS:880:CHCKBTOLR") field(F, "2.0") field(INPG, "30") field(INPH, "QUAD:LTUS:880:BACT.VAL") # # MPS absolute and relative tolerances field(INPP, "QUAD:LTUS:880:MPSBTOL") field(INPQ, "QUAD:LTUS:880:MPSBTOLR") field(FLNK, "QUAD:LTUS:880:BCONLIMITS") info(autosaveFields,"F") } # This record is processed by BDELTAS record(aSub, "QUAD:LTUS:880:BCONLIMITS") { field(DESC, "Config B-field Limits") field(INAM, "mgntInit") field(SNAM, "mgntBCONLimits") field(INPA, "QUAD:LTUS:880:BDES") field(INPB, "QUAD:LTUS:880:BDELTAS.I") field(INPG, "QUAD:LTUS:880:DEBUG.RVAL") field(FTA, "DOUBLE") field(FTB, "DOUBLE") field(FTG, "ULONG") field(OUTA, "QUAD:LTUS:880:BCON.HIGH") field(OUTB, "QUAD:LTUS:880:BCON.LOW") field(OUTC, "QUAD:LTUS:880:BCON.HIHI") field(OUTD, "QUAD:LTUS:880:BCON.LOLO PP") field(FTVA, "DOUBLE") field(FTVB, "DOUBLE") field(FTVC, "DOUBLE") field(FTVD, "DOUBLE") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:880:IDELTAS") } # The following PV is processed by :BACT # which is processed by :BACT # record(fanout, "QUAD:LTUS:880:BACTFO") { field(DESC, "BACT processing") field(SELM, "All") field(LNK1, "QUAD:LTUS:880:BDIFF") field(LNK2, "QUAD:LTUS:880:BADIFF") field(LNK3, "QUAD:LTUS:880:BRATIO") field(LNK4, "QUAD:LTUS:880:MPSLIMITS") field(LNK5, "QUAD:LTUS:880:I2BSTATUS") field(LNK6, "QUAD:LTUS:880:IACTFO.PROC") } record(calc, "QUAD:LTUS:880:BDIFF") { field(DESC, "BDES-BACT") field(CALC, "A-B") field(INPA, "QUAD:LTUS:880:BDES") field(INPB, "QUAD:LTUS:880:BACT") field(EGU, "kG") field(PREC, "7") } record(calc, "QUAD:LTUS:880:BADIFF") { field(DESC, "Absolute BDES-BACT") field(INPA, "QUAD:LTUS:880:BDIFF") field(EGU, "kG") field(PREC, "7") field(CALC, "A<0?ABS(A):A") } record(calc, "QUAD:LTUS:880:BRATIO") { field(DESC, "BACT Error") field(CALC, "B?A/B:0") field(INPA, "QUAD:LTUS:880:BDIFF") field(INPB, "QUAD:LTUS:880:BDES.HOPR") field(EGU, "kG") field(PREC, "7") } record(mbbi, "QUAD:LTUS:880: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, "QUAD:LTUS:880:BACT.J") } # Note: for a string slave set the MONFL # macro to the following: # MONFL=:IMONCALC MS record(sub, "QUAD:LTUS:880:BMON") { field(DESC, "Second Transductor") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "QUAD:LTUS:880:BMON") field(INPB, "QUAD:LTUS:880:POLYCOEF") field(INPC, "QUAD:LTUS:880:POLYCOEF.A") field(INPD, "QUAD:LTUS:880:POLYCOEF.B") field(INPE, "QUAD:LTUS:880:IMON MS") field(INPF, "QUAD:LTUS:880:BDELTAS.VAL") field(INPG, "100") field(EGU, "kG") field(HOPR, "67.1881") field(LOPR, "-67.4262") field(HIHI, "67.1881") field(LOLO, "-67.4262") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "67.1881") field(LOW, "-67.4262") } # 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=PSC:LTUS:MG21:BDES CP record(ao, "QUAD:LTUS:880:BDES") { field(DESC, "Desired B-Field") field(PINI, "YES") field(DRVH, "67.1881") field(DRVL, "-67.4262") field(HOPR, "67.1881") field(LOPR, "-67.4262") field(PREC, "7") field(EGU, "kG") field(MDEL, "-1") field(OMSL, "supervisory") # field(DOL, "") field(OUT, "QUAD:LTUS:880:B2IDES PP") info(autosaveFields,"VAL") } record(sub, "QUAD:LTUS:880:B2IDES") { field(DESC, "Convert Desired B-Field to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:880:POLYCOEF") field(INPC, "QUAD:LTUS:880:POLYCOEF.A") field(INPD, "QUAD:LTUS:880:POLYCOEF.B") field(PREC, "7") field(EGU, "kG") field(HOPR, "67.1881") field(LOPR, "-67.4262") field(MDEL, "-1") field(INPE, "QUAD:LTUS:880:BDES.DRVH") field(INPF, "QUAD:LTUS:880:BDES.DRVL") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:880:IDES") } record(sub, "QUAD:LTUS:880:BNOM") { field(DESC, "Nominal Field") field(PINI, "YES") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:880:POLYCOEF") field(INPC, "QUAD:LTUS:880:POLYCOEF.A") field(INPD, "QUAD:LTUS:880:POLYCOEF.B") field(INPE, "QUAD:LTUS:880:BDES.DRVH") field(INPF, "QUAD:LTUS:880:BDES.DRVL") field(EGU, "kG") field(HOPR, "67.1881") field(LOPR, "-67.4262") field(PREC, "7") field(VAL, "0.0") field(FLNK, "QUAD:LTUS:880:INOM") } record(sub, "QUAD:LTUS:880:BACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:880:BDES.VAL") field(INPB, "QUAD:LTUS:880:BDES.DRVH") field(INPC, "QUAD:LTUS:880:BDES.DRVL") field(INPD, "QUAD:LTUS:880:BDELTAS.I") field(INPE, "QUAD:LTUS:880:BDELTAS.J") field(INPG, "QUAD:LTUS:880:STATE") field(INPH, "QUAD:LTUS:880:HSTA") field(EGU, "kG") field(HOPR, "67.1881") field(LOPR, "-67.4262") field(PREC, "7") field(BRSV, "INVALID") } record(sub, "QUAD:LTUS:880:BMONLIMITS") { field(DESC, "MON Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:880:BDES.VAL") field(INPB, "QUAD:LTUS:880:BDES.DRVH") field(INPC, "QUAD:LTUS:880:BDES.DRVL") field(INPD, "QUAD:LTUS:880:BDELTAS.K") field(INPE, "QUAD:LTUS:880:BDELTAS.L") field(INPG, "QUAD:LTUS:880:STATE") field(INPH, "QUAD:LTUS:880:HSTA") field(EGU, "kG") field(HOPR, "67.1881") field(LOPR, "-67.4262") field(PREC, "7") field(BRSV, "INVALID") } record(seq, "QUAD:LTUS:880:BLIMITS") { field(DESC, "ACT Limits") field(PREC, "7") field(DOL1, "QUAD:LTUS:880:BLIMITS") field(LNK1, "QUAD:LTUS:880:BACTLIMITS.F PP") field(DOL2, "QUAD:LTUS:880:BACTLIMITS.I") field(LNK2, "QUAD:LTUS:880:BACT.HIGH") field(DOL3, "QUAD:LTUS:880:BACTLIMITS.J") field(LNK3, "QUAD:LTUS:880:BACT.LOW") field(DOL4, "QUAD:LTUS:880:BACTLIMITS.K") field(LNK4, "QUAD:LTUS:880:BACT.HIHI") field(DOL5, "QUAD:LTUS:880:BACTLIMITS.L") field(LNK5, "QUAD:LTUS:880:BACT.LOLO") field(DOL6, "QUAD:LTUS:880:BLIMITS") field(LNK6, "QUAD:LTUS:880:BMONLIMITS.F PP") field(DOL7, "QUAD:LTUS:880:BMONLIMITS.I") field(LNK7, "QUAD:LTUS:880:BMON.HIGH") field(DOL8, "QUAD:LTUS:880:BMONLIMITS.J") field(LNK8, "QUAD:LTUS:880:BMON.LOW") field(DOL9, "QUAD:LTUS:880:BMONLIMITS.K") field(LNK9, "QUAD:LTUS:880:BMON.HIHI") field(DOLA, "QUAD:LTUS:880:BMONLIMITS.L") field(LNKA, "QUAD:LTUS:880:BMON.LOLO") field(FLNK, "QUAD:LTUS:880:ILIMITS") field(SCAN, "5 second") } record(ao, "QUAD:LTUS:880:BCTRL") { field(DESC, "B-Perturb") field(PREC, "7") field(EGU, "kG") field(DRVH, "67.1881") field(DRVL, "-67.4262") field(HOPR, "67.1881") field(LOPR, "-67.4262") # 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, "QUAD:LTUS:880: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, "QUAD:LTUS:880:BCTRLGO") { field(DESC, "Update DES and perturb") field(PREC, "7") # Disable BACT limits field(DOL1, "1") field(LNK1, "QUAD:LTUS:880:BLIMITS.VAL") # Update BDES with the BCTRL (slider) value field(DOL2, "QUAD:LTUS:880:BCTRL.VAL") field(LNK2, "QUAD:LTUS:880:BDES PP") field(DOL3, "1") field(LNK3, "QUAD:LTUS:880:IDIRECT.PROC PP") field(DOL4, "1") field(LNK4, "QUAD:LTUS:880:CHECKSTDZLOST.PROC PP") field(DOL5, "QUAD:LTUS:880:BCTRL.VAL") field(LNK5, "QUAD:LTUS:880:BCTRLSUB PP") # Re-enable BACT limits field(DOL6, "0") field(LNK6, "QUAD:LTUS:880:BLIMITS.VAL") } # Convert B-field to Current and output to ISETPT record(sub, "QUAD:LTUS:880:BCTRLSUB") { field(DESC, "Feedback") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:880:POLYCOEF") field(INPC, "QUAD:LTUS:880:POLYCOEF.A") field(INPD, "QUAD:LTUS:880:POLYCOEF.B") field(INPE, "QUAD:LTUS:880:BDES.DRVH") field(INPF, "QUAD:LTUS:880:BDES.DRVL") field(PREC, "7") field(EGU, "kG") field(HOPR, "67.1881") field(LOPR, "-67.4262") field(MDEL, "-1") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:880:ISETPT") } record(ao, "QUAD:LTUS:880:BDESPREVTRIM") { field(DESC, "trim bdes for undo") field(DTYP, "Soft Channel") field(DRVH, "67.1881") field(DRVL, "-67.4262") field(EGU, "kG") field(HOPR, "67.1881") field(LOPR, "-67.4262") field(PREC, "7") field(PINI, "YES") info(autosaveFields,"VAL") } record(stringin, "QUAD:LTUS:880:MADNAME") { field(DESC, "MAD deck nomenclature") field(PINI, "YES") field(VAL, "QUM4B") } record(ai, "QUAD:LTUS:880: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, "3555.768776") } record(ao, "QUAD:LTUS:880:BMAX") { field(DESC, "Max B-Field") field(DTYP, "Soft Channel") field(DRVH, "67.1881") field(DRVL, "-67.4262") field(EGU, "kG") field(HOPR, "67.1881") field(LOPR, "-67.4262") field(PREC, "7") field(PINI, "YES") field(VAL, "67.1881") field(FLNK, "QUAD:LTUS:880:BSTEP") } record(ao, "QUAD:LTUS:880:BMIN") { field(DESC, "Min B-Field") field(DTYP, "Soft Channel") field(DRVH, "67.1881") field(DRVL, "-67.4262") field(EGU, "kG") field(HOPR, "67.1881") field(LOPR, "-67.4262") field(PREC, "7") field(PINI, "YES") field(VAL, "-67.4262") field(FLNK, "QUAD:LTUS:880:BSTEP") } record(ao, "QUAD:LTUS:880:BDESSAVE") { field(DESC, "bdes for save/load") field(DTYP, "Soft Channel") field(DRVH, "67.1881") field(DRVL, "-67.4262") field(EGU, "kG") field(HOPR, "67.1881") field(LOPR, "-67.4262") field(PINI, "YES") field(PREC, "7") } # This record is processed by QUAD:LTUS:880: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, "QUAD:LTUS:880:BCON") { field(DESC, "Config B-Field ") field(DTYP, "Soft Channel") field(PREC, "7") field(EGU, "kG") field(HOPR, "67.1881") field(LOPR, "-67.4262") field(DRVH, "67.1881") field(DRVL, "-67.4262") # Set MINOR Alarm as the default, slaves will set NO_ALARM=0. field(HHSV, "MINOR") field(LLSV, "MINOR") field(HSV, "MINOR") field(LSV, "MINOR") # field(DOL , "") field(OMSL, "supervisory") field(OUT, "QUAD:LTUS:880:B2ICON PP") info(autosaveFields,"VAL") } record(sub, "QUAD:LTUS:880:B2ICON") { field(DESC, "Convert Desired ICon to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:880:POLYCOEF") field(INPC, "QUAD:LTUS:880:POLYCOEF.A") field(INPD, "QUAD:LTUS:880:POLYCOEF.B") field(PREC, "7") field(EGU, "kG") field(HOPR, "67.1881") field(LOPR, "-67.4262") field(MDEL, "-1") field(INPE, "QUAD:LTUS:880:BCON.DRVH") field(INPF, "QUAD:LTUS:880:BCON.DRVL") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:880: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, "QUAD:LTUS:880:BSTEP") { field(DESC, "B-Field step size") field(CALC, "(C==3)||(D==3)?0:ABS(A-B)*0.005") field(INPA, "QUAD:LTUS:880:BMAX") field(INPB, "QUAD:LTUS:880:BMIN") field(INPC, "QUAD:LTUS:880:BMIN.SEVR") field(INPD, "QUAD:LTUS:880:BMAX.SEVR") field(EGU, "kG") 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,"QUAD:LTUS:880:BCTRLDISABLECALC") { field(DESC, "Calc for disabling BCTRL") field(ASG, "Internal") field(CALC, "A?2:1") field(INPA, "QUAD:LTUS:880:ONLINE CP") field(OUT, "QUAD:LTUS:880:BCTRLDISABLEFOUT PP") } record(fanout, "QUAD:LTUS:880:BCTRLDISABLEFOUT") { field(DESC, "Disable BCTRL fanout") field(SELM, "Specified") field(SELL, "QUAD:LTUS:880:BCTRLDISABLECALC") field(LNK1, "QUAD:LTUS:880:BCTRLDISABLE") field(LNK2, "QUAD:LTUS:880:BCTRLENABLE") } record(stringout, "QUAD:LTUS:880:BCTRLDISABLE") { field(DESC, "Disable BCTRL") field(DTYP, "Soft Channel") field(OUT, "QUAD:LTUS:880:BCTRL.ASG") field(VAL, "NOWRITE") field(FLNK, "QUAD:LTUS:880:BCTRLDISV_UPDATE") } record(stringout, "QUAD:LTUS:880:BCTRLENABLE") { field(DESC, "Enable BCTRL") field(DTYP, "Soft Channel") field(OUT, "QUAD:LTUS:880:BCTRL.ASG") field(VAL, "") field(FLNK, "QUAD:LTUS:880:BCTRLDISV_UPDATE") } record(calcout, "QUAD:LTUS:880:BCTRLDISV_UPDATE") { field(DESC, "Calc for updating BCTRL.DISV") field(ASG, "Internal") field(CALC, "A") field(INPA, "QUAD:LTUS:880:ONLINE") field(OUT, "QUAD:LTUS:880: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,"QUAD:LTUS:880:BACT and MON\n are processed via links from \n QUAD:LTUS:880:IACT (device raw value readback 1)\n and\n QUAD:LTUS:880: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 QUAD:LTUS:880:POLYCOEF\nC = First polynomial coefficient (offset if linear)\nD = Second polynomial coefficient (slope if linear)\nE = QUAD:LTUS:880: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,"QUAD:LTUS:880:BDES\n is processed when set by CA users or \n QUAD:LTUS:880: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,"QUAD:LTUS:880: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 QUAD:LTUS:880: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 (QUAD:LTUS:880: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,"QUAD:LTUS:880:B*LIMITS and QUAD:LTUS:880:BLIMITS:\n Calculate alarm and warning limits based on \n deltas from QUAD:LTUS:880: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,"QUAD:LTUS:880: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,"QUAD:LTUS:880: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, "QUAD:LTUS:880: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, "QUAD:LTUS:880:MPSBTOL") { field(DESC, "Absolute mps tol") field(EGU, "kG") field(PREC, "2") field(CALC, "ABS(A)*0.02") field(INPA, "QUAD:LTUS:880:BMAX") field(PINI, "YES") } # # 21-Aug-2013: K. Luchini # Set channel access security so that users # cannot easily change values. record(ao, "QUAD:LTUS:880:MPSBMAX") { field(DESC, "MPS Max B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "67.1881") field(DRVL, "-67.4262") field(PINI, "YES") field(VAL, "67.1881") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:880:MPSBMIN") { field(DESC, "MPS Min B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "67.1881") field(DRVL, "-67.4262") field(PINI, "YES") field(VAL, "-67.4262") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:880:MPSBLLIM") { field(DESC, "MPS Low Limit B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "67.1881") field(DRVL, "-67.4262") field(PINI, "YES") field(VAL, "-67.4262") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:880:MPSBLLIM2") { field(DESC, "MPS Low Limit #2 B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "67.1881") field(DRVL, "-67.4262") field(PINI, "YES") field(VAL, "-67.4262") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } # Set the default to Std record(mbbo, "QUAD:LTUS:880: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, "QUAD:LTUS:880:MPSLIMITS.E PP") } record(aSub, "QUAD:LTUS:880: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, "QUAD:LTUS:880:MPS.RVAL") field(INPB, "QUAD:LTUS:880:BADIFF") field(INPC, "QUAD:LTUS:880:BDELTAS.N") field(INPD, "QUAD:LTUS:880:BACT") field(INPE, "QUAD:LTUS:880:MPSBITMASK.RVAL") field(INPF, "QUAD:LTUS:880:MPSBLLIM") field(INPG, "QUAD:LTUS:880:MPSBMIN") field(INPH, "QUAD:LTUS:880:MPSBMAX") field(INPI, "QUAD:LTUS:880: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, "QUAD:LTUS:880:INTOL.RVAL PP") field(OUTB, "QUAD:LTUS:880:INTOL_BMIN.RVAL PP") field(OUTC, "QUAD:LTUS:880:INTOL_BRANGE.RVAL PP") field(OUTD, "QUAD:LTUS:880: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, "QUAD:LTUS:880:INTOL") { field(DESC, "BACT within MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:880:MPSLIMITS.VALA") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "QUAD:LTUS:880:INTOL_BMIN") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:880:MPSLIMITS.VALB") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "QUAD:LTUS:880:INTOL_BMIN2") { field(DESC, "MPS tol #2") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:880:MPSLIMITS.VALD") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "QUAD:LTUS:880:INTOL_BRANGE") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:880: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, "QUAD:LTUS:880:CHCKITOL") { field(DESC, "Absolute Check I Tolerance") field(EGU, "A") field(FLNK, "QUAD:LTUS:880:TRIMITOL") field(CALC, "ABS(A*B)") field(INPA, "QUAD:LTUS:880:CHCKBTOL") field(INPB, "QUAD:LTUS:880:POLYCOEF.B") field(PREC, "9") } record(calc, "QUAD:LTUS:880:TRIMBTOL") { field(EGU, "kG") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(DESC, "Absolute Trim Tolerance") field(CALC, "ABS(A)/2") field(INPA, "QUAD:LTUS:880:CHCKBTOL") field(FLNK, "QUAD:LTUS:880:CHCKITOL") } record(calc, "QUAD:LTUS:880:CHCKBTOL") { field(DESC, "Check absolute tolerance") field(EGU, "A") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(FLNK, "QUAD:LTUS:880:TRIMBTOL") field(CALC, "MAX(ABS(A),ABS(C))*(B/1000000)") field(INPA, "QUAD:LTUS:880:BDES.HOPR") field(INPB, "QUAD:LTUS:880:STABILITY") field(INPC, "QUAD:LTUS:880:BDES.LOPR") } record(longout, "QUAD:LTUS:880: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, "QUAD:LTUS:880:CHCKBTOL") } record(calc, "QUAD:LTUS:880:TRIMITOL") { field(DESC, "Absolute Trim I Tolerance") field(EGU, "kG") field(CALC, "ABS(A*B)") field(INPA, "QUAD:LTUS:880:POLYCOEF.B") field(INPB, "QUAD:LTUS:880:TRIMBTOL") field(PREC, "9") } record(ai, "QUAD:LTUS:880:TRIMBTOLR") { field(DESC, "Relative trim tol") field(PREC, "4") field(EGU, "%") field(HOPR, "1.0") field(LOPR, "0.0") field(PINI, "YES") } record(ai, "QUAD:LTUS:880: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, "QUAD:LTUS:880:FBCKFCOM") { field(ZNAM, "CA") field(ONAM, "FCOM") field(DESC, "CA Mode") field(PINI, "YES") field(SDIS, "0") } record(bo, "QUAD:LTUS:880:PAU") { field(ZNAM, "NotConfigured") field(ONAM, "Configured") field(DESC, "PAU Present") field(PINI, "YES") field(SDIS, "0") field(FLNK, "QUAD:LTUS:880:PAUGO") } record(fanout, "QUAD:LTUS:880:PAUGO") { field(DESC, "PAU control") field(LNK1, "QUAD:LTUS:880:PAUSTOP") field(LNK2, "QUAD:LTUS:880: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, "QUAD:LTUS:880:PAUSTART") { field(DESC, "Setup for PAU On") field(SDIS, "QUAD:LTUS:880: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, "QUAD:LTUS:880:PAUSTOP") { field(DESC, "Setup for PAU Off") field(SDIS, "QUAD:LTUS:880: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, "QUAD:LTUS:880:MCORDEVNAME") { field(DESC, "PS device name") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, "PSC:LTUS:MG21:") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "QUAD:LTUS:880: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, "QUAD:LTUS:880:PSTYPE.RVAL") field(INPC, "QUAD:LTUS:880:TURNEDOFF.RVAL") field(INPD, "QUAD:LTUS:880:CONFIG.RVAL") field(INPE, "QUAD:LTUS:880:PSCATEGORY.RVAL") field(INPF, "QUAD:LTUS:880:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "QUAD:LTUS:880:AUTOCTRL.RVAL") field(INPJ, "QUAD:LTUS:880:OUTOFSERVICE.RVAL") field(INPL, "QUAD:LTUS:880:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "QUAD:LTUS:880:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "QUAD:LTUS:880:PAU") field(INPP, "QUAD:LTUS:880:CALBDISABLE.RVAL") field(INPQ, "QUAD:LTUS:880:PTRBDISABLE.RVAL") field(INPR, "QUAD:LTUS:880:TRIMDISABLE.RVAL") field(INPS, "QUAD:LTUS:880:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "QUAD:LTUS:880:FBCK") field(INPU, "QUAD:LTUS:880:TRIMTYPE.RVAL") field(INPV, "QUAD:LTUS:880:STDZDIRECT.RVAL") field(INPW, "QUAD:LTUS:880:DEGAUSENABLE.RVAL") field(FLNK, "QUAD:LTUS:880:HSTA") } record(longin, "QUAD:LTUS:880:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "QUAD:LTUS:880:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "QUAD:LTUS:880: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, "QUAD:LTUS:880: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, "QUAD:LTUS:880:CALBDISABLE") { field(DESC, "DAC Calb Disabled") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:880:PTRBDISABLE") { field(DESC, "Perturb Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:880:TRIMDISABLE") { field(DESC, "Trim Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:880: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 QUAD:LTUS:880:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses QUAD:LTUS:880:FBCK. # This PV should be replaced by QUAD:LTUS:880: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, "QUAD:LTUS:880: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, "QUAD:LTUS:880: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, "QUAD:LTUS:880: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, "") field(OMSL, "supervisory") field(FLNK, "QUAD:LTUS:880:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"QUAD:LTUS:880:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "QUAD:LTUS:880:OUTOFSERVICE NPP NMS") field(OUT, "QUAD:LTUS:880:ONLINE PP") } record(bo, "QUAD:LTUS:880:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "QUAD:LTUS:880: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, "1") } record(bo, "QUAD:LTUS:880: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, "1") } record(bo, "QUAD:LTUS:880: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, "QUAD:LTUS:880: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, "QUAD:LTUS:880: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, "QUAD:LTUS:880: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, "QUAD:LTUS:880: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, "QUAD:LTUS:880: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, "1") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:880: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, "1") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:880: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, "2") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:880: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, "0") field(ASG, "NOWRITE") field(FLNK, "QUAD:LTUS:880:TRIMTYPE") } record(stringout, "QUAD:LTUS:880:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "QUAD:LTUS:880:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "QUAD:LTUS:880:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "QUAD:LTUS:880:STATE.RVAL") field(INPB, "QUAD:LTUS:880:INTLKSUMY.RVAL") field(OUT, "QUAD:LTUS:880:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:LTUS:880: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, "QUAD:LTUS:880:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "QUAD:LTUS:880:STATE.RVAL") field(INPB, "QUAD:LTUS:880:INTLKSUMY.RVAL") field(OUT, "QUAD:LTUS:880:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:LTUS:880:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "QUAD:LTUS:880:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "QUAD:LTUS:880: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, "QUAD:LTUS:880:RAMPSTARTDLY") { field(DESC, "Tansition to ramp delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "2") } ######### For PSTYPE=2 Only ############# record(mbbo, "QUAD:LTUS:880: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, "QUAD:LTUS:880: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,"QUAD:LTUS:880: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("QUAD:LTUS:880:TURNEDOFF",3140,1907,0,1,"QUAD:LTUS:880:TURNEDOFF") #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "QUAD:LTUS:880:STATSUB") { field(DESC, "Build STATus ") field(INAM, "mgntInit") field(SNAM, "mgntSlcStat") field(INPA, "QUAD:LTUS:880:BACT.STAT") field(INPB, "QUAD:LTUS:880:BDES.STAT") field(INPC, "QUAD:LTUS:880:IRIPL.STAT") field(INPD, "PSC:LTUS:MG21:ISETPT.STAT") field(INPE, "PSC:LTUS:MG21:IACT.STAT") # 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, "QUAD:LTUS:880:BACT.SEVR") field(INPH, "QUAD:LTUS:880:BDES.SEVR") field(INPI, "QUAD:LTUS:880:IRIPL.SEVR") field(INPJ, "PSC:LTUS:MG21:ISETPT.SEVR") field(INPK, "PSC:LTUS:MG21:IACT.SEVR") # # 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, "QUAD:LTUS:880:STATE.RVAL") field(INPN, "QUAD:LTUS:880:STDZOK") field(INPO, "QUAD:LTUS:880:CALBOK") field(INPP, "QUAD:LTUS:880:OUTOFSERVICE.RVAL") field(INPQ, "QUAD:LTUS:880:CONFIG.RVAL") field(INPR, "QUAD:LTUS:880:HSTA") field(INPS, "QUAD:LTUS:880:CTRL.RVAL") field(INPT, "QUAD:LTUS:880:DEGAUSOK") field(INPV, "QUAD:LTUS:880: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, "QUAD:LTUS:880:STAT") } record(longout, "QUAD:LTUS:880:STAT") { field(DESC, "STAT sent to SLC") field(SCAN, "Passive") field(FLNK, "QUAD:LTUS:880:STATCTRLSUB") field(DOL, "QUAD:LTUS:880:STATSUB.VAL") field(OMSL, "closed_loop") } record(sSub, "QUAD:LTUS:880:STATCTRLSUB") { field(DESC, "Decode SLC STAT into mbbo") field(INAM, "mgntInit") field(SNAM, "mgntStatDecode") field(INPA, "QUAD:LTUS:880:STAT") field(INPB, "QUAD:LTUS:880:HSTA") field(INPD, "QUAD:LTUS:880:ONOFFCTRL.RVAL") field(FLNK, "QUAD:LTUS:880:STATMSG") } record(mbbo, "QUAD:LTUS:880: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, "QUAD:LTUS:880:UNAVAILGO") field(DOL, "QUAD:LTUS:880:STATCTRLSUB.W") } record(seq, "QUAD:LTUS:880:UNAVAILGO") { field(DESC, "Process UNAVAIL") field(DOL1, "QUAD:LTUS:880:STATSUB.U") field(LNK1, "QUAD:LTUS:880:UNAVAIL PP") } record(stringout, "QUAD:LTUS:880:SNLSTATMSG") { field(DTYP, "Soft Channel") } #! TextBox(TB0,820,1000,1200,1220,0,"Dialog",12,1,16777215,"QUAD:LTUS:880:STATUSSUB - future\nOverall device status - takes input from action snls, record sevrs, master snl(s) and outputs final status\n\nInputs:\nA - QUAD:LTUS:880:CTRLSTATUS - snl status\nB - MGNT:CTRLSTATUS - master list status\nC\nD - QUAD:LTUS:880: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,"QUAD:LTUS:880STATSUB\nformat control bo's into slc STAT\n\nInputs:\nA - QUAD:LTUS:880:STATUS\nC - QUAD:LTUS:880:ON\nD - QUAD:LTUS:880:STDZOK\nE - QUAD:LTUS:880:CALBOK\nF - QUAD:LTUS:880:BACTDRIFT (future)\nG -\nH- QUAD:LTUS:880:DACSTATUS\nI -QUAD:LTUS:880:ADCSTATUS\nJ - QUAD:LTUS:880:BACTSTATUS\nK - QUAD:LTUS:880:BDESSTATUS\nL - QUAD:LTUS:880:RIPLSTATUS\n\nOutput:\nP - QUAD:LTUS:880: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, "QUAD:LTUS:880: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, "QUAD:LTUS:880: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, "QUAD:LTUS:880: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, "QUAD:LTUS:880: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.6 #! DBDSTART #! DBD("../../../../dbd/mgntSoft.dbd") #! DBDEND record(stringout, "QUAD:LTUS:880:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:880:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "QUAD:LTUS:880:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "QUAD:LTUS:880:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "QUAD:LTUS:880:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "QUAD:LTUS:880:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "1") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "QUAD:LTUS:880: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, "QUAD:LTUS:880:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "QUAD:LTUS:880:TRIMTYPE.RVAL") field(INPB, "QUAD:LTUS:880:CONFIG.RVAL") field(OUT, "QUAD:LTUS:880:TRIMMAXNUM PP") } record(longout, "QUAD:LTUS:880: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, "QUAD:LTUS:880: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, "") field(OMSL, "supervisory") field(VAL, "20") field(OUT, "QUAD:LTUS:880:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "QUAD:LTUS:880: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, "") field(OMSL, "supervisory") field(VAL, "10") } record(bo, "QUAD:LTUS:880: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, "QUAD:LTUS:880: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, "QUAD:LTUS:880: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, "QUAD:LTUS:880:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "0") } record(ao, "QUAD:LTUS:880: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, "QUAD:LTUS:880:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "QUAD:LTUS:880: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, "QUAD:LTUS:880: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, "QUAD:LTUS:880:IMOVE") field(INPB, "QUAD:LTUS:880:IACT") field(INPC, "QUAD:LTUS:880:IRAMPRATE") field(INPD, "1.577") field(INPE, "QUAD:LTUS:880:TRIMDLYPCT") field(INPF, "QUAD:LTUS:880:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "QUAD:LTUS:880:RAMPTIME_LEFT PP") } record(longout, "QUAD:LTUS:880:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "QUAD:LTUS:880:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "QUAD:LTUS:880:RAMPDONE_CALC") } record(calc, "QUAD:LTUS:880:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "QUAD:LTUS:880:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "QUAD:LTUS:880:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "QUAD:LTUS:880: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, "QUAD:LTUS:880:RAMPTIME_LEFT") field(OUT, "QUAD:LTUS:880:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "QUAD:LTUS:880:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "QUAD:LTUS:880:RAMPTIME_LEFT NMS") field(OUT, "QUAD:LTUS:880:RAMPDONE PP") } record(bo, "QUAD:LTUS:880:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "QUAD:LTUS:880:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "QUAD:LTUS:880: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, "QUAD:LTUS:880: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(sSub, "QUAD:LTUS:880: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, "QUAD:LTUS:880:PSTYPE.RVAL") field(INPC, "QUAD:LTUS:880:TURNEDOFF.RVAL") field(INPD, "QUAD:LTUS:880:CONFIG.RVAL") field(INPE, "QUAD:LTUS:880:PSCATEGORY.RVAL") field(INPF, "QUAD:LTUS:880:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "QUAD:LTUS:880:AUTOCTRL.RVAL") field(INPJ, "QUAD:LTUS:880:OUTOFSERVICE.RVAL") field(INPL, "QUAD:LTUS:880:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "QUAD:LTUS:880:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "QUAD:LTUS:880:PAU") field(INPP, "QUAD:LTUS:880:CALBDISABLE.RVAL") field(INPQ, "QUAD:LTUS:880:PTRBDISABLE.RVAL") field(INPR, "QUAD:LTUS:880:TRIMDISABLE.RVAL") field(INPS, "QUAD:LTUS:880:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "QUAD:LTUS:880:FBCK") field(INPU, "QUAD:LTUS:880:TRIMTYPE.RVAL") field(INPV, "QUAD:LTUS:880:STDZDIRECT.RVAL") field(INPW, "QUAD:LTUS:880:DEGAUSENABLE.RVAL") field(FLNK, "QUAD:LTUS:880:HSTA") } record(longin, "QUAD:LTUS:880:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "QUAD:LTUS:880:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "QUAD:LTUS:880: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, "QUAD:LTUS:880: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, "QUAD:LTUS:880:CALBDISABLE") { field(DESC, "DAC Calb Disabled") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:880:PTRBDISABLE") { field(DESC, "Perturb Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:880:TRIMDISABLE") { field(DESC, "Trim Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:LTUS:880:STDZDISABLE") { field(DTYP, "Raw Soft Channel") field(ZNAM, "NO") field(ONAM, "YES") field(DESC, "Standardize Function") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } # This PV has been replaced by QUAD:LTUS:880:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses QUAD:LTUS:880:FBCK. # This PV should be replaced by QUAD:LTUS:880: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, "QUAD:LTUS:880: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, "QUAD:LTUS:880: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, "QUAD:LTUS:880: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, "") field(OMSL, "supervisory") field(FLNK, "QUAD:LTUS:880:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"QUAD:LTUS:880:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "QUAD:LTUS:880:OUTOFSERVICE NPP NMS") field(OUT, "QUAD:LTUS:880:ONLINE PP") } record(bo, "QUAD:LTUS:880:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "QUAD:LTUS:880: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, "1") } record(bo, "QUAD:LTUS:880: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, "1") } record(bo, "QUAD:LTUS:880: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, "QUAD:LTUS:880: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, "QUAD:LTUS:880: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, "QUAD:LTUS:880: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, "QUAD:LTUS:880: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, "QUAD:LTUS:880: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, "1") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:880: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, "1") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:880: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, "2") field(ASG, "NOWRITE") } record(mbbo, "QUAD:LTUS:880: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, "0") field(ASG, "NOWRITE") field(FLNK, "QUAD:LTUS:880:TRIMTYPE") } record(stringout, "QUAD:LTUS:880:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "QUAD:LTUS:880:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "QUAD:LTUS:880:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "QUAD:LTUS:880:STATE.RVAL") field(INPB, "QUAD:LTUS:880:INTLKSUMY.RVAL") field(OUT, "QUAD:LTUS:880:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:LTUS:880: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, "QUAD:LTUS:880:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "QUAD:LTUS:880:STATE.RVAL") field(INPB, "QUAD:LTUS:880:INTLKSUMY.RVAL") field(OUT, "QUAD:LTUS:880:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:LTUS:880:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "QUAD:LTUS:880:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "QUAD:LTUS:880: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, "QUAD:LTUS:880:RAMPSTARTDLY") { field(DESC, "Tansition to ramp delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "2") } ######### For PSTYPE=2 Only ############# record(mbbo, "QUAD:LTUS:880: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, "QUAD:LTUS:880: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,"QUAD:LTUS:880: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("QUAD:LTUS:880:TURNEDOFF",3140,1907,0,1,"QUAD:LTUS:880:TURNEDOFF") #! 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, "BEND:UNDS:3510:IACT") { field(DESC, "Current") field(INP, "PSC:UNDS:MG01:IACT") field(EGU, "A") field(HOPR, "9.0") field(LOPR, "-9.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "BEND:UNDS:3510:BACT") info(autosaveFields,"HYST") } record(bi, "BEND:UNDS:3510:STATE") { field(DESC, "PS On/Off Status") field(DTYP, "Raw Soft Channel") field(INP, "PSC:UNDS:MG01:STATE NPP MS") field(ZSV, "MAJOR") field(ZNAM, "OFF") field(ONAM, "ON") } record(ao, "BEND:UNDS:3510:IDES") { field(DESC, "Desired Current") field(PREC, "3") field(EGU, "A") field(HOPR, "9.0") field(LOPR, "-9.0") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(MDEL, "-1") field(HIHI, "9.0") field(LOLO, "-9.0") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "BEND:UNDS:3510:BDELTAS") field(DRVH, "9.0") field(DRVL, "-9.0") field(DOL, "BEND:UNDS:3510: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, "BEND:UNDS:3510:ICTRL PP") } # This record is processed by BEND:UNDS:3510:ICON") # Note: we are not setting alarms here. record(ao, "BEND:UNDS:3510:ICON") { field(DESC, "Config I") field(DTYP, "Soft Channel") field(PREC, "3") field(HOPR, "9.0") field(LOPR, "-9.0") field(DRVH, "9.0") field(DRVL, "-9.0") field(DOL, "BEND:UNDS:3510:B2ICON.K") field(OMSL, "closed_loop") info(autosaveFields,"VAL") } record(ao, "BEND:UNDS:3510:INOM") { field(DESC, "Nominal Current") field(DOL, "BEND:UNDS:3510:BNOM.K") field(OMSL, "closed_loop") field(PREC, "3") field(EGU, "A") field(DRVH, "9.0") field(DRVL, "-9.0") field(HOPR, "9.0") field(LOPR, "-9.0") } record(ao, "BEND:UNDS:3510:ICTRL") { field(DESC, "Set Current") field(PREC, "3") field(EGU, "A") field(HOPR, "9.0") field(LOPR, "-9.0") field(DRVH, "9.0") field(DRVL, "-9.0") field(MDEL, "-1") field(FLNK, "BEND:UNDS:3510:ICTRLGO") field(OMSL, "supervisory") info(autosavefields,"VAL") } record(seq, "BEND:UNDS:3510:ICTRLGO") { field(DESC, "Process Current Setpoint") field(PREC, "3") # Set ISETPT to supervisory field(DOL1, "0") field(LNK1, "BEND:UNDS:3510:ISETPT.OMSL") field(DOL2, "BEND:UNDS:3510:ICTRL") field(LNK2, "BEND:UNDS:3510:ISETPT PP") # Set ISETPT to closed loop - get data from BCTRLSUB.K field(DOL3, "1") field(LNK3, "BEND:UNDS:3510:ISETPT.OMSL") } record(ao, "BEND:UNDS:3510:IMAX") { field(DESC, "Max I") field(DTYP, "Soft Channel") field(DRVH, "9.0") field(DRVL, "-9.0") field(EGU, "A") field(HOPR, "9.0") field(LOPR, "-9.0") field(PREC, "3") field(PINI, "YES") field(VAL, "9.0") field(FLNK, "BEND:UNDS:3510:IMIN") } record(ao, "BEND:UNDS:3510:IMIN") { field(DESC, "Min I") field(DTYP, "Soft Channel") field(DRVH, "9.0") field(DRVL, "-9.0") field(EGU, "A") field(HOPR, "9.0") field(LOPR, "-9.0") field(PREC, "3") field(VAL, "-9.0") field(FLNK, "BEND:UNDS:3510:IRANGE") } record(sel, "BEND:UNDS:3510:IACTPREVOK") { field(DESC, "Last Good Current") field(EGU, "A") field(HOPR, "9.0") field(LOPR, "-9.0") field(PREC, "3") field(NVL, "BEND:UNDS:3510:BACT.SEVR") field(INPA, "BEND:UNDS:3510:IACT NPP MS") field(INPB, "BEND:UNDS:3510:IACTPREVOK NPP MS") field(INPC, "BEND:UNDS:3510:IACTPREVOK NPP MS") field(INPD, "BEND:UNDS:3510:IACTPREVOK NPP MS") } record(sub, "BEND:UNDS:3510:IACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "BEND:UNDS:3510:IDES") field(INPB, "BEND:UNDS:3510:ISETPT.DRVH") field(INPC, "BEND:UNDS:3510:ISETPT.DRVL") field(INPD, "BEND:UNDS:3510:IDELTAS.I") field(INPE, "BEND:UNDS:3510:IDELTAS.J") field(INPG, "BEND:UNDS:3510:STATE") field(INPH, "BEND:UNDS:3510:HSTA") field(EGU, "A") field(HOPR, "9.0") field(LOPR, "-9.0") field(PREC, "3") field(BRSV, "INVALID") } record(sub, "BEND:UNDS:3510:IMONLIMITS") { field(DESC, "Aux Current Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "BEND:UNDS:3510:IDES") field(INPB, "BEND:UNDS:3510:ISETPT.DRVH") field(INPC, "BEND:UNDS:3510:ISETPT.DRVL") field(INPD, "BEND:UNDS:3510:IDELTAS.K") field(INPE, "BEND:UNDS:3510:IDELTAS.L") field(INPG, "BEND:UNDS:3510:STATE") field(INPH, "BEND:UNDS:3510:HSTA") field(EGU, "A") field(HOPR, "9.0") field(LOPR, "-9.0") field(PREC, "3") field(BRSV, "INVALID") } record(seq, "BEND:UNDS:3510:ILIMITS") { field(DESC, "Set ACT and MON Limits") field(PREC, "3") field(DOL1, "BEND:UNDS:3510:BLIMITS") field(LNK1, "BEND:UNDS:3510:IACTLIMITS.F PP") field(DOL2, "BEND:UNDS:3510:IACTLIMITS.I") field(LNK2, "BEND:UNDS:3510:IACT.HIGH") field(DOL3, "BEND:UNDS:3510:IACTLIMITS.J") field(LNK3, "BEND:UNDS:3510:IACT.LOW") field(DOL4, "BEND:UNDS:3510:IACTLIMITS.K") field(LNK4, "BEND:UNDS:3510:IACT.HIHI") field(DOL5, "BEND:UNDS:3510:IACTLIMITS.L") field(LNK5, "BEND:UNDS:3510:IACT.LOLO") field(DOL6, "BEND:UNDS:3510:BLIMITS") field(LNK6, "BEND:UNDS:3510:IMONLIMITS.F PP") field(DOL7, "BEND:UNDS:3510:IMONLIMITS.I") field(LNK7, "BEND:UNDS:3510:IMON.HIGH") field(DOL8, "BEND:UNDS:3510:IMONLIMITS.J") field(LNK8, "BEND:UNDS:3510:IMON.LOW") field(DOL9, "BEND:UNDS:3510:IMONLIMITS.K") field(LNK9, "BEND:UNDS:3510:IMON.HIHI") field(DOLA, "BEND:UNDS:3510:IMONLIMITS.L") field(LNKA, "BEND:UNDS:3510: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, "BEND:UNDS:3510:IDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntRawDeltas") field(INPD, "BEND:UNDS:3510:TRIMBTOL") field(INPE, "BEND:UNDS:3510:CHCKBTOL") field(INPF, "BEND:UNDS:3510:BDELTAS.K") field(INPG, "BEND:UNDS:3510:BDELTAS.L") field(INPH, "BEND:UNDS:3510: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, "BEND:UNDS:3510:STDZITOLR") field(INPC, "BEND:UNDS:3510:STDZITOL") field(FLNK, "") } # All ps controllers with on/off control will set the macro ONOF # as follows: # # ONOF = PSC:UNDS:MG01: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, "BEND:UNDS:3510:STATESETPT") { field(DESC, "PS On/Off") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFF") field(ONAM, "ON") field(OUT, "PSC:UNDS:MG01:STATESETPT PP") 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 = PSC:UNDS:MG01:RESET PP # record(bo, "BEND:UNDS:3510:RESET") { field(DESC, "Interlock Latch Reset") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFF") field(ONAM, "ON") field(HIGH, "1.0") field(OUT, "PSC:UNDS:MG01:RESET PP") } record(bo, "BEND:UNDS:3510:RAMPSTATE") { field(DESC, "PS Ramp Status") field(DTYP, "Soft Channel") field(DOL, "PSC:UNDS:MG01:RAMPSTATE NPP 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, "BEND:UNDS:3510: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, "BEND:UNDS:3510:TRIMRAMPRATE") field(OUT, "PSC:UNDS:MG01:IRAMPRATE PP") field(FLNK, "BEND:UNDS:3510:STDZDLY") } record(ao, "BEND:UNDS:3510:ISETPT") { field(DESC, "Current Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(EGU, "A") field(HOPR, "9.0") field(LOPR, "-9.0") field(DRVH, "9.0") field(DRVL, "-9.0") field(MDEL, "-1") field(OUT, "PSC:UNDS:MG01:ISETPT PP") field(DOL, "BEND:UNDS:3510: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, "BEND:UNDS:3510:IMON") { field(DESC, "Aux Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(INP, "PSC:UNDS:MG01:IMON") field(EGU, "A") field(HOPR, "9.0") field(LOPR, "-9.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "BEND:UNDS:3510:BMON") } record(ao, "BEND:UNDS:3510:IRIPL") { field(DESC, "Ripple Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(DOL, "PSC:UNDS:MG01:IRIPL NPP NMS") field(OMSL, "closed_loop") field(EGU, "A") field(DRVH, "1.0") field(HOPR, "1.0") field(PREC, "3") field(FLNK, "BEND:UNDS:3510:IRIPLOK") } record(sub, "BEND:UNDS:3510:IRIPLOK") { field(DESC, "Ripple Current Status") field(INAM, "mgntInit") field(SNAM, "mgntRiplOK") field(INPA, "BEND:UNDS:3510:IRIPL.VAL") field(INPB, "BEND:UNDS:3510: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, "BEND:UNDS:3510:R") { field(DESC, "Resistance") field(EGU, "Ohms") field(PREC, "4") field(PINI, "YES") field(DOL, "PSC:UNDS:MG01:R NPP MS") 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, "BEND:UNDS:3510:IGND") { field(DESC, "Ground Current") field(EGU, "A") field(PREC, "6") field(PINI, "YES") field(DOL, "PSC:UNDS:MG01:IGND NPP MS") field(OMSL, "closed_loop") } record(bi, "BEND:UNDS:3510:INTLKSUMY") { field(DESC, "Interlock Summary") field(INP, "PSC:UNDS:MG01:INTLKSUMY NPP MS") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(ZNAM, "OK") field(ONAM, "FAULT") field(PINI, "NO") } record(mbbo, "BEND:UNDS:3510: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, "PSC:UNDS:MG01:COOLING") field(OMSL, "closed_loop") } # The following PV is processed by :BACTFO # which is processed by :BACT record(fanout, "BEND:UNDS:3510:IACTFO") { field(DESC, "IACT processing") field(SELM, "All") field(LNK1, "BEND:UNDS:3510:IACTPREVOK") field(LNK2, "BEND:UNDS:3510:IDIFF") field(LNK3, "BEND:UNDS:3510:IADIFF") field(LNK4, "BEND:UNDS:3510:IRATIO") field(LNK5, "BEND:UNDS:3510:IDIRECT") field(LNK6, "BEND:UNDS:3510:IACTPOL_CHECK") } record(calc, "BEND:UNDS:3510:IDIFF") { field(DESC, "IDES-IACT") field(CALC, "A-B") field(INPA, "BEND:UNDS:3510:IDES") field(INPB, "BEND:UNDS:3510:IACT") field(EGU, "A") field(PREC, "9") field(HOPR, "9.0") field(LOPR, "-9.0") } record(calc, "BEND:UNDS:3510:IADIFF") { field(DESC, "Absolute IDES-IACT") field(CALC, "A<0?ABS(A):A") field(INPA, "BEND:UNDS:3510:IDIFF") field(PREC, "9") } record(calc, "BEND:UNDS:3510:IRATIO") { field(DESC, "IDES-IACT/IMAX") field(CALC, "B?A/B:0") field(INPA, "BEND:UNDS:3510:IDIFF") field(INPB, "BEND:UNDS:3510:IDES.DRVH") field(PREC, "9") } record(calcout, "BEND:UNDS:3510:IRANGE") { field(DESC, "Current Range") field(PINI, "YES") field(CALC, "ABS(A-B)") field(INPA, "BEND:UNDS:3510:IMIN") field(INPB, "BEND:UNDS:3510: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, "BEND:UNDS:3510: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, "BEND:UNDS:3510:IACT") field(FLNK, "BEND:UNDS:3510:IACTPOL") } record(bo, "BEND:UNDS:3510:IACTPOL") { field(DESC, "Actual I Polarity") field(DTYP, "Raw Soft Channel") field(DOL, "BEND:UNDS:3510: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,"BEND:UNDS:3510:I*LIMITS:\n Calculate alarm and warning limits based on \n deltas from BEND:UNDS:3510:IDELTAS and the\n BEND:UNDS:3510: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,"BEND:UNDS:3510:IACT: \n Get copy of BEND:UNDS:3510:I. \n",null) #! TextBox(TB12,1280,3100,1760,3200,0,"Dialog",12,1,16777215,"BEND:UNDS:3510: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,"BEND:UNDS:3510:IDES:\n Contains raw value calculated by \nBEND:UNDS:3510: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 \nBEND:UNDS:3510:BDELTAS.\n",null) #! TextBox(TB10,56,1940,316,2340,0,"Dialog",12,1,16777215,"BEND:UNDS:3510: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 BEND:UNDS:3510: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 BEND:UNDS:3510: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,"BEND:UNDS:3510:ISETPT:\n Sets the hardware. When fast feedback is set on, this record is\n set to closed loop mode by BEND:UNDS:3510:FBCKSTART sequence. When \n the loop is closed, this record takes input calculated by \n BFBCK only. When fast feedback is set off, BEND:UNDS:3510:FBCKSTOP \n will set it back to supervisory so that the value can be set by \n BEND:UNDS:3510: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, "BEND:UNDS:3510:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "BEND:UNDS:3510:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "BEND:UNDS:3510:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "BEND:UNDS:3510:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "BEND:UNDS:3510:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "BEND:UNDS:3510:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "1") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "BEND:UNDS:3510: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, "BEND:UNDS:3510:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "BEND:UNDS:3510:TRIMTYPE.RVAL") field(INPB, "BEND:UNDS:3510:CONFIG.RVAL") field(OUT, "BEND:UNDS:3510:TRIMMAXNUM PP") } record(longout, "BEND:UNDS:3510: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, "BEND:UNDS:3510: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, "") field(OMSL, "supervisory") field(VAL, "10") field(OUT, "BEND:UNDS:3510:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "BEND:UNDS:3510: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, "") field(OMSL, "supervisory") field(VAL, "10") } record(bo, "BEND:UNDS:3510: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, "BEND:UNDS:3510: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, "BEND:UNDS:3510: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, "BEND:UNDS:3510:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "0") } record(ao, "BEND:UNDS:3510: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, "BEND:UNDS:3510:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "BEND:UNDS:3510: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, "BEND:UNDS:3510: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, "BEND:UNDS:3510:IMOVE") field(INPB, "BEND:UNDS:3510:IACT") field(INPC, "BEND:UNDS:3510:IRAMPRATE") field(INPD, "1.577") field(INPE, "BEND:UNDS:3510:TRIMDLYPCT") field(INPF, "BEND:UNDS:3510:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "BEND:UNDS:3510:RAMPTIME_LEFT PP") } record(longout, "BEND:UNDS:3510:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "BEND:UNDS:3510:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "BEND:UNDS:3510:RAMPDONE_CALC") } record(calc, "BEND:UNDS:3510:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "BEND:UNDS:3510:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "BEND:UNDS:3510:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "BEND:UNDS:3510: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, "BEND:UNDS:3510:RAMPTIME_LEFT") field(OUT, "BEND:UNDS:3510:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "BEND:UNDS:3510:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "BEND:UNDS:3510:RAMPTIME_LEFT NMS") field(OUT, "BEND:UNDS:3510:RAMPDONE PP") } record(bo, "BEND:UNDS:3510:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "BEND:UNDS:3510:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "BEND:UNDS:3510: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, "BEND:UNDS:3510: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, "BEND:UNDS:3510:STDZINIT") { field(DESC, "Proc. Stdz PVs on boot") field(PINI, "YES") field(DOL1, "1") field(DOL2, "1") field(DOL3, "1") field(LNK1, "BEND:UNDS:3510:DEBUG.PROC PP") field(LNK2, "BEND:UNDS:3510:STDZCYCLENUM.PROC PP") field(LNK3, "BEND:UNDS:3510:STDZDISABLE.PROC PP") field(LNK4, "BEND:UNDS:3510: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, "BEND:UNDS:3510:STDZSUB") { field(DESC, "Stdz subroutine") field(INAM, "mgntStdzInit") field(SNAM, "mgntStdz") field(BRSV, "INVALID") field(INPA, "BEND:UNDS:3510:STDZIMIN NPP NMS") field(INPB, "BEND:UNDS:3510:STDZIMAX NPP NMS") field(INPC, "BEND:UNDS:3510:STDZIFINAL NPP NMS") field(INPD, "BEND:UNDS:3510:STDZCYCLENUM NPP NMS") field(INPE, "BEND:UNDS:3510:STDZDIRECT.RVAL NPP NMS") field(INPF, "BEND:UNDS:3510:STDZDISABLE.RVAL CPP NMS") field(INPG, "BEND:UNDS:3510: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, "BEND:UNDS:3510:STDZWF PP") field(OUTB, "BEND:UNDS:3510: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, "BEND:UNDS:3510:STDZWF") } record(mbbo, "BEND:UNDS:3510: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, "BEND:UNDS:3510: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, "BEND:UNDS:3510:STDZMAINPS") { field(DESC, "Stdz by main or self") field(PINI, "YES") field(DTYP, "Soft Channel") field(ZNAM, "SELF") field(ONAM, "MAIN") } record(bo, "BEND:UNDS:3510: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, "BEND:UNDS:3510: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, "BEND:UNDS:3510: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, "BEND:UNDS:3510:STDZTOD") { field(DESC, "Successful Standardize Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "BEND:UNDS:3510:STDZLOSTTOD") { field(DESC, "Standardize Lost Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(longout, "BEND:UNDS:3510:STDZCYCLECNT") { field(DESC, "Cycle Count") field(PINI, "YES") } record(longout, "BEND:UNDS:3510:STDZCYCLENUM") { field(DESC, "No. Standardize Cycles") field(VAL, "3") field(HOPR, "10") field(LOPR, "0") field(DRVH, "10") field(DRVL, "0") field(PINI, "YES") field(FLNK, "BEND:UNDS:3510:STDZDIRECT") } # The default standardize direction is "UP" for # all LCLS Magnets.. record(bo, "BEND:UNDS:3510:STDZDIRECT") { field(DESC, "Standardize Direction ") field(ZNAM, "UP") field(ONAM, "DOWN") field(VAL, "0") field(FLNK, "BEND:UNDS:3510:STDZIMIN") } record(ao, "BEND:UNDS:3510:STDZIMIN") { field(DESC, "Min-STDZ Current") field(PREC, "1") field(EGU, "A") field(HOPR, "9.0") field(LOPR, "-9.0") field(VAL, "-9.0") field(FLNK, "BEND:UNDS:3510:STDZIMAX") } record(ao, "BEND:UNDS:3510:STDZIMAX") { field(DESC, "Max. Standarize Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "9.0") field(LOPR, "-9.0") field(VAL, "9.0") field(FLNK, "BEND:UNDS:3510:STDZIFINAL") } record(ao, "BEND:UNDS:3510:STDZIFINAL") { field(DESC, "Final SDTZ Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "9.0") field(LOPR, "-9.0") field(VAL, "-9.0") field(FLNK, "BEND:UNDS:3510: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, "BEND:UNDS:3510: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, "BEND:UNDS:3510:STDZITOL") { field(DESC, "Stdz min tolerance") field(PREC, "5") field(CALC, "MAX(ABS(A),ABS(B))*C") field(INPA, "BEND:UNDS:3510:STDZIMIN CP NMS") field(INPB, "BEND:UNDS:3510:STDZIMAX CP MMS") field(INPC, "0.05") field(INPD, "BEND:UNDS:3510:STDZITOLR CP MMS") field(EGU, "A") field(FLNK, "BEND:UNDS:3510:IDELTAS") field(PINI, "YES") } # D - factor (3.154/2 = 1.577) for EPSC, otherwise, set to 1.0 record(calc, "BEND:UNDS:3510:STDZDLY") { field(DESC, "Ramp time for stdz cycle") field(CALC, "C>0?MAX(1,ABS((A-B)/C)*D):0") field(INPA, "BEND:UNDS:3510:STDZIMIN CP NMS") field(INPB, "BEND:UNDS:3510:STDZIMAX CP NMS") field(INPC, "BEND:UNDS:3510:TRIMRAMPRATE CP NMS") field(INPD, "1.577") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") } record(calc, "BEND:UNDS:3510:STDZRAMPDLY") { field(DESC, "Ramp delay total") field(CALC, "MAX(1,((A/100)*B+B))") field(PREC, "5") field(INPA, "BEND:UNDS:3510:TRIMDLYPCT CP MS") field(INPB, "BEND:UNDS:3510: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, "BEND:UNDS:3510:STDZMINIDLY") { field(DESC, "Mini-stdz delay") field(CALC, "A") field(PREC, "5") field(A, "1.0") field(EGU, "sec") field(PINI, "YES") } record(ao, "BEND:UNDS:3510: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, "BEND:UNDS:3510:STDZMINIDELTA") { field(DESC, "Stdz mini % of IMAX") field(CALC, "(B/100)*(A-C)") field(INPA, "BEND:UNDS:3510:IDES.HOPR") field(INPB, "BEND:UNDS:3510:STDZMINIPCT CPP NMS") field(INPC, "BEND:UNDS:3510:IDES.LOPR") field(PREC, "5") } record(calc, "BEND:UNDS:3510:STDZMINISETPT") { field(DESC, "Mini Stdz delta") field(CALC, "C==0?MAX(E-D,B):MIN(E+D,A)") field(INPA, "BEND:UNDS:3510:IDES.HOPR") field(INPB, "BEND:UNDS:3510:IDES.LOPR") field(INPC, "BEND:UNDS:3510:STDZDIRECT.RVAL") field(INPD, "BEND:UNDS:3510:STDZMINIDELTA") field(INPE, "BEND:UNDS:3510:IDES") field(PREC, "5") field(FLNK, "BEND:UNDS:3510: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, "BEND:UNDS:3510:STDZMINISETPTOOR") { field(DESC, "Mini Stdz setpoint out of range") field(CALC, "C==0?(E-DA)") field(INPA, "BEND:UNDS:3510:IDES.HOPR") field(INPB, "BEND:UNDS:3510:IDES.LOPR") field(INPC, "BEND:UNDS:3510:STDZDIRECT.RVAL") field(INPD, "BEND:UNDS:3510:STDZMINIDELTA") field(INPE, "BEND:UNDS:3510: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, "BEND:UNDS:3510: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, "BEND:UNDS:3510:IADJUST.RVAL") field(INPB, "BEND:UNDS:3510:STDZDIRECT.RVAL") field(INPC, "BEND:UNDS:3510:STDZOK.RVAL") field(INPD, "BEND:UNDS:3510:STDZDISABLE.RVAL") field(INPE, "BEND:UNDS:3510:STATE.RVAL CPP NMS") field(INPF, "BEND:UNDS:3510:ICTRL.RVAL") field(INPG, "BEND:UNDS:3510:STATE.SEVR") field(INPH, "BEND:UNDS:3510:BDELTAS.M") field(INPI, "BEND:UNDS:3510:IACT.SEVR") field(OUT, "BEND:UNDS:3510:STDZLOSTGO.SELN PP NMS") field(OOPT, "Transition To Non-zero") } record(seq, "BEND:UNDS:3510:STDZLOSTGO") { field(DESC, "Process lost stdz") field(SELM, "Mask") field(DOL1, "1") field(DOL2, "0") field(LNK1, "BEND:UNDS:3510:STDZLOSTTOD.PROC") field(LNK2, "BEND:UNDS:3510:STDZOK PP") } # Record maximum current after standardize # Reset to IACT from sequence after trim # Disable processing during (mini-)standardize or trim record(calc, "BEND:UNDS:3510:STDZIACTMAX") { field(DESC, "Max act current after stdz") field(CALC, "MAX(A, B)") field(DISV, "0") field(SDIS, "BEND:UNDS:3510:CHECKPWRDIP_ENABLE") field(INPA, "BEND:UNDS:3510:IACT CP") field(INPB, "BEND:UNDS:3510:STDZIACTMAX") field(EGU, "A") field(FLNK, "BEND:UNDS:3510:CHECKPWRDIP") } # Detect power dip if STDZOK is YES, STDZ is enabled, and IACT is valid # If IACT drops below STDZIACTMAX by more than the trim tolerance, clear STDZOK # Warning: Take the absolute value of the trim tolerance, or else quads of # negative polarity will always lose STDZ since their IDELTAS.I are negative. # Note: Large quads and bends are prone to losing STDZ even if they are # perturbed toward higher current since their current tends to overshoot # by greater than the trim tolerance before settling down. record(calcout, "BEND:UNDS:3510:CHECKPWRDIP") { field(DESC, "Detect power dip") field(CALC, "(A-B>ABS(C))?3:0") field(DISV, "0") field(SDIS, "BEND:UNDS:3510:CHECKPWRDIP_ENABLE") field(INPA, "BEND:UNDS:3510:STDZIACTMAX") field(INPB, "BEND:UNDS:3510:IACT") field(INPC, "BEND:UNDS:3510:IDELTAS.I") field(OUT, "BEND:UNDS:3510:STDZLOSTGO.SELN PP NMS") field(OOPT, "When Non-zero") } # Enable processing of STDZIACTMAX and CHECKPWRDIP only if # STDZOK = YES, STDZDISABLE = NO, CTRL != Trim (2), and # CTRL != Stdz (4) record(calc, "BEND:UNDS:3510:CHECKPWRDIP_ENABLE") { field(CALC, "A&&!B&&(C#2)&&(C#4)") field(INPA, "BEND:UNDS:3510:STDZOK.RVAL CP") field(INPB, "BEND:UNDS:3510:STDZDISABLE.RVAL CP") field(INPC, "BEND:UNDS:3510:CTRL.RVAL CP") } #! 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, "BEND:UNDS:3510: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, "BEND:UNDS:3510:CALBOK") { field(DESC, "Successful Calibration") field(DTYP, "Raw Soft Channel") field(ZNAM, "NO") field(ONAM, "YES") field(DOL, "PSC:UNDS:MG01:CALBOK.RVAL") field(OMSL, "closed_loop") 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, "BEND:UNDS:3510:CALBSET") { field(DESC, "Use DAC Calbration") field(SCAN, "10 second") field(CALC, "A&&(B==0)&&C?31:960") field(INPA, "BEND:UNDS:3510:CALBOK") field(INPB, "BEND:UNDS:3510:CALBDISABLE") field(INPC, "BEND:UNDS:3510:CALBSLOPE") field(OOPT, "On Change") field(OUT, "BEND:UNDS:3510: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, "BEND:UNDS:3510:CALB_SEQ") { field(DESC, "Output Calib Values") field(SELM, "Mask") field(SELL, "BEND:UNDS:3510: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, "BEND:UNDS:3510:CALBSLOPE") field(DOL3, "BEND:UNDS:3510: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, "BEND:UNDS:3510:CALBTOD") { field(DESC, "Calibration Success Time") field(PINI, "YES") field(DOL, "PSC:UNDS:MG01:CALBTOD") field(OMSL, "closed_loop") field(DTYP, "Soft Channel") info(autosaveFields,"VAL") } record(ao, "BEND:UNDS:3510: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, "BEND:UNDS:3510: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, "BEND:UNDS:3510: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, "BEND:UNDS:3510:CALBOFFSET") { field(DESC, "Calc DAC Offset") field(PREC, "6") field(EGU, "Counts") field(PINI, "YES") } record(bo, "BEND:UNDS:3510: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, "BEND:UNDS:3510:DACSLOPE") { field(DESC, "V to DAC slope") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "closed_loop") field(PINI, "YES") field(FLNK, "BEND:UNDS:3510:DACOFFSET") } # Default Offset used in conversion from Volts to DAC Counts record(ao, "BEND:UNDS:3510:DACOFFSET") { field(DESC, "V to DAC offset") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "closed_loop") field(PINI, "YES") field(FLNK, "BEND:UNDS:3510: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, "BEND:UNDS:3510: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, "BEND:UNDS:3510:IACT") field(INPD, "BEND:UNDS:3510:DACSLOPE") field(INPE, "BEND:UNDS:3510:DACOFFSET") field(EGU, "Counts") field(PREC, "6") } record(ao, "BEND:UNDS:3510:DAC") { field(DESC, "DAC Set point") field(EGU, "Counts") field(DOL, "") field(OMSL, "closed_loop") field(PREC, "6") field(PINI, "YES") } record(ao, "BEND:UNDS:3510:CALBIMIN") { field(DESC, "Calibration Min Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(DRVH, "9.0") field(HOPR, "9.0") field(DRVL, "-9.0") field(LOPR, "-9.0") field(PREC, "3") field(EGU, "A") field(VAL, "0.0") field(FLNK, "BEND:UNDS:3510:CALBIMAX") } record(ao, "BEND:UNDS:3510:CALBIMAX") { field(DESC, "Calibration Max Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(DRVH, "9.0") field(HOPR, "9.0") field(LOPR, "-9.0") field(DRVL, "-9.0") field(EGU, "A") field(VAL, "9.0") field(FLNK, "BEND:UNDS:3510:CALBSTEPNUM") } record(ao, "BEND:UNDS:3510:CALBIFINAL") { field(DESC, "Calibration Last Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(PREC, "3") field(EGU, "A") field(HOPR, "9.0") field(LOPR, "-9.0") field(VAL, "0") } record(longout, "BEND:UNDS:3510: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, "BEND:UNDS:3510:CALBIDELTA") } record(calc, "BEND:UNDS:3510:CALBIDELTA") { field(DESC, "Step size for CALB") field(CALC, "C=0?0:ABS((A-B)/C)") field(INPA, "BEND:UNDS:3510:CALBIMAX") field(INPB, "BEND:UNDS:3510:CALBIMIN") field(INPC, "BEND:UNDS:3510: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, "BEND:UNDS:3510:CALBIMULT") { field(DESC, "IACT vs ISETPT mult") field(CALC, "C#0||A=0?1:ABS(B/A)") field(INPA, "PSC:UNDS:MG01:ISETPT.DRVH") field(INPB, "PSC:UNDS:MG01:IACT.HOPR") field(INPC, "BEND:UNDS:3510:PSCONTROLLER.RVAL CPP") field(EGU, "A") field(PINI, "YES") } # SNL dbputs DAC values here. 6-10 steps are possible. record(waveform, "BEND:UNDS:3510:CALBICTRLWF") { field(DESC, "ICTRL setpoint array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") } record(waveform, "BEND:UNDS:3510:DACWF") { field(DESC, "DAC count array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "BEND:UNDS:3510:DACSA") } # Used only for xygraph edm plot record(subArray, "BEND:UNDS:3510:DACSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "BEND:UNDS:3510: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, "BEND:UNDS:3510:CALCDACWF") { field(DESC, "Calc DAC counts array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "BEND:UNDS:3510:CALCDACSA") } # Used only for xygraph edm plot record(subArray, "BEND:UNDS:3510:CALCDACSA") { field(DESC, "Calc DAC counts") field(DTYP, "Soft Channel") field(INP, "BEND:UNDS:3510: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, "BEND:UNDS:3510:CALBYWF") { field(DESC, "mx + b") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "BEND:UNDS:3510:CALBYSA") } # Used only for xygraph edm plot record(subArray, "BEND:UNDS:3510:CALBYSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "BEND:UNDS:3510:CALBYWF") field(MALM, "10") field(NELM, "6") field(INDX, "0") field(FTVL, "DOUBLE") } record(waveform, "BEND:UNDS:3510:CALBIACTWF") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "BEND:UNDS:3510:CALBIACTSA") } # Used only for xygraph edm plot record(subArray, "BEND:UNDS:3510:CALBIACTSA") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(MALM, "10") field(NELM, "6") field(INP, "BEND:UNDS:3510:CALBIACTWF") field(INDX, "0") field(FTVL, "DOUBLE") field(FLNK, "BEND:UNDS:3510:CALBLIMITS") } # Check that measured current during calibration is within # tolerance. record(aSub, "BEND:UNDS:3510: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, "BEND:UNDS:3510:CALBSTEPNUM") field(INPB, "BEND:UNDS:3510:CALBIACTWF") field(INPC, "BEND:UNDS:3510: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, "BEND:UNDS:3510: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, "BEND:UNDS:3510:STDZITOL") field(INPH, "BEND:UNDS:3510:DACSLOPE") field(INPI, "BEND:UNDS:3510: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, "BEND:UNDS:3510: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, "BEND:UNDS:3510:CALBSTEPNUM") field(INPB, "BEND:UNDS:3510:CALBIACTWF") field(INPC, "BEND:UNDS:3510:DACWF") field(INPF, "BEND:UNDS:3510: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 BEND:UNDS:3510CALBOK 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, "BEND:UNDS:3510:DEGAUSINIT") { field(DESC, "Proc. Degauss PVs on boot") field(PINI, "YES") field(DOL, "1") field(OUTA, "BEND:UNDS:3510:DEGAUSIMIN.PROC PP") field(OUTB, "BEND:UNDS:3510:DEGAUSIMAX.PROC PP") field(OUTC, "BEND:UNDS:3510:DEGAUSTYPE.PROC PP") field(OUTD, "BEND:UNDS:3510:DEGAUSSTEP.PROC PP") field(OUTE, "BEND:UNDS:3510:MADNAME.PROC PP") field(OUTF, "BEND:UNDS:3510:PSTYPE.PROC PP") field(OUTG, "BEND:UNDS:3510: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, "BEND:UNDS:3510:DEGAUSSUB") { field(DESC, "Degauss subroutine") field(INAM, "mgntDegaussInit") field(SNAM, "mgntDegauss") field(BRSV, "INVALID") field(INPA, "BEND:UNDS:3510:DEGAUSIMIN NPP NMS") field(INPB, "BEND:UNDS:3510:DEGAUSIMAX NPP NMS") field(INPC, "BEND:UNDS:3510:DEGAUSTYPE.RVAL NPP NMS") field(INPE, "BEND:UNDS:3510:DEGAUSMETHOD.RVAL NPP NMS") field(INPF, "BEND:UNDS:3510:PSTYPE NPP NMS") field(INPG, "BEND:UNDS:3510:DEBUG.RVAL NPP NMS") field(INPH, "BEND:UNDS:3510: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, "BEND:UNDS:3510:DEGAUSWF PP") field(OUTB, "BEND:UNDS:3510:DEGAUSMSG PP") field(OUTC, "BEND:UNDS:3510: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, "BEND:UNDS:3510:DEGAUSWF") { field(DESC, "Degauss Setpts") field(NELM, "60") field(FTVL, "DOUBLE") } record(mbbo,"BEND:UNDS:3510: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, "BEND:UNDS:3510: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, "BEND:UNDS:3510: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, "BEND:UNDS:3510: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, "BEND:UNDS:3510: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, "BEND:UNDS:3510:DEGAUSIMIN") { field(DESC, "Min. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "9.0") field(LOPR, "-9.0") field(DRVH, "9.0") field(DRVL, "-9.0") field(VAL, "-9.0") } record(ao, "BEND:UNDS:3510:DEGAUSIMAX") { field(DESC, "Max. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "9.0") field(LOPR, "-9.0") field(DRVH, "9.0") field(DRVL, "-9.0") field(VAL, "9.0") } # 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,"BEND:UNDS:3510: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, "BEND:UNDS:3510: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,"BEND:UNDS:3510: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, "BEND:UNDS:3510: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, "BEND:UNDS:3510: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, "BEND:UNDS:3510: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, "BEND:UNDS:3510:DEGAUSTOD") { field(DESC, "Successful Degauss Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "BEND:UNDS:3510:DEGAUSLOSTTOD") { field(DESC, "Degauss Lost Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "BEND:UNDS:3510:DEGAUSTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "BEND:UNDS:3510:DEGAUSTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "BEND:UNDS:3510: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, "BEND:UNDS:3510:DEGAUSGO") { field(DESC, "Set bdes of btrms to zero") field(ASG, "Internal") field(OUTA, "") field(OUTB, "") field(OUTC, "") field(OUTD, "") } # =========== CRYO ONLY =========== record(bo, "BEND:UNDS:3510: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, "BEND:UNDS:3510:DEGAUS_IMAX_CHECK") { field(DESC, "Check if imax shoud chg") field(CALC, "(C==4)&&(ABS(B)>ABS(A))?1:0") field(INPA, "BEND:UNDS:3510:DEGAUS_IMAX") field(INPB, "BEND:UNDS:3510:ISETPT") field(INPC, "BEND:UNDS:3510:DEGAUSTYPE.RVAL") field(OUT, "BEND:UNDS:3510:DEGAUS_IMAX_UPDATE.SELN") field(FLNK, "BEND:UNDS:3510:DEGAUS_IMAX_UPDATE") } record(seq, "BEND:UNDS:3510:DEGAUS_IMAX_UPDATE") { field(DESC, "Degauss IMAX Update") field(SELM, "Specified") field(DOL1, "BEND:UNDS:3510:ISETPT") field(LNK1, "BEND:UNDS:3510:DEGAUS_IMAX PP") } # Set the maximum current after a successful # degauss. This pv is updated by the # sequence. record(ao, "BEND:UNDS:3510:DEGAUS_IMAX") { field(DESC, "Max I set afer a degauss") field(EGU, "Amps") field(PINI, "YES") field(PREC, "6") field(HOPR, "9.0") field(LOPR, "-9.0") field(DRVH, "9.0") field(DRVL, "-9.0") field(VAL, "9.0") field(FLNK, "BEND:UNDS:3510:DEGAUS_IMAXPOL_CHECK") info(autosaveFields,"VAL,RVAL") } # Set the polarity if degauss_imax record(calcout, "BEND:UNDS:3510:DEGAUS_IMAXPOL_CHECK") { field(DESC, "Determine polarity of imax") field(CALC, "A>=0?0:1") field(INPA, "BEND:UNDS:3510:DEGAUS_IMAX") field(FLNK, "BEND:UNDS:3510:DEGAUS_IMAXPOL") } record(bo, "BEND:UNDS:3510:DEGAUS_IMAXPOL") { field(DESC, "Polarity of imax I") field(DTYP, "Raw Soft Channel") field(DOL, "BEND:UNDS:3510:DEGAUS_IMAXPOL_CHECK") field(OMSL, "closed_loop") field(ZNAM, "Positive") field(ONAM, "Negative") field(FLNK, "BEND:UNDS:3510: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, "BEND:UNDS:3510:DEGAUS_ABSIMAX") { field(DESC, "Absolute Max. Degauss I") field(CALC, "ABS(A)") field(INPA, "BEND:UNDS:3510:DEGAUS_IMAX") field(PREC, "6") field(EGU, "Amps") field(HOPR, "9.0") field(LOPR, "-9.0") info(autosaveFields,"VAL RVAL") } # IACT Polarity record(calcout, "BEND:UNDS:3510:IACTPOL_CHECK") { field(DESC, "Determine IACT polarity") field(SCAN, "5 second") field(CALC, "ABS(A-B)>C?(A>=0?0:1):D") field(INPA, "BEND:UNDS:3510:IACT") field(INPB, "BEND:UNDS:3510:IACTPOL_CHECK.LA") field(INPC, "0.0001") field(INPD, "BEND:UNDS:3510:IACTPOL_CHECK.PVAL") field(OOPT, "On Change") field(FLNK, "BEND:UNDS:3510:IACTPOL") } record(bo, "BEND:UNDS:3510: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,"BEND:UNDS:3510: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, "BEND:UNDS:3510:DEGAUSENABLE CP") field(INPB, "BEND:UNDS:3510:DEGAUSOK") field(INPC, "BEND:UNDS:3510:STATE CP") field(INPD, "BEND:UNDS:3510:STATE.SEVR") field(OUT, "BEND:UNDS:3510:DEGAUS_STATE_SEQ.SELN PP") field(ASG, "Internal") } record(seq, "BEND:UNDS:3510:DEGAUS_STATE_SEQ") { field(DESC, "Degauss State Sequence") field(SELM, "Specified") field(SELL, "BEND:UNDS:3510:DEGAUS_STATE_CHECK") field(LNK1, "BEND:UNDS:3510:DEGAUS_STATE_DISABLE.PROC PP") field(LNK2, "BEND:UNDS:3510:DEGAUS_STATE_LOST.PROC PP") field(LNK3, "BEND:UNDS:3510:DEGAUS_STATE_GOOD.PROC PP") field(LNK4, "BEND:UNDS:3510: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, "BEND:UNDS:3510:DEGAUS_STATE_DISABLE") { field(DESC, "Degauss not used") field(LNK1, "BEND:UNDS:3510:DEGAUSOK.ZSV") field(LNK2, "BEND:UNDS:3510: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, "BEND:UNDS:3510:STATMSG.FRSV") field(LNK4, "BEND:UNDS:3510: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, "BEND:UNDS:3510:DEGAUS_STATE_LOST") { field(DESC, "Degauss lost and ps On") field(DOL1, "1") field(LNK1, "BEND:UNDS:3510:DEGAUSOK.ZSV") field(LNK2, "BEND:UNDS:3510: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, "BEND:UNDS:3510:STATMSG.FRSV") field(LNK4, "BEND:UNDS:3510: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, "BEND:UNDS:3510:DEGAUS_STATE_OFF") { field(DESC, "Degaused lost and ps Off") field(DOL1, "2") field(LNK1, "BEND:UNDS:3510: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, "BEND:UNDS:3510:STATMSG.FRSV") field(LNK3, "BEND:UNDS:3510: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, "BEND:UNDS:3510:DEGAUS_STATE_GOOD") { field(DESC, "Degauss good") field(DOL1, "1") field(LNK1, "BEND:UNDS:3510: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, "BEND:UNDS:3510:STATMSG.FRSV PP") field(LNK3, "BEND:UNDS:3510:STATMSG.FVSV PP") field(LNK4, "") field(ASG, "Internal") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(mbbo, "BEND:UNDS:3510:FUNC") { field(DESC, "BEND:UNDS:3510 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, "1") field(THVL, "9") field(FRVL, "10") field(FVVL, "0") field(SXVL, "2") field(SVVL, "8") field(EIVL, "11") field(NIVL, "12") field(TEVL, "13") field(ELVL, "5") field(TVVL, "6") field(TTVL, "7") field(FTVL, "4") field(FFVL, "3") field(OUT, "BEND:UNDS:3510:CTRL CA") } # :CTRL pv is processed at boot in the # sequence mgntCtrl.st Processed in sequence # record(mbbo, "BEND:UNDS:3510:CTRL") { field(DESC, "BEND:UNDS:3510 Control") field(PINI, "NO") field(ZRST, "Ready") field(ONST, "TRIM") field(TWST, "PERTURB") field(THST, "BCON_TO_BDES") field(FRST, "BACT_TO_BDES") field(FVST, "SAVE_BDES") field(SXST, "LOAD_BDES") field(SVST, "UNDO_BDES") field(EIST, "DAC_ZERO") field(NIST, "CALB") field(TEST, "STDZ") field(ELST, "RESET") field(TVST, "TURN_ON") field(TTST, "TURN_OFF") field(FTST, "") field(FFST, "") field(ZRVL, "0") field(ONVL, "2") field(TWVL, "6") field(THVL, "15") field(FRVL, "14") field(FVVL, "11") field(SXVL, "12") field(SVVL, "13") field(EIVL, "7") field(NIVL, "3") field(TEVL, "4") field(ELVL, "8") field(TVVL, "9") field(TTVL, "10") field(FTVL, "0") field(FFVL, "0") field(OUT, "BEND:UNDS:3510:SELECTEN.A PP") field(SDIS, "0") } # If a function has been selected set this unit to busy record(calcout, "BEND:UNDS:3510:SELECTEN") { field(DESC, "Control Select Enable") field(CALC, "A>0?1:A") field(FLNK, "BEND:UNDS:3510:BUSY") } # Set to FREE on IOC reboot record(bo, "BEND:UNDS:3510:BUSY") { field(DESC, "BEND:UNDS:3510 Ctrl Done") field(DOL, "BEND:UNDS:3510:SELECTEN") field(ZNAM, "FREE") field(ONAM, "BUSY") field(PINI, "YES") field(FLNK, "BEND:UNDS:3510:SELECT") } record(bo, "BEND:UNDS:3510:SELECT") { field(ZNAM, "NO") field(ONAM, "YES") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") } record(bo, "BEND:UNDS:3510: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, "BEND:UNDS:3510:CTRLSTATE") { field(DESC, "BEND:UNDS:3510 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("BEND:UNDS:3510:CTRL",20,20,0,0,"BEND:UNDS:3510:CTRL") #! Field("BEND:UNDS:3510:CTRL.OUT",16777215,1,"BEND:UNDS:3510:CTRL.OUT") #! Link("BEND:UNDS:3510:CTRL.OUT","BEND:UNDS:3510:SELECTEN.A") #! Field("BEND:UNDS:3510:CTRL.VAL",16777215,1,"BEND:UNDS:3510:CTRL.VAL") #! Record("BEND:UNDS:3510:SELECTEN",321,381,0,0,"BEND:UNDS:3510:SELECTEN") #! Field("BEND:UNDS:3510:SELECTEN.A",16777215,0,"BEND:UNDS:3510:SELECTEN.A") #! Field("BEND:UNDS:3510:SELECTEN.FLNK",16777215,1,"BEND:UNDS:3510:SELECTEN.FLNK") #! Link("BEND:UNDS:3510:SELECTEN.FLNK","BEND:UNDS:3510:BUSY") #! Field("BEND:UNDS:3510:SELECTEN.VAL",16777215,1,"BEND:UNDS:3510:SELECTEN.VAL") #! Record("BEND:UNDS:3510:BUSY",623,274,0,0,"BEND:UNDS:3510:BUSY") #! Field("BEND:UNDS:3510:BUSY.DOL",16777215,0,"BEND:UNDS:3510:BUSY.DOL") #! Link("BEND:UNDS:3510:BUSY.DOL","BEND:UNDS:3510:SELECTEN.VAL") #! Field("BEND:UNDS:3510:BUSY.FLNK",16777215,1,"BEND:UNDS:3510:BUSY.FLNK") #! Link("BEND:UNDS:3510:BUSY.FLNK","BEND:UNDS:3510:SELECT") #! Record("BEND:UNDS:3510:SELECT",669,508,0,1,"BEND:UNDS:3510:SELECT") #! Record("BEND:UNDS:3510:FUNC",940,120,0,0,"BEND:UNDS:3510:FUNC") #! Field("BEND:UNDS:3510:FUNC.OUT",16777215,0,"BEND:UNDS:3510:FUNC.OUT") #! Link("BEND:UNDS:3510:FUNC.OUT","BEND:UNDS:3510:CTRL.VAL") #! Record("BEND:UNDS:3510:ABORT",193,41,0,0,"BEND:UNDS:3510:ABORT") #! Record("BEND:UNDS:3510:CTRLSTATE",369,34,0,0,"BEND:UNDS:3510: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,"BEND:UNDS:3510:SELECT is used for Multi-device selection.\nIt is enabled when associated BEND:UNDS:3510:CTRL is \"0\" (DONE).\nIt is disabled when associated BEND:UNDS:3510: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,"BEND:UNDS:3510: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, "BEND:UNDS:3510:BCTRL_INIT") { field(DESC, "Process BCTRL on boot") field(PINI, "YES") field(CALC, "A=3?1:0") field(INPA, "BEND:UNDS:3510:BCTRL.SEVR") field(OUT, "BEND:UNDS:3510: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, "BEND:UNDS:3510:BACT") { field(DESC, "Actual B") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "BEND:UNDS:3510:BACT") field(INPB, "BEND:UNDS:3510:POLYCOEF") field(INPC, "BEND:UNDS:3510:POLYCOEF.A") field(INPD, "BEND:UNDS:3510:POLYCOEF.B") field(INPE, "BEND:UNDS:3510:IACT MS") field(INPF, "BEND:UNDS:3510:BDELTAS PP") field(INPG, "100") field(EGU, "kG-m") field(HOPR, "2.68") field(LOPR, "0.0") field(HIHI, "2.68") field(LOLO, "0.0") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "2.68") field(LOW, "0.0") field(FLNK, "BEND:UNDS:3510: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, "BEND:UNDS:3510:BDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntPhyDeltas") field(EGU, "kG-m") field(HOPR, "1") field(PREC, "7") field(BRSV, "INVALID") field(INPA, "BEND:UNDS:3510:BDES") field(INPB, "BEND:UNDS:3510:TRIMBTOL") field(INPC, "BEND:UNDS:3510:TRIMBTOLR") field(INPD, "BEND:UNDS:3510:CHCKBTOL") field(INPE, "BEND:UNDS:3510:CHCKBTOLR") field(F, "2.0") field(INPG, "30") field(INPH, "BEND:UNDS:3510:BACT.VAL") # # MPS absolute and relative tolerances field(INPP, "BEND:UNDS:3510:MPSBTOL") field(INPQ, "BEND:UNDS:3510:MPSBTOLR") field(FLNK, "BEND:UNDS:3510:BCONLIMITS") info(autosaveFields,"F") } # This record is processed by BDELTAS record(aSub, "BEND:UNDS:3510:BCONLIMITS") { field(DESC, "Config B-field Limits") field(INAM, "mgntInit") field(SNAM, "mgntBCONLimits") field(INPA, "BEND:UNDS:3510:BDES") field(INPB, "BEND:UNDS:3510:BDELTAS.I") field(INPG, "BEND:UNDS:3510:DEBUG.RVAL") field(FTA, "DOUBLE") field(FTB, "DOUBLE") field(FTG, "ULONG") field(OUTA, "BEND:UNDS:3510:BCON.HIGH") field(OUTB, "BEND:UNDS:3510:BCON.LOW") field(OUTC, "BEND:UNDS:3510:BCON.HIHI") field(OUTD, "BEND:UNDS:3510:BCON.LOLO PP") field(FTVA, "DOUBLE") field(FTVB, "DOUBLE") field(FTVC, "DOUBLE") field(FTVD, "DOUBLE") field(BRSV, "INVALID") field(FLNK, "BEND:UNDS:3510:IDELTAS") } # The following PV is processed by :BACT # which is processed by :BACT # record(fanout, "BEND:UNDS:3510:BACTFO") { field(DESC, "BACT processing") field(SELM, "All") field(LNK1, "BEND:UNDS:3510:BDIFF") field(LNK2, "BEND:UNDS:3510:BADIFF") field(LNK3, "BEND:UNDS:3510:BRATIO") field(LNK4, "BEND:UNDS:3510:MPSLIMITS") field(LNK5, "BEND:UNDS:3510:I2BSTATUS") field(LNK6, "BEND:UNDS:3510:IACTFO.PROC") } record(calc, "BEND:UNDS:3510:BDIFF") { field(DESC, "BDES-BACT") field(CALC, "A-B") field(INPA, "BEND:UNDS:3510:BDES") field(INPB, "BEND:UNDS:3510:BACT") field(EGU, "kG-m") field(PREC, "7") } record(calc, "BEND:UNDS:3510:BADIFF") { field(DESC, "Absolute BDES-BACT") field(INPA, "BEND:UNDS:3510:BDIFF") field(EGU, "kG-m") field(PREC, "7") field(CALC, "A<0?ABS(A):A") } record(calc, "BEND:UNDS:3510:BRATIO") { field(DESC, "BACT Error") field(CALC, "B?A/B:0") field(INPA, "BEND:UNDS:3510:BDIFF") field(INPB, "BEND:UNDS:3510:BDES.HOPR") field(EGU, "kG-m") field(PREC, "7") } record(mbbi, "BEND:UNDS:3510: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, "BEND:UNDS:3510:BACT.J") } # Note: for a string slave set the MONFL # macro to the following: # MONFL=:IMONCALC MS record(sub, "BEND:UNDS:3510:BMON") { field(DESC, "Second Transductor") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "BEND:UNDS:3510:BMON") field(INPB, "BEND:UNDS:3510:POLYCOEF") field(INPC, "BEND:UNDS:3510:POLYCOEF.A") field(INPD, "BEND:UNDS:3510:POLYCOEF.B") field(INPE, "BEND:UNDS:3510:IMON MS") field(INPF, "BEND:UNDS:3510:BDELTAS.VAL") field(INPG, "100") field(EGU, "kG-m") field(HOPR, "2.68") field(LOPR, "0.0") field(HIHI, "2.68") field(LOLO, "0.0") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "2.68") field(LOW, "0.0") } # 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=PSC:UNDS:MG01:BDES CP record(ao, "BEND:UNDS:3510:BDES") { field(DESC, "Desired B-Field") field(PINI, "YES") field(DRVH, "2.68") field(DRVL, "0.0") field(HOPR, "2.68") field(LOPR, "0.0") field(PREC, "7") field(EGU, "kG-m") field(MDEL, "-1") field(OMSL, "supervisory") # field(DOL, "") field(OUT, "BEND:UNDS:3510:B2IDES PP") info(autosaveFields,"VAL") } record(sub, "BEND:UNDS:3510:B2IDES") { field(DESC, "Convert Desired B-Field to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "BEND:UNDS:3510:POLYCOEF") field(INPC, "BEND:UNDS:3510:POLYCOEF.A") field(INPD, "BEND:UNDS:3510:POLYCOEF.B") field(PREC, "7") field(EGU, "kG-m") field(HOPR, "2.68") field(LOPR, "0.0") field(MDEL, "-1") field(INPE, "BEND:UNDS:3510:BDES.DRVH") field(INPF, "BEND:UNDS:3510:BDES.DRVL") field(BRSV, "INVALID") field(FLNK, "BEND:UNDS:3510:IDES") } record(sub, "BEND:UNDS:3510:BNOM") { field(DESC, "Nominal Field") field(PINI, "YES") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "BEND:UNDS:3510:POLYCOEF") field(INPC, "BEND:UNDS:3510:POLYCOEF.A") field(INPD, "BEND:UNDS:3510:POLYCOEF.B") field(INPE, "BEND:UNDS:3510:BDES.DRVH") field(INPF, "BEND:UNDS:3510:BDES.DRVL") field(EGU, "kG-m") field(HOPR, "2.68") field(LOPR, "0.0") field(PREC, "7") field(VAL, "0.0") field(FLNK, "BEND:UNDS:3510:INOM") } record(sub, "BEND:UNDS:3510:BACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "BEND:UNDS:3510:BDES.VAL") field(INPB, "BEND:UNDS:3510:BDES.DRVH") field(INPC, "BEND:UNDS:3510:BDES.DRVL") field(INPD, "BEND:UNDS:3510:BDELTAS.I") field(INPE, "BEND:UNDS:3510:BDELTAS.J") field(INPG, "BEND:UNDS:3510:STATE") field(INPH, "BEND:UNDS:3510:HSTA") field(EGU, "kG-m") field(HOPR, "2.68") field(LOPR, "0.0") field(PREC, "7") field(BRSV, "INVALID") } record(sub, "BEND:UNDS:3510:BMONLIMITS") { field(DESC, "MON Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "BEND:UNDS:3510:BDES.VAL") field(INPB, "BEND:UNDS:3510:BDES.DRVH") field(INPC, "BEND:UNDS:3510:BDES.DRVL") field(INPD, "BEND:UNDS:3510:BDELTAS.K") field(INPE, "BEND:UNDS:3510:BDELTAS.L") field(INPG, "BEND:UNDS:3510:STATE") field(INPH, "BEND:UNDS:3510:HSTA") field(EGU, "kG-m") field(HOPR, "2.68") field(LOPR, "0.0") field(PREC, "7") field(BRSV, "INVALID") } record(seq, "BEND:UNDS:3510:BLIMITS") { field(DESC, "ACT Limits") field(PREC, "7") field(DOL1, "BEND:UNDS:3510:BLIMITS") field(LNK1, "BEND:UNDS:3510:BACTLIMITS.F PP") field(DOL2, "BEND:UNDS:3510:BACTLIMITS.I") field(LNK2, "BEND:UNDS:3510:BACT.HIGH") field(DOL3, "BEND:UNDS:3510:BACTLIMITS.J") field(LNK3, "BEND:UNDS:3510:BACT.LOW") field(DOL4, "BEND:UNDS:3510:BACTLIMITS.K") field(LNK4, "BEND:UNDS:3510:BACT.HIHI") field(DOL5, "BEND:UNDS:3510:BACTLIMITS.L") field(LNK5, "BEND:UNDS:3510:BACT.LOLO") field(DOL6, "BEND:UNDS:3510:BLIMITS") field(LNK6, "BEND:UNDS:3510:BMONLIMITS.F PP") field(DOL7, "BEND:UNDS:3510:BMONLIMITS.I") field(LNK7, "BEND:UNDS:3510:BMON.HIGH") field(DOL8, "BEND:UNDS:3510:BMONLIMITS.J") field(LNK8, "BEND:UNDS:3510:BMON.LOW") field(DOL9, "BEND:UNDS:3510:BMONLIMITS.K") field(LNK9, "BEND:UNDS:3510:BMON.HIHI") field(DOLA, "BEND:UNDS:3510:BMONLIMITS.L") field(LNKA, "BEND:UNDS:3510:BMON.LOLO") field(FLNK, "BEND:UNDS:3510:ILIMITS") field(SCAN, "5 second") } record(ao, "BEND:UNDS:3510:BCTRL") { field(DESC, "B-Perturb") field(PREC, "7") field(EGU, "kG-m") field(DRVH, "2.68") field(DRVL, "0.0") field(HOPR, "2.68") field(LOPR, "0.0") # 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, "BEND:UNDS:3510: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, "BEND:UNDS:3510:BCTRLGO") { field(DESC, "Update DES and perturb") field(PREC, "7") # Disable BACT limits field(DOL1, "1") field(LNK1, "BEND:UNDS:3510:BLIMITS.VAL") # Update BDES with the BCTRL (slider) value field(DOL2, "BEND:UNDS:3510:BCTRL.VAL") field(LNK2, "BEND:UNDS:3510:BDES PP") field(DOL3, "1") field(LNK3, "BEND:UNDS:3510:IDIRECT.PROC PP") field(DOL4, "1") field(LNK4, "BEND:UNDS:3510:CHECKSTDZLOST.PROC PP") field(DOL5, "BEND:UNDS:3510:BCTRL.VAL") field(LNK5, "BEND:UNDS:3510:BCTRLSUB PP") # Re-enable BACT limits field(DOL6, "0") field(LNK6, "BEND:UNDS:3510:BLIMITS.VAL") } # Convert B-field to Current and output to ISETPT record(sub, "BEND:UNDS:3510:BCTRLSUB") { field(DESC, "Feedback") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "BEND:UNDS:3510:POLYCOEF") field(INPC, "BEND:UNDS:3510:POLYCOEF.A") field(INPD, "BEND:UNDS:3510:POLYCOEF.B") field(INPE, "BEND:UNDS:3510:BDES.DRVH") field(INPF, "BEND:UNDS:3510:BDES.DRVL") field(PREC, "7") field(EGU, "kG-m") field(HOPR, "2.68") field(LOPR, "0.0") field(MDEL, "-1") field(BRSV, "INVALID") field(FLNK, "BEND:UNDS:3510:ISETPT") } record(ao, "BEND:UNDS:3510:BDESPREVTRIM") { field(DESC, "trim bdes for undo") field(DTYP, "Soft Channel") field(DRVH, "2.68") field(DRVL, "0.0") field(EGU, "kG-m") field(HOPR, "2.68") field(LOPR, "0.0") field(PREC, "7") field(PINI, "YES") info(autosaveFields,"VAL") } record(stringin, "BEND:UNDS:3510:MADNAME") { field(DESC, "MAD deck nomenclature") field(PINI, "YES") field(VAL, "BCXSS1") } record(ai, "BEND:UNDS:3510: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, "3647.561138") } record(ao, "BEND:UNDS:3510:BMAX") { field(DESC, "Max B-Field") field(DTYP, "Soft Channel") field(DRVH, "2.68") field(DRVL, "0.0") field(EGU, "kG-m") field(HOPR, "2.68") field(LOPR, "0.0") field(PREC, "7") field(PINI, "YES") field(VAL, "2.68") field(FLNK, "BEND:UNDS:3510:BSTEP") } record(ao, "BEND:UNDS:3510:BMIN") { field(DESC, "Min B-Field") field(DTYP, "Soft Channel") field(DRVH, "2.68") field(DRVL, "0.0") field(EGU, "kG-m") field(HOPR, "2.68") field(LOPR, "0.0") field(PREC, "7") field(PINI, "YES") field(VAL, "0.0") field(FLNK, "BEND:UNDS:3510:BSTEP") } record(ao, "BEND:UNDS:3510:BDESSAVE") { field(DESC, "bdes for save/load") field(DTYP, "Soft Channel") field(DRVH, "2.68") field(DRVL, "0.0") field(EGU, "kG-m") field(HOPR, "2.68") field(LOPR, "0.0") field(PINI, "YES") field(PREC, "7") } # This record is processed by BEND:UNDS:3510: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, "BEND:UNDS:3510:BCON") { field(DESC, "Config B-Field ") field(DTYP, "Soft Channel") field(PREC, "7") field(EGU, "kG-m") field(HOPR, "2.68") field(LOPR, "0.0") field(DRVH, "2.68") field(DRVL, "0.0") # Set MINOR Alarm as the default, slaves will set NO_ALARM=0. field(HHSV, "MINOR") field(LLSV, "MINOR") field(HSV, "MINOR") field(LSV, "MINOR") # field(DOL , "") field(OMSL, "supervisory") field(OUT, "BEND:UNDS:3510:B2ICON PP") info(autosaveFields,"VAL") } record(sub, "BEND:UNDS:3510:B2ICON") { field(DESC, "Convert Desired ICon to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "BEND:UNDS:3510:POLYCOEF") field(INPC, "BEND:UNDS:3510:POLYCOEF.A") field(INPD, "BEND:UNDS:3510:POLYCOEF.B") field(PREC, "7") field(EGU, "kG-m") field(HOPR, "2.68") field(LOPR, "0.0") field(MDEL, "-1") field(INPE, "BEND:UNDS:3510:BCON.DRVH") field(INPF, "BEND:UNDS:3510:BCON.DRVL") field(BRSV, "INVALID") field(FLNK, "BEND:UNDS:3510: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, "BEND:UNDS:3510:BSTEP") { field(DESC, "B-Field step size") field(CALC, "(C==3)||(D==3)?0:ABS(A-B)*0.005") field(INPA, "BEND:UNDS:3510:BMAX") field(INPB, "BEND:UNDS:3510:BMIN") field(INPC, "BEND:UNDS:3510:BMIN.SEVR") field(INPD, "BEND:UNDS:3510:BMAX.SEVR") field(EGU, "kG-m") 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,"BEND:UNDS:3510:BCTRLDISABLECALC") { field(DESC, "Calc for disabling BCTRL") field(ASG, "Internal") field(CALC, "A?2:1") field(INPA, "BEND:UNDS:3510:ONLINE CP") field(OUT, "BEND:UNDS:3510:BCTRLDISABLEFOUT PP") } record(fanout, "BEND:UNDS:3510:BCTRLDISABLEFOUT") { field(DESC, "Disable BCTRL fanout") field(SELM, "Specified") field(SELL, "BEND:UNDS:3510:BCTRLDISABLECALC") field(LNK1, "BEND:UNDS:3510:BCTRLDISABLE") field(LNK2, "BEND:UNDS:3510:BCTRLENABLE") } record(stringout, "BEND:UNDS:3510:BCTRLDISABLE") { field(DESC, "Disable BCTRL") field(DTYP, "Soft Channel") field(OUT, "BEND:UNDS:3510:BCTRL.ASG") field(VAL, "NOWRITE") field(FLNK, "BEND:UNDS:3510:BCTRLDISV_UPDATE") } record(stringout, "BEND:UNDS:3510:BCTRLENABLE") { field(DESC, "Enable BCTRL") field(DTYP, "Soft Channel") field(OUT, "BEND:UNDS:3510:BCTRL.ASG") field(VAL, "") field(FLNK, "BEND:UNDS:3510:BCTRLDISV_UPDATE") } record(calcout, "BEND:UNDS:3510:BCTRLDISV_UPDATE") { field(DESC, "Calc for updating BCTRL.DISV") field(ASG, "Internal") field(CALC, "A") field(INPA, "BEND:UNDS:3510:ONLINE") field(OUT, "BEND:UNDS:3510: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,"BEND:UNDS:3510:BACT and MON\n are processed via links from \n BEND:UNDS:3510:IACT (device raw value readback 1)\n and\n BEND:UNDS:3510: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 BEND:UNDS:3510:POLYCOEF\nC = First polynomial coefficient (offset if linear)\nD = Second polynomial coefficient (slope if linear)\nE = BEND:UNDS:3510: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,"BEND:UNDS:3510:BDES\n is processed when set by CA users or \n BEND:UNDS:3510: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,"BEND:UNDS:3510: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 BEND:UNDS:3510: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 (BEND:UNDS:3510: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,"BEND:UNDS:3510:B*LIMITS and BEND:UNDS:3510:BLIMITS:\n Calculate alarm and warning limits based on \n deltas from BEND:UNDS:3510: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,"BEND:UNDS:3510: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,"BEND:UNDS:3510: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, "BEND:UNDS:3510: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, "BEND:UNDS:3510:MPSBTOL") { field(DESC, "Absolute mps tol") field(EGU, "kG-m") field(PREC, "2") field(CALC, "ABS(A)*0.02") field(INPA, "BEND:UNDS:3510:BMAX") field(PINI, "YES") } # # 21-Aug-2013: K. Luchini # Set channel access security so that users # cannot easily change values. record(ao, "BEND:UNDS:3510:MPSBMAX") { field(DESC, "MPS Max B-field") field(EGU, "kG-m") field(PREC, "7") field(DRVH, "2.68") field(DRVL, "0.0") field(PINI, "YES") field(VAL, "2.68") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "BEND:UNDS:3510:MPSBMIN") { field(DESC, "MPS Min B-field") field(EGU, "kG-m") field(PREC, "7") field(DRVH, "2.68") field(DRVL, "0.0") field(PINI, "YES") field(VAL, "0.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "BEND:UNDS:3510:MPSBLLIM") { field(DESC, "MPS Low Limit B-field") field(EGU, "kG-m") field(PREC, "7") field(DRVH, "2.68") field(DRVL, "0.0") field(PINI, "YES") field(VAL, "0.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "BEND:UNDS:3510:MPSBLLIM2") { field(DESC, "MPS Low Limit #2 B-field") field(EGU, "kG-m") field(PREC, "7") field(DRVH, "2.68") field(DRVL, "0.0") field(PINI, "YES") field(VAL, "0.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } # Set the default to Std record(mbbo, "BEND:UNDS:3510: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, "BEND:UNDS:3510:MPSLIMITS.E PP") } record(aSub, "BEND:UNDS:3510: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, "BEND:UNDS:3510:MPS.RVAL") field(INPB, "BEND:UNDS:3510:BADIFF") field(INPC, "BEND:UNDS:3510:BDELTAS.N") field(INPD, "BEND:UNDS:3510:BACT") field(INPE, "BEND:UNDS:3510:MPSBITMASK.RVAL") field(INPF, "BEND:UNDS:3510:MPSBLLIM") field(INPG, "BEND:UNDS:3510:MPSBMIN") field(INPH, "BEND:UNDS:3510:MPSBMAX") field(INPI, "BEND:UNDS:3510: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, "BEND:UNDS:3510:INTOL.RVAL PP") field(OUTB, "BEND:UNDS:3510:INTOL_BMIN.RVAL PP") field(OUTC, "BEND:UNDS:3510:INTOL_BRANGE.RVAL PP") field(OUTD, "BEND:UNDS:3510: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, "BEND:UNDS:3510:INTOL") { field(DESC, "BACT within MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "BEND:UNDS:3510:MPSLIMITS.VALA") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "BEND:UNDS:3510:INTOL_BMIN") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "BEND:UNDS:3510:MPSLIMITS.VALB") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "BEND:UNDS:3510:INTOL_BMIN2") { field(DESC, "MPS tol #2") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "BEND:UNDS:3510:MPSLIMITS.VALD") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "BEND:UNDS:3510:INTOL_BRANGE") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "BEND:UNDS:3510: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, "BEND:UNDS:3510:CHCKITOL") { field(DESC, "Absolute Check I Tolerance") field(EGU, "A") field(FLNK, "BEND:UNDS:3510:TRIMITOL") field(CALC, "ABS(A*B)") field(INPA, "BEND:UNDS:3510:CHCKBTOL") field(INPB, "BEND:UNDS:3510:POLYCOEF.B") field(PREC, "9") } record(calc, "BEND:UNDS:3510:TRIMBTOL") { field(EGU, "kG-m") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(DESC, "Absolute Trim Tolerance") field(CALC, "ABS(A)/2") field(INPA, "BEND:UNDS:3510:CHCKBTOL") field(FLNK, "BEND:UNDS:3510:CHCKITOL") } record(calc, "BEND:UNDS:3510:CHCKBTOL") { field(DESC, "Check absolute tolerance") field(EGU, "A") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(FLNK, "BEND:UNDS:3510:TRIMBTOL") field(CALC, "MAX(ABS(A),ABS(C))*(B/1000000)") field(INPA, "BEND:UNDS:3510:BDES.HOPR") field(INPB, "BEND:UNDS:3510:STABILITY") field(INPC, "BEND:UNDS:3510:BDES.LOPR") } record(longout, "BEND:UNDS:3510: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, "BEND:UNDS:3510:CHCKBTOL") } record(calc, "BEND:UNDS:3510:TRIMITOL") { field(DESC, "Absolute Trim I Tolerance") field(EGU, "kG-m") field(CALC, "ABS(A*B)") field(INPA, "BEND:UNDS:3510:POLYCOEF.B") field(INPB, "BEND:UNDS:3510:TRIMBTOL") field(PREC, "9") } record(ai, "BEND:UNDS:3510:TRIMBTOLR") { field(DESC, "Relative trim tol") field(PREC, "4") field(EGU, "%") field(HOPR, "1.0") field(LOPR, "0.0") field(PINI, "YES") } record(ai, "BEND:UNDS:3510: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, "BEND:UNDS:3510:FBCKFCOM") { field(ZNAM, "CA") field(ONAM, "FCOM") field(DESC, "CA Mode") field(PINI, "YES") field(SDIS, "0") } record(bo, "BEND:UNDS:3510:PAU") { field(ZNAM, "NotConfigured") field(ONAM, "Configured") field(DESC, "PAU Present") field(PINI, "YES") field(SDIS, "0") field(FLNK, "BEND:UNDS:3510:PAUGO") } record(fanout, "BEND:UNDS:3510:PAUGO") { field(DESC, "PAU control") field(LNK1, "BEND:UNDS:3510:PAUSTOP") field(LNK2, "BEND:UNDS:3510: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, "BEND:UNDS:3510:PAUSTART") { field(DESC, "Setup for PAU On") field(SDIS, "BEND:UNDS:3510: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, "BEND:UNDS:3510:PAUSTOP") { field(DESC, "Setup for PAU Off") field(SDIS, "BEND:UNDS:3510: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, "BEND:UNDS:3510:MCORDEVNAME") { field(DESC, "PS device name") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, "PSC:UNDS:MG01:") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "BEND:UNDS:3510: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, "BEND:UNDS:3510:PSTYPE.RVAL") field(INPC, "BEND:UNDS:3510:TURNEDOFF.RVAL") field(INPD, "BEND:UNDS:3510:CONFIG.RVAL") field(INPE, "BEND:UNDS:3510:PSCATEGORY.RVAL") field(INPF, "BEND:UNDS:3510:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "BEND:UNDS:3510:AUTOCTRL.RVAL") field(INPJ, "BEND:UNDS:3510:OUTOFSERVICE.RVAL") field(INPL, "BEND:UNDS:3510:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "BEND:UNDS:3510:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "BEND:UNDS:3510:PAU") field(INPP, "BEND:UNDS:3510:CALBDISABLE.RVAL") field(INPQ, "BEND:UNDS:3510:PTRBDISABLE.RVAL") field(INPR, "BEND:UNDS:3510:TRIMDISABLE.RVAL") field(INPS, "BEND:UNDS:3510:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "BEND:UNDS:3510:FBCK") field(INPU, "BEND:UNDS:3510:TRIMTYPE.RVAL") field(INPV, "BEND:UNDS:3510:STDZDIRECT.RVAL") field(INPW, "BEND:UNDS:3510:DEGAUSENABLE.RVAL") field(FLNK, "BEND:UNDS:3510:HSTA") } record(longin, "BEND:UNDS:3510:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "BEND:UNDS:3510:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "BEND:UNDS:3510: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, "BEND:UNDS:3510: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, "BEND:UNDS:3510:CALBDISABLE") { field(DESC, "DAC Calb Disabled") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "BEND:UNDS:3510:PTRBDISABLE") { field(DESC, "Perturb Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "BEND:UNDS:3510:TRIMDISABLE") { field(DESC, "Trim Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "BEND:UNDS:3510: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 BEND:UNDS:3510:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses BEND:UNDS:3510:FBCK. # This PV should be replaced by BEND:UNDS:3510: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, "BEND:UNDS:3510: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, "BEND:UNDS:3510: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, "BEND:UNDS:3510: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, "") field(OMSL, "supervisory") field(FLNK, "BEND:UNDS:3510:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"BEND:UNDS:3510:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "BEND:UNDS:3510:OUTOFSERVICE NPP NMS") field(OUT, "BEND:UNDS:3510:ONLINE PP") } record(bo, "BEND:UNDS:3510:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "BEND:UNDS:3510: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, "1") } record(bo, "BEND:UNDS:3510: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, "1") } record(bo, "BEND:UNDS:3510: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, "BEND:UNDS:3510: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, "BEND:UNDS:3510: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, "BEND:UNDS:3510: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, "BEND:UNDS:3510: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, "BEND:UNDS:3510: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, "1") field(ASG, "NOWRITE") } record(mbbo, "BEND:UNDS:3510: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, "1") field(ASG, "NOWRITE") } record(mbbo, "BEND:UNDS:3510: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, "2") field(ASG, "NOWRITE") } record(mbbo, "BEND:UNDS:3510: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, "0") field(ASG, "NOWRITE") field(FLNK, "BEND:UNDS:3510:TRIMTYPE") } record(stringout, "BEND:UNDS:3510:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "BEND:UNDS:3510:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "BEND:UNDS:3510:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "BEND:UNDS:3510:STATE.RVAL") field(INPB, "BEND:UNDS:3510:INTLKSUMY.RVAL") field(OUT, "BEND:UNDS:3510:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "BEND:UNDS:3510: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, "BEND:UNDS:3510:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "BEND:UNDS:3510:STATE.RVAL") field(INPB, "BEND:UNDS:3510:INTLKSUMY.RVAL") field(OUT, "BEND:UNDS:3510:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "BEND:UNDS:3510:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "BEND:UNDS:3510:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "BEND:UNDS:3510: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, "BEND:UNDS:3510:RAMPSTARTDLY") { field(DESC, "Tansition to ramp delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "2") } ######### For PSTYPE=2 Only ############# record(mbbo, "BEND:UNDS:3510: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, "BEND:UNDS:3510: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,"BEND:UNDS:3510: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("BEND:UNDS:3510:TURNEDOFF",3140,1907,0,1,"BEND:UNDS:3510:TURNEDOFF") #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "BEND:UNDS:3510:STATSUB") { field(DESC, "Build STATus ") field(INAM, "mgntInit") field(SNAM, "mgntSlcStat") field(INPA, "BEND:UNDS:3510:BACT.STAT") field(INPB, "BEND:UNDS:3510:BDES.STAT") field(INPC, "BEND:UNDS:3510:IRIPL.STAT") field(INPD, "PSC:UNDS:MG01:ISETPT.STAT") field(INPE, "PSC:UNDS:MG01:IACT.STAT") # 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, "BEND:UNDS:3510:BACT.SEVR") field(INPH, "BEND:UNDS:3510:BDES.SEVR") field(INPI, "BEND:UNDS:3510:IRIPL.SEVR") field(INPJ, "PSC:UNDS:MG01:ISETPT.SEVR") field(INPK, "PSC:UNDS:MG01:IACT.SEVR") # # 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, "BEND:UNDS:3510:STATE.RVAL") field(INPN, "BEND:UNDS:3510:STDZOK") field(INPO, "BEND:UNDS:3510:CALBOK") field(INPP, "BEND:UNDS:3510:OUTOFSERVICE.RVAL") field(INPQ, "BEND:UNDS:3510:CONFIG.RVAL") field(INPR, "BEND:UNDS:3510:HSTA") field(INPS, "BEND:UNDS:3510:CTRL.RVAL") field(INPT, "BEND:UNDS:3510:DEGAUSOK") field(INPV, "BEND:UNDS:3510: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, "BEND:UNDS:3510:STAT") } record(longout, "BEND:UNDS:3510:STAT") { field(DESC, "STAT sent to SLC") field(SCAN, "Passive") field(FLNK, "BEND:UNDS:3510:STATCTRLSUB") field(DOL, "BEND:UNDS:3510:STATSUB.VAL") field(OMSL, "closed_loop") } record(sSub, "BEND:UNDS:3510:STATCTRLSUB") { field(DESC, "Decode SLC STAT into mbbo") field(INAM, "mgntInit") field(SNAM, "mgntStatDecode") field(INPA, "BEND:UNDS:3510:STAT") field(INPB, "BEND:UNDS:3510:HSTA") field(INPD, "BEND:UNDS:3510:ONOFFCTRL.RVAL") field(FLNK, "BEND:UNDS:3510:STATMSG") } record(mbbo, "BEND:UNDS:3510: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, "BEND:UNDS:3510:UNAVAILGO") field(DOL, "BEND:UNDS:3510:STATCTRLSUB.W") } record(seq, "BEND:UNDS:3510:UNAVAILGO") { field(DESC, "Process UNAVAIL") field(DOL1, "BEND:UNDS:3510:STATSUB.U") field(LNK1, "BEND:UNDS:3510:UNAVAIL PP") } record(stringout, "BEND:UNDS:3510:SNLSTATMSG") { field(DTYP, "Soft Channel") } #! TextBox(TB0,820,1000,1200,1220,0,"Dialog",12,1,16777215,"BEND:UNDS:3510:STATUSSUB - future\nOverall device status - takes input from action snls, record sevrs, master snl(s) and outputs final status\n\nInputs:\nA - BEND:UNDS:3510:CTRLSTATUS - snl status\nB - MGNT:CTRLSTATUS - master list status\nC\nD - BEND:UNDS:3510: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,"BEND:UNDS:3510STATSUB\nformat control bo's into slc STAT\n\nInputs:\nA - BEND:UNDS:3510:STATUS\nC - BEND:UNDS:3510:ON\nD - BEND:UNDS:3510:STDZOK\nE - BEND:UNDS:3510:CALBOK\nF - BEND:UNDS:3510:BACTDRIFT (future)\nG -\nH- BEND:UNDS:3510:DACSTATUS\nI -BEND:UNDS:3510:ADCSTATUS\nJ - BEND:UNDS:3510:BACTSTATUS\nK - BEND:UNDS:3510:BDESSTATUS\nL - BEND:UNDS:3510:RIPLSTATUS\n\nOutput:\nP - BEND:UNDS:3510: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, "BEND:UNDS:3510: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, "BEND:UNDS:3510: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, "BEND:UNDS:3510: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, "BEND:UNDS:3510: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.6 #! DBDSTART #! DBD("../../../../dbd/mgntSoft.dbd") #! DBDEND record(stringout, "BEND:UNDS:3510:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "BEND:UNDS:3510:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "BEND:UNDS:3510:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "BEND:UNDS:3510:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "BEND:UNDS:3510:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "BEND:UNDS:3510:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "1") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "BEND:UNDS:3510: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, "BEND:UNDS:3510:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "BEND:UNDS:3510:TRIMTYPE.RVAL") field(INPB, "BEND:UNDS:3510:CONFIG.RVAL") field(OUT, "BEND:UNDS:3510:TRIMMAXNUM PP") } record(longout, "BEND:UNDS:3510: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, "BEND:UNDS:3510: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, "") field(OMSL, "supervisory") field(VAL, "5") field(OUT, "BEND:UNDS:3510:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "BEND:UNDS:3510: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, "") field(OMSL, "supervisory") field(VAL, "10") } record(bo, "BEND:UNDS:3510: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, "BEND:UNDS:3510: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, "BEND:UNDS:3510: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, "BEND:UNDS:3510:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "0") } record(ao, "BEND:UNDS:3510: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, "BEND:UNDS:3510:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "BEND:UNDS:3510: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, "BEND:UNDS:3510: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, "BEND:UNDS:3510:IMOVE") field(INPB, "BEND:UNDS:3510:IACT") field(INPC, "BEND:UNDS:3510:IRAMPRATE") field(INPD, "1.577") field(INPE, "BEND:UNDS:3510:TRIMDLYPCT") field(INPF, "BEND:UNDS:3510:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "BEND:UNDS:3510:RAMPTIME_LEFT PP") } record(longout, "BEND:UNDS:3510:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "BEND:UNDS:3510:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "BEND:UNDS:3510:RAMPDONE_CALC") } record(calc, "BEND:UNDS:3510:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "BEND:UNDS:3510:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "BEND:UNDS:3510:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "BEND:UNDS:3510: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, "BEND:UNDS:3510:RAMPTIME_LEFT") field(OUT, "BEND:UNDS:3510:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "BEND:UNDS:3510:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "BEND:UNDS:3510:RAMPTIME_LEFT NMS") field(OUT, "BEND:UNDS:3510:RAMPDONE PP") } record(bo, "BEND:UNDS:3510:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "BEND:UNDS:3510:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "BEND:UNDS:3510: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, "BEND:UNDS:3510: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(sSub, "BEND:UNDS:3510: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, "BEND:UNDS:3510:PSTYPE.RVAL") field(INPC, "BEND:UNDS:3510:TURNEDOFF.RVAL") field(INPD, "BEND:UNDS:3510:CONFIG.RVAL") field(INPE, "BEND:UNDS:3510:PSCATEGORY.RVAL") field(INPF, "BEND:UNDS:3510:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "BEND:UNDS:3510:AUTOCTRL.RVAL") field(INPJ, "BEND:UNDS:3510:OUTOFSERVICE.RVAL") field(INPL, "BEND:UNDS:3510:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "BEND:UNDS:3510:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "BEND:UNDS:3510:PAU") field(INPP, "BEND:UNDS:3510:CALBDISABLE.RVAL") field(INPQ, "BEND:UNDS:3510:PTRBDISABLE.RVAL") field(INPR, "BEND:UNDS:3510:TRIMDISABLE.RVAL") field(INPS, "BEND:UNDS:3510:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "BEND:UNDS:3510:FBCK") field(INPU, "BEND:UNDS:3510:TRIMTYPE.RVAL") field(INPV, "BEND:UNDS:3510:STDZDIRECT.RVAL") field(INPW, "BEND:UNDS:3510:DEGAUSENABLE.RVAL") field(FLNK, "BEND:UNDS:3510:HSTA") } record(longin, "BEND:UNDS:3510:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "BEND:UNDS:3510:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "BEND:UNDS:3510: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, "BEND:UNDS:3510: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, "BEND:UNDS:3510:CALBDISABLE") { field(DESC, "DAC Calb Disabled") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "BEND:UNDS:3510:PTRBDISABLE") { field(DESC, "Perturb Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "BEND:UNDS:3510:TRIMDISABLE") { field(DESC, "Trim Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "BEND:UNDS:3510:STDZDISABLE") { field(DTYP, "Raw Soft Channel") field(ZNAM, "NO") field(ONAM, "YES") field(DESC, "Standardize Function") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } # This PV has been replaced by BEND:UNDS:3510:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses BEND:UNDS:3510:FBCK. # This PV should be replaced by BEND:UNDS:3510: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, "BEND:UNDS:3510: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, "BEND:UNDS:3510: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, "BEND:UNDS:3510: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, "") field(OMSL, "supervisory") field(FLNK, "BEND:UNDS:3510:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"BEND:UNDS:3510:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "BEND:UNDS:3510:OUTOFSERVICE NPP NMS") field(OUT, "BEND:UNDS:3510:ONLINE PP") } record(bo, "BEND:UNDS:3510:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "BEND:UNDS:3510: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, "1") } record(bo, "BEND:UNDS:3510: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, "1") } record(bo, "BEND:UNDS:3510: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, "BEND:UNDS:3510: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, "BEND:UNDS:3510: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, "BEND:UNDS:3510: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, "BEND:UNDS:3510: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, "BEND:UNDS:3510: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, "1") field(ASG, "NOWRITE") } record(mbbo, "BEND:UNDS:3510: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, "1") field(ASG, "NOWRITE") } record(mbbo, "BEND:UNDS:3510: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, "2") field(ASG, "NOWRITE") } record(mbbo, "BEND:UNDS:3510: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, "2") field(ASG, "NOWRITE") field(FLNK, "BEND:UNDS:3510:TRIMTYPE") } record(stringout, "BEND:UNDS:3510:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "BEND:UNDS:3510:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "BEND:UNDS:3510:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "BEND:UNDS:3510:STATE.RVAL") field(INPB, "BEND:UNDS:3510:INTLKSUMY.RVAL") field(OUT, "BEND:UNDS:3510:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "BEND:UNDS:3510: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, "BEND:UNDS:3510:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "BEND:UNDS:3510:STATE.RVAL") field(INPB, "BEND:UNDS:3510:INTLKSUMY.RVAL") field(OUT, "BEND:UNDS:3510:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "BEND:UNDS:3510:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "BEND:UNDS:3510:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "BEND:UNDS:3510: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, "BEND:UNDS:3510:RAMPSTARTDLY") { field(DESC, "Tansition to ramp delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "2") } ######### For PSTYPE=2 Only ############# record(mbbo, "BEND:UNDS:3510: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, "BEND:UNDS:3510: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,"BEND:UNDS:3510: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("BEND:UNDS:3510:TURNEDOFF",3140,1907,0,1,"BEND:UNDS:3510:TURNEDOFF") #! 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, "QUAD:DMPS:300:IACT") { field(DESC, "Current") field(INP, "PSC:DMPS:MG02:IACT") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "QUAD:DMPS:300:BACT") info(autosaveFields,"HYST") } record(bi, "QUAD:DMPS:300:STATE") { field(DESC, "PS On/Off Status") field(DTYP, "Raw Soft Channel") field(INP, "PSC:DMPS:MG02:STATE NPP MS") field(ZSV, "MAJOR") field(ZNAM, "OFF") field(ONAM, "ON") } record(ao, "QUAD:DMPS:300:IDES") { field(DESC, "Desired Current") field(PREC, "3") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(MDEL, "-1") field(HIHI, "165.0") field(LOLO, "0.0") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "QUAD:DMPS:300:BDELTAS") field(DRVH, "165.0") field(DRVL, "0.0") field(DOL, "QUAD:DMPS:300: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, "QUAD:DMPS:300:ICTRL PP") } # This record is processed by QUAD:DMPS:300:ICON") # Note: we are not setting alarms here. record(ao, "QUAD:DMPS:300:ICON") { field(DESC, "Config I") field(DTYP, "Soft Channel") field(PREC, "3") field(HOPR, "165.0") field(LOPR, "0.0") field(DRVH, "165.0") field(DRVL, "0.0") field(DOL, "QUAD:DMPS:300:B2ICON.K") field(OMSL, "closed_loop") info(autosaveFields,"VAL") } record(ao, "QUAD:DMPS:300:INOM") { field(DESC, "Nominal Current") field(DOL, "QUAD:DMPS:300:BNOM.K") field(OMSL, "closed_loop") field(PREC, "3") field(EGU, "A") field(DRVH, "165.0") field(DRVL, "0.0") field(HOPR, "165.0") field(LOPR, "0.0") } record(ao, "QUAD:DMPS:300:ICTRL") { field(DESC, "Set Current") field(PREC, "3") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(DRVH, "165.0") field(DRVL, "0.0") field(MDEL, "-1") field(FLNK, "QUAD:DMPS:300:ICTRLGO") field(OMSL, "supervisory") info(autosavefields,"VAL") } record(seq, "QUAD:DMPS:300:ICTRLGO") { field(DESC, "Process Current Setpoint") field(PREC, "3") # Set ISETPT to supervisory field(DOL1, "0") field(LNK1, "QUAD:DMPS:300:ISETPT.OMSL") field(DOL2, "QUAD:DMPS:300:ICTRL") field(LNK2, "QUAD:DMPS:300:ISETPT PP") # Set ISETPT to closed loop - get data from BCTRLSUB.K field(DOL3, "1") field(LNK3, "QUAD:DMPS:300:ISETPT.OMSL") } record(ao, "QUAD:DMPS:300:IMAX") { field(DESC, "Max I") field(DTYP, "Soft Channel") field(DRVH, "165.0") field(DRVL, "0.0") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(PREC, "3") field(PINI, "YES") field(VAL, "165.0") field(FLNK, "QUAD:DMPS:300:IMIN") } record(ao, "QUAD:DMPS:300:IMIN") { field(DESC, "Min I") field(DTYP, "Soft Channel") field(DRVH, "165.0") field(DRVL, "0.0") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(PREC, "3") field(VAL, "0.0") field(FLNK, "QUAD:DMPS:300:IRANGE") } record(sel, "QUAD:DMPS:300:IACTPREVOK") { field(DESC, "Last Good Current") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(PREC, "3") field(NVL, "QUAD:DMPS:300:BACT.SEVR") field(INPA, "QUAD:DMPS:300:IACT NPP MS") field(INPB, "QUAD:DMPS:300:IACTPREVOK NPP MS") field(INPC, "QUAD:DMPS:300:IACTPREVOK NPP MS") field(INPD, "QUAD:DMPS:300:IACTPREVOK NPP MS") } record(sub, "QUAD:DMPS:300:IACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:DMPS:300:IDES") field(INPB, "QUAD:DMPS:300:ISETPT.DRVH") field(INPC, "QUAD:DMPS:300:ISETPT.DRVL") field(INPD, "QUAD:DMPS:300:IDELTAS.I") field(INPE, "QUAD:DMPS:300:IDELTAS.J") field(INPG, "QUAD:DMPS:300:STATE") field(INPH, "QUAD:DMPS:300:HSTA") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(sub, "QUAD:DMPS:300:IMONLIMITS") { field(DESC, "Aux Current Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:DMPS:300:IDES") field(INPB, "QUAD:DMPS:300:ISETPT.DRVH") field(INPC, "QUAD:DMPS:300:ISETPT.DRVL") field(INPD, "QUAD:DMPS:300:IDELTAS.K") field(INPE, "QUAD:DMPS:300:IDELTAS.L") field(INPG, "QUAD:DMPS:300:STATE") field(INPH, "QUAD:DMPS:300:HSTA") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(seq, "QUAD:DMPS:300:ILIMITS") { field(DESC, "Set ACT and MON Limits") field(PREC, "3") field(DOL1, "QUAD:DMPS:300:BLIMITS") field(LNK1, "QUAD:DMPS:300:IACTLIMITS.F PP") field(DOL2, "QUAD:DMPS:300:IACTLIMITS.I") field(LNK2, "QUAD:DMPS:300:IACT.HIGH") field(DOL3, "QUAD:DMPS:300:IACTLIMITS.J") field(LNK3, "QUAD:DMPS:300:IACT.LOW") field(DOL4, "QUAD:DMPS:300:IACTLIMITS.K") field(LNK4, "QUAD:DMPS:300:IACT.HIHI") field(DOL5, "QUAD:DMPS:300:IACTLIMITS.L") field(LNK5, "QUAD:DMPS:300:IACT.LOLO") field(DOL6, "QUAD:DMPS:300:BLIMITS") field(LNK6, "QUAD:DMPS:300:IMONLIMITS.F PP") field(DOL7, "QUAD:DMPS:300:IMONLIMITS.I") field(LNK7, "QUAD:DMPS:300:IMON.HIGH") field(DOL8, "QUAD:DMPS:300:IMONLIMITS.J") field(LNK8, "QUAD:DMPS:300:IMON.LOW") field(DOL9, "QUAD:DMPS:300:IMONLIMITS.K") field(LNK9, "QUAD:DMPS:300:IMON.HIHI") field(DOLA, "QUAD:DMPS:300:IMONLIMITS.L") field(LNKA, "QUAD:DMPS:300: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, "QUAD:DMPS:300:IDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntRawDeltas") field(INPD, "QUAD:DMPS:300:TRIMBTOL") field(INPE, "QUAD:DMPS:300:CHCKBTOL") field(INPF, "QUAD:DMPS:300:BDELTAS.K") field(INPG, "QUAD:DMPS:300:BDELTAS.L") field(INPH, "QUAD:DMPS:300: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, "QUAD:DMPS:300:STDZITOLR") field(INPC, "QUAD:DMPS:300:STDZITOL") field(FLNK, "") } # All ps controllers with on/off control will set the macro ONOF # as follows: # # ONOF = PSC:DMPS:MG02: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, "QUAD:DMPS:300:STATESETPT") { field(DESC, "PS On/Off") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFF") field(ONAM, "ON") field(OUT, "PSC:DMPS:MG02:STATESETPT PP") 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 = PSC:DMPS:MG02:RESET PP # record(bo, "QUAD:DMPS:300:RESET") { field(DESC, "Interlock Latch Reset") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFF") field(ONAM, "ON") field(HIGH, "1.0") field(OUT, "PSC:DMPS:MG02:RESET PP") } record(bo, "QUAD:DMPS:300:RAMPSTATE") { field(DESC, "PS Ramp Status") field(DTYP, "Soft Channel") field(DOL, "PSC:DMPS:MG02:RAMPSTATE NPP 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, "QUAD:DMPS:300: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, "QUAD:DMPS:300:TRIMRAMPRATE") field(OUT, "PSC:DMPS:MG02:IRAMPRATE PP") field(FLNK, "QUAD:DMPS:300:STDZDLY") } record(ao, "QUAD:DMPS:300:ISETPT") { field(DESC, "Current Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(DRVH, "165.0") field(DRVL, "0.0") field(MDEL, "-1") field(OUT, "PSC:DMPS:MG02:ISETPT PP") field(DOL, "QUAD:DMPS:300: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, "QUAD:DMPS:300:IMON") { field(DESC, "Aux Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(INP, "PSC:DMPS:MG02:IMON") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "QUAD:DMPS:300:BMON") } record(ao, "QUAD:DMPS:300:IRIPL") { field(DESC, "Ripple Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(DOL, "PSC:DMPS:MG02:IRIPL NPP NMS") field(OMSL, "closed_loop") field(EGU, "A") field(DRVH, "1.0") field(HOPR, "1.0") field(PREC, "3") field(FLNK, "QUAD:DMPS:300:IRIPLOK") } record(sub, "QUAD:DMPS:300:IRIPLOK") { field(DESC, "Ripple Current Status") field(INAM, "mgntInit") field(SNAM, "mgntRiplOK") field(INPA, "QUAD:DMPS:300:IRIPL.VAL") field(INPB, "QUAD:DMPS:300: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, "QUAD:DMPS:300:R") { field(DESC, "Resistance") field(EGU, "Ohms") field(PREC, "4") field(PINI, "YES") field(DOL, "PSC:DMPS:MG02:R NPP MS") 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, "QUAD:DMPS:300:IGND") { field(DESC, "Ground Current") field(EGU, "A") field(PREC, "6") field(PINI, "YES") field(DOL, "PSC:DMPS:MG02:IGND NPP MS") field(OMSL, "closed_loop") } record(bi, "QUAD:DMPS:300:INTLKSUMY") { field(DESC, "Interlock Summary") field(INP, "PSC:DMPS:MG02:INTLKSUMY NPP MS") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(ZNAM, "OK") field(ONAM, "FAULT") field(PINI, "NO") } record(mbbo, "QUAD:DMPS:300: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, "PSC:DMPS:MG02:COOLING") field(OMSL, "closed_loop") } # The following PV is processed by :BACTFO # which is processed by :BACT record(fanout, "QUAD:DMPS:300:IACTFO") { field(DESC, "IACT processing") field(SELM, "All") field(LNK1, "QUAD:DMPS:300:IACTPREVOK") field(LNK2, "QUAD:DMPS:300:IDIFF") field(LNK3, "QUAD:DMPS:300:IADIFF") field(LNK4, "QUAD:DMPS:300:IRATIO") field(LNK5, "QUAD:DMPS:300:IDIRECT") field(LNK6, "QUAD:DMPS:300:IACTPOL_CHECK") } record(calc, "QUAD:DMPS:300:IDIFF") { field(DESC, "IDES-IACT") field(CALC, "A-B") field(INPA, "QUAD:DMPS:300:IDES") field(INPB, "QUAD:DMPS:300:IACT") field(EGU, "A") field(PREC, "9") field(HOPR, "165.0") field(LOPR, "0.0") } record(calc, "QUAD:DMPS:300:IADIFF") { field(DESC, "Absolute IDES-IACT") field(CALC, "A<0?ABS(A):A") field(INPA, "QUAD:DMPS:300:IDIFF") field(PREC, "9") } record(calc, "QUAD:DMPS:300:IRATIO") { field(DESC, "IDES-IACT/IMAX") field(CALC, "B?A/B:0") field(INPA, "QUAD:DMPS:300:IDIFF") field(INPB, "QUAD:DMPS:300:IDES.DRVH") field(PREC, "9") } record(calcout, "QUAD:DMPS:300:IRANGE") { field(DESC, "Current Range") field(PINI, "YES") field(CALC, "ABS(A-B)") field(INPA, "QUAD:DMPS:300:IMIN") field(INPB, "QUAD:DMPS:300: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, "QUAD:DMPS:300: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, "QUAD:DMPS:300:IACT") field(FLNK, "QUAD:DMPS:300:IACTPOL") } record(bo, "QUAD:DMPS:300:IACTPOL") { field(DESC, "Actual I Polarity") field(DTYP, "Raw Soft Channel") field(DOL, "QUAD:DMPS:300: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,"QUAD:DMPS:300:I*LIMITS:\n Calculate alarm and warning limits based on \n deltas from QUAD:DMPS:300:IDELTAS and the\n QUAD:DMPS:300: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,"QUAD:DMPS:300:IACT: \n Get copy of QUAD:DMPS:300:I. \n",null) #! TextBox(TB12,1280,3100,1760,3200,0,"Dialog",12,1,16777215,"QUAD:DMPS:300: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,"QUAD:DMPS:300:IDES:\n Contains raw value calculated by \nQUAD:DMPS:300: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 \nQUAD:DMPS:300:BDELTAS.\n",null) #! TextBox(TB10,56,1940,316,2340,0,"Dialog",12,1,16777215,"QUAD:DMPS:300: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 QUAD:DMPS:300: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 QUAD:DMPS:300: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,"QUAD:DMPS:300:ISETPT:\n Sets the hardware. When fast feedback is set on, this record is\n set to closed loop mode by QUAD:DMPS:300:FBCKSTART sequence. When \n the loop is closed, this record takes input calculated by \n BFBCK only. When fast feedback is set off, QUAD:DMPS:300:FBCKSTOP \n will set it back to supervisory so that the value can be set by \n QUAD:DMPS:300: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, "QUAD:DMPS:300:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "QUAD:DMPS:300:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "QUAD:DMPS:300:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "QUAD:DMPS:300:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "QUAD:DMPS:300:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "QUAD:DMPS:300:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "1") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "QUAD:DMPS:300: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, "QUAD:DMPS:300:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "QUAD:DMPS:300:TRIMTYPE.RVAL") field(INPB, "QUAD:DMPS:300:CONFIG.RVAL") field(OUT, "QUAD:DMPS:300:TRIMMAXNUM PP") } record(longout, "QUAD:DMPS:300: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, "QUAD:DMPS:300: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, "") field(OMSL, "supervisory") field(VAL, "10") field(OUT, "QUAD:DMPS:300:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "QUAD:DMPS:300: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, "") field(OMSL, "supervisory") field(VAL, "10") } record(bo, "QUAD:DMPS:300: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, "QUAD:DMPS:300: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, "QUAD:DMPS:300: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, "QUAD:DMPS:300:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "0") } record(ao, "QUAD:DMPS:300: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, "QUAD:DMPS:300:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "QUAD:DMPS:300: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, "QUAD:DMPS:300: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, "QUAD:DMPS:300:IMOVE") field(INPB, "QUAD:DMPS:300:IACT") field(INPC, "QUAD:DMPS:300:IRAMPRATE") field(INPD, "1.577") field(INPE, "QUAD:DMPS:300:TRIMDLYPCT") field(INPF, "QUAD:DMPS:300:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "QUAD:DMPS:300:RAMPTIME_LEFT PP") } record(longout, "QUAD:DMPS:300:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "QUAD:DMPS:300:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "QUAD:DMPS:300:RAMPDONE_CALC") } record(calc, "QUAD:DMPS:300:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "QUAD:DMPS:300:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "QUAD:DMPS:300:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "QUAD:DMPS:300: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, "QUAD:DMPS:300:RAMPTIME_LEFT") field(OUT, "QUAD:DMPS:300:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "QUAD:DMPS:300:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "QUAD:DMPS:300:RAMPTIME_LEFT NMS") field(OUT, "QUAD:DMPS:300:RAMPDONE PP") } record(bo, "QUAD:DMPS:300:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "QUAD:DMPS:300:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "QUAD:DMPS:300: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, "QUAD:DMPS:300: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, "QUAD:DMPS:300:STDZINIT") { field(DESC, "Proc. Stdz PVs on boot") field(PINI, "YES") field(DOL1, "1") field(DOL2, "1") field(DOL3, "1") field(LNK1, "QUAD:DMPS:300:DEBUG.PROC PP") field(LNK2, "QUAD:DMPS:300:STDZCYCLENUM.PROC PP") field(LNK3, "QUAD:DMPS:300:STDZDISABLE.PROC PP") field(LNK4, "QUAD:DMPS:300: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, "QUAD:DMPS:300:STDZSUB") { field(DESC, "Stdz subroutine") field(INAM, "mgntStdzInit") field(SNAM, "mgntStdz") field(BRSV, "INVALID") field(INPA, "QUAD:DMPS:300:STDZIMIN NPP NMS") field(INPB, "QUAD:DMPS:300:STDZIMAX NPP NMS") field(INPC, "QUAD:DMPS:300:STDZIFINAL NPP NMS") field(INPD, "QUAD:DMPS:300:STDZCYCLENUM NPP NMS") field(INPE, "QUAD:DMPS:300:STDZDIRECT.RVAL NPP NMS") field(INPF, "QUAD:DMPS:300:STDZDISABLE.RVAL CPP NMS") field(INPG, "QUAD:DMPS:300: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, "QUAD:DMPS:300:STDZWF PP") field(OUTB, "QUAD:DMPS:300: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, "QUAD:DMPS:300:STDZWF") } record(mbbo, "QUAD:DMPS:300: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, "QUAD:DMPS:300: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, "QUAD:DMPS:300:STDZMAINPS") { field(DESC, "Stdz by main or self") field(PINI, "YES") field(DTYP, "Soft Channel") field(ZNAM, "SELF") field(ONAM, "MAIN") } record(bo, "QUAD:DMPS:300: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, "QUAD:DMPS:300: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, "QUAD:DMPS:300: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, "QUAD:DMPS:300:STDZTOD") { field(DESC, "Successful Standardize Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "QUAD:DMPS:300:STDZLOSTTOD") { field(DESC, "Standardize Lost Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(longout, "QUAD:DMPS:300:STDZCYCLECNT") { field(DESC, "Cycle Count") field(PINI, "YES") } record(longout, "QUAD:DMPS:300:STDZCYCLENUM") { field(DESC, "No. Standardize Cycles") field(VAL, "3") field(HOPR, "10") field(LOPR, "0") field(DRVH, "10") field(DRVL, "0") field(PINI, "YES") field(FLNK, "QUAD:DMPS:300:STDZDIRECT") } # The default standardize direction is "UP" for # all LCLS Magnets.. record(bo, "QUAD:DMPS:300:STDZDIRECT") { field(DESC, "Standardize Direction ") field(ZNAM, "UP") field(ONAM, "DOWN") field(VAL, "0") field(FLNK, "QUAD:DMPS:300:STDZIMIN") } record(ao, "QUAD:DMPS:300:STDZIMIN") { field(DESC, "Min-STDZ Current") field(PREC, "1") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(VAL, "0.0") field(FLNK, "QUAD:DMPS:300:STDZIMAX") } record(ao, "QUAD:DMPS:300:STDZIMAX") { field(DESC, "Max. Standarize Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(VAL, "165.0") field(FLNK, "QUAD:DMPS:300:STDZIFINAL") } record(ao, "QUAD:DMPS:300:STDZIFINAL") { field(DESC, "Final SDTZ Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(VAL, "0.0") field(FLNK, "QUAD:DMPS:300: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, "QUAD:DMPS:300: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, "QUAD:DMPS:300:STDZITOL") { field(DESC, "Stdz min tolerance") field(PREC, "5") field(CALC, "MAX(ABS(A),ABS(B))*C") field(INPA, "QUAD:DMPS:300:STDZIMIN CP NMS") field(INPB, "QUAD:DMPS:300:STDZIMAX CP MMS") field(INPC, "0.05") field(INPD, "QUAD:DMPS:300:STDZITOLR CP MMS") field(EGU, "A") field(FLNK, "QUAD:DMPS:300:IDELTAS") field(PINI, "YES") } # D - factor (3.154/2 = 1.577) for EPSC, otherwise, set to 1.0 record(calc, "QUAD:DMPS:300:STDZDLY") { field(DESC, "Ramp time for stdz cycle") field(CALC, "C>0?MAX(1,ABS((A-B)/C)*D):0") field(INPA, "QUAD:DMPS:300:STDZIMIN CP NMS") field(INPB, "QUAD:DMPS:300:STDZIMAX CP NMS") field(INPC, "QUAD:DMPS:300:TRIMRAMPRATE CP NMS") field(INPD, "1.577") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") } record(calc, "QUAD:DMPS:300:STDZRAMPDLY") { field(DESC, "Ramp delay total") field(CALC, "MAX(1,((A/100)*B+B))") field(PREC, "5") field(INPA, "QUAD:DMPS:300:TRIMDLYPCT CP MS") field(INPB, "QUAD:DMPS:300: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, "QUAD:DMPS:300:STDZMINIDLY") { field(DESC, "Mini-stdz delay") field(CALC, "A") field(PREC, "5") field(A, "1.0") field(EGU, "sec") field(PINI, "YES") } record(ao, "QUAD:DMPS:300: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, "QUAD:DMPS:300:STDZMINIDELTA") { field(DESC, "Stdz mini % of IMAX") field(CALC, "(B/100)*(A-C)") field(INPA, "QUAD:DMPS:300:IDES.HOPR") field(INPB, "QUAD:DMPS:300:STDZMINIPCT CPP NMS") field(INPC, "QUAD:DMPS:300:IDES.LOPR") field(PREC, "5") } record(calc, "QUAD:DMPS:300:STDZMINISETPT") { field(DESC, "Mini Stdz delta") field(CALC, "C==0?MAX(E-D,B):MIN(E+D,A)") field(INPA, "QUAD:DMPS:300:IDES.HOPR") field(INPB, "QUAD:DMPS:300:IDES.LOPR") field(INPC, "QUAD:DMPS:300:STDZDIRECT.RVAL") field(INPD, "QUAD:DMPS:300:STDZMINIDELTA") field(INPE, "QUAD:DMPS:300:IDES") field(PREC, "5") field(FLNK, "QUAD:DMPS:300: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, "QUAD:DMPS:300:STDZMINISETPTOOR") { field(DESC, "Mini Stdz setpoint out of range") field(CALC, "C==0?(E-DA)") field(INPA, "QUAD:DMPS:300:IDES.HOPR") field(INPB, "QUAD:DMPS:300:IDES.LOPR") field(INPC, "QUAD:DMPS:300:STDZDIRECT.RVAL") field(INPD, "QUAD:DMPS:300:STDZMINIDELTA") field(INPE, "QUAD:DMPS:300: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, "QUAD:DMPS:300: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, "QUAD:DMPS:300:IADJUST.RVAL") field(INPB, "QUAD:DMPS:300:STDZDIRECT.RVAL") field(INPC, "QUAD:DMPS:300:STDZOK.RVAL") field(INPD, "QUAD:DMPS:300:STDZDISABLE.RVAL") field(INPE, "QUAD:DMPS:300:STATE.RVAL CPP NMS") field(INPF, "QUAD:DMPS:300:ICTRL.RVAL") field(INPG, "QUAD:DMPS:300:STATE.SEVR") field(INPH, "QUAD:DMPS:300:BDELTAS.M") field(INPI, "QUAD:DMPS:300:IACT.SEVR") field(OUT, "QUAD:DMPS:300:STDZLOSTGO.SELN PP NMS") field(OOPT, "Transition To Non-zero") } record(seq, "QUAD:DMPS:300:STDZLOSTGO") { field(DESC, "Process lost stdz") field(SELM, "Mask") field(DOL1, "1") field(DOL2, "0") field(LNK1, "QUAD:DMPS:300:STDZLOSTTOD.PROC") field(LNK2, "QUAD:DMPS:300:STDZOK PP") } # Record maximum current after standardize # Reset to IACT from sequence after trim # Disable processing during (mini-)standardize or trim record(calc, "QUAD:DMPS:300:STDZIACTMAX") { field(DESC, "Max act current after stdz") field(CALC, "MAX(A, B)") field(DISV, "0") field(SDIS, "QUAD:DMPS:300:CHECKPWRDIP_ENABLE") field(INPA, "QUAD:DMPS:300:IACT CP") field(INPB, "QUAD:DMPS:300:STDZIACTMAX") field(EGU, "A") field(FLNK, "QUAD:DMPS:300:CHECKPWRDIP") } # Detect power dip if STDZOK is YES, STDZ is enabled, and IACT is valid # If IACT drops below STDZIACTMAX by more than the trim tolerance, clear STDZOK # Warning: Take the absolute value of the trim tolerance, or else quads of # negative polarity will always lose STDZ since their IDELTAS.I are negative. # Note: Large quads and bends are prone to losing STDZ even if they are # perturbed toward higher current since their current tends to overshoot # by greater than the trim tolerance before settling down. record(calcout, "QUAD:DMPS:300:CHECKPWRDIP") { field(DESC, "Detect power dip") field(CALC, "(A-B>ABS(C))?3:0") field(DISV, "0") field(SDIS, "QUAD:DMPS:300:CHECKPWRDIP_ENABLE") field(INPA, "QUAD:DMPS:300:STDZIACTMAX") field(INPB, "QUAD:DMPS:300:IACT") field(INPC, "QUAD:DMPS:300:IDELTAS.I") field(OUT, "QUAD:DMPS:300:STDZLOSTGO.SELN PP NMS") field(OOPT, "When Non-zero") } # Enable processing of STDZIACTMAX and CHECKPWRDIP only if # STDZOK = YES, STDZDISABLE = NO, CTRL != Trim (2), and # CTRL != Stdz (4) record(calc, "QUAD:DMPS:300:CHECKPWRDIP_ENABLE") { field(CALC, "A&&!B&&(C#2)&&(C#4)") field(INPA, "QUAD:DMPS:300:STDZOK.RVAL CP") field(INPB, "QUAD:DMPS:300:STDZDISABLE.RVAL CP") field(INPC, "QUAD:DMPS:300:CTRL.RVAL CP") } #! 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, "QUAD:DMPS:300: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, "QUAD:DMPS:300:CALBOK") { field(DESC, "Successful Calibration") field(DTYP, "Raw Soft Channel") field(ZNAM, "NO") field(ONAM, "YES") field(DOL, "PSC:DMPS:MG02:CALBOK.RVAL") field(OMSL, "closed_loop") 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, "QUAD:DMPS:300:CALBSET") { field(DESC, "Use DAC Calbration") field(SCAN, "10 second") field(CALC, "A&&(B==0)&&C?31:960") field(INPA, "QUAD:DMPS:300:CALBOK") field(INPB, "QUAD:DMPS:300:CALBDISABLE") field(INPC, "QUAD:DMPS:300:CALBSLOPE") field(OOPT, "On Change") field(OUT, "QUAD:DMPS:300: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, "QUAD:DMPS:300:CALB_SEQ") { field(DESC, "Output Calib Values") field(SELM, "Mask") field(SELL, "QUAD:DMPS:300: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, "QUAD:DMPS:300:CALBSLOPE") field(DOL3, "QUAD:DMPS:300: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, "QUAD:DMPS:300:CALBTOD") { field(DESC, "Calibration Success Time") field(PINI, "YES") field(DOL, "PSC:DMPS:MG02:CALBTOD") field(OMSL, "closed_loop") field(DTYP, "Soft Channel") info(autosaveFields,"VAL") } record(ao, "QUAD:DMPS:300: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, "QUAD:DMPS:300: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, "QUAD:DMPS:300: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, "QUAD:DMPS:300:CALBOFFSET") { field(DESC, "Calc DAC Offset") field(PREC, "6") field(EGU, "Counts") field(PINI, "YES") } record(bo, "QUAD:DMPS:300: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, "QUAD:DMPS:300:DACSLOPE") { field(DESC, "V to DAC slope") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "closed_loop") field(PINI, "YES") field(FLNK, "QUAD:DMPS:300:DACOFFSET") } # Default Offset used in conversion from Volts to DAC Counts record(ao, "QUAD:DMPS:300:DACOFFSET") { field(DESC, "V to DAC offset") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "closed_loop") field(PINI, "YES") field(FLNK, "QUAD:DMPS:300: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, "QUAD:DMPS:300: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, "QUAD:DMPS:300:IACT") field(INPD, "QUAD:DMPS:300:DACSLOPE") field(INPE, "QUAD:DMPS:300:DACOFFSET") field(EGU, "Counts") field(PREC, "6") } record(ao, "QUAD:DMPS:300:DAC") { field(DESC, "DAC Set point") field(EGU, "Counts") field(DOL, "") field(OMSL, "closed_loop") field(PREC, "6") field(PINI, "YES") } record(ao, "QUAD:DMPS:300:CALBIMIN") { field(DESC, "Calibration Min Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(DRVH, "165.0") field(HOPR, "165.0") field(DRVL, "0.0") field(LOPR, "0.0") field(PREC, "3") field(EGU, "A") field(VAL, "0.0") field(FLNK, "QUAD:DMPS:300:CALBIMAX") } record(ao, "QUAD:DMPS:300:CALBIMAX") { field(DESC, "Calibration Max Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(DRVH, "165.0") field(HOPR, "165.0") field(LOPR, "0.0") field(DRVL, "0.0") field(EGU, "A") field(VAL, "165.0") field(FLNK, "QUAD:DMPS:300:CALBSTEPNUM") } record(ao, "QUAD:DMPS:300:CALBIFINAL") { field(DESC, "Calibration Last Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(PREC, "3") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(VAL, "0") } record(longout, "QUAD:DMPS:300: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, "QUAD:DMPS:300:CALBIDELTA") } record(calc, "QUAD:DMPS:300:CALBIDELTA") { field(DESC, "Step size for CALB") field(CALC, "C=0?0:ABS((A-B)/C)") field(INPA, "QUAD:DMPS:300:CALBIMAX") field(INPB, "QUAD:DMPS:300:CALBIMIN") field(INPC, "QUAD:DMPS:300: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, "QUAD:DMPS:300:CALBIMULT") { field(DESC, "IACT vs ISETPT mult") field(CALC, "C#0||A=0?1:ABS(B/A)") field(INPA, "PSC:DMPS:MG02:ISETPT.DRVH") field(INPB, "PSC:DMPS:MG02:IACT.HOPR") field(INPC, "QUAD:DMPS:300:PSCONTROLLER.RVAL CPP") field(EGU, "A") field(PINI, "YES") } # SNL dbputs DAC values here. 6-10 steps are possible. record(waveform, "QUAD:DMPS:300:CALBICTRLWF") { field(DESC, "ICTRL setpoint array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") } record(waveform, "QUAD:DMPS:300:DACWF") { field(DESC, "DAC count array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:DMPS:300:DACSA") } # Used only for xygraph edm plot record(subArray, "QUAD:DMPS:300:DACSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "QUAD:DMPS:300: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, "QUAD:DMPS:300:CALCDACWF") { field(DESC, "Calc DAC counts array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:DMPS:300:CALCDACSA") } # Used only for xygraph edm plot record(subArray, "QUAD:DMPS:300:CALCDACSA") { field(DESC, "Calc DAC counts") field(DTYP, "Soft Channel") field(INP, "QUAD:DMPS:300: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, "QUAD:DMPS:300:CALBYWF") { field(DESC, "mx + b") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:DMPS:300:CALBYSA") } # Used only for xygraph edm plot record(subArray, "QUAD:DMPS:300:CALBYSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "QUAD:DMPS:300:CALBYWF") field(MALM, "10") field(NELM, "6") field(INDX, "0") field(FTVL, "DOUBLE") } record(waveform, "QUAD:DMPS:300:CALBIACTWF") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:DMPS:300:CALBIACTSA") } # Used only for xygraph edm plot record(subArray, "QUAD:DMPS:300:CALBIACTSA") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(MALM, "10") field(NELM, "6") field(INP, "QUAD:DMPS:300:CALBIACTWF") field(INDX, "0") field(FTVL, "DOUBLE") field(FLNK, "QUAD:DMPS:300:CALBLIMITS") } # Check that measured current during calibration is within # tolerance. record(aSub, "QUAD:DMPS:300: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, "QUAD:DMPS:300:CALBSTEPNUM") field(INPB, "QUAD:DMPS:300:CALBIACTWF") field(INPC, "QUAD:DMPS:300: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, "QUAD:DMPS:300: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, "QUAD:DMPS:300:STDZITOL") field(INPH, "QUAD:DMPS:300:DACSLOPE") field(INPI, "QUAD:DMPS:300: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, "QUAD:DMPS:300: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, "QUAD:DMPS:300:CALBSTEPNUM") field(INPB, "QUAD:DMPS:300:CALBIACTWF") field(INPC, "QUAD:DMPS:300:DACWF") field(INPF, "QUAD:DMPS:300: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 QUAD:DMPS:300CALBOK 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, "QUAD:DMPS:300:DEGAUSINIT") { field(DESC, "Proc. Degauss PVs on boot") field(PINI, "YES") field(DOL, "1") field(OUTA, "QUAD:DMPS:300:DEGAUSIMIN.PROC PP") field(OUTB, "QUAD:DMPS:300:DEGAUSIMAX.PROC PP") field(OUTC, "QUAD:DMPS:300:DEGAUSTYPE.PROC PP") field(OUTD, "QUAD:DMPS:300:DEGAUSSTEP.PROC PP") field(OUTE, "QUAD:DMPS:300:MADNAME.PROC PP") field(OUTF, "QUAD:DMPS:300:PSTYPE.PROC PP") field(OUTG, "QUAD:DMPS:300: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, "QUAD:DMPS:300:DEGAUSSUB") { field(DESC, "Degauss subroutine") field(INAM, "mgntDegaussInit") field(SNAM, "mgntDegauss") field(BRSV, "INVALID") field(INPA, "QUAD:DMPS:300:DEGAUSIMIN NPP NMS") field(INPB, "QUAD:DMPS:300:DEGAUSIMAX NPP NMS") field(INPC, "QUAD:DMPS:300:DEGAUSTYPE.RVAL NPP NMS") field(INPE, "QUAD:DMPS:300:DEGAUSMETHOD.RVAL NPP NMS") field(INPF, "QUAD:DMPS:300:PSTYPE NPP NMS") field(INPG, "QUAD:DMPS:300:DEBUG.RVAL NPP NMS") field(INPH, "QUAD:DMPS:300: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, "QUAD:DMPS:300:DEGAUSWF PP") field(OUTB, "QUAD:DMPS:300:DEGAUSMSG PP") field(OUTC, "QUAD:DMPS:300: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, "QUAD:DMPS:300:DEGAUSWF") { field(DESC, "Degauss Setpts") field(NELM, "60") field(FTVL, "DOUBLE") } record(mbbo,"QUAD:DMPS:300: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, "QUAD:DMPS:300: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, "QUAD:DMPS:300: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, "QUAD:DMPS:300: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, "QUAD:DMPS:300: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, "QUAD:DMPS:300:DEGAUSIMIN") { field(DESC, "Min. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "165.0") field(LOPR, "-165.0") field(DRVH, "165.0") field(DRVL, "-165.0") field(VAL, "-165.0") } record(ao, "QUAD:DMPS:300:DEGAUSIMAX") { field(DESC, "Max. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "165.0") field(LOPR, "-165.0") field(DRVH, "165.0") field(DRVL, "-165.0") field(VAL, "165.0") } # 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,"QUAD:DMPS:300: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, "QUAD:DMPS:300: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,"QUAD:DMPS:300: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, "QUAD:DMPS:300: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, "QUAD:DMPS:300: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, "QUAD:DMPS:300: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, "QUAD:DMPS:300:DEGAUSTOD") { field(DESC, "Successful Degauss Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "QUAD:DMPS:300:DEGAUSLOSTTOD") { field(DESC, "Degauss Lost Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "QUAD:DMPS:300:DEGAUSTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "QUAD:DMPS:300:DEGAUSTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "QUAD:DMPS:300: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, "QUAD:DMPS:300:DEGAUSGO") { field(DESC, "Set bdes of btrms to zero") field(ASG, "Internal") field(OUTA, "") field(OUTB, "") field(OUTC, "") field(OUTD, "") } # =========== CRYO ONLY =========== record(bo, "QUAD:DMPS:300: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, "QUAD:DMPS:300:DEGAUS_IMAX_CHECK") { field(DESC, "Check if imax shoud chg") field(CALC, "(C==4)&&(ABS(B)>ABS(A))?1:0") field(INPA, "QUAD:DMPS:300:DEGAUS_IMAX") field(INPB, "QUAD:DMPS:300:ISETPT") field(INPC, "QUAD:DMPS:300:DEGAUSTYPE.RVAL") field(OUT, "QUAD:DMPS:300:DEGAUS_IMAX_UPDATE.SELN") field(FLNK, "QUAD:DMPS:300:DEGAUS_IMAX_UPDATE") } record(seq, "QUAD:DMPS:300:DEGAUS_IMAX_UPDATE") { field(DESC, "Degauss IMAX Update") field(SELM, "Specified") field(DOL1, "QUAD:DMPS:300:ISETPT") field(LNK1, "QUAD:DMPS:300:DEGAUS_IMAX PP") } # Set the maximum current after a successful # degauss. This pv is updated by the # sequence. record(ao, "QUAD:DMPS:300:DEGAUS_IMAX") { field(DESC, "Max I set afer a degauss") field(EGU, "Amps") field(PINI, "YES") field(PREC, "6") field(HOPR, "165.0") field(LOPR, "-165.0") field(DRVH, "165.0") field(DRVL, "-165.0") field(VAL, "165.0") field(FLNK, "QUAD:DMPS:300:DEGAUS_IMAXPOL_CHECK") info(autosaveFields,"VAL,RVAL") } # Set the polarity if degauss_imax record(calcout, "QUAD:DMPS:300:DEGAUS_IMAXPOL_CHECK") { field(DESC, "Determine polarity of imax") field(CALC, "A>=0?0:1") field(INPA, "QUAD:DMPS:300:DEGAUS_IMAX") field(FLNK, "QUAD:DMPS:300:DEGAUS_IMAXPOL") } record(bo, "QUAD:DMPS:300:DEGAUS_IMAXPOL") { field(DESC, "Polarity of imax I") field(DTYP, "Raw Soft Channel") field(DOL, "QUAD:DMPS:300:DEGAUS_IMAXPOL_CHECK") field(OMSL, "closed_loop") field(ZNAM, "Positive") field(ONAM, "Negative") field(FLNK, "QUAD:DMPS:300: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, "QUAD:DMPS:300:DEGAUS_ABSIMAX") { field(DESC, "Absolute Max. Degauss I") field(CALC, "ABS(A)") field(INPA, "QUAD:DMPS:300:DEGAUS_IMAX") field(PREC, "6") field(EGU, "Amps") field(HOPR, "165.0") field(LOPR, "-165.0") info(autosaveFields,"VAL RVAL") } # IACT Polarity record(calcout, "QUAD:DMPS:300:IACTPOL_CHECK") { field(DESC, "Determine IACT polarity") field(SCAN, "5 second") field(CALC, "ABS(A-B)>C?(A>=0?0:1):D") field(INPA, "QUAD:DMPS:300:IACT") field(INPB, "QUAD:DMPS:300:IACTPOL_CHECK.LA") field(INPC, "0.0001") field(INPD, "QUAD:DMPS:300:IACTPOL_CHECK.PVAL") field(OOPT, "On Change") field(FLNK, "QUAD:DMPS:300:IACTPOL") } record(bo, "QUAD:DMPS:300: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,"QUAD:DMPS:300: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, "QUAD:DMPS:300:DEGAUSENABLE CP") field(INPB, "QUAD:DMPS:300:DEGAUSOK") field(INPC, "QUAD:DMPS:300:STATE CP") field(INPD, "QUAD:DMPS:300:STATE.SEVR") field(OUT, "QUAD:DMPS:300:DEGAUS_STATE_SEQ.SELN PP") field(ASG, "Internal") } record(seq, "QUAD:DMPS:300:DEGAUS_STATE_SEQ") { field(DESC, "Degauss State Sequence") field(SELM, "Specified") field(SELL, "QUAD:DMPS:300:DEGAUS_STATE_CHECK") field(LNK1, "QUAD:DMPS:300:DEGAUS_STATE_DISABLE.PROC PP") field(LNK2, "QUAD:DMPS:300:DEGAUS_STATE_LOST.PROC PP") field(LNK3, "QUAD:DMPS:300:DEGAUS_STATE_GOOD.PROC PP") field(LNK4, "QUAD:DMPS:300: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, "QUAD:DMPS:300:DEGAUS_STATE_DISABLE") { field(DESC, "Degauss not used") field(LNK1, "QUAD:DMPS:300:DEGAUSOK.ZSV") field(LNK2, "QUAD:DMPS:300: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, "QUAD:DMPS:300:STATMSG.FRSV") field(LNK4, "QUAD:DMPS:300: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, "QUAD:DMPS:300:DEGAUS_STATE_LOST") { field(DESC, "Degauss lost and ps On") field(DOL1, "1") field(LNK1, "QUAD:DMPS:300:DEGAUSOK.ZSV") field(LNK2, "QUAD:DMPS:300: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, "QUAD:DMPS:300:STATMSG.FRSV") field(LNK4, "QUAD:DMPS:300: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, "QUAD:DMPS:300:DEGAUS_STATE_OFF") { field(DESC, "Degaused lost and ps Off") field(DOL1, "2") field(LNK1, "QUAD:DMPS:300: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, "QUAD:DMPS:300:STATMSG.FRSV") field(LNK3, "QUAD:DMPS:300: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, "QUAD:DMPS:300:DEGAUS_STATE_GOOD") { field(DESC, "Degauss good") field(DOL1, "1") field(LNK1, "QUAD:DMPS:300: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, "QUAD:DMPS:300:STATMSG.FRSV PP") field(LNK3, "QUAD:DMPS:300:STATMSG.FVSV PP") field(LNK4, "") field(ASG, "Internal") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(mbbo, "QUAD:DMPS:300:FUNC") { field(DESC, "QUAD:DMPS:300 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, "1") field(THVL, "9") field(FRVL, "10") field(FVVL, "0") field(SXVL, "2") field(SVVL, "8") field(EIVL, "11") field(NIVL, "12") field(TEVL, "13") field(ELVL, "5") field(TVVL, "6") field(TTVL, "7") field(FTVL, "4") field(FFVL, "3") field(OUT, "QUAD:DMPS:300:CTRL CA") } # :CTRL pv is processed at boot in the # sequence mgntCtrl.st Processed in sequence # record(mbbo, "QUAD:DMPS:300:CTRL") { field(DESC, "QUAD:DMPS:300 Control") field(PINI, "NO") field(ZRST, "Ready") field(ONST, "TRIM") field(TWST, "PERTURB") field(THST, "BCON_TO_BDES") field(FRST, "BACT_TO_BDES") field(FVST, "SAVE_BDES") field(SXST, "LOAD_BDES") field(SVST, "UNDO_BDES") field(EIST, "DAC_ZERO") field(NIST, "CALB") field(TEST, "STDZ") field(ELST, "RESET") field(TVST, "TURN_ON") field(TTST, "TURN_OFF") field(FTST, "") field(FFST, "") field(ZRVL, "0") field(ONVL, "2") field(TWVL, "6") field(THVL, "15") field(FRVL, "14") field(FVVL, "11") field(SXVL, "12") field(SVVL, "13") field(EIVL, "7") field(NIVL, "3") field(TEVL, "4") field(ELVL, "8") field(TVVL, "9") field(TTVL, "10") field(FTVL, "0") field(FFVL, "0") field(OUT, "QUAD:DMPS:300:SELECTEN.A PP") field(SDIS, "0") } # If a function has been selected set this unit to busy record(calcout, "QUAD:DMPS:300:SELECTEN") { field(DESC, "Control Select Enable") field(CALC, "A>0?1:A") field(FLNK, "QUAD:DMPS:300:BUSY") } # Set to FREE on IOC reboot record(bo, "QUAD:DMPS:300:BUSY") { field(DESC, "QUAD:DMPS:300 Ctrl Done") field(DOL, "QUAD:DMPS:300:SELECTEN") field(ZNAM, "FREE") field(ONAM, "BUSY") field(PINI, "YES") field(FLNK, "QUAD:DMPS:300:SELECT") } record(bo, "QUAD:DMPS:300:SELECT") { field(ZNAM, "NO") field(ONAM, "YES") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") } record(bo, "QUAD:DMPS:300: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, "QUAD:DMPS:300:CTRLSTATE") { field(DESC, "QUAD:DMPS:300 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("QUAD:DMPS:300:CTRL",20,20,0,0,"QUAD:DMPS:300:CTRL") #! Field("QUAD:DMPS:300:CTRL.OUT",16777215,1,"QUAD:DMPS:300:CTRL.OUT") #! Link("QUAD:DMPS:300:CTRL.OUT","QUAD:DMPS:300:SELECTEN.A") #! Field("QUAD:DMPS:300:CTRL.VAL",16777215,1,"QUAD:DMPS:300:CTRL.VAL") #! Record("QUAD:DMPS:300:SELECTEN",321,381,0,0,"QUAD:DMPS:300:SELECTEN") #! Field("QUAD:DMPS:300:SELECTEN.A",16777215,0,"QUAD:DMPS:300:SELECTEN.A") #! Field("QUAD:DMPS:300:SELECTEN.FLNK",16777215,1,"QUAD:DMPS:300:SELECTEN.FLNK") #! Link("QUAD:DMPS:300:SELECTEN.FLNK","QUAD:DMPS:300:BUSY") #! Field("QUAD:DMPS:300:SELECTEN.VAL",16777215,1,"QUAD:DMPS:300:SELECTEN.VAL") #! Record("QUAD:DMPS:300:BUSY",623,274,0,0,"QUAD:DMPS:300:BUSY") #! Field("QUAD:DMPS:300:BUSY.DOL",16777215,0,"QUAD:DMPS:300:BUSY.DOL") #! Link("QUAD:DMPS:300:BUSY.DOL","QUAD:DMPS:300:SELECTEN.VAL") #! Field("QUAD:DMPS:300:BUSY.FLNK",16777215,1,"QUAD:DMPS:300:BUSY.FLNK") #! Link("QUAD:DMPS:300:BUSY.FLNK","QUAD:DMPS:300:SELECT") #! Record("QUAD:DMPS:300:SELECT",669,508,0,1,"QUAD:DMPS:300:SELECT") #! Record("QUAD:DMPS:300:FUNC",940,120,0,0,"QUAD:DMPS:300:FUNC") #! Field("QUAD:DMPS:300:FUNC.OUT",16777215,0,"QUAD:DMPS:300:FUNC.OUT") #! Link("QUAD:DMPS:300:FUNC.OUT","QUAD:DMPS:300:CTRL.VAL") #! Record("QUAD:DMPS:300:ABORT",193,41,0,0,"QUAD:DMPS:300:ABORT") #! Record("QUAD:DMPS:300:CTRLSTATE",369,34,0,0,"QUAD:DMPS:300: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,"QUAD:DMPS:300:SELECT is used for Multi-device selection.\nIt is enabled when associated QUAD:DMPS:300:CTRL is \"0\" (DONE).\nIt is disabled when associated QUAD:DMPS:300: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,"QUAD:DMPS:300: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, "QUAD:DMPS:300:BCTRL_INIT") { field(DESC, "Process BCTRL on boot") field(PINI, "YES") field(CALC, "A=3?1:0") field(INPA, "QUAD:DMPS:300:BCTRL.SEVR") field(OUT, "QUAD:DMPS:300: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, "QUAD:DMPS:300:BACT") { field(DESC, "Actual B") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "QUAD:DMPS:300:BACT") field(INPB, "QUAD:DMPS:300:POLYCOEF") field(INPC, "QUAD:DMPS:300:POLYCOEF.A") field(INPD, "QUAD:DMPS:300:POLYCOEF.B") field(INPE, "QUAD:DMPS:300:IACT MS") field(INPF, "QUAD:DMPS:300:BDELTAS PP") field(INPG, "100") field(EGU, "kG") field(HOPR, "51.1632") field(LOPR, "0.1189") field(HIHI, "51.1632") field(LOLO, "0.1189") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "51.1632") field(LOW, "0.1189") field(FLNK, "QUAD:DMPS:300: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, "QUAD:DMPS:300:BDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntPhyDeltas") field(EGU, "kG") field(HOPR, "1") field(PREC, "7") field(BRSV, "INVALID") field(INPA, "QUAD:DMPS:300:BDES") field(INPB, "QUAD:DMPS:300:TRIMBTOL") field(INPC, "QUAD:DMPS:300:TRIMBTOLR") field(INPD, "QUAD:DMPS:300:CHCKBTOL") field(INPE, "QUAD:DMPS:300:CHCKBTOLR") field(F, "2.0") field(INPG, "30") field(INPH, "QUAD:DMPS:300:BACT.VAL") # # MPS absolute and relative tolerances field(INPP, "QUAD:DMPS:300:MPSBTOL") field(INPQ, "QUAD:DMPS:300:MPSBTOLR") field(FLNK, "QUAD:DMPS:300:BCONLIMITS") info(autosaveFields,"F") } # This record is processed by BDELTAS record(aSub, "QUAD:DMPS:300:BCONLIMITS") { field(DESC, "Config B-field Limits") field(INAM, "mgntInit") field(SNAM, "mgntBCONLimits") field(INPA, "QUAD:DMPS:300:BDES") field(INPB, "QUAD:DMPS:300:BDELTAS.I") field(INPG, "QUAD:DMPS:300:DEBUG.RVAL") field(FTA, "DOUBLE") field(FTB, "DOUBLE") field(FTG, "ULONG") field(OUTA, "QUAD:DMPS:300:BCON.HIGH") field(OUTB, "QUAD:DMPS:300:BCON.LOW") field(OUTC, "QUAD:DMPS:300:BCON.HIHI") field(OUTD, "QUAD:DMPS:300:BCON.LOLO PP") field(FTVA, "DOUBLE") field(FTVB, "DOUBLE") field(FTVC, "DOUBLE") field(FTVD, "DOUBLE") field(BRSV, "INVALID") field(FLNK, "QUAD:DMPS:300:IDELTAS") } # The following PV is processed by :BACT # which is processed by :BACT # record(fanout, "QUAD:DMPS:300:BACTFO") { field(DESC, "BACT processing") field(SELM, "All") field(LNK1, "QUAD:DMPS:300:BDIFF") field(LNK2, "QUAD:DMPS:300:BADIFF") field(LNK3, "QUAD:DMPS:300:BRATIO") field(LNK4, "QUAD:DMPS:300:MPSLIMITS") field(LNK5, "QUAD:DMPS:300:I2BSTATUS") field(LNK6, "QUAD:DMPS:300:IACTFO.PROC") } record(calc, "QUAD:DMPS:300:BDIFF") { field(DESC, "BDES-BACT") field(CALC, "A-B") field(INPA, "QUAD:DMPS:300:BDES") field(INPB, "QUAD:DMPS:300:BACT") field(EGU, "kG") field(PREC, "7") } record(calc, "QUAD:DMPS:300:BADIFF") { field(DESC, "Absolute BDES-BACT") field(INPA, "QUAD:DMPS:300:BDIFF") field(EGU, "kG") field(PREC, "7") field(CALC, "A<0?ABS(A):A") } record(calc, "QUAD:DMPS:300:BRATIO") { field(DESC, "BACT Error") field(CALC, "B?A/B:0") field(INPA, "QUAD:DMPS:300:BDIFF") field(INPB, "QUAD:DMPS:300:BDES.HOPR") field(EGU, "kG") field(PREC, "7") } record(mbbi, "QUAD:DMPS:300: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, "QUAD:DMPS:300:BACT.J") } # Note: for a string slave set the MONFL # macro to the following: # MONFL=:IMONCALC MS record(sub, "QUAD:DMPS:300:BMON") { field(DESC, "Second Transductor") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "QUAD:DMPS:300:BMON") field(INPB, "QUAD:DMPS:300:POLYCOEF") field(INPC, "QUAD:DMPS:300:POLYCOEF.A") field(INPD, "QUAD:DMPS:300:POLYCOEF.B") field(INPE, "QUAD:DMPS:300:IMON MS") field(INPF, "QUAD:DMPS:300:BDELTAS.VAL") field(INPG, "100") field(EGU, "kG") field(HOPR, "51.1632") field(LOPR, "0.1189") field(HIHI, "51.1632") field(LOLO, "0.1189") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "51.1632") field(LOW, "0.1189") } # 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=PSC:DMPS:MG02:BDES CP record(ao, "QUAD:DMPS:300:BDES") { field(DESC, "Desired B-Field") field(PINI, "YES") field(DRVH, "51.1632") field(DRVL, "0.1189") field(HOPR, "51.1632") field(LOPR, "0.1189") field(PREC, "7") field(EGU, "kG") field(MDEL, "-1") field(OMSL, "supervisory") # field(DOL, "") field(OUT, "QUAD:DMPS:300:B2IDES PP") info(autosaveFields,"VAL") } record(sub, "QUAD:DMPS:300:B2IDES") { field(DESC, "Convert Desired B-Field to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:DMPS:300:POLYCOEF") field(INPC, "QUAD:DMPS:300:POLYCOEF.A") field(INPD, "QUAD:DMPS:300:POLYCOEF.B") field(PREC, "7") field(EGU, "kG") field(HOPR, "51.1632") field(LOPR, "0.1189") field(MDEL, "-1") field(INPE, "QUAD:DMPS:300:BDES.DRVH") field(INPF, "QUAD:DMPS:300:BDES.DRVL") field(BRSV, "INVALID") field(FLNK, "QUAD:DMPS:300:IDES") } record(sub, "QUAD:DMPS:300:BNOM") { field(DESC, "Nominal Field") field(PINI, "YES") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:DMPS:300:POLYCOEF") field(INPC, "QUAD:DMPS:300:POLYCOEF.A") field(INPD, "QUAD:DMPS:300:POLYCOEF.B") field(INPE, "QUAD:DMPS:300:BDES.DRVH") field(INPF, "QUAD:DMPS:300:BDES.DRVL") field(EGU, "kG") field(HOPR, "51.1632") field(LOPR, "0.1189") field(PREC, "7") field(VAL, "0.0") field(FLNK, "QUAD:DMPS:300:INOM") } record(sub, "QUAD:DMPS:300:BACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:DMPS:300:BDES.VAL") field(INPB, "QUAD:DMPS:300:BDES.DRVH") field(INPC, "QUAD:DMPS:300:BDES.DRVL") field(INPD, "QUAD:DMPS:300:BDELTAS.I") field(INPE, "QUAD:DMPS:300:BDELTAS.J") field(INPG, "QUAD:DMPS:300:STATE") field(INPH, "QUAD:DMPS:300:HSTA") field(EGU, "kG") field(HOPR, "51.1632") field(LOPR, "0.1189") field(PREC, "7") field(BRSV, "INVALID") } record(sub, "QUAD:DMPS:300:BMONLIMITS") { field(DESC, "MON Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:DMPS:300:BDES.VAL") field(INPB, "QUAD:DMPS:300:BDES.DRVH") field(INPC, "QUAD:DMPS:300:BDES.DRVL") field(INPD, "QUAD:DMPS:300:BDELTAS.K") field(INPE, "QUAD:DMPS:300:BDELTAS.L") field(INPG, "QUAD:DMPS:300:STATE") field(INPH, "QUAD:DMPS:300:HSTA") field(EGU, "kG") field(HOPR, "51.1632") field(LOPR, "0.1189") field(PREC, "7") field(BRSV, "INVALID") } record(seq, "QUAD:DMPS:300:BLIMITS") { field(DESC, "ACT Limits") field(PREC, "7") field(DOL1, "QUAD:DMPS:300:BLIMITS") field(LNK1, "QUAD:DMPS:300:BACTLIMITS.F PP") field(DOL2, "QUAD:DMPS:300:BACTLIMITS.I") field(LNK2, "QUAD:DMPS:300:BACT.HIGH") field(DOL3, "QUAD:DMPS:300:BACTLIMITS.J") field(LNK3, "QUAD:DMPS:300:BACT.LOW") field(DOL4, "QUAD:DMPS:300:BACTLIMITS.K") field(LNK4, "QUAD:DMPS:300:BACT.HIHI") field(DOL5, "QUAD:DMPS:300:BACTLIMITS.L") field(LNK5, "QUAD:DMPS:300:BACT.LOLO") field(DOL6, "QUAD:DMPS:300:BLIMITS") field(LNK6, "QUAD:DMPS:300:BMONLIMITS.F PP") field(DOL7, "QUAD:DMPS:300:BMONLIMITS.I") field(LNK7, "QUAD:DMPS:300:BMON.HIGH") field(DOL8, "QUAD:DMPS:300:BMONLIMITS.J") field(LNK8, "QUAD:DMPS:300:BMON.LOW") field(DOL9, "QUAD:DMPS:300:BMONLIMITS.K") field(LNK9, "QUAD:DMPS:300:BMON.HIHI") field(DOLA, "QUAD:DMPS:300:BMONLIMITS.L") field(LNKA, "QUAD:DMPS:300:BMON.LOLO") field(FLNK, "QUAD:DMPS:300:ILIMITS") field(SCAN, "5 second") } record(ao, "QUAD:DMPS:300:BCTRL") { field(DESC, "B-Perturb") field(PREC, "7") field(EGU, "kG") field(DRVH, "51.1632") field(DRVL, "0.1189") field(HOPR, "51.1632") field(LOPR, "0.1189") # 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, "QUAD:DMPS:300: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, "QUAD:DMPS:300:BCTRLGO") { field(DESC, "Update DES and perturb") field(PREC, "7") # Disable BACT limits field(DOL1, "1") field(LNK1, "QUAD:DMPS:300:BLIMITS.VAL") # Update BDES with the BCTRL (slider) value field(DOL2, "QUAD:DMPS:300:BCTRL.VAL") field(LNK2, "QUAD:DMPS:300:BDES PP") field(DOL3, "1") field(LNK3, "QUAD:DMPS:300:IDIRECT.PROC PP") field(DOL4, "1") field(LNK4, "QUAD:DMPS:300:CHECKSTDZLOST.PROC PP") field(DOL5, "QUAD:DMPS:300:BCTRL.VAL") field(LNK5, "QUAD:DMPS:300:BCTRLSUB PP") # Re-enable BACT limits field(DOL6, "0") field(LNK6, "QUAD:DMPS:300:BLIMITS.VAL") } # Convert B-field to Current and output to ISETPT record(sub, "QUAD:DMPS:300:BCTRLSUB") { field(DESC, "Feedback") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:DMPS:300:POLYCOEF") field(INPC, "QUAD:DMPS:300:POLYCOEF.A") field(INPD, "QUAD:DMPS:300:POLYCOEF.B") field(INPE, "QUAD:DMPS:300:BDES.DRVH") field(INPF, "QUAD:DMPS:300:BDES.DRVL") field(PREC, "7") field(EGU, "kG") field(HOPR, "51.1632") field(LOPR, "0.1189") field(MDEL, "-1") field(BRSV, "INVALID") field(FLNK, "QUAD:DMPS:300:ISETPT") } record(ao, "QUAD:DMPS:300:BDESPREVTRIM") { field(DESC, "trim bdes for undo") field(DTYP, "Soft Channel") field(DRVH, "51.1632") field(DRVL, "0.1189") field(EGU, "kG") field(HOPR, "51.1632") field(LOPR, "0.1189") field(PREC, "7") field(PINI, "YES") info(autosaveFields,"VAL") } record(stringin, "QUAD:DMPS:300:MADNAME") { field(DESC, "MAD deck nomenclature") field(PINI, "YES") field(VAL, "QUE1B") } record(ai, "QUAD:DMPS:300: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, "3723.653364") } record(ao, "QUAD:DMPS:300:BMAX") { field(DESC, "Max B-Field") field(DTYP, "Soft Channel") field(DRVH, "51.1632") field(DRVL, "0.1189") field(EGU, "kG") field(HOPR, "51.1632") field(LOPR, "0.1189") field(PREC, "7") field(PINI, "YES") field(VAL, "51.1632") field(FLNK, "QUAD:DMPS:300:BSTEP") } record(ao, "QUAD:DMPS:300:BMIN") { field(DESC, "Min B-Field") field(DTYP, "Soft Channel") field(DRVH, "51.1632") field(DRVL, "0.1189") field(EGU, "kG") field(HOPR, "51.1632") field(LOPR, "0.1189") field(PREC, "7") field(PINI, "YES") field(VAL, "0.1189") field(FLNK, "QUAD:DMPS:300:BSTEP") } record(ao, "QUAD:DMPS:300:BDESSAVE") { field(DESC, "bdes for save/load") field(DTYP, "Soft Channel") field(DRVH, "51.1632") field(DRVL, "0.1189") field(EGU, "kG") field(HOPR, "51.1632") field(LOPR, "0.1189") field(PINI, "YES") field(PREC, "7") } # This record is processed by QUAD:DMPS:300: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, "QUAD:DMPS:300:BCON") { field(DESC, "Config B-Field ") field(DTYP, "Soft Channel") field(PREC, "7") field(EGU, "kG") field(HOPR, "51.1632") field(LOPR, "0.1189") field(DRVH, "51.1632") field(DRVL, "0.1189") # Set MINOR Alarm as the default, slaves will set NO_ALARM=0. field(HHSV, "MINOR") field(LLSV, "MINOR") field(HSV, "MINOR") field(LSV, "MINOR") # field(DOL , "") field(OMSL, "supervisory") field(OUT, "QUAD:DMPS:300:B2ICON PP") info(autosaveFields,"VAL") } record(sub, "QUAD:DMPS:300:B2ICON") { field(DESC, "Convert Desired ICon to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:DMPS:300:POLYCOEF") field(INPC, "QUAD:DMPS:300:POLYCOEF.A") field(INPD, "QUAD:DMPS:300:POLYCOEF.B") field(PREC, "7") field(EGU, "kG") field(HOPR, "51.1632") field(LOPR, "0.1189") field(MDEL, "-1") field(INPE, "QUAD:DMPS:300:BCON.DRVH") field(INPF, "QUAD:DMPS:300:BCON.DRVL") field(BRSV, "INVALID") field(FLNK, "QUAD:DMPS:300: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, "QUAD:DMPS:300:BSTEP") { field(DESC, "B-Field step size") field(CALC, "(C==3)||(D==3)?0:ABS(A-B)*0.005") field(INPA, "QUAD:DMPS:300:BMAX") field(INPB, "QUAD:DMPS:300:BMIN") field(INPC, "QUAD:DMPS:300:BMIN.SEVR") field(INPD, "QUAD:DMPS:300:BMAX.SEVR") field(EGU, "kG") 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,"QUAD:DMPS:300:BCTRLDISABLECALC") { field(DESC, "Calc for disabling BCTRL") field(ASG, "Internal") field(CALC, "A?2:1") field(INPA, "QUAD:DMPS:300:ONLINE CP") field(OUT, "QUAD:DMPS:300:BCTRLDISABLEFOUT PP") } record(fanout, "QUAD:DMPS:300:BCTRLDISABLEFOUT") { field(DESC, "Disable BCTRL fanout") field(SELM, "Specified") field(SELL, "QUAD:DMPS:300:BCTRLDISABLECALC") field(LNK1, "QUAD:DMPS:300:BCTRLDISABLE") field(LNK2, "QUAD:DMPS:300:BCTRLENABLE") } record(stringout, "QUAD:DMPS:300:BCTRLDISABLE") { field(DESC, "Disable BCTRL") field(DTYP, "Soft Channel") field(OUT, "QUAD:DMPS:300:BCTRL.ASG") field(VAL, "NOWRITE") field(FLNK, "QUAD:DMPS:300:BCTRLDISV_UPDATE") } record(stringout, "QUAD:DMPS:300:BCTRLENABLE") { field(DESC, "Enable BCTRL") field(DTYP, "Soft Channel") field(OUT, "QUAD:DMPS:300:BCTRL.ASG") field(VAL, "") field(FLNK, "QUAD:DMPS:300:BCTRLDISV_UPDATE") } record(calcout, "QUAD:DMPS:300:BCTRLDISV_UPDATE") { field(DESC, "Calc for updating BCTRL.DISV") field(ASG, "Internal") field(CALC, "A") field(INPA, "QUAD:DMPS:300:ONLINE") field(OUT, "QUAD:DMPS:300: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,"QUAD:DMPS:300:BACT and MON\n are processed via links from \n QUAD:DMPS:300:IACT (device raw value readback 1)\n and\n QUAD:DMPS:300: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 QUAD:DMPS:300:POLYCOEF\nC = First polynomial coefficient (offset if linear)\nD = Second polynomial coefficient (slope if linear)\nE = QUAD:DMPS:300: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,"QUAD:DMPS:300:BDES\n is processed when set by CA users or \n QUAD:DMPS:300: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,"QUAD:DMPS:300: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 QUAD:DMPS:300: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 (QUAD:DMPS:300: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,"QUAD:DMPS:300:B*LIMITS and QUAD:DMPS:300:BLIMITS:\n Calculate alarm and warning limits based on \n deltas from QUAD:DMPS:300: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,"QUAD:DMPS:300: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,"QUAD:DMPS:300: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, "QUAD:DMPS:300: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, "QUAD:DMPS:300:MPSBTOL") { field(DESC, "Absolute mps tol") field(EGU, "kG") field(PREC, "2") field(CALC, "ABS(A)*0.02") field(INPA, "QUAD:DMPS:300:BMAX") field(PINI, "YES") } # # 21-Aug-2013: K. Luchini # Set channel access security so that users # cannot easily change values. record(ao, "QUAD:DMPS:300:MPSBMAX") { field(DESC, "MPS Max B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "51.1632") field(DRVL, "0.1189") field(PINI, "YES") field(VAL, "51.1632") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "QUAD:DMPS:300:MPSBMIN") { field(DESC, "MPS Min B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "51.1632") field(DRVL, "0.1189") field(PINI, "YES") field(VAL, "0.1189") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "QUAD:DMPS:300:MPSBLLIM") { field(DESC, "MPS Low Limit B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "51.1632") field(DRVL, "0.1189") field(PINI, "YES") field(VAL, "0.1189") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "QUAD:DMPS:300:MPSBLLIM2") { field(DESC, "MPS Low Limit #2 B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "51.1632") field(DRVL, "0.1189") field(PINI, "YES") field(VAL, "0.1189") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } # Set the default to Std record(mbbo, "QUAD:DMPS:300: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, "QUAD:DMPS:300:MPSLIMITS.E PP") } record(aSub, "QUAD:DMPS:300: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, "QUAD:DMPS:300:MPS.RVAL") field(INPB, "QUAD:DMPS:300:BADIFF") field(INPC, "QUAD:DMPS:300:BDELTAS.N") field(INPD, "QUAD:DMPS:300:BACT") field(INPE, "QUAD:DMPS:300:MPSBITMASK.RVAL") field(INPF, "QUAD:DMPS:300:MPSBLLIM") field(INPG, "QUAD:DMPS:300:MPSBMIN") field(INPH, "QUAD:DMPS:300:MPSBMAX") field(INPI, "QUAD:DMPS:300: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, "QUAD:DMPS:300:INTOL.RVAL PP") field(OUTB, "QUAD:DMPS:300:INTOL_BMIN.RVAL PP") field(OUTC, "QUAD:DMPS:300:INTOL_BRANGE.RVAL PP") field(OUTD, "QUAD:DMPS:300: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, "QUAD:DMPS:300:INTOL") { field(DESC, "BACT within MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:DMPS:300:MPSLIMITS.VALA") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "QUAD:DMPS:300:INTOL_BMIN") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:DMPS:300:MPSLIMITS.VALB") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "QUAD:DMPS:300:INTOL_BMIN2") { field(DESC, "MPS tol #2") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:DMPS:300:MPSLIMITS.VALD") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "QUAD:DMPS:300:INTOL_BRANGE") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:DMPS:300: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, "QUAD:DMPS:300:CHCKITOL") { field(DESC, "Absolute Check I Tolerance") field(EGU, "A") field(FLNK, "QUAD:DMPS:300:TRIMITOL") field(CALC, "ABS(A*B)") field(INPA, "QUAD:DMPS:300:CHCKBTOL") field(INPB, "QUAD:DMPS:300:POLYCOEF.B") field(PREC, "9") } record(calc, "QUAD:DMPS:300:TRIMBTOL") { field(EGU, "kG") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(DESC, "Absolute Trim Tolerance") field(CALC, "ABS(A)/2") field(INPA, "QUAD:DMPS:300:CHCKBTOL") field(FLNK, "QUAD:DMPS:300:CHCKITOL") } record(calc, "QUAD:DMPS:300:CHCKBTOL") { field(DESC, "Check absolute tolerance") field(EGU, "A") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(FLNK, "QUAD:DMPS:300:TRIMBTOL") field(CALC, "MAX(ABS(A),ABS(C))*(B/1000000)") field(INPA, "QUAD:DMPS:300:BDES.HOPR") field(INPB, "QUAD:DMPS:300:STABILITY") field(INPC, "QUAD:DMPS:300:BDES.LOPR") } record(longout, "QUAD:DMPS:300: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, "QUAD:DMPS:300:CHCKBTOL") } record(calc, "QUAD:DMPS:300:TRIMITOL") { field(DESC, "Absolute Trim I Tolerance") field(EGU, "kG") field(CALC, "ABS(A*B)") field(INPA, "QUAD:DMPS:300:POLYCOEF.B") field(INPB, "QUAD:DMPS:300:TRIMBTOL") field(PREC, "9") } record(ai, "QUAD:DMPS:300:TRIMBTOLR") { field(DESC, "Relative trim tol") field(PREC, "4") field(EGU, "%") field(HOPR, "1.0") field(LOPR, "0.0") field(PINI, "YES") } record(ai, "QUAD:DMPS:300: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, "QUAD:DMPS:300:FBCKFCOM") { field(ZNAM, "CA") field(ONAM, "FCOM") field(DESC, "CA Mode") field(PINI, "YES") field(SDIS, "0") } record(bo, "QUAD:DMPS:300:PAU") { field(ZNAM, "NotConfigured") field(ONAM, "Configured") field(DESC, "PAU Present") field(PINI, "YES") field(SDIS, "0") field(FLNK, "QUAD:DMPS:300:PAUGO") } record(fanout, "QUAD:DMPS:300:PAUGO") { field(DESC, "PAU control") field(LNK1, "QUAD:DMPS:300:PAUSTOP") field(LNK2, "QUAD:DMPS:300: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, "QUAD:DMPS:300:PAUSTART") { field(DESC, "Setup for PAU On") field(SDIS, "QUAD:DMPS:300: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, "QUAD:DMPS:300:PAUSTOP") { field(DESC, "Setup for PAU Off") field(SDIS, "QUAD:DMPS:300: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, "QUAD:DMPS:300:MCORDEVNAME") { field(DESC, "PS device name") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, "PSC:DMPS:MG02:") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "QUAD:DMPS:300: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, "QUAD:DMPS:300:PSTYPE.RVAL") field(INPC, "QUAD:DMPS:300:TURNEDOFF.RVAL") field(INPD, "QUAD:DMPS:300:CONFIG.RVAL") field(INPE, "QUAD:DMPS:300:PSCATEGORY.RVAL") field(INPF, "QUAD:DMPS:300:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "QUAD:DMPS:300:AUTOCTRL.RVAL") field(INPJ, "QUAD:DMPS:300:OUTOFSERVICE.RVAL") field(INPL, "QUAD:DMPS:300:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "QUAD:DMPS:300:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "QUAD:DMPS:300:PAU") field(INPP, "QUAD:DMPS:300:CALBDISABLE.RVAL") field(INPQ, "QUAD:DMPS:300:PTRBDISABLE.RVAL") field(INPR, "QUAD:DMPS:300:TRIMDISABLE.RVAL") field(INPS, "QUAD:DMPS:300:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "QUAD:DMPS:300:FBCK") field(INPU, "QUAD:DMPS:300:TRIMTYPE.RVAL") field(INPV, "QUAD:DMPS:300:STDZDIRECT.RVAL") field(INPW, "QUAD:DMPS:300:DEGAUSENABLE.RVAL") field(FLNK, "QUAD:DMPS:300:HSTA") } record(longin, "QUAD:DMPS:300:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "QUAD:DMPS:300:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "QUAD:DMPS:300: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, "QUAD:DMPS:300: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, "QUAD:DMPS:300:CALBDISABLE") { field(DESC, "DAC Calb Disabled") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:DMPS:300:PTRBDISABLE") { field(DESC, "Perturb Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:DMPS:300:TRIMDISABLE") { field(DESC, "Trim Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:DMPS:300: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 QUAD:DMPS:300:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses QUAD:DMPS:300:FBCK. # This PV should be replaced by QUAD:DMPS:300: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, "QUAD:DMPS:300: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, "QUAD:DMPS:300: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, "QUAD:DMPS:300: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, "") field(OMSL, "supervisory") field(FLNK, "QUAD:DMPS:300:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"QUAD:DMPS:300:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "QUAD:DMPS:300:OUTOFSERVICE NPP NMS") field(OUT, "QUAD:DMPS:300:ONLINE PP") } record(bo, "QUAD:DMPS:300:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "QUAD:DMPS:300: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, "1") } record(bo, "QUAD:DMPS:300: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, "1") } record(bo, "QUAD:DMPS:300: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, "QUAD:DMPS:300: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, "QUAD:DMPS:300: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, "QUAD:DMPS:300: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, "QUAD:DMPS:300: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, "QUAD:DMPS:300: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, "1") field(ASG, "NOWRITE") } record(mbbo, "QUAD:DMPS:300: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, "1") field(ASG, "NOWRITE") } record(mbbo, "QUAD:DMPS:300: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, "2") field(ASG, "NOWRITE") } record(mbbo, "QUAD:DMPS:300: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, "0") field(ASG, "NOWRITE") field(FLNK, "QUAD:DMPS:300:TRIMTYPE") } record(stringout, "QUAD:DMPS:300:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "QUAD:DMPS:300:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "QUAD:DMPS:300:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "QUAD:DMPS:300:STATE.RVAL") field(INPB, "QUAD:DMPS:300:INTLKSUMY.RVAL") field(OUT, "QUAD:DMPS:300:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:DMPS:300: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, "QUAD:DMPS:300:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "QUAD:DMPS:300:STATE.RVAL") field(INPB, "QUAD:DMPS:300:INTLKSUMY.RVAL") field(OUT, "QUAD:DMPS:300:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:DMPS:300:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "QUAD:DMPS:300:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "QUAD:DMPS:300: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, "QUAD:DMPS:300:RAMPSTARTDLY") { field(DESC, "Tansition to ramp delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "2") } ######### For PSTYPE=2 Only ############# record(mbbo, "QUAD:DMPS:300: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, "QUAD:DMPS:300: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,"QUAD:DMPS:300: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("QUAD:DMPS:300:TURNEDOFF",3140,1907,0,1,"QUAD:DMPS:300:TURNEDOFF") #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "QUAD:DMPS:300:STATSUB") { field(DESC, "Build STATus ") field(INAM, "mgntInit") field(SNAM, "mgntSlcStat") field(INPA, "QUAD:DMPS:300:BACT.STAT") field(INPB, "QUAD:DMPS:300:BDES.STAT") field(INPC, "QUAD:DMPS:300:IRIPL.STAT") field(INPD, "PSC:DMPS:MG02:ISETPT.STAT") field(INPE, "PSC:DMPS:MG02:IACT.STAT") # 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, "QUAD:DMPS:300:BACT.SEVR") field(INPH, "QUAD:DMPS:300:BDES.SEVR") field(INPI, "QUAD:DMPS:300:IRIPL.SEVR") field(INPJ, "PSC:DMPS:MG02:ISETPT.SEVR") field(INPK, "PSC:DMPS:MG02:IACT.SEVR") # # 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, "QUAD:DMPS:300:STATE.RVAL") field(INPN, "QUAD:DMPS:300:STDZOK") field(INPO, "QUAD:DMPS:300:CALBOK") field(INPP, "QUAD:DMPS:300:OUTOFSERVICE.RVAL") field(INPQ, "QUAD:DMPS:300:CONFIG.RVAL") field(INPR, "QUAD:DMPS:300:HSTA") field(INPS, "QUAD:DMPS:300:CTRL.RVAL") field(INPT, "QUAD:DMPS:300:DEGAUSOK") field(INPV, "QUAD:DMPS:300: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, "QUAD:DMPS:300:STAT") } record(longout, "QUAD:DMPS:300:STAT") { field(DESC, "STAT sent to SLC") field(SCAN, "Passive") field(FLNK, "QUAD:DMPS:300:STATCTRLSUB") field(DOL, "QUAD:DMPS:300:STATSUB.VAL") field(OMSL, "closed_loop") } record(sSub, "QUAD:DMPS:300:STATCTRLSUB") { field(DESC, "Decode SLC STAT into mbbo") field(INAM, "mgntInit") field(SNAM, "mgntStatDecode") field(INPA, "QUAD:DMPS:300:STAT") field(INPB, "QUAD:DMPS:300:HSTA") field(INPD, "QUAD:DMPS:300:ONOFFCTRL.RVAL") field(FLNK, "QUAD:DMPS:300:STATMSG") } record(mbbo, "QUAD:DMPS:300: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, "QUAD:DMPS:300:UNAVAILGO") field(DOL, "QUAD:DMPS:300:STATCTRLSUB.W") } record(seq, "QUAD:DMPS:300:UNAVAILGO") { field(DESC, "Process UNAVAIL") field(DOL1, "QUAD:DMPS:300:STATSUB.U") field(LNK1, "QUAD:DMPS:300:UNAVAIL PP") } record(stringout, "QUAD:DMPS:300:SNLSTATMSG") { field(DTYP, "Soft Channel") } #! TextBox(TB0,820,1000,1200,1220,0,"Dialog",12,1,16777215,"QUAD:DMPS:300:STATUSSUB - future\nOverall device status - takes input from action snls, record sevrs, master snl(s) and outputs final status\n\nInputs:\nA - QUAD:DMPS:300:CTRLSTATUS - snl status\nB - MGNT:CTRLSTATUS - master list status\nC\nD - QUAD:DMPS:300: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,"QUAD:DMPS:300STATSUB\nformat control bo's into slc STAT\n\nInputs:\nA - QUAD:DMPS:300:STATUS\nC - QUAD:DMPS:300:ON\nD - QUAD:DMPS:300:STDZOK\nE - QUAD:DMPS:300:CALBOK\nF - QUAD:DMPS:300:BACTDRIFT (future)\nG -\nH- QUAD:DMPS:300:DACSTATUS\nI -QUAD:DMPS:300:ADCSTATUS\nJ - QUAD:DMPS:300:BACTSTATUS\nK - QUAD:DMPS:300:BDESSTATUS\nL - QUAD:DMPS:300:RIPLSTATUS\n\nOutput:\nP - QUAD:DMPS:300: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, "QUAD:DMPS:300: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, "QUAD:DMPS:300: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, "QUAD:DMPS:300: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, "QUAD:DMPS:300: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.6 #! DBDSTART #! DBD("../../../../dbd/mgntSoft.dbd") #! DBDEND record(stringout, "QUAD:DMPS:300:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "QUAD:DMPS:300:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "QUAD:DMPS:300:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "QUAD:DMPS:300:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "QUAD:DMPS:300:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "QUAD:DMPS:300:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "1") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "QUAD:DMPS:300: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, "QUAD:DMPS:300:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "QUAD:DMPS:300:TRIMTYPE.RVAL") field(INPB, "QUAD:DMPS:300:CONFIG.RVAL") field(OUT, "QUAD:DMPS:300:TRIMMAXNUM PP") } record(longout, "QUAD:DMPS:300: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, "QUAD:DMPS:300: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, "") field(OMSL, "supervisory") field(VAL, "20") field(OUT, "QUAD:DMPS:300:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "QUAD:DMPS:300: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, "") field(OMSL, "supervisory") field(VAL, "10") } record(bo, "QUAD:DMPS:300: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, "QUAD:DMPS:300: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, "QUAD:DMPS:300: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, "QUAD:DMPS:300:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "0") } record(ao, "QUAD:DMPS:300: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, "QUAD:DMPS:300:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "QUAD:DMPS:300: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, "QUAD:DMPS:300: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, "QUAD:DMPS:300:IMOVE") field(INPB, "QUAD:DMPS:300:IACT") field(INPC, "QUAD:DMPS:300:IRAMPRATE") field(INPD, "1.577") field(INPE, "QUAD:DMPS:300:TRIMDLYPCT") field(INPF, "QUAD:DMPS:300:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "QUAD:DMPS:300:RAMPTIME_LEFT PP") } record(longout, "QUAD:DMPS:300:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "QUAD:DMPS:300:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "QUAD:DMPS:300:RAMPDONE_CALC") } record(calc, "QUAD:DMPS:300:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "QUAD:DMPS:300:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "QUAD:DMPS:300:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "QUAD:DMPS:300: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, "QUAD:DMPS:300:RAMPTIME_LEFT") field(OUT, "QUAD:DMPS:300:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "QUAD:DMPS:300:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "QUAD:DMPS:300:RAMPTIME_LEFT NMS") field(OUT, "QUAD:DMPS:300:RAMPDONE PP") } record(bo, "QUAD:DMPS:300:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "QUAD:DMPS:300:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "QUAD:DMPS:300: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, "QUAD:DMPS:300: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(sSub, "QUAD:DMPS:300: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, "QUAD:DMPS:300:PSTYPE.RVAL") field(INPC, "QUAD:DMPS:300:TURNEDOFF.RVAL") field(INPD, "QUAD:DMPS:300:CONFIG.RVAL") field(INPE, "QUAD:DMPS:300:PSCATEGORY.RVAL") field(INPF, "QUAD:DMPS:300:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "QUAD:DMPS:300:AUTOCTRL.RVAL") field(INPJ, "QUAD:DMPS:300:OUTOFSERVICE.RVAL") field(INPL, "QUAD:DMPS:300:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "QUAD:DMPS:300:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "QUAD:DMPS:300:PAU") field(INPP, "QUAD:DMPS:300:CALBDISABLE.RVAL") field(INPQ, "QUAD:DMPS:300:PTRBDISABLE.RVAL") field(INPR, "QUAD:DMPS:300:TRIMDISABLE.RVAL") field(INPS, "QUAD:DMPS:300:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "QUAD:DMPS:300:FBCK") field(INPU, "QUAD:DMPS:300:TRIMTYPE.RVAL") field(INPV, "QUAD:DMPS:300:STDZDIRECT.RVAL") field(INPW, "QUAD:DMPS:300:DEGAUSENABLE.RVAL") field(FLNK, "QUAD:DMPS:300:HSTA") } record(longin, "QUAD:DMPS:300:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "QUAD:DMPS:300:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "QUAD:DMPS:300: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, "QUAD:DMPS:300: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, "QUAD:DMPS:300:CALBDISABLE") { field(DESC, "DAC Calb Disabled") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:DMPS:300:PTRBDISABLE") { field(DESC, "Perturb Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:DMPS:300:TRIMDISABLE") { field(DESC, "Trim Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:DMPS:300:STDZDISABLE") { field(DTYP, "Raw Soft Channel") field(ZNAM, "NO") field(ONAM, "YES") field(DESC, "Standardize Function") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } # This PV has been replaced by QUAD:DMPS:300:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses QUAD:DMPS:300:FBCK. # This PV should be replaced by QUAD:DMPS:300: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, "QUAD:DMPS:300: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, "QUAD:DMPS:300: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, "QUAD:DMPS:300: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, "") field(OMSL, "supervisory") field(FLNK, "QUAD:DMPS:300:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"QUAD:DMPS:300:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "QUAD:DMPS:300:OUTOFSERVICE NPP NMS") field(OUT, "QUAD:DMPS:300:ONLINE PP") } record(bo, "QUAD:DMPS:300:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "QUAD:DMPS:300: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, "1") } record(bo, "QUAD:DMPS:300: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, "1") } record(bo, "QUAD:DMPS:300: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, "QUAD:DMPS:300: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, "QUAD:DMPS:300: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, "QUAD:DMPS:300: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, "QUAD:DMPS:300: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, "QUAD:DMPS:300: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, "1") field(ASG, "NOWRITE") } record(mbbo, "QUAD:DMPS:300: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, "1") field(ASG, "NOWRITE") } record(mbbo, "QUAD:DMPS:300: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, "2") field(ASG, "NOWRITE") } record(mbbo, "QUAD:DMPS:300: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, "0") field(ASG, "NOWRITE") field(FLNK, "QUAD:DMPS:300:TRIMTYPE") } record(stringout, "QUAD:DMPS:300:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "QUAD:DMPS:300:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "QUAD:DMPS:300:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "QUAD:DMPS:300:STATE.RVAL") field(INPB, "QUAD:DMPS:300:INTLKSUMY.RVAL") field(OUT, "QUAD:DMPS:300:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:DMPS:300: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, "QUAD:DMPS:300:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "QUAD:DMPS:300:STATE.RVAL") field(INPB, "QUAD:DMPS:300:INTLKSUMY.RVAL") field(OUT, "QUAD:DMPS:300:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:DMPS:300:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "QUAD:DMPS:300:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "QUAD:DMPS:300: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, "QUAD:DMPS:300:RAMPSTARTDLY") { field(DESC, "Tansition to ramp delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "2") } ######### For PSTYPE=2 Only ############# record(mbbo, "QUAD:DMPS:300: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, "QUAD:DMPS:300: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,"QUAD:DMPS:300: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("QUAD:DMPS:300:TURNEDOFF",3140,1907,0,1,"QUAD:DMPS:300:TURNEDOFF") #! 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, "QUAD:DMPS:380:IACT") { field(DESC, "Current") field(INP, "PSC:DMPS:MG03:IACT") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "QUAD:DMPS:380:BACT") info(autosaveFields,"HYST") } record(bi, "QUAD:DMPS:380:STATE") { field(DESC, "PS On/Off Status") field(DTYP, "Raw Soft Channel") field(INP, "PSC:DMPS:MG03:STATE NPP MS") field(ZSV, "MAJOR") field(ZNAM, "OFF") field(ONAM, "ON") } record(ao, "QUAD:DMPS:380:IDES") { field(DESC, "Desired Current") field(PREC, "3") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(MDEL, "-1") field(HIHI, "165.0") field(LOLO, "0.0") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "QUAD:DMPS:380:BDELTAS") field(DRVH, "165.0") field(DRVL, "0.0") field(DOL, "QUAD:DMPS:380: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, "QUAD:DMPS:380:ICTRL PP") } # This record is processed by QUAD:DMPS:380:ICON") # Note: we are not setting alarms here. record(ao, "QUAD:DMPS:380:ICON") { field(DESC, "Config I") field(DTYP, "Soft Channel") field(PREC, "3") field(HOPR, "165.0") field(LOPR, "0.0") field(DRVH, "165.0") field(DRVL, "0.0") field(DOL, "QUAD:DMPS:380:B2ICON.K") field(OMSL, "closed_loop") info(autosaveFields,"VAL") } record(ao, "QUAD:DMPS:380:INOM") { field(DESC, "Nominal Current") field(DOL, "QUAD:DMPS:380:BNOM.K") field(OMSL, "closed_loop") field(PREC, "3") field(EGU, "A") field(DRVH, "165.0") field(DRVL, "0.0") field(HOPR, "165.0") field(LOPR, "0.0") } record(ao, "QUAD:DMPS:380:ICTRL") { field(DESC, "Set Current") field(PREC, "3") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(DRVH, "165.0") field(DRVL, "0.0") field(MDEL, "-1") field(FLNK, "QUAD:DMPS:380:ICTRLGO") field(OMSL, "supervisory") info(autosavefields,"VAL") } record(seq, "QUAD:DMPS:380:ICTRLGO") { field(DESC, "Process Current Setpoint") field(PREC, "3") # Set ISETPT to supervisory field(DOL1, "0") field(LNK1, "QUAD:DMPS:380:ISETPT.OMSL") field(DOL2, "QUAD:DMPS:380:ICTRL") field(LNK2, "QUAD:DMPS:380:ISETPT PP") # Set ISETPT to closed loop - get data from BCTRLSUB.K field(DOL3, "1") field(LNK3, "QUAD:DMPS:380:ISETPT.OMSL") } record(ao, "QUAD:DMPS:380:IMAX") { field(DESC, "Max I") field(DTYP, "Soft Channel") field(DRVH, "165.0") field(DRVL, "0.0") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(PREC, "3") field(PINI, "YES") field(VAL, "165.0") field(FLNK, "QUAD:DMPS:380:IMIN") } record(ao, "QUAD:DMPS:380:IMIN") { field(DESC, "Min I") field(DTYP, "Soft Channel") field(DRVH, "165.0") field(DRVL, "0.0") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(PREC, "3") field(VAL, "0.0") field(FLNK, "QUAD:DMPS:380:IRANGE") } record(sel, "QUAD:DMPS:380:IACTPREVOK") { field(DESC, "Last Good Current") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(PREC, "3") field(NVL, "QUAD:DMPS:380:BACT.SEVR") field(INPA, "QUAD:DMPS:380:IACT NPP MS") field(INPB, "QUAD:DMPS:380:IACTPREVOK NPP MS") field(INPC, "QUAD:DMPS:380:IACTPREVOK NPP MS") field(INPD, "QUAD:DMPS:380:IACTPREVOK NPP MS") } record(sub, "QUAD:DMPS:380:IACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:DMPS:380:IDES") field(INPB, "QUAD:DMPS:380:ISETPT.DRVH") field(INPC, "QUAD:DMPS:380:ISETPT.DRVL") field(INPD, "QUAD:DMPS:380:IDELTAS.I") field(INPE, "QUAD:DMPS:380:IDELTAS.J") field(INPG, "QUAD:DMPS:380:STATE") field(INPH, "QUAD:DMPS:380:HSTA") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(sub, "QUAD:DMPS:380:IMONLIMITS") { field(DESC, "Aux Current Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:DMPS:380:IDES") field(INPB, "QUAD:DMPS:380:ISETPT.DRVH") field(INPC, "QUAD:DMPS:380:ISETPT.DRVL") field(INPD, "QUAD:DMPS:380:IDELTAS.K") field(INPE, "QUAD:DMPS:380:IDELTAS.L") field(INPG, "QUAD:DMPS:380:STATE") field(INPH, "QUAD:DMPS:380:HSTA") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(seq, "QUAD:DMPS:380:ILIMITS") { field(DESC, "Set ACT and MON Limits") field(PREC, "3") field(DOL1, "QUAD:DMPS:380:BLIMITS") field(LNK1, "QUAD:DMPS:380:IACTLIMITS.F PP") field(DOL2, "QUAD:DMPS:380:IACTLIMITS.I") field(LNK2, "QUAD:DMPS:380:IACT.HIGH") field(DOL3, "QUAD:DMPS:380:IACTLIMITS.J") field(LNK3, "QUAD:DMPS:380:IACT.LOW") field(DOL4, "QUAD:DMPS:380:IACTLIMITS.K") field(LNK4, "QUAD:DMPS:380:IACT.HIHI") field(DOL5, "QUAD:DMPS:380:IACTLIMITS.L") field(LNK5, "QUAD:DMPS:380:IACT.LOLO") field(DOL6, "QUAD:DMPS:380:BLIMITS") field(LNK6, "QUAD:DMPS:380:IMONLIMITS.F PP") field(DOL7, "QUAD:DMPS:380:IMONLIMITS.I") field(LNK7, "QUAD:DMPS:380:IMON.HIGH") field(DOL8, "QUAD:DMPS:380:IMONLIMITS.J") field(LNK8, "QUAD:DMPS:380:IMON.LOW") field(DOL9, "QUAD:DMPS:380:IMONLIMITS.K") field(LNK9, "QUAD:DMPS:380:IMON.HIHI") field(DOLA, "QUAD:DMPS:380:IMONLIMITS.L") field(LNKA, "QUAD:DMPS:380: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, "QUAD:DMPS:380:IDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntRawDeltas") field(INPD, "QUAD:DMPS:380:TRIMBTOL") field(INPE, "QUAD:DMPS:380:CHCKBTOL") field(INPF, "QUAD:DMPS:380:BDELTAS.K") field(INPG, "QUAD:DMPS:380:BDELTAS.L") field(INPH, "QUAD:DMPS:380: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, "QUAD:DMPS:380:STDZITOLR") field(INPC, "QUAD:DMPS:380:STDZITOL") field(FLNK, "") } # All ps controllers with on/off control will set the macro ONOF # as follows: # # ONOF = PSC:DMPS:MG03: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, "QUAD:DMPS:380:STATESETPT") { field(DESC, "PS On/Off") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFF") field(ONAM, "ON") field(OUT, "PSC:DMPS:MG03:STATESETPT PP") 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 = PSC:DMPS:MG03:RESET PP # record(bo, "QUAD:DMPS:380:RESET") { field(DESC, "Interlock Latch Reset") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFF") field(ONAM, "ON") field(HIGH, "1.0") field(OUT, "PSC:DMPS:MG03:RESET PP") } record(bo, "QUAD:DMPS:380:RAMPSTATE") { field(DESC, "PS Ramp Status") field(DTYP, "Soft Channel") field(DOL, "PSC:DMPS:MG03:RAMPSTATE NPP 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, "QUAD:DMPS:380: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, "QUAD:DMPS:380:TRIMRAMPRATE") field(OUT, "PSC:DMPS:MG03:IRAMPRATE PP") field(FLNK, "QUAD:DMPS:380:STDZDLY") } record(ao, "QUAD:DMPS:380:ISETPT") { field(DESC, "Current Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(DRVH, "165.0") field(DRVL, "0.0") field(MDEL, "-1") field(OUT, "PSC:DMPS:MG03:ISETPT PP") field(DOL, "QUAD:DMPS:380: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, "QUAD:DMPS:380:IMON") { field(DESC, "Aux Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(INP, "PSC:DMPS:MG03:IMON") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "QUAD:DMPS:380:BMON") } record(ao, "QUAD:DMPS:380:IRIPL") { field(DESC, "Ripple Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(DOL, "PSC:DMPS:MG03:IRIPL NPP NMS") field(OMSL, "closed_loop") field(EGU, "A") field(DRVH, "1.0") field(HOPR, "1.0") field(PREC, "3") field(FLNK, "QUAD:DMPS:380:IRIPLOK") } record(sub, "QUAD:DMPS:380:IRIPLOK") { field(DESC, "Ripple Current Status") field(INAM, "mgntInit") field(SNAM, "mgntRiplOK") field(INPA, "QUAD:DMPS:380:IRIPL.VAL") field(INPB, "QUAD:DMPS:380: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, "QUAD:DMPS:380:R") { field(DESC, "Resistance") field(EGU, "Ohms") field(PREC, "4") field(PINI, "YES") field(DOL, "PSC:DMPS:MG03:R NPP MS") 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, "QUAD:DMPS:380:IGND") { field(DESC, "Ground Current") field(EGU, "A") field(PREC, "6") field(PINI, "YES") field(DOL, "PSC:DMPS:MG03:IGND NPP MS") field(OMSL, "closed_loop") } record(bi, "QUAD:DMPS:380:INTLKSUMY") { field(DESC, "Interlock Summary") field(INP, "PSC:DMPS:MG03:INTLKSUMY NPP MS") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(ZNAM, "OK") field(ONAM, "FAULT") field(PINI, "NO") } record(mbbo, "QUAD:DMPS:380: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, "PSC:DMPS:MG03:COOLING") field(OMSL, "closed_loop") } # The following PV is processed by :BACTFO # which is processed by :BACT record(fanout, "QUAD:DMPS:380:IACTFO") { field(DESC, "IACT processing") field(SELM, "All") field(LNK1, "QUAD:DMPS:380:IACTPREVOK") field(LNK2, "QUAD:DMPS:380:IDIFF") field(LNK3, "QUAD:DMPS:380:IADIFF") field(LNK4, "QUAD:DMPS:380:IRATIO") field(LNK5, "QUAD:DMPS:380:IDIRECT") field(LNK6, "QUAD:DMPS:380:IACTPOL_CHECK") } record(calc, "QUAD:DMPS:380:IDIFF") { field(DESC, "IDES-IACT") field(CALC, "A-B") field(INPA, "QUAD:DMPS:380:IDES") field(INPB, "QUAD:DMPS:380:IACT") field(EGU, "A") field(PREC, "9") field(HOPR, "165.0") field(LOPR, "0.0") } record(calc, "QUAD:DMPS:380:IADIFF") { field(DESC, "Absolute IDES-IACT") field(CALC, "A<0?ABS(A):A") field(INPA, "QUAD:DMPS:380:IDIFF") field(PREC, "9") } record(calc, "QUAD:DMPS:380:IRATIO") { field(DESC, "IDES-IACT/IMAX") field(CALC, "B?A/B:0") field(INPA, "QUAD:DMPS:380:IDIFF") field(INPB, "QUAD:DMPS:380:IDES.DRVH") field(PREC, "9") } record(calcout, "QUAD:DMPS:380:IRANGE") { field(DESC, "Current Range") field(PINI, "YES") field(CALC, "ABS(A-B)") field(INPA, "QUAD:DMPS:380:IMIN") field(INPB, "QUAD:DMPS:380: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, "QUAD:DMPS:380: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, "QUAD:DMPS:380:IACT") field(FLNK, "QUAD:DMPS:380:IACTPOL") } record(bo, "QUAD:DMPS:380:IACTPOL") { field(DESC, "Actual I Polarity") field(DTYP, "Raw Soft Channel") field(DOL, "QUAD:DMPS:380: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,"QUAD:DMPS:380:I*LIMITS:\n Calculate alarm and warning limits based on \n deltas from QUAD:DMPS:380:IDELTAS and the\n QUAD:DMPS:380: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,"QUAD:DMPS:380:IACT: \n Get copy of QUAD:DMPS:380:I. \n",null) #! TextBox(TB12,1280,3100,1760,3200,0,"Dialog",12,1,16777215,"QUAD:DMPS:380: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,"QUAD:DMPS:380:IDES:\n Contains raw value calculated by \nQUAD:DMPS:380: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 \nQUAD:DMPS:380:BDELTAS.\n",null) #! TextBox(TB10,56,1940,316,2340,0,"Dialog",12,1,16777215,"QUAD:DMPS:380: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 QUAD:DMPS:380: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 QUAD:DMPS:380: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,"QUAD:DMPS:380:ISETPT:\n Sets the hardware. When fast feedback is set on, this record is\n set to closed loop mode by QUAD:DMPS:380:FBCKSTART sequence. When \n the loop is closed, this record takes input calculated by \n BFBCK only. When fast feedback is set off, QUAD:DMPS:380:FBCKSTOP \n will set it back to supervisory so that the value can be set by \n QUAD:DMPS:380: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, "QUAD:DMPS:380:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "QUAD:DMPS:380:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "QUAD:DMPS:380:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "QUAD:DMPS:380:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "QUAD:DMPS:380:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "QUAD:DMPS:380:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "1") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "QUAD:DMPS:380: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, "QUAD:DMPS:380:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "QUAD:DMPS:380:TRIMTYPE.RVAL") field(INPB, "QUAD:DMPS:380:CONFIG.RVAL") field(OUT, "QUAD:DMPS:380:TRIMMAXNUM PP") } record(longout, "QUAD:DMPS:380: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, "QUAD:DMPS:380: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, "") field(OMSL, "supervisory") field(VAL, "10") field(OUT, "QUAD:DMPS:380:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "QUAD:DMPS:380: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, "") field(OMSL, "supervisory") field(VAL, "10") } record(bo, "QUAD:DMPS:380: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, "QUAD:DMPS:380: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, "QUAD:DMPS:380: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, "QUAD:DMPS:380:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "0") } record(ao, "QUAD:DMPS:380: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, "QUAD:DMPS:380:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "QUAD:DMPS:380: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, "QUAD:DMPS:380: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, "QUAD:DMPS:380:IMOVE") field(INPB, "QUAD:DMPS:380:IACT") field(INPC, "QUAD:DMPS:380:IRAMPRATE") field(INPD, "1.577") field(INPE, "QUAD:DMPS:380:TRIMDLYPCT") field(INPF, "QUAD:DMPS:380:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "QUAD:DMPS:380:RAMPTIME_LEFT PP") } record(longout, "QUAD:DMPS:380:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "QUAD:DMPS:380:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "QUAD:DMPS:380:RAMPDONE_CALC") } record(calc, "QUAD:DMPS:380:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "QUAD:DMPS:380:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "QUAD:DMPS:380:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "QUAD:DMPS:380: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, "QUAD:DMPS:380:RAMPTIME_LEFT") field(OUT, "QUAD:DMPS:380:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "QUAD:DMPS:380:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "QUAD:DMPS:380:RAMPTIME_LEFT NMS") field(OUT, "QUAD:DMPS:380:RAMPDONE PP") } record(bo, "QUAD:DMPS:380:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "QUAD:DMPS:380:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "QUAD:DMPS:380: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, "QUAD:DMPS:380: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, "QUAD:DMPS:380:STDZINIT") { field(DESC, "Proc. Stdz PVs on boot") field(PINI, "YES") field(DOL1, "1") field(DOL2, "1") field(DOL3, "1") field(LNK1, "QUAD:DMPS:380:DEBUG.PROC PP") field(LNK2, "QUAD:DMPS:380:STDZCYCLENUM.PROC PP") field(LNK3, "QUAD:DMPS:380:STDZDISABLE.PROC PP") field(LNK4, "QUAD:DMPS:380: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, "QUAD:DMPS:380:STDZSUB") { field(DESC, "Stdz subroutine") field(INAM, "mgntStdzInit") field(SNAM, "mgntStdz") field(BRSV, "INVALID") field(INPA, "QUAD:DMPS:380:STDZIMIN NPP NMS") field(INPB, "QUAD:DMPS:380:STDZIMAX NPP NMS") field(INPC, "QUAD:DMPS:380:STDZIFINAL NPP NMS") field(INPD, "QUAD:DMPS:380:STDZCYCLENUM NPP NMS") field(INPE, "QUAD:DMPS:380:STDZDIRECT.RVAL NPP NMS") field(INPF, "QUAD:DMPS:380:STDZDISABLE.RVAL CPP NMS") field(INPG, "QUAD:DMPS:380: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, "QUAD:DMPS:380:STDZWF PP") field(OUTB, "QUAD:DMPS:380: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, "QUAD:DMPS:380:STDZWF") } record(mbbo, "QUAD:DMPS:380: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, "QUAD:DMPS:380: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, "QUAD:DMPS:380:STDZMAINPS") { field(DESC, "Stdz by main or self") field(PINI, "YES") field(DTYP, "Soft Channel") field(ZNAM, "SELF") field(ONAM, "MAIN") } record(bo, "QUAD:DMPS:380: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, "QUAD:DMPS:380: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, "QUAD:DMPS:380: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, "QUAD:DMPS:380:STDZTOD") { field(DESC, "Successful Standardize Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "QUAD:DMPS:380:STDZLOSTTOD") { field(DESC, "Standardize Lost Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(longout, "QUAD:DMPS:380:STDZCYCLECNT") { field(DESC, "Cycle Count") field(PINI, "YES") } record(longout, "QUAD:DMPS:380:STDZCYCLENUM") { field(DESC, "No. Standardize Cycles") field(VAL, "3") field(HOPR, "10") field(LOPR, "0") field(DRVH, "10") field(DRVL, "0") field(PINI, "YES") field(FLNK, "QUAD:DMPS:380:STDZDIRECT") } # The default standardize direction is "UP" for # all LCLS Magnets.. record(bo, "QUAD:DMPS:380:STDZDIRECT") { field(DESC, "Standardize Direction ") field(ZNAM, "UP") field(ONAM, "DOWN") field(VAL, "0") field(FLNK, "QUAD:DMPS:380:STDZIMIN") } record(ao, "QUAD:DMPS:380:STDZIMIN") { field(DESC, "Min-STDZ Current") field(PREC, "1") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(VAL, "0.0") field(FLNK, "QUAD:DMPS:380:STDZIMAX") } record(ao, "QUAD:DMPS:380:STDZIMAX") { field(DESC, "Max. Standarize Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(VAL, "165.0") field(FLNK, "QUAD:DMPS:380:STDZIFINAL") } record(ao, "QUAD:DMPS:380:STDZIFINAL") { field(DESC, "Final SDTZ Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(VAL, "0.0") field(FLNK, "QUAD:DMPS:380: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, "QUAD:DMPS:380: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, "QUAD:DMPS:380:STDZITOL") { field(DESC, "Stdz min tolerance") field(PREC, "5") field(CALC, "MAX(ABS(A),ABS(B))*C") field(INPA, "QUAD:DMPS:380:STDZIMIN CP NMS") field(INPB, "QUAD:DMPS:380:STDZIMAX CP MMS") field(INPC, "0.05") field(INPD, "QUAD:DMPS:380:STDZITOLR CP MMS") field(EGU, "A") field(FLNK, "QUAD:DMPS:380:IDELTAS") field(PINI, "YES") } # D - factor (3.154/2 = 1.577) for EPSC, otherwise, set to 1.0 record(calc, "QUAD:DMPS:380:STDZDLY") { field(DESC, "Ramp time for stdz cycle") field(CALC, "C>0?MAX(1,ABS((A-B)/C)*D):0") field(INPA, "QUAD:DMPS:380:STDZIMIN CP NMS") field(INPB, "QUAD:DMPS:380:STDZIMAX CP NMS") field(INPC, "QUAD:DMPS:380:TRIMRAMPRATE CP NMS") field(INPD, "1.577") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") } record(calc, "QUAD:DMPS:380:STDZRAMPDLY") { field(DESC, "Ramp delay total") field(CALC, "MAX(1,((A/100)*B+B))") field(PREC, "5") field(INPA, "QUAD:DMPS:380:TRIMDLYPCT CP MS") field(INPB, "QUAD:DMPS:380: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, "QUAD:DMPS:380:STDZMINIDLY") { field(DESC, "Mini-stdz delay") field(CALC, "A") field(PREC, "5") field(A, "1.0") field(EGU, "sec") field(PINI, "YES") } record(ao, "QUAD:DMPS:380: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, "QUAD:DMPS:380:STDZMINIDELTA") { field(DESC, "Stdz mini % of IMAX") field(CALC, "(B/100)*(A-C)") field(INPA, "QUAD:DMPS:380:IDES.HOPR") field(INPB, "QUAD:DMPS:380:STDZMINIPCT CPP NMS") field(INPC, "QUAD:DMPS:380:IDES.LOPR") field(PREC, "5") } record(calc, "QUAD:DMPS:380:STDZMINISETPT") { field(DESC, "Mini Stdz delta") field(CALC, "C==0?MAX(E-D,B):MIN(E+D,A)") field(INPA, "QUAD:DMPS:380:IDES.HOPR") field(INPB, "QUAD:DMPS:380:IDES.LOPR") field(INPC, "QUAD:DMPS:380:STDZDIRECT.RVAL") field(INPD, "QUAD:DMPS:380:STDZMINIDELTA") field(INPE, "QUAD:DMPS:380:IDES") field(PREC, "5") field(FLNK, "QUAD:DMPS:380: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, "QUAD:DMPS:380:STDZMINISETPTOOR") { field(DESC, "Mini Stdz setpoint out of range") field(CALC, "C==0?(E-DA)") field(INPA, "QUAD:DMPS:380:IDES.HOPR") field(INPB, "QUAD:DMPS:380:IDES.LOPR") field(INPC, "QUAD:DMPS:380:STDZDIRECT.RVAL") field(INPD, "QUAD:DMPS:380:STDZMINIDELTA") field(INPE, "QUAD:DMPS:380: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, "QUAD:DMPS:380: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, "QUAD:DMPS:380:IADJUST.RVAL") field(INPB, "QUAD:DMPS:380:STDZDIRECT.RVAL") field(INPC, "QUAD:DMPS:380:STDZOK.RVAL") field(INPD, "QUAD:DMPS:380:STDZDISABLE.RVAL") field(INPE, "QUAD:DMPS:380:STATE.RVAL CPP NMS") field(INPF, "QUAD:DMPS:380:ICTRL.RVAL") field(INPG, "QUAD:DMPS:380:STATE.SEVR") field(INPH, "QUAD:DMPS:380:BDELTAS.M") field(INPI, "QUAD:DMPS:380:IACT.SEVR") field(OUT, "QUAD:DMPS:380:STDZLOSTGO.SELN PP NMS") field(OOPT, "Transition To Non-zero") } record(seq, "QUAD:DMPS:380:STDZLOSTGO") { field(DESC, "Process lost stdz") field(SELM, "Mask") field(DOL1, "1") field(DOL2, "0") field(LNK1, "QUAD:DMPS:380:STDZLOSTTOD.PROC") field(LNK2, "QUAD:DMPS:380:STDZOK PP") } # Record maximum current after standardize # Reset to IACT from sequence after trim # Disable processing during (mini-)standardize or trim record(calc, "QUAD:DMPS:380:STDZIACTMAX") { field(DESC, "Max act current after stdz") field(CALC, "MAX(A, B)") field(DISV, "0") field(SDIS, "QUAD:DMPS:380:CHECKPWRDIP_ENABLE") field(INPA, "QUAD:DMPS:380:IACT CP") field(INPB, "QUAD:DMPS:380:STDZIACTMAX") field(EGU, "A") field(FLNK, "QUAD:DMPS:380:CHECKPWRDIP") } # Detect power dip if STDZOK is YES, STDZ is enabled, and IACT is valid # If IACT drops below STDZIACTMAX by more than the trim tolerance, clear STDZOK # Warning: Take the absolute value of the trim tolerance, or else quads of # negative polarity will always lose STDZ since their IDELTAS.I are negative. # Note: Large quads and bends are prone to losing STDZ even if they are # perturbed toward higher current since their current tends to overshoot # by greater than the trim tolerance before settling down. record(calcout, "QUAD:DMPS:380:CHECKPWRDIP") { field(DESC, "Detect power dip") field(CALC, "(A-B>ABS(C))?3:0") field(DISV, "0") field(SDIS, "QUAD:DMPS:380:CHECKPWRDIP_ENABLE") field(INPA, "QUAD:DMPS:380:STDZIACTMAX") field(INPB, "QUAD:DMPS:380:IACT") field(INPC, "QUAD:DMPS:380:IDELTAS.I") field(OUT, "QUAD:DMPS:380:STDZLOSTGO.SELN PP NMS") field(OOPT, "When Non-zero") } # Enable processing of STDZIACTMAX and CHECKPWRDIP only if # STDZOK = YES, STDZDISABLE = NO, CTRL != Trim (2), and # CTRL != Stdz (4) record(calc, "QUAD:DMPS:380:CHECKPWRDIP_ENABLE") { field(CALC, "A&&!B&&(C#2)&&(C#4)") field(INPA, "QUAD:DMPS:380:STDZOK.RVAL CP") field(INPB, "QUAD:DMPS:380:STDZDISABLE.RVAL CP") field(INPC, "QUAD:DMPS:380:CTRL.RVAL CP") } #! 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, "QUAD:DMPS:380: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, "QUAD:DMPS:380:CALBOK") { field(DESC, "Successful Calibration") field(DTYP, "Raw Soft Channel") field(ZNAM, "NO") field(ONAM, "YES") field(DOL, "PSC:DMPS:MG03:CALBOK.RVAL") field(OMSL, "closed_loop") 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, "QUAD:DMPS:380:CALBSET") { field(DESC, "Use DAC Calbration") field(SCAN, "10 second") field(CALC, "A&&(B==0)&&C?31:960") field(INPA, "QUAD:DMPS:380:CALBOK") field(INPB, "QUAD:DMPS:380:CALBDISABLE") field(INPC, "QUAD:DMPS:380:CALBSLOPE") field(OOPT, "On Change") field(OUT, "QUAD:DMPS:380: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, "QUAD:DMPS:380:CALB_SEQ") { field(DESC, "Output Calib Values") field(SELM, "Mask") field(SELL, "QUAD:DMPS:380: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, "QUAD:DMPS:380:CALBSLOPE") field(DOL3, "QUAD:DMPS:380: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, "QUAD:DMPS:380:CALBTOD") { field(DESC, "Calibration Success Time") field(PINI, "YES") field(DOL, "PSC:DMPS:MG03:CALBTOD") field(OMSL, "closed_loop") field(DTYP, "Soft Channel") info(autosaveFields,"VAL") } record(ao, "QUAD:DMPS:380: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, "QUAD:DMPS:380: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, "QUAD:DMPS:380: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, "QUAD:DMPS:380:CALBOFFSET") { field(DESC, "Calc DAC Offset") field(PREC, "6") field(EGU, "Counts") field(PINI, "YES") } record(bo, "QUAD:DMPS:380: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, "QUAD:DMPS:380:DACSLOPE") { field(DESC, "V to DAC slope") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "closed_loop") field(PINI, "YES") field(FLNK, "QUAD:DMPS:380:DACOFFSET") } # Default Offset used in conversion from Volts to DAC Counts record(ao, "QUAD:DMPS:380:DACOFFSET") { field(DESC, "V to DAC offset") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "closed_loop") field(PINI, "YES") field(FLNK, "QUAD:DMPS:380: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, "QUAD:DMPS:380: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, "QUAD:DMPS:380:IACT") field(INPD, "QUAD:DMPS:380:DACSLOPE") field(INPE, "QUAD:DMPS:380:DACOFFSET") field(EGU, "Counts") field(PREC, "6") } record(ao, "QUAD:DMPS:380:DAC") { field(DESC, "DAC Set point") field(EGU, "Counts") field(DOL, "") field(OMSL, "closed_loop") field(PREC, "6") field(PINI, "YES") } record(ao, "QUAD:DMPS:380:CALBIMIN") { field(DESC, "Calibration Min Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(DRVH, "165.0") field(HOPR, "165.0") field(DRVL, "0.0") field(LOPR, "0.0") field(PREC, "3") field(EGU, "A") field(VAL, "0.0") field(FLNK, "QUAD:DMPS:380:CALBIMAX") } record(ao, "QUAD:DMPS:380:CALBIMAX") { field(DESC, "Calibration Max Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(DRVH, "165.0") field(HOPR, "165.0") field(LOPR, "0.0") field(DRVL, "0.0") field(EGU, "A") field(VAL, "165.0") field(FLNK, "QUAD:DMPS:380:CALBSTEPNUM") } record(ao, "QUAD:DMPS:380:CALBIFINAL") { field(DESC, "Calibration Last Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(PREC, "3") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(VAL, "0") } record(longout, "QUAD:DMPS:380: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, "QUAD:DMPS:380:CALBIDELTA") } record(calc, "QUAD:DMPS:380:CALBIDELTA") { field(DESC, "Step size for CALB") field(CALC, "C=0?0:ABS((A-B)/C)") field(INPA, "QUAD:DMPS:380:CALBIMAX") field(INPB, "QUAD:DMPS:380:CALBIMIN") field(INPC, "QUAD:DMPS:380: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, "QUAD:DMPS:380:CALBIMULT") { field(DESC, "IACT vs ISETPT mult") field(CALC, "C#0||A=0?1:ABS(B/A)") field(INPA, "PSC:DMPS:MG03:ISETPT.DRVH") field(INPB, "PSC:DMPS:MG03:IACT.HOPR") field(INPC, "QUAD:DMPS:380:PSCONTROLLER.RVAL CPP") field(EGU, "A") field(PINI, "YES") } # SNL dbputs DAC values here. 6-10 steps are possible. record(waveform, "QUAD:DMPS:380:CALBICTRLWF") { field(DESC, "ICTRL setpoint array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") } record(waveform, "QUAD:DMPS:380:DACWF") { field(DESC, "DAC count array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:DMPS:380:DACSA") } # Used only for xygraph edm plot record(subArray, "QUAD:DMPS:380:DACSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "QUAD:DMPS:380: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, "QUAD:DMPS:380:CALCDACWF") { field(DESC, "Calc DAC counts array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:DMPS:380:CALCDACSA") } # Used only for xygraph edm plot record(subArray, "QUAD:DMPS:380:CALCDACSA") { field(DESC, "Calc DAC counts") field(DTYP, "Soft Channel") field(INP, "QUAD:DMPS:380: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, "QUAD:DMPS:380:CALBYWF") { field(DESC, "mx + b") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:DMPS:380:CALBYSA") } # Used only for xygraph edm plot record(subArray, "QUAD:DMPS:380:CALBYSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "QUAD:DMPS:380:CALBYWF") field(MALM, "10") field(NELM, "6") field(INDX, "0") field(FTVL, "DOUBLE") } record(waveform, "QUAD:DMPS:380:CALBIACTWF") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:DMPS:380:CALBIACTSA") } # Used only for xygraph edm plot record(subArray, "QUAD:DMPS:380:CALBIACTSA") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(MALM, "10") field(NELM, "6") field(INP, "QUAD:DMPS:380:CALBIACTWF") field(INDX, "0") field(FTVL, "DOUBLE") field(FLNK, "QUAD:DMPS:380:CALBLIMITS") } # Check that measured current during calibration is within # tolerance. record(aSub, "QUAD:DMPS:380: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, "QUAD:DMPS:380:CALBSTEPNUM") field(INPB, "QUAD:DMPS:380:CALBIACTWF") field(INPC, "QUAD:DMPS:380: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, "QUAD:DMPS:380: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, "QUAD:DMPS:380:STDZITOL") field(INPH, "QUAD:DMPS:380:DACSLOPE") field(INPI, "QUAD:DMPS:380: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, "QUAD:DMPS:380: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, "QUAD:DMPS:380:CALBSTEPNUM") field(INPB, "QUAD:DMPS:380:CALBIACTWF") field(INPC, "QUAD:DMPS:380:DACWF") field(INPF, "QUAD:DMPS:380: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 QUAD:DMPS:380CALBOK 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, "QUAD:DMPS:380:DEGAUSINIT") { field(DESC, "Proc. Degauss PVs on boot") field(PINI, "YES") field(DOL, "1") field(OUTA, "QUAD:DMPS:380:DEGAUSIMIN.PROC PP") field(OUTB, "QUAD:DMPS:380:DEGAUSIMAX.PROC PP") field(OUTC, "QUAD:DMPS:380:DEGAUSTYPE.PROC PP") field(OUTD, "QUAD:DMPS:380:DEGAUSSTEP.PROC PP") field(OUTE, "QUAD:DMPS:380:MADNAME.PROC PP") field(OUTF, "QUAD:DMPS:380:PSTYPE.PROC PP") field(OUTG, "QUAD:DMPS:380: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, "QUAD:DMPS:380:DEGAUSSUB") { field(DESC, "Degauss subroutine") field(INAM, "mgntDegaussInit") field(SNAM, "mgntDegauss") field(BRSV, "INVALID") field(INPA, "QUAD:DMPS:380:DEGAUSIMIN NPP NMS") field(INPB, "QUAD:DMPS:380:DEGAUSIMAX NPP NMS") field(INPC, "QUAD:DMPS:380:DEGAUSTYPE.RVAL NPP NMS") field(INPE, "QUAD:DMPS:380:DEGAUSMETHOD.RVAL NPP NMS") field(INPF, "QUAD:DMPS:380:PSTYPE NPP NMS") field(INPG, "QUAD:DMPS:380:DEBUG.RVAL NPP NMS") field(INPH, "QUAD:DMPS:380: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, "QUAD:DMPS:380:DEGAUSWF PP") field(OUTB, "QUAD:DMPS:380:DEGAUSMSG PP") field(OUTC, "QUAD:DMPS:380: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, "QUAD:DMPS:380:DEGAUSWF") { field(DESC, "Degauss Setpts") field(NELM, "60") field(FTVL, "DOUBLE") } record(mbbo,"QUAD:DMPS:380: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, "QUAD:DMPS:380: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, "QUAD:DMPS:380: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, "QUAD:DMPS:380: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, "QUAD:DMPS:380: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, "QUAD:DMPS:380:DEGAUSIMIN") { field(DESC, "Min. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "165.0") field(LOPR, "-165.0") field(DRVH, "165.0") field(DRVL, "-165.0") field(VAL, "-165.0") } record(ao, "QUAD:DMPS:380:DEGAUSIMAX") { field(DESC, "Max. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "165.0") field(LOPR, "-165.0") field(DRVH, "165.0") field(DRVL, "-165.0") field(VAL, "165.0") } # 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,"QUAD:DMPS:380: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, "QUAD:DMPS:380: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,"QUAD:DMPS:380: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, "QUAD:DMPS:380: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, "QUAD:DMPS:380: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, "QUAD:DMPS:380: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, "QUAD:DMPS:380:DEGAUSTOD") { field(DESC, "Successful Degauss Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "QUAD:DMPS:380:DEGAUSLOSTTOD") { field(DESC, "Degauss Lost Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "QUAD:DMPS:380:DEGAUSTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "QUAD:DMPS:380:DEGAUSTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "QUAD:DMPS:380: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, "QUAD:DMPS:380:DEGAUSGO") { field(DESC, "Set bdes of btrms to zero") field(ASG, "Internal") field(OUTA, "") field(OUTB, "") field(OUTC, "") field(OUTD, "") } # =========== CRYO ONLY =========== record(bo, "QUAD:DMPS:380: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, "QUAD:DMPS:380:DEGAUS_IMAX_CHECK") { field(DESC, "Check if imax shoud chg") field(CALC, "(C==4)&&(ABS(B)>ABS(A))?1:0") field(INPA, "QUAD:DMPS:380:DEGAUS_IMAX") field(INPB, "QUAD:DMPS:380:ISETPT") field(INPC, "QUAD:DMPS:380:DEGAUSTYPE.RVAL") field(OUT, "QUAD:DMPS:380:DEGAUS_IMAX_UPDATE.SELN") field(FLNK, "QUAD:DMPS:380:DEGAUS_IMAX_UPDATE") } record(seq, "QUAD:DMPS:380:DEGAUS_IMAX_UPDATE") { field(DESC, "Degauss IMAX Update") field(SELM, "Specified") field(DOL1, "QUAD:DMPS:380:ISETPT") field(LNK1, "QUAD:DMPS:380:DEGAUS_IMAX PP") } # Set the maximum current after a successful # degauss. This pv is updated by the # sequence. record(ao, "QUAD:DMPS:380:DEGAUS_IMAX") { field(DESC, "Max I set afer a degauss") field(EGU, "Amps") field(PINI, "YES") field(PREC, "6") field(HOPR, "165.0") field(LOPR, "-165.0") field(DRVH, "165.0") field(DRVL, "-165.0") field(VAL, "165.0") field(FLNK, "QUAD:DMPS:380:DEGAUS_IMAXPOL_CHECK") info(autosaveFields,"VAL,RVAL") } # Set the polarity if degauss_imax record(calcout, "QUAD:DMPS:380:DEGAUS_IMAXPOL_CHECK") { field(DESC, "Determine polarity of imax") field(CALC, "A>=0?0:1") field(INPA, "QUAD:DMPS:380:DEGAUS_IMAX") field(FLNK, "QUAD:DMPS:380:DEGAUS_IMAXPOL") } record(bo, "QUAD:DMPS:380:DEGAUS_IMAXPOL") { field(DESC, "Polarity of imax I") field(DTYP, "Raw Soft Channel") field(DOL, "QUAD:DMPS:380:DEGAUS_IMAXPOL_CHECK") field(OMSL, "closed_loop") field(ZNAM, "Positive") field(ONAM, "Negative") field(FLNK, "QUAD:DMPS:380: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, "QUAD:DMPS:380:DEGAUS_ABSIMAX") { field(DESC, "Absolute Max. Degauss I") field(CALC, "ABS(A)") field(INPA, "QUAD:DMPS:380:DEGAUS_IMAX") field(PREC, "6") field(EGU, "Amps") field(HOPR, "165.0") field(LOPR, "-165.0") info(autosaveFields,"VAL RVAL") } # IACT Polarity record(calcout, "QUAD:DMPS:380:IACTPOL_CHECK") { field(DESC, "Determine IACT polarity") field(SCAN, "5 second") field(CALC, "ABS(A-B)>C?(A>=0?0:1):D") field(INPA, "QUAD:DMPS:380:IACT") field(INPB, "QUAD:DMPS:380:IACTPOL_CHECK.LA") field(INPC, "0.0001") field(INPD, "QUAD:DMPS:380:IACTPOL_CHECK.PVAL") field(OOPT, "On Change") field(FLNK, "QUAD:DMPS:380:IACTPOL") } record(bo, "QUAD:DMPS:380: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,"QUAD:DMPS:380: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, "QUAD:DMPS:380:DEGAUSENABLE CP") field(INPB, "QUAD:DMPS:380:DEGAUSOK") field(INPC, "QUAD:DMPS:380:STATE CP") field(INPD, "QUAD:DMPS:380:STATE.SEVR") field(OUT, "QUAD:DMPS:380:DEGAUS_STATE_SEQ.SELN PP") field(ASG, "Internal") } record(seq, "QUAD:DMPS:380:DEGAUS_STATE_SEQ") { field(DESC, "Degauss State Sequence") field(SELM, "Specified") field(SELL, "QUAD:DMPS:380:DEGAUS_STATE_CHECK") field(LNK1, "QUAD:DMPS:380:DEGAUS_STATE_DISABLE.PROC PP") field(LNK2, "QUAD:DMPS:380:DEGAUS_STATE_LOST.PROC PP") field(LNK3, "QUAD:DMPS:380:DEGAUS_STATE_GOOD.PROC PP") field(LNK4, "QUAD:DMPS:380: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, "QUAD:DMPS:380:DEGAUS_STATE_DISABLE") { field(DESC, "Degauss not used") field(LNK1, "QUAD:DMPS:380:DEGAUSOK.ZSV") field(LNK2, "QUAD:DMPS:380: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, "QUAD:DMPS:380:STATMSG.FRSV") field(LNK4, "QUAD:DMPS:380: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, "QUAD:DMPS:380:DEGAUS_STATE_LOST") { field(DESC, "Degauss lost and ps On") field(DOL1, "1") field(LNK1, "QUAD:DMPS:380:DEGAUSOK.ZSV") field(LNK2, "QUAD:DMPS:380: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, "QUAD:DMPS:380:STATMSG.FRSV") field(LNK4, "QUAD:DMPS:380: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, "QUAD:DMPS:380:DEGAUS_STATE_OFF") { field(DESC, "Degaused lost and ps Off") field(DOL1, "2") field(LNK1, "QUAD:DMPS:380: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, "QUAD:DMPS:380:STATMSG.FRSV") field(LNK3, "QUAD:DMPS:380: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, "QUAD:DMPS:380:DEGAUS_STATE_GOOD") { field(DESC, "Degauss good") field(DOL1, "1") field(LNK1, "QUAD:DMPS:380: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, "QUAD:DMPS:380:STATMSG.FRSV PP") field(LNK3, "QUAD:DMPS:380:STATMSG.FVSV PP") field(LNK4, "") field(ASG, "Internal") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(mbbo, "QUAD:DMPS:380:FUNC") { field(DESC, "QUAD:DMPS:380 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, "1") field(THVL, "9") field(FRVL, "10") field(FVVL, "0") field(SXVL, "2") field(SVVL, "8") field(EIVL, "11") field(NIVL, "12") field(TEVL, "13") field(ELVL, "5") field(TVVL, "6") field(TTVL, "7") field(FTVL, "4") field(FFVL, "3") field(OUT, "QUAD:DMPS:380:CTRL CA") } # :CTRL pv is processed at boot in the # sequence mgntCtrl.st Processed in sequence # record(mbbo, "QUAD:DMPS:380:CTRL") { field(DESC, "QUAD:DMPS:380 Control") field(PINI, "NO") field(ZRST, "Ready") field(ONST, "TRIM") field(TWST, "PERTURB") field(THST, "BCON_TO_BDES") field(FRST, "BACT_TO_BDES") field(FVST, "SAVE_BDES") field(SXST, "LOAD_BDES") field(SVST, "UNDO_BDES") field(EIST, "DAC_ZERO") field(NIST, "CALB") field(TEST, "STDZ") field(ELST, "RESET") field(TVST, "TURN_ON") field(TTST, "TURN_OFF") field(FTST, "") field(FFST, "") field(ZRVL, "0") field(ONVL, "2") field(TWVL, "6") field(THVL, "15") field(FRVL, "14") field(FVVL, "11") field(SXVL, "12") field(SVVL, "13") field(EIVL, "7") field(NIVL, "3") field(TEVL, "4") field(ELVL, "8") field(TVVL, "9") field(TTVL, "10") field(FTVL, "0") field(FFVL, "0") field(OUT, "QUAD:DMPS:380:SELECTEN.A PP") field(SDIS, "0") } # If a function has been selected set this unit to busy record(calcout, "QUAD:DMPS:380:SELECTEN") { field(DESC, "Control Select Enable") field(CALC, "A>0?1:A") field(FLNK, "QUAD:DMPS:380:BUSY") } # Set to FREE on IOC reboot record(bo, "QUAD:DMPS:380:BUSY") { field(DESC, "QUAD:DMPS:380 Ctrl Done") field(DOL, "QUAD:DMPS:380:SELECTEN") field(ZNAM, "FREE") field(ONAM, "BUSY") field(PINI, "YES") field(FLNK, "QUAD:DMPS:380:SELECT") } record(bo, "QUAD:DMPS:380:SELECT") { field(ZNAM, "NO") field(ONAM, "YES") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") } record(bo, "QUAD:DMPS:380: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, "QUAD:DMPS:380:CTRLSTATE") { field(DESC, "QUAD:DMPS:380 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("QUAD:DMPS:380:CTRL",20,20,0,0,"QUAD:DMPS:380:CTRL") #! Field("QUAD:DMPS:380:CTRL.OUT",16777215,1,"QUAD:DMPS:380:CTRL.OUT") #! Link("QUAD:DMPS:380:CTRL.OUT","QUAD:DMPS:380:SELECTEN.A") #! Field("QUAD:DMPS:380:CTRL.VAL",16777215,1,"QUAD:DMPS:380:CTRL.VAL") #! Record("QUAD:DMPS:380:SELECTEN",321,381,0,0,"QUAD:DMPS:380:SELECTEN") #! Field("QUAD:DMPS:380:SELECTEN.A",16777215,0,"QUAD:DMPS:380:SELECTEN.A") #! Field("QUAD:DMPS:380:SELECTEN.FLNK",16777215,1,"QUAD:DMPS:380:SELECTEN.FLNK") #! Link("QUAD:DMPS:380:SELECTEN.FLNK","QUAD:DMPS:380:BUSY") #! Field("QUAD:DMPS:380:SELECTEN.VAL",16777215,1,"QUAD:DMPS:380:SELECTEN.VAL") #! Record("QUAD:DMPS:380:BUSY",623,274,0,0,"QUAD:DMPS:380:BUSY") #! Field("QUAD:DMPS:380:BUSY.DOL",16777215,0,"QUAD:DMPS:380:BUSY.DOL") #! Link("QUAD:DMPS:380:BUSY.DOL","QUAD:DMPS:380:SELECTEN.VAL") #! Field("QUAD:DMPS:380:BUSY.FLNK",16777215,1,"QUAD:DMPS:380:BUSY.FLNK") #! Link("QUAD:DMPS:380:BUSY.FLNK","QUAD:DMPS:380:SELECT") #! Record("QUAD:DMPS:380:SELECT",669,508,0,1,"QUAD:DMPS:380:SELECT") #! Record("QUAD:DMPS:380:FUNC",940,120,0,0,"QUAD:DMPS:380:FUNC") #! Field("QUAD:DMPS:380:FUNC.OUT",16777215,0,"QUAD:DMPS:380:FUNC.OUT") #! Link("QUAD:DMPS:380:FUNC.OUT","QUAD:DMPS:380:CTRL.VAL") #! Record("QUAD:DMPS:380:ABORT",193,41,0,0,"QUAD:DMPS:380:ABORT") #! Record("QUAD:DMPS:380:CTRLSTATE",369,34,0,0,"QUAD:DMPS:380: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,"QUAD:DMPS:380:SELECT is used for Multi-device selection.\nIt is enabled when associated QUAD:DMPS:380:CTRL is \"0\" (DONE).\nIt is disabled when associated QUAD:DMPS:380: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,"QUAD:DMPS:380: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, "QUAD:DMPS:380:BCTRL_INIT") { field(DESC, "Process BCTRL on boot") field(PINI, "YES") field(CALC, "A=3?1:0") field(INPA, "QUAD:DMPS:380:BCTRL.SEVR") field(OUT, "QUAD:DMPS:380: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, "QUAD:DMPS:380:BACT") { field(DESC, "Actual B") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "QUAD:DMPS:380:BACT") field(INPB, "QUAD:DMPS:380:POLYCOEF") field(INPC, "QUAD:DMPS:380:POLYCOEF.A") field(INPD, "QUAD:DMPS:380:POLYCOEF.B") field(INPE, "QUAD:DMPS:380:IACT MS") field(INPF, "QUAD:DMPS:380:BDELTAS PP") field(INPG, "100") field(EGU, "kG") field(HOPR, "-0.1211") field(LOPR, "-52.0555") field(HIHI, "-0.1211") field(LOLO, "-52.0555") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "-0.1211") field(LOW, "-52.0555") field(FLNK, "QUAD:DMPS:380: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, "QUAD:DMPS:380:BDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntPhyDeltas") field(EGU, "kG") field(HOPR, "1") field(PREC, "7") field(BRSV, "INVALID") field(INPA, "QUAD:DMPS:380:BDES") field(INPB, "QUAD:DMPS:380:TRIMBTOL") field(INPC, "QUAD:DMPS:380:TRIMBTOLR") field(INPD, "QUAD:DMPS:380:CHCKBTOL") field(INPE, "QUAD:DMPS:380:CHCKBTOLR") field(F, "2.0") field(INPG, "30") field(INPH, "QUAD:DMPS:380:BACT.VAL") # # MPS absolute and relative tolerances field(INPP, "QUAD:DMPS:380:MPSBTOL") field(INPQ, "QUAD:DMPS:380:MPSBTOLR") field(FLNK, "QUAD:DMPS:380:BCONLIMITS") info(autosaveFields,"F") } # This record is processed by BDELTAS record(aSub, "QUAD:DMPS:380:BCONLIMITS") { field(DESC, "Config B-field Limits") field(INAM, "mgntInit") field(SNAM, "mgntBCONLimits") field(INPA, "QUAD:DMPS:380:BDES") field(INPB, "QUAD:DMPS:380:BDELTAS.I") field(INPG, "QUAD:DMPS:380:DEBUG.RVAL") field(FTA, "DOUBLE") field(FTB, "DOUBLE") field(FTG, "ULONG") field(OUTA, "QUAD:DMPS:380:BCON.HIGH") field(OUTB, "QUAD:DMPS:380:BCON.LOW") field(OUTC, "QUAD:DMPS:380:BCON.HIHI") field(OUTD, "QUAD:DMPS:380:BCON.LOLO PP") field(FTVA, "DOUBLE") field(FTVB, "DOUBLE") field(FTVC, "DOUBLE") field(FTVD, "DOUBLE") field(BRSV, "INVALID") field(FLNK, "QUAD:DMPS:380:IDELTAS") } # The following PV is processed by :BACT # which is processed by :BACT # record(fanout, "QUAD:DMPS:380:BACTFO") { field(DESC, "BACT processing") field(SELM, "All") field(LNK1, "QUAD:DMPS:380:BDIFF") field(LNK2, "QUAD:DMPS:380:BADIFF") field(LNK3, "QUAD:DMPS:380:BRATIO") field(LNK4, "QUAD:DMPS:380:MPSLIMITS") field(LNK5, "QUAD:DMPS:380:I2BSTATUS") field(LNK6, "QUAD:DMPS:380:IACTFO.PROC") } record(calc, "QUAD:DMPS:380:BDIFF") { field(DESC, "BDES-BACT") field(CALC, "A-B") field(INPA, "QUAD:DMPS:380:BDES") field(INPB, "QUAD:DMPS:380:BACT") field(EGU, "kG") field(PREC, "7") } record(calc, "QUAD:DMPS:380:BADIFF") { field(DESC, "Absolute BDES-BACT") field(INPA, "QUAD:DMPS:380:BDIFF") field(EGU, "kG") field(PREC, "7") field(CALC, "A<0?ABS(A):A") } record(calc, "QUAD:DMPS:380:BRATIO") { field(DESC, "BACT Error") field(CALC, "B?A/B:0") field(INPA, "QUAD:DMPS:380:BDIFF") field(INPB, "QUAD:DMPS:380:BDES.HOPR") field(EGU, "kG") field(PREC, "7") } record(mbbi, "QUAD:DMPS:380: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, "QUAD:DMPS:380:BACT.J") } # Note: for a string slave set the MONFL # macro to the following: # MONFL=:IMONCALC MS record(sub, "QUAD:DMPS:380:BMON") { field(DESC, "Second Transductor") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "QUAD:DMPS:380:BMON") field(INPB, "QUAD:DMPS:380:POLYCOEF") field(INPC, "QUAD:DMPS:380:POLYCOEF.A") field(INPD, "QUAD:DMPS:380:POLYCOEF.B") field(INPE, "QUAD:DMPS:380:IMON MS") field(INPF, "QUAD:DMPS:380:BDELTAS.VAL") field(INPG, "100") field(EGU, "kG") field(HOPR, "-0.1211") field(LOPR, "-52.0555") field(HIHI, "-0.1211") field(LOLO, "-52.0555") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "-0.1211") field(LOW, "-52.0555") } # 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=PSC:DMPS:MG03:BDES CP record(ao, "QUAD:DMPS:380:BDES") { field(DESC, "Desired B-Field") field(PINI, "YES") field(DRVH, "-0.1211") field(DRVL, "-52.0555") field(HOPR, "-0.1211") field(LOPR, "-52.0555") field(PREC, "7") field(EGU, "kG") field(MDEL, "-1") field(OMSL, "supervisory") # field(DOL, "") field(OUT, "QUAD:DMPS:380:B2IDES PP") info(autosaveFields,"VAL") } record(sub, "QUAD:DMPS:380:B2IDES") { field(DESC, "Convert Desired B-Field to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:DMPS:380:POLYCOEF") field(INPC, "QUAD:DMPS:380:POLYCOEF.A") field(INPD, "QUAD:DMPS:380:POLYCOEF.B") field(PREC, "7") field(EGU, "kG") field(HOPR, "-0.1211") field(LOPR, "-52.0555") field(MDEL, "-1") field(INPE, "QUAD:DMPS:380:BDES.DRVH") field(INPF, "QUAD:DMPS:380:BDES.DRVL") field(BRSV, "INVALID") field(FLNK, "QUAD:DMPS:380:IDES") } record(sub, "QUAD:DMPS:380:BNOM") { field(DESC, "Nominal Field") field(PINI, "YES") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:DMPS:380:POLYCOEF") field(INPC, "QUAD:DMPS:380:POLYCOEF.A") field(INPD, "QUAD:DMPS:380:POLYCOEF.B") field(INPE, "QUAD:DMPS:380:BDES.DRVH") field(INPF, "QUAD:DMPS:380:BDES.DRVL") field(EGU, "kG") field(HOPR, "-0.1211") field(LOPR, "-52.0555") field(PREC, "7") field(VAL, "0.0") field(FLNK, "QUAD:DMPS:380:INOM") } record(sub, "QUAD:DMPS:380:BACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:DMPS:380:BDES.VAL") field(INPB, "QUAD:DMPS:380:BDES.DRVH") field(INPC, "QUAD:DMPS:380:BDES.DRVL") field(INPD, "QUAD:DMPS:380:BDELTAS.I") field(INPE, "QUAD:DMPS:380:BDELTAS.J") field(INPG, "QUAD:DMPS:380:STATE") field(INPH, "QUAD:DMPS:380:HSTA") field(EGU, "kG") field(HOPR, "-0.1211") field(LOPR, "-52.0555") field(PREC, "7") field(BRSV, "INVALID") } record(sub, "QUAD:DMPS:380:BMONLIMITS") { field(DESC, "MON Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:DMPS:380:BDES.VAL") field(INPB, "QUAD:DMPS:380:BDES.DRVH") field(INPC, "QUAD:DMPS:380:BDES.DRVL") field(INPD, "QUAD:DMPS:380:BDELTAS.K") field(INPE, "QUAD:DMPS:380:BDELTAS.L") field(INPG, "QUAD:DMPS:380:STATE") field(INPH, "QUAD:DMPS:380:HSTA") field(EGU, "kG") field(HOPR, "-0.1211") field(LOPR, "-52.0555") field(PREC, "7") field(BRSV, "INVALID") } record(seq, "QUAD:DMPS:380:BLIMITS") { field(DESC, "ACT Limits") field(PREC, "7") field(DOL1, "QUAD:DMPS:380:BLIMITS") field(LNK1, "QUAD:DMPS:380:BACTLIMITS.F PP") field(DOL2, "QUAD:DMPS:380:BACTLIMITS.I") field(LNK2, "QUAD:DMPS:380:BACT.HIGH") field(DOL3, "QUAD:DMPS:380:BACTLIMITS.J") field(LNK3, "QUAD:DMPS:380:BACT.LOW") field(DOL4, "QUAD:DMPS:380:BACTLIMITS.K") field(LNK4, "QUAD:DMPS:380:BACT.HIHI") field(DOL5, "QUAD:DMPS:380:BACTLIMITS.L") field(LNK5, "QUAD:DMPS:380:BACT.LOLO") field(DOL6, "QUAD:DMPS:380:BLIMITS") field(LNK6, "QUAD:DMPS:380:BMONLIMITS.F PP") field(DOL7, "QUAD:DMPS:380:BMONLIMITS.I") field(LNK7, "QUAD:DMPS:380:BMON.HIGH") field(DOL8, "QUAD:DMPS:380:BMONLIMITS.J") field(LNK8, "QUAD:DMPS:380:BMON.LOW") field(DOL9, "QUAD:DMPS:380:BMONLIMITS.K") field(LNK9, "QUAD:DMPS:380:BMON.HIHI") field(DOLA, "QUAD:DMPS:380:BMONLIMITS.L") field(LNKA, "QUAD:DMPS:380:BMON.LOLO") field(FLNK, "QUAD:DMPS:380:ILIMITS") field(SCAN, "5 second") } record(ao, "QUAD:DMPS:380:BCTRL") { field(DESC, "B-Perturb") field(PREC, "7") field(EGU, "kG") field(DRVH, "-0.1211") field(DRVL, "-52.0555") field(HOPR, "-0.1211") field(LOPR, "-52.0555") # 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, "QUAD:DMPS:380: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, "QUAD:DMPS:380:BCTRLGO") { field(DESC, "Update DES and perturb") field(PREC, "7") # Disable BACT limits field(DOL1, "1") field(LNK1, "QUAD:DMPS:380:BLIMITS.VAL") # Update BDES with the BCTRL (slider) value field(DOL2, "QUAD:DMPS:380:BCTRL.VAL") field(LNK2, "QUAD:DMPS:380:BDES PP") field(DOL3, "1") field(LNK3, "QUAD:DMPS:380:IDIRECT.PROC PP") field(DOL4, "1") field(LNK4, "QUAD:DMPS:380:CHECKSTDZLOST.PROC PP") field(DOL5, "QUAD:DMPS:380:BCTRL.VAL") field(LNK5, "QUAD:DMPS:380:BCTRLSUB PP") # Re-enable BACT limits field(DOL6, "0") field(LNK6, "QUAD:DMPS:380:BLIMITS.VAL") } # Convert B-field to Current and output to ISETPT record(sub, "QUAD:DMPS:380:BCTRLSUB") { field(DESC, "Feedback") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:DMPS:380:POLYCOEF") field(INPC, "QUAD:DMPS:380:POLYCOEF.A") field(INPD, "QUAD:DMPS:380:POLYCOEF.B") field(INPE, "QUAD:DMPS:380:BDES.DRVH") field(INPF, "QUAD:DMPS:380:BDES.DRVL") field(PREC, "7") field(EGU, "kG") field(HOPR, "-0.1211") field(LOPR, "-52.0555") field(MDEL, "-1") field(BRSV, "INVALID") field(FLNK, "QUAD:DMPS:380:ISETPT") } record(ao, "QUAD:DMPS:380:BDESPREVTRIM") { field(DESC, "trim bdes for undo") field(DTYP, "Soft Channel") field(DRVH, "-0.1211") field(DRVL, "-52.0555") field(EGU, "kG") field(HOPR, "-0.1211") field(LOPR, "-52.0555") field(PREC, "7") field(PINI, "YES") info(autosaveFields,"VAL") } record(stringin, "QUAD:DMPS:380:MADNAME") { field(DESC, "MAD deck nomenclature") field(PINI, "YES") field(VAL, "QUE2B") } record(ai, "QUAD:DMPS:380: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, "3731.443708") } record(ao, "QUAD:DMPS:380:BMAX") { field(DESC, "Max B-Field") field(DTYP, "Soft Channel") field(DRVH, "-0.1211") field(DRVL, "-52.0555") field(EGU, "kG") field(HOPR, "-0.1211") field(LOPR, "-52.0555") field(PREC, "7") field(PINI, "YES") field(VAL, "-0.1211") field(FLNK, "QUAD:DMPS:380:BSTEP") } record(ao, "QUAD:DMPS:380:BMIN") { field(DESC, "Min B-Field") field(DTYP, "Soft Channel") field(DRVH, "-0.1211") field(DRVL, "-52.0555") field(EGU, "kG") field(HOPR, "-0.1211") field(LOPR, "-52.0555") field(PREC, "7") field(PINI, "YES") field(VAL, "-52.0555") field(FLNK, "QUAD:DMPS:380:BSTEP") } record(ao, "QUAD:DMPS:380:BDESSAVE") { field(DESC, "bdes for save/load") field(DTYP, "Soft Channel") field(DRVH, "-0.1211") field(DRVL, "-52.0555") field(EGU, "kG") field(HOPR, "-0.1211") field(LOPR, "-52.0555") field(PINI, "YES") field(PREC, "7") } # This record is processed by QUAD:DMPS:380: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, "QUAD:DMPS:380:BCON") { field(DESC, "Config B-Field ") field(DTYP, "Soft Channel") field(PREC, "7") field(EGU, "kG") field(HOPR, "-0.1211") field(LOPR, "-52.0555") field(DRVH, "-0.1211") field(DRVL, "-52.0555") # Set MINOR Alarm as the default, slaves will set NO_ALARM=0. field(HHSV, "MINOR") field(LLSV, "MINOR") field(HSV, "MINOR") field(LSV, "MINOR") # field(DOL , "") field(OMSL, "supervisory") field(OUT, "QUAD:DMPS:380:B2ICON PP") info(autosaveFields,"VAL") } record(sub, "QUAD:DMPS:380:B2ICON") { field(DESC, "Convert Desired ICon to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:DMPS:380:POLYCOEF") field(INPC, "QUAD:DMPS:380:POLYCOEF.A") field(INPD, "QUAD:DMPS:380:POLYCOEF.B") field(PREC, "7") field(EGU, "kG") field(HOPR, "-0.1211") field(LOPR, "-52.0555") field(MDEL, "-1") field(INPE, "QUAD:DMPS:380:BCON.DRVH") field(INPF, "QUAD:DMPS:380:BCON.DRVL") field(BRSV, "INVALID") field(FLNK, "QUAD:DMPS:380: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, "QUAD:DMPS:380:BSTEP") { field(DESC, "B-Field step size") field(CALC, "(C==3)||(D==3)?0:ABS(A-B)*0.005") field(INPA, "QUAD:DMPS:380:BMAX") field(INPB, "QUAD:DMPS:380:BMIN") field(INPC, "QUAD:DMPS:380:BMIN.SEVR") field(INPD, "QUAD:DMPS:380:BMAX.SEVR") field(EGU, "kG") 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,"QUAD:DMPS:380:BCTRLDISABLECALC") { field(DESC, "Calc for disabling BCTRL") field(ASG, "Internal") field(CALC, "A?2:1") field(INPA, "QUAD:DMPS:380:ONLINE CP") field(OUT, "QUAD:DMPS:380:BCTRLDISABLEFOUT PP") } record(fanout, "QUAD:DMPS:380:BCTRLDISABLEFOUT") { field(DESC, "Disable BCTRL fanout") field(SELM, "Specified") field(SELL, "QUAD:DMPS:380:BCTRLDISABLECALC") field(LNK1, "QUAD:DMPS:380:BCTRLDISABLE") field(LNK2, "QUAD:DMPS:380:BCTRLENABLE") } record(stringout, "QUAD:DMPS:380:BCTRLDISABLE") { field(DESC, "Disable BCTRL") field(DTYP, "Soft Channel") field(OUT, "QUAD:DMPS:380:BCTRL.ASG") field(VAL, "NOWRITE") field(FLNK, "QUAD:DMPS:380:BCTRLDISV_UPDATE") } record(stringout, "QUAD:DMPS:380:BCTRLENABLE") { field(DESC, "Enable BCTRL") field(DTYP, "Soft Channel") field(OUT, "QUAD:DMPS:380:BCTRL.ASG") field(VAL, "") field(FLNK, "QUAD:DMPS:380:BCTRLDISV_UPDATE") } record(calcout, "QUAD:DMPS:380:BCTRLDISV_UPDATE") { field(DESC, "Calc for updating BCTRL.DISV") field(ASG, "Internal") field(CALC, "A") field(INPA, "QUAD:DMPS:380:ONLINE") field(OUT, "QUAD:DMPS:380: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,"QUAD:DMPS:380:BACT and MON\n are processed via links from \n QUAD:DMPS:380:IACT (device raw value readback 1)\n and\n QUAD:DMPS:380: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 QUAD:DMPS:380:POLYCOEF\nC = First polynomial coefficient (offset if linear)\nD = Second polynomial coefficient (slope if linear)\nE = QUAD:DMPS:380: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,"QUAD:DMPS:380:BDES\n is processed when set by CA users or \n QUAD:DMPS:380: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,"QUAD:DMPS:380: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 QUAD:DMPS:380: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 (QUAD:DMPS:380: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,"QUAD:DMPS:380:B*LIMITS and QUAD:DMPS:380:BLIMITS:\n Calculate alarm and warning limits based on \n deltas from QUAD:DMPS:380: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,"QUAD:DMPS:380: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,"QUAD:DMPS:380: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, "QUAD:DMPS:380: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, "QUAD:DMPS:380:MPSBTOL") { field(DESC, "Absolute mps tol") field(EGU, "kG") field(PREC, "2") field(CALC, "ABS(A)*0.02") field(INPA, "QUAD:DMPS:380:BMAX") field(PINI, "YES") } # # 21-Aug-2013: K. Luchini # Set channel access security so that users # cannot easily change values. record(ao, "QUAD:DMPS:380:MPSBMAX") { field(DESC, "MPS Max B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "-0.1211") field(DRVL, "-52.0555") field(PINI, "YES") field(VAL, "-0.1211") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "QUAD:DMPS:380:MPSBMIN") { field(DESC, "MPS Min B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "-0.1211") field(DRVL, "-52.0555") field(PINI, "YES") field(VAL, "-52.0555") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "QUAD:DMPS:380:MPSBLLIM") { field(DESC, "MPS Low Limit B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "-0.1211") field(DRVL, "-52.0555") field(PINI, "YES") field(VAL, "-52.0555") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "QUAD:DMPS:380:MPSBLLIM2") { field(DESC, "MPS Low Limit #2 B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "-0.1211") field(DRVL, "-52.0555") field(PINI, "YES") field(VAL, "-52.0555") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } # Set the default to Std record(mbbo, "QUAD:DMPS:380: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, "QUAD:DMPS:380:MPSLIMITS.E PP") } record(aSub, "QUAD:DMPS:380: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, "QUAD:DMPS:380:MPS.RVAL") field(INPB, "QUAD:DMPS:380:BADIFF") field(INPC, "QUAD:DMPS:380:BDELTAS.N") field(INPD, "QUAD:DMPS:380:BACT") field(INPE, "QUAD:DMPS:380:MPSBITMASK.RVAL") field(INPF, "QUAD:DMPS:380:MPSBLLIM") field(INPG, "QUAD:DMPS:380:MPSBMIN") field(INPH, "QUAD:DMPS:380:MPSBMAX") field(INPI, "QUAD:DMPS:380: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, "QUAD:DMPS:380:INTOL.RVAL PP") field(OUTB, "QUAD:DMPS:380:INTOL_BMIN.RVAL PP") field(OUTC, "QUAD:DMPS:380:INTOL_BRANGE.RVAL PP") field(OUTD, "QUAD:DMPS:380: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, "QUAD:DMPS:380:INTOL") { field(DESC, "BACT within MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:DMPS:380:MPSLIMITS.VALA") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "QUAD:DMPS:380:INTOL_BMIN") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:DMPS:380:MPSLIMITS.VALB") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "QUAD:DMPS:380:INTOL_BMIN2") { field(DESC, "MPS tol #2") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:DMPS:380:MPSLIMITS.VALD") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "QUAD:DMPS:380:INTOL_BRANGE") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:DMPS:380: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, "QUAD:DMPS:380:CHCKITOL") { field(DESC, "Absolute Check I Tolerance") field(EGU, "A") field(FLNK, "QUAD:DMPS:380:TRIMITOL") field(CALC, "ABS(A*B)") field(INPA, "QUAD:DMPS:380:CHCKBTOL") field(INPB, "QUAD:DMPS:380:POLYCOEF.B") field(PREC, "9") } record(calc, "QUAD:DMPS:380:TRIMBTOL") { field(EGU, "kG") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(DESC, "Absolute Trim Tolerance") field(CALC, "ABS(A)/2") field(INPA, "QUAD:DMPS:380:CHCKBTOL") field(FLNK, "QUAD:DMPS:380:CHCKITOL") } record(calc, "QUAD:DMPS:380:CHCKBTOL") { field(DESC, "Check absolute tolerance") field(EGU, "A") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(FLNK, "QUAD:DMPS:380:TRIMBTOL") field(CALC, "MAX(ABS(A),ABS(C))*(B/1000000)") field(INPA, "QUAD:DMPS:380:BDES.HOPR") field(INPB, "QUAD:DMPS:380:STABILITY") field(INPC, "QUAD:DMPS:380:BDES.LOPR") } record(longout, "QUAD:DMPS:380: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, "QUAD:DMPS:380:CHCKBTOL") } record(calc, "QUAD:DMPS:380:TRIMITOL") { field(DESC, "Absolute Trim I Tolerance") field(EGU, "kG") field(CALC, "ABS(A*B)") field(INPA, "QUAD:DMPS:380:POLYCOEF.B") field(INPB, "QUAD:DMPS:380:TRIMBTOL") field(PREC, "9") } record(ai, "QUAD:DMPS:380:TRIMBTOLR") { field(DESC, "Relative trim tol") field(PREC, "4") field(EGU, "%") field(HOPR, "1.0") field(LOPR, "0.0") field(PINI, "YES") } record(ai, "QUAD:DMPS:380: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, "QUAD:DMPS:380:FBCKFCOM") { field(ZNAM, "CA") field(ONAM, "FCOM") field(DESC, "CA Mode") field(PINI, "YES") field(SDIS, "0") } record(bo, "QUAD:DMPS:380:PAU") { field(ZNAM, "NotConfigured") field(ONAM, "Configured") field(DESC, "PAU Present") field(PINI, "YES") field(SDIS, "0") field(FLNK, "QUAD:DMPS:380:PAUGO") } record(fanout, "QUAD:DMPS:380:PAUGO") { field(DESC, "PAU control") field(LNK1, "QUAD:DMPS:380:PAUSTOP") field(LNK2, "QUAD:DMPS:380: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, "QUAD:DMPS:380:PAUSTART") { field(DESC, "Setup for PAU On") field(SDIS, "QUAD:DMPS:380: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, "QUAD:DMPS:380:PAUSTOP") { field(DESC, "Setup for PAU Off") field(SDIS, "QUAD:DMPS:380: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, "QUAD:DMPS:380:MCORDEVNAME") { field(DESC, "PS device name") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, "PSC:DMPS:MG03:") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "QUAD:DMPS:380: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, "QUAD:DMPS:380:PSTYPE.RVAL") field(INPC, "QUAD:DMPS:380:TURNEDOFF.RVAL") field(INPD, "QUAD:DMPS:380:CONFIG.RVAL") field(INPE, "QUAD:DMPS:380:PSCATEGORY.RVAL") field(INPF, "QUAD:DMPS:380:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "QUAD:DMPS:380:AUTOCTRL.RVAL") field(INPJ, "QUAD:DMPS:380:OUTOFSERVICE.RVAL") field(INPL, "QUAD:DMPS:380:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "QUAD:DMPS:380:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "QUAD:DMPS:380:PAU") field(INPP, "QUAD:DMPS:380:CALBDISABLE.RVAL") field(INPQ, "QUAD:DMPS:380:PTRBDISABLE.RVAL") field(INPR, "QUAD:DMPS:380:TRIMDISABLE.RVAL") field(INPS, "QUAD:DMPS:380:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "QUAD:DMPS:380:FBCK") field(INPU, "QUAD:DMPS:380:TRIMTYPE.RVAL") field(INPV, "QUAD:DMPS:380:STDZDIRECT.RVAL") field(INPW, "QUAD:DMPS:380:DEGAUSENABLE.RVAL") field(FLNK, "QUAD:DMPS:380:HSTA") } record(longin, "QUAD:DMPS:380:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "QUAD:DMPS:380:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "QUAD:DMPS:380: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, "QUAD:DMPS:380: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, "QUAD:DMPS:380:CALBDISABLE") { field(DESC, "DAC Calb Disabled") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:DMPS:380:PTRBDISABLE") { field(DESC, "Perturb Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:DMPS:380:TRIMDISABLE") { field(DESC, "Trim Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:DMPS:380: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 QUAD:DMPS:380:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses QUAD:DMPS:380:FBCK. # This PV should be replaced by QUAD:DMPS:380: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, "QUAD:DMPS:380: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, "QUAD:DMPS:380: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, "QUAD:DMPS:380: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, "") field(OMSL, "supervisory") field(FLNK, "QUAD:DMPS:380:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"QUAD:DMPS:380:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "QUAD:DMPS:380:OUTOFSERVICE NPP NMS") field(OUT, "QUAD:DMPS:380:ONLINE PP") } record(bo, "QUAD:DMPS:380:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "QUAD:DMPS:380: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, "1") } record(bo, "QUAD:DMPS:380: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, "1") } record(bo, "QUAD:DMPS:380: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, "QUAD:DMPS:380: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, "QUAD:DMPS:380: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, "QUAD:DMPS:380: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, "QUAD:DMPS:380: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, "QUAD:DMPS:380: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, "1") field(ASG, "NOWRITE") } record(mbbo, "QUAD:DMPS:380: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, "1") field(ASG, "NOWRITE") } record(mbbo, "QUAD:DMPS:380: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, "2") field(ASG, "NOWRITE") } record(mbbo, "QUAD:DMPS:380: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, "0") field(ASG, "NOWRITE") field(FLNK, "QUAD:DMPS:380:TRIMTYPE") } record(stringout, "QUAD:DMPS:380:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "QUAD:DMPS:380:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "QUAD:DMPS:380:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "QUAD:DMPS:380:STATE.RVAL") field(INPB, "QUAD:DMPS:380:INTLKSUMY.RVAL") field(OUT, "QUAD:DMPS:380:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:DMPS:380: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, "QUAD:DMPS:380:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "QUAD:DMPS:380:STATE.RVAL") field(INPB, "QUAD:DMPS:380:INTLKSUMY.RVAL") field(OUT, "QUAD:DMPS:380:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:DMPS:380:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "QUAD:DMPS:380:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "QUAD:DMPS:380: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, "QUAD:DMPS:380:RAMPSTARTDLY") { field(DESC, "Tansition to ramp delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "2") } ######### For PSTYPE=2 Only ############# record(mbbo, "QUAD:DMPS:380: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, "QUAD:DMPS:380: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,"QUAD:DMPS:380: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("QUAD:DMPS:380:TURNEDOFF",3140,1907,0,1,"QUAD:DMPS:380:TURNEDOFF") #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "QUAD:DMPS:380:STATSUB") { field(DESC, "Build STATus ") field(INAM, "mgntInit") field(SNAM, "mgntSlcStat") field(INPA, "QUAD:DMPS:380:BACT.STAT") field(INPB, "QUAD:DMPS:380:BDES.STAT") field(INPC, "QUAD:DMPS:380:IRIPL.STAT") field(INPD, "PSC:DMPS:MG03:ISETPT.STAT") field(INPE, "PSC:DMPS:MG03:IACT.STAT") # 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, "QUAD:DMPS:380:BACT.SEVR") field(INPH, "QUAD:DMPS:380:BDES.SEVR") field(INPI, "QUAD:DMPS:380:IRIPL.SEVR") field(INPJ, "PSC:DMPS:MG03:ISETPT.SEVR") field(INPK, "PSC:DMPS:MG03:IACT.SEVR") # # 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, "QUAD:DMPS:380:STATE.RVAL") field(INPN, "QUAD:DMPS:380:STDZOK") field(INPO, "QUAD:DMPS:380:CALBOK") field(INPP, "QUAD:DMPS:380:OUTOFSERVICE.RVAL") field(INPQ, "QUAD:DMPS:380:CONFIG.RVAL") field(INPR, "QUAD:DMPS:380:HSTA") field(INPS, "QUAD:DMPS:380:CTRL.RVAL") field(INPT, "QUAD:DMPS:380:DEGAUSOK") field(INPV, "QUAD:DMPS:380: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, "QUAD:DMPS:380:STAT") } record(longout, "QUAD:DMPS:380:STAT") { field(DESC, "STAT sent to SLC") field(SCAN, "Passive") field(FLNK, "QUAD:DMPS:380:STATCTRLSUB") field(DOL, "QUAD:DMPS:380:STATSUB.VAL") field(OMSL, "closed_loop") } record(sSub, "QUAD:DMPS:380:STATCTRLSUB") { field(DESC, "Decode SLC STAT into mbbo") field(INAM, "mgntInit") field(SNAM, "mgntStatDecode") field(INPA, "QUAD:DMPS:380:STAT") field(INPB, "QUAD:DMPS:380:HSTA") field(INPD, "QUAD:DMPS:380:ONOFFCTRL.RVAL") field(FLNK, "QUAD:DMPS:380:STATMSG") } record(mbbo, "QUAD:DMPS:380: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, "QUAD:DMPS:380:UNAVAILGO") field(DOL, "QUAD:DMPS:380:STATCTRLSUB.W") } record(seq, "QUAD:DMPS:380:UNAVAILGO") { field(DESC, "Process UNAVAIL") field(DOL1, "QUAD:DMPS:380:STATSUB.U") field(LNK1, "QUAD:DMPS:380:UNAVAIL PP") } record(stringout, "QUAD:DMPS:380:SNLSTATMSG") { field(DTYP, "Soft Channel") } #! TextBox(TB0,820,1000,1200,1220,0,"Dialog",12,1,16777215,"QUAD:DMPS:380:STATUSSUB - future\nOverall device status - takes input from action snls, record sevrs, master snl(s) and outputs final status\n\nInputs:\nA - QUAD:DMPS:380:CTRLSTATUS - snl status\nB - MGNT:CTRLSTATUS - master list status\nC\nD - QUAD:DMPS:380: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,"QUAD:DMPS:380STATSUB\nformat control bo's into slc STAT\n\nInputs:\nA - QUAD:DMPS:380:STATUS\nC - QUAD:DMPS:380:ON\nD - QUAD:DMPS:380:STDZOK\nE - QUAD:DMPS:380:CALBOK\nF - QUAD:DMPS:380:BACTDRIFT (future)\nG -\nH- QUAD:DMPS:380:DACSTATUS\nI -QUAD:DMPS:380:ADCSTATUS\nJ - QUAD:DMPS:380:BACTSTATUS\nK - QUAD:DMPS:380:BDESSTATUS\nL - QUAD:DMPS:380:RIPLSTATUS\n\nOutput:\nP - QUAD:DMPS:380: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, "QUAD:DMPS:380: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, "QUAD:DMPS:380: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, "QUAD:DMPS:380: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, "QUAD:DMPS:380: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.6 #! DBDSTART #! DBD("../../../../dbd/mgntSoft.dbd") #! DBDEND record(stringout, "QUAD:DMPS:380:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "QUAD:DMPS:380:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "QUAD:DMPS:380:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "QUAD:DMPS:380:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "QUAD:DMPS:380:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "QUAD:DMPS:380:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "1") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "QUAD:DMPS:380: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, "QUAD:DMPS:380:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "QUAD:DMPS:380:TRIMTYPE.RVAL") field(INPB, "QUAD:DMPS:380:CONFIG.RVAL") field(OUT, "QUAD:DMPS:380:TRIMMAXNUM PP") } record(longout, "QUAD:DMPS:380: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, "QUAD:DMPS:380: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, "") field(OMSL, "supervisory") field(VAL, "20") field(OUT, "QUAD:DMPS:380:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "QUAD:DMPS:380: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, "") field(OMSL, "supervisory") field(VAL, "10") } record(bo, "QUAD:DMPS:380: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, "QUAD:DMPS:380: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, "QUAD:DMPS:380: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, "QUAD:DMPS:380:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "0") } record(ao, "QUAD:DMPS:380: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, "QUAD:DMPS:380:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "QUAD:DMPS:380: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, "QUAD:DMPS:380: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, "QUAD:DMPS:380:IMOVE") field(INPB, "QUAD:DMPS:380:IACT") field(INPC, "QUAD:DMPS:380:IRAMPRATE") field(INPD, "1.577") field(INPE, "QUAD:DMPS:380:TRIMDLYPCT") field(INPF, "QUAD:DMPS:380:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "QUAD:DMPS:380:RAMPTIME_LEFT PP") } record(longout, "QUAD:DMPS:380:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "QUAD:DMPS:380:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "QUAD:DMPS:380:RAMPDONE_CALC") } record(calc, "QUAD:DMPS:380:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "QUAD:DMPS:380:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "QUAD:DMPS:380:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "QUAD:DMPS:380: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, "QUAD:DMPS:380:RAMPTIME_LEFT") field(OUT, "QUAD:DMPS:380:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "QUAD:DMPS:380:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "QUAD:DMPS:380:RAMPTIME_LEFT NMS") field(OUT, "QUAD:DMPS:380:RAMPDONE PP") } record(bo, "QUAD:DMPS:380:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "QUAD:DMPS:380:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "QUAD:DMPS:380: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, "QUAD:DMPS:380: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(sSub, "QUAD:DMPS:380: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, "QUAD:DMPS:380:PSTYPE.RVAL") field(INPC, "QUAD:DMPS:380:TURNEDOFF.RVAL") field(INPD, "QUAD:DMPS:380:CONFIG.RVAL") field(INPE, "QUAD:DMPS:380:PSCATEGORY.RVAL") field(INPF, "QUAD:DMPS:380:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "QUAD:DMPS:380:AUTOCTRL.RVAL") field(INPJ, "QUAD:DMPS:380:OUTOFSERVICE.RVAL") field(INPL, "QUAD:DMPS:380:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "QUAD:DMPS:380:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "QUAD:DMPS:380:PAU") field(INPP, "QUAD:DMPS:380:CALBDISABLE.RVAL") field(INPQ, "QUAD:DMPS:380:PTRBDISABLE.RVAL") field(INPR, "QUAD:DMPS:380:TRIMDISABLE.RVAL") field(INPS, "QUAD:DMPS:380:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "QUAD:DMPS:380:FBCK") field(INPU, "QUAD:DMPS:380:TRIMTYPE.RVAL") field(INPV, "QUAD:DMPS:380:STDZDIRECT.RVAL") field(INPW, "QUAD:DMPS:380:DEGAUSENABLE.RVAL") field(FLNK, "QUAD:DMPS:380:HSTA") } record(longin, "QUAD:DMPS:380:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "QUAD:DMPS:380:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "QUAD:DMPS:380: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, "QUAD:DMPS:380: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, "QUAD:DMPS:380:CALBDISABLE") { field(DESC, "DAC Calb Disabled") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:DMPS:380:PTRBDISABLE") { field(DESC, "Perturb Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:DMPS:380:TRIMDISABLE") { field(DESC, "Trim Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:DMPS:380:STDZDISABLE") { field(DTYP, "Raw Soft Channel") field(ZNAM, "NO") field(ONAM, "YES") field(DESC, "Standardize Function") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } # This PV has been replaced by QUAD:DMPS:380:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses QUAD:DMPS:380:FBCK. # This PV should be replaced by QUAD:DMPS:380: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, "QUAD:DMPS:380: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, "QUAD:DMPS:380: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, "QUAD:DMPS:380: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, "") field(OMSL, "supervisory") field(FLNK, "QUAD:DMPS:380:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"QUAD:DMPS:380:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "QUAD:DMPS:380:OUTOFSERVICE NPP NMS") field(OUT, "QUAD:DMPS:380:ONLINE PP") } record(bo, "QUAD:DMPS:380:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "QUAD:DMPS:380: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, "1") } record(bo, "QUAD:DMPS:380: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, "1") } record(bo, "QUAD:DMPS:380: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, "QUAD:DMPS:380: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, "QUAD:DMPS:380: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, "QUAD:DMPS:380: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, "QUAD:DMPS:380: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, "QUAD:DMPS:380: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, "1") field(ASG, "NOWRITE") } record(mbbo, "QUAD:DMPS:380: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, "1") field(ASG, "NOWRITE") } record(mbbo, "QUAD:DMPS:380: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, "2") field(ASG, "NOWRITE") } record(mbbo, "QUAD:DMPS:380: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, "0") field(ASG, "NOWRITE") field(FLNK, "QUAD:DMPS:380:TRIMTYPE") } record(stringout, "QUAD:DMPS:380:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "QUAD:DMPS:380:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "QUAD:DMPS:380:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "QUAD:DMPS:380:STATE.RVAL") field(INPB, "QUAD:DMPS:380:INTLKSUMY.RVAL") field(OUT, "QUAD:DMPS:380:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:DMPS:380: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, "QUAD:DMPS:380:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "QUAD:DMPS:380:STATE.RVAL") field(INPB, "QUAD:DMPS:380:INTLKSUMY.RVAL") field(OUT, "QUAD:DMPS:380:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:DMPS:380:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "QUAD:DMPS:380:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "QUAD:DMPS:380: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, "QUAD:DMPS:380:RAMPSTARTDLY") { field(DESC, "Tansition to ramp delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "2") } ######### For PSTYPE=2 Only ############# record(mbbo, "QUAD:DMPS:380: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, "QUAD:DMPS:380: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,"QUAD:DMPS:380: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("QUAD:DMPS:380:TURNEDOFF",3140,1907,0,1,"QUAD:DMPS:380:TURNEDOFF") #! 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, "BEND:DMPS:400:IACT") { field(DESC, "Current") field(INP, "PSC:LTUS:MG04:IACT") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "BEND:DMPS:400:BACT") info(autosaveFields,"HYST") } record(bi, "BEND:DMPS:400:STATE") { field(DESC, "PS On/Off Status") field(DTYP, "Raw Soft Channel") field(INP, "PSC:LTUS:MG04:STATE NPP MS") field(ZSV, "MAJOR") field(ZNAM, "OFF") field(ONAM, "ON") } record(ao, "BEND:DMPS:400:IDES") { field(DESC, "Desired Current") field(PREC, "3") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(MDEL, "-1") field(HIHI, "200.0") field(LOLO, "0.0") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "BEND:DMPS:400:BDELTAS") field(DRVH, "200.0") field(DRVL, "0.0") field(DOL, "BEND:DMPS:400: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, "BEND:DMPS:400:ICTRL PP") } # This record is processed by BEND:DMPS:400:ICON") # Note: we are not setting alarms here. record(ao, "BEND:DMPS:400:ICON") { field(DESC, "Config I") field(DTYP, "Soft Channel") field(PREC, "3") field(HOPR, "200.0") field(LOPR, "0.0") field(DRVH, "200.0") field(DRVL, "0.0") field(DOL, "BEND:DMPS:400:B2ICON.K") field(OMSL, "closed_loop") info(autosaveFields,"VAL") } record(ao, "BEND:DMPS:400:INOM") { field(DESC, "Nominal Current") field(DOL, "BEND:DMPS:400:BNOM.K") field(OMSL, "closed_loop") field(PREC, "3") field(EGU, "A") field(DRVH, "200.0") field(DRVL, "0.0") field(HOPR, "200.0") field(LOPR, "0.0") } record(ao, "BEND:DMPS:400:ICTRL") { field(DESC, "Set Current") field(PREC, "3") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(DRVH, "200.0") field(DRVL, "0.0") field(MDEL, "-1") field(FLNK, "BEND:DMPS:400:ICTRLGO") field(OMSL, "supervisory") info(autosavefields,"VAL") } record(seq, "BEND:DMPS:400:ICTRLGO") { field(DESC, "Process Current Setpoint") field(PREC, "3") # Set ISETPT to supervisory field(DOL1, "0") field(LNK1, "BEND:DMPS:400:ISETPT.OMSL") field(DOL2, "BEND:DMPS:400:ICTRL") field(LNK2, "BEND:DMPS:400:ISETPT PP") # Set ISETPT to closed loop - get data from BCTRLSUB.K field(DOL3, "1") field(LNK3, "BEND:DMPS:400:ISETPT.OMSL") } record(ao, "BEND:DMPS:400:IMAX") { field(DESC, "Max I") field(DTYP, "Soft Channel") field(DRVH, "200.0") field(DRVL, "0.0") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(PREC, "3") field(PINI, "YES") field(VAL, "200.0") field(FLNK, "BEND:DMPS:400:IMIN") } record(ao, "BEND:DMPS:400:IMIN") { field(DESC, "Min I") field(DTYP, "Soft Channel") field(DRVH, "200.0") field(DRVL, "0.0") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(PREC, "3") field(VAL, "0.0") field(FLNK, "BEND:DMPS:400:IRANGE") } record(sel, "BEND:DMPS:400:IACTPREVOK") { field(DESC, "Last Good Current") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(PREC, "3") field(NVL, "BEND:DMPS:400:BACT.SEVR") field(INPA, "BEND:DMPS:400:IACT NPP MS") field(INPB, "BEND:DMPS:400:IACTPREVOK NPP MS") field(INPC, "BEND:DMPS:400:IACTPREVOK NPP MS") field(INPD, "BEND:DMPS:400:IACTPREVOK NPP MS") } record(sub, "BEND:DMPS:400:IACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "BEND:DMPS:400:IDES") field(INPB, "BEND:DMPS:400:ISETPT.DRVH") field(INPC, "BEND:DMPS:400:ISETPT.DRVL") field(INPD, "BEND:DMPS:400:IDELTAS.I") field(INPE, "BEND:DMPS:400:IDELTAS.J") field(INPG, "BEND:DMPS:400:STATE") field(INPH, "BEND:DMPS:400:HSTA") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(sub, "BEND:DMPS:400:IMONLIMITS") { field(DESC, "Aux Current Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "BEND:DMPS:400:IDES") field(INPB, "BEND:DMPS:400:ISETPT.DRVH") field(INPC, "BEND:DMPS:400:ISETPT.DRVL") field(INPD, "BEND:DMPS:400:IDELTAS.K") field(INPE, "BEND:DMPS:400:IDELTAS.L") field(INPG, "BEND:DMPS:400:STATE") field(INPH, "BEND:DMPS:400:HSTA") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(seq, "BEND:DMPS:400:ILIMITS") { field(DESC, "Set ACT and MON Limits") field(PREC, "3") field(DOL1, "BEND:DMPS:400:BLIMITS") field(LNK1, "BEND:DMPS:400:IACTLIMITS.F PP") field(DOL2, "BEND:DMPS:400:IACTLIMITS.I") field(LNK2, "BEND:DMPS:400:IACT.HIGH") field(DOL3, "BEND:DMPS:400:IACTLIMITS.J") field(LNK3, "BEND:DMPS:400:IACT.LOW") field(DOL4, "BEND:DMPS:400:IACTLIMITS.K") field(LNK4, "BEND:DMPS:400:IACT.HIHI") field(DOL5, "BEND:DMPS:400:IACTLIMITS.L") field(LNK5, "BEND:DMPS:400:IACT.LOLO") field(DOL6, "BEND:DMPS:400:BLIMITS") field(LNK6, "BEND:DMPS:400:IMONLIMITS.F PP") field(DOL7, "BEND:DMPS:400:IMONLIMITS.I") field(LNK7, "BEND:DMPS:400:IMON.HIGH") field(DOL8, "BEND:DMPS:400:IMONLIMITS.J") field(LNK8, "BEND:DMPS:400:IMON.LOW") field(DOL9, "BEND:DMPS:400:IMONLIMITS.K") field(LNK9, "BEND:DMPS:400:IMON.HIHI") field(DOLA, "BEND:DMPS:400:IMONLIMITS.L") field(LNKA, "BEND:DMPS:400: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, "BEND:DMPS:400:IDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntRawDeltas") field(INPD, "BEND:DMPS:400:TRIMBTOL") field(INPE, "BEND:DMPS:400:CHCKBTOL") field(INPF, "BEND:DMPS:400:BDELTAS.K") field(INPG, "BEND:DMPS:400:BDELTAS.L") field(INPH, "BEND:DMPS:400: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, "BEND:DMPS:400:STDZITOLR") field(INPC, "BEND:DMPS:400:STDZITOL") field(FLNK, "") } # All ps controllers with on/off control will set the macro ONOF # as follows: # # ONOF = PSC:LTUS:MG04: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, "BEND:DMPS:400:STATESETPT") { field(DESC, "PS On/Off") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFF") field(ONAM, "ON") field(OUT, "PSC:LTUS:MG04:STATESETPT PP") 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 = PSC:LTUS:MG04:RESET PP # record(bo, "BEND:DMPS:400:RESET") { field(DESC, "Interlock Latch Reset") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFF") field(ONAM, "ON") field(HIGH, "1.0") field(OUT, "PSC:LTUS:MG04:RESET PP") } record(bo, "BEND:DMPS:400:RAMPSTATE") { field(DESC, "PS Ramp Status") field(DTYP, "Soft Channel") field(DOL, "PSC:LTUS:MG04:RAMPSTATE NPP 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, "BEND:DMPS:400: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, "BEND:DMPS:400:TRIMRAMPRATE") field(OUT, "PSC:LTUS:MG04:IRAMPRATE PP") field(FLNK, "BEND:DMPS:400:STDZDLY") } record(ao, "BEND:DMPS:400:ISETPT") { field(DESC, "Current Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(DRVH, "200.0") field(DRVL, "0.0") field(MDEL, "-1") field(OUT, "PSC:LTUS:MG04:ISETPT PP") field(DOL, "BEND:DMPS:400: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, "BEND:DMPS:400:IMON") { field(DESC, "Aux Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(INP, "PSC:LTUS:MG04:IMON") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "BEND:DMPS:400:BMON") } record(ao, "BEND:DMPS:400:IRIPL") { field(DESC, "Ripple Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(DOL, "PSC:LTUS:MG04:IRIPL NPP NMS") field(OMSL, "closed_loop") field(EGU, "A") field(DRVH, "1.0") field(HOPR, "1.0") field(PREC, "3") field(FLNK, "BEND:DMPS:400:IRIPLOK") } record(sub, "BEND:DMPS:400:IRIPLOK") { field(DESC, "Ripple Current Status") field(INAM, "mgntInit") field(SNAM, "mgntRiplOK") field(INPA, "BEND:DMPS:400:IRIPL.VAL") field(INPB, "BEND:DMPS:400: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, "BEND:DMPS:400:R") { field(DESC, "Resistance") field(EGU, "Ohms") field(PREC, "4") field(PINI, "YES") field(DOL, "PSC:LTUS:MG04:R NPP MS") 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, "BEND:DMPS:400:IGND") { field(DESC, "Ground Current") field(EGU, "A") field(PREC, "6") field(PINI, "YES") field(DOL, "PSC:LTUS:MG04:IGND NPP MS") field(OMSL, "closed_loop") } record(bi, "BEND:DMPS:400:INTLKSUMY") { field(DESC, "Interlock Summary") field(INP, "PSC:LTUS:MG04:INTLKSUMY NPP MS") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(ZNAM, "OK") field(ONAM, "FAULT") field(PINI, "NO") } record(mbbo, "BEND:DMPS:400: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, "PSC:LTUS:MG04:COOLING") field(OMSL, "closed_loop") } # The following PV is processed by :BACTFO # which is processed by :BACT record(fanout, "BEND:DMPS:400:IACTFO") { field(DESC, "IACT processing") field(SELM, "All") field(LNK1, "BEND:DMPS:400:IACTPREVOK") field(LNK2, "BEND:DMPS:400:IDIFF") field(LNK3, "BEND:DMPS:400:IADIFF") field(LNK4, "BEND:DMPS:400:IRATIO") field(LNK5, "BEND:DMPS:400:IDIRECT") field(LNK6, "BEND:DMPS:400:IACTPOL_CHECK") } record(calc, "BEND:DMPS:400:IDIFF") { field(DESC, "IDES-IACT") field(CALC, "A-B") field(INPA, "BEND:DMPS:400:IDES") field(INPB, "BEND:DMPS:400:IACT") field(EGU, "A") field(PREC, "9") field(HOPR, "200.0") field(LOPR, "0.0") } record(calc, "BEND:DMPS:400:IADIFF") { field(DESC, "Absolute IDES-IACT") field(CALC, "A<0?ABS(A):A") field(INPA, "BEND:DMPS:400:IDIFF") field(PREC, "9") } record(calc, "BEND:DMPS:400:IRATIO") { field(DESC, "IDES-IACT/IMAX") field(CALC, "B?A/B:0") field(INPA, "BEND:DMPS:400:IDIFF") field(INPB, "BEND:DMPS:400:IDES.DRVH") field(PREC, "9") } record(calcout, "BEND:DMPS:400:IRANGE") { field(DESC, "Current Range") field(PINI, "YES") field(CALC, "ABS(A-B)") field(INPA, "BEND:DMPS:400:IMIN") field(INPB, "BEND:DMPS:400: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, "BEND:DMPS:400: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, "BEND:DMPS:400:IACT") field(FLNK, "BEND:DMPS:400:IACTPOL") } record(bo, "BEND:DMPS:400:IACTPOL") { field(DESC, "Actual I Polarity") field(DTYP, "Raw Soft Channel") field(DOL, "BEND:DMPS:400: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,"BEND:DMPS:400:I*LIMITS:\n Calculate alarm and warning limits based on \n deltas from BEND:DMPS:400:IDELTAS and the\n BEND:DMPS:400: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,"BEND:DMPS:400:IACT: \n Get copy of BEND:DMPS:400:I. \n",null) #! TextBox(TB12,1280,3100,1760,3200,0,"Dialog",12,1,16777215,"BEND:DMPS:400: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,"BEND:DMPS:400:IDES:\n Contains raw value calculated by \nBEND:DMPS:400: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 \nBEND:DMPS:400:BDELTAS.\n",null) #! TextBox(TB10,56,1940,316,2340,0,"Dialog",12,1,16777215,"BEND:DMPS:400: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 BEND:DMPS:400: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 BEND:DMPS:400: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,"BEND:DMPS:400:ISETPT:\n Sets the hardware. When fast feedback is set on, this record is\n set to closed loop mode by BEND:DMPS:400:FBCKSTART sequence. When \n the loop is closed, this record takes input calculated by \n BFBCK only. When fast feedback is set off, BEND:DMPS:400:FBCKSTOP \n will set it back to supervisory so that the value can be set by \n BEND:DMPS:400: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, "BEND:DMPS:400:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "BEND:DMPS:400:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "BEND:DMPS:400:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "BEND:DMPS:400:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "BEND:DMPS:400:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "BEND:DMPS:400:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "1") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "BEND:DMPS:400: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, "BEND:DMPS:400:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "BEND:DMPS:400:TRIMTYPE.RVAL") field(INPB, "BEND:DMPS:400:CONFIG.RVAL") field(OUT, "BEND:DMPS:400:TRIMMAXNUM PP") } record(longout, "BEND:DMPS:400: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, "BEND:DMPS:400: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, "") field(OMSL, "supervisory") field(VAL, "10") field(OUT, "BEND:DMPS:400:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "BEND:DMPS:400: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, "") field(OMSL, "supervisory") field(VAL, "10") } record(bo, "BEND:DMPS:400: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, "BEND:DMPS:400: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, "BEND:DMPS:400: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, "BEND:DMPS:400:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "0") } record(ao, "BEND:DMPS:400: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, "BEND:DMPS:400:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "BEND:DMPS:400: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, "BEND:DMPS:400: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, "BEND:DMPS:400:IMOVE") field(INPB, "BEND:DMPS:400:IACT") field(INPC, "BEND:DMPS:400:IRAMPRATE") field(INPD, "1.577") field(INPE, "BEND:DMPS:400:TRIMDLYPCT") field(INPF, "BEND:DMPS:400:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "BEND:DMPS:400:RAMPTIME_LEFT PP") } record(longout, "BEND:DMPS:400:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "BEND:DMPS:400:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "BEND:DMPS:400:RAMPDONE_CALC") } record(calc, "BEND:DMPS:400:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "BEND:DMPS:400:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "BEND:DMPS:400:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "BEND:DMPS:400: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, "BEND:DMPS:400:RAMPTIME_LEFT") field(OUT, "BEND:DMPS:400:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "BEND:DMPS:400:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "BEND:DMPS:400:RAMPTIME_LEFT NMS") field(OUT, "BEND:DMPS:400:RAMPDONE PP") } record(bo, "BEND:DMPS:400:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "BEND:DMPS:400:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "BEND:DMPS:400: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, "BEND:DMPS:400: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, "BEND:DMPS:400:STDZINIT") { field(DESC, "Proc. Stdz PVs on boot") field(PINI, "YES") field(DOL1, "1") field(DOL2, "1") field(DOL3, "1") field(LNK1, "BEND:DMPS:400:DEBUG.PROC PP") field(LNK2, "BEND:DMPS:400:STDZCYCLENUM.PROC PP") field(LNK3, "BEND:DMPS:400:STDZDISABLE.PROC PP") field(LNK4, "BEND:DMPS:400: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, "BEND:DMPS:400:STDZSUB") { field(DESC, "Stdz subroutine") field(INAM, "mgntStdzInit") field(SNAM, "mgntStdz") field(BRSV, "INVALID") field(INPA, "BEND:DMPS:400:STDZIMIN NPP NMS") field(INPB, "BEND:DMPS:400:STDZIMAX NPP NMS") field(INPC, "BEND:DMPS:400:STDZIFINAL NPP NMS") field(INPD, "BEND:DMPS:400:STDZCYCLENUM NPP NMS") field(INPE, "BEND:DMPS:400:STDZDIRECT.RVAL NPP NMS") field(INPF, "BEND:DMPS:400:STDZDISABLE.RVAL CPP NMS") field(INPG, "BEND:DMPS:400: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, "BEND:DMPS:400:STDZWF PP") field(OUTB, "BEND:DMPS:400: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, "BEND:DMPS:400:STDZWF") } record(mbbo, "BEND:DMPS:400: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, "BEND:DMPS:400: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, "BEND:DMPS:400:STDZMAINPS") { field(DESC, "Stdz by main or self") field(PINI, "YES") field(DTYP, "Soft Channel") field(ZNAM, "SELF") field(ONAM, "MAIN") } record(bo, "BEND:DMPS:400: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, "BEND:DMPS:400: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, "BEND:DMPS:400: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, "BEND:DMPS:400:STDZTOD") { field(DESC, "Successful Standardize Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "BEND:DMPS:400:STDZLOSTTOD") { field(DESC, "Standardize Lost Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(longout, "BEND:DMPS:400:STDZCYCLECNT") { field(DESC, "Cycle Count") field(PINI, "YES") } record(longout, "BEND:DMPS:400:STDZCYCLENUM") { field(DESC, "No. Standardize Cycles") field(VAL, "3") field(HOPR, "10") field(LOPR, "0") field(DRVH, "10") field(DRVL, "0") field(PINI, "YES") field(FLNK, "BEND:DMPS:400:STDZDIRECT") } # The default standardize direction is "UP" for # all LCLS Magnets.. record(bo, "BEND:DMPS:400:STDZDIRECT") { field(DESC, "Standardize Direction ") field(ZNAM, "UP") field(ONAM, "DOWN") field(VAL, "0") field(FLNK, "BEND:DMPS:400:STDZIMIN") } record(ao, "BEND:DMPS:400:STDZIMIN") { field(DESC, "Min-STDZ Current") field(PREC, "1") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(VAL, "0.0") field(FLNK, "BEND:DMPS:400:STDZIMAX") } record(ao, "BEND:DMPS:400:STDZIMAX") { field(DESC, "Max. Standarize Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(VAL, "200.0") field(FLNK, "BEND:DMPS:400:STDZIFINAL") } record(ao, "BEND:DMPS:400:STDZIFINAL") { field(DESC, "Final SDTZ Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(VAL, "0.0") field(FLNK, "BEND:DMPS:400: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, "BEND:DMPS:400: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, "BEND:DMPS:400:STDZITOL") { field(DESC, "Stdz min tolerance") field(PREC, "5") field(CALC, "MAX(ABS(A),ABS(B))*C") field(INPA, "BEND:DMPS:400:STDZIMIN CP NMS") field(INPB, "BEND:DMPS:400:STDZIMAX CP MMS") field(INPC, "0.05") field(INPD, "BEND:DMPS:400:STDZITOLR CP MMS") field(EGU, "A") field(FLNK, "BEND:DMPS:400:IDELTAS") field(PINI, "YES") } # D - factor (3.154/2 = 1.577) for EPSC, otherwise, set to 1.0 record(calc, "BEND:DMPS:400:STDZDLY") { field(DESC, "Ramp time for stdz cycle") field(CALC, "C>0?MAX(1,ABS((A-B)/C)*D):0") field(INPA, "BEND:DMPS:400:STDZIMIN CP NMS") field(INPB, "BEND:DMPS:400:STDZIMAX CP NMS") field(INPC, "BEND:DMPS:400:TRIMRAMPRATE CP NMS") field(INPD, "1.577") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") } record(calc, "BEND:DMPS:400:STDZRAMPDLY") { field(DESC, "Ramp delay total") field(CALC, "MAX(1,((A/100)*B+B))") field(PREC, "5") field(INPA, "BEND:DMPS:400:TRIMDLYPCT CP MS") field(INPB, "BEND:DMPS:400: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, "BEND:DMPS:400:STDZMINIDLY") { field(DESC, "Mini-stdz delay") field(CALC, "A") field(PREC, "5") field(A, "1.0") field(EGU, "sec") field(PINI, "YES") } record(ao, "BEND:DMPS:400: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, "BEND:DMPS:400:STDZMINIDELTA") { field(DESC, "Stdz mini % of IMAX") field(CALC, "(B/100)*(A-C)") field(INPA, "BEND:DMPS:400:IDES.HOPR") field(INPB, "BEND:DMPS:400:STDZMINIPCT CPP NMS") field(INPC, "BEND:DMPS:400:IDES.LOPR") field(PREC, "5") } record(calc, "BEND:DMPS:400:STDZMINISETPT") { field(DESC, "Mini Stdz delta") field(CALC, "C==0?MAX(E-D,B):MIN(E+D,A)") field(INPA, "BEND:DMPS:400:IDES.HOPR") field(INPB, "BEND:DMPS:400:IDES.LOPR") field(INPC, "BEND:DMPS:400:STDZDIRECT.RVAL") field(INPD, "BEND:DMPS:400:STDZMINIDELTA") field(INPE, "BEND:DMPS:400:IDES") field(PREC, "5") field(FLNK, "BEND:DMPS:400: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, "BEND:DMPS:400:STDZMINISETPTOOR") { field(DESC, "Mini Stdz setpoint out of range") field(CALC, "C==0?(E-DA)") field(INPA, "BEND:DMPS:400:IDES.HOPR") field(INPB, "BEND:DMPS:400:IDES.LOPR") field(INPC, "BEND:DMPS:400:STDZDIRECT.RVAL") field(INPD, "BEND:DMPS:400:STDZMINIDELTA") field(INPE, "BEND:DMPS:400: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, "BEND:DMPS:400: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, "BEND:DMPS:400:IADJUST.RVAL") field(INPB, "BEND:DMPS:400:STDZDIRECT.RVAL") field(INPC, "BEND:DMPS:400:STDZOK.RVAL") field(INPD, "BEND:DMPS:400:STDZDISABLE.RVAL") field(INPE, "BEND:DMPS:400:STATE.RVAL CPP NMS") field(INPF, "BEND:DMPS:400:ICTRL.RVAL") field(INPG, "BEND:DMPS:400:STATE.SEVR") field(INPH, "BEND:DMPS:400:BDELTAS.M") field(INPI, "BEND:DMPS:400:IACT.SEVR") field(OUT, "BEND:DMPS:400:STDZLOSTGO.SELN PP NMS") field(OOPT, "Transition To Non-zero") } record(seq, "BEND:DMPS:400:STDZLOSTGO") { field(DESC, "Process lost stdz") field(SELM, "Mask") field(DOL1, "1") field(DOL2, "0") field(LNK1, "BEND:DMPS:400:STDZLOSTTOD.PROC") field(LNK2, "BEND:DMPS:400:STDZOK PP") } # Record maximum current after standardize # Reset to IACT from sequence after trim # Disable processing during (mini-)standardize or trim record(calc, "BEND:DMPS:400:STDZIACTMAX") { field(DESC, "Max act current after stdz") field(CALC, "MAX(A, B)") field(DISV, "0") field(SDIS, "BEND:DMPS:400:CHECKPWRDIP_ENABLE") field(INPA, "BEND:DMPS:400:IACT CP") field(INPB, "BEND:DMPS:400:STDZIACTMAX") field(EGU, "A") field(FLNK, "BEND:DMPS:400:CHECKPWRDIP") } # Detect power dip if STDZOK is YES, STDZ is enabled, and IACT is valid # If IACT drops below STDZIACTMAX by more than the trim tolerance, clear STDZOK # Warning: Take the absolute value of the trim tolerance, or else quads of # negative polarity will always lose STDZ since their IDELTAS.I are negative. # Note: Large quads and bends are prone to losing STDZ even if they are # perturbed toward higher current since their current tends to overshoot # by greater than the trim tolerance before settling down. record(calcout, "BEND:DMPS:400:CHECKPWRDIP") { field(DESC, "Detect power dip") field(CALC, "(A-B>ABS(C))?3:0") field(DISV, "0") field(SDIS, "BEND:DMPS:400:CHECKPWRDIP_ENABLE") field(INPA, "BEND:DMPS:400:STDZIACTMAX") field(INPB, "BEND:DMPS:400:IACT") field(INPC, "BEND:DMPS:400:IDELTAS.I") field(OUT, "BEND:DMPS:400:STDZLOSTGO.SELN PP NMS") field(OOPT, "When Non-zero") } # Enable processing of STDZIACTMAX and CHECKPWRDIP only if # STDZOK = YES, STDZDISABLE = NO, CTRL != Trim (2), and # CTRL != Stdz (4) record(calc, "BEND:DMPS:400:CHECKPWRDIP_ENABLE") { field(CALC, "A&&!B&&(C#2)&&(C#4)") field(INPA, "BEND:DMPS:400:STDZOK.RVAL CP") field(INPB, "BEND:DMPS:400:STDZDISABLE.RVAL CP") field(INPC, "BEND:DMPS:400:CTRL.RVAL CP") } #! 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, "BEND:DMPS:400: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, "BEND:DMPS:400:CALBOK") { field(DESC, "Successful Calibration") field(DTYP, "Raw Soft Channel") field(ZNAM, "NO") field(ONAM, "YES") field(DOL, "PSC:LTUS:MG04:CALBOK.RVAL") field(OMSL, "closed_loop") 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, "BEND:DMPS:400:CALBSET") { field(DESC, "Use DAC Calbration") field(SCAN, "10 second") field(CALC, "A&&(B==0)&&C?31:960") field(INPA, "BEND:DMPS:400:CALBOK") field(INPB, "BEND:DMPS:400:CALBDISABLE") field(INPC, "BEND:DMPS:400:CALBSLOPE") field(OOPT, "On Change") field(OUT, "BEND:DMPS:400: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, "BEND:DMPS:400:CALB_SEQ") { field(DESC, "Output Calib Values") field(SELM, "Mask") field(SELL, "BEND:DMPS:400: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, "BEND:DMPS:400:CALBSLOPE") field(DOL3, "BEND:DMPS:400: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, "BEND:DMPS:400:CALBTOD") { field(DESC, "Calibration Success Time") field(PINI, "YES") field(DOL, "PSC:LTUS:MG04:CALBTOD") field(OMSL, "closed_loop") field(DTYP, "Soft Channel") info(autosaveFields,"VAL") } record(ao, "BEND:DMPS:400: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, "BEND:DMPS:400: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, "BEND:DMPS:400: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, "BEND:DMPS:400:CALBOFFSET") { field(DESC, "Calc DAC Offset") field(PREC, "6") field(EGU, "Counts") field(PINI, "YES") } record(bo, "BEND:DMPS:400: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, "BEND:DMPS:400:DACSLOPE") { field(DESC, "V to DAC slope") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "closed_loop") field(PINI, "YES") field(FLNK, "BEND:DMPS:400:DACOFFSET") } # Default Offset used in conversion from Volts to DAC Counts record(ao, "BEND:DMPS:400:DACOFFSET") { field(DESC, "V to DAC offset") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "closed_loop") field(PINI, "YES") field(FLNK, "BEND:DMPS:400: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, "BEND:DMPS:400: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, "BEND:DMPS:400:IACT") field(INPD, "BEND:DMPS:400:DACSLOPE") field(INPE, "BEND:DMPS:400:DACOFFSET") field(EGU, "Counts") field(PREC, "6") } record(ao, "BEND:DMPS:400:DAC") { field(DESC, "DAC Set point") field(EGU, "Counts") field(DOL, "") field(OMSL, "closed_loop") field(PREC, "6") field(PINI, "YES") } record(ao, "BEND:DMPS:400:CALBIMIN") { field(DESC, "Calibration Min Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(DRVH, "200.0") field(HOPR, "200.0") field(DRVL, "0.0") field(LOPR, "0.0") field(PREC, "3") field(EGU, "A") field(VAL, "0.0") field(FLNK, "BEND:DMPS:400:CALBIMAX") } record(ao, "BEND:DMPS:400:CALBIMAX") { field(DESC, "Calibration Max Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(DRVH, "200.0") field(HOPR, "200.0") field(LOPR, "0.0") field(DRVL, "0.0") field(EGU, "A") field(VAL, "200.0") field(FLNK, "BEND:DMPS:400:CALBSTEPNUM") } record(ao, "BEND:DMPS:400:CALBIFINAL") { field(DESC, "Calibration Last Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(PREC, "3") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(VAL, "0") } record(longout, "BEND:DMPS:400: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, "BEND:DMPS:400:CALBIDELTA") } record(calc, "BEND:DMPS:400:CALBIDELTA") { field(DESC, "Step size for CALB") field(CALC, "C=0?0:ABS((A-B)/C)") field(INPA, "BEND:DMPS:400:CALBIMAX") field(INPB, "BEND:DMPS:400:CALBIMIN") field(INPC, "BEND:DMPS:400: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, "BEND:DMPS:400:CALBIMULT") { field(DESC, "IACT vs ISETPT mult") field(CALC, "C#0||A=0?1:ABS(B/A)") field(INPA, "PSC:LTUS:MG04:ISETPT.DRVH") field(INPB, "PSC:LTUS:MG04:IACT.HOPR") field(INPC, "BEND:DMPS:400:PSCONTROLLER.RVAL CPP") field(EGU, "A") field(PINI, "YES") } # SNL dbputs DAC values here. 6-10 steps are possible. record(waveform, "BEND:DMPS:400:CALBICTRLWF") { field(DESC, "ICTRL setpoint array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") } record(waveform, "BEND:DMPS:400:DACWF") { field(DESC, "DAC count array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "BEND:DMPS:400:DACSA") } # Used only for xygraph edm plot record(subArray, "BEND:DMPS:400:DACSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "BEND:DMPS:400: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, "BEND:DMPS:400:CALCDACWF") { field(DESC, "Calc DAC counts array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "BEND:DMPS:400:CALCDACSA") } # Used only for xygraph edm plot record(subArray, "BEND:DMPS:400:CALCDACSA") { field(DESC, "Calc DAC counts") field(DTYP, "Soft Channel") field(INP, "BEND:DMPS:400: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, "BEND:DMPS:400:CALBYWF") { field(DESC, "mx + b") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "BEND:DMPS:400:CALBYSA") } # Used only for xygraph edm plot record(subArray, "BEND:DMPS:400:CALBYSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "BEND:DMPS:400:CALBYWF") field(MALM, "10") field(NELM, "6") field(INDX, "0") field(FTVL, "DOUBLE") } record(waveform, "BEND:DMPS:400:CALBIACTWF") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "BEND:DMPS:400:CALBIACTSA") } # Used only for xygraph edm plot record(subArray, "BEND:DMPS:400:CALBIACTSA") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(MALM, "10") field(NELM, "6") field(INP, "BEND:DMPS:400:CALBIACTWF") field(INDX, "0") field(FTVL, "DOUBLE") field(FLNK, "BEND:DMPS:400:CALBLIMITS") } # Check that measured current during calibration is within # tolerance. record(aSub, "BEND:DMPS:400: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, "BEND:DMPS:400:CALBSTEPNUM") field(INPB, "BEND:DMPS:400:CALBIACTWF") field(INPC, "BEND:DMPS:400: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, "BEND:DMPS:400: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, "BEND:DMPS:400:STDZITOL") field(INPH, "BEND:DMPS:400:DACSLOPE") field(INPI, "BEND:DMPS:400: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, "BEND:DMPS:400: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, "BEND:DMPS:400:CALBSTEPNUM") field(INPB, "BEND:DMPS:400:CALBIACTWF") field(INPC, "BEND:DMPS:400:DACWF") field(INPF, "BEND:DMPS:400: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 BEND:DMPS:400CALBOK 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, "BEND:DMPS:400:DEGAUSINIT") { field(DESC, "Proc. Degauss PVs on boot") field(PINI, "YES") field(DOL, "1") field(OUTA, "BEND:DMPS:400:DEGAUSIMIN.PROC PP") field(OUTB, "BEND:DMPS:400:DEGAUSIMAX.PROC PP") field(OUTC, "BEND:DMPS:400:DEGAUSTYPE.PROC PP") field(OUTD, "BEND:DMPS:400:DEGAUSSTEP.PROC PP") field(OUTE, "BEND:DMPS:400:MADNAME.PROC PP") field(OUTF, "BEND:DMPS:400:PSTYPE.PROC PP") field(OUTG, "BEND:DMPS:400: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, "BEND:DMPS:400:DEGAUSSUB") { field(DESC, "Degauss subroutine") field(INAM, "mgntDegaussInit") field(SNAM, "mgntDegauss") field(BRSV, "INVALID") field(INPA, "BEND:DMPS:400:DEGAUSIMIN NPP NMS") field(INPB, "BEND:DMPS:400:DEGAUSIMAX NPP NMS") field(INPC, "BEND:DMPS:400:DEGAUSTYPE.RVAL NPP NMS") field(INPE, "BEND:DMPS:400:DEGAUSMETHOD.RVAL NPP NMS") field(INPF, "BEND:DMPS:400:PSTYPE NPP NMS") field(INPG, "BEND:DMPS:400:DEBUG.RVAL NPP NMS") field(INPH, "BEND:DMPS:400: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, "BEND:DMPS:400:DEGAUSWF PP") field(OUTB, "BEND:DMPS:400:DEGAUSMSG PP") field(OUTC, "BEND:DMPS:400: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, "BEND:DMPS:400:DEGAUSWF") { field(DESC, "Degauss Setpts") field(NELM, "60") field(FTVL, "DOUBLE") } record(mbbo,"BEND:DMPS:400: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, "BEND:DMPS:400: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, "BEND:DMPS:400: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, "BEND:DMPS:400: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, "BEND:DMPS:400: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, "BEND:DMPS:400:DEGAUSIMIN") { field(DESC, "Min. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "200.0") field(LOPR, "-200.0") field(DRVH, "200.0") field(DRVL, "-200.0") field(VAL, "-200.0") } record(ao, "BEND:DMPS:400:DEGAUSIMAX") { field(DESC, "Max. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "200.0") field(LOPR, "-200.0") field(DRVH, "200.0") field(DRVL, "-200.0") field(VAL, "200.0") } # 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,"BEND:DMPS:400: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, "BEND:DMPS:400: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,"BEND:DMPS:400: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, "BEND:DMPS:400: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, "BEND:DMPS:400: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, "BEND:DMPS:400: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, "BEND:DMPS:400:DEGAUSTOD") { field(DESC, "Successful Degauss Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "BEND:DMPS:400:DEGAUSLOSTTOD") { field(DESC, "Degauss Lost Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "BEND:DMPS:400:DEGAUSTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "BEND:DMPS:400:DEGAUSTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "BEND:DMPS:400: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, "BEND:DMPS:400:DEGAUSGO") { field(DESC, "Set bdes of btrms to zero") field(ASG, "Internal") field(OUTA, "") field(OUTB, "") field(OUTC, "") field(OUTD, "") } # =========== CRYO ONLY =========== record(bo, "BEND:DMPS:400: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, "BEND:DMPS:400:DEGAUS_IMAX_CHECK") { field(DESC, "Check if imax shoud chg") field(CALC, "(C==4)&&(ABS(B)>ABS(A))?1:0") field(INPA, "BEND:DMPS:400:DEGAUS_IMAX") field(INPB, "BEND:DMPS:400:ISETPT") field(INPC, "BEND:DMPS:400:DEGAUSTYPE.RVAL") field(OUT, "BEND:DMPS:400:DEGAUS_IMAX_UPDATE.SELN") field(FLNK, "BEND:DMPS:400:DEGAUS_IMAX_UPDATE") } record(seq, "BEND:DMPS:400:DEGAUS_IMAX_UPDATE") { field(DESC, "Degauss IMAX Update") field(SELM, "Specified") field(DOL1, "BEND:DMPS:400:ISETPT") field(LNK1, "BEND:DMPS:400:DEGAUS_IMAX PP") } # Set the maximum current after a successful # degauss. This pv is updated by the # sequence. record(ao, "BEND:DMPS:400:DEGAUS_IMAX") { field(DESC, "Max I set afer a degauss") field(EGU, "Amps") field(PINI, "YES") field(PREC, "6") field(HOPR, "200.0") field(LOPR, "-200.0") field(DRVH, "200.0") field(DRVL, "-200.0") field(VAL, "200.0") field(FLNK, "BEND:DMPS:400:DEGAUS_IMAXPOL_CHECK") info(autosaveFields,"VAL,RVAL") } # Set the polarity if degauss_imax record(calcout, "BEND:DMPS:400:DEGAUS_IMAXPOL_CHECK") { field(DESC, "Determine polarity of imax") field(CALC, "A>=0?0:1") field(INPA, "BEND:DMPS:400:DEGAUS_IMAX") field(FLNK, "BEND:DMPS:400:DEGAUS_IMAXPOL") } record(bo, "BEND:DMPS:400:DEGAUS_IMAXPOL") { field(DESC, "Polarity of imax I") field(DTYP, "Raw Soft Channel") field(DOL, "BEND:DMPS:400:DEGAUS_IMAXPOL_CHECK") field(OMSL, "closed_loop") field(ZNAM, "Positive") field(ONAM, "Negative") field(FLNK, "BEND:DMPS:400: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, "BEND:DMPS:400:DEGAUS_ABSIMAX") { field(DESC, "Absolute Max. Degauss I") field(CALC, "ABS(A)") field(INPA, "BEND:DMPS:400:DEGAUS_IMAX") field(PREC, "6") field(EGU, "Amps") field(HOPR, "200.0") field(LOPR, "-200.0") info(autosaveFields,"VAL RVAL") } # IACT Polarity record(calcout, "BEND:DMPS:400:IACTPOL_CHECK") { field(DESC, "Determine IACT polarity") field(SCAN, "5 second") field(CALC, "ABS(A-B)>C?(A>=0?0:1):D") field(INPA, "BEND:DMPS:400:IACT") field(INPB, "BEND:DMPS:400:IACTPOL_CHECK.LA") field(INPC, "0.0001") field(INPD, "BEND:DMPS:400:IACTPOL_CHECK.PVAL") field(OOPT, "On Change") field(FLNK, "BEND:DMPS:400:IACTPOL") } record(bo, "BEND:DMPS:400: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,"BEND:DMPS:400: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, "BEND:DMPS:400:DEGAUSENABLE CP") field(INPB, "BEND:DMPS:400:DEGAUSOK") field(INPC, "BEND:DMPS:400:STATE CP") field(INPD, "BEND:DMPS:400:STATE.SEVR") field(OUT, "BEND:DMPS:400:DEGAUS_STATE_SEQ.SELN PP") field(ASG, "Internal") } record(seq, "BEND:DMPS:400:DEGAUS_STATE_SEQ") { field(DESC, "Degauss State Sequence") field(SELM, "Specified") field(SELL, "BEND:DMPS:400:DEGAUS_STATE_CHECK") field(LNK1, "BEND:DMPS:400:DEGAUS_STATE_DISABLE.PROC PP") field(LNK2, "BEND:DMPS:400:DEGAUS_STATE_LOST.PROC PP") field(LNK3, "BEND:DMPS:400:DEGAUS_STATE_GOOD.PROC PP") field(LNK4, "BEND:DMPS:400: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, "BEND:DMPS:400:DEGAUS_STATE_DISABLE") { field(DESC, "Degauss not used") field(LNK1, "BEND:DMPS:400:DEGAUSOK.ZSV") field(LNK2, "BEND:DMPS:400: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, "BEND:DMPS:400:STATMSG.FRSV") field(LNK4, "BEND:DMPS:400: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, "BEND:DMPS:400:DEGAUS_STATE_LOST") { field(DESC, "Degauss lost and ps On") field(DOL1, "1") field(LNK1, "BEND:DMPS:400:DEGAUSOK.ZSV") field(LNK2, "BEND:DMPS:400: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, "BEND:DMPS:400:STATMSG.FRSV") field(LNK4, "BEND:DMPS:400: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, "BEND:DMPS:400:DEGAUS_STATE_OFF") { field(DESC, "Degaused lost and ps Off") field(DOL1, "2") field(LNK1, "BEND:DMPS:400: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, "BEND:DMPS:400:STATMSG.FRSV") field(LNK3, "BEND:DMPS:400: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, "BEND:DMPS:400:DEGAUS_STATE_GOOD") { field(DESC, "Degauss good") field(DOL1, "1") field(LNK1, "BEND:DMPS:400: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, "BEND:DMPS:400:STATMSG.FRSV PP") field(LNK3, "BEND:DMPS:400:STATMSG.FVSV PP") field(LNK4, "") field(ASG, "Internal") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(mbbo, "BEND:DMPS:400:FUNC") { field(DESC, "BEND:DMPS:400 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, "1") field(THVL, "9") field(FRVL, "10") field(FVVL, "0") field(SXVL, "2") field(SVVL, "8") field(EIVL, "11") field(NIVL, "12") field(TEVL, "13") field(ELVL, "5") field(TVVL, "6") field(TTVL, "7") field(FTVL, "4") field(FFVL, "3") field(OUT, "BEND:DMPS:400:CTRL CA") } # :CTRL pv is processed at boot in the # sequence mgntCtrl.st Processed in sequence # record(mbbo, "BEND:DMPS:400:CTRL") { field(DESC, "BEND:DMPS:400 Control") field(PINI, "NO") field(ZRST, "Ready") field(ONST, "TRIM") field(TWST, "PERTURB") field(THST, "BCON_TO_BDES") field(FRST, "BACT_TO_BDES") field(FVST, "SAVE_BDES") field(SXST, "LOAD_BDES") field(SVST, "UNDO_BDES") field(EIST, "DAC_ZERO") field(NIST, "CALB") field(TEST, "STDZ") field(ELST, "RESET") field(TVST, "TURN_ON") field(TTST, "TURN_OFF") field(FTST, "") field(FFST, "") field(ZRVL, "0") field(ONVL, "2") field(TWVL, "6") field(THVL, "15") field(FRVL, "14") field(FVVL, "11") field(SXVL, "12") field(SVVL, "13") field(EIVL, "7") field(NIVL, "3") field(TEVL, "4") field(ELVL, "8") field(TVVL, "9") field(TTVL, "10") field(FTVL, "0") field(FFVL, "0") field(OUT, "BEND:DMPS:400:SELECTEN.A PP") field(SDIS, "0") } # If a function has been selected set this unit to busy record(calcout, "BEND:DMPS:400:SELECTEN") { field(DESC, "Control Select Enable") field(CALC, "A>0?1:A") field(FLNK, "BEND:DMPS:400:BUSY") } # Set to FREE on IOC reboot record(bo, "BEND:DMPS:400:BUSY") { field(DESC, "BEND:DMPS:400 Ctrl Done") field(DOL, "BEND:DMPS:400:SELECTEN") field(ZNAM, "FREE") field(ONAM, "BUSY") field(PINI, "YES") field(FLNK, "BEND:DMPS:400:SELECT") } record(bo, "BEND:DMPS:400:SELECT") { field(ZNAM, "NO") field(ONAM, "YES") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") } record(bo, "BEND:DMPS:400: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, "BEND:DMPS:400:CTRLSTATE") { field(DESC, "BEND:DMPS:400 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("BEND:DMPS:400:CTRL",20,20,0,0,"BEND:DMPS:400:CTRL") #! Field("BEND:DMPS:400:CTRL.OUT",16777215,1,"BEND:DMPS:400:CTRL.OUT") #! Link("BEND:DMPS:400:CTRL.OUT","BEND:DMPS:400:SELECTEN.A") #! Field("BEND:DMPS:400:CTRL.VAL",16777215,1,"BEND:DMPS:400:CTRL.VAL") #! Record("BEND:DMPS:400:SELECTEN",321,381,0,0,"BEND:DMPS:400:SELECTEN") #! Field("BEND:DMPS:400:SELECTEN.A",16777215,0,"BEND:DMPS:400:SELECTEN.A") #! Field("BEND:DMPS:400:SELECTEN.FLNK",16777215,1,"BEND:DMPS:400:SELECTEN.FLNK") #! Link("BEND:DMPS:400:SELECTEN.FLNK","BEND:DMPS:400:BUSY") #! Field("BEND:DMPS:400:SELECTEN.VAL",16777215,1,"BEND:DMPS:400:SELECTEN.VAL") #! Record("BEND:DMPS:400:BUSY",623,274,0,0,"BEND:DMPS:400:BUSY") #! Field("BEND:DMPS:400:BUSY.DOL",16777215,0,"BEND:DMPS:400:BUSY.DOL") #! Link("BEND:DMPS:400:BUSY.DOL","BEND:DMPS:400:SELECTEN.VAL") #! Field("BEND:DMPS:400:BUSY.FLNK",16777215,1,"BEND:DMPS:400:BUSY.FLNK") #! Link("BEND:DMPS:400:BUSY.FLNK","BEND:DMPS:400:SELECT") #! Record("BEND:DMPS:400:SELECT",669,508,0,1,"BEND:DMPS:400:SELECT") #! Record("BEND:DMPS:400:FUNC",940,120,0,0,"BEND:DMPS:400:FUNC") #! Field("BEND:DMPS:400:FUNC.OUT",16777215,0,"BEND:DMPS:400:FUNC.OUT") #! Link("BEND:DMPS:400:FUNC.OUT","BEND:DMPS:400:CTRL.VAL") #! Record("BEND:DMPS:400:ABORT",193,41,0,0,"BEND:DMPS:400:ABORT") #! Record("BEND:DMPS:400:CTRLSTATE",369,34,0,0,"BEND:DMPS:400: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,"BEND:DMPS:400:SELECT is used for Multi-device selection.\nIt is enabled when associated BEND:DMPS:400:CTRL is \"0\" (DONE).\nIt is disabled when associated BEND:DMPS:400: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,"BEND:DMPS:400: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, "BEND:DMPS:400:BCTRL_INIT") { field(DESC, "Process BCTRL on boot") field(PINI, "YES") field(CALC, "A=3?1:0") field(INPA, "BEND:DMPS:400:BCTRL.SEVR") field(OUT, "BEND:DMPS:400: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, "BEND:DMPS:400:BACT") { field(DESC, "Actual B") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "BEND:DMPS:400:BACT") field(INPB, "BEND:DMPS:400:POLYCOEF") field(INPC, "BEND:DMPS:400:POLYCOEF.A") field(INPD, "BEND:DMPS:400:POLYCOEF.B") field(INPE, "BEND:DMPS:400:IACT MS") field(INPF, "BEND:DMPS:400:BDELTAS PP") field(INPG, "100") field(EGU, "GeV/c") field(HOPR, "15.7809") field(LOPR, "0.0264") field(HIHI, "15.7809") field(LOLO, "0.0264") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "15.7809") field(LOW, "0.0264") field(FLNK, "BEND:DMPS:400: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, "BEND:DMPS:400:BDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntPhyDeltas") field(EGU, "GeV/c") field(HOPR, "1") field(PREC, "7") field(BRSV, "INVALID") field(INPA, "BEND:DMPS:400:BDES") field(INPB, "BEND:DMPS:400:TRIMBTOL") field(INPC, "BEND:DMPS:400:TRIMBTOLR") field(INPD, "BEND:DMPS:400:CHCKBTOL") field(INPE, "BEND:DMPS:400:CHCKBTOLR") field(F, "2.0") field(INPG, "30") field(INPH, "BEND:DMPS:400:BACT.VAL") # # MPS absolute and relative tolerances field(INPP, "BEND:DMPS:400:MPSBTOL") field(INPQ, "BEND:DMPS:400:MPSBTOLR") field(FLNK, "BEND:DMPS:400:BCONLIMITS") info(autosaveFields,"F") } # This record is processed by BDELTAS record(aSub, "BEND:DMPS:400:BCONLIMITS") { field(DESC, "Config B-field Limits") field(INAM, "mgntInit") field(SNAM, "mgntBCONLimits") field(INPA, "BEND:DMPS:400:BDES") field(INPB, "BEND:DMPS:400:BDELTAS.I") field(INPG, "BEND:DMPS:400:DEBUG.RVAL") field(FTA, "DOUBLE") field(FTB, "DOUBLE") field(FTG, "ULONG") field(OUTA, "BEND:DMPS:400:BCON.HIGH") field(OUTB, "BEND:DMPS:400:BCON.LOW") field(OUTC, "BEND:DMPS:400:BCON.HIHI") field(OUTD, "BEND:DMPS:400:BCON.LOLO PP") field(FTVA, "DOUBLE") field(FTVB, "DOUBLE") field(FTVC, "DOUBLE") field(FTVD, "DOUBLE") field(BRSV, "INVALID") field(FLNK, "BEND:DMPS:400:IDELTAS") } # The following PV is processed by :BACT # which is processed by :BACT # record(fanout, "BEND:DMPS:400:BACTFO") { field(DESC, "BACT processing") field(SELM, "All") field(LNK1, "BEND:DMPS:400:BDIFF") field(LNK2, "BEND:DMPS:400:BADIFF") field(LNK3, "BEND:DMPS:400:BRATIO") field(LNK4, "BEND:DMPS:400:MPSLIMITS") field(LNK5, "BEND:DMPS:400:I2BSTATUS") field(LNK6, "BEND:DMPS:400:IACTFO.PROC") } record(calc, "BEND:DMPS:400:BDIFF") { field(DESC, "BDES-BACT") field(CALC, "A-B") field(INPA, "BEND:DMPS:400:BDES") field(INPB, "BEND:DMPS:400:BACT") field(EGU, "GeV/c") field(PREC, "7") } record(calc, "BEND:DMPS:400:BADIFF") { field(DESC, "Absolute BDES-BACT") field(INPA, "BEND:DMPS:400:BDIFF") field(EGU, "GeV/c") field(PREC, "7") field(CALC, "A<0?ABS(A):A") } record(calc, "BEND:DMPS:400:BRATIO") { field(DESC, "BACT Error") field(CALC, "B?A/B:0") field(INPA, "BEND:DMPS:400:BDIFF") field(INPB, "BEND:DMPS:400:BDES.HOPR") field(EGU, "GeV/c") field(PREC, "7") } record(mbbi, "BEND:DMPS:400: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, "BEND:DMPS:400:BACT.J") } # Note: for a string slave set the MONFL # macro to the following: # MONFL=:IMONCALC MS record(sub, "BEND:DMPS:400:BMON") { field(DESC, "Second Transductor") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "BEND:DMPS:400:BMON") field(INPB, "BEND:DMPS:400:POLYCOEF") field(INPC, "BEND:DMPS:400:POLYCOEF.A") field(INPD, "BEND:DMPS:400:POLYCOEF.B") field(INPE, "BEND:DMPS:400:IMON MS") field(INPF, "BEND:DMPS:400:BDELTAS.VAL") field(INPG, "100") field(EGU, "GeV/c") field(HOPR, "15.7809") field(LOPR, "0.0264") field(HIHI, "15.7809") field(LOLO, "0.0264") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "15.7809") field(LOW, "0.0264") } # 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=PSC:LTUS:MG04:BDES CP record(ao, "BEND:DMPS:400:BDES") { field(DESC, "Desired B-Field") field(PINI, "YES") field(DRVH, "15.7809") field(DRVL, "0.0264") field(HOPR, "15.7809") field(LOPR, "0.0264") field(PREC, "7") field(EGU, "GeV/c") field(MDEL, "-1") field(OMSL, "supervisory") # field(DOL, "") field(OUT, "BEND:DMPS:400:B2IDES PP") info(autosaveFields,"VAL") } record(sub, "BEND:DMPS:400:B2IDES") { field(DESC, "Convert Desired B-Field to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "BEND:DMPS:400:POLYCOEF") field(INPC, "BEND:DMPS:400:POLYCOEF.A") field(INPD, "BEND:DMPS:400:POLYCOEF.B") field(PREC, "7") field(EGU, "GeV/c") field(HOPR, "15.7809") field(LOPR, "0.0264") field(MDEL, "-1") field(INPE, "BEND:DMPS:400:BDES.DRVH") field(INPF, "BEND:DMPS:400:BDES.DRVL") field(BRSV, "INVALID") field(FLNK, "BEND:DMPS:400:IDES") } record(sub, "BEND:DMPS:400:BNOM") { field(DESC, "Nominal Field") field(PINI, "YES") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "BEND:DMPS:400:POLYCOEF") field(INPC, "BEND:DMPS:400:POLYCOEF.A") field(INPD, "BEND:DMPS:400:POLYCOEF.B") field(INPE, "BEND:DMPS:400:BDES.DRVH") field(INPF, "BEND:DMPS:400:BDES.DRVL") field(EGU, "GeV/c") field(HOPR, "15.7809") field(LOPR, "0.0264") field(PREC, "7") field(VAL, "0.0") field(FLNK, "BEND:DMPS:400:INOM") } record(sub, "BEND:DMPS:400:BACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "BEND:DMPS:400:BDES.VAL") field(INPB, "BEND:DMPS:400:BDES.DRVH") field(INPC, "BEND:DMPS:400:BDES.DRVL") field(INPD, "BEND:DMPS:400:BDELTAS.I") field(INPE, "BEND:DMPS:400:BDELTAS.J") field(INPG, "BEND:DMPS:400:STATE") field(INPH, "BEND:DMPS:400:HSTA") field(EGU, "GeV/c") field(HOPR, "15.7809") field(LOPR, "0.0264") field(PREC, "7") field(BRSV, "INVALID") } record(sub, "BEND:DMPS:400:BMONLIMITS") { field(DESC, "MON Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "BEND:DMPS:400:BDES.VAL") field(INPB, "BEND:DMPS:400:BDES.DRVH") field(INPC, "BEND:DMPS:400:BDES.DRVL") field(INPD, "BEND:DMPS:400:BDELTAS.K") field(INPE, "BEND:DMPS:400:BDELTAS.L") field(INPG, "BEND:DMPS:400:STATE") field(INPH, "BEND:DMPS:400:HSTA") field(EGU, "GeV/c") field(HOPR, "15.7809") field(LOPR, "0.0264") field(PREC, "7") field(BRSV, "INVALID") } record(seq, "BEND:DMPS:400:BLIMITS") { field(DESC, "ACT Limits") field(PREC, "7") field(DOL1, "BEND:DMPS:400:BLIMITS") field(LNK1, "BEND:DMPS:400:BACTLIMITS.F PP") field(DOL2, "BEND:DMPS:400:BACTLIMITS.I") field(LNK2, "BEND:DMPS:400:BACT.HIGH") field(DOL3, "BEND:DMPS:400:BACTLIMITS.J") field(LNK3, "BEND:DMPS:400:BACT.LOW") field(DOL4, "BEND:DMPS:400:BACTLIMITS.K") field(LNK4, "BEND:DMPS:400:BACT.HIHI") field(DOL5, "BEND:DMPS:400:BACTLIMITS.L") field(LNK5, "BEND:DMPS:400:BACT.LOLO") field(DOL6, "BEND:DMPS:400:BLIMITS") field(LNK6, "BEND:DMPS:400:BMONLIMITS.F PP") field(DOL7, "BEND:DMPS:400:BMONLIMITS.I") field(LNK7, "BEND:DMPS:400:BMON.HIGH") field(DOL8, "BEND:DMPS:400:BMONLIMITS.J") field(LNK8, "BEND:DMPS:400:BMON.LOW") field(DOL9, "BEND:DMPS:400:BMONLIMITS.K") field(LNK9, "BEND:DMPS:400:BMON.HIHI") field(DOLA, "BEND:DMPS:400:BMONLIMITS.L") field(LNKA, "BEND:DMPS:400:BMON.LOLO") field(FLNK, "BEND:DMPS:400:ILIMITS") field(SCAN, "5 second") } record(ao, "BEND:DMPS:400:BCTRL") { field(DESC, "B-Perturb") field(PREC, "7") field(EGU, "GeV/c") field(DRVH, "15.7809") field(DRVL, "0.0264") field(HOPR, "15.7809") field(LOPR, "0.0264") # 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, "BEND:DMPS:400: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, "BEND:DMPS:400:BCTRLGO") { field(DESC, "Update DES and perturb") field(PREC, "7") # Disable BACT limits field(DOL1, "1") field(LNK1, "BEND:DMPS:400:BLIMITS.VAL") # Update BDES with the BCTRL (slider) value field(DOL2, "BEND:DMPS:400:BCTRL.VAL") field(LNK2, "BEND:DMPS:400:BDES PP") field(DOL3, "1") field(LNK3, "BEND:DMPS:400:IDIRECT.PROC PP") field(DOL4, "1") field(LNK4, "BEND:DMPS:400:CHECKSTDZLOST.PROC PP") field(DOL5, "BEND:DMPS:400:BCTRL.VAL") field(LNK5, "BEND:DMPS:400:BCTRLSUB PP") # Re-enable BACT limits field(DOL6, "0") field(LNK6, "BEND:DMPS:400:BLIMITS.VAL") } # Convert B-field to Current and output to ISETPT record(sub, "BEND:DMPS:400:BCTRLSUB") { field(DESC, "Feedback") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "BEND:DMPS:400:POLYCOEF") field(INPC, "BEND:DMPS:400:POLYCOEF.A") field(INPD, "BEND:DMPS:400:POLYCOEF.B") field(INPE, "BEND:DMPS:400:BDES.DRVH") field(INPF, "BEND:DMPS:400:BDES.DRVL") field(PREC, "7") field(EGU, "GeV/c") field(HOPR, "15.7809") field(LOPR, "0.0264") field(MDEL, "-1") field(BRSV, "INVALID") field(FLNK, "BEND:DMPS:400:ISETPT") } record(ao, "BEND:DMPS:400:BDESPREVTRIM") { field(DESC, "trim bdes for undo") field(DTYP, "Soft Channel") field(DRVH, "15.7809") field(DRVL, "0.0264") field(EGU, "GeV/c") field(HOPR, "15.7809") field(LOPR, "0.0264") field(PREC, "7") field(PINI, "YES") info(autosaveFields,"VAL") } record(stringin, "BEND:DMPS:400:MADNAME") { field(DESC, "MAD deck nomenclature") field(PINI, "YES") field(VAL, "BYD1B") } record(ai, "BEND:DMPS:400: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, "3735.948908") } record(ao, "BEND:DMPS:400:BMAX") { field(DESC, "Max B-Field") field(DTYP, "Soft Channel") field(DRVH, "15.7809") field(DRVL, "0.0264") field(EGU, "GeV/c") field(HOPR, "15.7809") field(LOPR, "0.0264") field(PREC, "7") field(PINI, "YES") field(VAL, "15.7809") field(FLNK, "BEND:DMPS:400:BSTEP") } record(ao, "BEND:DMPS:400:BMIN") { field(DESC, "Min B-Field") field(DTYP, "Soft Channel") field(DRVH, "15.7809") field(DRVL, "0.0264") field(EGU, "GeV/c") field(HOPR, "15.7809") field(LOPR, "0.0264") field(PREC, "7") field(PINI, "YES") field(VAL, "0.0264") field(FLNK, "BEND:DMPS:400:BSTEP") } record(ao, "BEND:DMPS:400:BDESSAVE") { field(DESC, "bdes for save/load") field(DTYP, "Soft Channel") field(DRVH, "15.7809") field(DRVL, "0.0264") field(EGU, "GeV/c") field(HOPR, "15.7809") field(LOPR, "0.0264") field(PINI, "YES") field(PREC, "7") } # This record is processed by BEND:DMPS:400: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, "BEND:DMPS:400:BCON") { field(DESC, "Config B-Field ") field(DTYP, "Soft Channel") field(PREC, "7") field(EGU, "GeV/c") field(HOPR, "15.7809") field(LOPR, "0.0264") field(DRVH, "15.7809") field(DRVL, "0.0264") # Set MINOR Alarm as the default, slaves will set NO_ALARM=0. field(HHSV, "MINOR") field(LLSV, "MINOR") field(HSV, "MINOR") field(LSV, "MINOR") # field(DOL , "") field(OMSL, "supervisory") field(OUT, "BEND:DMPS:400:B2ICON PP") info(autosaveFields,"VAL") } record(sub, "BEND:DMPS:400:B2ICON") { field(DESC, "Convert Desired ICon to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "BEND:DMPS:400:POLYCOEF") field(INPC, "BEND:DMPS:400:POLYCOEF.A") field(INPD, "BEND:DMPS:400:POLYCOEF.B") field(PREC, "7") field(EGU, "GeV/c") field(HOPR, "15.7809") field(LOPR, "0.0264") field(MDEL, "-1") field(INPE, "BEND:DMPS:400:BCON.DRVH") field(INPF, "BEND:DMPS:400:BCON.DRVL") field(BRSV, "INVALID") field(FLNK, "BEND:DMPS:400: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, "BEND:DMPS:400:BSTEP") { field(DESC, "B-Field step size") field(CALC, "(C==3)||(D==3)?0:ABS(A-B)*0.005") field(INPA, "BEND:DMPS:400:BMAX") field(INPB, "BEND:DMPS:400:BMIN") field(INPC, "BEND:DMPS:400:BMIN.SEVR") field(INPD, "BEND:DMPS:400:BMAX.SEVR") field(EGU, "GeV/c") 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,"BEND:DMPS:400:BCTRLDISABLECALC") { field(DESC, "Calc for disabling BCTRL") field(ASG, "Internal") field(CALC, "A?2:1") field(INPA, "BEND:DMPS:400:ONLINE CP") field(OUT, "BEND:DMPS:400:BCTRLDISABLEFOUT PP") } record(fanout, "BEND:DMPS:400:BCTRLDISABLEFOUT") { field(DESC, "Disable BCTRL fanout") field(SELM, "Specified") field(SELL, "BEND:DMPS:400:BCTRLDISABLECALC") field(LNK1, "BEND:DMPS:400:BCTRLDISABLE") field(LNK2, "BEND:DMPS:400:BCTRLENABLE") } record(stringout, "BEND:DMPS:400:BCTRLDISABLE") { field(DESC, "Disable BCTRL") field(DTYP, "Soft Channel") field(OUT, "BEND:DMPS:400:BCTRL.ASG") field(VAL, "NOWRITE") field(FLNK, "BEND:DMPS:400:BCTRLDISV_UPDATE") } record(stringout, "BEND:DMPS:400:BCTRLENABLE") { field(DESC, "Enable BCTRL") field(DTYP, "Soft Channel") field(OUT, "BEND:DMPS:400:BCTRL.ASG") field(VAL, "") field(FLNK, "BEND:DMPS:400:BCTRLDISV_UPDATE") } record(calcout, "BEND:DMPS:400:BCTRLDISV_UPDATE") { field(DESC, "Calc for updating BCTRL.DISV") field(ASG, "Internal") field(CALC, "A") field(INPA, "BEND:DMPS:400:ONLINE") field(OUT, "BEND:DMPS:400: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,"BEND:DMPS:400:BACT and MON\n are processed via links from \n BEND:DMPS:400:IACT (device raw value readback 1)\n and\n BEND:DMPS:400: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 BEND:DMPS:400:POLYCOEF\nC = First polynomial coefficient (offset if linear)\nD = Second polynomial coefficient (slope if linear)\nE = BEND:DMPS:400: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,"BEND:DMPS:400:BDES\n is processed when set by CA users or \n BEND:DMPS:400: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,"BEND:DMPS:400: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 BEND:DMPS:400: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 (BEND:DMPS:400: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,"BEND:DMPS:400:B*LIMITS and BEND:DMPS:400:BLIMITS:\n Calculate alarm and warning limits based on \n deltas from BEND:DMPS:400: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,"BEND:DMPS:400: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,"BEND:DMPS:400: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, "BEND:DMPS:400: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, "BEND:DMPS:400:MPSBTOL") { field(DESC, "Absolute mps tol") field(EGU, "GeV/c") field(PREC, "2") field(CALC, "ABS(A)*0.02") field(INPA, "BEND:DMPS:400:BMAX") field(PINI, "YES") } # # 21-Aug-2013: K. Luchini # Set channel access security so that users # cannot easily change values. record(ao, "BEND:DMPS:400:MPSBMAX") { field(DESC, "MPS Max B-field") field(EGU, "GeV/c") field(PREC, "7") field(DRVH, "15.7809") field(DRVL, "0.0264") field(PINI, "YES") field(VAL, "15.7809") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "BEND:DMPS:400:MPSBMIN") { field(DESC, "MPS Min B-field") field(EGU, "GeV/c") field(PREC, "7") field(DRVH, "15.7809") field(DRVL, "0.0264") field(PINI, "YES") field(VAL, "0.0264") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "BEND:DMPS:400:MPSBLLIM") { field(DESC, "MPS Low Limit B-field") field(EGU, "GeV/c") field(PREC, "7") field(DRVH, "15.7809") field(DRVL, "0.0264") field(PINI, "YES") field(VAL, "0.0264") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "BEND:DMPS:400:MPSBLLIM2") { field(DESC, "MPS Low Limit #2 B-field") field(EGU, "GeV/c") field(PREC, "7") field(DRVH, "15.7809") field(DRVL, "0.0264") field(PINI, "YES") field(VAL, "0.0264") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } # Set the default to Std record(mbbo, "BEND:DMPS:400: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, "BEND:DMPS:400:MPSLIMITS.E PP") } record(aSub, "BEND:DMPS:400: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, "BEND:DMPS:400:MPS.RVAL") field(INPB, "BEND:DMPS:400:BADIFF") field(INPC, "BEND:DMPS:400:BDELTAS.N") field(INPD, "BEND:DMPS:400:BACT") field(INPE, "BEND:DMPS:400:MPSBITMASK.RVAL") field(INPF, "BEND:DMPS:400:MPSBLLIM") field(INPG, "BEND:DMPS:400:MPSBMIN") field(INPH, "BEND:DMPS:400:MPSBMAX") field(INPI, "BEND:DMPS:400: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, "BEND:DMPS:400:INTOL.RVAL PP") field(OUTB, "BEND:DMPS:400:INTOL_BMIN.RVAL PP") field(OUTC, "BEND:DMPS:400:INTOL_BRANGE.RVAL PP") field(OUTD, "BEND:DMPS:400: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, "BEND:DMPS:400:INTOL") { field(DESC, "BACT within MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "BEND:DMPS:400:MPSLIMITS.VALA") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "BEND:DMPS:400:INTOL_BMIN") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "BEND:DMPS:400:MPSLIMITS.VALB") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "BEND:DMPS:400:INTOL_BMIN2") { field(DESC, "MPS tol #2") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "BEND:DMPS:400:MPSLIMITS.VALD") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "BEND:DMPS:400:INTOL_BRANGE") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "BEND:DMPS:400: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, "BEND:DMPS:400:CHCKITOL") { field(DESC, "Absolute Check I Tolerance") field(EGU, "A") field(FLNK, "BEND:DMPS:400:TRIMITOL") field(CALC, "ABS(A*B)") field(INPA, "BEND:DMPS:400:CHCKBTOL") field(INPB, "BEND:DMPS:400:POLYCOEF.B") field(PREC, "9") } record(calc, "BEND:DMPS:400:TRIMBTOL") { field(EGU, "GeV/c") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(DESC, "Absolute Trim Tolerance") field(CALC, "ABS(A)/2") field(INPA, "BEND:DMPS:400:CHCKBTOL") field(FLNK, "BEND:DMPS:400:CHCKITOL") } record(calc, "BEND:DMPS:400:CHCKBTOL") { field(DESC, "Check absolute tolerance") field(EGU, "A") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(FLNK, "BEND:DMPS:400:TRIMBTOL") field(CALC, "MAX(ABS(A),ABS(C))*(B/1000000)") field(INPA, "BEND:DMPS:400:BDES.HOPR") field(INPB, "BEND:DMPS:400:STABILITY") field(INPC, "BEND:DMPS:400:BDES.LOPR") } record(longout, "BEND:DMPS:400: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, "BEND:DMPS:400:CHCKBTOL") } record(calc, "BEND:DMPS:400:TRIMITOL") { field(DESC, "Absolute Trim I Tolerance") field(EGU, "GeV/c") field(CALC, "ABS(A*B)") field(INPA, "BEND:DMPS:400:POLYCOEF.B") field(INPB, "BEND:DMPS:400:TRIMBTOL") field(PREC, "9") } record(ai, "BEND:DMPS:400:TRIMBTOLR") { field(DESC, "Relative trim tol") field(PREC, "4") field(EGU, "%") field(HOPR, "1.0") field(LOPR, "0.0") field(PINI, "YES") } record(ai, "BEND:DMPS:400: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, "BEND:DMPS:400:FBCKFCOM") { field(ZNAM, "CA") field(ONAM, "FCOM") field(DESC, "CA Mode") field(PINI, "YES") field(SDIS, "0") } record(bo, "BEND:DMPS:400:PAU") { field(ZNAM, "NotConfigured") field(ONAM, "Configured") field(DESC, "PAU Present") field(PINI, "YES") field(SDIS, "0") field(FLNK, "BEND:DMPS:400:PAUGO") } record(fanout, "BEND:DMPS:400:PAUGO") { field(DESC, "PAU control") field(LNK1, "BEND:DMPS:400:PAUSTOP") field(LNK2, "BEND:DMPS:400: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, "BEND:DMPS:400:PAUSTART") { field(DESC, "Setup for PAU On") field(SDIS, "BEND:DMPS:400: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, "BEND:DMPS:400:PAUSTOP") { field(DESC, "Setup for PAU Off") field(SDIS, "BEND:DMPS:400: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, "BEND:DMPS:400:MCORDEVNAME") { field(DESC, "PS device name") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, "PSC:LTUS:MG04:") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "BEND:DMPS:400: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, "BEND:DMPS:400:PSTYPE.RVAL") field(INPC, "BEND:DMPS:400:TURNEDOFF.RVAL") field(INPD, "BEND:DMPS:400:CONFIG.RVAL") field(INPE, "BEND:DMPS:400:PSCATEGORY.RVAL") field(INPF, "BEND:DMPS:400:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "BEND:DMPS:400:AUTOCTRL.RVAL") field(INPJ, "BEND:DMPS:400:OUTOFSERVICE.RVAL") field(INPL, "BEND:DMPS:400:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "BEND:DMPS:400:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "BEND:DMPS:400:PAU") field(INPP, "BEND:DMPS:400:CALBDISABLE.RVAL") field(INPQ, "BEND:DMPS:400:PTRBDISABLE.RVAL") field(INPR, "BEND:DMPS:400:TRIMDISABLE.RVAL") field(INPS, "BEND:DMPS:400:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "BEND:DMPS:400:FBCK") field(INPU, "BEND:DMPS:400:TRIMTYPE.RVAL") field(INPV, "BEND:DMPS:400:STDZDIRECT.RVAL") field(INPW, "BEND:DMPS:400:DEGAUSENABLE.RVAL") field(FLNK, "BEND:DMPS:400:HSTA") } record(longin, "BEND:DMPS:400:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "BEND:DMPS:400:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "BEND:DMPS:400: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, "BEND:DMPS:400: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, "BEND:DMPS:400:CALBDISABLE") { field(DESC, "DAC Calb Disabled") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "BEND:DMPS:400:PTRBDISABLE") { field(DESC, "Perturb Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "BEND:DMPS:400:TRIMDISABLE") { field(DESC, "Trim Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "BEND:DMPS:400: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 BEND:DMPS:400:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses BEND:DMPS:400:FBCK. # This PV should be replaced by BEND:DMPS:400: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, "BEND:DMPS:400: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, "BEND:DMPS:400: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, "BEND:DMPS:400: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, "") field(OMSL, "supervisory") field(FLNK, "BEND:DMPS:400:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"BEND:DMPS:400:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "BEND:DMPS:400:OUTOFSERVICE NPP NMS") field(OUT, "BEND:DMPS:400:ONLINE PP") } record(bo, "BEND:DMPS:400:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "BEND:DMPS:400: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, "1") } record(bo, "BEND:DMPS:400: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, "1") } record(bo, "BEND:DMPS:400: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, "BEND:DMPS:400: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, "BEND:DMPS:400: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, "BEND:DMPS:400: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, "BEND:DMPS:400: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, "BEND:DMPS:400: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, "1") field(ASG, "NOWRITE") } record(mbbo, "BEND:DMPS:400: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, "1") field(ASG, "NOWRITE") } record(mbbo, "BEND:DMPS:400: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, "2") field(ASG, "NOWRITE") } record(mbbo, "BEND:DMPS:400: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, "0") field(ASG, "NOWRITE") field(FLNK, "BEND:DMPS:400:TRIMTYPE") } record(stringout, "BEND:DMPS:400:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "BEND:DMPS:400:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "BEND:DMPS:400:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "BEND:DMPS:400:STATE.RVAL") field(INPB, "BEND:DMPS:400:INTLKSUMY.RVAL") field(OUT, "BEND:DMPS:400:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "BEND:DMPS:400: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, "BEND:DMPS:400:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "BEND:DMPS:400:STATE.RVAL") field(INPB, "BEND:DMPS:400:INTLKSUMY.RVAL") field(OUT, "BEND:DMPS:400:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "BEND:DMPS:400:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "BEND:DMPS:400:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "BEND:DMPS:400: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, "BEND:DMPS:400:RAMPSTARTDLY") { field(DESC, "Tansition to ramp delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "2") } ######### For PSTYPE=2 Only ############# record(mbbo, "BEND:DMPS:400: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, "BEND:DMPS:400: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,"BEND:DMPS:400: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("BEND:DMPS:400:TURNEDOFF",3140,1907,0,1,"BEND:DMPS:400:TURNEDOFF") #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "BEND:DMPS:400:STATSUB") { field(DESC, "Build STATus ") field(INAM, "mgntInit") field(SNAM, "mgntSlcStat") field(INPA, "BEND:DMPS:400:BACT.STAT") field(INPB, "BEND:DMPS:400:BDES.STAT") field(INPC, "BEND:DMPS:400:IRIPL.STAT") field(INPD, "PSC:LTUS:MG04:ISETPT.STAT") field(INPE, "PSC:LTUS:MG04:IACT.STAT") # 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, "BEND:DMPS:400:BACT.SEVR") field(INPH, "BEND:DMPS:400:BDES.SEVR") field(INPI, "BEND:DMPS:400:IRIPL.SEVR") field(INPJ, "PSC:LTUS:MG04:ISETPT.SEVR") field(INPK, "PSC:LTUS:MG04:IACT.SEVR") # # 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, "BEND:DMPS:400:STATE.RVAL") field(INPN, "BEND:DMPS:400:STDZOK") field(INPO, "BEND:DMPS:400:CALBOK") field(INPP, "BEND:DMPS:400:OUTOFSERVICE.RVAL") field(INPQ, "BEND:DMPS:400:CONFIG.RVAL") field(INPR, "BEND:DMPS:400:HSTA") field(INPS, "BEND:DMPS:400:CTRL.RVAL") field(INPT, "BEND:DMPS:400:DEGAUSOK") field(INPV, "BEND:DMPS:400: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, "BEND:DMPS:400:STAT") } record(longout, "BEND:DMPS:400:STAT") { field(DESC, "STAT sent to SLC") field(SCAN, "Passive") field(FLNK, "BEND:DMPS:400:STATCTRLSUB") field(DOL, "BEND:DMPS:400:STATSUB.VAL") field(OMSL, "closed_loop") } record(sSub, "BEND:DMPS:400:STATCTRLSUB") { field(DESC, "Decode SLC STAT into mbbo") field(INAM, "mgntInit") field(SNAM, "mgntStatDecode") field(INPA, "BEND:DMPS:400:STAT") field(INPB, "BEND:DMPS:400:HSTA") field(INPD, "BEND:DMPS:400:ONOFFCTRL.RVAL") field(FLNK, "BEND:DMPS:400:STATMSG") } record(mbbo, "BEND:DMPS:400: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, "BEND:DMPS:400:UNAVAILGO") field(DOL, "BEND:DMPS:400:STATCTRLSUB.W") } record(seq, "BEND:DMPS:400:UNAVAILGO") { field(DESC, "Process UNAVAIL") field(DOL1, "BEND:DMPS:400:STATSUB.U") field(LNK1, "BEND:DMPS:400:UNAVAIL PP") } record(stringout, "BEND:DMPS:400:SNLSTATMSG") { field(DTYP, "Soft Channel") } #! TextBox(TB0,820,1000,1200,1220,0,"Dialog",12,1,16777215,"BEND:DMPS:400:STATUSSUB - future\nOverall device status - takes input from action snls, record sevrs, master snl(s) and outputs final status\n\nInputs:\nA - BEND:DMPS:400:CTRLSTATUS - snl status\nB - MGNT:CTRLSTATUS - master list status\nC\nD - BEND:DMPS:400: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,"BEND:DMPS:400STATSUB\nformat control bo's into slc STAT\n\nInputs:\nA - BEND:DMPS:400:STATUS\nC - BEND:DMPS:400:ON\nD - BEND:DMPS:400:STDZOK\nE - BEND:DMPS:400:CALBOK\nF - BEND:DMPS:400:BACTDRIFT (future)\nG -\nH- BEND:DMPS:400:DACSTATUS\nI -BEND:DMPS:400:ADCSTATUS\nJ - BEND:DMPS:400:BACTSTATUS\nK - BEND:DMPS:400:BDESSTATUS\nL - BEND:DMPS:400:RIPLSTATUS\n\nOutput:\nP - BEND:DMPS:400: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, "BEND:DMPS:400: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, "BEND:DMPS:400: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, "BEND:DMPS:400: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, "BEND:DMPS:400: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.6 #! DBDSTART #! DBD("../../../../dbd/mgntSoft.dbd") #! DBDEND record(stringout, "BEND:DMPS:400:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "BEND:DMPS:400:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "BEND:DMPS:400:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "BEND:DMPS:400:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "BEND:DMPS:400:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "BEND:DMPS:400:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "1") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "BEND:DMPS:400: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, "BEND:DMPS:400:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "BEND:DMPS:400:TRIMTYPE.RVAL") field(INPB, "BEND:DMPS:400:CONFIG.RVAL") field(OUT, "BEND:DMPS:400:TRIMMAXNUM PP") } record(longout, "BEND:DMPS:400: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, "BEND:DMPS:400: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, "") field(OMSL, "supervisory") field(VAL, "5") field(OUT, "BEND:DMPS:400:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "BEND:DMPS:400: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, "") field(OMSL, "supervisory") field(VAL, "10") } record(bo, "BEND:DMPS:400: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, "BEND:DMPS:400: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, "BEND:DMPS:400: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, "BEND:DMPS:400:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "0") } record(ao, "BEND:DMPS:400: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, "BEND:DMPS:400:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "BEND:DMPS:400: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, "BEND:DMPS:400: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, "BEND:DMPS:400:IMOVE") field(INPB, "BEND:DMPS:400:IACT") field(INPC, "BEND:DMPS:400:IRAMPRATE") field(INPD, "1.577") field(INPE, "BEND:DMPS:400:TRIMDLYPCT") field(INPF, "BEND:DMPS:400:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "BEND:DMPS:400:RAMPTIME_LEFT PP") } record(longout, "BEND:DMPS:400:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "BEND:DMPS:400:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "BEND:DMPS:400:RAMPDONE_CALC") } record(calc, "BEND:DMPS:400:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "BEND:DMPS:400:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "BEND:DMPS:400:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "BEND:DMPS:400: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, "BEND:DMPS:400:RAMPTIME_LEFT") field(OUT, "BEND:DMPS:400:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "BEND:DMPS:400:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "BEND:DMPS:400:RAMPTIME_LEFT NMS") field(OUT, "BEND:DMPS:400:RAMPDONE PP") } record(bo, "BEND:DMPS:400:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "BEND:DMPS:400:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "BEND:DMPS:400: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, "BEND:DMPS:400: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(sSub, "BEND:DMPS:400: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, "BEND:DMPS:400:PSTYPE.RVAL") field(INPC, "BEND:DMPS:400:TURNEDOFF.RVAL") field(INPD, "BEND:DMPS:400:CONFIG.RVAL") field(INPE, "BEND:DMPS:400:PSCATEGORY.RVAL") field(INPF, "BEND:DMPS:400:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "BEND:DMPS:400:AUTOCTRL.RVAL") field(INPJ, "BEND:DMPS:400:OUTOFSERVICE.RVAL") field(INPL, "BEND:DMPS:400:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "BEND:DMPS:400:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "BEND:DMPS:400:PAU") field(INPP, "BEND:DMPS:400:CALBDISABLE.RVAL") field(INPQ, "BEND:DMPS:400:PTRBDISABLE.RVAL") field(INPR, "BEND:DMPS:400:TRIMDISABLE.RVAL") field(INPS, "BEND:DMPS:400:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "BEND:DMPS:400:FBCK") field(INPU, "BEND:DMPS:400:TRIMTYPE.RVAL") field(INPV, "BEND:DMPS:400:STDZDIRECT.RVAL") field(INPW, "BEND:DMPS:400:DEGAUSENABLE.RVAL") field(FLNK, "BEND:DMPS:400:HSTA") } record(longin, "BEND:DMPS:400:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "BEND:DMPS:400:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "BEND:DMPS:400: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, "BEND:DMPS:400: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, "BEND:DMPS:400:CALBDISABLE") { field(DESC, "DAC Calb Disabled") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "BEND:DMPS:400:PTRBDISABLE") { field(DESC, "Perturb Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "BEND:DMPS:400:TRIMDISABLE") { field(DESC, "Trim Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "BEND:DMPS:400:STDZDISABLE") { field(DTYP, "Raw Soft Channel") field(ZNAM, "NO") field(ONAM, "YES") field(DESC, "Standardize Function") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } # This PV has been replaced by BEND:DMPS:400:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses BEND:DMPS:400:FBCK. # This PV should be replaced by BEND:DMPS:400: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, "BEND:DMPS:400: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, "BEND:DMPS:400: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, "BEND:DMPS:400: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, "") field(OMSL, "supervisory") field(FLNK, "BEND:DMPS:400:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"BEND:DMPS:400:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "BEND:DMPS:400:OUTOFSERVICE NPP NMS") field(OUT, "BEND:DMPS:400:ONLINE PP") } record(bo, "BEND:DMPS:400:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "BEND:DMPS:400: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, "1") } record(bo, "BEND:DMPS:400: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, "1") } record(bo, "BEND:DMPS:400: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, "BEND:DMPS:400: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, "BEND:DMPS:400: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, "BEND:DMPS:400: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, "BEND:DMPS:400: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, "BEND:DMPS:400: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, "1") field(ASG, "NOWRITE") } record(mbbo, "BEND:DMPS:400: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, "1") field(ASG, "NOWRITE") } record(mbbo, "BEND:DMPS:400: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, "2") field(ASG, "NOWRITE") } record(mbbo, "BEND:DMPS:400: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, "2") field(ASG, "NOWRITE") field(FLNK, "BEND:DMPS:400:TRIMTYPE") } record(stringout, "BEND:DMPS:400:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "BEND:DMPS:400:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "BEND:DMPS:400:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "BEND:DMPS:400:STATE.RVAL") field(INPB, "BEND:DMPS:400:INTLKSUMY.RVAL") field(OUT, "BEND:DMPS:400:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "BEND:DMPS:400: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, "BEND:DMPS:400:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "BEND:DMPS:400:STATE.RVAL") field(INPB, "BEND:DMPS:400:INTLKSUMY.RVAL") field(OUT, "BEND:DMPS:400:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "BEND:DMPS:400:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "BEND:DMPS:400:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "BEND:DMPS:400: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, "BEND:DMPS:400:RAMPSTARTDLY") { field(DESC, "Tansition to ramp delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "2") } ######### For PSTYPE=2 Only ############# record(mbbo, "BEND:DMPS:400: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, "BEND:DMPS:400: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,"BEND:DMPS:400: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("BEND:DMPS:400:TURNEDOFF",3140,1907,0,1,"BEND:DMPS:400:TURNEDOFF") #! 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, "QUAD:DMPS:500:IACT") { field(DESC, "Current") field(INP, "PSC:DMPS:MG01:IACT") field(EGU, "A") field(HOPR, "150.0") field(LOPR, "0.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "QUAD:DMPS:500:BACT") info(autosaveFields,"HYST") } record(bi, "QUAD:DMPS:500:STATE") { field(DESC, "PS On/Off Status") field(DTYP, "Raw Soft Channel") field(INP, "PSC:DMPS:MG01:STATE NPP MS") field(ZSV, "MAJOR") field(ZNAM, "OFF") field(ONAM, "ON") } record(ao, "QUAD:DMPS:500:IDES") { field(DESC, "Desired Current") field(PREC, "3") field(EGU, "A") field(HOPR, "150.0") field(LOPR, "0.0") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(MDEL, "-1") field(HIHI, "150.0") field(LOLO, "0.0") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "QUAD:DMPS:500:BDELTAS") field(DRVH, "150.0") field(DRVL, "0.0") field(DOL, "QUAD:DMPS:500: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, "QUAD:DMPS:500:ICTRL PP") } # This record is processed by QUAD:DMPS:500:ICON") # Note: we are not setting alarms here. record(ao, "QUAD:DMPS:500:ICON") { field(DESC, "Config I") field(DTYP, "Soft Channel") field(PREC, "3") field(HOPR, "150.0") field(LOPR, "0.0") field(DRVH, "150.0") field(DRVL, "0.0") field(DOL, "QUAD:DMPS:500:B2ICON.K") field(OMSL, "closed_loop") info(autosaveFields,"VAL") } record(ao, "QUAD:DMPS:500:INOM") { field(DESC, "Nominal Current") field(DOL, "QUAD:DMPS:500:BNOM.K") field(OMSL, "closed_loop") field(PREC, "3") field(EGU, "A") field(DRVH, "150.0") field(DRVL, "0.0") field(HOPR, "150.0") field(LOPR, "0.0") } record(ao, "QUAD:DMPS:500:ICTRL") { field(DESC, "Set Current") field(PREC, "3") field(EGU, "A") field(HOPR, "150.0") field(LOPR, "0.0") field(DRVH, "150.0") field(DRVL, "0.0") field(MDEL, "-1") field(FLNK, "QUAD:DMPS:500:ICTRLGO") field(OMSL, "supervisory") info(autosavefields,"VAL") } record(seq, "QUAD:DMPS:500:ICTRLGO") { field(DESC, "Process Current Setpoint") field(PREC, "3") # Set ISETPT to supervisory field(DOL1, "0") field(LNK1, "QUAD:DMPS:500:ISETPT.OMSL") field(DOL2, "QUAD:DMPS:500:ICTRL") field(LNK2, "QUAD:DMPS:500:ISETPT PP") # Set ISETPT to closed loop - get data from BCTRLSUB.K field(DOL3, "1") field(LNK3, "QUAD:DMPS:500:ISETPT.OMSL") } record(ao, "QUAD:DMPS:500:IMAX") { field(DESC, "Max I") field(DTYP, "Soft Channel") field(DRVH, "150.0") field(DRVL, "0.0") field(EGU, "A") field(HOPR, "150.0") field(LOPR, "0.0") field(PREC, "3") field(PINI, "YES") field(VAL, "150.0") field(FLNK, "QUAD:DMPS:500:IMIN") } record(ao, "QUAD:DMPS:500:IMIN") { field(DESC, "Min I") field(DTYP, "Soft Channel") field(DRVH, "150.0") field(DRVL, "0.0") field(EGU, "A") field(HOPR, "150.0") field(LOPR, "0.0") field(PREC, "3") field(VAL, "0.0") field(FLNK, "QUAD:DMPS:500:IRANGE") } record(sel, "QUAD:DMPS:500:IACTPREVOK") { field(DESC, "Last Good Current") field(EGU, "A") field(HOPR, "150.0") field(LOPR, "0.0") field(PREC, "3") field(NVL, "QUAD:DMPS:500:BACT.SEVR") field(INPA, "QUAD:DMPS:500:IACT NPP MS") field(INPB, "QUAD:DMPS:500:IACTPREVOK NPP MS") field(INPC, "QUAD:DMPS:500:IACTPREVOK NPP MS") field(INPD, "QUAD:DMPS:500:IACTPREVOK NPP MS") } record(sub, "QUAD:DMPS:500:IACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:DMPS:500:IDES") field(INPB, "QUAD:DMPS:500:ISETPT.DRVH") field(INPC, "QUAD:DMPS:500:ISETPT.DRVL") field(INPD, "QUAD:DMPS:500:IDELTAS.I") field(INPE, "QUAD:DMPS:500:IDELTAS.J") field(INPG, "QUAD:DMPS:500:STATE") field(INPH, "QUAD:DMPS:500:HSTA") field(EGU, "A") field(HOPR, "150.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(sub, "QUAD:DMPS:500:IMONLIMITS") { field(DESC, "Aux Current Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:DMPS:500:IDES") field(INPB, "QUAD:DMPS:500:ISETPT.DRVH") field(INPC, "QUAD:DMPS:500:ISETPT.DRVL") field(INPD, "QUAD:DMPS:500:IDELTAS.K") field(INPE, "QUAD:DMPS:500:IDELTAS.L") field(INPG, "QUAD:DMPS:500:STATE") field(INPH, "QUAD:DMPS:500:HSTA") field(EGU, "A") field(HOPR, "150.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(seq, "QUAD:DMPS:500:ILIMITS") { field(DESC, "Set ACT and MON Limits") field(PREC, "3") field(DOL1, "QUAD:DMPS:500:BLIMITS") field(LNK1, "QUAD:DMPS:500:IACTLIMITS.F PP") field(DOL2, "QUAD:DMPS:500:IACTLIMITS.I") field(LNK2, "QUAD:DMPS:500:IACT.HIGH") field(DOL3, "QUAD:DMPS:500:IACTLIMITS.J") field(LNK3, "QUAD:DMPS:500:IACT.LOW") field(DOL4, "QUAD:DMPS:500:IACTLIMITS.K") field(LNK4, "QUAD:DMPS:500:IACT.HIHI") field(DOL5, "QUAD:DMPS:500:IACTLIMITS.L") field(LNK5, "QUAD:DMPS:500:IACT.LOLO") field(DOL6, "QUAD:DMPS:500:BLIMITS") field(LNK6, "QUAD:DMPS:500:IMONLIMITS.F PP") field(DOL7, "QUAD:DMPS:500:IMONLIMITS.I") field(LNK7, "QUAD:DMPS:500:IMON.HIGH") field(DOL8, "QUAD:DMPS:500:IMONLIMITS.J") field(LNK8, "QUAD:DMPS:500:IMON.LOW") field(DOL9, "QUAD:DMPS:500:IMONLIMITS.K") field(LNK9, "QUAD:DMPS:500:IMON.HIHI") field(DOLA, "QUAD:DMPS:500:IMONLIMITS.L") field(LNKA, "QUAD:DMPS:500: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, "QUAD:DMPS:500:IDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntRawDeltas") field(INPD, "QUAD:DMPS:500:TRIMBTOL") field(INPE, "QUAD:DMPS:500:CHCKBTOL") field(INPF, "QUAD:DMPS:500:BDELTAS.K") field(INPG, "QUAD:DMPS:500:BDELTAS.L") field(INPH, "QUAD:DMPS:500: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, "QUAD:DMPS:500:STDZITOLR") field(INPC, "QUAD:DMPS:500:STDZITOL") field(FLNK, "") } # All ps controllers with on/off control will set the macro ONOF # as follows: # # ONOF = PSC:DMPS:MG01: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, "QUAD:DMPS:500:STATESETPT") { field(DESC, "PS On/Off") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFF") field(ONAM, "ON") field(OUT, "PSC:DMPS:MG01:STATESETPT PP") 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 = PSC:DMPS:MG01:RESET PP # record(bo, "QUAD:DMPS:500:RESET") { field(DESC, "Interlock Latch Reset") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFF") field(ONAM, "ON") field(HIGH, "1.0") field(OUT, "PSC:DMPS:MG01:RESET PP") } record(bo, "QUAD:DMPS:500:RAMPSTATE") { field(DESC, "PS Ramp Status") field(DTYP, "Soft Channel") field(DOL, "PSC:DMPS:MG01:RAMPSTATE NPP 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, "QUAD:DMPS:500: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, "QUAD:DMPS:500:TRIMRAMPRATE") field(OUT, "PSC:DMPS:MG01:IRAMPRATE PP") field(FLNK, "QUAD:DMPS:500:STDZDLY") } record(ao, "QUAD:DMPS:500:ISETPT") { field(DESC, "Current Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(EGU, "A") field(HOPR, "150.0") field(LOPR, "0.0") field(DRVH, "150.0") field(DRVL, "0.0") field(MDEL, "-1") field(OUT, "PSC:DMPS:MG01:ISETPT PP") field(DOL, "QUAD:DMPS:500: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, "QUAD:DMPS:500:IMON") { field(DESC, "Aux Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(INP, "PSC:DMPS:MG01:IMON") field(EGU, "A") field(HOPR, "150.0") field(LOPR, "0.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "QUAD:DMPS:500:BMON") } record(ao, "QUAD:DMPS:500:IRIPL") { field(DESC, "Ripple Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(DOL, "PSC:DMPS:MG01:IRIPL NPP NMS") field(OMSL, "closed_loop") field(EGU, "A") field(DRVH, "1.0") field(HOPR, "1.0") field(PREC, "3") field(FLNK, "QUAD:DMPS:500:IRIPLOK") } record(sub, "QUAD:DMPS:500:IRIPLOK") { field(DESC, "Ripple Current Status") field(INAM, "mgntInit") field(SNAM, "mgntRiplOK") field(INPA, "QUAD:DMPS:500:IRIPL.VAL") field(INPB, "QUAD:DMPS:500: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, "QUAD:DMPS:500:R") { field(DESC, "Resistance") field(EGU, "Ohms") field(PREC, "4") field(PINI, "YES") field(DOL, "PSC:DMPS:MG01:R NPP MS") 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, "QUAD:DMPS:500:IGND") { field(DESC, "Ground Current") field(EGU, "A") field(PREC, "6") field(PINI, "YES") field(DOL, "PSC:DMPS:MG01:IGND NPP MS") field(OMSL, "closed_loop") } record(bi, "QUAD:DMPS:500:INTLKSUMY") { field(DESC, "Interlock Summary") field(INP, "PSC:DMPS:MG01:INTLKSUMY NPP MS") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(ZNAM, "OK") field(ONAM, "FAULT") field(PINI, "NO") } record(mbbo, "QUAD:DMPS:500: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, "PSC:DMPS:MG01:COOLING") field(OMSL, "closed_loop") } # The following PV is processed by :BACTFO # which is processed by :BACT record(fanout, "QUAD:DMPS:500:IACTFO") { field(DESC, "IACT processing") field(SELM, "All") field(LNK1, "QUAD:DMPS:500:IACTPREVOK") field(LNK2, "QUAD:DMPS:500:IDIFF") field(LNK3, "QUAD:DMPS:500:IADIFF") field(LNK4, "QUAD:DMPS:500:IRATIO") field(LNK5, "QUAD:DMPS:500:IDIRECT") field(LNK6, "QUAD:DMPS:500:IACTPOL_CHECK") } record(calc, "QUAD:DMPS:500:IDIFF") { field(DESC, "IDES-IACT") field(CALC, "A-B") field(INPA, "QUAD:DMPS:500:IDES") field(INPB, "QUAD:DMPS:500:IACT") field(EGU, "A") field(PREC, "9") field(HOPR, "150.0") field(LOPR, "0.0") } record(calc, "QUAD:DMPS:500:IADIFF") { field(DESC, "Absolute IDES-IACT") field(CALC, "A<0?ABS(A):A") field(INPA, "QUAD:DMPS:500:IDIFF") field(PREC, "9") } record(calc, "QUAD:DMPS:500:IRATIO") { field(DESC, "IDES-IACT/IMAX") field(CALC, "B?A/B:0") field(INPA, "QUAD:DMPS:500:IDIFF") field(INPB, "QUAD:DMPS:500:IDES.DRVH") field(PREC, "9") } record(calcout, "QUAD:DMPS:500:IRANGE") { field(DESC, "Current Range") field(PINI, "YES") field(CALC, "ABS(A-B)") field(INPA, "QUAD:DMPS:500:IMIN") field(INPB, "QUAD:DMPS:500: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, "QUAD:DMPS:500: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, "QUAD:DMPS:500:IACT") field(FLNK, "QUAD:DMPS:500:IACTPOL") } record(bo, "QUAD:DMPS:500:IACTPOL") { field(DESC, "Actual I Polarity") field(DTYP, "Raw Soft Channel") field(DOL, "QUAD:DMPS:500: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,"QUAD:DMPS:500:I*LIMITS:\n Calculate alarm and warning limits based on \n deltas from QUAD:DMPS:500:IDELTAS and the\n QUAD:DMPS:500: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,"QUAD:DMPS:500:IACT: \n Get copy of QUAD:DMPS:500:I. \n",null) #! TextBox(TB12,1280,3100,1760,3200,0,"Dialog",12,1,16777215,"QUAD:DMPS:500: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,"QUAD:DMPS:500:IDES:\n Contains raw value calculated by \nQUAD:DMPS:500: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 \nQUAD:DMPS:500:BDELTAS.\n",null) #! TextBox(TB10,56,1940,316,2340,0,"Dialog",12,1,16777215,"QUAD:DMPS:500: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 QUAD:DMPS:500: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 QUAD:DMPS:500: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,"QUAD:DMPS:500:ISETPT:\n Sets the hardware. When fast feedback is set on, this record is\n set to closed loop mode by QUAD:DMPS:500:FBCKSTART sequence. When \n the loop is closed, this record takes input calculated by \n BFBCK only. When fast feedback is set off, QUAD:DMPS:500:FBCKSTOP \n will set it back to supervisory so that the value can be set by \n QUAD:DMPS:500: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, "QUAD:DMPS:500:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "QUAD:DMPS:500:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "QUAD:DMPS:500:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "QUAD:DMPS:500:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "QUAD:DMPS:500:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "QUAD:DMPS:500:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "1") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "QUAD:DMPS:500: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, "QUAD:DMPS:500:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "QUAD:DMPS:500:TRIMTYPE.RVAL") field(INPB, "QUAD:DMPS:500:CONFIG.RVAL") field(OUT, "QUAD:DMPS:500:TRIMMAXNUM PP") } record(longout, "QUAD:DMPS:500: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, "QUAD:DMPS:500: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, "") field(OMSL, "supervisory") field(VAL, "10") field(OUT, "QUAD:DMPS:500:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "QUAD:DMPS:500: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, "") field(OMSL, "supervisory") field(VAL, "10") } record(bo, "QUAD:DMPS:500: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, "QUAD:DMPS:500: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, "QUAD:DMPS:500: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, "QUAD:DMPS:500:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "0") } record(ao, "QUAD:DMPS:500: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, "QUAD:DMPS:500:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "QUAD:DMPS:500: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, "QUAD:DMPS:500: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, "QUAD:DMPS:500:IMOVE") field(INPB, "QUAD:DMPS:500:IACT") field(INPC, "QUAD:DMPS:500:IRAMPRATE") field(INPD, "1.577") field(INPE, "QUAD:DMPS:500:TRIMDLYPCT") field(INPF, "QUAD:DMPS:500:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "QUAD:DMPS:500:RAMPTIME_LEFT PP") } record(longout, "QUAD:DMPS:500:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "QUAD:DMPS:500:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "QUAD:DMPS:500:RAMPDONE_CALC") } record(calc, "QUAD:DMPS:500:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "QUAD:DMPS:500:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "QUAD:DMPS:500:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "QUAD:DMPS:500: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, "QUAD:DMPS:500:RAMPTIME_LEFT") field(OUT, "QUAD:DMPS:500:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "QUAD:DMPS:500:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "QUAD:DMPS:500:RAMPTIME_LEFT NMS") field(OUT, "QUAD:DMPS:500:RAMPDONE PP") } record(bo, "QUAD:DMPS:500:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "QUAD:DMPS:500:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "QUAD:DMPS:500: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, "QUAD:DMPS:500: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, "QUAD:DMPS:500:STDZINIT") { field(DESC, "Proc. Stdz PVs on boot") field(PINI, "YES") field(DOL1, "1") field(DOL2, "1") field(DOL3, "1") field(LNK1, "QUAD:DMPS:500:DEBUG.PROC PP") field(LNK2, "QUAD:DMPS:500:STDZCYCLENUM.PROC PP") field(LNK3, "QUAD:DMPS:500:STDZDISABLE.PROC PP") field(LNK4, "QUAD:DMPS:500: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, "QUAD:DMPS:500:STDZSUB") { field(DESC, "Stdz subroutine") field(INAM, "mgntStdzInit") field(SNAM, "mgntStdz") field(BRSV, "INVALID") field(INPA, "QUAD:DMPS:500:STDZIMIN NPP NMS") field(INPB, "QUAD:DMPS:500:STDZIMAX NPP NMS") field(INPC, "QUAD:DMPS:500:STDZIFINAL NPP NMS") field(INPD, "QUAD:DMPS:500:STDZCYCLENUM NPP NMS") field(INPE, "QUAD:DMPS:500:STDZDIRECT.RVAL NPP NMS") field(INPF, "QUAD:DMPS:500:STDZDISABLE.RVAL CPP NMS") field(INPG, "QUAD:DMPS:500: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, "QUAD:DMPS:500:STDZWF PP") field(OUTB, "QUAD:DMPS:500: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, "QUAD:DMPS:500:STDZWF") } record(mbbo, "QUAD:DMPS:500: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, "QUAD:DMPS:500: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, "QUAD:DMPS:500:STDZMAINPS") { field(DESC, "Stdz by main or self") field(PINI, "YES") field(DTYP, "Soft Channel") field(ZNAM, "SELF") field(ONAM, "MAIN") } record(bo, "QUAD:DMPS:500: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, "QUAD:DMPS:500: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, "QUAD:DMPS:500: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, "QUAD:DMPS:500:STDZTOD") { field(DESC, "Successful Standardize Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "QUAD:DMPS:500:STDZLOSTTOD") { field(DESC, "Standardize Lost Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(longout, "QUAD:DMPS:500:STDZCYCLECNT") { field(DESC, "Cycle Count") field(PINI, "YES") } record(longout, "QUAD:DMPS:500:STDZCYCLENUM") { field(DESC, "No. Standardize Cycles") field(VAL, "3") field(HOPR, "10") field(LOPR, "0") field(DRVH, "10") field(DRVL, "0") field(PINI, "YES") field(FLNK, "QUAD:DMPS:500:STDZDIRECT") } # The default standardize direction is "UP" for # all LCLS Magnets.. record(bo, "QUAD:DMPS:500:STDZDIRECT") { field(DESC, "Standardize Direction ") field(ZNAM, "UP") field(ONAM, "DOWN") field(VAL, "0") field(FLNK, "QUAD:DMPS:500:STDZIMIN") } record(ao, "QUAD:DMPS:500:STDZIMIN") { field(DESC, "Min-STDZ Current") field(PREC, "1") field(EGU, "A") field(HOPR, "150.0") field(LOPR, "0.0") field(VAL, "0.0") field(FLNK, "QUAD:DMPS:500:STDZIMAX") } record(ao, "QUAD:DMPS:500:STDZIMAX") { field(DESC, "Max. Standarize Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "150.0") field(LOPR, "0.0") field(VAL, "150.0") field(FLNK, "QUAD:DMPS:500:STDZIFINAL") } record(ao, "QUAD:DMPS:500:STDZIFINAL") { field(DESC, "Final SDTZ Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "150.0") field(LOPR, "0.0") field(VAL, "0.0") field(FLNK, "QUAD:DMPS:500: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, "QUAD:DMPS:500: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, "QUAD:DMPS:500:STDZITOL") { field(DESC, "Stdz min tolerance") field(PREC, "5") field(CALC, "MAX(ABS(A),ABS(B))*C") field(INPA, "QUAD:DMPS:500:STDZIMIN CP NMS") field(INPB, "QUAD:DMPS:500:STDZIMAX CP MMS") field(INPC, "0.05") field(INPD, "QUAD:DMPS:500:STDZITOLR CP MMS") field(EGU, "A") field(FLNK, "QUAD:DMPS:500:IDELTAS") field(PINI, "YES") } # D - factor (3.154/2 = 1.577) for EPSC, otherwise, set to 1.0 record(calc, "QUAD:DMPS:500:STDZDLY") { field(DESC, "Ramp time for stdz cycle") field(CALC, "C>0?MAX(1,ABS((A-B)/C)*D):0") field(INPA, "QUAD:DMPS:500:STDZIMIN CP NMS") field(INPB, "QUAD:DMPS:500:STDZIMAX CP NMS") field(INPC, "QUAD:DMPS:500:TRIMRAMPRATE CP NMS") field(INPD, "1.577") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") } record(calc, "QUAD:DMPS:500:STDZRAMPDLY") { field(DESC, "Ramp delay total") field(CALC, "MAX(1,((A/100)*B+B))") field(PREC, "5") field(INPA, "QUAD:DMPS:500:TRIMDLYPCT CP MS") field(INPB, "QUAD:DMPS:500: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, "QUAD:DMPS:500:STDZMINIDLY") { field(DESC, "Mini-stdz delay") field(CALC, "A") field(PREC, "5") field(A, "1.0") field(EGU, "sec") field(PINI, "YES") } record(ao, "QUAD:DMPS:500: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, "QUAD:DMPS:500:STDZMINIDELTA") { field(DESC, "Stdz mini % of IMAX") field(CALC, "(B/100)*(A-C)") field(INPA, "QUAD:DMPS:500:IDES.HOPR") field(INPB, "QUAD:DMPS:500:STDZMINIPCT CPP NMS") field(INPC, "QUAD:DMPS:500:IDES.LOPR") field(PREC, "5") } record(calc, "QUAD:DMPS:500:STDZMINISETPT") { field(DESC, "Mini Stdz delta") field(CALC, "C==0?MAX(E-D,B):MIN(E+D,A)") field(INPA, "QUAD:DMPS:500:IDES.HOPR") field(INPB, "QUAD:DMPS:500:IDES.LOPR") field(INPC, "QUAD:DMPS:500:STDZDIRECT.RVAL") field(INPD, "QUAD:DMPS:500:STDZMINIDELTA") field(INPE, "QUAD:DMPS:500:IDES") field(PREC, "5") field(FLNK, "QUAD:DMPS:500: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, "QUAD:DMPS:500:STDZMINISETPTOOR") { field(DESC, "Mini Stdz setpoint out of range") field(CALC, "C==0?(E-DA)") field(INPA, "QUAD:DMPS:500:IDES.HOPR") field(INPB, "QUAD:DMPS:500:IDES.LOPR") field(INPC, "QUAD:DMPS:500:STDZDIRECT.RVAL") field(INPD, "QUAD:DMPS:500:STDZMINIDELTA") field(INPE, "QUAD:DMPS:500: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, "QUAD:DMPS:500: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, "QUAD:DMPS:500:IADJUST.RVAL") field(INPB, "QUAD:DMPS:500:STDZDIRECT.RVAL") field(INPC, "QUAD:DMPS:500:STDZOK.RVAL") field(INPD, "QUAD:DMPS:500:STDZDISABLE.RVAL") field(INPE, "QUAD:DMPS:500:STATE.RVAL CPP NMS") field(INPF, "QUAD:DMPS:500:ICTRL.RVAL") field(INPG, "QUAD:DMPS:500:STATE.SEVR") field(INPH, "QUAD:DMPS:500:BDELTAS.M") field(INPI, "QUAD:DMPS:500:IACT.SEVR") field(OUT, "QUAD:DMPS:500:STDZLOSTGO.SELN PP NMS") field(OOPT, "Transition To Non-zero") } record(seq, "QUAD:DMPS:500:STDZLOSTGO") { field(DESC, "Process lost stdz") field(SELM, "Mask") field(DOL1, "1") field(DOL2, "0") field(LNK1, "QUAD:DMPS:500:STDZLOSTTOD.PROC") field(LNK2, "QUAD:DMPS:500:STDZOK PP") } # Record maximum current after standardize # Reset to IACT from sequence after trim # Disable processing during (mini-)standardize or trim record(calc, "QUAD:DMPS:500:STDZIACTMAX") { field(DESC, "Max act current after stdz") field(CALC, "MAX(A, B)") field(DISV, "0") field(SDIS, "QUAD:DMPS:500:CHECKPWRDIP_ENABLE") field(INPA, "QUAD:DMPS:500:IACT CP") field(INPB, "QUAD:DMPS:500:STDZIACTMAX") field(EGU, "A") field(FLNK, "QUAD:DMPS:500:CHECKPWRDIP") } # Detect power dip if STDZOK is YES, STDZ is enabled, and IACT is valid # If IACT drops below STDZIACTMAX by more than the trim tolerance, clear STDZOK # Warning: Take the absolute value of the trim tolerance, or else quads of # negative polarity will always lose STDZ since their IDELTAS.I are negative. # Note: Large quads and bends are prone to losing STDZ even if they are # perturbed toward higher current since their current tends to overshoot # by greater than the trim tolerance before settling down. record(calcout, "QUAD:DMPS:500:CHECKPWRDIP") { field(DESC, "Detect power dip") field(CALC, "(A-B>ABS(C))?3:0") field(DISV, "0") field(SDIS, "QUAD:DMPS:500:CHECKPWRDIP_ENABLE") field(INPA, "QUAD:DMPS:500:STDZIACTMAX") field(INPB, "QUAD:DMPS:500:IACT") field(INPC, "QUAD:DMPS:500:IDELTAS.I") field(OUT, "QUAD:DMPS:500:STDZLOSTGO.SELN PP NMS") field(OOPT, "When Non-zero") } # Enable processing of STDZIACTMAX and CHECKPWRDIP only if # STDZOK = YES, STDZDISABLE = NO, CTRL != Trim (2), and # CTRL != Stdz (4) record(calc, "QUAD:DMPS:500:CHECKPWRDIP_ENABLE") { field(CALC, "A&&!B&&(C#2)&&(C#4)") field(INPA, "QUAD:DMPS:500:STDZOK.RVAL CP") field(INPB, "QUAD:DMPS:500:STDZDISABLE.RVAL CP") field(INPC, "QUAD:DMPS:500:CTRL.RVAL CP") } #! 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, "QUAD:DMPS:500: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, "QUAD:DMPS:500:CALBOK") { field(DESC, "Successful Calibration") field(DTYP, "Raw Soft Channel") field(ZNAM, "NO") field(ONAM, "YES") field(DOL, "PSC:DMPS:MG01:CALBOK.RVAL") field(OMSL, "closed_loop") 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, "QUAD:DMPS:500:CALBSET") { field(DESC, "Use DAC Calbration") field(SCAN, "10 second") field(CALC, "A&&(B==0)&&C?31:960") field(INPA, "QUAD:DMPS:500:CALBOK") field(INPB, "QUAD:DMPS:500:CALBDISABLE") field(INPC, "QUAD:DMPS:500:CALBSLOPE") field(OOPT, "On Change") field(OUT, "QUAD:DMPS:500: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, "QUAD:DMPS:500:CALB_SEQ") { field(DESC, "Output Calib Values") field(SELM, "Mask") field(SELL, "QUAD:DMPS:500: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, "QUAD:DMPS:500:CALBSLOPE") field(DOL3, "QUAD:DMPS:500: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, "QUAD:DMPS:500:CALBTOD") { field(DESC, "Calibration Success Time") field(PINI, "YES") field(DOL, "PSC:DMPS:MG01:CALBTOD") field(OMSL, "closed_loop") field(DTYP, "Soft Channel") info(autosaveFields,"VAL") } record(ao, "QUAD:DMPS:500: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, "QUAD:DMPS:500: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, "QUAD:DMPS:500: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, "QUAD:DMPS:500:CALBOFFSET") { field(DESC, "Calc DAC Offset") field(PREC, "6") field(EGU, "Counts") field(PINI, "YES") } record(bo, "QUAD:DMPS:500: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, "QUAD:DMPS:500:DACSLOPE") { field(DESC, "V to DAC slope") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "closed_loop") field(PINI, "YES") field(FLNK, "QUAD:DMPS:500:DACOFFSET") } # Default Offset used in conversion from Volts to DAC Counts record(ao, "QUAD:DMPS:500:DACOFFSET") { field(DESC, "V to DAC offset") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "closed_loop") field(PINI, "YES") field(FLNK, "QUAD:DMPS:500: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, "QUAD:DMPS:500: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, "QUAD:DMPS:500:IACT") field(INPD, "QUAD:DMPS:500:DACSLOPE") field(INPE, "QUAD:DMPS:500:DACOFFSET") field(EGU, "Counts") field(PREC, "6") } record(ao, "QUAD:DMPS:500:DAC") { field(DESC, "DAC Set point") field(EGU, "Counts") field(DOL, "") field(OMSL, "closed_loop") field(PREC, "6") field(PINI, "YES") } record(ao, "QUAD:DMPS:500:CALBIMIN") { field(DESC, "Calibration Min Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(DRVH, "150.0") field(HOPR, "150.0") field(DRVL, "0.0") field(LOPR, "0.0") field(PREC, "3") field(EGU, "A") field(VAL, "0.0") field(FLNK, "QUAD:DMPS:500:CALBIMAX") } record(ao, "QUAD:DMPS:500:CALBIMAX") { field(DESC, "Calibration Max Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(DRVH, "150.0") field(HOPR, "150.0") field(LOPR, "0.0") field(DRVL, "0.0") field(EGU, "A") field(VAL, "150.0") field(FLNK, "QUAD:DMPS:500:CALBSTEPNUM") } record(ao, "QUAD:DMPS:500:CALBIFINAL") { field(DESC, "Calibration Last Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(PREC, "3") field(EGU, "A") field(HOPR, "150.0") field(LOPR, "0.0") field(VAL, "0") } record(longout, "QUAD:DMPS:500: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, "QUAD:DMPS:500:CALBIDELTA") } record(calc, "QUAD:DMPS:500:CALBIDELTA") { field(DESC, "Step size for CALB") field(CALC, "C=0?0:ABS((A-B)/C)") field(INPA, "QUAD:DMPS:500:CALBIMAX") field(INPB, "QUAD:DMPS:500:CALBIMIN") field(INPC, "QUAD:DMPS:500: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, "QUAD:DMPS:500:CALBIMULT") { field(DESC, "IACT vs ISETPT mult") field(CALC, "C#0||A=0?1:ABS(B/A)") field(INPA, "PSC:DMPS:MG01:ISETPT.DRVH") field(INPB, "PSC:DMPS:MG01:IACT.HOPR") field(INPC, "QUAD:DMPS:500:PSCONTROLLER.RVAL CPP") field(EGU, "A") field(PINI, "YES") } # SNL dbputs DAC values here. 6-10 steps are possible. record(waveform, "QUAD:DMPS:500:CALBICTRLWF") { field(DESC, "ICTRL setpoint array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") } record(waveform, "QUAD:DMPS:500:DACWF") { field(DESC, "DAC count array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:DMPS:500:DACSA") } # Used only for xygraph edm plot record(subArray, "QUAD:DMPS:500:DACSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "QUAD:DMPS:500: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, "QUAD:DMPS:500:CALCDACWF") { field(DESC, "Calc DAC counts array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:DMPS:500:CALCDACSA") } # Used only for xygraph edm plot record(subArray, "QUAD:DMPS:500:CALCDACSA") { field(DESC, "Calc DAC counts") field(DTYP, "Soft Channel") field(INP, "QUAD:DMPS:500: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, "QUAD:DMPS:500:CALBYWF") { field(DESC, "mx + b") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:DMPS:500:CALBYSA") } # Used only for xygraph edm plot record(subArray, "QUAD:DMPS:500:CALBYSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "QUAD:DMPS:500:CALBYWF") field(MALM, "10") field(NELM, "6") field(INDX, "0") field(FTVL, "DOUBLE") } record(waveform, "QUAD:DMPS:500:CALBIACTWF") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:DMPS:500:CALBIACTSA") } # Used only for xygraph edm plot record(subArray, "QUAD:DMPS:500:CALBIACTSA") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(MALM, "10") field(NELM, "6") field(INP, "QUAD:DMPS:500:CALBIACTWF") field(INDX, "0") field(FTVL, "DOUBLE") field(FLNK, "QUAD:DMPS:500:CALBLIMITS") } # Check that measured current during calibration is within # tolerance. record(aSub, "QUAD:DMPS:500: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, "QUAD:DMPS:500:CALBSTEPNUM") field(INPB, "QUAD:DMPS:500:CALBIACTWF") field(INPC, "QUAD:DMPS:500: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, "QUAD:DMPS:500: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, "QUAD:DMPS:500:STDZITOL") field(INPH, "QUAD:DMPS:500:DACSLOPE") field(INPI, "QUAD:DMPS:500: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, "QUAD:DMPS:500: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, "QUAD:DMPS:500:CALBSTEPNUM") field(INPB, "QUAD:DMPS:500:CALBIACTWF") field(INPC, "QUAD:DMPS:500:DACWF") field(INPF, "QUAD:DMPS:500: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 QUAD:DMPS:500CALBOK 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, "QUAD:DMPS:500:DEGAUSINIT") { field(DESC, "Proc. Degauss PVs on boot") field(PINI, "YES") field(DOL, "1") field(OUTA, "QUAD:DMPS:500:DEGAUSIMIN.PROC PP") field(OUTB, "QUAD:DMPS:500:DEGAUSIMAX.PROC PP") field(OUTC, "QUAD:DMPS:500:DEGAUSTYPE.PROC PP") field(OUTD, "QUAD:DMPS:500:DEGAUSSTEP.PROC PP") field(OUTE, "QUAD:DMPS:500:MADNAME.PROC PP") field(OUTF, "QUAD:DMPS:500:PSTYPE.PROC PP") field(OUTG, "QUAD:DMPS:500: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, "QUAD:DMPS:500:DEGAUSSUB") { field(DESC, "Degauss subroutine") field(INAM, "mgntDegaussInit") field(SNAM, "mgntDegauss") field(BRSV, "INVALID") field(INPA, "QUAD:DMPS:500:DEGAUSIMIN NPP NMS") field(INPB, "QUAD:DMPS:500:DEGAUSIMAX NPP NMS") field(INPC, "QUAD:DMPS:500:DEGAUSTYPE.RVAL NPP NMS") field(INPE, "QUAD:DMPS:500:DEGAUSMETHOD.RVAL NPP NMS") field(INPF, "QUAD:DMPS:500:PSTYPE NPP NMS") field(INPG, "QUAD:DMPS:500:DEBUG.RVAL NPP NMS") field(INPH, "QUAD:DMPS:500: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, "QUAD:DMPS:500:DEGAUSWF PP") field(OUTB, "QUAD:DMPS:500:DEGAUSMSG PP") field(OUTC, "QUAD:DMPS:500: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, "QUAD:DMPS:500:DEGAUSWF") { field(DESC, "Degauss Setpts") field(NELM, "60") field(FTVL, "DOUBLE") } record(mbbo,"QUAD:DMPS:500: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, "QUAD:DMPS:500: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, "QUAD:DMPS:500: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, "QUAD:DMPS:500: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, "QUAD:DMPS:500: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, "QUAD:DMPS:500:DEGAUSIMIN") { field(DESC, "Min. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "150.0") field(LOPR, "-150.0") field(DRVH, "150.0") field(DRVL, "-150.0") field(VAL, "-150.0") } record(ao, "QUAD:DMPS:500:DEGAUSIMAX") { field(DESC, "Max. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "150.0") field(LOPR, "-150.0") field(DRVH, "150.0") field(DRVL, "-150.0") field(VAL, "150.0") } # 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,"QUAD:DMPS:500: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, "QUAD:DMPS:500: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,"QUAD:DMPS:500: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, "QUAD:DMPS:500: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, "QUAD:DMPS:500: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, "QUAD:DMPS:500: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, "QUAD:DMPS:500:DEGAUSTOD") { field(DESC, "Successful Degauss Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "QUAD:DMPS:500:DEGAUSLOSTTOD") { field(DESC, "Degauss Lost Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "QUAD:DMPS:500:DEGAUSTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "QUAD:DMPS:500:DEGAUSTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "QUAD:DMPS:500: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, "QUAD:DMPS:500:DEGAUSGO") { field(DESC, "Set bdes of btrms to zero") field(ASG, "Internal") field(OUTA, "") field(OUTB, "") field(OUTC, "") field(OUTD, "") } # =========== CRYO ONLY =========== record(bo, "QUAD:DMPS:500: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, "QUAD:DMPS:500:DEGAUS_IMAX_CHECK") { field(DESC, "Check if imax shoud chg") field(CALC, "(C==4)&&(ABS(B)>ABS(A))?1:0") field(INPA, "QUAD:DMPS:500:DEGAUS_IMAX") field(INPB, "QUAD:DMPS:500:ISETPT") field(INPC, "QUAD:DMPS:500:DEGAUSTYPE.RVAL") field(OUT, "QUAD:DMPS:500:DEGAUS_IMAX_UPDATE.SELN") field(FLNK, "QUAD:DMPS:500:DEGAUS_IMAX_UPDATE") } record(seq, "QUAD:DMPS:500:DEGAUS_IMAX_UPDATE") { field(DESC, "Degauss IMAX Update") field(SELM, "Specified") field(DOL1, "QUAD:DMPS:500:ISETPT") field(LNK1, "QUAD:DMPS:500:DEGAUS_IMAX PP") } # Set the maximum current after a successful # degauss. This pv is updated by the # sequence. record(ao, "QUAD:DMPS:500:DEGAUS_IMAX") { field(DESC, "Max I set afer a degauss") field(EGU, "Amps") field(PINI, "YES") field(PREC, "6") field(HOPR, "150.0") field(LOPR, "-150.0") field(DRVH, "150.0") field(DRVL, "-150.0") field(VAL, "150.0") field(FLNK, "QUAD:DMPS:500:DEGAUS_IMAXPOL_CHECK") info(autosaveFields,"VAL,RVAL") } # Set the polarity if degauss_imax record(calcout, "QUAD:DMPS:500:DEGAUS_IMAXPOL_CHECK") { field(DESC, "Determine polarity of imax") field(CALC, "A>=0?0:1") field(INPA, "QUAD:DMPS:500:DEGAUS_IMAX") field(FLNK, "QUAD:DMPS:500:DEGAUS_IMAXPOL") } record(bo, "QUAD:DMPS:500:DEGAUS_IMAXPOL") { field(DESC, "Polarity of imax I") field(DTYP, "Raw Soft Channel") field(DOL, "QUAD:DMPS:500:DEGAUS_IMAXPOL_CHECK") field(OMSL, "closed_loop") field(ZNAM, "Positive") field(ONAM, "Negative") field(FLNK, "QUAD:DMPS:500: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, "QUAD:DMPS:500:DEGAUS_ABSIMAX") { field(DESC, "Absolute Max. Degauss I") field(CALC, "ABS(A)") field(INPA, "QUAD:DMPS:500:DEGAUS_IMAX") field(PREC, "6") field(EGU, "Amps") field(HOPR, "150.0") field(LOPR, "-150.0") info(autosaveFields,"VAL RVAL") } # IACT Polarity record(calcout, "QUAD:DMPS:500:IACTPOL_CHECK") { field(DESC, "Determine IACT polarity") field(SCAN, "5 second") field(CALC, "ABS(A-B)>C?(A>=0?0:1):D") field(INPA, "QUAD:DMPS:500:IACT") field(INPB, "QUAD:DMPS:500:IACTPOL_CHECK.LA") field(INPC, "0.0001") field(INPD, "QUAD:DMPS:500:IACTPOL_CHECK.PVAL") field(OOPT, "On Change") field(FLNK, "QUAD:DMPS:500:IACTPOL") } record(bo, "QUAD:DMPS:500: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,"QUAD:DMPS:500: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, "QUAD:DMPS:500:DEGAUSENABLE CP") field(INPB, "QUAD:DMPS:500:DEGAUSOK") field(INPC, "QUAD:DMPS:500:STATE CP") field(INPD, "QUAD:DMPS:500:STATE.SEVR") field(OUT, "QUAD:DMPS:500:DEGAUS_STATE_SEQ.SELN PP") field(ASG, "Internal") } record(seq, "QUAD:DMPS:500:DEGAUS_STATE_SEQ") { field(DESC, "Degauss State Sequence") field(SELM, "Specified") field(SELL, "QUAD:DMPS:500:DEGAUS_STATE_CHECK") field(LNK1, "QUAD:DMPS:500:DEGAUS_STATE_DISABLE.PROC PP") field(LNK2, "QUAD:DMPS:500:DEGAUS_STATE_LOST.PROC PP") field(LNK3, "QUAD:DMPS:500:DEGAUS_STATE_GOOD.PROC PP") field(LNK4, "QUAD:DMPS:500: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, "QUAD:DMPS:500:DEGAUS_STATE_DISABLE") { field(DESC, "Degauss not used") field(LNK1, "QUAD:DMPS:500:DEGAUSOK.ZSV") field(LNK2, "QUAD:DMPS:500: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, "QUAD:DMPS:500:STATMSG.FRSV") field(LNK4, "QUAD:DMPS:500: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, "QUAD:DMPS:500:DEGAUS_STATE_LOST") { field(DESC, "Degauss lost and ps On") field(DOL1, "1") field(LNK1, "QUAD:DMPS:500:DEGAUSOK.ZSV") field(LNK2, "QUAD:DMPS:500: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, "QUAD:DMPS:500:STATMSG.FRSV") field(LNK4, "QUAD:DMPS:500: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, "QUAD:DMPS:500:DEGAUS_STATE_OFF") { field(DESC, "Degaused lost and ps Off") field(DOL1, "2") field(LNK1, "QUAD:DMPS:500: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, "QUAD:DMPS:500:STATMSG.FRSV") field(LNK3, "QUAD:DMPS:500: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, "QUAD:DMPS:500:DEGAUS_STATE_GOOD") { field(DESC, "Degauss good") field(DOL1, "1") field(LNK1, "QUAD:DMPS:500: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, "QUAD:DMPS:500:STATMSG.FRSV PP") field(LNK3, "QUAD:DMPS:500:STATMSG.FVSV PP") field(LNK4, "") field(ASG, "Internal") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(mbbo, "QUAD:DMPS:500:FUNC") { field(DESC, "QUAD:DMPS:500 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, "1") field(THVL, "9") field(FRVL, "10") field(FVVL, "0") field(SXVL, "2") field(SVVL, "8") field(EIVL, "11") field(NIVL, "12") field(TEVL, "13") field(ELVL, "5") field(TVVL, "6") field(TTVL, "7") field(FTVL, "4") field(FFVL, "3") field(OUT, "QUAD:DMPS:500:CTRL CA") } # :CTRL pv is processed at boot in the # sequence mgntCtrl.st Processed in sequence # record(mbbo, "QUAD:DMPS:500:CTRL") { field(DESC, "QUAD:DMPS:500 Control") field(PINI, "NO") field(ZRST, "Ready") field(ONST, "TRIM") field(TWST, "PERTURB") field(THST, "BCON_TO_BDES") field(FRST, "BACT_TO_BDES") field(FVST, "SAVE_BDES") field(SXST, "LOAD_BDES") field(SVST, "UNDO_BDES") field(EIST, "DAC_ZERO") field(NIST, "CALB") field(TEST, "STDZ") field(ELST, "RESET") field(TVST, "TURN_ON") field(TTST, "TURN_OFF") field(FTST, "") field(FFST, "") field(ZRVL, "0") field(ONVL, "2") field(TWVL, "6") field(THVL, "15") field(FRVL, "14") field(FVVL, "11") field(SXVL, "12") field(SVVL, "13") field(EIVL, "7") field(NIVL, "3") field(TEVL, "4") field(ELVL, "8") field(TVVL, "9") field(TTVL, "10") field(FTVL, "0") field(FFVL, "0") field(OUT, "QUAD:DMPS:500:SELECTEN.A PP") field(SDIS, "0") } # If a function has been selected set this unit to busy record(calcout, "QUAD:DMPS:500:SELECTEN") { field(DESC, "Control Select Enable") field(CALC, "A>0?1:A") field(FLNK, "QUAD:DMPS:500:BUSY") } # Set to FREE on IOC reboot record(bo, "QUAD:DMPS:500:BUSY") { field(DESC, "QUAD:DMPS:500 Ctrl Done") field(DOL, "QUAD:DMPS:500:SELECTEN") field(ZNAM, "FREE") field(ONAM, "BUSY") field(PINI, "YES") field(FLNK, "QUAD:DMPS:500:SELECT") } record(bo, "QUAD:DMPS:500:SELECT") { field(ZNAM, "NO") field(ONAM, "YES") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") } record(bo, "QUAD:DMPS:500: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, "QUAD:DMPS:500:CTRLSTATE") { field(DESC, "QUAD:DMPS:500 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("QUAD:DMPS:500:CTRL",20,20,0,0,"QUAD:DMPS:500:CTRL") #! Field("QUAD:DMPS:500:CTRL.OUT",16777215,1,"QUAD:DMPS:500:CTRL.OUT") #! Link("QUAD:DMPS:500:CTRL.OUT","QUAD:DMPS:500:SELECTEN.A") #! Field("QUAD:DMPS:500:CTRL.VAL",16777215,1,"QUAD:DMPS:500:CTRL.VAL") #! Record("QUAD:DMPS:500:SELECTEN",321,381,0,0,"QUAD:DMPS:500:SELECTEN") #! Field("QUAD:DMPS:500:SELECTEN.A",16777215,0,"QUAD:DMPS:500:SELECTEN.A") #! Field("QUAD:DMPS:500:SELECTEN.FLNK",16777215,1,"QUAD:DMPS:500:SELECTEN.FLNK") #! Link("QUAD:DMPS:500:SELECTEN.FLNK","QUAD:DMPS:500:BUSY") #! Field("QUAD:DMPS:500:SELECTEN.VAL",16777215,1,"QUAD:DMPS:500:SELECTEN.VAL") #! Record("QUAD:DMPS:500:BUSY",623,274,0,0,"QUAD:DMPS:500:BUSY") #! Field("QUAD:DMPS:500:BUSY.DOL",16777215,0,"QUAD:DMPS:500:BUSY.DOL") #! Link("QUAD:DMPS:500:BUSY.DOL","QUAD:DMPS:500:SELECTEN.VAL") #! Field("QUAD:DMPS:500:BUSY.FLNK",16777215,1,"QUAD:DMPS:500:BUSY.FLNK") #! Link("QUAD:DMPS:500:BUSY.FLNK","QUAD:DMPS:500:SELECT") #! Record("QUAD:DMPS:500:SELECT",669,508,0,1,"QUAD:DMPS:500:SELECT") #! Record("QUAD:DMPS:500:FUNC",940,120,0,0,"QUAD:DMPS:500:FUNC") #! Field("QUAD:DMPS:500:FUNC.OUT",16777215,0,"QUAD:DMPS:500:FUNC.OUT") #! Link("QUAD:DMPS:500:FUNC.OUT","QUAD:DMPS:500:CTRL.VAL") #! Record("QUAD:DMPS:500:ABORT",193,41,0,0,"QUAD:DMPS:500:ABORT") #! Record("QUAD:DMPS:500:CTRLSTATE",369,34,0,0,"QUAD:DMPS:500: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,"QUAD:DMPS:500:SELECT is used for Multi-device selection.\nIt is enabled when associated QUAD:DMPS:500:CTRL is \"0\" (DONE).\nIt is disabled when associated QUAD:DMPS:500: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,"QUAD:DMPS:500: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, "QUAD:DMPS:500:BCTRL_INIT") { field(DESC, "Process BCTRL on boot") field(PINI, "YES") field(CALC, "A=3?1:0") field(INPA, "QUAD:DMPS:500:BCTRL.SEVR") field(OUT, "QUAD:DMPS:500: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, "QUAD:DMPS:500:BACT") { field(DESC, "Actual B") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "QUAD:DMPS:500:BACT") field(INPB, "QUAD:DMPS:500:POLYCOEF") field(INPC, "QUAD:DMPS:500:POLYCOEF.A") field(INPD, "QUAD:DMPS:500:POLYCOEF.B") field(INPE, "QUAD:DMPS:500:IACT MS") field(INPF, "QUAD:DMPS:500:BDELTAS PP") field(INPG, "100") field(EGU, "kG") field(HOPR, "-0.0817") field(LOPR, "-38.580") field(HIHI, "-0.0817") field(LOLO, "-38.580") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "-0.0817") field(LOW, "-38.580") field(FLNK, "QUAD:DMPS:500: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, "QUAD:DMPS:500:BDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntPhyDeltas") field(EGU, "kG") field(HOPR, "1") field(PREC, "7") field(BRSV, "INVALID") field(INPA, "QUAD:DMPS:500:BDES") field(INPB, "QUAD:DMPS:500:TRIMBTOL") field(INPC, "QUAD:DMPS:500:TRIMBTOLR") field(INPD, "QUAD:DMPS:500:CHCKBTOL") field(INPE, "QUAD:DMPS:500:CHCKBTOLR") field(F, "2.0") field(INPG, "30") field(INPH, "QUAD:DMPS:500:BACT.VAL") # # MPS absolute and relative tolerances field(INPP, "QUAD:DMPS:500:MPSBTOL") field(INPQ, "QUAD:DMPS:500:MPSBTOLR") field(FLNK, "QUAD:DMPS:500:BCONLIMITS") info(autosaveFields,"F") } # This record is processed by BDELTAS record(aSub, "QUAD:DMPS:500:BCONLIMITS") { field(DESC, "Config B-field Limits") field(INAM, "mgntInit") field(SNAM, "mgntBCONLimits") field(INPA, "QUAD:DMPS:500:BDES") field(INPB, "QUAD:DMPS:500:BDELTAS.I") field(INPG, "QUAD:DMPS:500:DEBUG.RVAL") field(FTA, "DOUBLE") field(FTB, "DOUBLE") field(FTG, "ULONG") field(OUTA, "QUAD:DMPS:500:BCON.HIGH") field(OUTB, "QUAD:DMPS:500:BCON.LOW") field(OUTC, "QUAD:DMPS:500:BCON.HIHI") field(OUTD, "QUAD:DMPS:500:BCON.LOLO PP") field(FTVA, "DOUBLE") field(FTVB, "DOUBLE") field(FTVC, "DOUBLE") field(FTVD, "DOUBLE") field(BRSV, "INVALID") field(FLNK, "QUAD:DMPS:500:IDELTAS") } # The following PV is processed by :BACT # which is processed by :BACT # record(fanout, "QUAD:DMPS:500:BACTFO") { field(DESC, "BACT processing") field(SELM, "All") field(LNK1, "QUAD:DMPS:500:BDIFF") field(LNK2, "QUAD:DMPS:500:BADIFF") field(LNK3, "QUAD:DMPS:500:BRATIO") field(LNK4, "QUAD:DMPS:500:MPSLIMITS") field(LNK5, "QUAD:DMPS:500:I2BSTATUS") field(LNK6, "QUAD:DMPS:500:IACTFO.PROC") } record(calc, "QUAD:DMPS:500:BDIFF") { field(DESC, "BDES-BACT") field(CALC, "A-B") field(INPA, "QUAD:DMPS:500:BDES") field(INPB, "QUAD:DMPS:500:BACT") field(EGU, "kG") field(PREC, "7") } record(calc, "QUAD:DMPS:500:BADIFF") { field(DESC, "Absolute BDES-BACT") field(INPA, "QUAD:DMPS:500:BDIFF") field(EGU, "kG") field(PREC, "7") field(CALC, "A<0?ABS(A):A") } record(calc, "QUAD:DMPS:500:BRATIO") { field(DESC, "BACT Error") field(CALC, "B?A/B:0") field(INPA, "QUAD:DMPS:500:BDIFF") field(INPB, "QUAD:DMPS:500:BDES.HOPR") field(EGU, "kG") field(PREC, "7") } record(mbbi, "QUAD:DMPS:500: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, "QUAD:DMPS:500:BACT.J") } # Note: for a string slave set the MONFL # macro to the following: # MONFL=:IMONCALC MS record(sub, "QUAD:DMPS:500:BMON") { field(DESC, "Second Transductor") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "QUAD:DMPS:500:BMON") field(INPB, "QUAD:DMPS:500:POLYCOEF") field(INPC, "QUAD:DMPS:500:POLYCOEF.A") field(INPD, "QUAD:DMPS:500:POLYCOEF.B") field(INPE, "QUAD:DMPS:500:IMON MS") field(INPF, "QUAD:DMPS:500:BDELTAS.VAL") field(INPG, "100") field(EGU, "kG") field(HOPR, "-0.0817") field(LOPR, "-38.580") field(HIHI, "-0.0817") field(LOLO, "-38.580") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "-0.0817") field(LOW, "-38.580") } # 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=PSC:DMPS:MG01:BDES CP record(ao, "QUAD:DMPS:500:BDES") { field(DESC, "Desired B-Field") field(PINI, "YES") field(DRVH, "-0.0817") field(DRVL, "-38.580") field(HOPR, "-0.0817") field(LOPR, "-38.580") field(PREC, "7") field(EGU, "kG") field(MDEL, "-1") field(OMSL, "supervisory") # field(DOL, "") field(OUT, "QUAD:DMPS:500:B2IDES PP") info(autosaveFields,"VAL") } record(sub, "QUAD:DMPS:500:B2IDES") { field(DESC, "Convert Desired B-Field to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:DMPS:500:POLYCOEF") field(INPC, "QUAD:DMPS:500:POLYCOEF.A") field(INPD, "QUAD:DMPS:500:POLYCOEF.B") field(PREC, "7") field(EGU, "kG") field(HOPR, "-0.0817") field(LOPR, "-38.580") field(MDEL, "-1") field(INPE, "QUAD:DMPS:500:BDES.DRVH") field(INPF, "QUAD:DMPS:500:BDES.DRVL") field(BRSV, "INVALID") field(FLNK, "QUAD:DMPS:500:IDES") } record(sub, "QUAD:DMPS:500:BNOM") { field(DESC, "Nominal Field") field(PINI, "YES") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:DMPS:500:POLYCOEF") field(INPC, "QUAD:DMPS:500:POLYCOEF.A") field(INPD, "QUAD:DMPS:500:POLYCOEF.B") field(INPE, "QUAD:DMPS:500:BDES.DRVH") field(INPF, "QUAD:DMPS:500:BDES.DRVL") field(EGU, "kG") field(HOPR, "-0.0817") field(LOPR, "-38.580") field(PREC, "7") field(VAL, "0.0") field(FLNK, "QUAD:DMPS:500:INOM") } record(sub, "QUAD:DMPS:500:BACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:DMPS:500:BDES.VAL") field(INPB, "QUAD:DMPS:500:BDES.DRVH") field(INPC, "QUAD:DMPS:500:BDES.DRVL") field(INPD, "QUAD:DMPS:500:BDELTAS.I") field(INPE, "QUAD:DMPS:500:BDELTAS.J") field(INPG, "QUAD:DMPS:500:STATE") field(INPH, "QUAD:DMPS:500:HSTA") field(EGU, "kG") field(HOPR, "-0.0817") field(LOPR, "-38.580") field(PREC, "7") field(BRSV, "INVALID") } record(sub, "QUAD:DMPS:500:BMONLIMITS") { field(DESC, "MON Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:DMPS:500:BDES.VAL") field(INPB, "QUAD:DMPS:500:BDES.DRVH") field(INPC, "QUAD:DMPS:500:BDES.DRVL") field(INPD, "QUAD:DMPS:500:BDELTAS.K") field(INPE, "QUAD:DMPS:500:BDELTAS.L") field(INPG, "QUAD:DMPS:500:STATE") field(INPH, "QUAD:DMPS:500:HSTA") field(EGU, "kG") field(HOPR, "-0.0817") field(LOPR, "-38.580") field(PREC, "7") field(BRSV, "INVALID") } record(seq, "QUAD:DMPS:500:BLIMITS") { field(DESC, "ACT Limits") field(PREC, "7") field(DOL1, "QUAD:DMPS:500:BLIMITS") field(LNK1, "QUAD:DMPS:500:BACTLIMITS.F PP") field(DOL2, "QUAD:DMPS:500:BACTLIMITS.I") field(LNK2, "QUAD:DMPS:500:BACT.HIGH") field(DOL3, "QUAD:DMPS:500:BACTLIMITS.J") field(LNK3, "QUAD:DMPS:500:BACT.LOW") field(DOL4, "QUAD:DMPS:500:BACTLIMITS.K") field(LNK4, "QUAD:DMPS:500:BACT.HIHI") field(DOL5, "QUAD:DMPS:500:BACTLIMITS.L") field(LNK5, "QUAD:DMPS:500:BACT.LOLO") field(DOL6, "QUAD:DMPS:500:BLIMITS") field(LNK6, "QUAD:DMPS:500:BMONLIMITS.F PP") field(DOL7, "QUAD:DMPS:500:BMONLIMITS.I") field(LNK7, "QUAD:DMPS:500:BMON.HIGH") field(DOL8, "QUAD:DMPS:500:BMONLIMITS.J") field(LNK8, "QUAD:DMPS:500:BMON.LOW") field(DOL9, "QUAD:DMPS:500:BMONLIMITS.K") field(LNK9, "QUAD:DMPS:500:BMON.HIHI") field(DOLA, "QUAD:DMPS:500:BMONLIMITS.L") field(LNKA, "QUAD:DMPS:500:BMON.LOLO") field(FLNK, "QUAD:DMPS:500:ILIMITS") field(SCAN, "5 second") } record(ao, "QUAD:DMPS:500:BCTRL") { field(DESC, "B-Perturb") field(PREC, "7") field(EGU, "kG") field(DRVH, "-0.0817") field(DRVL, "-38.580") field(HOPR, "-0.0817") field(LOPR, "-38.580") # 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, "QUAD:DMPS:500: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, "QUAD:DMPS:500:BCTRLGO") { field(DESC, "Update DES and perturb") field(PREC, "7") # Disable BACT limits field(DOL1, "1") field(LNK1, "QUAD:DMPS:500:BLIMITS.VAL") # Update BDES with the BCTRL (slider) value field(DOL2, "QUAD:DMPS:500:BCTRL.VAL") field(LNK2, "QUAD:DMPS:500:BDES PP") field(DOL3, "1") field(LNK3, "QUAD:DMPS:500:IDIRECT.PROC PP") field(DOL4, "1") field(LNK4, "QUAD:DMPS:500:CHECKSTDZLOST.PROC PP") field(DOL5, "QUAD:DMPS:500:BCTRL.VAL") field(LNK5, "QUAD:DMPS:500:BCTRLSUB PP") # Re-enable BACT limits field(DOL6, "0") field(LNK6, "QUAD:DMPS:500:BLIMITS.VAL") } # Convert B-field to Current and output to ISETPT record(sub, "QUAD:DMPS:500:BCTRLSUB") { field(DESC, "Feedback") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:DMPS:500:POLYCOEF") field(INPC, "QUAD:DMPS:500:POLYCOEF.A") field(INPD, "QUAD:DMPS:500:POLYCOEF.B") field(INPE, "QUAD:DMPS:500:BDES.DRVH") field(INPF, "QUAD:DMPS:500:BDES.DRVL") field(PREC, "7") field(EGU, "kG") field(HOPR, "-0.0817") field(LOPR, "-38.580") field(MDEL, "-1") field(BRSV, "INVALID") field(FLNK, "QUAD:DMPS:500:ISETPT") } record(ao, "QUAD:DMPS:500:BDESPREVTRIM") { field(DESC, "trim bdes for undo") field(DTYP, "Soft Channel") field(DRVH, "-0.0817") field(DRVL, "-38.580") field(EGU, "kG") field(HOPR, "-0.0817") field(LOPR, "-38.580") field(PREC, "7") field(PINI, "YES") info(autosaveFields,"VAL") } record(stringin, "QUAD:DMPS:500:MADNAME") { field(DESC, "MAD deck nomenclature") field(PINI, "YES") field(VAL, "QDMP1B") } record(ai, "QUAD:DMPS:500: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, "3751.779635") } record(ao, "QUAD:DMPS:500:BMAX") { field(DESC, "Max B-Field") field(DTYP, "Soft Channel") field(DRVH, "-0.0817") field(DRVL, "-38.580") field(EGU, "kG") field(HOPR, "-0.0817") field(LOPR, "-38.580") field(PREC, "7") field(PINI, "YES") field(VAL, "-0.0817") field(FLNK, "QUAD:DMPS:500:BSTEP") } record(ao, "QUAD:DMPS:500:BMIN") { field(DESC, "Min B-Field") field(DTYP, "Soft Channel") field(DRVH, "-0.0817") field(DRVL, "-38.580") field(EGU, "kG") field(HOPR, "-0.0817") field(LOPR, "-38.580") field(PREC, "7") field(PINI, "YES") field(VAL, "-38.580") field(FLNK, "QUAD:DMPS:500:BSTEP") } record(ao, "QUAD:DMPS:500:BDESSAVE") { field(DESC, "bdes for save/load") field(DTYP, "Soft Channel") field(DRVH, "-0.0817") field(DRVL, "-38.580") field(EGU, "kG") field(HOPR, "-0.0817") field(LOPR, "-38.580") field(PINI, "YES") field(PREC, "7") } # This record is processed by QUAD:DMPS:500: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, "QUAD:DMPS:500:BCON") { field(DESC, "Config B-Field ") field(DTYP, "Soft Channel") field(PREC, "7") field(EGU, "kG") field(HOPR, "-0.0817") field(LOPR, "-38.580") field(DRVH, "-0.0817") field(DRVL, "-38.580") # Set MINOR Alarm as the default, slaves will set NO_ALARM=0. field(HHSV, "MINOR") field(LLSV, "MINOR") field(HSV, "MINOR") field(LSV, "MINOR") # field(DOL , "") field(OMSL, "supervisory") field(OUT, "QUAD:DMPS:500:B2ICON PP") info(autosaveFields,"VAL") } record(sub, "QUAD:DMPS:500:B2ICON") { field(DESC, "Convert Desired ICon to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:DMPS:500:POLYCOEF") field(INPC, "QUAD:DMPS:500:POLYCOEF.A") field(INPD, "QUAD:DMPS:500:POLYCOEF.B") field(PREC, "7") field(EGU, "kG") field(HOPR, "-0.0817") field(LOPR, "-38.580") field(MDEL, "-1") field(INPE, "QUAD:DMPS:500:BCON.DRVH") field(INPF, "QUAD:DMPS:500:BCON.DRVL") field(BRSV, "INVALID") field(FLNK, "QUAD:DMPS:500: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, "QUAD:DMPS:500:BSTEP") { field(DESC, "B-Field step size") field(CALC, "(C==3)||(D==3)?0:ABS(A-B)*0.005") field(INPA, "QUAD:DMPS:500:BMAX") field(INPB, "QUAD:DMPS:500:BMIN") field(INPC, "QUAD:DMPS:500:BMIN.SEVR") field(INPD, "QUAD:DMPS:500:BMAX.SEVR") field(EGU, "kG") 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,"QUAD:DMPS:500:BCTRLDISABLECALC") { field(DESC, "Calc for disabling BCTRL") field(ASG, "Internal") field(CALC, "A?2:1") field(INPA, "QUAD:DMPS:500:ONLINE CP") field(OUT, "QUAD:DMPS:500:BCTRLDISABLEFOUT PP") } record(fanout, "QUAD:DMPS:500:BCTRLDISABLEFOUT") { field(DESC, "Disable BCTRL fanout") field(SELM, "Specified") field(SELL, "QUAD:DMPS:500:BCTRLDISABLECALC") field(LNK1, "QUAD:DMPS:500:BCTRLDISABLE") field(LNK2, "QUAD:DMPS:500:BCTRLENABLE") } record(stringout, "QUAD:DMPS:500:BCTRLDISABLE") { field(DESC, "Disable BCTRL") field(DTYP, "Soft Channel") field(OUT, "QUAD:DMPS:500:BCTRL.ASG") field(VAL, "NOWRITE") field(FLNK, "QUAD:DMPS:500:BCTRLDISV_UPDATE") } record(stringout, "QUAD:DMPS:500:BCTRLENABLE") { field(DESC, "Enable BCTRL") field(DTYP, "Soft Channel") field(OUT, "QUAD:DMPS:500:BCTRL.ASG") field(VAL, "") field(FLNK, "QUAD:DMPS:500:BCTRLDISV_UPDATE") } record(calcout, "QUAD:DMPS:500:BCTRLDISV_UPDATE") { field(DESC, "Calc for updating BCTRL.DISV") field(ASG, "Internal") field(CALC, "A") field(INPA, "QUAD:DMPS:500:ONLINE") field(OUT, "QUAD:DMPS:500: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,"QUAD:DMPS:500:BACT and MON\n are processed via links from \n QUAD:DMPS:500:IACT (device raw value readback 1)\n and\n QUAD:DMPS:500: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 QUAD:DMPS:500:POLYCOEF\nC = First polynomial coefficient (offset if linear)\nD = Second polynomial coefficient (slope if linear)\nE = QUAD:DMPS:500: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,"QUAD:DMPS:500:BDES\n is processed when set by CA users or \n QUAD:DMPS:500: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,"QUAD:DMPS:500: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 QUAD:DMPS:500: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 (QUAD:DMPS:500: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,"QUAD:DMPS:500:B*LIMITS and QUAD:DMPS:500:BLIMITS:\n Calculate alarm and warning limits based on \n deltas from QUAD:DMPS:500: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,"QUAD:DMPS:500: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,"QUAD:DMPS:500: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, "QUAD:DMPS:500: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, "QUAD:DMPS:500:MPSBTOL") { field(DESC, "Absolute mps tol") field(EGU, "kG") field(PREC, "2") field(CALC, "ABS(A)*0.02") field(INPA, "QUAD:DMPS:500:BMAX") field(PINI, "YES") } # # 21-Aug-2013: K. Luchini # Set channel access security so that users # cannot easily change values. record(ao, "QUAD:DMPS:500:MPSBMAX") { field(DESC, "MPS Max B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "-0.0817") field(DRVL, "-38.580") field(PINI, "YES") field(VAL, "-0.0817") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "QUAD:DMPS:500:MPSBMIN") { field(DESC, "MPS Min B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "-0.0817") field(DRVL, "-38.580") field(PINI, "YES") field(VAL, "-38.580") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "QUAD:DMPS:500:MPSBLLIM") { field(DESC, "MPS Low Limit B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "-0.0817") field(DRVL, "-38.580") field(PINI, "YES") field(VAL, "-38.580") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "QUAD:DMPS:500:MPSBLLIM2") { field(DESC, "MPS Low Limit #2 B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "-0.0817") field(DRVL, "-38.580") field(PINI, "YES") field(VAL, "-38.580") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } # Set the default to Std record(mbbo, "QUAD:DMPS:500: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, "QUAD:DMPS:500:MPSLIMITS.E PP") } record(aSub, "QUAD:DMPS:500: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, "QUAD:DMPS:500:MPS.RVAL") field(INPB, "QUAD:DMPS:500:BADIFF") field(INPC, "QUAD:DMPS:500:BDELTAS.N") field(INPD, "QUAD:DMPS:500:BACT") field(INPE, "QUAD:DMPS:500:MPSBITMASK.RVAL") field(INPF, "QUAD:DMPS:500:MPSBLLIM") field(INPG, "QUAD:DMPS:500:MPSBMIN") field(INPH, "QUAD:DMPS:500:MPSBMAX") field(INPI, "QUAD:DMPS:500: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, "QUAD:DMPS:500:INTOL.RVAL PP") field(OUTB, "QUAD:DMPS:500:INTOL_BMIN.RVAL PP") field(OUTC, "QUAD:DMPS:500:INTOL_BRANGE.RVAL PP") field(OUTD, "QUAD:DMPS:500: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, "QUAD:DMPS:500:INTOL") { field(DESC, "BACT within MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:DMPS:500:MPSLIMITS.VALA") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "QUAD:DMPS:500:INTOL_BMIN") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:DMPS:500:MPSLIMITS.VALB") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "QUAD:DMPS:500:INTOL_BMIN2") { field(DESC, "MPS tol #2") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:DMPS:500:MPSLIMITS.VALD") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "QUAD:DMPS:500:INTOL_BRANGE") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:DMPS:500: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, "QUAD:DMPS:500:CHCKITOL") { field(DESC, "Absolute Check I Tolerance") field(EGU, "A") field(FLNK, "QUAD:DMPS:500:TRIMITOL") field(CALC, "ABS(A*B)") field(INPA, "QUAD:DMPS:500:CHCKBTOL") field(INPB, "QUAD:DMPS:500:POLYCOEF.B") field(PREC, "9") } record(calc, "QUAD:DMPS:500:TRIMBTOL") { field(EGU, "kG") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(DESC, "Absolute Trim Tolerance") field(CALC, "ABS(A)/2") field(INPA, "QUAD:DMPS:500:CHCKBTOL") field(FLNK, "QUAD:DMPS:500:CHCKITOL") } record(calc, "QUAD:DMPS:500:CHCKBTOL") { field(DESC, "Check absolute tolerance") field(EGU, "A") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(FLNK, "QUAD:DMPS:500:TRIMBTOL") field(CALC, "MAX(ABS(A),ABS(C))*(B/1000000)") field(INPA, "QUAD:DMPS:500:BDES.HOPR") field(INPB, "QUAD:DMPS:500:STABILITY") field(INPC, "QUAD:DMPS:500:BDES.LOPR") } record(longout, "QUAD:DMPS:500: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, "QUAD:DMPS:500:CHCKBTOL") } record(calc, "QUAD:DMPS:500:TRIMITOL") { field(DESC, "Absolute Trim I Tolerance") field(EGU, "kG") field(CALC, "ABS(A*B)") field(INPA, "QUAD:DMPS:500:POLYCOEF.B") field(INPB, "QUAD:DMPS:500:TRIMBTOL") field(PREC, "9") } record(ai, "QUAD:DMPS:500:TRIMBTOLR") { field(DESC, "Relative trim tol") field(PREC, "4") field(EGU, "%") field(HOPR, "1.0") field(LOPR, "0.0") field(PINI, "YES") } record(ai, "QUAD:DMPS:500: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, "QUAD:DMPS:500:FBCKFCOM") { field(ZNAM, "CA") field(ONAM, "FCOM") field(DESC, "CA Mode") field(PINI, "YES") field(SDIS, "0") } record(bo, "QUAD:DMPS:500:PAU") { field(ZNAM, "NotConfigured") field(ONAM, "Configured") field(DESC, "PAU Present") field(PINI, "YES") field(SDIS, "0") field(FLNK, "QUAD:DMPS:500:PAUGO") } record(fanout, "QUAD:DMPS:500:PAUGO") { field(DESC, "PAU control") field(LNK1, "QUAD:DMPS:500:PAUSTOP") field(LNK2, "QUAD:DMPS:500: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, "QUAD:DMPS:500:PAUSTART") { field(DESC, "Setup for PAU On") field(SDIS, "QUAD:DMPS:500: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, "QUAD:DMPS:500:PAUSTOP") { field(DESC, "Setup for PAU Off") field(SDIS, "QUAD:DMPS:500: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, "QUAD:DMPS:500:MCORDEVNAME") { field(DESC, "PS device name") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, "PSC:DMPS:MG01:") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "QUAD:DMPS:500: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, "QUAD:DMPS:500:PSTYPE.RVAL") field(INPC, "QUAD:DMPS:500:TURNEDOFF.RVAL") field(INPD, "QUAD:DMPS:500:CONFIG.RVAL") field(INPE, "QUAD:DMPS:500:PSCATEGORY.RVAL") field(INPF, "QUAD:DMPS:500:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "QUAD:DMPS:500:AUTOCTRL.RVAL") field(INPJ, "QUAD:DMPS:500:OUTOFSERVICE.RVAL") field(INPL, "QUAD:DMPS:500:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "QUAD:DMPS:500:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "QUAD:DMPS:500:PAU") field(INPP, "QUAD:DMPS:500:CALBDISABLE.RVAL") field(INPQ, "QUAD:DMPS:500:PTRBDISABLE.RVAL") field(INPR, "QUAD:DMPS:500:TRIMDISABLE.RVAL") field(INPS, "QUAD:DMPS:500:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "QUAD:DMPS:500:FBCK") field(INPU, "QUAD:DMPS:500:TRIMTYPE.RVAL") field(INPV, "QUAD:DMPS:500:STDZDIRECT.RVAL") field(INPW, "QUAD:DMPS:500:DEGAUSENABLE.RVAL") field(FLNK, "QUAD:DMPS:500:HSTA") } record(longin, "QUAD:DMPS:500:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "QUAD:DMPS:500:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "QUAD:DMPS:500: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, "QUAD:DMPS:500: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, "QUAD:DMPS:500:CALBDISABLE") { field(DESC, "DAC Calb Disabled") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:DMPS:500:PTRBDISABLE") { field(DESC, "Perturb Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:DMPS:500:TRIMDISABLE") { field(DESC, "Trim Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:DMPS:500: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 QUAD:DMPS:500:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses QUAD:DMPS:500:FBCK. # This PV should be replaced by QUAD:DMPS:500: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, "QUAD:DMPS:500: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, "QUAD:DMPS:500: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, "QUAD:DMPS:500: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, "") field(OMSL, "supervisory") field(FLNK, "QUAD:DMPS:500:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"QUAD:DMPS:500:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "QUAD:DMPS:500:OUTOFSERVICE NPP NMS") field(OUT, "QUAD:DMPS:500:ONLINE PP") } record(bo, "QUAD:DMPS:500:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "QUAD:DMPS:500: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, "1") } record(bo, "QUAD:DMPS:500: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, "1") } record(bo, "QUAD:DMPS:500: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, "QUAD:DMPS:500: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, "QUAD:DMPS:500: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, "QUAD:DMPS:500: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, "QUAD:DMPS:500: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, "QUAD:DMPS:500: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, "1") field(ASG, "NOWRITE") } record(mbbo, "QUAD:DMPS:500: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, "1") field(ASG, "NOWRITE") } record(mbbo, "QUAD:DMPS:500: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, "2") field(ASG, "NOWRITE") } record(mbbo, "QUAD:DMPS:500: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, "0") field(ASG, "NOWRITE") field(FLNK, "QUAD:DMPS:500:TRIMTYPE") } record(stringout, "QUAD:DMPS:500:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "QUAD:DMPS:500:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "QUAD:DMPS:500:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "QUAD:DMPS:500:STATE.RVAL") field(INPB, "QUAD:DMPS:500:INTLKSUMY.RVAL") field(OUT, "QUAD:DMPS:500:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:DMPS:500: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, "QUAD:DMPS:500:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "QUAD:DMPS:500:STATE.RVAL") field(INPB, "QUAD:DMPS:500:INTLKSUMY.RVAL") field(OUT, "QUAD:DMPS:500:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:DMPS:500:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "QUAD:DMPS:500:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "QUAD:DMPS:500: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, "QUAD:DMPS:500:RAMPSTARTDLY") { field(DESC, "Tansition to ramp delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "2") } ######### For PSTYPE=2 Only ############# record(mbbo, "QUAD:DMPS:500: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, "QUAD:DMPS:500: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,"QUAD:DMPS:500: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("QUAD:DMPS:500:TURNEDOFF",3140,1907,0,1,"QUAD:DMPS:500:TURNEDOFF") #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "QUAD:DMPS:500:STATSUB") { field(DESC, "Build STATus ") field(INAM, "mgntInit") field(SNAM, "mgntSlcStat") field(INPA, "QUAD:DMPS:500:BACT.STAT") field(INPB, "QUAD:DMPS:500:BDES.STAT") field(INPC, "QUAD:DMPS:500:IRIPL.STAT") field(INPD, "PSC:DMPS:MG01:ISETPT.STAT") field(INPE, "PSC:DMPS:MG01:IACT.STAT") # 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, "QUAD:DMPS:500:BACT.SEVR") field(INPH, "QUAD:DMPS:500:BDES.SEVR") field(INPI, "QUAD:DMPS:500:IRIPL.SEVR") field(INPJ, "PSC:DMPS:MG01:ISETPT.SEVR") field(INPK, "PSC:DMPS:MG01:IACT.SEVR") # # 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, "QUAD:DMPS:500:STATE.RVAL") field(INPN, "QUAD:DMPS:500:STDZOK") field(INPO, "QUAD:DMPS:500:CALBOK") field(INPP, "QUAD:DMPS:500:OUTOFSERVICE.RVAL") field(INPQ, "QUAD:DMPS:500:CONFIG.RVAL") field(INPR, "QUAD:DMPS:500:HSTA") field(INPS, "QUAD:DMPS:500:CTRL.RVAL") field(INPT, "QUAD:DMPS:500:DEGAUSOK") field(INPV, "QUAD:DMPS:500: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, "QUAD:DMPS:500:STAT") } record(longout, "QUAD:DMPS:500:STAT") { field(DESC, "STAT sent to SLC") field(SCAN, "Passive") field(FLNK, "QUAD:DMPS:500:STATCTRLSUB") field(DOL, "QUAD:DMPS:500:STATSUB.VAL") field(OMSL, "closed_loop") } record(sSub, "QUAD:DMPS:500:STATCTRLSUB") { field(DESC, "Decode SLC STAT into mbbo") field(INAM, "mgntInit") field(SNAM, "mgntStatDecode") field(INPA, "QUAD:DMPS:500:STAT") field(INPB, "QUAD:DMPS:500:HSTA") field(INPD, "QUAD:DMPS:500:ONOFFCTRL.RVAL") field(FLNK, "QUAD:DMPS:500:STATMSG") } record(mbbo, "QUAD:DMPS:500: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, "QUAD:DMPS:500:UNAVAILGO") field(DOL, "QUAD:DMPS:500:STATCTRLSUB.W") } record(seq, "QUAD:DMPS:500:UNAVAILGO") { field(DESC, "Process UNAVAIL") field(DOL1, "QUAD:DMPS:500:STATSUB.U") field(LNK1, "QUAD:DMPS:500:UNAVAIL PP") } record(stringout, "QUAD:DMPS:500:SNLSTATMSG") { field(DTYP, "Soft Channel") } #! TextBox(TB0,820,1000,1200,1220,0,"Dialog",12,1,16777215,"QUAD:DMPS:500:STATUSSUB - future\nOverall device status - takes input from action snls, record sevrs, master snl(s) and outputs final status\n\nInputs:\nA - QUAD:DMPS:500:CTRLSTATUS - snl status\nB - MGNT:CTRLSTATUS - master list status\nC\nD - QUAD:DMPS:500: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,"QUAD:DMPS:500STATSUB\nformat control bo's into slc STAT\n\nInputs:\nA - QUAD:DMPS:500:STATUS\nC - QUAD:DMPS:500:ON\nD - QUAD:DMPS:500:STDZOK\nE - QUAD:DMPS:500:CALBOK\nF - QUAD:DMPS:500:BACTDRIFT (future)\nG -\nH- QUAD:DMPS:500:DACSTATUS\nI -QUAD:DMPS:500:ADCSTATUS\nJ - QUAD:DMPS:500:BACTSTATUS\nK - QUAD:DMPS:500:BDESSTATUS\nL - QUAD:DMPS:500:RIPLSTATUS\n\nOutput:\nP - QUAD:DMPS:500: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, "QUAD:DMPS:500: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, "QUAD:DMPS:500: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, "QUAD:DMPS:500: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, "QUAD:DMPS:500: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.6 #! DBDSTART #! DBD("../../../../dbd/mgntSoft.dbd") #! DBDEND record(stringout, "QUAD:DMPS:500:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "QUAD:DMPS:500:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "QUAD:DMPS:500:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "QUAD:DMPS:500:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "QUAD:DMPS:500:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "QUAD:DMPS:500:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "1") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "QUAD:DMPS:500: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, "QUAD:DMPS:500:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "QUAD:DMPS:500:TRIMTYPE.RVAL") field(INPB, "QUAD:DMPS:500:CONFIG.RVAL") field(OUT, "QUAD:DMPS:500:TRIMMAXNUM PP") } record(longout, "QUAD:DMPS:500: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, "QUAD:DMPS:500: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, "") field(OMSL, "supervisory") field(VAL, "20") field(OUT, "QUAD:DMPS:500:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "QUAD:DMPS:500: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, "") field(OMSL, "supervisory") field(VAL, "10") } record(bo, "QUAD:DMPS:500: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, "QUAD:DMPS:500: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, "QUAD:DMPS:500: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, "QUAD:DMPS:500:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "0") } record(ao, "QUAD:DMPS:500: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, "QUAD:DMPS:500:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "QUAD:DMPS:500: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, "QUAD:DMPS:500: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, "QUAD:DMPS:500:IMOVE") field(INPB, "QUAD:DMPS:500:IACT") field(INPC, "QUAD:DMPS:500:IRAMPRATE") field(INPD, "1.577") field(INPE, "QUAD:DMPS:500:TRIMDLYPCT") field(INPF, "QUAD:DMPS:500:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "QUAD:DMPS:500:RAMPTIME_LEFT PP") } record(longout, "QUAD:DMPS:500:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "QUAD:DMPS:500:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "QUAD:DMPS:500:RAMPDONE_CALC") } record(calc, "QUAD:DMPS:500:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "QUAD:DMPS:500:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "QUAD:DMPS:500:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "QUAD:DMPS:500: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, "QUAD:DMPS:500:RAMPTIME_LEFT") field(OUT, "QUAD:DMPS:500:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "QUAD:DMPS:500:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "QUAD:DMPS:500:RAMPTIME_LEFT NMS") field(OUT, "QUAD:DMPS:500:RAMPDONE PP") } record(bo, "QUAD:DMPS:500:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "QUAD:DMPS:500:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "QUAD:DMPS:500: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, "QUAD:DMPS:500: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(sSub, "QUAD:DMPS:500: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, "QUAD:DMPS:500:PSTYPE.RVAL") field(INPC, "QUAD:DMPS:500:TURNEDOFF.RVAL") field(INPD, "QUAD:DMPS:500:CONFIG.RVAL") field(INPE, "QUAD:DMPS:500:PSCATEGORY.RVAL") field(INPF, "QUAD:DMPS:500:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "QUAD:DMPS:500:AUTOCTRL.RVAL") field(INPJ, "QUAD:DMPS:500:OUTOFSERVICE.RVAL") field(INPL, "QUAD:DMPS:500:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "QUAD:DMPS:500:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "QUAD:DMPS:500:PAU") field(INPP, "QUAD:DMPS:500:CALBDISABLE.RVAL") field(INPQ, "QUAD:DMPS:500:PTRBDISABLE.RVAL") field(INPR, "QUAD:DMPS:500:TRIMDISABLE.RVAL") field(INPS, "QUAD:DMPS:500:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "QUAD:DMPS:500:FBCK") field(INPU, "QUAD:DMPS:500:TRIMTYPE.RVAL") field(INPV, "QUAD:DMPS:500:STDZDIRECT.RVAL") field(INPW, "QUAD:DMPS:500:DEGAUSENABLE.RVAL") field(FLNK, "QUAD:DMPS:500:HSTA") } record(longin, "QUAD:DMPS:500:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "QUAD:DMPS:500:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "QUAD:DMPS:500: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, "QUAD:DMPS:500: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, "QUAD:DMPS:500:CALBDISABLE") { field(DESC, "DAC Calb Disabled") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:DMPS:500:PTRBDISABLE") { field(DESC, "Perturb Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:DMPS:500:TRIMDISABLE") { field(DESC, "Trim Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "QUAD:DMPS:500:STDZDISABLE") { field(DTYP, "Raw Soft Channel") field(ZNAM, "NO") field(ONAM, "YES") field(DESC, "Standardize Function") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } # This PV has been replaced by QUAD:DMPS:500:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses QUAD:DMPS:500:FBCK. # This PV should be replaced by QUAD:DMPS:500: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, "QUAD:DMPS:500: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, "QUAD:DMPS:500: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, "QUAD:DMPS:500: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, "") field(OMSL, "supervisory") field(FLNK, "QUAD:DMPS:500:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"QUAD:DMPS:500:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "QUAD:DMPS:500:OUTOFSERVICE NPP NMS") field(OUT, "QUAD:DMPS:500:ONLINE PP") } record(bo, "QUAD:DMPS:500:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "QUAD:DMPS:500: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, "1") } record(bo, "QUAD:DMPS:500: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, "1") } record(bo, "QUAD:DMPS:500: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, "QUAD:DMPS:500: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, "QUAD:DMPS:500: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, "QUAD:DMPS:500: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, "QUAD:DMPS:500: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, "QUAD:DMPS:500: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, "1") field(ASG, "NOWRITE") } record(mbbo, "QUAD:DMPS:500: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, "1") field(ASG, "NOWRITE") } record(mbbo, "QUAD:DMPS:500: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, "2") field(ASG, "NOWRITE") } record(mbbo, "QUAD:DMPS:500: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, "2") field(ASG, "NOWRITE") field(FLNK, "QUAD:DMPS:500:TRIMTYPE") } record(stringout, "QUAD:DMPS:500:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "QUAD:DMPS:500:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "QUAD:DMPS:500:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "QUAD:DMPS:500:STATE.RVAL") field(INPB, "QUAD:DMPS:500:INTLKSUMY.RVAL") field(OUT, "QUAD:DMPS:500:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:DMPS:500: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, "QUAD:DMPS:500:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "QUAD:DMPS:500:STATE.RVAL") field(INPB, "QUAD:DMPS:500:INTLKSUMY.RVAL") field(OUT, "QUAD:DMPS:500:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:DMPS:500:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "QUAD:DMPS:500:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "QUAD:DMPS:500: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, "QUAD:DMPS:500:RAMPSTARTDLY") { field(DESC, "Tansition to ramp delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "2") } ######### For PSTYPE=2 Only ############# record(mbbo, "QUAD:DMPS:500: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, "QUAD:DMPS:500: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,"QUAD:DMPS:500: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("QUAD:DMPS:500:TURNEDOFF",3140,1907,0,1,"QUAD:DMPS:500:TURNEDOFF") #! 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, "BEND:UNDS:3530:IACT") { field(DESC, "Current") field(INP, "BEND:UNDS:3510:IACT CP NMS") field(EGU, "A") field(HOPR, "9.0") field(LOPR, "-9.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "BEND:UNDS:3530:IACTCALC") info(autosaveFields,"HYST") } record(bi, "BEND:UNDS:3530:STATE") { field(DESC, "PS On/Off Status") field(DTYP, "Raw Soft Channel") field(INP, "BEND:UNDS:3510:STATE CP MS") field(ZSV, "MAJOR") field(ZNAM, "OFF") field(ONAM, "ON") } record(ao, "BEND:UNDS:3530:IDES") { field(DESC, "Desired Current") field(PREC, "3") field(EGU, "A") field(HOPR, "9.0") field(LOPR, "-9.0") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(MDEL, "-1") field(HIHI, "9.0") field(LOLO, "-9.0") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "BEND:UNDS:3530:BDELTAS") field(DRVH, "9.0") field(DRVL, "-9.0") field(DOL, "BEND:UNDS:3530: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, "BEND:UNDS:3530:ICTRL PP") } # This record is processed by BEND:UNDS:3530:ICON") # Note: we are not setting alarms here. record(ao, "BEND:UNDS:3530:ICON") { field(DESC, "Config I") field(DTYP, "Soft Channel") field(PREC, "3") field(HOPR, "9.0") field(LOPR, "-9.0") field(DRVH, "9.0") field(DRVL, "-9.0") field(DOL, "BEND:UNDS:3530:B2ICON.K") field(OMSL, "closed_loop") info(autosaveFields,"VAL") } record(ao, "BEND:UNDS:3530:INOM") { field(DESC, "Nominal Current") field(DOL, "BEND:UNDS:3530:BNOM.K") field(OMSL, "closed_loop") field(PREC, "3") field(EGU, "A") field(DRVH, "9.0") field(DRVL, "-9.0") field(HOPR, "9.0") field(LOPR, "-9.0") } record(ao, "BEND:UNDS:3530:ICTRL") { field(DESC, "Set Current") field(PREC, "3") field(EGU, "A") field(HOPR, "9.0") field(LOPR, "-9.0") field(DRVH, "9.0") field(DRVL, "-9.0") field(MDEL, "-1") field(FLNK, "BEND:UNDS:3530:ICTRLGO") field(OMSL, "supervisory") info(autosavefields,"VAL") } record(seq, "BEND:UNDS:3530:ICTRLGO") { field(DESC, "Process Current Setpoint") field(PREC, "3") # Set ISETPT to supervisory field(DOL1, "0") field(LNK1, "BEND:UNDS:3530:ISETPT.OMSL") field(DOL2, "BEND:UNDS:3530:ICTRL") field(LNK2, "BEND:UNDS:3530:ISETPT PP") # Set ISETPT to closed loop - get data from BCTRLSUB.K field(DOL3, "1") field(LNK3, "BEND:UNDS:3530:ISETPT.OMSL") } record(ao, "BEND:UNDS:3530:IMAX") { field(DESC, "Max I") field(DTYP, "Soft Channel") field(DRVH, "9.0") field(DRVL, "-9.0") field(EGU, "A") field(HOPR, "9.0") field(LOPR, "-9.0") field(PREC, "3") field(PINI, "YES") field(VAL, "9.0") field(FLNK, "BEND:UNDS:3530:IMIN") } record(ao, "BEND:UNDS:3530:IMIN") { field(DESC, "Min I") field(DTYP, "Soft Channel") field(DRVH, "9.0") field(DRVL, "-9.0") field(EGU, "A") field(HOPR, "9.0") field(LOPR, "-9.0") field(PREC, "3") field(VAL, "-9.0") field(FLNK, "BEND:UNDS:3530:IRANGE") } record(sel, "BEND:UNDS:3530:IACTPREVOK") { field(DESC, "Last Good Current") field(EGU, "A") field(HOPR, "9.0") field(LOPR, "-9.0") field(PREC, "3") field(NVL, "BEND:UNDS:3530:BACT.SEVR") field(INPA, "BEND:UNDS:3530:IACT NPP MS") field(INPB, "BEND:UNDS:3530:IACTPREVOK NPP MS") field(INPC, "BEND:UNDS:3530:IACTPREVOK NPP MS") field(INPD, "BEND:UNDS:3530:IACTPREVOK NPP MS") } record(sub, "BEND:UNDS:3530:IACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "BEND:UNDS:3530:IDES") field(INPB, "BEND:UNDS:3530:ISETPT.DRVH") field(INPC, "BEND:UNDS:3530:ISETPT.DRVL") field(INPD, "BEND:UNDS:3530:IDELTAS.I") field(INPE, "BEND:UNDS:3530:IDELTAS.J") field(INPG, "BEND:UNDS:3530:STATE") field(INPH, "BEND:UNDS:3530:HSTA") field(EGU, "A") field(HOPR, "9.0") field(LOPR, "-9.0") field(PREC, "3") field(BRSV, "INVALID") } record(sub, "BEND:UNDS:3530:IMONLIMITS") { field(DESC, "Aux Current Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "BEND:UNDS:3530:IDES") field(INPB, "BEND:UNDS:3530:ISETPT.DRVH") field(INPC, "BEND:UNDS:3530:ISETPT.DRVL") field(INPD, "BEND:UNDS:3530:IDELTAS.K") field(INPE, "BEND:UNDS:3530:IDELTAS.L") field(INPG, "BEND:UNDS:3530:STATE") field(INPH, "BEND:UNDS:3530:HSTA") field(EGU, "A") field(HOPR, "9.0") field(LOPR, "-9.0") field(PREC, "3") field(BRSV, "INVALID") } record(seq, "BEND:UNDS:3530:ILIMITS") { field(DESC, "Set ACT and MON Limits") field(PREC, "3") field(DOL1, "BEND:UNDS:3530:BLIMITS") field(LNK1, "BEND:UNDS:3530:IACTLIMITS.F PP") field(DOL2, "BEND:UNDS:3530:IACTLIMITS.I") field(LNK2, "BEND:UNDS:3530:IACT.HIGH") field(DOL3, "BEND:UNDS:3530:IACTLIMITS.J") field(LNK3, "BEND:UNDS:3530:IACT.LOW") field(DOL4, "BEND:UNDS:3530:IACTLIMITS.K") field(LNK4, "BEND:UNDS:3530:IACT.HIHI") field(DOL5, "BEND:UNDS:3530:IACTLIMITS.L") field(LNK5, "BEND:UNDS:3530:IACT.LOLO") field(DOL6, "BEND:UNDS:3530:BLIMITS") field(LNK6, "BEND:UNDS:3530:IMONLIMITS.F PP") field(DOL7, "BEND:UNDS:3530:IMONLIMITS.I") field(LNK7, "BEND:UNDS:3530:IMON.HIGH") field(DOL8, "BEND:UNDS:3530:IMONLIMITS.J") field(LNK8, "BEND:UNDS:3530:IMON.LOW") field(DOL9, "BEND:UNDS:3530:IMONLIMITS.K") field(LNK9, "BEND:UNDS:3530:IMON.HIHI") field(DOLA, "BEND:UNDS:3530:IMONLIMITS.L") field(LNKA, "BEND:UNDS:3530: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, "BEND:UNDS:3530:IDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntRawDeltas") field(INPD, "BEND:UNDS:3530:TRIMBTOL") field(INPE, "BEND:UNDS:3530:CHCKBTOL") field(INPF, "BEND:UNDS:3530:BDELTAS.K") field(INPG, "BEND:UNDS:3530:BDELTAS.L") field(INPH, "BEND:UNDS:3530: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, "BEND:UNDS:3530:STDZITOLR") field(INPC, "BEND:UNDS:3530:STDZITOL") field(FLNK, "") } # All ps controllers with on/off control will set the macro ONOF # as follows: # # ONOF = BEND:UNDS:3510: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, "BEND:UNDS:3530: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 = BEND:UNDS:3510:RESET PP # record(bo, "BEND:UNDS:3530: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, "BEND:UNDS:3530:RAMPSTATE") { field(DESC, "PS Ramp Status") field(DTYP, "Soft Channel") field(DOL, "BEND:UNDS:3510: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, "BEND:UNDS:3530: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, "BEND:UNDS:3530:TRIMRAMPRATE") field(OUT, "") field(FLNK, "BEND:UNDS:3530:STDZDLY") } record(ao, "BEND:UNDS:3530:ISETPT") { field(DESC, "Current Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(EGU, "A") field(HOPR, "9.0") field(LOPR, "-9.0") field(DRVH, "9.0") field(DRVL, "-9.0") field(MDEL, "-1") field(OUT, "") field(DOL, "BEND:UNDS:3530: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, "BEND:UNDS:3530:IMON") { field(DESC, "Aux Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(INP, "BEND:UNDS:3510:IMON CP NMS") field(EGU, "A") field(HOPR, "9.0") field(LOPR, "-9.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "BEND:UNDS:3530:IMONCALC") } record(ao, "BEND:UNDS:3530:IRIPL") { field(DESC, "Ripple Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(DOL, "BEND:UNDS:3510:IRIPL CP NMS") field(OMSL, "closed_loop") field(EGU, "A") field(DRVH, "1.0") field(HOPR, "1.0") field(PREC, "3") field(FLNK, "BEND:UNDS:3530:IRIPLOK") } record(sub, "BEND:UNDS:3530:IRIPLOK") { field(DESC, "Ripple Current Status") field(INAM, "mgntInit") field(SNAM, "mgntRiplOK") field(INPA, "BEND:UNDS:3530:IRIPL.VAL") field(INPB, "BEND:UNDS:3530: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, "BEND:UNDS:3530:R") { field(DESC, "Resistance") field(EGU, "Ohms") field(PREC, "4") field(PINI, "YES") field(DOL, "BEND:UNDS:3510: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, "BEND:UNDS:3530:IGND") { field(DESC, "Ground Current") field(EGU, "A") field(PREC, "6") field(PINI, "YES") field(DOL, "BEND:UNDS:3510:IGND CP MS") field(OMSL, "closed_loop") } record(bi, "BEND:UNDS:3530:INTLKSUMY") { field(DESC, "Interlock Summary") field(INP, "BEND:UNDS:3510:INTLKSUMY CP MS") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(ZNAM, "OK") field(ONAM, "FAULT") field(PINI, "NO") } record(mbbo, "BEND:UNDS:3530: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, "BEND:UNDS:3510:COOLING CP NMS") field(OMSL, "closed_loop") } # The following PV is processed by :BACTFO # which is processed by :BACT record(fanout, "BEND:UNDS:3530:IACTFO") { field(DESC, "IACT processing") field(SELM, "All") field(LNK1, "BEND:UNDS:3530:IACTPREVOK") field(LNK2, "BEND:UNDS:3530:IDIFF") field(LNK3, "BEND:UNDS:3530:IADIFF") field(LNK4, "BEND:UNDS:3530:IRATIO") field(LNK5, "BEND:UNDS:3530:IDIRECT") field(LNK6, "BEND:UNDS:3530:IACTPOL_CHECK") } record(calc, "BEND:UNDS:3530:IDIFF") { field(DESC, "IDES-IACT") field(CALC, "A-B") field(INPA, "BEND:UNDS:3530:IDES") field(INPB, "BEND:UNDS:3530:IACT") field(EGU, "A") field(PREC, "9") field(HOPR, "9.0") field(LOPR, "-9.0") } record(calc, "BEND:UNDS:3530:IADIFF") { field(DESC, "Absolute IDES-IACT") field(CALC, "A<0?ABS(A):A") field(INPA, "BEND:UNDS:3530:IDIFF") field(PREC, "9") } record(calc, "BEND:UNDS:3530:IRATIO") { field(DESC, "IDES-IACT/IMAX") field(CALC, "B?A/B:0") field(INPA, "BEND:UNDS:3530:IDIFF") field(INPB, "BEND:UNDS:3530:IDES.DRVH") field(PREC, "9") } record(calcout, "BEND:UNDS:3530:IRANGE") { field(DESC, "Current Range") field(PINI, "YES") field(CALC, "ABS(A-B)") field(INPA, "BEND:UNDS:3530:IMIN") field(INPB, "BEND:UNDS:3530: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, "BEND:UNDS:3530: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, "BEND:UNDS:3530:IACT") field(FLNK, "BEND:UNDS:3530:IACTPOL") } record(bo, "BEND:UNDS:3530:IACTPOL") { field(DESC, "Actual I Polarity") field(DTYP, "Raw Soft Channel") field(DOL, "BEND:UNDS:3530: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,"BEND:UNDS:3530:I*LIMITS:\n Calculate alarm and warning limits based on \n deltas from BEND:UNDS:3530:IDELTAS and the\n BEND:UNDS:3530: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,"BEND:UNDS:3530:IACT: \n Get copy of BEND:UNDS:3530:I. \n",null) #! TextBox(TB12,1280,3100,1760,3200,0,"Dialog",12,1,16777215,"BEND:UNDS:3530: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,"BEND:UNDS:3530:IDES:\n Contains raw value calculated by \nBEND:UNDS:3530: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 \nBEND:UNDS:3530:BDELTAS.\n",null) #! TextBox(TB10,56,1940,316,2340,0,"Dialog",12,1,16777215,"BEND:UNDS:3530: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 BEND:UNDS:3530: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 BEND:UNDS:3530: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,"BEND:UNDS:3530:ISETPT:\n Sets the hardware. When fast feedback is set on, this record is\n set to closed loop mode by BEND:UNDS:3530:FBCKSTART sequence. When \n the loop is closed, this record takes input calculated by \n BFBCK only. When fast feedback is set off, BEND:UNDS:3530:FBCKSTOP \n will set it back to supervisory so that the value can be set by \n BEND:UNDS:3530: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, "BEND:UNDS:3530:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "BEND:UNDS:3530:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "BEND:UNDS:3530:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "BEND:UNDS:3530:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "BEND:UNDS:3530:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "BEND:UNDS:3530:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "1") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "BEND:UNDS:3530: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, "BEND:UNDS:3530:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "BEND:UNDS:3530:TRIMTYPE.RVAL") field(INPB, "BEND:UNDS:3530:CONFIG.RVAL") field(OUT, "BEND:UNDS:3530:TRIMMAXNUM PP") } record(longout, "BEND:UNDS:3530: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, "BEND:UNDS:3530: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, "BEND:UNDS:3510:TRIMRAMPRATE CP NMS") field(OMSL, "closed_loop") field(VAL, "") field(OUT, "BEND:UNDS:3530:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "BEND:UNDS:3530: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, "BEND:UNDS:3510:TRIMSETL CP NMS") field(OMSL, "closed_loop") field(VAL, "") } record(bo, "BEND:UNDS:3530: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, "BEND:UNDS:3530: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, "BEND:UNDS:3530: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, "BEND:UNDS:3530:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "0") } record(ao, "BEND:UNDS:3530: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, "BEND:UNDS:3530:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "BEND:UNDS:3530: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, "BEND:UNDS:3530: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, "BEND:UNDS:3530:IMOVE") field(INPB, "BEND:UNDS:3530:IACT") field(INPC, "BEND:UNDS:3530:IRAMPRATE") field(INPD, "1.577") field(INPE, "BEND:UNDS:3530:TRIMDLYPCT") field(INPF, "BEND:UNDS:3530:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "BEND:UNDS:3530:RAMPTIME_LEFT PP") } record(longout, "BEND:UNDS:3530:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "BEND:UNDS:3530:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "BEND:UNDS:3530:RAMPDONE_CALC") } record(calc, "BEND:UNDS:3530:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "BEND:UNDS:3530:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "BEND:UNDS:3530:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "BEND:UNDS:3530: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, "BEND:UNDS:3530:RAMPTIME_LEFT") field(OUT, "BEND:UNDS:3530:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "BEND:UNDS:3530:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "BEND:UNDS:3530:RAMPTIME_LEFT NMS") field(OUT, "BEND:UNDS:3530:RAMPDONE PP") } record(bo, "BEND:UNDS:3530:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "BEND:UNDS:3530:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "BEND:UNDS:3530: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, "BEND:UNDS:3530: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, "BEND:UNDS:3530:STDZINIT") { field(DESC, "Proc. Stdz PVs on boot") field(PINI, "YES") field(DOL1, "1") field(DOL2, "1") field(DOL3, "1") field(LNK1, "BEND:UNDS:3530:DEBUG.PROC PP") field(LNK2, "BEND:UNDS:3530:STDZCYCLENUM.PROC PP") field(LNK3, "BEND:UNDS:3530:STDZDISABLE.PROC PP") field(LNK4, "BEND:UNDS:3530: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, "BEND:UNDS:3530:STDZSUB") { field(DESC, "Stdz subroutine") field(INAM, "mgntStdzInit") field(SNAM, "mgntStdz") field(BRSV, "INVALID") field(INPA, "BEND:UNDS:3530:STDZIMIN NPP NMS") field(INPB, "BEND:UNDS:3530:STDZIMAX NPP NMS") field(INPC, "BEND:UNDS:3530:STDZIFINAL NPP NMS") field(INPD, "BEND:UNDS:3530:STDZCYCLENUM NPP NMS") field(INPE, "BEND:UNDS:3530:STDZDIRECT.RVAL NPP NMS") field(INPF, "BEND:UNDS:3530:STDZDISABLE.RVAL CPP NMS") field(INPG, "BEND:UNDS:3530: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, "BEND:UNDS:3530:STDZWF PP") field(OUTB, "BEND:UNDS:3530: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, "BEND:UNDS:3530:STDZWF") } record(mbbo, "BEND:UNDS:3530: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, "BEND:UNDS:3530: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, "BEND:UNDS:3530:STDZMAINPS") { field(DESC, "Stdz by main or self") field(PINI, "YES") field(DTYP, "Soft Channel") field(ZNAM, "SELF") field(ONAM, "MAIN") } record(bo, "BEND:UNDS:3530: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, "BEND:UNDS:3530: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, "BEND:UNDS:3530: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, "BEND:UNDS:3530:STDZTOD") { field(DESC, "Successful Standardize Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "BEND:UNDS:3530:STDZLOSTTOD") { field(DESC, "Standardize Lost Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(longout, "BEND:UNDS:3530:STDZCYCLECNT") { field(DESC, "Cycle Count") field(PINI, "YES") } record(longout, "BEND:UNDS:3530: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, "BEND:UNDS:3530:STDZDIRECT") } # The default standardize direction is "UP" for # all LCLS Magnets.. record(bo, "BEND:UNDS:3530:STDZDIRECT") { field(DESC, "Standardize Direction ") field(ZNAM, "UP") field(ONAM, "DOWN") field(VAL, "0") field(FLNK, "BEND:UNDS:3530:STDZIMIN") } record(ao, "BEND:UNDS:3530:STDZIMIN") { field(DESC, "Min-STDZ Current") field(PREC, "1") field(EGU, "A") field(HOPR, "9.0") field(LOPR, "-9.0") field(VAL, "-9.0") field(FLNK, "BEND:UNDS:3530:STDZIMAX") } record(ao, "BEND:UNDS:3530:STDZIMAX") { field(DESC, "Max. Standarize Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "9.0") field(LOPR, "-9.0") field(VAL, "9.0") field(FLNK, "BEND:UNDS:3530:STDZIFINAL") } record(ao, "BEND:UNDS:3530:STDZIFINAL") { field(DESC, "Final SDTZ Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "9.0") field(LOPR, "-9.0") field(VAL, "-9.0") field(FLNK, "BEND:UNDS:3530: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, "BEND:UNDS:3530: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, "BEND:UNDS:3530:STDZITOL") { field(DESC, "Stdz min tolerance") field(PREC, "5") field(CALC, "MAX(ABS(A),ABS(B))*C") field(INPA, "BEND:UNDS:3530:STDZIMIN CP NMS") field(INPB, "BEND:UNDS:3530:STDZIMAX CP MMS") field(INPC, "0.05") field(INPD, "BEND:UNDS:3530:STDZITOLR CP MMS") field(EGU, "A") field(FLNK, "BEND:UNDS:3530:IDELTAS") field(PINI, "YES") } # D - factor (3.154/2 = 1.577) for EPSC, otherwise, set to 1.0 record(calc, "BEND:UNDS:3530:STDZDLY") { field(DESC, "Ramp time for stdz cycle") field(CALC, "C>0?MAX(1,ABS((A-B)/C)*D):0") field(INPA, "BEND:UNDS:3530:STDZIMIN CP NMS") field(INPB, "BEND:UNDS:3530:STDZIMAX CP NMS") field(INPC, "BEND:UNDS:3530:TRIMRAMPRATE CP NMS") field(INPD, "1.0") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") } record(calc, "BEND:UNDS:3530:STDZRAMPDLY") { field(DESC, "Ramp delay total") field(CALC, "MAX(1,((A/100)*B+B))") field(PREC, "5") field(INPA, "BEND:UNDS:3530:TRIMDLYPCT CP MS") field(INPB, "BEND:UNDS:3530: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, "BEND:UNDS:3530:STDZMINIDLY") { field(DESC, "Mini-stdz delay") field(CALC, "A") field(PREC, "5") field(A, "1.0") field(EGU, "sec") field(PINI, "YES") } record(ao, "BEND:UNDS:3530: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, "BEND:UNDS:3530:STDZMINIDELTA") { field(DESC, "Stdz mini % of IMAX") field(CALC, "(B/100)*(A-C)") field(INPA, "BEND:UNDS:3530:IDES.HOPR") field(INPB, "BEND:UNDS:3530:STDZMINIPCT CPP NMS") field(INPC, "BEND:UNDS:3530:IDES.LOPR") field(PREC, "5") } record(calc, "BEND:UNDS:3530:STDZMINISETPT") { field(DESC, "Mini Stdz delta") field(CALC, "C==0?MAX(E-D,B):MIN(E+D,A)") field(INPA, "BEND:UNDS:3530:IDES.HOPR") field(INPB, "BEND:UNDS:3530:IDES.LOPR") field(INPC, "BEND:UNDS:3530:STDZDIRECT.RVAL") field(INPD, "BEND:UNDS:3530:STDZMINIDELTA") field(INPE, "BEND:UNDS:3530:IDES") field(PREC, "5") field(FLNK, "BEND:UNDS:3530: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, "BEND:UNDS:3530:STDZMINISETPTOOR") { field(DESC, "Mini Stdz setpoint out of range") field(CALC, "C==0?(E-DA)") field(INPA, "BEND:UNDS:3530:IDES.HOPR") field(INPB, "BEND:UNDS:3530:IDES.LOPR") field(INPC, "BEND:UNDS:3530:STDZDIRECT.RVAL") field(INPD, "BEND:UNDS:3530:STDZMINIDELTA") field(INPE, "BEND:UNDS:3530: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, "BEND:UNDS:3530: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, "BEND:UNDS:3530:IADJUST.RVAL") field(INPB, "BEND:UNDS:3530:STDZDIRECT.RVAL") field(INPC, "BEND:UNDS:3530:STDZOK.RVAL") field(INPD, "BEND:UNDS:3530:STDZDISABLE.RVAL") field(INPE, "BEND:UNDS:3530:STATE.RVAL CPP NMS") field(INPF, "BEND:UNDS:3530:ICTRL.RVAL") field(INPG, "BEND:UNDS:3530:STATE.SEVR") field(INPH, "BEND:UNDS:3530:BDELTAS.M") field(INPI, "BEND:UNDS:3530:IACT.SEVR") field(OUT, "BEND:UNDS:3530:STDZLOSTGO.SELN PP NMS") field(OOPT, "Transition To Non-zero") } record(seq, "BEND:UNDS:3530:STDZLOSTGO") { field(DESC, "Process lost stdz") field(SELM, "Mask") field(DOL1, "1") field(DOL2, "0") field(LNK1, "BEND:UNDS:3530:STDZLOSTTOD.PROC") field(LNK2, "BEND:UNDS:3530:STDZOK PP") } # Record maximum current after standardize # Reset to IACT from sequence after trim # Disable processing during (mini-)standardize or trim record(calc, "BEND:UNDS:3530:STDZIACTMAX") { field(DESC, "Max act current after stdz") field(CALC, "MAX(A, B)") field(DISV, "0") field(SDIS, "BEND:UNDS:3530:CHECKPWRDIP_ENABLE") field(INPA, "BEND:UNDS:3530:IACT CP") field(INPB, "BEND:UNDS:3530:STDZIACTMAX") field(EGU, "A") field(FLNK, "BEND:UNDS:3530:CHECKPWRDIP") } # Detect power dip if STDZOK is YES, STDZ is enabled, and IACT is valid # If IACT drops below STDZIACTMAX by more than the trim tolerance, clear STDZOK # Warning: Take the absolute value of the trim tolerance, or else quads of # negative polarity will always lose STDZ since their IDELTAS.I are negative. # Note: Large quads and bends are prone to losing STDZ even if they are # perturbed toward higher current since their current tends to overshoot # by greater than the trim tolerance before settling down. record(calcout, "BEND:UNDS:3530:CHECKPWRDIP") { field(DESC, "Detect power dip") field(CALC, "(A-B>ABS(C))?3:0") field(DISV, "0") field(SDIS, "BEND:UNDS:3530:CHECKPWRDIP_ENABLE") field(INPA, "BEND:UNDS:3530:STDZIACTMAX") field(INPB, "BEND:UNDS:3530:IACT") field(INPC, "BEND:UNDS:3530:IDELTAS.I") field(OUT, "BEND:UNDS:3530:STDZLOSTGO.SELN PP NMS") field(OOPT, "When Non-zero") } # Enable processing of STDZIACTMAX and CHECKPWRDIP only if # STDZOK = YES, STDZDISABLE = NO, CTRL != Trim (2), and # CTRL != Stdz (4) record(calc, "BEND:UNDS:3530:CHECKPWRDIP_ENABLE") { field(CALC, "A&&!B&&(C#2)&&(C#4)") field(INPA, "BEND:UNDS:3530:STDZOK.RVAL CP") field(INPB, "BEND:UNDS:3530:STDZDISABLE.RVAL CP") field(INPC, "BEND:UNDS:3530:CTRL.RVAL CP") } #! 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, "BEND:UNDS:3530: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, "BEND:UNDS:3530: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, "BEND:UNDS:3530:CALBSET") { field(DESC, "Use DAC Calbration") field(SCAN, "10 second") field(CALC, "A&&(B==0)&&C?31:960") field(INPA, "BEND:UNDS:3530:CALBOK") field(INPB, "BEND:UNDS:3530:CALBDISABLE") field(INPC, "BEND:UNDS:3530:CALBSLOPE") field(OOPT, "On Change") field(OUT, "BEND:UNDS:3530: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, "BEND:UNDS:3530:CALB_SEQ") { field(DESC, "Output Calib Values") field(SELM, "Mask") field(SELL, "BEND:UNDS:3530: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, "BEND:UNDS:3530:CALBSLOPE") field(DOL3, "BEND:UNDS:3530: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, "BEND:UNDS:3530:CALBTOD") { field(DESC, "Calibration Success Time") field(PINI, "YES") # field(DOL, "") field(OMSL, "supervisory") field(DTYP, "Soft Channel") info(autosaveFields,"VAL") } record(ao, "BEND:UNDS:3530: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, "BEND:UNDS:3530: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, "BEND:UNDS:3530: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, "BEND:UNDS:3530:CALBOFFSET") { field(DESC, "Calc DAC Offset") field(PREC, "6") field(EGU, "Counts") field(PINI, "YES") } record(bo, "BEND:UNDS:3530: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, "BEND:UNDS:3530:DACSLOPE") { field(DESC, "V to DAC slope") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "supervisory") field(PINI, "YES") field(FLNK, "BEND:UNDS:3530:DACOFFSET") } # Default Offset used in conversion from Volts to DAC Counts record(ao, "BEND:UNDS:3530:DACOFFSET") { field(DESC, "V to DAC offset") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "supervisory") field(PINI, "YES") field(FLNK, "BEND:UNDS:3530: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, "BEND:UNDS:3530: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, "BEND:UNDS:3530:IACT") field(INPD, "BEND:UNDS:3530:DACSLOPE") field(INPE, "BEND:UNDS:3530:DACOFFSET") field(EGU, "Counts") field(PREC, "6") } record(ao, "BEND:UNDS:3530:DAC") { field(DESC, "DAC Set point") field(EGU, "Counts") field(DOL, "") field(OMSL, "supervisory") field(PREC, "6") field(PINI, "YES") } record(ao, "BEND:UNDS:3530:CALBIMIN") { field(DESC, "Calibration Min Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(DRVH, "9.0") field(HOPR, "9.0") field(DRVL, "-9.0") field(LOPR, "-9.0") field(PREC, "3") field(EGU, "A") field(VAL, "0.0") field(FLNK, "BEND:UNDS:3530:CALBIMAX") } record(ao, "BEND:UNDS:3530:CALBIMAX") { field(DESC, "Calibration Max Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(DRVH, "9.0") field(HOPR, "9.0") field(LOPR, "-9.0") field(DRVL, "-9.0") field(EGU, "A") field(VAL, "9.0") field(FLNK, "BEND:UNDS:3530:CALBSTEPNUM") } record(ao, "BEND:UNDS:3530:CALBIFINAL") { field(DESC, "Calibration Last Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(PREC, "3") field(EGU, "A") field(HOPR, "9.0") field(LOPR, "-9.0") field(VAL, "0") } record(longout, "BEND:UNDS:3530: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, "BEND:UNDS:3530:CALBIDELTA") } record(calc, "BEND:UNDS:3530:CALBIDELTA") { field(DESC, "Step size for CALB") field(CALC, "C=0?0:ABS((A-B)/C)") field(INPA, "BEND:UNDS:3530:CALBIMAX") field(INPB, "BEND:UNDS:3530:CALBIMIN") field(INPC, "BEND:UNDS:3530: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, "BEND:UNDS:3530:CALBIMULT") { field(DESC, "IACT vs ISETPT mult") field(CALC, "C#0||A=0?1:ABS(B/A)") field(INPA, "BEND:UNDS:3510:ISETPT.DRVH") field(INPB, "BEND:UNDS:3510:IACT.HOPR") field(INPC, "BEND:UNDS:3530:PSCONTROLLER.RVAL CPP") field(EGU, "A") field(PINI, "YES") } # SNL dbputs DAC values here. 6-10 steps are possible. record(waveform, "BEND:UNDS:3530:CALBICTRLWF") { field(DESC, "ICTRL setpoint array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") } record(waveform, "BEND:UNDS:3530:DACWF") { field(DESC, "DAC count array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "BEND:UNDS:3530:DACSA") } # Used only for xygraph edm plot record(subArray, "BEND:UNDS:3530:DACSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "BEND:UNDS:3530: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, "BEND:UNDS:3530:CALCDACWF") { field(DESC, "Calc DAC counts array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "BEND:UNDS:3530:CALCDACSA") } # Used only for xygraph edm plot record(subArray, "BEND:UNDS:3530:CALCDACSA") { field(DESC, "Calc DAC counts") field(DTYP, "Soft Channel") field(INP, "BEND:UNDS:3530: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, "BEND:UNDS:3530:CALBYWF") { field(DESC, "mx + b") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "BEND:UNDS:3530:CALBYSA") } # Used only for xygraph edm plot record(subArray, "BEND:UNDS:3530:CALBYSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "BEND:UNDS:3530:CALBYWF") field(MALM, "10") field(NELM, "6") field(INDX, "0") field(FTVL, "DOUBLE") } record(waveform, "BEND:UNDS:3530:CALBIACTWF") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "BEND:UNDS:3530:CALBIACTSA") } # Used only for xygraph edm plot record(subArray, "BEND:UNDS:3530:CALBIACTSA") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(MALM, "10") field(NELM, "6") field(INP, "BEND:UNDS:3530:CALBIACTWF") field(INDX, "0") field(FTVL, "DOUBLE") field(FLNK, "BEND:UNDS:3530:CALBLIMITS") } # Check that measured current during calibration is within # tolerance. record(aSub, "BEND:UNDS:3530: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, "BEND:UNDS:3530:CALBSTEPNUM") field(INPB, "BEND:UNDS:3530:CALBIACTWF") field(INPC, "BEND:UNDS:3530: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, "BEND:UNDS:3530: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, "BEND:UNDS:3530:STDZITOL") field(INPH, "BEND:UNDS:3530:DACSLOPE") field(INPI, "BEND:UNDS:3530: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, "BEND:UNDS:3530: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, "BEND:UNDS:3530:CALBSTEPNUM") field(INPB, "BEND:UNDS:3530:CALBIACTWF") field(INPC, "BEND:UNDS:3530:DACWF") field(INPF, "BEND:UNDS:3530: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 BEND:UNDS:3530CALBOK 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, "BEND:UNDS:3530:DEGAUSINIT") { field(DESC, "Proc. Degauss PVs on boot") field(PINI, "YES") field(DOL, "1") field(OUTA, "BEND:UNDS:3530:DEGAUSIMIN.PROC PP") field(OUTB, "BEND:UNDS:3530:DEGAUSIMAX.PROC PP") field(OUTC, "BEND:UNDS:3530:DEGAUSTYPE.PROC PP") field(OUTD, "BEND:UNDS:3530:DEGAUSSTEP.PROC PP") field(OUTE, "BEND:UNDS:3530:MADNAME.PROC PP") field(OUTF, "BEND:UNDS:3530:PSTYPE.PROC PP") field(OUTG, "BEND:UNDS:3530: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, "BEND:UNDS:3530:DEGAUSSUB") { field(DESC, "Degauss subroutine") field(INAM, "mgntDegaussInit") field(SNAM, "mgntDegauss") field(BRSV, "INVALID") field(INPA, "BEND:UNDS:3530:DEGAUSIMIN NPP NMS") field(INPB, "BEND:UNDS:3530:DEGAUSIMAX NPP NMS") field(INPC, "BEND:UNDS:3530:DEGAUSTYPE.RVAL NPP NMS") field(INPE, "BEND:UNDS:3530:DEGAUSMETHOD.RVAL NPP NMS") field(INPF, "BEND:UNDS:3530:PSTYPE NPP NMS") field(INPG, "BEND:UNDS:3530:DEBUG.RVAL NPP NMS") field(INPH, "BEND:UNDS:3530: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, "BEND:UNDS:3530:DEGAUSWF PP") field(OUTB, "BEND:UNDS:3530:DEGAUSMSG PP") field(OUTC, "BEND:UNDS:3530: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, "BEND:UNDS:3530:DEGAUSWF") { field(DESC, "Degauss Setpts") field(NELM, "60") field(FTVL, "DOUBLE") } record(mbbo,"BEND:UNDS:3530: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, "BEND:UNDS:3530: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, "BEND:UNDS:3530: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, "BEND:UNDS:3530: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, "BEND:UNDS:3530: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, "BEND:UNDS:3530:DEGAUSIMIN") { field(DESC, "Min. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "9.0") field(LOPR, "-9.0") field(DRVH, "9.0") field(DRVL, "-9.0") field(VAL, "-9.0") } record(ao, "BEND:UNDS:3530:DEGAUSIMAX") { field(DESC, "Max. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "9.0") field(LOPR, "-9.0") field(DRVH, "9.0") field(DRVL, "-9.0") field(VAL, "9.0") } # 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,"BEND:UNDS:3530: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, "BEND:UNDS:3530: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,"BEND:UNDS:3530: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, "BEND:UNDS:3530: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, "BEND:UNDS:3530: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, "BEND:UNDS:3530: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, "BEND:UNDS:3530:DEGAUSTOD") { field(DESC, "Successful Degauss Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "BEND:UNDS:3530:DEGAUSLOSTTOD") { field(DESC, "Degauss Lost Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "BEND:UNDS:3530:DEGAUSTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "BEND:UNDS:3530:DEGAUSTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "BEND:UNDS:3530: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, "BEND:UNDS:3530:DEGAUSGO") { field(DESC, "Set bdes of btrms to zero") field(ASG, "Internal") field(OUTA, "") field(OUTB, "") field(OUTC, "") field(OUTD, "") } # =========== CRYO ONLY =========== record(bo, "BEND:UNDS:3530: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, "BEND:UNDS:3530:DEGAUS_IMAX_CHECK") { field(DESC, "Check if imax shoud chg") field(CALC, "(C==4)&&(ABS(B)>ABS(A))?1:0") field(INPA, "BEND:UNDS:3530:DEGAUS_IMAX") field(INPB, "BEND:UNDS:3530:ISETPT") field(INPC, "BEND:UNDS:3530:DEGAUSTYPE.RVAL") field(OUT, "BEND:UNDS:3530:DEGAUS_IMAX_UPDATE.SELN") field(FLNK, "BEND:UNDS:3530:DEGAUS_IMAX_UPDATE") } record(seq, "BEND:UNDS:3530:DEGAUS_IMAX_UPDATE") { field(DESC, "Degauss IMAX Update") field(SELM, "Specified") field(DOL1, "BEND:UNDS:3530:ISETPT") field(LNK1, "BEND:UNDS:3530:DEGAUS_IMAX PP") } # Set the maximum current after a successful # degauss. This pv is updated by the # sequence. record(ao, "BEND:UNDS:3530:DEGAUS_IMAX") { field(DESC, "Max I set afer a degauss") field(EGU, "Amps") field(PINI, "YES") field(PREC, "6") field(HOPR, "9.0") field(LOPR, "-9.0") field(DRVH, "9.0") field(DRVL, "-9.0") field(VAL, "9.0") field(FLNK, "BEND:UNDS:3530:DEGAUS_IMAXPOL_CHECK") info(autosaveFields,"VAL,RVAL") } # Set the polarity if degauss_imax record(calcout, "BEND:UNDS:3530:DEGAUS_IMAXPOL_CHECK") { field(DESC, "Determine polarity of imax") field(CALC, "A>=0?0:1") field(INPA, "BEND:UNDS:3530:DEGAUS_IMAX") field(FLNK, "BEND:UNDS:3530:DEGAUS_IMAXPOL") } record(bo, "BEND:UNDS:3530:DEGAUS_IMAXPOL") { field(DESC, "Polarity of imax I") field(DTYP, "Raw Soft Channel") field(DOL, "BEND:UNDS:3530:DEGAUS_IMAXPOL_CHECK") field(OMSL, "closed_loop") field(ZNAM, "Positive") field(ONAM, "Negative") field(FLNK, "BEND:UNDS:3530: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, "BEND:UNDS:3530:DEGAUS_ABSIMAX") { field(DESC, "Absolute Max. Degauss I") field(CALC, "ABS(A)") field(INPA, "BEND:UNDS:3530:DEGAUS_IMAX") field(PREC, "6") field(EGU, "Amps") field(HOPR, "9.0") field(LOPR, "-9.0") info(autosaveFields,"VAL RVAL") } # IACT Polarity record(calcout, "BEND:UNDS:3530:IACTPOL_CHECK") { field(DESC, "Determine IACT polarity") field(SCAN, "5 second") field(CALC, "ABS(A-B)>C?(A>=0?0:1):D") field(INPA, "BEND:UNDS:3530:IACT") field(INPB, "BEND:UNDS:3530:IACTPOL_CHECK.LA") field(INPC, "0.0001") field(INPD, "BEND:UNDS:3530:IACTPOL_CHECK.PVAL") field(OOPT, "On Change") field(FLNK, "BEND:UNDS:3530:IACTPOL") } record(bo, "BEND:UNDS:3530: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,"BEND:UNDS:3530: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, "BEND:UNDS:3530:DEGAUSENABLE CP") field(INPB, "BEND:UNDS:3530:DEGAUSOK") field(INPC, "BEND:UNDS:3530:STATE CP") field(INPD, "BEND:UNDS:3530:STATE.SEVR") field(OUT, "BEND:UNDS:3530:DEGAUS_STATE_SEQ.SELN PP") field(ASG, "Internal") } record(seq, "BEND:UNDS:3530:DEGAUS_STATE_SEQ") { field(DESC, "Degauss State Sequence") field(SELM, "Specified") field(SELL, "BEND:UNDS:3530:DEGAUS_STATE_CHECK") field(LNK1, "BEND:UNDS:3530:DEGAUS_STATE_DISABLE.PROC PP") field(LNK2, "BEND:UNDS:3530:DEGAUS_STATE_LOST.PROC PP") field(LNK3, "BEND:UNDS:3530:DEGAUS_STATE_GOOD.PROC PP") field(LNK4, "BEND:UNDS:3530: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, "BEND:UNDS:3530:DEGAUS_STATE_DISABLE") { field(DESC, "Degauss not used") field(LNK1, "BEND:UNDS:3530:DEGAUSOK.ZSV") field(LNK2, "BEND:UNDS:3530: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, "BEND:UNDS:3530:STATMSG.FRSV") field(LNK4, "BEND:UNDS:3530: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, "BEND:UNDS:3530:DEGAUS_STATE_LOST") { field(DESC, "Degauss lost and ps On") field(DOL1, "1") field(LNK1, "BEND:UNDS:3530:DEGAUSOK.ZSV") field(LNK2, "BEND:UNDS:3530: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, "BEND:UNDS:3530:STATMSG.FRSV") field(LNK4, "BEND:UNDS:3530: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, "BEND:UNDS:3530:DEGAUS_STATE_OFF") { field(DESC, "Degaused lost and ps Off") field(DOL1, "2") field(LNK1, "BEND:UNDS:3530: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, "BEND:UNDS:3530:STATMSG.FRSV") field(LNK3, "BEND:UNDS:3530: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, "BEND:UNDS:3530:DEGAUS_STATE_GOOD") { field(DESC, "Degauss good") field(DOL1, "1") field(LNK1, "BEND:UNDS:3530: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, "BEND:UNDS:3530:STATMSG.FRSV PP") field(LNK3, "BEND:UNDS:3530:STATMSG.FVSV PP") field(LNK4, "") field(ASG, "Internal") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(mbbo, "BEND:UNDS:3530:FUNC") { field(DESC, "BEND:UNDS:3530 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, "0") field(FFVL, "0") field(OUT, "BEND:UNDS:3530:CTRL CA") } # :CTRL pv is processed at boot in the # sequence mgntCtrl.st Processed in sequence # record(mbbo, "BEND:UNDS:3530:CTRL") { field(DESC, "BEND:UNDS:3530 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, "BEND:UNDS:3530:SELECTEN.A PP") field(SDIS, "0") } # If a function has been selected set this unit to busy record(calcout, "BEND:UNDS:3530:SELECTEN") { field(DESC, "Control Select Enable") field(CALC, "A>0?1:A") field(FLNK, "BEND:UNDS:3530:BUSY") } # Set to FREE on IOC reboot record(bo, "BEND:UNDS:3530:BUSY") { field(DESC, "BEND:UNDS:3530 Ctrl Done") field(DOL, "BEND:UNDS:3530:SELECTEN") field(ZNAM, "FREE") field(ONAM, "BUSY") field(PINI, "YES") field(FLNK, "BEND:UNDS:3530:SELECT") } record(bo, "BEND:UNDS:3530:SELECT") { field(ZNAM, "NO") field(ONAM, "YES") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") } record(bo, "BEND:UNDS:3530: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, "BEND:UNDS:3530:CTRLSTATE") { field(DESC, "BEND:UNDS:3530 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("BEND:UNDS:3530:CTRL",20,20,0,0,"BEND:UNDS:3530:CTRL") #! Field("BEND:UNDS:3530:CTRL.OUT",16777215,1,"BEND:UNDS:3530:CTRL.OUT") #! Link("BEND:UNDS:3530:CTRL.OUT","BEND:UNDS:3530:SELECTEN.A") #! Field("BEND:UNDS:3530:CTRL.VAL",16777215,1,"BEND:UNDS:3530:CTRL.VAL") #! Record("BEND:UNDS:3530:SELECTEN",321,381,0,0,"BEND:UNDS:3530:SELECTEN") #! Field("BEND:UNDS:3530:SELECTEN.A",16777215,0,"BEND:UNDS:3530:SELECTEN.A") #! Field("BEND:UNDS:3530:SELECTEN.FLNK",16777215,1,"BEND:UNDS:3530:SELECTEN.FLNK") #! Link("BEND:UNDS:3530:SELECTEN.FLNK","BEND:UNDS:3530:BUSY") #! Field("BEND:UNDS:3530:SELECTEN.VAL",16777215,1,"BEND:UNDS:3530:SELECTEN.VAL") #! Record("BEND:UNDS:3530:BUSY",623,274,0,0,"BEND:UNDS:3530:BUSY") #! Field("BEND:UNDS:3530:BUSY.DOL",16777215,0,"BEND:UNDS:3530:BUSY.DOL") #! Link("BEND:UNDS:3530:BUSY.DOL","BEND:UNDS:3530:SELECTEN.VAL") #! Field("BEND:UNDS:3530:BUSY.FLNK",16777215,1,"BEND:UNDS:3530:BUSY.FLNK") #! Link("BEND:UNDS:3530:BUSY.FLNK","BEND:UNDS:3530:SELECT") #! Record("BEND:UNDS:3530:SELECT",669,508,0,1,"BEND:UNDS:3530:SELECT") #! Record("BEND:UNDS:3530:FUNC",940,120,0,0,"BEND:UNDS:3530:FUNC") #! Field("BEND:UNDS:3530:FUNC.OUT",16777215,0,"BEND:UNDS:3530:FUNC.OUT") #! Link("BEND:UNDS:3530:FUNC.OUT","BEND:UNDS:3530:CTRL.VAL") #! Record("BEND:UNDS:3530:ABORT",193,41,0,0,"BEND:UNDS:3530:ABORT") #! Record("BEND:UNDS:3530:CTRLSTATE",369,34,0,0,"BEND:UNDS:3530: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,"BEND:UNDS:3530:SELECT is used for Multi-device selection.\nIt is enabled when associated BEND:UNDS:3530:CTRL is \"0\" (DONE).\nIt is disabled when associated BEND:UNDS:3530: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,"BEND:UNDS:3530: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, "BEND:UNDS:3530:BCTRL_INIT") { field(DESC, "Process BCTRL on boot") field(PINI, "YES") field(CALC, "A=3?1:0") field(INPA, "BEND:UNDS:3530:BCTRL.SEVR") field(OUT, "BEND:UNDS:3530: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, "BEND:UNDS:3530:BACT") { field(DESC, "Actual B") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "BEND:UNDS:3530:BACT") field(INPB, "BEND:UNDS:3530:POLYCOEF") field(INPC, "BEND:UNDS:3530:POLYCOEF.A") field(INPD, "BEND:UNDS:3530:POLYCOEF.B") field(INPE, "BEND:UNDS:3530:IACTCALC MS") field(INPF, "BEND:UNDS:3530:BDELTAS PP") field(INPG, "100") field(EGU, "kG-m") field(HOPR, "2.68") field(LOPR, "0.0") field(HIHI, "2.68") field(LOLO, "0.0") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "2.68") field(LOW, "0.0") field(FLNK, "BEND:UNDS:3530: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, "BEND:UNDS:3530:BDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntPhyDeltas") field(EGU, "kG-m") field(HOPR, "1") field(PREC, "7") field(BRSV, "INVALID") field(INPA, "BEND:UNDS:3530:BDES") field(INPB, "BEND:UNDS:3530:TRIMBTOL") field(INPC, "BEND:UNDS:3530:TRIMBTOLR") field(INPD, "BEND:UNDS:3530:CHCKBTOL") field(INPE, "BEND:UNDS:3530:CHCKBTOLR") field(F, "2.0") field(INPG, "30") field(INPH, "BEND:UNDS:3530:BACT.VAL") # # MPS absolute and relative tolerances field(INPP, "BEND:UNDS:3530:MPSBTOL") field(INPQ, "BEND:UNDS:3530:MPSBTOLR") field(FLNK, "BEND:UNDS:3530:BCONLIMITS") info(autosaveFields,"F") } # This record is processed by BDELTAS record(aSub, "BEND:UNDS:3530:BCONLIMITS") { field(DESC, "Config B-field Limits") field(INAM, "mgntInit") field(SNAM, "mgntBCONLimits") field(INPA, "BEND:UNDS:3530:BDES") field(INPB, "BEND:UNDS:3530:BDELTAS.I") field(INPG, "BEND:UNDS:3530:DEBUG.RVAL") field(FTA, "DOUBLE") field(FTB, "DOUBLE") field(FTG, "ULONG") field(OUTA, "BEND:UNDS:3530:BCON.HIGH") field(OUTB, "BEND:UNDS:3530:BCON.LOW") field(OUTC, "BEND:UNDS:3530:BCON.HIHI") field(OUTD, "BEND:UNDS:3530:BCON.LOLO PP") field(FTVA, "DOUBLE") field(FTVB, "DOUBLE") field(FTVC, "DOUBLE") field(FTVD, "DOUBLE") field(BRSV, "INVALID") field(FLNK, "BEND:UNDS:3530:IDELTAS") } # The following PV is processed by :BACT # which is processed by :BACT # record(fanout, "BEND:UNDS:3530:BACTFO") { field(DESC, "BACT processing") field(SELM, "All") field(LNK1, "BEND:UNDS:3530:BDIFF") field(LNK2, "BEND:UNDS:3530:BADIFF") field(LNK3, "BEND:UNDS:3530:BRATIO") field(LNK4, "BEND:UNDS:3530:MPSLIMITS") field(LNK5, "BEND:UNDS:3530:I2BSTATUS") field(LNK6, "BEND:UNDS:3530:IACTFO.PROC") } record(calc, "BEND:UNDS:3530:BDIFF") { field(DESC, "BDES-BACT") field(CALC, "A-B") field(INPA, "BEND:UNDS:3530:BDES") field(INPB, "BEND:UNDS:3530:BACT") field(EGU, "kG-m") field(PREC, "7") } record(calc, "BEND:UNDS:3530:BADIFF") { field(DESC, "Absolute BDES-BACT") field(INPA, "BEND:UNDS:3530:BDIFF") field(EGU, "kG-m") field(PREC, "7") field(CALC, "A<0?ABS(A):A") } record(calc, "BEND:UNDS:3530:BRATIO") { field(DESC, "BACT Error") field(CALC, "B?A/B:0") field(INPA, "BEND:UNDS:3530:BDIFF") field(INPB, "BEND:UNDS:3530:BDES.HOPR") field(EGU, "kG-m") field(PREC, "7") } record(mbbi, "BEND:UNDS:3530: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, "BEND:UNDS:3530:BACT.J") } # Note: for a string slave set the MONFL # macro to the following: # MONFL=:IMONCALC MS record(sub, "BEND:UNDS:3530:BMON") { field(DESC, "Second Transductor") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "BEND:UNDS:3530:BMON") field(INPB, "BEND:UNDS:3530:POLYCOEF") field(INPC, "BEND:UNDS:3530:POLYCOEF.A") field(INPD, "BEND:UNDS:3530:POLYCOEF.B") field(INPE, "BEND:UNDS:3530:IMONCALC MS") field(INPF, "BEND:UNDS:3530:BDELTAS.VAL") field(INPG, "100") field(EGU, "kG-m") field(HOPR, "2.68") field(LOPR, "0.0") field(HIHI, "2.68") field(LOLO, "0.0") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "2.68") field(LOW, "0.0") } # 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=BEND:UNDS:3510:BDES CP record(ao, "BEND:UNDS:3530:BDES") { field(DESC, "Desired B-Field") field(PINI, "NO") field(DRVH, "2.68") field(DRVL, "0.0") field(HOPR, "2.68") field(LOPR, "0.0") field(PREC, "7") field(EGU, "kG-m") field(MDEL, "-1") field(OMSL, "closed_loop") field(DOL, "BEND:UNDS:3530:IDES2BDES") field(OUT, "BEND:UNDS:3530:B2IDES PP") info(autosaveFields,"VAL") } record(sub, "BEND:UNDS:3530:B2IDES") { field(DESC, "Convert Desired B-Field to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "BEND:UNDS:3530:POLYCOEF") field(INPC, "BEND:UNDS:3530:POLYCOEF.A") field(INPD, "BEND:UNDS:3530:POLYCOEF.B") field(PREC, "7") field(EGU, "kG-m") field(HOPR, "2.68") field(LOPR, "0.0") field(MDEL, "-1") field(INPE, "BEND:UNDS:3530:BDES.DRVH") field(INPF, "BEND:UNDS:3530:BDES.DRVL") field(BRSV, "INVALID") field(FLNK, "BEND:UNDS:3530:IDES") } record(sub, "BEND:UNDS:3530:BNOM") { field(DESC, "Nominal Field") field(PINI, "YES") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "BEND:UNDS:3530:POLYCOEF") field(INPC, "BEND:UNDS:3530:POLYCOEF.A") field(INPD, "BEND:UNDS:3530:POLYCOEF.B") field(INPE, "BEND:UNDS:3530:BDES.DRVH") field(INPF, "BEND:UNDS:3530:BDES.DRVL") field(EGU, "kG-m") field(HOPR, "2.68") field(LOPR, "0.0") field(PREC, "7") field(VAL, "0.0") field(FLNK, "BEND:UNDS:3530:INOM") } record(sub, "BEND:UNDS:3530:BACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "BEND:UNDS:3530:BDES.VAL") field(INPB, "BEND:UNDS:3530:BDES.DRVH") field(INPC, "BEND:UNDS:3530:BDES.DRVL") field(INPD, "BEND:UNDS:3530:BDELTAS.I") field(INPE, "BEND:UNDS:3530:BDELTAS.J") field(INPG, "BEND:UNDS:3530:STATE") field(INPH, "BEND:UNDS:3530:HSTA") field(EGU, "kG-m") field(HOPR, "2.68") field(LOPR, "0.0") field(PREC, "7") field(BRSV, "INVALID") } record(sub, "BEND:UNDS:3530:BMONLIMITS") { field(DESC, "MON Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "BEND:UNDS:3530:BDES.VAL") field(INPB, "BEND:UNDS:3530:BDES.DRVH") field(INPC, "BEND:UNDS:3530:BDES.DRVL") field(INPD, "BEND:UNDS:3530:BDELTAS.K") field(INPE, "BEND:UNDS:3530:BDELTAS.L") field(INPG, "BEND:UNDS:3530:STATE") field(INPH, "BEND:UNDS:3530:HSTA") field(EGU, "kG-m") field(HOPR, "2.68") field(LOPR, "0.0") field(PREC, "7") field(BRSV, "INVALID") } record(seq, "BEND:UNDS:3530:BLIMITS") { field(DESC, "ACT Limits") field(PREC, "7") field(DOL1, "BEND:UNDS:3530:BLIMITS") field(LNK1, "BEND:UNDS:3530:BACTLIMITS.F PP") field(DOL2, "BEND:UNDS:3530:BACTLIMITS.I") field(LNK2, "BEND:UNDS:3530:BACT.HIGH") field(DOL3, "BEND:UNDS:3530:BACTLIMITS.J") field(LNK3, "BEND:UNDS:3530:BACT.LOW") field(DOL4, "BEND:UNDS:3530:BACTLIMITS.K") field(LNK4, "BEND:UNDS:3530:BACT.HIHI") field(DOL5, "BEND:UNDS:3530:BACTLIMITS.L") field(LNK5, "BEND:UNDS:3530:BACT.LOLO") field(DOL6, "BEND:UNDS:3530:BLIMITS") field(LNK6, "BEND:UNDS:3530:BMONLIMITS.F PP") field(DOL7, "BEND:UNDS:3530:BMONLIMITS.I") field(LNK7, "BEND:UNDS:3530:BMON.HIGH") field(DOL8, "BEND:UNDS:3530:BMONLIMITS.J") field(LNK8, "BEND:UNDS:3530:BMON.LOW") field(DOL9, "BEND:UNDS:3530:BMONLIMITS.K") field(LNK9, "BEND:UNDS:3530:BMON.HIHI") field(DOLA, "BEND:UNDS:3530:BMONLIMITS.L") field(LNKA, "BEND:UNDS:3530:BMON.LOLO") field(FLNK, "BEND:UNDS:3530:ILIMITS") field(SCAN, "5 second") } record(ao, "BEND:UNDS:3530:BCTRL") { field(DESC, "B-Perturb") field(PREC, "7") field(EGU, "kG-m") field(DRVH, "2.68") field(DRVL, "0.0") field(HOPR, "2.68") field(LOPR, "0.0") # 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, "BEND:UNDS:3530: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, "BEND:UNDS:3530:BCTRLGO") { field(DESC, "Update DES and perturb") field(PREC, "7") # Disable BACT limits field(DOL1, "1") field(LNK1, "BEND:UNDS:3530:BLIMITS.VAL") # Update BDES with the BCTRL (slider) value field(DOL2, "BEND:UNDS:3530:BCTRL.VAL") field(LNK2, "BEND:UNDS:3530:BDES PP") field(DOL3, "1") field(LNK3, "BEND:UNDS:3530:IDIRECT.PROC PP") field(DOL4, "1") field(LNK4, "BEND:UNDS:3530:CHECKSTDZLOST.PROC PP") field(DOL5, "BEND:UNDS:3530:BCTRL.VAL") field(LNK5, "BEND:UNDS:3530:BCTRLSUB PP") # Re-enable BACT limits field(DOL6, "0") field(LNK6, "BEND:UNDS:3530:BLIMITS.VAL") } # Convert B-field to Current and output to ISETPT record(sub, "BEND:UNDS:3530:BCTRLSUB") { field(DESC, "Feedback") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "BEND:UNDS:3530:POLYCOEF") field(INPC, "BEND:UNDS:3530:POLYCOEF.A") field(INPD, "BEND:UNDS:3530:POLYCOEF.B") field(INPE, "BEND:UNDS:3530:BDES.DRVH") field(INPF, "BEND:UNDS:3530:BDES.DRVL") field(PREC, "7") field(EGU, "kG-m") field(HOPR, "2.68") field(LOPR, "0.0") field(MDEL, "-1") field(BRSV, "INVALID") field(FLNK, "BEND:UNDS:3530:ISETPT") } record(ao, "BEND:UNDS:3530:BDESPREVTRIM") { field(DESC, "trim bdes for undo") field(DTYP, "Soft Channel") field(DRVH, "2.68") field(DRVL, "0.0") field(EGU, "kG-m") field(HOPR, "2.68") field(LOPR, "0.0") field(PREC, "7") field(PINI, "YES") info(autosaveFields,"VAL") } record(stringin, "BEND:UNDS:3530:MADNAME") { field(DESC, "MAD deck nomenclature") field(PINI, "YES") field(VAL, "BCXSS2") } record(ai, "BEND:UNDS:3530: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, "3648.754125") } record(ao, "BEND:UNDS:3530:BMAX") { field(DESC, "Max B-Field") field(DTYP, "Soft Channel") field(DRVH, "2.68") field(DRVL, "0.0") field(EGU, "kG-m") field(HOPR, "2.68") field(LOPR, "0.0") field(PREC, "7") field(PINI, "YES") field(VAL, "2.68") field(FLNK, "BEND:UNDS:3530:BSTEP") } record(ao, "BEND:UNDS:3530:BMIN") { field(DESC, "Min B-Field") field(DTYP, "Soft Channel") field(DRVH, "2.68") field(DRVL, "0.0") field(EGU, "kG-m") field(HOPR, "2.68") field(LOPR, "0.0") field(PREC, "7") field(PINI, "YES") field(VAL, "0.0") field(FLNK, "BEND:UNDS:3530:BSTEP") } record(ao, "BEND:UNDS:3530:BDESSAVE") { field(DESC, "bdes for save/load") field(DTYP, "Soft Channel") field(DRVH, "2.68") field(DRVL, "0.0") field(EGU, "kG-m") field(HOPR, "2.68") field(LOPR, "0.0") field(PINI, "YES") field(PREC, "7") } # This record is processed by BEND:UNDS:3530: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, "BEND:UNDS:3530:BCON") { field(DESC, "Config B-Field ") field(DTYP, "Soft Channel") field(PREC, "7") field(EGU, "kG-m") field(HOPR, "2.68") field(LOPR, "0.0") field(DRVH, "2.68") field(DRVL, "0.0") # 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 , "BEND:UNDS:3530:ICON2BCON") field(OMSL, "closed_loop") field(OUT, "BEND:UNDS:3530:B2ICON PP") info(autosaveFields,"VAL") } record(sub, "BEND:UNDS:3530:B2ICON") { field(DESC, "Convert Desired ICon to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "BEND:UNDS:3530:POLYCOEF") field(INPC, "BEND:UNDS:3530:POLYCOEF.A") field(INPD, "BEND:UNDS:3530:POLYCOEF.B") field(PREC, "7") field(EGU, "kG-m") field(HOPR, "2.68") field(LOPR, "0.0") field(MDEL, "-1") field(INPE, "BEND:UNDS:3530:BCON.DRVH") field(INPF, "BEND:UNDS:3530:BCON.DRVL") field(BRSV, "INVALID") field(FLNK, "BEND:UNDS:3530: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, "BEND:UNDS:3530:BSTEP") { field(DESC, "B-Field step size") field(CALC, "(C==3)||(D==3)?0:ABS(A-B)*0.005") field(INPA, "BEND:UNDS:3530:BMAX") field(INPB, "BEND:UNDS:3530:BMIN") field(INPC, "BEND:UNDS:3530:BMIN.SEVR") field(INPD, "BEND:UNDS:3530:BMAX.SEVR") field(EGU, "kG-m") 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,"BEND:UNDS:3530:BCTRLDISABLECALC") { field(DESC, "Calc for disabling BCTRL") field(ASG, "Internal") field(CALC, "A?2:1") field(INPA, "BEND:UNDS:3530:ONLINE CP") field(OUT, "BEND:UNDS:3530:BCTRLDISABLEFOUT PP") } record(fanout, "BEND:UNDS:3530:BCTRLDISABLEFOUT") { field(DESC, "Disable BCTRL fanout") field(SELM, "Specified") field(SELL, "BEND:UNDS:3530:BCTRLDISABLECALC") field(LNK1, "BEND:UNDS:3530:BCTRLDISABLE") field(LNK2, "BEND:UNDS:3530:BCTRLENABLE") } record(stringout, "BEND:UNDS:3530:BCTRLDISABLE") { field(DESC, "Disable BCTRL") field(DTYP, "Soft Channel") field(OUT, "BEND:UNDS:3530:BCTRL.ASG") field(VAL, "NOWRITE") field(FLNK, "BEND:UNDS:3530:BCTRLDISV_UPDATE") } record(stringout, "BEND:UNDS:3530:BCTRLENABLE") { field(DESC, "Enable BCTRL") field(DTYP, "Soft Channel") field(OUT, "BEND:UNDS:3530:BCTRL.ASG") field(VAL, "") field(FLNK, "BEND:UNDS:3530:BCTRLDISV_UPDATE") } record(calcout, "BEND:UNDS:3530:BCTRLDISV_UPDATE") { field(DESC, "Calc for updating BCTRL.DISV") field(ASG, "Internal") field(CALC, "A") field(INPA, "BEND:UNDS:3530:ONLINE") field(OUT, "BEND:UNDS:3530: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,"BEND:UNDS:3530:BACT and MON\n are processed via links from \n BEND:UNDS:3530:IACT (device raw value readback 1)\n and\n BEND:UNDS:3530: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 BEND:UNDS:3530:POLYCOEF\nC = First polynomial coefficient (offset if linear)\nD = Second polynomial coefficient (slope if linear)\nE = BEND:UNDS:3530: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,"BEND:UNDS:3530:BDES\n is processed when set by CA users or \n BEND:UNDS:3530: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,"BEND:UNDS:3530: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 BEND:UNDS:3530: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 (BEND:UNDS:3530: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,"BEND:UNDS:3530:B*LIMITS and BEND:UNDS:3530:BLIMITS:\n Calculate alarm and warning limits based on \n deltas from BEND:UNDS:3530: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,"BEND:UNDS:3530: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,"BEND:UNDS:3530: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, "BEND:UNDS:3530: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, "BEND:UNDS:3530:MPSBTOL") { field(DESC, "Absolute mps tol") field(EGU, "kG-m") field(PREC, "2") field(CALC, "ABS(A)*0.02") field(INPA, "BEND:UNDS:3530:BMAX") field(PINI, "YES") } # # 21-Aug-2013: K. Luchini # Set channel access security so that users # cannot easily change values. record(ao, "BEND:UNDS:3530:MPSBMAX") { field(DESC, "MPS Max B-field") field(EGU, "kG-m") field(PREC, "7") field(DRVH, "2.68") field(DRVL, "0.0") field(PINI, "YES") field(VAL, "2.68") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "BEND:UNDS:3530:MPSBMIN") { field(DESC, "MPS Min B-field") field(EGU, "kG-m") field(PREC, "7") field(DRVH, "2.68") field(DRVL, "0.0") field(PINI, "YES") field(VAL, "0.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "BEND:UNDS:3530:MPSBLLIM") { field(DESC, "MPS Low Limit B-field") field(EGU, "kG-m") field(PREC, "7") field(DRVH, "2.68") field(DRVL, "0.0") field(PINI, "YES") field(VAL, "0.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "BEND:UNDS:3530:MPSBLLIM2") { field(DESC, "MPS Low Limit #2 B-field") field(EGU, "kG-m") field(PREC, "7") field(DRVH, "2.68") field(DRVL, "0.0") field(PINI, "YES") field(VAL, "0.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } # Set the default to Std record(mbbo, "BEND:UNDS:3530: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, "BEND:UNDS:3530:MPSLIMITS.E PP") } record(aSub, "BEND:UNDS:3530: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, "BEND:UNDS:3530:MPS.RVAL") field(INPB, "BEND:UNDS:3530:BADIFF") field(INPC, "BEND:UNDS:3530:BDELTAS.N") field(INPD, "BEND:UNDS:3530:BACT") field(INPE, "BEND:UNDS:3530:MPSBITMASK.RVAL") field(INPF, "BEND:UNDS:3530:MPSBLLIM") field(INPG, "BEND:UNDS:3530:MPSBMIN") field(INPH, "BEND:UNDS:3530:MPSBMAX") field(INPI, "BEND:UNDS:3530: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, "BEND:UNDS:3530:INTOL.RVAL PP") field(OUTB, "BEND:UNDS:3530:INTOL_BMIN.RVAL PP") field(OUTC, "BEND:UNDS:3530:INTOL_BRANGE.RVAL PP") field(OUTD, "BEND:UNDS:3530: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, "BEND:UNDS:3530:INTOL") { field(DESC, "BACT within MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "BEND:UNDS:3530:MPSLIMITS.VALA") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "BEND:UNDS:3530:INTOL_BMIN") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "BEND:UNDS:3530:MPSLIMITS.VALB") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "BEND:UNDS:3530:INTOL_BMIN2") { field(DESC, "MPS tol #2") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "BEND:UNDS:3530:MPSLIMITS.VALD") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "BEND:UNDS:3530:INTOL_BRANGE") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "BEND:UNDS:3530: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, "BEND:UNDS:3530:CHCKITOL") { field(DESC, "Absolute Check I Tolerance") field(EGU, "A") field(FLNK, "BEND:UNDS:3530:TRIMITOL") field(CALC, "ABS(A*B)") field(INPA, "BEND:UNDS:3530:CHCKBTOL") field(INPB, "BEND:UNDS:3530:POLYCOEF.B") field(PREC, "9") } record(calc, "BEND:UNDS:3530:TRIMBTOL") { field(EGU, "kG-m") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(DESC, "Absolute Trim Tolerance") field(CALC, "ABS(A)/2") field(INPA, "BEND:UNDS:3530:CHCKBTOL") field(FLNK, "BEND:UNDS:3530:CHCKITOL") } record(calc, "BEND:UNDS:3530:CHCKBTOL") { field(DESC, "Check absolute tolerance") field(EGU, "A") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(FLNK, "BEND:UNDS:3530:TRIMBTOL") field(CALC, "MAX(ABS(A),ABS(C))*(B/1000000)") field(INPA, "BEND:UNDS:3530:BDES.HOPR") field(INPB, "BEND:UNDS:3530:STABILITY") field(INPC, "BEND:UNDS:3530:BDES.LOPR") } record(longout, "BEND:UNDS:3530: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, "BEND:UNDS:3530:CHCKBTOL") } record(calc, "BEND:UNDS:3530:TRIMITOL") { field(DESC, "Absolute Trim I Tolerance") field(EGU, "kG-m") field(CALC, "ABS(A*B)") field(INPA, "BEND:UNDS:3530:POLYCOEF.B") field(INPB, "BEND:UNDS:3530:TRIMBTOL") field(PREC, "9") } record(ai, "BEND:UNDS:3530:TRIMBTOLR") { field(DESC, "Relative trim tol") field(PREC, "4") field(EGU, "%") field(HOPR, "1.0") field(LOPR, "0.0") field(PINI, "YES") } record(ai, "BEND:UNDS:3530: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, "BEND:UNDS:3530:FBCKFCOM") { field(ZNAM, "CA") field(ONAM, "FCOM") field(DESC, "CA Mode") field(PINI, "YES") field(SDIS, "0") } record(bo, "BEND:UNDS:3530:PAU") { field(ZNAM, "NotConfigured") field(ONAM, "Configured") field(DESC, "PAU Present") field(PINI, "YES") field(SDIS, "0") field(FLNK, "BEND:UNDS:3530:PAUGO") } record(fanout, "BEND:UNDS:3530:PAUGO") { field(DESC, "PAU control") field(LNK1, "BEND:UNDS:3530:PAUSTOP") field(LNK2, "BEND:UNDS:3530: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, "BEND:UNDS:3530:PAUSTART") { field(DESC, "Setup for PAU On") field(SDIS, "BEND:UNDS:3530: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, "BEND:UNDS:3530:PAUSTOP") { field(DESC, "Setup for PAU Off") field(SDIS, "BEND:UNDS:3530: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, "BEND:UNDS:3530:MCORDEVNAME") { field(DESC, "PS device name") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, "BEND:UNDS:3510:") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "BEND:UNDS:3530: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, "BEND:UNDS:3530:PSTYPE.RVAL") field(INPC, "BEND:UNDS:3530:TURNEDOFF.RVAL") field(INPD, "BEND:UNDS:3530:CONFIG.RVAL") field(INPE, "BEND:UNDS:3530:PSCATEGORY.RVAL") field(INPF, "BEND:UNDS:3530:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "BEND:UNDS:3530:AUTOCTRL.RVAL") field(INPJ, "BEND:UNDS:3530:OUTOFSERVICE.RVAL") field(INPL, "BEND:UNDS:3530:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "BEND:UNDS:3530:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "BEND:UNDS:3530:PAU") field(INPP, "BEND:UNDS:3530:CALBDISABLE.RVAL") field(INPQ, "BEND:UNDS:3530:PTRBDISABLE.RVAL") field(INPR, "BEND:UNDS:3530:TRIMDISABLE.RVAL") field(INPS, "BEND:UNDS:3530:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "BEND:UNDS:3530:FBCK") field(INPU, "BEND:UNDS:3530:TRIMTYPE.RVAL") field(INPV, "BEND:UNDS:3530:STDZDIRECT.RVAL") field(INPW, "BEND:UNDS:3530:DEGAUSENABLE.RVAL") field(FLNK, "BEND:UNDS:3530:HSTA") } record(longin, "BEND:UNDS:3530:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "BEND:UNDS:3530:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "BEND:UNDS:3530: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, "BEND:UNDS:3530: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, "BEND:UNDS:3530: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, "BEND:UNDS:3530: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, "BEND:UNDS:3530: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, "BEND:UNDS:3530: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 BEND:UNDS:3530:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses BEND:UNDS:3530:FBCK. # This PV should be replaced by BEND:UNDS:3530: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, "BEND:UNDS:3530: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, "BEND:UNDS:3530: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, "BEND:UNDS:3530: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, "BEND:UNDS:3510:OUTOFSERVICE CPP NMS") field(OMSL, "closed_loop") field(FLNK, "BEND:UNDS:3530:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"BEND:UNDS:3530:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "BEND:UNDS:3530:OUTOFSERVICE NPP NMS") field(OUT, "BEND:UNDS:3530:ONLINE PP") } record(bo, "BEND:UNDS:3530:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "BEND:UNDS:3530: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, "BEND:UNDS:3530: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, "BEND:UNDS:3530: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, "BEND:UNDS:3530: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, "BEND:UNDS:3530: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, "BEND:UNDS:3530: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, "BEND:UNDS:3530: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, "BEND:UNDS:3530: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, "BEND:UNDS:3530: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, "BEND:UNDS:3530: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, "BEND:UNDS:3530: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, "BEND:UNDS:3530:TRIMTYPE") } record(stringout, "BEND:UNDS:3530:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "BEND:UNDS:3510:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "BEND:UNDS:3530:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "BEND:UNDS:3530:STATE.RVAL") field(INPB, "BEND:UNDS:3530:INTLKSUMY.RVAL") field(OUT, "BEND:UNDS:3530:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "BEND:UNDS:3530: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, "BEND:UNDS:3530:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "BEND:UNDS:3530:STATE.RVAL") field(INPB, "BEND:UNDS:3530:INTLKSUMY.RVAL") field(OUT, "BEND:UNDS:3530:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "BEND:UNDS:3530:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "BEND:UNDS:3530:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "BEND:UNDS:3530: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, "BEND:UNDS:3530: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, "BEND:UNDS:3530: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, "BEND:UNDS:3530: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,"BEND:UNDS:3530: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("BEND:UNDS:3530:TURNEDOFF",3140,1907,0,1,"BEND:UNDS:3530:TURNEDOFF") #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "BEND:UNDS:3530:STATSUB") { field(DESC, "Build STATus ") field(INAM, "mgntInit") field(SNAM, "mgntSlcStat") field(INPA, "BEND:UNDS:3530:BACT.STAT") field(INPB, "BEND:UNDS:3530:BDES.STAT") field(INPC, "BEND:UNDS:3530: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, "BEND:UNDS:3530:BACT.SEVR") field(INPH, "BEND:UNDS:3530:BDES.SEVR") field(INPI, "BEND:UNDS:3530: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, "BEND:UNDS:3530:STATE.RVAL") field(INPN, "BEND:UNDS:3530:STDZOK") field(INPO, "BEND:UNDS:3530:CALBOK") field(INPP, "BEND:UNDS:3530:OUTOFSERVICE.RVAL") field(INPQ, "BEND:UNDS:3530:CONFIG.RVAL") field(INPR, "BEND:UNDS:3530:HSTA") field(INPS, "BEND:UNDS:3530:CTRL.RVAL") field(INPT, "BEND:UNDS:3530:DEGAUSOK") field(INPV, "BEND:UNDS:3530: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, "BEND:UNDS:3530:STAT") } record(longout, "BEND:UNDS:3530:STAT") { field(DESC, "STAT sent to SLC") field(SCAN, "Passive") field(FLNK, "BEND:UNDS:3530:STATCTRLSUB") field(DOL, "BEND:UNDS:3530:STATSUB.VAL") field(OMSL, "closed_loop") } record(sSub, "BEND:UNDS:3530:STATCTRLSUB") { field(DESC, "Decode SLC STAT into mbbo") field(INAM, "mgntInit") field(SNAM, "mgntStatDecode") field(INPA, "BEND:UNDS:3530:STAT") field(INPB, "BEND:UNDS:3530:HSTA") field(INPD, "BEND:UNDS:3530:ONOFFCTRL.RVAL") field(FLNK, "BEND:UNDS:3530:STATMSG") } record(mbbo, "BEND:UNDS:3530: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, "BEND:UNDS:3530:UNAVAILGO") field(DOL, "BEND:UNDS:3530:STATCTRLSUB.W") } record(seq, "BEND:UNDS:3530:UNAVAILGO") { field(DESC, "Process UNAVAIL") field(DOL1, "BEND:UNDS:3530:STATSUB.U") field(LNK1, "BEND:UNDS:3530:UNAVAIL PP") } record(stringout, "BEND:UNDS:3530:SNLSTATMSG") { field(DTYP, "Soft Channel") } #! TextBox(TB0,820,1000,1200,1220,0,"Dialog",12,1,16777215,"BEND:UNDS:3530:STATUSSUB - future\nOverall device status - takes input from action snls, record sevrs, master snl(s) and outputs final status\n\nInputs:\nA - BEND:UNDS:3530:CTRLSTATUS - snl status\nB - MGNT:CTRLSTATUS - master list status\nC\nD - BEND:UNDS:3530: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,"BEND:UNDS:3530STATSUB\nformat control bo's into slc STAT\n\nInputs:\nA - BEND:UNDS:3530:STATUS\nC - BEND:UNDS:3530:ON\nD - BEND:UNDS:3530:STDZOK\nE - BEND:UNDS:3530:CALBOK\nF - BEND:UNDS:3530:BACTDRIFT (future)\nG -\nH- BEND:UNDS:3530:DACSTATUS\nI -BEND:UNDS:3530:ADCSTATUS\nJ - BEND:UNDS:3530:BACTSTATUS\nK - BEND:UNDS:3530:BDESSTATUS\nL - BEND:UNDS:3530:RIPLSTATUS\n\nOutput:\nP - BEND:UNDS:3530: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, "BEND:UNDS:3530: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, "BEND:UNDS:3530: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, "BEND:UNDS:3530: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, "BEND:UNDS:3530: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, "BEND:UNDS:3530:IDESTOTAL"){ field(DESC, "Calc total current") field(CALC, "A+B") field(EGU, "kG-m") field(PREC, "7") field(INPA, "BEND:UNDS:3510:IDES CP NMS") field(INPB, "BTRM:UNDS:3530:BDES CP NMS") field(OUT, "BEND:UNDS:3530:IDES2BDES.E PP") } record(sub, "BEND:UNDS:3530:IDES2BDES") { field(DESC, "Cal BDES") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "BEND:UNDS:3530:IDES2BDES") field(INPB, "BEND:UNDS:3530:POLYCOEF") field(INPC, "BEND:UNDS:3530:POLYCOEF.A") field(INPD, "BEND:UNDS:3530:POLYCOEF.B") field(INPE, "BEND:UNDS:3530:IDESTOTAL MS") field(INPF, "BEND:UNDS:3510:BDELTAS PP") field(INPG, "100") field(EGU, "kG-m") field(HOPR, "2.68") field(LOPR, "0.0") field(HIHI, "2.68") field(LOLO, "0.0") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "2.68") field(LOW, "0.0") field(FLNK, "BEND:UNDS:3530: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, "BEND:UNDS:3530:IACTCALC"){ field(DESC, "Calc total act current") field(CALC, "A+B") field(EGU, "kG-m") field(PREC, "7") field(INPA, "BEND:UNDS:3530:IACT CP NMS") field(INPB, "BTRM:UNDS:3530:BACT") field(OUT, "BEND:UNDS:3530: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, "BEND:UNDS:3530:IMONCALC"){ field(DESC, "Calc total mon current") field(CALC, "A+B") field(EGU, "kG-m") field(PREC, "7") field(INPA, "BEND:UNDS:3530:IMON CP NMS") field(INPB, "BTRM:UNDS:3530:BMON") field(OUT, "BEND:UNDS:3530: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, "BEND:UNDS:3530:ICONTOTAL"){ field(DESC, "Calc total current") field(CALC, "A+B") field(EGU, "kG-m") field(PREC, "7") field(INPA, "BEND:UNDS:3510:ICON CP NMS") field(INPB, "BTRM:UNDS:3530:BCON CP NMS") field(OUT, "BEND:UNDS:3530:ICON2BCON.E PP") } record(sub, "BEND:UNDS:3530:ICON2BCON") { field(DESC, "Cal BCON") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "BEND:UNDS:3530:ICON2BCON") field(INPB, "BEND:UNDS:3530:POLYCOEF") field(INPC, "BEND:UNDS:3530:POLYCOEF.A") field(INPD, "BEND:UNDS:3530:POLYCOEF.B") field(INPE, "BEND:UNDS:3530:ICONTOTAL MS") field(INPF, "BEND:UNDS:3510:BDELTAS PP") field(INPG, "100") field(EGU, "kG-m") field(HOPR, "2.68") field(LOPR, "0.0") field(HIHI, "2.68") field(LOLO, "0.0") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "2.68") field(LOW, "0.0") field(FLNK, "BEND:UNDS:3530:BCON") } #! 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, "BEND:UNDS:3550:IACT") { field(DESC, "Current") field(INP, "BEND:UNDS:3510:IACT CP NMS") field(EGU, "A") field(HOPR, "9.0") field(LOPR, "-9.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "BEND:UNDS:3550:IACTCALC") info(autosaveFields,"HYST") } record(bi, "BEND:UNDS:3550:STATE") { field(DESC, "PS On/Off Status") field(DTYP, "Raw Soft Channel") field(INP, "BEND:UNDS:3510:STATE CP MS") field(ZSV, "MAJOR") field(ZNAM, "OFF") field(ONAM, "ON") } record(ao, "BEND:UNDS:3550:IDES") { field(DESC, "Desired Current") field(PREC, "3") field(EGU, "A") field(HOPR, "9.0") field(LOPR, "-9.0") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(MDEL, "-1") field(HIHI, "9.0") field(LOLO, "-9.0") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "BEND:UNDS:3550:BDELTAS") field(DRVH, "9.0") field(DRVL, "-9.0") field(DOL, "BEND:UNDS:3550: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, "BEND:UNDS:3550:ICTRL PP") } # This record is processed by BEND:UNDS:3550:ICON") # Note: we are not setting alarms here. record(ao, "BEND:UNDS:3550:ICON") { field(DESC, "Config I") field(DTYP, "Soft Channel") field(PREC, "3") field(HOPR, "9.0") field(LOPR, "-9.0") field(DRVH, "9.0") field(DRVL, "-9.0") field(DOL, "BEND:UNDS:3550:B2ICON.K") field(OMSL, "closed_loop") info(autosaveFields,"VAL") } record(ao, "BEND:UNDS:3550:INOM") { field(DESC, "Nominal Current") field(DOL, "BEND:UNDS:3550:BNOM.K") field(OMSL, "closed_loop") field(PREC, "3") field(EGU, "A") field(DRVH, "9.0") field(DRVL, "-9.0") field(HOPR, "9.0") field(LOPR, "-9.0") } record(ao, "BEND:UNDS:3550:ICTRL") { field(DESC, "Set Current") field(PREC, "3") field(EGU, "A") field(HOPR, "9.0") field(LOPR, "-9.0") field(DRVH, "9.0") field(DRVL, "-9.0") field(MDEL, "-1") field(FLNK, "BEND:UNDS:3550:ICTRLGO") field(OMSL, "supervisory") info(autosavefields,"VAL") } record(seq, "BEND:UNDS:3550:ICTRLGO") { field(DESC, "Process Current Setpoint") field(PREC, "3") # Set ISETPT to supervisory field(DOL1, "0") field(LNK1, "BEND:UNDS:3550:ISETPT.OMSL") field(DOL2, "BEND:UNDS:3550:ICTRL") field(LNK2, "BEND:UNDS:3550:ISETPT PP") # Set ISETPT to closed loop - get data from BCTRLSUB.K field(DOL3, "1") field(LNK3, "BEND:UNDS:3550:ISETPT.OMSL") } record(ao, "BEND:UNDS:3550:IMAX") { field(DESC, "Max I") field(DTYP, "Soft Channel") field(DRVH, "9.0") field(DRVL, "-9.0") field(EGU, "A") field(HOPR, "9.0") field(LOPR, "-9.0") field(PREC, "3") field(PINI, "YES") field(VAL, "9.0") field(FLNK, "BEND:UNDS:3550:IMIN") } record(ao, "BEND:UNDS:3550:IMIN") { field(DESC, "Min I") field(DTYP, "Soft Channel") field(DRVH, "9.0") field(DRVL, "-9.0") field(EGU, "A") field(HOPR, "9.0") field(LOPR, "-9.0") field(PREC, "3") field(VAL, "-9.0") field(FLNK, "BEND:UNDS:3550:IRANGE") } record(sel, "BEND:UNDS:3550:IACTPREVOK") { field(DESC, "Last Good Current") field(EGU, "A") field(HOPR, "9.0") field(LOPR, "-9.0") field(PREC, "3") field(NVL, "BEND:UNDS:3550:BACT.SEVR") field(INPA, "BEND:UNDS:3550:IACT NPP MS") field(INPB, "BEND:UNDS:3550:IACTPREVOK NPP MS") field(INPC, "BEND:UNDS:3550:IACTPREVOK NPP MS") field(INPD, "BEND:UNDS:3550:IACTPREVOK NPP MS") } record(sub, "BEND:UNDS:3550:IACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "BEND:UNDS:3550:IDES") field(INPB, "BEND:UNDS:3550:ISETPT.DRVH") field(INPC, "BEND:UNDS:3550:ISETPT.DRVL") field(INPD, "BEND:UNDS:3550:IDELTAS.I") field(INPE, "BEND:UNDS:3550:IDELTAS.J") field(INPG, "BEND:UNDS:3550:STATE") field(INPH, "BEND:UNDS:3550:HSTA") field(EGU, "A") field(HOPR, "9.0") field(LOPR, "-9.0") field(PREC, "3") field(BRSV, "INVALID") } record(sub, "BEND:UNDS:3550:IMONLIMITS") { field(DESC, "Aux Current Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "BEND:UNDS:3550:IDES") field(INPB, "BEND:UNDS:3550:ISETPT.DRVH") field(INPC, "BEND:UNDS:3550:ISETPT.DRVL") field(INPD, "BEND:UNDS:3550:IDELTAS.K") field(INPE, "BEND:UNDS:3550:IDELTAS.L") field(INPG, "BEND:UNDS:3550:STATE") field(INPH, "BEND:UNDS:3550:HSTA") field(EGU, "A") field(HOPR, "9.0") field(LOPR, "-9.0") field(PREC, "3") field(BRSV, "INVALID") } record(seq, "BEND:UNDS:3550:ILIMITS") { field(DESC, "Set ACT and MON Limits") field(PREC, "3") field(DOL1, "BEND:UNDS:3550:BLIMITS") field(LNK1, "BEND:UNDS:3550:IACTLIMITS.F PP") field(DOL2, "BEND:UNDS:3550:IACTLIMITS.I") field(LNK2, "BEND:UNDS:3550:IACT.HIGH") field(DOL3, "BEND:UNDS:3550:IACTLIMITS.J") field(LNK3, "BEND:UNDS:3550:IACT.LOW") field(DOL4, "BEND:UNDS:3550:IACTLIMITS.K") field(LNK4, "BEND:UNDS:3550:IACT.HIHI") field(DOL5, "BEND:UNDS:3550:IACTLIMITS.L") field(LNK5, "BEND:UNDS:3550:IACT.LOLO") field(DOL6, "BEND:UNDS:3550:BLIMITS") field(LNK6, "BEND:UNDS:3550:IMONLIMITS.F PP") field(DOL7, "BEND:UNDS:3550:IMONLIMITS.I") field(LNK7, "BEND:UNDS:3550:IMON.HIGH") field(DOL8, "BEND:UNDS:3550:IMONLIMITS.J") field(LNK8, "BEND:UNDS:3550:IMON.LOW") field(DOL9, "BEND:UNDS:3550:IMONLIMITS.K") field(LNK9, "BEND:UNDS:3550:IMON.HIHI") field(DOLA, "BEND:UNDS:3550:IMONLIMITS.L") field(LNKA, "BEND:UNDS:3550: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, "BEND:UNDS:3550:IDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntRawDeltas") field(INPD, "BEND:UNDS:3550:TRIMBTOL") field(INPE, "BEND:UNDS:3550:CHCKBTOL") field(INPF, "BEND:UNDS:3550:BDELTAS.K") field(INPG, "BEND:UNDS:3550:BDELTAS.L") field(INPH, "BEND:UNDS:3550: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, "BEND:UNDS:3550:STDZITOLR") field(INPC, "BEND:UNDS:3550:STDZITOL") field(FLNK, "") } # All ps controllers with on/off control will set the macro ONOF # as follows: # # ONOF = BEND:UNDS:3510: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, "BEND:UNDS:3550: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 = BEND:UNDS:3510:RESET PP # record(bo, "BEND:UNDS:3550: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, "BEND:UNDS:3550:RAMPSTATE") { field(DESC, "PS Ramp Status") field(DTYP, "Soft Channel") field(DOL, "BEND:UNDS:3510: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, "BEND:UNDS:3550: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, "BEND:UNDS:3550:TRIMRAMPRATE") field(OUT, "") field(FLNK, "BEND:UNDS:3550:STDZDLY") } record(ao, "BEND:UNDS:3550:ISETPT") { field(DESC, "Current Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(EGU, "A") field(HOPR, "9.0") field(LOPR, "-9.0") field(DRVH, "9.0") field(DRVL, "-9.0") field(MDEL, "-1") field(OUT, "") field(DOL, "BEND:UNDS:3550: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, "BEND:UNDS:3550:IMON") { field(DESC, "Aux Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(INP, "BEND:UNDS:3510:IMON CP NMS") field(EGU, "A") field(HOPR, "9.0") field(LOPR, "-9.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "BEND:UNDS:3550:IMONCALC") } record(ao, "BEND:UNDS:3550:IRIPL") { field(DESC, "Ripple Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(DOL, "BEND:UNDS:3510:IRIPL CP NMS") field(OMSL, "closed_loop") field(EGU, "A") field(DRVH, "1.0") field(HOPR, "1.0") field(PREC, "3") field(FLNK, "BEND:UNDS:3550:IRIPLOK") } record(sub, "BEND:UNDS:3550:IRIPLOK") { field(DESC, "Ripple Current Status") field(INAM, "mgntInit") field(SNAM, "mgntRiplOK") field(INPA, "BEND:UNDS:3550:IRIPL.VAL") field(INPB, "BEND:UNDS:3550: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, "BEND:UNDS:3550:R") { field(DESC, "Resistance") field(EGU, "Ohms") field(PREC, "4") field(PINI, "YES") field(DOL, "BEND:UNDS:3510: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, "BEND:UNDS:3550:IGND") { field(DESC, "Ground Current") field(EGU, "A") field(PREC, "6") field(PINI, "YES") field(DOL, "BEND:UNDS:3510:IGND CP MS") field(OMSL, "closed_loop") } record(bi, "BEND:UNDS:3550:INTLKSUMY") { field(DESC, "Interlock Summary") field(INP, "BEND:UNDS:3510:INTLKSUMY CP MS") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(ZNAM, "OK") field(ONAM, "FAULT") field(PINI, "NO") } record(mbbo, "BEND:UNDS:3550: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, "BEND:UNDS:3510:COOLING CP NMS") field(OMSL, "closed_loop") } # The following PV is processed by :BACTFO # which is processed by :BACT record(fanout, "BEND:UNDS:3550:IACTFO") { field(DESC, "IACT processing") field(SELM, "All") field(LNK1, "BEND:UNDS:3550:IACTPREVOK") field(LNK2, "BEND:UNDS:3550:IDIFF") field(LNK3, "BEND:UNDS:3550:IADIFF") field(LNK4, "BEND:UNDS:3550:IRATIO") field(LNK5, "BEND:UNDS:3550:IDIRECT") field(LNK6, "BEND:UNDS:3550:IACTPOL_CHECK") } record(calc, "BEND:UNDS:3550:IDIFF") { field(DESC, "IDES-IACT") field(CALC, "A-B") field(INPA, "BEND:UNDS:3550:IDES") field(INPB, "BEND:UNDS:3550:IACT") field(EGU, "A") field(PREC, "9") field(HOPR, "9.0") field(LOPR, "-9.0") } record(calc, "BEND:UNDS:3550:IADIFF") { field(DESC, "Absolute IDES-IACT") field(CALC, "A<0?ABS(A):A") field(INPA, "BEND:UNDS:3550:IDIFF") field(PREC, "9") } record(calc, "BEND:UNDS:3550:IRATIO") { field(DESC, "IDES-IACT/IMAX") field(CALC, "B?A/B:0") field(INPA, "BEND:UNDS:3550:IDIFF") field(INPB, "BEND:UNDS:3550:IDES.DRVH") field(PREC, "9") } record(calcout, "BEND:UNDS:3550:IRANGE") { field(DESC, "Current Range") field(PINI, "YES") field(CALC, "ABS(A-B)") field(INPA, "BEND:UNDS:3550:IMIN") field(INPB, "BEND:UNDS:3550: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, "BEND:UNDS:3550: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, "BEND:UNDS:3550:IACT") field(FLNK, "BEND:UNDS:3550:IACTPOL") } record(bo, "BEND:UNDS:3550:IACTPOL") { field(DESC, "Actual I Polarity") field(DTYP, "Raw Soft Channel") field(DOL, "BEND:UNDS:3550: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,"BEND:UNDS:3550:I*LIMITS:\n Calculate alarm and warning limits based on \n deltas from BEND:UNDS:3550:IDELTAS and the\n BEND:UNDS:3550: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,"BEND:UNDS:3550:IACT: \n Get copy of BEND:UNDS:3550:I. \n",null) #! TextBox(TB12,1280,3100,1760,3200,0,"Dialog",12,1,16777215,"BEND:UNDS:3550: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,"BEND:UNDS:3550:IDES:\n Contains raw value calculated by \nBEND:UNDS:3550: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 \nBEND:UNDS:3550:BDELTAS.\n",null) #! TextBox(TB10,56,1940,316,2340,0,"Dialog",12,1,16777215,"BEND:UNDS:3550: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 BEND:UNDS:3550: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 BEND:UNDS:3550: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,"BEND:UNDS:3550:ISETPT:\n Sets the hardware. When fast feedback is set on, this record is\n set to closed loop mode by BEND:UNDS:3550:FBCKSTART sequence. When \n the loop is closed, this record takes input calculated by \n BFBCK only. When fast feedback is set off, BEND:UNDS:3550:FBCKSTOP \n will set it back to supervisory so that the value can be set by \n BEND:UNDS:3550: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, "BEND:UNDS:3550:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "BEND:UNDS:3550:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "BEND:UNDS:3550:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "BEND:UNDS:3550:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "BEND:UNDS:3550:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "BEND:UNDS:3550:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "1") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "BEND:UNDS:3550: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, "BEND:UNDS:3550:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "BEND:UNDS:3550:TRIMTYPE.RVAL") field(INPB, "BEND:UNDS:3550:CONFIG.RVAL") field(OUT, "BEND:UNDS:3550:TRIMMAXNUM PP") } record(longout, "BEND:UNDS:3550: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, "BEND:UNDS:3550: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, "BEND:UNDS:3510:TRIMRAMPRATE CP NMS") field(OMSL, "closed_loop") field(VAL, "") field(OUT, "BEND:UNDS:3550:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "BEND:UNDS:3550: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, "BEND:UNDS:3510:TRIMSETL CP NMS") field(OMSL, "closed_loop") field(VAL, "") } record(bo, "BEND:UNDS:3550: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, "BEND:UNDS:3550: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, "BEND:UNDS:3550: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, "BEND:UNDS:3550:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "0") } record(ao, "BEND:UNDS:3550: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, "BEND:UNDS:3550:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "BEND:UNDS:3550: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, "BEND:UNDS:3550: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, "BEND:UNDS:3550:IMOVE") field(INPB, "BEND:UNDS:3550:IACT") field(INPC, "BEND:UNDS:3550:IRAMPRATE") field(INPD, "1.577") field(INPE, "BEND:UNDS:3550:TRIMDLYPCT") field(INPF, "BEND:UNDS:3550:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "BEND:UNDS:3550:RAMPTIME_LEFT PP") } record(longout, "BEND:UNDS:3550:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "BEND:UNDS:3550:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "BEND:UNDS:3550:RAMPDONE_CALC") } record(calc, "BEND:UNDS:3550:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "BEND:UNDS:3550:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "BEND:UNDS:3550:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "BEND:UNDS:3550: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, "BEND:UNDS:3550:RAMPTIME_LEFT") field(OUT, "BEND:UNDS:3550:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "BEND:UNDS:3550:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "BEND:UNDS:3550:RAMPTIME_LEFT NMS") field(OUT, "BEND:UNDS:3550:RAMPDONE PP") } record(bo, "BEND:UNDS:3550:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "BEND:UNDS:3550:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "BEND:UNDS:3550: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, "BEND:UNDS:3550: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, "BEND:UNDS:3550:STDZINIT") { field(DESC, "Proc. Stdz PVs on boot") field(PINI, "YES") field(DOL1, "1") field(DOL2, "1") field(DOL3, "1") field(LNK1, "BEND:UNDS:3550:DEBUG.PROC PP") field(LNK2, "BEND:UNDS:3550:STDZCYCLENUM.PROC PP") field(LNK3, "BEND:UNDS:3550:STDZDISABLE.PROC PP") field(LNK4, "BEND:UNDS:3550: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, "BEND:UNDS:3550:STDZSUB") { field(DESC, "Stdz subroutine") field(INAM, "mgntStdzInit") field(SNAM, "mgntStdz") field(BRSV, "INVALID") field(INPA, "BEND:UNDS:3550:STDZIMIN NPP NMS") field(INPB, "BEND:UNDS:3550:STDZIMAX NPP NMS") field(INPC, "BEND:UNDS:3550:STDZIFINAL NPP NMS") field(INPD, "BEND:UNDS:3550:STDZCYCLENUM NPP NMS") field(INPE, "BEND:UNDS:3550:STDZDIRECT.RVAL NPP NMS") field(INPF, "BEND:UNDS:3550:STDZDISABLE.RVAL CPP NMS") field(INPG, "BEND:UNDS:3550: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, "BEND:UNDS:3550:STDZWF PP") field(OUTB, "BEND:UNDS:3550: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, "BEND:UNDS:3550:STDZWF") } record(mbbo, "BEND:UNDS:3550: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, "BEND:UNDS:3550: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, "BEND:UNDS:3550:STDZMAINPS") { field(DESC, "Stdz by main or self") field(PINI, "YES") field(DTYP, "Soft Channel") field(ZNAM, "SELF") field(ONAM, "MAIN") } record(bo, "BEND:UNDS:3550: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, "BEND:UNDS:3550: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, "BEND:UNDS:3550: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, "BEND:UNDS:3550:STDZTOD") { field(DESC, "Successful Standardize Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "BEND:UNDS:3550:STDZLOSTTOD") { field(DESC, "Standardize Lost Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(longout, "BEND:UNDS:3550:STDZCYCLECNT") { field(DESC, "Cycle Count") field(PINI, "YES") } record(longout, "BEND:UNDS:3550: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, "BEND:UNDS:3550:STDZDIRECT") } # The default standardize direction is "UP" for # all LCLS Magnets.. record(bo, "BEND:UNDS:3550:STDZDIRECT") { field(DESC, "Standardize Direction ") field(ZNAM, "UP") field(ONAM, "DOWN") field(VAL, "0") field(FLNK, "BEND:UNDS:3550:STDZIMIN") } record(ao, "BEND:UNDS:3550:STDZIMIN") { field(DESC, "Min-STDZ Current") field(PREC, "1") field(EGU, "A") field(HOPR, "9.0") field(LOPR, "-9.0") field(VAL, "-9.0") field(FLNK, "BEND:UNDS:3550:STDZIMAX") } record(ao, "BEND:UNDS:3550:STDZIMAX") { field(DESC, "Max. Standarize Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "9.0") field(LOPR, "-9.0") field(VAL, "9.0") field(FLNK, "BEND:UNDS:3550:STDZIFINAL") } record(ao, "BEND:UNDS:3550:STDZIFINAL") { field(DESC, "Final SDTZ Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "9.0") field(LOPR, "-9.0") field(VAL, "-9.0") field(FLNK, "BEND:UNDS:3550: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, "BEND:UNDS:3550: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, "BEND:UNDS:3550:STDZITOL") { field(DESC, "Stdz min tolerance") field(PREC, "5") field(CALC, "MAX(ABS(A),ABS(B))*C") field(INPA, "BEND:UNDS:3550:STDZIMIN CP NMS") field(INPB, "BEND:UNDS:3550:STDZIMAX CP MMS") field(INPC, "0.05") field(INPD, "BEND:UNDS:3550:STDZITOLR CP MMS") field(EGU, "A") field(FLNK, "BEND:UNDS:3550:IDELTAS") field(PINI, "YES") } # D - factor (3.154/2 = 1.577) for EPSC, otherwise, set to 1.0 record(calc, "BEND:UNDS:3550:STDZDLY") { field(DESC, "Ramp time for stdz cycle") field(CALC, "C>0?MAX(1,ABS((A-B)/C)*D):0") field(INPA, "BEND:UNDS:3550:STDZIMIN CP NMS") field(INPB, "BEND:UNDS:3550:STDZIMAX CP NMS") field(INPC, "BEND:UNDS:3550:TRIMRAMPRATE CP NMS") field(INPD, "1.0") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") } record(calc, "BEND:UNDS:3550:STDZRAMPDLY") { field(DESC, "Ramp delay total") field(CALC, "MAX(1,((A/100)*B+B))") field(PREC, "5") field(INPA, "BEND:UNDS:3550:TRIMDLYPCT CP MS") field(INPB, "BEND:UNDS:3550: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, "BEND:UNDS:3550:STDZMINIDLY") { field(DESC, "Mini-stdz delay") field(CALC, "A") field(PREC, "5") field(A, "1.0") field(EGU, "sec") field(PINI, "YES") } record(ao, "BEND:UNDS:3550: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, "BEND:UNDS:3550:STDZMINIDELTA") { field(DESC, "Stdz mini % of IMAX") field(CALC, "(B/100)*(A-C)") field(INPA, "BEND:UNDS:3550:IDES.HOPR") field(INPB, "BEND:UNDS:3550:STDZMINIPCT CPP NMS") field(INPC, "BEND:UNDS:3550:IDES.LOPR") field(PREC, "5") } record(calc, "BEND:UNDS:3550:STDZMINISETPT") { field(DESC, "Mini Stdz delta") field(CALC, "C==0?MAX(E-D,B):MIN(E+D,A)") field(INPA, "BEND:UNDS:3550:IDES.HOPR") field(INPB, "BEND:UNDS:3550:IDES.LOPR") field(INPC, "BEND:UNDS:3550:STDZDIRECT.RVAL") field(INPD, "BEND:UNDS:3550:STDZMINIDELTA") field(INPE, "BEND:UNDS:3550:IDES") field(PREC, "5") field(FLNK, "BEND:UNDS:3550: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, "BEND:UNDS:3550:STDZMINISETPTOOR") { field(DESC, "Mini Stdz setpoint out of range") field(CALC, "C==0?(E-DA)") field(INPA, "BEND:UNDS:3550:IDES.HOPR") field(INPB, "BEND:UNDS:3550:IDES.LOPR") field(INPC, "BEND:UNDS:3550:STDZDIRECT.RVAL") field(INPD, "BEND:UNDS:3550:STDZMINIDELTA") field(INPE, "BEND:UNDS:3550: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, "BEND:UNDS:3550: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, "BEND:UNDS:3550:IADJUST.RVAL") field(INPB, "BEND:UNDS:3550:STDZDIRECT.RVAL") field(INPC, "BEND:UNDS:3550:STDZOK.RVAL") field(INPD, "BEND:UNDS:3550:STDZDISABLE.RVAL") field(INPE, "BEND:UNDS:3550:STATE.RVAL CPP NMS") field(INPF, "BEND:UNDS:3550:ICTRL.RVAL") field(INPG, "BEND:UNDS:3550:STATE.SEVR") field(INPH, "BEND:UNDS:3550:BDELTAS.M") field(INPI, "BEND:UNDS:3550:IACT.SEVR") field(OUT, "BEND:UNDS:3550:STDZLOSTGO.SELN PP NMS") field(OOPT, "Transition To Non-zero") } record(seq, "BEND:UNDS:3550:STDZLOSTGO") { field(DESC, "Process lost stdz") field(SELM, "Mask") field(DOL1, "1") field(DOL2, "0") field(LNK1, "BEND:UNDS:3550:STDZLOSTTOD.PROC") field(LNK2, "BEND:UNDS:3550:STDZOK PP") } # Record maximum current after standardize # Reset to IACT from sequence after trim # Disable processing during (mini-)standardize or trim record(calc, "BEND:UNDS:3550:STDZIACTMAX") { field(DESC, "Max act current after stdz") field(CALC, "MAX(A, B)") field(DISV, "0") field(SDIS, "BEND:UNDS:3550:CHECKPWRDIP_ENABLE") field(INPA, "BEND:UNDS:3550:IACT CP") field(INPB, "BEND:UNDS:3550:STDZIACTMAX") field(EGU, "A") field(FLNK, "BEND:UNDS:3550:CHECKPWRDIP") } # Detect power dip if STDZOK is YES, STDZ is enabled, and IACT is valid # If IACT drops below STDZIACTMAX by more than the trim tolerance, clear STDZOK # Warning: Take the absolute value of the trim tolerance, or else quads of # negative polarity will always lose STDZ since their IDELTAS.I are negative. # Note: Large quads and bends are prone to losing STDZ even if they are # perturbed toward higher current since their current tends to overshoot # by greater than the trim tolerance before settling down. record(calcout, "BEND:UNDS:3550:CHECKPWRDIP") { field(DESC, "Detect power dip") field(CALC, "(A-B>ABS(C))?3:0") field(DISV, "0") field(SDIS, "BEND:UNDS:3550:CHECKPWRDIP_ENABLE") field(INPA, "BEND:UNDS:3550:STDZIACTMAX") field(INPB, "BEND:UNDS:3550:IACT") field(INPC, "BEND:UNDS:3550:IDELTAS.I") field(OUT, "BEND:UNDS:3550:STDZLOSTGO.SELN PP NMS") field(OOPT, "When Non-zero") } # Enable processing of STDZIACTMAX and CHECKPWRDIP only if # STDZOK = YES, STDZDISABLE = NO, CTRL != Trim (2), and # CTRL != Stdz (4) record(calc, "BEND:UNDS:3550:CHECKPWRDIP_ENABLE") { field(CALC, "A&&!B&&(C#2)&&(C#4)") field(INPA, "BEND:UNDS:3550:STDZOK.RVAL CP") field(INPB, "BEND:UNDS:3550:STDZDISABLE.RVAL CP") field(INPC, "BEND:UNDS:3550:CTRL.RVAL CP") } #! 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, "BEND:UNDS:3550: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, "BEND:UNDS:3550: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, "BEND:UNDS:3550:CALBSET") { field(DESC, "Use DAC Calbration") field(SCAN, "10 second") field(CALC, "A&&(B==0)&&C?31:960") field(INPA, "BEND:UNDS:3550:CALBOK") field(INPB, "BEND:UNDS:3550:CALBDISABLE") field(INPC, "BEND:UNDS:3550:CALBSLOPE") field(OOPT, "On Change") field(OUT, "BEND:UNDS:3550: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, "BEND:UNDS:3550:CALB_SEQ") { field(DESC, "Output Calib Values") field(SELM, "Mask") field(SELL, "BEND:UNDS:3550: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, "BEND:UNDS:3550:CALBSLOPE") field(DOL3, "BEND:UNDS:3550: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, "BEND:UNDS:3550:CALBTOD") { field(DESC, "Calibration Success Time") field(PINI, "YES") # field(DOL, "") field(OMSL, "supervisory") field(DTYP, "Soft Channel") info(autosaveFields,"VAL") } record(ao, "BEND:UNDS:3550: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, "BEND:UNDS:3550: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, "BEND:UNDS:3550: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, "BEND:UNDS:3550:CALBOFFSET") { field(DESC, "Calc DAC Offset") field(PREC, "6") field(EGU, "Counts") field(PINI, "YES") } record(bo, "BEND:UNDS:3550: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, "BEND:UNDS:3550:DACSLOPE") { field(DESC, "V to DAC slope") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "supervisory") field(PINI, "YES") field(FLNK, "BEND:UNDS:3550:DACOFFSET") } # Default Offset used in conversion from Volts to DAC Counts record(ao, "BEND:UNDS:3550:DACOFFSET") { field(DESC, "V to DAC offset") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "supervisory") field(PINI, "YES") field(FLNK, "BEND:UNDS:3550: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, "BEND:UNDS:3550: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, "BEND:UNDS:3550:IACT") field(INPD, "BEND:UNDS:3550:DACSLOPE") field(INPE, "BEND:UNDS:3550:DACOFFSET") field(EGU, "Counts") field(PREC, "6") } record(ao, "BEND:UNDS:3550:DAC") { field(DESC, "DAC Set point") field(EGU, "Counts") field(DOL, "") field(OMSL, "supervisory") field(PREC, "6") field(PINI, "YES") } record(ao, "BEND:UNDS:3550:CALBIMIN") { field(DESC, "Calibration Min Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(DRVH, "9.0") field(HOPR, "9.0") field(DRVL, "-9.0") field(LOPR, "-9.0") field(PREC, "3") field(EGU, "A") field(VAL, "0.0") field(FLNK, "BEND:UNDS:3550:CALBIMAX") } record(ao, "BEND:UNDS:3550:CALBIMAX") { field(DESC, "Calibration Max Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(DRVH, "9.0") field(HOPR, "9.0") field(LOPR, "-9.0") field(DRVL, "-9.0") field(EGU, "A") field(VAL, "9.0") field(FLNK, "BEND:UNDS:3550:CALBSTEPNUM") } record(ao, "BEND:UNDS:3550:CALBIFINAL") { field(DESC, "Calibration Last Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(PREC, "3") field(EGU, "A") field(HOPR, "9.0") field(LOPR, "-9.0") field(VAL, "0") } record(longout, "BEND:UNDS:3550: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, "BEND:UNDS:3550:CALBIDELTA") } record(calc, "BEND:UNDS:3550:CALBIDELTA") { field(DESC, "Step size for CALB") field(CALC, "C=0?0:ABS((A-B)/C)") field(INPA, "BEND:UNDS:3550:CALBIMAX") field(INPB, "BEND:UNDS:3550:CALBIMIN") field(INPC, "BEND:UNDS:3550: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, "BEND:UNDS:3550:CALBIMULT") { field(DESC, "IACT vs ISETPT mult") field(CALC, "C#0||A=0?1:ABS(B/A)") field(INPA, "BEND:UNDS:3510:ISETPT.DRVH") field(INPB, "BEND:UNDS:3510:IACT.HOPR") field(INPC, "BEND:UNDS:3550:PSCONTROLLER.RVAL CPP") field(EGU, "A") field(PINI, "YES") } # SNL dbputs DAC values here. 6-10 steps are possible. record(waveform, "BEND:UNDS:3550:CALBICTRLWF") { field(DESC, "ICTRL setpoint array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") } record(waveform, "BEND:UNDS:3550:DACWF") { field(DESC, "DAC count array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "BEND:UNDS:3550:DACSA") } # Used only for xygraph edm plot record(subArray, "BEND:UNDS:3550:DACSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "BEND:UNDS:3550: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, "BEND:UNDS:3550:CALCDACWF") { field(DESC, "Calc DAC counts array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "BEND:UNDS:3550:CALCDACSA") } # Used only for xygraph edm plot record(subArray, "BEND:UNDS:3550:CALCDACSA") { field(DESC, "Calc DAC counts") field(DTYP, "Soft Channel") field(INP, "BEND:UNDS:3550: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, "BEND:UNDS:3550:CALBYWF") { field(DESC, "mx + b") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "BEND:UNDS:3550:CALBYSA") } # Used only for xygraph edm plot record(subArray, "BEND:UNDS:3550:CALBYSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "BEND:UNDS:3550:CALBYWF") field(MALM, "10") field(NELM, "6") field(INDX, "0") field(FTVL, "DOUBLE") } record(waveform, "BEND:UNDS:3550:CALBIACTWF") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "BEND:UNDS:3550:CALBIACTSA") } # Used only for xygraph edm plot record(subArray, "BEND:UNDS:3550:CALBIACTSA") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(MALM, "10") field(NELM, "6") field(INP, "BEND:UNDS:3550:CALBIACTWF") field(INDX, "0") field(FTVL, "DOUBLE") field(FLNK, "BEND:UNDS:3550:CALBLIMITS") } # Check that measured current during calibration is within # tolerance. record(aSub, "BEND:UNDS:3550: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, "BEND:UNDS:3550:CALBSTEPNUM") field(INPB, "BEND:UNDS:3550:CALBIACTWF") field(INPC, "BEND:UNDS:3550: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, "BEND:UNDS:3550: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, "BEND:UNDS:3550:STDZITOL") field(INPH, "BEND:UNDS:3550:DACSLOPE") field(INPI, "BEND:UNDS:3550: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, "BEND:UNDS:3550: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, "BEND:UNDS:3550:CALBSTEPNUM") field(INPB, "BEND:UNDS:3550:CALBIACTWF") field(INPC, "BEND:UNDS:3550:DACWF") field(INPF, "BEND:UNDS:3550: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 BEND:UNDS:3550CALBOK 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, "BEND:UNDS:3550:DEGAUSINIT") { field(DESC, "Proc. Degauss PVs on boot") field(PINI, "YES") field(DOL, "1") field(OUTA, "BEND:UNDS:3550:DEGAUSIMIN.PROC PP") field(OUTB, "BEND:UNDS:3550:DEGAUSIMAX.PROC PP") field(OUTC, "BEND:UNDS:3550:DEGAUSTYPE.PROC PP") field(OUTD, "BEND:UNDS:3550:DEGAUSSTEP.PROC PP") field(OUTE, "BEND:UNDS:3550:MADNAME.PROC PP") field(OUTF, "BEND:UNDS:3550:PSTYPE.PROC PP") field(OUTG, "BEND:UNDS:3550: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, "BEND:UNDS:3550:DEGAUSSUB") { field(DESC, "Degauss subroutine") field(INAM, "mgntDegaussInit") field(SNAM, "mgntDegauss") field(BRSV, "INVALID") field(INPA, "BEND:UNDS:3550:DEGAUSIMIN NPP NMS") field(INPB, "BEND:UNDS:3550:DEGAUSIMAX NPP NMS") field(INPC, "BEND:UNDS:3550:DEGAUSTYPE.RVAL NPP NMS") field(INPE, "BEND:UNDS:3550:DEGAUSMETHOD.RVAL NPP NMS") field(INPF, "BEND:UNDS:3550:PSTYPE NPP NMS") field(INPG, "BEND:UNDS:3550:DEBUG.RVAL NPP NMS") field(INPH, "BEND:UNDS:3550: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, "BEND:UNDS:3550:DEGAUSWF PP") field(OUTB, "BEND:UNDS:3550:DEGAUSMSG PP") field(OUTC, "BEND:UNDS:3550: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, "BEND:UNDS:3550:DEGAUSWF") { field(DESC, "Degauss Setpts") field(NELM, "60") field(FTVL, "DOUBLE") } record(mbbo,"BEND:UNDS:3550: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, "BEND:UNDS:3550: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, "BEND:UNDS:3550: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, "BEND:UNDS:3550: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, "BEND:UNDS:3550: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, "BEND:UNDS:3550:DEGAUSIMIN") { field(DESC, "Min. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "9.0") field(LOPR, "-9.0") field(DRVH, "9.0") field(DRVL, "-9.0") field(VAL, "-9.0") } record(ao, "BEND:UNDS:3550:DEGAUSIMAX") { field(DESC, "Max. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "9.0") field(LOPR, "-9.0") field(DRVH, "9.0") field(DRVL, "-9.0") field(VAL, "9.0") } # 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,"BEND:UNDS:3550: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, "BEND:UNDS:3550: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,"BEND:UNDS:3550: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, "BEND:UNDS:3550: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, "BEND:UNDS:3550: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, "BEND:UNDS:3550: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, "BEND:UNDS:3550:DEGAUSTOD") { field(DESC, "Successful Degauss Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "BEND:UNDS:3550:DEGAUSLOSTTOD") { field(DESC, "Degauss Lost Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "BEND:UNDS:3550:DEGAUSTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "BEND:UNDS:3550:DEGAUSTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "BEND:UNDS:3550: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, "BEND:UNDS:3550:DEGAUSGO") { field(DESC, "Set bdes of btrms to zero") field(ASG, "Internal") field(OUTA, "") field(OUTB, "") field(OUTC, "") field(OUTD, "") } # =========== CRYO ONLY =========== record(bo, "BEND:UNDS:3550: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, "BEND:UNDS:3550:DEGAUS_IMAX_CHECK") { field(DESC, "Check if imax shoud chg") field(CALC, "(C==4)&&(ABS(B)>ABS(A))?1:0") field(INPA, "BEND:UNDS:3550:DEGAUS_IMAX") field(INPB, "BEND:UNDS:3550:ISETPT") field(INPC, "BEND:UNDS:3550:DEGAUSTYPE.RVAL") field(OUT, "BEND:UNDS:3550:DEGAUS_IMAX_UPDATE.SELN") field(FLNK, "BEND:UNDS:3550:DEGAUS_IMAX_UPDATE") } record(seq, "BEND:UNDS:3550:DEGAUS_IMAX_UPDATE") { field(DESC, "Degauss IMAX Update") field(SELM, "Specified") field(DOL1, "BEND:UNDS:3550:ISETPT") field(LNK1, "BEND:UNDS:3550:DEGAUS_IMAX PP") } # Set the maximum current after a successful # degauss. This pv is updated by the # sequence. record(ao, "BEND:UNDS:3550:DEGAUS_IMAX") { field(DESC, "Max I set afer a degauss") field(EGU, "Amps") field(PINI, "YES") field(PREC, "6") field(HOPR, "9.0") field(LOPR, "-9.0") field(DRVH, "9.0") field(DRVL, "-9.0") field(VAL, "9.0") field(FLNK, "BEND:UNDS:3550:DEGAUS_IMAXPOL_CHECK") info(autosaveFields,"VAL,RVAL") } # Set the polarity if degauss_imax record(calcout, "BEND:UNDS:3550:DEGAUS_IMAXPOL_CHECK") { field(DESC, "Determine polarity of imax") field(CALC, "A>=0?0:1") field(INPA, "BEND:UNDS:3550:DEGAUS_IMAX") field(FLNK, "BEND:UNDS:3550:DEGAUS_IMAXPOL") } record(bo, "BEND:UNDS:3550:DEGAUS_IMAXPOL") { field(DESC, "Polarity of imax I") field(DTYP, "Raw Soft Channel") field(DOL, "BEND:UNDS:3550:DEGAUS_IMAXPOL_CHECK") field(OMSL, "closed_loop") field(ZNAM, "Positive") field(ONAM, "Negative") field(FLNK, "BEND:UNDS:3550: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, "BEND:UNDS:3550:DEGAUS_ABSIMAX") { field(DESC, "Absolute Max. Degauss I") field(CALC, "ABS(A)") field(INPA, "BEND:UNDS:3550:DEGAUS_IMAX") field(PREC, "6") field(EGU, "Amps") field(HOPR, "9.0") field(LOPR, "-9.0") info(autosaveFields,"VAL RVAL") } # IACT Polarity record(calcout, "BEND:UNDS:3550:IACTPOL_CHECK") { field(DESC, "Determine IACT polarity") field(SCAN, "5 second") field(CALC, "ABS(A-B)>C?(A>=0?0:1):D") field(INPA, "BEND:UNDS:3550:IACT") field(INPB, "BEND:UNDS:3550:IACTPOL_CHECK.LA") field(INPC, "0.0001") field(INPD, "BEND:UNDS:3550:IACTPOL_CHECK.PVAL") field(OOPT, "On Change") field(FLNK, "BEND:UNDS:3550:IACTPOL") } record(bo, "BEND:UNDS:3550: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,"BEND:UNDS:3550: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, "BEND:UNDS:3550:DEGAUSENABLE CP") field(INPB, "BEND:UNDS:3550:DEGAUSOK") field(INPC, "BEND:UNDS:3550:STATE CP") field(INPD, "BEND:UNDS:3550:STATE.SEVR") field(OUT, "BEND:UNDS:3550:DEGAUS_STATE_SEQ.SELN PP") field(ASG, "Internal") } record(seq, "BEND:UNDS:3550:DEGAUS_STATE_SEQ") { field(DESC, "Degauss State Sequence") field(SELM, "Specified") field(SELL, "BEND:UNDS:3550:DEGAUS_STATE_CHECK") field(LNK1, "BEND:UNDS:3550:DEGAUS_STATE_DISABLE.PROC PP") field(LNK2, "BEND:UNDS:3550:DEGAUS_STATE_LOST.PROC PP") field(LNK3, "BEND:UNDS:3550:DEGAUS_STATE_GOOD.PROC PP") field(LNK4, "BEND:UNDS:3550: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, "BEND:UNDS:3550:DEGAUS_STATE_DISABLE") { field(DESC, "Degauss not used") field(LNK1, "BEND:UNDS:3550:DEGAUSOK.ZSV") field(LNK2, "BEND:UNDS:3550: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, "BEND:UNDS:3550:STATMSG.FRSV") field(LNK4, "BEND:UNDS:3550: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, "BEND:UNDS:3550:DEGAUS_STATE_LOST") { field(DESC, "Degauss lost and ps On") field(DOL1, "1") field(LNK1, "BEND:UNDS:3550:DEGAUSOK.ZSV") field(LNK2, "BEND:UNDS:3550: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, "BEND:UNDS:3550:STATMSG.FRSV") field(LNK4, "BEND:UNDS:3550: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, "BEND:UNDS:3550:DEGAUS_STATE_OFF") { field(DESC, "Degaused lost and ps Off") field(DOL1, "2") field(LNK1, "BEND:UNDS:3550: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, "BEND:UNDS:3550:STATMSG.FRSV") field(LNK3, "BEND:UNDS:3550: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, "BEND:UNDS:3550:DEGAUS_STATE_GOOD") { field(DESC, "Degauss good") field(DOL1, "1") field(LNK1, "BEND:UNDS:3550: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, "BEND:UNDS:3550:STATMSG.FRSV PP") field(LNK3, "BEND:UNDS:3550:STATMSG.FVSV PP") field(LNK4, "") field(ASG, "Internal") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(mbbo, "BEND:UNDS:3550:FUNC") { field(DESC, "BEND:UNDS:3550 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, "0") field(FFVL, "0") field(OUT, "BEND:UNDS:3550:CTRL CA") } # :CTRL pv is processed at boot in the # sequence mgntCtrl.st Processed in sequence # record(mbbo, "BEND:UNDS:3550:CTRL") { field(DESC, "BEND:UNDS:3550 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, "BEND:UNDS:3550:SELECTEN.A PP") field(SDIS, "0") } # If a function has been selected set this unit to busy record(calcout, "BEND:UNDS:3550:SELECTEN") { field(DESC, "Control Select Enable") field(CALC, "A>0?1:A") field(FLNK, "BEND:UNDS:3550:BUSY") } # Set to FREE on IOC reboot record(bo, "BEND:UNDS:3550:BUSY") { field(DESC, "BEND:UNDS:3550 Ctrl Done") field(DOL, "BEND:UNDS:3550:SELECTEN") field(ZNAM, "FREE") field(ONAM, "BUSY") field(PINI, "YES") field(FLNK, "BEND:UNDS:3550:SELECT") } record(bo, "BEND:UNDS:3550:SELECT") { field(ZNAM, "NO") field(ONAM, "YES") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") } record(bo, "BEND:UNDS:3550: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, "BEND:UNDS:3550:CTRLSTATE") { field(DESC, "BEND:UNDS:3550 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("BEND:UNDS:3550:CTRL",20,20,0,0,"BEND:UNDS:3550:CTRL") #! Field("BEND:UNDS:3550:CTRL.OUT",16777215,1,"BEND:UNDS:3550:CTRL.OUT") #! Link("BEND:UNDS:3550:CTRL.OUT","BEND:UNDS:3550:SELECTEN.A") #! Field("BEND:UNDS:3550:CTRL.VAL",16777215,1,"BEND:UNDS:3550:CTRL.VAL") #! Record("BEND:UNDS:3550:SELECTEN",321,381,0,0,"BEND:UNDS:3550:SELECTEN") #! Field("BEND:UNDS:3550:SELECTEN.A",16777215,0,"BEND:UNDS:3550:SELECTEN.A") #! Field("BEND:UNDS:3550:SELECTEN.FLNK",16777215,1,"BEND:UNDS:3550:SELECTEN.FLNK") #! Link("BEND:UNDS:3550:SELECTEN.FLNK","BEND:UNDS:3550:BUSY") #! Field("BEND:UNDS:3550:SELECTEN.VAL",16777215,1,"BEND:UNDS:3550:SELECTEN.VAL") #! Record("BEND:UNDS:3550:BUSY",623,274,0,0,"BEND:UNDS:3550:BUSY") #! Field("BEND:UNDS:3550:BUSY.DOL",16777215,0,"BEND:UNDS:3550:BUSY.DOL") #! Link("BEND:UNDS:3550:BUSY.DOL","BEND:UNDS:3550:SELECTEN.VAL") #! Field("BEND:UNDS:3550:BUSY.FLNK",16777215,1,"BEND:UNDS:3550:BUSY.FLNK") #! Link("BEND:UNDS:3550:BUSY.FLNK","BEND:UNDS:3550:SELECT") #! Record("BEND:UNDS:3550:SELECT",669,508,0,1,"BEND:UNDS:3550:SELECT") #! Record("BEND:UNDS:3550:FUNC",940,120,0,0,"BEND:UNDS:3550:FUNC") #! Field("BEND:UNDS:3550:FUNC.OUT",16777215,0,"BEND:UNDS:3550:FUNC.OUT") #! Link("BEND:UNDS:3550:FUNC.OUT","BEND:UNDS:3550:CTRL.VAL") #! Record("BEND:UNDS:3550:ABORT",193,41,0,0,"BEND:UNDS:3550:ABORT") #! Record("BEND:UNDS:3550:CTRLSTATE",369,34,0,0,"BEND:UNDS:3550: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,"BEND:UNDS:3550:SELECT is used for Multi-device selection.\nIt is enabled when associated BEND:UNDS:3550:CTRL is \"0\" (DONE).\nIt is disabled when associated BEND:UNDS:3550: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,"BEND:UNDS:3550: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, "BEND:UNDS:3550:BCTRL_INIT") { field(DESC, "Process BCTRL on boot") field(PINI, "YES") field(CALC, "A=3?1:0") field(INPA, "BEND:UNDS:3550:BCTRL.SEVR") field(OUT, "BEND:UNDS:3550: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, "BEND:UNDS:3550:BACT") { field(DESC, "Actual B") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "BEND:UNDS:3550:BACT") field(INPB, "BEND:UNDS:3550:POLYCOEF") field(INPC, "BEND:UNDS:3550:POLYCOEF.A") field(INPD, "BEND:UNDS:3550:POLYCOEF.B") field(INPE, "BEND:UNDS:3550:IACTCALC MS") field(INPF, "BEND:UNDS:3550:BDELTAS PP") field(INPG, "100") field(EGU, "kG-m") field(HOPR, "2.68") field(LOPR, "0.0") field(HIHI, "2.68") field(LOLO, "0.0") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "2.68") field(LOW, "0.0") field(FLNK, "BEND:UNDS:3550: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, "BEND:UNDS:3550:BDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntPhyDeltas") field(EGU, "kG-m") field(HOPR, "1") field(PREC, "7") field(BRSV, "INVALID") field(INPA, "BEND:UNDS:3550:BDES") field(INPB, "BEND:UNDS:3550:TRIMBTOL") field(INPC, "BEND:UNDS:3550:TRIMBTOLR") field(INPD, "BEND:UNDS:3550:CHCKBTOL") field(INPE, "BEND:UNDS:3550:CHCKBTOLR") field(F, "2.0") field(INPG, "30") field(INPH, "BEND:UNDS:3550:BACT.VAL") # # MPS absolute and relative tolerances field(INPP, "BEND:UNDS:3550:MPSBTOL") field(INPQ, "BEND:UNDS:3550:MPSBTOLR") field(FLNK, "BEND:UNDS:3550:BCONLIMITS") info(autosaveFields,"F") } # This record is processed by BDELTAS record(aSub, "BEND:UNDS:3550:BCONLIMITS") { field(DESC, "Config B-field Limits") field(INAM, "mgntInit") field(SNAM, "mgntBCONLimits") field(INPA, "BEND:UNDS:3550:BDES") field(INPB, "BEND:UNDS:3550:BDELTAS.I") field(INPG, "BEND:UNDS:3550:DEBUG.RVAL") field(FTA, "DOUBLE") field(FTB, "DOUBLE") field(FTG, "ULONG") field(OUTA, "BEND:UNDS:3550:BCON.HIGH") field(OUTB, "BEND:UNDS:3550:BCON.LOW") field(OUTC, "BEND:UNDS:3550:BCON.HIHI") field(OUTD, "BEND:UNDS:3550:BCON.LOLO PP") field(FTVA, "DOUBLE") field(FTVB, "DOUBLE") field(FTVC, "DOUBLE") field(FTVD, "DOUBLE") field(BRSV, "INVALID") field(FLNK, "BEND:UNDS:3550:IDELTAS") } # The following PV is processed by :BACT # which is processed by :BACT # record(fanout, "BEND:UNDS:3550:BACTFO") { field(DESC, "BACT processing") field(SELM, "All") field(LNK1, "BEND:UNDS:3550:BDIFF") field(LNK2, "BEND:UNDS:3550:BADIFF") field(LNK3, "BEND:UNDS:3550:BRATIO") field(LNK4, "BEND:UNDS:3550:MPSLIMITS") field(LNK5, "BEND:UNDS:3550:I2BSTATUS") field(LNK6, "BEND:UNDS:3550:IACTFO.PROC") } record(calc, "BEND:UNDS:3550:BDIFF") { field(DESC, "BDES-BACT") field(CALC, "A-B") field(INPA, "BEND:UNDS:3550:BDES") field(INPB, "BEND:UNDS:3550:BACT") field(EGU, "kG-m") field(PREC, "7") } record(calc, "BEND:UNDS:3550:BADIFF") { field(DESC, "Absolute BDES-BACT") field(INPA, "BEND:UNDS:3550:BDIFF") field(EGU, "kG-m") field(PREC, "7") field(CALC, "A<0?ABS(A):A") } record(calc, "BEND:UNDS:3550:BRATIO") { field(DESC, "BACT Error") field(CALC, "B?A/B:0") field(INPA, "BEND:UNDS:3550:BDIFF") field(INPB, "BEND:UNDS:3550:BDES.HOPR") field(EGU, "kG-m") field(PREC, "7") } record(mbbi, "BEND:UNDS:3550: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, "BEND:UNDS:3550:BACT.J") } # Note: for a string slave set the MONFL # macro to the following: # MONFL=:IMONCALC MS record(sub, "BEND:UNDS:3550:BMON") { field(DESC, "Second Transductor") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "BEND:UNDS:3550:BMON") field(INPB, "BEND:UNDS:3550:POLYCOEF") field(INPC, "BEND:UNDS:3550:POLYCOEF.A") field(INPD, "BEND:UNDS:3550:POLYCOEF.B") field(INPE, "BEND:UNDS:3550:IMONCALC MS") field(INPF, "BEND:UNDS:3550:BDELTAS.VAL") field(INPG, "100") field(EGU, "kG-m") field(HOPR, "2.68") field(LOPR, "0.0") field(HIHI, "2.68") field(LOLO, "0.0") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "2.68") field(LOW, "0.0") } # 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=BEND:UNDS:3510:BDES CP record(ao, "BEND:UNDS:3550:BDES") { field(DESC, "Desired B-Field") field(PINI, "NO") field(DRVH, "2.68") field(DRVL, "0.0") field(HOPR, "2.68") field(LOPR, "0.0") field(PREC, "7") field(EGU, "kG-m") field(MDEL, "-1") field(OMSL, "closed_loop") field(DOL, "BEND:UNDS:3550:IDES2BDES") field(OUT, "BEND:UNDS:3550:B2IDES PP") info(autosaveFields,"VAL") } record(sub, "BEND:UNDS:3550:B2IDES") { field(DESC, "Convert Desired B-Field to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "BEND:UNDS:3550:POLYCOEF") field(INPC, "BEND:UNDS:3550:POLYCOEF.A") field(INPD, "BEND:UNDS:3550:POLYCOEF.B") field(PREC, "7") field(EGU, "kG-m") field(HOPR, "2.68") field(LOPR, "0.0") field(MDEL, "-1") field(INPE, "BEND:UNDS:3550:BDES.DRVH") field(INPF, "BEND:UNDS:3550:BDES.DRVL") field(BRSV, "INVALID") field(FLNK, "BEND:UNDS:3550:IDES") } record(sub, "BEND:UNDS:3550:BNOM") { field(DESC, "Nominal Field") field(PINI, "YES") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "BEND:UNDS:3550:POLYCOEF") field(INPC, "BEND:UNDS:3550:POLYCOEF.A") field(INPD, "BEND:UNDS:3550:POLYCOEF.B") field(INPE, "BEND:UNDS:3550:BDES.DRVH") field(INPF, "BEND:UNDS:3550:BDES.DRVL") field(EGU, "kG-m") field(HOPR, "2.68") field(LOPR, "0.0") field(PREC, "7") field(VAL, "0.0") field(FLNK, "BEND:UNDS:3550:INOM") } record(sub, "BEND:UNDS:3550:BACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "BEND:UNDS:3550:BDES.VAL") field(INPB, "BEND:UNDS:3550:BDES.DRVH") field(INPC, "BEND:UNDS:3550:BDES.DRVL") field(INPD, "BEND:UNDS:3550:BDELTAS.I") field(INPE, "BEND:UNDS:3550:BDELTAS.J") field(INPG, "BEND:UNDS:3550:STATE") field(INPH, "BEND:UNDS:3550:HSTA") field(EGU, "kG-m") field(HOPR, "2.68") field(LOPR, "0.0") field(PREC, "7") field(BRSV, "INVALID") } record(sub, "BEND:UNDS:3550:BMONLIMITS") { field(DESC, "MON Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "BEND:UNDS:3550:BDES.VAL") field(INPB, "BEND:UNDS:3550:BDES.DRVH") field(INPC, "BEND:UNDS:3550:BDES.DRVL") field(INPD, "BEND:UNDS:3550:BDELTAS.K") field(INPE, "BEND:UNDS:3550:BDELTAS.L") field(INPG, "BEND:UNDS:3550:STATE") field(INPH, "BEND:UNDS:3550:HSTA") field(EGU, "kG-m") field(HOPR, "2.68") field(LOPR, "0.0") field(PREC, "7") field(BRSV, "INVALID") } record(seq, "BEND:UNDS:3550:BLIMITS") { field(DESC, "ACT Limits") field(PREC, "7") field(DOL1, "BEND:UNDS:3550:BLIMITS") field(LNK1, "BEND:UNDS:3550:BACTLIMITS.F PP") field(DOL2, "BEND:UNDS:3550:BACTLIMITS.I") field(LNK2, "BEND:UNDS:3550:BACT.HIGH") field(DOL3, "BEND:UNDS:3550:BACTLIMITS.J") field(LNK3, "BEND:UNDS:3550:BACT.LOW") field(DOL4, "BEND:UNDS:3550:BACTLIMITS.K") field(LNK4, "BEND:UNDS:3550:BACT.HIHI") field(DOL5, "BEND:UNDS:3550:BACTLIMITS.L") field(LNK5, "BEND:UNDS:3550:BACT.LOLO") field(DOL6, "BEND:UNDS:3550:BLIMITS") field(LNK6, "BEND:UNDS:3550:BMONLIMITS.F PP") field(DOL7, "BEND:UNDS:3550:BMONLIMITS.I") field(LNK7, "BEND:UNDS:3550:BMON.HIGH") field(DOL8, "BEND:UNDS:3550:BMONLIMITS.J") field(LNK8, "BEND:UNDS:3550:BMON.LOW") field(DOL9, "BEND:UNDS:3550:BMONLIMITS.K") field(LNK9, "BEND:UNDS:3550:BMON.HIHI") field(DOLA, "BEND:UNDS:3550:BMONLIMITS.L") field(LNKA, "BEND:UNDS:3550:BMON.LOLO") field(FLNK, "BEND:UNDS:3550:ILIMITS") field(SCAN, "5 second") } record(ao, "BEND:UNDS:3550:BCTRL") { field(DESC, "B-Perturb") field(PREC, "7") field(EGU, "kG-m") field(DRVH, "2.68") field(DRVL, "0.0") field(HOPR, "2.68") field(LOPR, "0.0") # 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, "BEND:UNDS:3550: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, "BEND:UNDS:3550:BCTRLGO") { field(DESC, "Update DES and perturb") field(PREC, "7") # Disable BACT limits field(DOL1, "1") field(LNK1, "BEND:UNDS:3550:BLIMITS.VAL") # Update BDES with the BCTRL (slider) value field(DOL2, "BEND:UNDS:3550:BCTRL.VAL") field(LNK2, "BEND:UNDS:3550:BDES PP") field(DOL3, "1") field(LNK3, "BEND:UNDS:3550:IDIRECT.PROC PP") field(DOL4, "1") field(LNK4, "BEND:UNDS:3550:CHECKSTDZLOST.PROC PP") field(DOL5, "BEND:UNDS:3550:BCTRL.VAL") field(LNK5, "BEND:UNDS:3550:BCTRLSUB PP") # Re-enable BACT limits field(DOL6, "0") field(LNK6, "BEND:UNDS:3550:BLIMITS.VAL") } # Convert B-field to Current and output to ISETPT record(sub, "BEND:UNDS:3550:BCTRLSUB") { field(DESC, "Feedback") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "BEND:UNDS:3550:POLYCOEF") field(INPC, "BEND:UNDS:3550:POLYCOEF.A") field(INPD, "BEND:UNDS:3550:POLYCOEF.B") field(INPE, "BEND:UNDS:3550:BDES.DRVH") field(INPF, "BEND:UNDS:3550:BDES.DRVL") field(PREC, "7") field(EGU, "kG-m") field(HOPR, "2.68") field(LOPR, "0.0") field(MDEL, "-1") field(BRSV, "INVALID") field(FLNK, "BEND:UNDS:3550:ISETPT") } record(ao, "BEND:UNDS:3550:BDESPREVTRIM") { field(DESC, "trim bdes for undo") field(DTYP, "Soft Channel") field(DRVH, "2.68") field(DRVL, "0.0") field(EGU, "kG-m") field(HOPR, "2.68") field(LOPR, "0.0") field(PREC, "7") field(PINI, "YES") info(autosaveFields,"VAL") } record(stringin, "BEND:UNDS:3550:MADNAME") { field(DESC, "MAD deck nomenclature") field(PINI, "YES") field(VAL, "BCXSS3") } record(ai, "BEND:UNDS:3550: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, "3649.274119") } record(ao, "BEND:UNDS:3550:BMAX") { field(DESC, "Max B-Field") field(DTYP, "Soft Channel") field(DRVH, "2.68") field(DRVL, "0.0") field(EGU, "kG-m") field(HOPR, "2.68") field(LOPR, "0.0") field(PREC, "7") field(PINI, "YES") field(VAL, "2.68") field(FLNK, "BEND:UNDS:3550:BSTEP") } record(ao, "BEND:UNDS:3550:BMIN") { field(DESC, "Min B-Field") field(DTYP, "Soft Channel") field(DRVH, "2.68") field(DRVL, "0.0") field(EGU, "kG-m") field(HOPR, "2.68") field(LOPR, "0.0") field(PREC, "7") field(PINI, "YES") field(VAL, "0.0") field(FLNK, "BEND:UNDS:3550:BSTEP") } record(ao, "BEND:UNDS:3550:BDESSAVE") { field(DESC, "bdes for save/load") field(DTYP, "Soft Channel") field(DRVH, "2.68") field(DRVL, "0.0") field(EGU, "kG-m") field(HOPR, "2.68") field(LOPR, "0.0") field(PINI, "YES") field(PREC, "7") } # This record is processed by BEND:UNDS:3550: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, "BEND:UNDS:3550:BCON") { field(DESC, "Config B-Field ") field(DTYP, "Soft Channel") field(PREC, "7") field(EGU, "kG-m") field(HOPR, "2.68") field(LOPR, "0.0") field(DRVH, "2.68") field(DRVL, "0.0") # 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 , "BEND:UNDS:3550:ICON2BCON") field(OMSL, "closed_loop") field(OUT, "BEND:UNDS:3550:B2ICON PP") info(autosaveFields,"VAL") } record(sub, "BEND:UNDS:3550:B2ICON") { field(DESC, "Convert Desired ICon to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "BEND:UNDS:3550:POLYCOEF") field(INPC, "BEND:UNDS:3550:POLYCOEF.A") field(INPD, "BEND:UNDS:3550:POLYCOEF.B") field(PREC, "7") field(EGU, "kG-m") field(HOPR, "2.68") field(LOPR, "0.0") field(MDEL, "-1") field(INPE, "BEND:UNDS:3550:BCON.DRVH") field(INPF, "BEND:UNDS:3550:BCON.DRVL") field(BRSV, "INVALID") field(FLNK, "BEND:UNDS:3550: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, "BEND:UNDS:3550:BSTEP") { field(DESC, "B-Field step size") field(CALC, "(C==3)||(D==3)?0:ABS(A-B)*0.005") field(INPA, "BEND:UNDS:3550:BMAX") field(INPB, "BEND:UNDS:3550:BMIN") field(INPC, "BEND:UNDS:3550:BMIN.SEVR") field(INPD, "BEND:UNDS:3550:BMAX.SEVR") field(EGU, "kG-m") 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,"BEND:UNDS:3550:BCTRLDISABLECALC") { field(DESC, "Calc for disabling BCTRL") field(ASG, "Internal") field(CALC, "A?2:1") field(INPA, "BEND:UNDS:3550:ONLINE CP") field(OUT, "BEND:UNDS:3550:BCTRLDISABLEFOUT PP") } record(fanout, "BEND:UNDS:3550:BCTRLDISABLEFOUT") { field(DESC, "Disable BCTRL fanout") field(SELM, "Specified") field(SELL, "BEND:UNDS:3550:BCTRLDISABLECALC") field(LNK1, "BEND:UNDS:3550:BCTRLDISABLE") field(LNK2, "BEND:UNDS:3550:BCTRLENABLE") } record(stringout, "BEND:UNDS:3550:BCTRLDISABLE") { field(DESC, "Disable BCTRL") field(DTYP, "Soft Channel") field(OUT, "BEND:UNDS:3550:BCTRL.ASG") field(VAL, "NOWRITE") field(FLNK, "BEND:UNDS:3550:BCTRLDISV_UPDATE") } record(stringout, "BEND:UNDS:3550:BCTRLENABLE") { field(DESC, "Enable BCTRL") field(DTYP, "Soft Channel") field(OUT, "BEND:UNDS:3550:BCTRL.ASG") field(VAL, "") field(FLNK, "BEND:UNDS:3550:BCTRLDISV_UPDATE") } record(calcout, "BEND:UNDS:3550:BCTRLDISV_UPDATE") { field(DESC, "Calc for updating BCTRL.DISV") field(ASG, "Internal") field(CALC, "A") field(INPA, "BEND:UNDS:3550:ONLINE") field(OUT, "BEND:UNDS:3550: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,"BEND:UNDS:3550:BACT and MON\n are processed via links from \n BEND:UNDS:3550:IACT (device raw value readback 1)\n and\n BEND:UNDS:3550: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 BEND:UNDS:3550:POLYCOEF\nC = First polynomial coefficient (offset if linear)\nD = Second polynomial coefficient (slope if linear)\nE = BEND:UNDS:3550: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,"BEND:UNDS:3550:BDES\n is processed when set by CA users or \n BEND:UNDS:3550: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,"BEND:UNDS:3550: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 BEND:UNDS:3550: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 (BEND:UNDS:3550: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,"BEND:UNDS:3550:B*LIMITS and BEND:UNDS:3550:BLIMITS:\n Calculate alarm and warning limits based on \n deltas from BEND:UNDS:3550: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,"BEND:UNDS:3550: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,"BEND:UNDS:3550: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, "BEND:UNDS:3550: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, "BEND:UNDS:3550:MPSBTOL") { field(DESC, "Absolute mps tol") field(EGU, "kG-m") field(PREC, "2") field(CALC, "ABS(A)*0.02") field(INPA, "BEND:UNDS:3550:BMAX") field(PINI, "YES") } # # 21-Aug-2013: K. Luchini # Set channel access security so that users # cannot easily change values. record(ao, "BEND:UNDS:3550:MPSBMAX") { field(DESC, "MPS Max B-field") field(EGU, "kG-m") field(PREC, "7") field(DRVH, "2.68") field(DRVL, "0.0") field(PINI, "YES") field(VAL, "2.68") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "BEND:UNDS:3550:MPSBMIN") { field(DESC, "MPS Min B-field") field(EGU, "kG-m") field(PREC, "7") field(DRVH, "2.68") field(DRVL, "0.0") field(PINI, "YES") field(VAL, "0.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "BEND:UNDS:3550:MPSBLLIM") { field(DESC, "MPS Low Limit B-field") field(EGU, "kG-m") field(PREC, "7") field(DRVH, "2.68") field(DRVL, "0.0") field(PINI, "YES") field(VAL, "0.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "BEND:UNDS:3550:MPSBLLIM2") { field(DESC, "MPS Low Limit #2 B-field") field(EGU, "kG-m") field(PREC, "7") field(DRVH, "2.68") field(DRVL, "0.0") field(PINI, "YES") field(VAL, "0.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } # Set the default to Std record(mbbo, "BEND:UNDS:3550: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, "BEND:UNDS:3550:MPSLIMITS.E PP") } record(aSub, "BEND:UNDS:3550: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, "BEND:UNDS:3550:MPS.RVAL") field(INPB, "BEND:UNDS:3550:BADIFF") field(INPC, "BEND:UNDS:3550:BDELTAS.N") field(INPD, "BEND:UNDS:3550:BACT") field(INPE, "BEND:UNDS:3550:MPSBITMASK.RVAL") field(INPF, "BEND:UNDS:3550:MPSBLLIM") field(INPG, "BEND:UNDS:3550:MPSBMIN") field(INPH, "BEND:UNDS:3550:MPSBMAX") field(INPI, "BEND:UNDS:3550: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, "BEND:UNDS:3550:INTOL.RVAL PP") field(OUTB, "BEND:UNDS:3550:INTOL_BMIN.RVAL PP") field(OUTC, "BEND:UNDS:3550:INTOL_BRANGE.RVAL PP") field(OUTD, "BEND:UNDS:3550: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, "BEND:UNDS:3550:INTOL") { field(DESC, "BACT within MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "BEND:UNDS:3550:MPSLIMITS.VALA") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "BEND:UNDS:3550:INTOL_BMIN") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "BEND:UNDS:3550:MPSLIMITS.VALB") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "BEND:UNDS:3550:INTOL_BMIN2") { field(DESC, "MPS tol #2") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "BEND:UNDS:3550:MPSLIMITS.VALD") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "BEND:UNDS:3550:INTOL_BRANGE") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "BEND:UNDS:3550: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, "BEND:UNDS:3550:CHCKITOL") { field(DESC, "Absolute Check I Tolerance") field(EGU, "A") field(FLNK, "BEND:UNDS:3550:TRIMITOL") field(CALC, "ABS(A*B)") field(INPA, "BEND:UNDS:3550:CHCKBTOL") field(INPB, "BEND:UNDS:3550:POLYCOEF.B") field(PREC, "9") } record(calc, "BEND:UNDS:3550:TRIMBTOL") { field(EGU, "kG-m") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(DESC, "Absolute Trim Tolerance") field(CALC, "ABS(A)/2") field(INPA, "BEND:UNDS:3550:CHCKBTOL") field(FLNK, "BEND:UNDS:3550:CHCKITOL") } record(calc, "BEND:UNDS:3550:CHCKBTOL") { field(DESC, "Check absolute tolerance") field(EGU, "A") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(FLNK, "BEND:UNDS:3550:TRIMBTOL") field(CALC, "MAX(ABS(A),ABS(C))*(B/1000000)") field(INPA, "BEND:UNDS:3550:BDES.HOPR") field(INPB, "BEND:UNDS:3550:STABILITY") field(INPC, "BEND:UNDS:3550:BDES.LOPR") } record(longout, "BEND:UNDS:3550: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, "BEND:UNDS:3550:CHCKBTOL") } record(calc, "BEND:UNDS:3550:TRIMITOL") { field(DESC, "Absolute Trim I Tolerance") field(EGU, "kG-m") field(CALC, "ABS(A*B)") field(INPA, "BEND:UNDS:3550:POLYCOEF.B") field(INPB, "BEND:UNDS:3550:TRIMBTOL") field(PREC, "9") } record(ai, "BEND:UNDS:3550:TRIMBTOLR") { field(DESC, "Relative trim tol") field(PREC, "4") field(EGU, "%") field(HOPR, "1.0") field(LOPR, "0.0") field(PINI, "YES") } record(ai, "BEND:UNDS:3550: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, "BEND:UNDS:3550:FBCKFCOM") { field(ZNAM, "CA") field(ONAM, "FCOM") field(DESC, "CA Mode") field(PINI, "YES") field(SDIS, "0") } record(bo, "BEND:UNDS:3550:PAU") { field(ZNAM, "NotConfigured") field(ONAM, "Configured") field(DESC, "PAU Present") field(PINI, "YES") field(SDIS, "0") field(FLNK, "BEND:UNDS:3550:PAUGO") } record(fanout, "BEND:UNDS:3550:PAUGO") { field(DESC, "PAU control") field(LNK1, "BEND:UNDS:3550:PAUSTOP") field(LNK2, "BEND:UNDS:3550: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, "BEND:UNDS:3550:PAUSTART") { field(DESC, "Setup for PAU On") field(SDIS, "BEND:UNDS:3550: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, "BEND:UNDS:3550:PAUSTOP") { field(DESC, "Setup for PAU Off") field(SDIS, "BEND:UNDS:3550: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, "BEND:UNDS:3550:MCORDEVNAME") { field(DESC, "PS device name") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, "BEND:UNDS:3510:") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "BEND:UNDS:3550: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, "BEND:UNDS:3550:PSTYPE.RVAL") field(INPC, "BEND:UNDS:3550:TURNEDOFF.RVAL") field(INPD, "BEND:UNDS:3550:CONFIG.RVAL") field(INPE, "BEND:UNDS:3550:PSCATEGORY.RVAL") field(INPF, "BEND:UNDS:3550:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "BEND:UNDS:3550:AUTOCTRL.RVAL") field(INPJ, "BEND:UNDS:3550:OUTOFSERVICE.RVAL") field(INPL, "BEND:UNDS:3550:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "BEND:UNDS:3550:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "BEND:UNDS:3550:PAU") field(INPP, "BEND:UNDS:3550:CALBDISABLE.RVAL") field(INPQ, "BEND:UNDS:3550:PTRBDISABLE.RVAL") field(INPR, "BEND:UNDS:3550:TRIMDISABLE.RVAL") field(INPS, "BEND:UNDS:3550:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "BEND:UNDS:3550:FBCK") field(INPU, "BEND:UNDS:3550:TRIMTYPE.RVAL") field(INPV, "BEND:UNDS:3550:STDZDIRECT.RVAL") field(INPW, "BEND:UNDS:3550:DEGAUSENABLE.RVAL") field(FLNK, "BEND:UNDS:3550:HSTA") } record(longin, "BEND:UNDS:3550:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "BEND:UNDS:3550:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "BEND:UNDS:3550: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, "BEND:UNDS:3550: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, "BEND:UNDS:3550: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, "BEND:UNDS:3550: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, "BEND:UNDS:3550: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, "BEND:UNDS:3550: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 BEND:UNDS:3550:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses BEND:UNDS:3550:FBCK. # This PV should be replaced by BEND:UNDS:3550: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, "BEND:UNDS:3550: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, "BEND:UNDS:3550: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, "BEND:UNDS:3550: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, "BEND:UNDS:3510:OUTOFSERVICE CPP NMS") field(OMSL, "closed_loop") field(FLNK, "BEND:UNDS:3550:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"BEND:UNDS:3550:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "BEND:UNDS:3550:OUTOFSERVICE NPP NMS") field(OUT, "BEND:UNDS:3550:ONLINE PP") } record(bo, "BEND:UNDS:3550:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "BEND:UNDS:3550: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, "BEND:UNDS:3550: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, "BEND:UNDS:3550: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, "BEND:UNDS:3550: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, "BEND:UNDS:3550: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, "BEND:UNDS:3550: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, "BEND:UNDS:3550: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, "BEND:UNDS:3550: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, "BEND:UNDS:3550: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, "BEND:UNDS:3550: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, "BEND:UNDS:3550: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, "BEND:UNDS:3550:TRIMTYPE") } record(stringout, "BEND:UNDS:3550:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "BEND:UNDS:3510:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "BEND:UNDS:3550:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "BEND:UNDS:3550:STATE.RVAL") field(INPB, "BEND:UNDS:3550:INTLKSUMY.RVAL") field(OUT, "BEND:UNDS:3550:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "BEND:UNDS:3550: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, "BEND:UNDS:3550:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "BEND:UNDS:3550:STATE.RVAL") field(INPB, "BEND:UNDS:3550:INTLKSUMY.RVAL") field(OUT, "BEND:UNDS:3550:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "BEND:UNDS:3550:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "BEND:UNDS:3550:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "BEND:UNDS:3550: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, "BEND:UNDS:3550: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, "BEND:UNDS:3550: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, "BEND:UNDS:3550: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,"BEND:UNDS:3550: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("BEND:UNDS:3550:TURNEDOFF",3140,1907,0,1,"BEND:UNDS:3550:TURNEDOFF") #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "BEND:UNDS:3550:STATSUB") { field(DESC, "Build STATus ") field(INAM, "mgntInit") field(SNAM, "mgntSlcStat") field(INPA, "BEND:UNDS:3550:BACT.STAT") field(INPB, "BEND:UNDS:3550:BDES.STAT") field(INPC, "BEND:UNDS:3550: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, "BEND:UNDS:3550:BACT.SEVR") field(INPH, "BEND:UNDS:3550:BDES.SEVR") field(INPI, "BEND:UNDS:3550: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, "BEND:UNDS:3550:STATE.RVAL") field(INPN, "BEND:UNDS:3550:STDZOK") field(INPO, "BEND:UNDS:3550:CALBOK") field(INPP, "BEND:UNDS:3550:OUTOFSERVICE.RVAL") field(INPQ, "BEND:UNDS:3550:CONFIG.RVAL") field(INPR, "BEND:UNDS:3550:HSTA") field(INPS, "BEND:UNDS:3550:CTRL.RVAL") field(INPT, "BEND:UNDS:3550:DEGAUSOK") field(INPV, "BEND:UNDS:3550: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, "BEND:UNDS:3550:STAT") } record(longout, "BEND:UNDS:3550:STAT") { field(DESC, "STAT sent to SLC") field(SCAN, "Passive") field(FLNK, "BEND:UNDS:3550:STATCTRLSUB") field(DOL, "BEND:UNDS:3550:STATSUB.VAL") field(OMSL, "closed_loop") } record(sSub, "BEND:UNDS:3550:STATCTRLSUB") { field(DESC, "Decode SLC STAT into mbbo") field(INAM, "mgntInit") field(SNAM, "mgntStatDecode") field(INPA, "BEND:UNDS:3550:STAT") field(INPB, "BEND:UNDS:3550:HSTA") field(INPD, "BEND:UNDS:3550:ONOFFCTRL.RVAL") field(FLNK, "BEND:UNDS:3550:STATMSG") } record(mbbo, "BEND:UNDS:3550: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, "BEND:UNDS:3550:UNAVAILGO") field(DOL, "BEND:UNDS:3550:STATCTRLSUB.W") } record(seq, "BEND:UNDS:3550:UNAVAILGO") { field(DESC, "Process UNAVAIL") field(DOL1, "BEND:UNDS:3550:STATSUB.U") field(LNK1, "BEND:UNDS:3550:UNAVAIL PP") } record(stringout, "BEND:UNDS:3550:SNLSTATMSG") { field(DTYP, "Soft Channel") } #! TextBox(TB0,820,1000,1200,1220,0,"Dialog",12,1,16777215,"BEND:UNDS:3550:STATUSSUB - future\nOverall device status - takes input from action snls, record sevrs, master snl(s) and outputs final status\n\nInputs:\nA - BEND:UNDS:3550:CTRLSTATUS - snl status\nB - MGNT:CTRLSTATUS - master list status\nC\nD - BEND:UNDS:3550: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,"BEND:UNDS:3550STATSUB\nformat control bo's into slc STAT\n\nInputs:\nA - BEND:UNDS:3550:STATUS\nC - BEND:UNDS:3550:ON\nD - BEND:UNDS:3550:STDZOK\nE - BEND:UNDS:3550:CALBOK\nF - BEND:UNDS:3550:BACTDRIFT (future)\nG -\nH- BEND:UNDS:3550:DACSTATUS\nI -BEND:UNDS:3550:ADCSTATUS\nJ - BEND:UNDS:3550:BACTSTATUS\nK - BEND:UNDS:3550:BDESSTATUS\nL - BEND:UNDS:3550:RIPLSTATUS\n\nOutput:\nP - BEND:UNDS:3550: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, "BEND:UNDS:3550: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, "BEND:UNDS:3550: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, "BEND:UNDS:3550: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, "BEND:UNDS:3550: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, "BEND:UNDS:3550:IDESTOTAL"){ field(DESC, "Calc total current") field(CALC, "A+B") field(EGU, "kG-m") field(PREC, "7") field(INPA, "BEND:UNDS:3510:IDES CP NMS") field(INPB, "BTRM:UNDS:3550:BDES CP NMS") field(OUT, "BEND:UNDS:3550:IDES2BDES.E PP") } record(sub, "BEND:UNDS:3550:IDES2BDES") { field(DESC, "Cal BDES") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "BEND:UNDS:3550:IDES2BDES") field(INPB, "BEND:UNDS:3550:POLYCOEF") field(INPC, "BEND:UNDS:3550:POLYCOEF.A") field(INPD, "BEND:UNDS:3550:POLYCOEF.B") field(INPE, "BEND:UNDS:3550:IDESTOTAL MS") field(INPF, "BEND:UNDS:3510:BDELTAS PP") field(INPG, "100") field(EGU, "kG-m") field(HOPR, "2.68") field(LOPR, "0.0") field(HIHI, "2.68") field(LOLO, "0.0") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "2.68") field(LOW, "0.0") field(FLNK, "BEND:UNDS:3550: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, "BEND:UNDS:3550:IACTCALC"){ field(DESC, "Calc total act current") field(CALC, "A+B") field(EGU, "kG-m") field(PREC, "7") field(INPA, "BEND:UNDS:3550:IACT CP NMS") field(INPB, "BTRM:UNDS:3550:BACT") field(OUT, "BEND:UNDS:3550: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, "BEND:UNDS:3550:IMONCALC"){ field(DESC, "Calc total mon current") field(CALC, "A+B") field(EGU, "kG-m") field(PREC, "7") field(INPA, "BEND:UNDS:3550:IMON CP NMS") field(INPB, "BTRM:UNDS:3550:BMON") field(OUT, "BEND:UNDS:3550: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, "BEND:UNDS:3550:ICONTOTAL"){ field(DESC, "Calc total current") field(CALC, "A+B") field(EGU, "kG-m") field(PREC, "7") field(INPA, "BEND:UNDS:3510:ICON CP NMS") field(INPB, "BTRM:UNDS:3550:BCON CP NMS") field(OUT, "BEND:UNDS:3550:ICON2BCON.E PP") } record(sub, "BEND:UNDS:3550:ICON2BCON") { field(DESC, "Cal BCON") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "BEND:UNDS:3550:ICON2BCON") field(INPB, "BEND:UNDS:3550:POLYCOEF") field(INPC, "BEND:UNDS:3550:POLYCOEF.A") field(INPD, "BEND:UNDS:3550:POLYCOEF.B") field(INPE, "BEND:UNDS:3550:ICONTOTAL MS") field(INPF, "BEND:UNDS:3510:BDELTAS PP") field(INPG, "100") field(EGU, "kG-m") field(HOPR, "2.68") field(LOPR, "0.0") field(HIHI, "2.68") field(LOLO, "0.0") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "2.68") field(LOW, "0.0") field(FLNK, "BEND:UNDS:3550:BCON") } #! 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, "BEND:UNDS:3570:IACT") { field(DESC, "Current") field(INP, "BEND:UNDS:3510:IACT CP NMS") field(EGU, "A") field(HOPR, "9.0") field(LOPR, "-9.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "BEND:UNDS:3570:IACTCALC") info(autosaveFields,"HYST") } record(bi, "BEND:UNDS:3570:STATE") { field(DESC, "PS On/Off Status") field(DTYP, "Raw Soft Channel") field(INP, "BEND:UNDS:3510:STATE CP MS") field(ZSV, "MAJOR") field(ZNAM, "OFF") field(ONAM, "ON") } record(ao, "BEND:UNDS:3570:IDES") { field(DESC, "Desired Current") field(PREC, "3") field(EGU, "A") field(HOPR, "9.0") field(LOPR, "-9.0") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(MDEL, "-1") field(HIHI, "9.0") field(LOLO, "-9.0") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "BEND:UNDS:3570:BDELTAS") field(DRVH, "9.0") field(DRVL, "-9.0") field(DOL, "BEND:UNDS:3570: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, "BEND:UNDS:3570:ICTRL PP") } # This record is processed by BEND:UNDS:3570:ICON") # Note: we are not setting alarms here. record(ao, "BEND:UNDS:3570:ICON") { field(DESC, "Config I") field(DTYP, "Soft Channel") field(PREC, "3") field(HOPR, "9.0") field(LOPR, "-9.0") field(DRVH, "9.0") field(DRVL, "-9.0") field(DOL, "BEND:UNDS:3570:B2ICON.K") field(OMSL, "closed_loop") info(autosaveFields,"VAL") } record(ao, "BEND:UNDS:3570:INOM") { field(DESC, "Nominal Current") field(DOL, "BEND:UNDS:3570:BNOM.K") field(OMSL, "closed_loop") field(PREC, "3") field(EGU, "A") field(DRVH, "9.0") field(DRVL, "-9.0") field(HOPR, "9.0") field(LOPR, "-9.0") } record(ao, "BEND:UNDS:3570:ICTRL") { field(DESC, "Set Current") field(PREC, "3") field(EGU, "A") field(HOPR, "9.0") field(LOPR, "-9.0") field(DRVH, "9.0") field(DRVL, "-9.0") field(MDEL, "-1") field(FLNK, "BEND:UNDS:3570:ICTRLGO") field(OMSL, "supervisory") info(autosavefields,"VAL") } record(seq, "BEND:UNDS:3570:ICTRLGO") { field(DESC, "Process Current Setpoint") field(PREC, "3") # Set ISETPT to supervisory field(DOL1, "0") field(LNK1, "BEND:UNDS:3570:ISETPT.OMSL") field(DOL2, "BEND:UNDS:3570:ICTRL") field(LNK2, "BEND:UNDS:3570:ISETPT PP") # Set ISETPT to closed loop - get data from BCTRLSUB.K field(DOL3, "1") field(LNK3, "BEND:UNDS:3570:ISETPT.OMSL") } record(ao, "BEND:UNDS:3570:IMAX") { field(DESC, "Max I") field(DTYP, "Soft Channel") field(DRVH, "9.0") field(DRVL, "-9.0") field(EGU, "A") field(HOPR, "9.0") field(LOPR, "-9.0") field(PREC, "3") field(PINI, "YES") field(VAL, "9.0") field(FLNK, "BEND:UNDS:3570:IMIN") } record(ao, "BEND:UNDS:3570:IMIN") { field(DESC, "Min I") field(DTYP, "Soft Channel") field(DRVH, "9.0") field(DRVL, "-9.0") field(EGU, "A") field(HOPR, "9.0") field(LOPR, "-9.0") field(PREC, "3") field(VAL, "-9.0") field(FLNK, "BEND:UNDS:3570:IRANGE") } record(sel, "BEND:UNDS:3570:IACTPREVOK") { field(DESC, "Last Good Current") field(EGU, "A") field(HOPR, "9.0") field(LOPR, "-9.0") field(PREC, "3") field(NVL, "BEND:UNDS:3570:BACT.SEVR") field(INPA, "BEND:UNDS:3570:IACT NPP MS") field(INPB, "BEND:UNDS:3570:IACTPREVOK NPP MS") field(INPC, "BEND:UNDS:3570:IACTPREVOK NPP MS") field(INPD, "BEND:UNDS:3570:IACTPREVOK NPP MS") } record(sub, "BEND:UNDS:3570:IACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "BEND:UNDS:3570:IDES") field(INPB, "BEND:UNDS:3570:ISETPT.DRVH") field(INPC, "BEND:UNDS:3570:ISETPT.DRVL") field(INPD, "BEND:UNDS:3570:IDELTAS.I") field(INPE, "BEND:UNDS:3570:IDELTAS.J") field(INPG, "BEND:UNDS:3570:STATE") field(INPH, "BEND:UNDS:3570:HSTA") field(EGU, "A") field(HOPR, "9.0") field(LOPR, "-9.0") field(PREC, "3") field(BRSV, "INVALID") } record(sub, "BEND:UNDS:3570:IMONLIMITS") { field(DESC, "Aux Current Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "BEND:UNDS:3570:IDES") field(INPB, "BEND:UNDS:3570:ISETPT.DRVH") field(INPC, "BEND:UNDS:3570:ISETPT.DRVL") field(INPD, "BEND:UNDS:3570:IDELTAS.K") field(INPE, "BEND:UNDS:3570:IDELTAS.L") field(INPG, "BEND:UNDS:3570:STATE") field(INPH, "BEND:UNDS:3570:HSTA") field(EGU, "A") field(HOPR, "9.0") field(LOPR, "-9.0") field(PREC, "3") field(BRSV, "INVALID") } record(seq, "BEND:UNDS:3570:ILIMITS") { field(DESC, "Set ACT and MON Limits") field(PREC, "3") field(DOL1, "BEND:UNDS:3570:BLIMITS") field(LNK1, "BEND:UNDS:3570:IACTLIMITS.F PP") field(DOL2, "BEND:UNDS:3570:IACTLIMITS.I") field(LNK2, "BEND:UNDS:3570:IACT.HIGH") field(DOL3, "BEND:UNDS:3570:IACTLIMITS.J") field(LNK3, "BEND:UNDS:3570:IACT.LOW") field(DOL4, "BEND:UNDS:3570:IACTLIMITS.K") field(LNK4, "BEND:UNDS:3570:IACT.HIHI") field(DOL5, "BEND:UNDS:3570:IACTLIMITS.L") field(LNK5, "BEND:UNDS:3570:IACT.LOLO") field(DOL6, "BEND:UNDS:3570:BLIMITS") field(LNK6, "BEND:UNDS:3570:IMONLIMITS.F PP") field(DOL7, "BEND:UNDS:3570:IMONLIMITS.I") field(LNK7, "BEND:UNDS:3570:IMON.HIGH") field(DOL8, "BEND:UNDS:3570:IMONLIMITS.J") field(LNK8, "BEND:UNDS:3570:IMON.LOW") field(DOL9, "BEND:UNDS:3570:IMONLIMITS.K") field(LNK9, "BEND:UNDS:3570:IMON.HIHI") field(DOLA, "BEND:UNDS:3570:IMONLIMITS.L") field(LNKA, "BEND:UNDS:3570: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, "BEND:UNDS:3570:IDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntRawDeltas") field(INPD, "BEND:UNDS:3570:TRIMBTOL") field(INPE, "BEND:UNDS:3570:CHCKBTOL") field(INPF, "BEND:UNDS:3570:BDELTAS.K") field(INPG, "BEND:UNDS:3570:BDELTAS.L") field(INPH, "BEND:UNDS:3570: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, "BEND:UNDS:3570:STDZITOLR") field(INPC, "BEND:UNDS:3570:STDZITOL") field(FLNK, "") } # All ps controllers with on/off control will set the macro ONOF # as follows: # # ONOF = BEND:UNDS:3510: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, "BEND:UNDS:3570: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 = BEND:UNDS:3510:RESET PP # record(bo, "BEND:UNDS:3570: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, "BEND:UNDS:3570:RAMPSTATE") { field(DESC, "PS Ramp Status") field(DTYP, "Soft Channel") field(DOL, "BEND:UNDS:3510: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, "BEND:UNDS:3570: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, "BEND:UNDS:3570:TRIMRAMPRATE") field(OUT, "") field(FLNK, "BEND:UNDS:3570:STDZDLY") } record(ao, "BEND:UNDS:3570:ISETPT") { field(DESC, "Current Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(EGU, "A") field(HOPR, "9.0") field(LOPR, "-9.0") field(DRVH, "9.0") field(DRVL, "-9.0") field(MDEL, "-1") field(OUT, "") field(DOL, "BEND:UNDS:3570: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, "BEND:UNDS:3570:IMON") { field(DESC, "Aux Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(INP, "BEND:UNDS:3510:IMON CP NMS") field(EGU, "A") field(HOPR, "9.0") field(LOPR, "-9.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "BEND:UNDS:3570:IMONCALC") } record(ao, "BEND:UNDS:3570:IRIPL") { field(DESC, "Ripple Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(DOL, "BEND:UNDS:3510:IRIPL CP NMS") field(OMSL, "closed_loop") field(EGU, "A") field(DRVH, "1.0") field(HOPR, "1.0") field(PREC, "3") field(FLNK, "BEND:UNDS:3570:IRIPLOK") } record(sub, "BEND:UNDS:3570:IRIPLOK") { field(DESC, "Ripple Current Status") field(INAM, "mgntInit") field(SNAM, "mgntRiplOK") field(INPA, "BEND:UNDS:3570:IRIPL.VAL") field(INPB, "BEND:UNDS:3570: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, "BEND:UNDS:3570:R") { field(DESC, "Resistance") field(EGU, "Ohms") field(PREC, "4") field(PINI, "YES") field(DOL, "BEND:UNDS:3510: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, "BEND:UNDS:3570:IGND") { field(DESC, "Ground Current") field(EGU, "A") field(PREC, "6") field(PINI, "YES") field(DOL, "BEND:UNDS:3510:IGND CP MS") field(OMSL, "closed_loop") } record(bi, "BEND:UNDS:3570:INTLKSUMY") { field(DESC, "Interlock Summary") field(INP, "BEND:UNDS:3510:INTLKSUMY CP MS") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(ZNAM, "OK") field(ONAM, "FAULT") field(PINI, "NO") } record(mbbo, "BEND:UNDS:3570: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, "BEND:UNDS:3510:COOLING CP NMS") field(OMSL, "closed_loop") } # The following PV is processed by :BACTFO # which is processed by :BACT record(fanout, "BEND:UNDS:3570:IACTFO") { field(DESC, "IACT processing") field(SELM, "All") field(LNK1, "BEND:UNDS:3570:IACTPREVOK") field(LNK2, "BEND:UNDS:3570:IDIFF") field(LNK3, "BEND:UNDS:3570:IADIFF") field(LNK4, "BEND:UNDS:3570:IRATIO") field(LNK5, "BEND:UNDS:3570:IDIRECT") field(LNK6, "BEND:UNDS:3570:IACTPOL_CHECK") } record(calc, "BEND:UNDS:3570:IDIFF") { field(DESC, "IDES-IACT") field(CALC, "A-B") field(INPA, "BEND:UNDS:3570:IDES") field(INPB, "BEND:UNDS:3570:IACT") field(EGU, "A") field(PREC, "9") field(HOPR, "9.0") field(LOPR, "-9.0") } record(calc, "BEND:UNDS:3570:IADIFF") { field(DESC, "Absolute IDES-IACT") field(CALC, "A<0?ABS(A):A") field(INPA, "BEND:UNDS:3570:IDIFF") field(PREC, "9") } record(calc, "BEND:UNDS:3570:IRATIO") { field(DESC, "IDES-IACT/IMAX") field(CALC, "B?A/B:0") field(INPA, "BEND:UNDS:3570:IDIFF") field(INPB, "BEND:UNDS:3570:IDES.DRVH") field(PREC, "9") } record(calcout, "BEND:UNDS:3570:IRANGE") { field(DESC, "Current Range") field(PINI, "YES") field(CALC, "ABS(A-B)") field(INPA, "BEND:UNDS:3570:IMIN") field(INPB, "BEND:UNDS:3570: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, "BEND:UNDS:3570: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, "BEND:UNDS:3570:IACT") field(FLNK, "BEND:UNDS:3570:IACTPOL") } record(bo, "BEND:UNDS:3570:IACTPOL") { field(DESC, "Actual I Polarity") field(DTYP, "Raw Soft Channel") field(DOL, "BEND:UNDS:3570: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,"BEND:UNDS:3570:I*LIMITS:\n Calculate alarm and warning limits based on \n deltas from BEND:UNDS:3570:IDELTAS and the\n BEND:UNDS:3570: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,"BEND:UNDS:3570:IACT: \n Get copy of BEND:UNDS:3570:I. \n",null) #! TextBox(TB12,1280,3100,1760,3200,0,"Dialog",12,1,16777215,"BEND:UNDS:3570: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,"BEND:UNDS:3570:IDES:\n Contains raw value calculated by \nBEND:UNDS:3570: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 \nBEND:UNDS:3570:BDELTAS.\n",null) #! TextBox(TB10,56,1940,316,2340,0,"Dialog",12,1,16777215,"BEND:UNDS:3570: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 BEND:UNDS:3570: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 BEND:UNDS:3570: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,"BEND:UNDS:3570:ISETPT:\n Sets the hardware. When fast feedback is set on, this record is\n set to closed loop mode by BEND:UNDS:3570:FBCKSTART sequence. When \n the loop is closed, this record takes input calculated by \n BFBCK only. When fast feedback is set off, BEND:UNDS:3570:FBCKSTOP \n will set it back to supervisory so that the value can be set by \n BEND:UNDS:3570: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, "BEND:UNDS:3570:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "BEND:UNDS:3570:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "BEND:UNDS:3570:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "BEND:UNDS:3570:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "BEND:UNDS:3570:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "BEND:UNDS:3570:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "1") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "BEND:UNDS:3570: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, "BEND:UNDS:3570:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "BEND:UNDS:3570:TRIMTYPE.RVAL") field(INPB, "BEND:UNDS:3570:CONFIG.RVAL") field(OUT, "BEND:UNDS:3570:TRIMMAXNUM PP") } record(longout, "BEND:UNDS:3570: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, "BEND:UNDS:3570: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, "BEND:UNDS:3510:TRIMRAMPRATE CP NMS") field(OMSL, "closed_loop") field(VAL, "") field(OUT, "BEND:UNDS:3570:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "BEND:UNDS:3570: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, "BEND:UNDS:3510:TRIMSETL CP NMS") field(OMSL, "closed_loop") field(VAL, "") } record(bo, "BEND:UNDS:3570: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, "BEND:UNDS:3570: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, "BEND:UNDS:3570: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, "BEND:UNDS:3570:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "0") } record(ao, "BEND:UNDS:3570: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, "BEND:UNDS:3570:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "BEND:UNDS:3570: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, "BEND:UNDS:3570: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, "BEND:UNDS:3570:IMOVE") field(INPB, "BEND:UNDS:3570:IACT") field(INPC, "BEND:UNDS:3570:IRAMPRATE") field(INPD, "1.577") field(INPE, "BEND:UNDS:3570:TRIMDLYPCT") field(INPF, "BEND:UNDS:3570:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "BEND:UNDS:3570:RAMPTIME_LEFT PP") } record(longout, "BEND:UNDS:3570:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "BEND:UNDS:3570:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "BEND:UNDS:3570:RAMPDONE_CALC") } record(calc, "BEND:UNDS:3570:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "BEND:UNDS:3570:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "BEND:UNDS:3570:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "BEND:UNDS:3570: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, "BEND:UNDS:3570:RAMPTIME_LEFT") field(OUT, "BEND:UNDS:3570:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "BEND:UNDS:3570:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "BEND:UNDS:3570:RAMPTIME_LEFT NMS") field(OUT, "BEND:UNDS:3570:RAMPDONE PP") } record(bo, "BEND:UNDS:3570:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "BEND:UNDS:3570:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "BEND:UNDS:3570: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, "BEND:UNDS:3570: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, "BEND:UNDS:3570:STDZINIT") { field(DESC, "Proc. Stdz PVs on boot") field(PINI, "YES") field(DOL1, "1") field(DOL2, "1") field(DOL3, "1") field(LNK1, "BEND:UNDS:3570:DEBUG.PROC PP") field(LNK2, "BEND:UNDS:3570:STDZCYCLENUM.PROC PP") field(LNK3, "BEND:UNDS:3570:STDZDISABLE.PROC PP") field(LNK4, "BEND:UNDS:3570: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, "BEND:UNDS:3570:STDZSUB") { field(DESC, "Stdz subroutine") field(INAM, "mgntStdzInit") field(SNAM, "mgntStdz") field(BRSV, "INVALID") field(INPA, "BEND:UNDS:3570:STDZIMIN NPP NMS") field(INPB, "BEND:UNDS:3570:STDZIMAX NPP NMS") field(INPC, "BEND:UNDS:3570:STDZIFINAL NPP NMS") field(INPD, "BEND:UNDS:3570:STDZCYCLENUM NPP NMS") field(INPE, "BEND:UNDS:3570:STDZDIRECT.RVAL NPP NMS") field(INPF, "BEND:UNDS:3570:STDZDISABLE.RVAL CPP NMS") field(INPG, "BEND:UNDS:3570: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, "BEND:UNDS:3570:STDZWF PP") field(OUTB, "BEND:UNDS:3570: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, "BEND:UNDS:3570:STDZWF") } record(mbbo, "BEND:UNDS:3570: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, "BEND:UNDS:3570: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, "BEND:UNDS:3570:STDZMAINPS") { field(DESC, "Stdz by main or self") field(PINI, "YES") field(DTYP, "Soft Channel") field(ZNAM, "SELF") field(ONAM, "MAIN") } record(bo, "BEND:UNDS:3570: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, "BEND:UNDS:3570: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, "BEND:UNDS:3570: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, "BEND:UNDS:3570:STDZTOD") { field(DESC, "Successful Standardize Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "BEND:UNDS:3570:STDZLOSTTOD") { field(DESC, "Standardize Lost Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(longout, "BEND:UNDS:3570:STDZCYCLECNT") { field(DESC, "Cycle Count") field(PINI, "YES") } record(longout, "BEND:UNDS:3570: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, "BEND:UNDS:3570:STDZDIRECT") } # The default standardize direction is "UP" for # all LCLS Magnets.. record(bo, "BEND:UNDS:3570:STDZDIRECT") { field(DESC, "Standardize Direction ") field(ZNAM, "UP") field(ONAM, "DOWN") field(VAL, "0") field(FLNK, "BEND:UNDS:3570:STDZIMIN") } record(ao, "BEND:UNDS:3570:STDZIMIN") { field(DESC, "Min-STDZ Current") field(PREC, "1") field(EGU, "A") field(HOPR, "9.0") field(LOPR, "-9.0") field(VAL, "-9.0") field(FLNK, "BEND:UNDS:3570:STDZIMAX") } record(ao, "BEND:UNDS:3570:STDZIMAX") { field(DESC, "Max. Standarize Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "9.0") field(LOPR, "-9.0") field(VAL, "9.0") field(FLNK, "BEND:UNDS:3570:STDZIFINAL") } record(ao, "BEND:UNDS:3570:STDZIFINAL") { field(DESC, "Final SDTZ Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "9.0") field(LOPR, "-9.0") field(VAL, "-9.0") field(FLNK, "BEND:UNDS:3570: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, "BEND:UNDS:3570: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, "BEND:UNDS:3570:STDZITOL") { field(DESC, "Stdz min tolerance") field(PREC, "5") field(CALC, "MAX(ABS(A),ABS(B))*C") field(INPA, "BEND:UNDS:3570:STDZIMIN CP NMS") field(INPB, "BEND:UNDS:3570:STDZIMAX CP MMS") field(INPC, "0.05") field(INPD, "BEND:UNDS:3570:STDZITOLR CP MMS") field(EGU, "A") field(FLNK, "BEND:UNDS:3570:IDELTAS") field(PINI, "YES") } # D - factor (3.154/2 = 1.577) for EPSC, otherwise, set to 1.0 record(calc, "BEND:UNDS:3570:STDZDLY") { field(DESC, "Ramp time for stdz cycle") field(CALC, "C>0?MAX(1,ABS((A-B)/C)*D):0") field(INPA, "BEND:UNDS:3570:STDZIMIN CP NMS") field(INPB, "BEND:UNDS:3570:STDZIMAX CP NMS") field(INPC, "BEND:UNDS:3570:TRIMRAMPRATE CP NMS") field(INPD, "1.0") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") } record(calc, "BEND:UNDS:3570:STDZRAMPDLY") { field(DESC, "Ramp delay total") field(CALC, "MAX(1,((A/100)*B+B))") field(PREC, "5") field(INPA, "BEND:UNDS:3570:TRIMDLYPCT CP MS") field(INPB, "BEND:UNDS:3570: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, "BEND:UNDS:3570:STDZMINIDLY") { field(DESC, "Mini-stdz delay") field(CALC, "A") field(PREC, "5") field(A, "1.0") field(EGU, "sec") field(PINI, "YES") } record(ao, "BEND:UNDS:3570: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, "BEND:UNDS:3570:STDZMINIDELTA") { field(DESC, "Stdz mini % of IMAX") field(CALC, "(B/100)*(A-C)") field(INPA, "BEND:UNDS:3570:IDES.HOPR") field(INPB, "BEND:UNDS:3570:STDZMINIPCT CPP NMS") field(INPC, "BEND:UNDS:3570:IDES.LOPR") field(PREC, "5") } record(calc, "BEND:UNDS:3570:STDZMINISETPT") { field(DESC, "Mini Stdz delta") field(CALC, "C==0?MAX(E-D,B):MIN(E+D,A)") field(INPA, "BEND:UNDS:3570:IDES.HOPR") field(INPB, "BEND:UNDS:3570:IDES.LOPR") field(INPC, "BEND:UNDS:3570:STDZDIRECT.RVAL") field(INPD, "BEND:UNDS:3570:STDZMINIDELTA") field(INPE, "BEND:UNDS:3570:IDES") field(PREC, "5") field(FLNK, "BEND:UNDS:3570: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, "BEND:UNDS:3570:STDZMINISETPTOOR") { field(DESC, "Mini Stdz setpoint out of range") field(CALC, "C==0?(E-DA)") field(INPA, "BEND:UNDS:3570:IDES.HOPR") field(INPB, "BEND:UNDS:3570:IDES.LOPR") field(INPC, "BEND:UNDS:3570:STDZDIRECT.RVAL") field(INPD, "BEND:UNDS:3570:STDZMINIDELTA") field(INPE, "BEND:UNDS:3570: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, "BEND:UNDS:3570: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, "BEND:UNDS:3570:IADJUST.RVAL") field(INPB, "BEND:UNDS:3570:STDZDIRECT.RVAL") field(INPC, "BEND:UNDS:3570:STDZOK.RVAL") field(INPD, "BEND:UNDS:3570:STDZDISABLE.RVAL") field(INPE, "BEND:UNDS:3570:STATE.RVAL CPP NMS") field(INPF, "BEND:UNDS:3570:ICTRL.RVAL") field(INPG, "BEND:UNDS:3570:STATE.SEVR") field(INPH, "BEND:UNDS:3570:BDELTAS.M") field(INPI, "BEND:UNDS:3570:IACT.SEVR") field(OUT, "BEND:UNDS:3570:STDZLOSTGO.SELN PP NMS") field(OOPT, "Transition To Non-zero") } record(seq, "BEND:UNDS:3570:STDZLOSTGO") { field(DESC, "Process lost stdz") field(SELM, "Mask") field(DOL1, "1") field(DOL2, "0") field(LNK1, "BEND:UNDS:3570:STDZLOSTTOD.PROC") field(LNK2, "BEND:UNDS:3570:STDZOK PP") } # Record maximum current after standardize # Reset to IACT from sequence after trim # Disable processing during (mini-)standardize or trim record(calc, "BEND:UNDS:3570:STDZIACTMAX") { field(DESC, "Max act current after stdz") field(CALC, "MAX(A, B)") field(DISV, "0") field(SDIS, "BEND:UNDS:3570:CHECKPWRDIP_ENABLE") field(INPA, "BEND:UNDS:3570:IACT CP") field(INPB, "BEND:UNDS:3570:STDZIACTMAX") field(EGU, "A") field(FLNK, "BEND:UNDS:3570:CHECKPWRDIP") } # Detect power dip if STDZOK is YES, STDZ is enabled, and IACT is valid # If IACT drops below STDZIACTMAX by more than the trim tolerance, clear STDZOK # Warning: Take the absolute value of the trim tolerance, or else quads of # negative polarity will always lose STDZ since their IDELTAS.I are negative. # Note: Large quads and bends are prone to losing STDZ even if they are # perturbed toward higher current since their current tends to overshoot # by greater than the trim tolerance before settling down. record(calcout, "BEND:UNDS:3570:CHECKPWRDIP") { field(DESC, "Detect power dip") field(CALC, "(A-B>ABS(C))?3:0") field(DISV, "0") field(SDIS, "BEND:UNDS:3570:CHECKPWRDIP_ENABLE") field(INPA, "BEND:UNDS:3570:STDZIACTMAX") field(INPB, "BEND:UNDS:3570:IACT") field(INPC, "BEND:UNDS:3570:IDELTAS.I") field(OUT, "BEND:UNDS:3570:STDZLOSTGO.SELN PP NMS") field(OOPT, "When Non-zero") } # Enable processing of STDZIACTMAX and CHECKPWRDIP only if # STDZOK = YES, STDZDISABLE = NO, CTRL != Trim (2), and # CTRL != Stdz (4) record(calc, "BEND:UNDS:3570:CHECKPWRDIP_ENABLE") { field(CALC, "A&&!B&&(C#2)&&(C#4)") field(INPA, "BEND:UNDS:3570:STDZOK.RVAL CP") field(INPB, "BEND:UNDS:3570:STDZDISABLE.RVAL CP") field(INPC, "BEND:UNDS:3570:CTRL.RVAL CP") } #! 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, "BEND:UNDS:3570: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, "BEND:UNDS:3570: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, "BEND:UNDS:3570:CALBSET") { field(DESC, "Use DAC Calbration") field(SCAN, "10 second") field(CALC, "A&&(B==0)&&C?31:960") field(INPA, "BEND:UNDS:3570:CALBOK") field(INPB, "BEND:UNDS:3570:CALBDISABLE") field(INPC, "BEND:UNDS:3570:CALBSLOPE") field(OOPT, "On Change") field(OUT, "BEND:UNDS:3570: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, "BEND:UNDS:3570:CALB_SEQ") { field(DESC, "Output Calib Values") field(SELM, "Mask") field(SELL, "BEND:UNDS:3570: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, "BEND:UNDS:3570:CALBSLOPE") field(DOL3, "BEND:UNDS:3570: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, "BEND:UNDS:3570:CALBTOD") { field(DESC, "Calibration Success Time") field(PINI, "YES") # field(DOL, "") field(OMSL, "supervisory") field(DTYP, "Soft Channel") info(autosaveFields,"VAL") } record(ao, "BEND:UNDS:3570: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, "BEND:UNDS:3570: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, "BEND:UNDS:3570: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, "BEND:UNDS:3570:CALBOFFSET") { field(DESC, "Calc DAC Offset") field(PREC, "6") field(EGU, "Counts") field(PINI, "YES") } record(bo, "BEND:UNDS:3570: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, "BEND:UNDS:3570:DACSLOPE") { field(DESC, "V to DAC slope") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "supervisory") field(PINI, "YES") field(FLNK, "BEND:UNDS:3570:DACOFFSET") } # Default Offset used in conversion from Volts to DAC Counts record(ao, "BEND:UNDS:3570:DACOFFSET") { field(DESC, "V to DAC offset") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "supervisory") field(PINI, "YES") field(FLNK, "BEND:UNDS:3570: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, "BEND:UNDS:3570: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, "BEND:UNDS:3570:IACT") field(INPD, "BEND:UNDS:3570:DACSLOPE") field(INPE, "BEND:UNDS:3570:DACOFFSET") field(EGU, "Counts") field(PREC, "6") } record(ao, "BEND:UNDS:3570:DAC") { field(DESC, "DAC Set point") field(EGU, "Counts") field(DOL, "") field(OMSL, "supervisory") field(PREC, "6") field(PINI, "YES") } record(ao, "BEND:UNDS:3570:CALBIMIN") { field(DESC, "Calibration Min Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(DRVH, "9.0") field(HOPR, "9.0") field(DRVL, "-9.0") field(LOPR, "-9.0") field(PREC, "3") field(EGU, "A") field(VAL, "0.0") field(FLNK, "BEND:UNDS:3570:CALBIMAX") } record(ao, "BEND:UNDS:3570:CALBIMAX") { field(DESC, "Calibration Max Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(DRVH, "9.0") field(HOPR, "9.0") field(LOPR, "-9.0") field(DRVL, "-9.0") field(EGU, "A") field(VAL, "9.0") field(FLNK, "BEND:UNDS:3570:CALBSTEPNUM") } record(ao, "BEND:UNDS:3570:CALBIFINAL") { field(DESC, "Calibration Last Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(PREC, "3") field(EGU, "A") field(HOPR, "9.0") field(LOPR, "-9.0") field(VAL, "0") } record(longout, "BEND:UNDS:3570: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, "BEND:UNDS:3570:CALBIDELTA") } record(calc, "BEND:UNDS:3570:CALBIDELTA") { field(DESC, "Step size for CALB") field(CALC, "C=0?0:ABS((A-B)/C)") field(INPA, "BEND:UNDS:3570:CALBIMAX") field(INPB, "BEND:UNDS:3570:CALBIMIN") field(INPC, "BEND:UNDS:3570: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, "BEND:UNDS:3570:CALBIMULT") { field(DESC, "IACT vs ISETPT mult") field(CALC, "C#0||A=0?1:ABS(B/A)") field(INPA, "BEND:UNDS:3510:ISETPT.DRVH") field(INPB, "BEND:UNDS:3510:IACT.HOPR") field(INPC, "BEND:UNDS:3570:PSCONTROLLER.RVAL CPP") field(EGU, "A") field(PINI, "YES") } # SNL dbputs DAC values here. 6-10 steps are possible. record(waveform, "BEND:UNDS:3570:CALBICTRLWF") { field(DESC, "ICTRL setpoint array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") } record(waveform, "BEND:UNDS:3570:DACWF") { field(DESC, "DAC count array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "BEND:UNDS:3570:DACSA") } # Used only for xygraph edm plot record(subArray, "BEND:UNDS:3570:DACSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "BEND:UNDS:3570: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, "BEND:UNDS:3570:CALCDACWF") { field(DESC, "Calc DAC counts array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "BEND:UNDS:3570:CALCDACSA") } # Used only for xygraph edm plot record(subArray, "BEND:UNDS:3570:CALCDACSA") { field(DESC, "Calc DAC counts") field(DTYP, "Soft Channel") field(INP, "BEND:UNDS:3570: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, "BEND:UNDS:3570:CALBYWF") { field(DESC, "mx + b") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "BEND:UNDS:3570:CALBYSA") } # Used only for xygraph edm plot record(subArray, "BEND:UNDS:3570:CALBYSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "BEND:UNDS:3570:CALBYWF") field(MALM, "10") field(NELM, "6") field(INDX, "0") field(FTVL, "DOUBLE") } record(waveform, "BEND:UNDS:3570:CALBIACTWF") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "BEND:UNDS:3570:CALBIACTSA") } # Used only for xygraph edm plot record(subArray, "BEND:UNDS:3570:CALBIACTSA") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(MALM, "10") field(NELM, "6") field(INP, "BEND:UNDS:3570:CALBIACTWF") field(INDX, "0") field(FTVL, "DOUBLE") field(FLNK, "BEND:UNDS:3570:CALBLIMITS") } # Check that measured current during calibration is within # tolerance. record(aSub, "BEND:UNDS:3570: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, "BEND:UNDS:3570:CALBSTEPNUM") field(INPB, "BEND:UNDS:3570:CALBIACTWF") field(INPC, "BEND:UNDS:3570: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, "BEND:UNDS:3570: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, "BEND:UNDS:3570:STDZITOL") field(INPH, "BEND:UNDS:3570:DACSLOPE") field(INPI, "BEND:UNDS:3570: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, "BEND:UNDS:3570: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, "BEND:UNDS:3570:CALBSTEPNUM") field(INPB, "BEND:UNDS:3570:CALBIACTWF") field(INPC, "BEND:UNDS:3570:DACWF") field(INPF, "BEND:UNDS:3570: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 BEND:UNDS:3570CALBOK 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, "BEND:UNDS:3570:DEGAUSINIT") { field(DESC, "Proc. Degauss PVs on boot") field(PINI, "YES") field(DOL, "1") field(OUTA, "BEND:UNDS:3570:DEGAUSIMIN.PROC PP") field(OUTB, "BEND:UNDS:3570:DEGAUSIMAX.PROC PP") field(OUTC, "BEND:UNDS:3570:DEGAUSTYPE.PROC PP") field(OUTD, "BEND:UNDS:3570:DEGAUSSTEP.PROC PP") field(OUTE, "BEND:UNDS:3570:MADNAME.PROC PP") field(OUTF, "BEND:UNDS:3570:PSTYPE.PROC PP") field(OUTG, "BEND:UNDS:3570: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, "BEND:UNDS:3570:DEGAUSSUB") { field(DESC, "Degauss subroutine") field(INAM, "mgntDegaussInit") field(SNAM, "mgntDegauss") field(BRSV, "INVALID") field(INPA, "BEND:UNDS:3570:DEGAUSIMIN NPP NMS") field(INPB, "BEND:UNDS:3570:DEGAUSIMAX NPP NMS") field(INPC, "BEND:UNDS:3570:DEGAUSTYPE.RVAL NPP NMS") field(INPE, "BEND:UNDS:3570:DEGAUSMETHOD.RVAL NPP NMS") field(INPF, "BEND:UNDS:3570:PSTYPE NPP NMS") field(INPG, "BEND:UNDS:3570:DEBUG.RVAL NPP NMS") field(INPH, "BEND:UNDS:3570: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, "BEND:UNDS:3570:DEGAUSWF PP") field(OUTB, "BEND:UNDS:3570:DEGAUSMSG PP") field(OUTC, "BEND:UNDS:3570: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, "BEND:UNDS:3570:DEGAUSWF") { field(DESC, "Degauss Setpts") field(NELM, "60") field(FTVL, "DOUBLE") } record(mbbo,"BEND:UNDS:3570: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, "BEND:UNDS:3570: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, "BEND:UNDS:3570: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, "BEND:UNDS:3570: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, "BEND:UNDS:3570: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, "BEND:UNDS:3570:DEGAUSIMIN") { field(DESC, "Min. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "9.0") field(LOPR, "-9.0") field(DRVH, "9.0") field(DRVL, "-9.0") field(VAL, "-9.0") } record(ao, "BEND:UNDS:3570:DEGAUSIMAX") { field(DESC, "Max. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "9.0") field(LOPR, "-9.0") field(DRVH, "9.0") field(DRVL, "-9.0") field(VAL, "9.0") } # 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,"BEND:UNDS:3570: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, "BEND:UNDS:3570: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,"BEND:UNDS:3570: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, "BEND:UNDS:3570: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, "BEND:UNDS:3570: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, "BEND:UNDS:3570: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, "BEND:UNDS:3570:DEGAUSTOD") { field(DESC, "Successful Degauss Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "BEND:UNDS:3570:DEGAUSLOSTTOD") { field(DESC, "Degauss Lost Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "BEND:UNDS:3570:DEGAUSTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "BEND:UNDS:3570:DEGAUSTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "BEND:UNDS:3570: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, "BEND:UNDS:3570:DEGAUSGO") { field(DESC, "Set bdes of btrms to zero") field(ASG, "Internal") field(OUTA, "") field(OUTB, "") field(OUTC, "") field(OUTD, "") } # =========== CRYO ONLY =========== record(bo, "BEND:UNDS:3570: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, "BEND:UNDS:3570:DEGAUS_IMAX_CHECK") { field(DESC, "Check if imax shoud chg") field(CALC, "(C==4)&&(ABS(B)>ABS(A))?1:0") field(INPA, "BEND:UNDS:3570:DEGAUS_IMAX") field(INPB, "BEND:UNDS:3570:ISETPT") field(INPC, "BEND:UNDS:3570:DEGAUSTYPE.RVAL") field(OUT, "BEND:UNDS:3570:DEGAUS_IMAX_UPDATE.SELN") field(FLNK, "BEND:UNDS:3570:DEGAUS_IMAX_UPDATE") } record(seq, "BEND:UNDS:3570:DEGAUS_IMAX_UPDATE") { field(DESC, "Degauss IMAX Update") field(SELM, "Specified") field(DOL1, "BEND:UNDS:3570:ISETPT") field(LNK1, "BEND:UNDS:3570:DEGAUS_IMAX PP") } # Set the maximum current after a successful # degauss. This pv is updated by the # sequence. record(ao, "BEND:UNDS:3570:DEGAUS_IMAX") { field(DESC, "Max I set afer a degauss") field(EGU, "Amps") field(PINI, "YES") field(PREC, "6") field(HOPR, "9.0") field(LOPR, "-9.0") field(DRVH, "9.0") field(DRVL, "-9.0") field(VAL, "9.0") field(FLNK, "BEND:UNDS:3570:DEGAUS_IMAXPOL_CHECK") info(autosaveFields,"VAL,RVAL") } # Set the polarity if degauss_imax record(calcout, "BEND:UNDS:3570:DEGAUS_IMAXPOL_CHECK") { field(DESC, "Determine polarity of imax") field(CALC, "A>=0?0:1") field(INPA, "BEND:UNDS:3570:DEGAUS_IMAX") field(FLNK, "BEND:UNDS:3570:DEGAUS_IMAXPOL") } record(bo, "BEND:UNDS:3570:DEGAUS_IMAXPOL") { field(DESC, "Polarity of imax I") field(DTYP, "Raw Soft Channel") field(DOL, "BEND:UNDS:3570:DEGAUS_IMAXPOL_CHECK") field(OMSL, "closed_loop") field(ZNAM, "Positive") field(ONAM, "Negative") field(FLNK, "BEND:UNDS:3570: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, "BEND:UNDS:3570:DEGAUS_ABSIMAX") { field(DESC, "Absolute Max. Degauss I") field(CALC, "ABS(A)") field(INPA, "BEND:UNDS:3570:DEGAUS_IMAX") field(PREC, "6") field(EGU, "Amps") field(HOPR, "9.0") field(LOPR, "-9.0") info(autosaveFields,"VAL RVAL") } # IACT Polarity record(calcout, "BEND:UNDS:3570:IACTPOL_CHECK") { field(DESC, "Determine IACT polarity") field(SCAN, "5 second") field(CALC, "ABS(A-B)>C?(A>=0?0:1):D") field(INPA, "BEND:UNDS:3570:IACT") field(INPB, "BEND:UNDS:3570:IACTPOL_CHECK.LA") field(INPC, "0.0001") field(INPD, "BEND:UNDS:3570:IACTPOL_CHECK.PVAL") field(OOPT, "On Change") field(FLNK, "BEND:UNDS:3570:IACTPOL") } record(bo, "BEND:UNDS:3570: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,"BEND:UNDS:3570: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, "BEND:UNDS:3570:DEGAUSENABLE CP") field(INPB, "BEND:UNDS:3570:DEGAUSOK") field(INPC, "BEND:UNDS:3570:STATE CP") field(INPD, "BEND:UNDS:3570:STATE.SEVR") field(OUT, "BEND:UNDS:3570:DEGAUS_STATE_SEQ.SELN PP") field(ASG, "Internal") } record(seq, "BEND:UNDS:3570:DEGAUS_STATE_SEQ") { field(DESC, "Degauss State Sequence") field(SELM, "Specified") field(SELL, "BEND:UNDS:3570:DEGAUS_STATE_CHECK") field(LNK1, "BEND:UNDS:3570:DEGAUS_STATE_DISABLE.PROC PP") field(LNK2, "BEND:UNDS:3570:DEGAUS_STATE_LOST.PROC PP") field(LNK3, "BEND:UNDS:3570:DEGAUS_STATE_GOOD.PROC PP") field(LNK4, "BEND:UNDS:3570: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, "BEND:UNDS:3570:DEGAUS_STATE_DISABLE") { field(DESC, "Degauss not used") field(LNK1, "BEND:UNDS:3570:DEGAUSOK.ZSV") field(LNK2, "BEND:UNDS:3570: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, "BEND:UNDS:3570:STATMSG.FRSV") field(LNK4, "BEND:UNDS:3570: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, "BEND:UNDS:3570:DEGAUS_STATE_LOST") { field(DESC, "Degauss lost and ps On") field(DOL1, "1") field(LNK1, "BEND:UNDS:3570:DEGAUSOK.ZSV") field(LNK2, "BEND:UNDS:3570: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, "BEND:UNDS:3570:STATMSG.FRSV") field(LNK4, "BEND:UNDS:3570: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, "BEND:UNDS:3570:DEGAUS_STATE_OFF") { field(DESC, "Degaused lost and ps Off") field(DOL1, "2") field(LNK1, "BEND:UNDS:3570: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, "BEND:UNDS:3570:STATMSG.FRSV") field(LNK3, "BEND:UNDS:3570: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, "BEND:UNDS:3570:DEGAUS_STATE_GOOD") { field(DESC, "Degauss good") field(DOL1, "1") field(LNK1, "BEND:UNDS:3570: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, "BEND:UNDS:3570:STATMSG.FRSV PP") field(LNK3, "BEND:UNDS:3570:STATMSG.FVSV PP") field(LNK4, "") field(ASG, "Internal") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(mbbo, "BEND:UNDS:3570:FUNC") { field(DESC, "BEND:UNDS:3570 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, "0") field(FFVL, "0") field(OUT, "BEND:UNDS:3570:CTRL CA") } # :CTRL pv is processed at boot in the # sequence mgntCtrl.st Processed in sequence # record(mbbo, "BEND:UNDS:3570:CTRL") { field(DESC, "BEND:UNDS:3570 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, "BEND:UNDS:3570:SELECTEN.A PP") field(SDIS, "0") } # If a function has been selected set this unit to busy record(calcout, "BEND:UNDS:3570:SELECTEN") { field(DESC, "Control Select Enable") field(CALC, "A>0?1:A") field(FLNK, "BEND:UNDS:3570:BUSY") } # Set to FREE on IOC reboot record(bo, "BEND:UNDS:3570:BUSY") { field(DESC, "BEND:UNDS:3570 Ctrl Done") field(DOL, "BEND:UNDS:3570:SELECTEN") field(ZNAM, "FREE") field(ONAM, "BUSY") field(PINI, "YES") field(FLNK, "BEND:UNDS:3570:SELECT") } record(bo, "BEND:UNDS:3570:SELECT") { field(ZNAM, "NO") field(ONAM, "YES") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") } record(bo, "BEND:UNDS:3570: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, "BEND:UNDS:3570:CTRLSTATE") { field(DESC, "BEND:UNDS:3570 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("BEND:UNDS:3570:CTRL",20,20,0,0,"BEND:UNDS:3570:CTRL") #! Field("BEND:UNDS:3570:CTRL.OUT",16777215,1,"BEND:UNDS:3570:CTRL.OUT") #! Link("BEND:UNDS:3570:CTRL.OUT","BEND:UNDS:3570:SELECTEN.A") #! Field("BEND:UNDS:3570:CTRL.VAL",16777215,1,"BEND:UNDS:3570:CTRL.VAL") #! Record("BEND:UNDS:3570:SELECTEN",321,381,0,0,"BEND:UNDS:3570:SELECTEN") #! Field("BEND:UNDS:3570:SELECTEN.A",16777215,0,"BEND:UNDS:3570:SELECTEN.A") #! Field("BEND:UNDS:3570:SELECTEN.FLNK",16777215,1,"BEND:UNDS:3570:SELECTEN.FLNK") #! Link("BEND:UNDS:3570:SELECTEN.FLNK","BEND:UNDS:3570:BUSY") #! Field("BEND:UNDS:3570:SELECTEN.VAL",16777215,1,"BEND:UNDS:3570:SELECTEN.VAL") #! Record("BEND:UNDS:3570:BUSY",623,274,0,0,"BEND:UNDS:3570:BUSY") #! Field("BEND:UNDS:3570:BUSY.DOL",16777215,0,"BEND:UNDS:3570:BUSY.DOL") #! Link("BEND:UNDS:3570:BUSY.DOL","BEND:UNDS:3570:SELECTEN.VAL") #! Field("BEND:UNDS:3570:BUSY.FLNK",16777215,1,"BEND:UNDS:3570:BUSY.FLNK") #! Link("BEND:UNDS:3570:BUSY.FLNK","BEND:UNDS:3570:SELECT") #! Record("BEND:UNDS:3570:SELECT",669,508,0,1,"BEND:UNDS:3570:SELECT") #! Record("BEND:UNDS:3570:FUNC",940,120,0,0,"BEND:UNDS:3570:FUNC") #! Field("BEND:UNDS:3570:FUNC.OUT",16777215,0,"BEND:UNDS:3570:FUNC.OUT") #! Link("BEND:UNDS:3570:FUNC.OUT","BEND:UNDS:3570:CTRL.VAL") #! Record("BEND:UNDS:3570:ABORT",193,41,0,0,"BEND:UNDS:3570:ABORT") #! Record("BEND:UNDS:3570:CTRLSTATE",369,34,0,0,"BEND:UNDS:3570: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,"BEND:UNDS:3570:SELECT is used for Multi-device selection.\nIt is enabled when associated BEND:UNDS:3570:CTRL is \"0\" (DONE).\nIt is disabled when associated BEND:UNDS:3570: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,"BEND:UNDS:3570: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, "BEND:UNDS:3570:BCTRL_INIT") { field(DESC, "Process BCTRL on boot") field(PINI, "YES") field(CALC, "A=3?1:0") field(INPA, "BEND:UNDS:3570:BCTRL.SEVR") field(OUT, "BEND:UNDS:3570: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, "BEND:UNDS:3570:BACT") { field(DESC, "Actual B") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "BEND:UNDS:3570:BACT") field(INPB, "BEND:UNDS:3570:POLYCOEF") field(INPC, "BEND:UNDS:3570:POLYCOEF.A") field(INPD, "BEND:UNDS:3570:POLYCOEF.B") field(INPE, "BEND:UNDS:3570:IACTCALC MS") field(INPF, "BEND:UNDS:3570:BDELTAS PP") field(INPG, "100") field(EGU, "kG-m") field(HOPR, "2.68") field(LOPR, "0.0") field(HIHI, "2.68") field(LOLO, "0.0") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "2.68") field(LOW, "0.0") field(FLNK, "BEND:UNDS:3570: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, "BEND:UNDS:3570:BDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntPhyDeltas") field(EGU, "kG-m") field(HOPR, "1") field(PREC, "7") field(BRSV, "INVALID") field(INPA, "BEND:UNDS:3570:BDES") field(INPB, "BEND:UNDS:3570:TRIMBTOL") field(INPC, "BEND:UNDS:3570:TRIMBTOLR") field(INPD, "BEND:UNDS:3570:CHCKBTOL") field(INPE, "BEND:UNDS:3570:CHCKBTOLR") field(F, "2.0") field(INPG, "30") field(INPH, "BEND:UNDS:3570:BACT.VAL") # # MPS absolute and relative tolerances field(INPP, "BEND:UNDS:3570:MPSBTOL") field(INPQ, "BEND:UNDS:3570:MPSBTOLR") field(FLNK, "BEND:UNDS:3570:BCONLIMITS") info(autosaveFields,"F") } # This record is processed by BDELTAS record(aSub, "BEND:UNDS:3570:BCONLIMITS") { field(DESC, "Config B-field Limits") field(INAM, "mgntInit") field(SNAM, "mgntBCONLimits") field(INPA, "BEND:UNDS:3570:BDES") field(INPB, "BEND:UNDS:3570:BDELTAS.I") field(INPG, "BEND:UNDS:3570:DEBUG.RVAL") field(FTA, "DOUBLE") field(FTB, "DOUBLE") field(FTG, "ULONG") field(OUTA, "BEND:UNDS:3570:BCON.HIGH") field(OUTB, "BEND:UNDS:3570:BCON.LOW") field(OUTC, "BEND:UNDS:3570:BCON.HIHI") field(OUTD, "BEND:UNDS:3570:BCON.LOLO PP") field(FTVA, "DOUBLE") field(FTVB, "DOUBLE") field(FTVC, "DOUBLE") field(FTVD, "DOUBLE") field(BRSV, "INVALID") field(FLNK, "BEND:UNDS:3570:IDELTAS") } # The following PV is processed by :BACT # which is processed by :BACT # record(fanout, "BEND:UNDS:3570:BACTFO") { field(DESC, "BACT processing") field(SELM, "All") field(LNK1, "BEND:UNDS:3570:BDIFF") field(LNK2, "BEND:UNDS:3570:BADIFF") field(LNK3, "BEND:UNDS:3570:BRATIO") field(LNK4, "BEND:UNDS:3570:MPSLIMITS") field(LNK5, "BEND:UNDS:3570:I2BSTATUS") field(LNK6, "BEND:UNDS:3570:IACTFO.PROC") } record(calc, "BEND:UNDS:3570:BDIFF") { field(DESC, "BDES-BACT") field(CALC, "A-B") field(INPA, "BEND:UNDS:3570:BDES") field(INPB, "BEND:UNDS:3570:BACT") field(EGU, "kG-m") field(PREC, "7") } record(calc, "BEND:UNDS:3570:BADIFF") { field(DESC, "Absolute BDES-BACT") field(INPA, "BEND:UNDS:3570:BDIFF") field(EGU, "kG-m") field(PREC, "7") field(CALC, "A<0?ABS(A):A") } record(calc, "BEND:UNDS:3570:BRATIO") { field(DESC, "BACT Error") field(CALC, "B?A/B:0") field(INPA, "BEND:UNDS:3570:BDIFF") field(INPB, "BEND:UNDS:3570:BDES.HOPR") field(EGU, "kG-m") field(PREC, "7") } record(mbbi, "BEND:UNDS:3570: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, "BEND:UNDS:3570:BACT.J") } # Note: for a string slave set the MONFL # macro to the following: # MONFL=:IMONCALC MS record(sub, "BEND:UNDS:3570:BMON") { field(DESC, "Second Transductor") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "BEND:UNDS:3570:BMON") field(INPB, "BEND:UNDS:3570:POLYCOEF") field(INPC, "BEND:UNDS:3570:POLYCOEF.A") field(INPD, "BEND:UNDS:3570:POLYCOEF.B") field(INPE, "BEND:UNDS:3570:IMONCALC MS") field(INPF, "BEND:UNDS:3570:BDELTAS.VAL") field(INPG, "100") field(EGU, "kG-m") field(HOPR, "2.68") field(LOPR, "0.0") field(HIHI, "2.68") field(LOLO, "0.0") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "2.68") field(LOW, "0.0") } # 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=BEND:UNDS:3510:BDES CP record(ao, "BEND:UNDS:3570:BDES") { field(DESC, "Desired B-Field") field(PINI, "NO") field(DRVH, "2.68") field(DRVL, "0.0") field(HOPR, "2.68") field(LOPR, "0.0") field(PREC, "7") field(EGU, "kG-m") field(MDEL, "-1") field(OMSL, "closed_loop") field(DOL, "BEND:UNDS:3570:IDES2BDES") field(OUT, "BEND:UNDS:3570:B2IDES PP") info(autosaveFields,"VAL") } record(sub, "BEND:UNDS:3570:B2IDES") { field(DESC, "Convert Desired B-Field to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "BEND:UNDS:3570:POLYCOEF") field(INPC, "BEND:UNDS:3570:POLYCOEF.A") field(INPD, "BEND:UNDS:3570:POLYCOEF.B") field(PREC, "7") field(EGU, "kG-m") field(HOPR, "2.68") field(LOPR, "0.0") field(MDEL, "-1") field(INPE, "BEND:UNDS:3570:BDES.DRVH") field(INPF, "BEND:UNDS:3570:BDES.DRVL") field(BRSV, "INVALID") field(FLNK, "BEND:UNDS:3570:IDES") } record(sub, "BEND:UNDS:3570:BNOM") { field(DESC, "Nominal Field") field(PINI, "YES") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "BEND:UNDS:3570:POLYCOEF") field(INPC, "BEND:UNDS:3570:POLYCOEF.A") field(INPD, "BEND:UNDS:3570:POLYCOEF.B") field(INPE, "BEND:UNDS:3570:BDES.DRVH") field(INPF, "BEND:UNDS:3570:BDES.DRVL") field(EGU, "kG-m") field(HOPR, "2.68") field(LOPR, "0.0") field(PREC, "7") field(VAL, "0.0") field(FLNK, "BEND:UNDS:3570:INOM") } record(sub, "BEND:UNDS:3570:BACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "BEND:UNDS:3570:BDES.VAL") field(INPB, "BEND:UNDS:3570:BDES.DRVH") field(INPC, "BEND:UNDS:3570:BDES.DRVL") field(INPD, "BEND:UNDS:3570:BDELTAS.I") field(INPE, "BEND:UNDS:3570:BDELTAS.J") field(INPG, "BEND:UNDS:3570:STATE") field(INPH, "BEND:UNDS:3570:HSTA") field(EGU, "kG-m") field(HOPR, "2.68") field(LOPR, "0.0") field(PREC, "7") field(BRSV, "INVALID") } record(sub, "BEND:UNDS:3570:BMONLIMITS") { field(DESC, "MON Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "BEND:UNDS:3570:BDES.VAL") field(INPB, "BEND:UNDS:3570:BDES.DRVH") field(INPC, "BEND:UNDS:3570:BDES.DRVL") field(INPD, "BEND:UNDS:3570:BDELTAS.K") field(INPE, "BEND:UNDS:3570:BDELTAS.L") field(INPG, "BEND:UNDS:3570:STATE") field(INPH, "BEND:UNDS:3570:HSTA") field(EGU, "kG-m") field(HOPR, "2.68") field(LOPR, "0.0") field(PREC, "7") field(BRSV, "INVALID") } record(seq, "BEND:UNDS:3570:BLIMITS") { field(DESC, "ACT Limits") field(PREC, "7") field(DOL1, "BEND:UNDS:3570:BLIMITS") field(LNK1, "BEND:UNDS:3570:BACTLIMITS.F PP") field(DOL2, "BEND:UNDS:3570:BACTLIMITS.I") field(LNK2, "BEND:UNDS:3570:BACT.HIGH") field(DOL3, "BEND:UNDS:3570:BACTLIMITS.J") field(LNK3, "BEND:UNDS:3570:BACT.LOW") field(DOL4, "BEND:UNDS:3570:BACTLIMITS.K") field(LNK4, "BEND:UNDS:3570:BACT.HIHI") field(DOL5, "BEND:UNDS:3570:BACTLIMITS.L") field(LNK5, "BEND:UNDS:3570:BACT.LOLO") field(DOL6, "BEND:UNDS:3570:BLIMITS") field(LNK6, "BEND:UNDS:3570:BMONLIMITS.F PP") field(DOL7, "BEND:UNDS:3570:BMONLIMITS.I") field(LNK7, "BEND:UNDS:3570:BMON.HIGH") field(DOL8, "BEND:UNDS:3570:BMONLIMITS.J") field(LNK8, "BEND:UNDS:3570:BMON.LOW") field(DOL9, "BEND:UNDS:3570:BMONLIMITS.K") field(LNK9, "BEND:UNDS:3570:BMON.HIHI") field(DOLA, "BEND:UNDS:3570:BMONLIMITS.L") field(LNKA, "BEND:UNDS:3570:BMON.LOLO") field(FLNK, "BEND:UNDS:3570:ILIMITS") field(SCAN, "5 second") } record(ao, "BEND:UNDS:3570:BCTRL") { field(DESC, "B-Perturb") field(PREC, "7") field(EGU, "kG-m") field(DRVH, "2.68") field(DRVL, "0.0") field(HOPR, "2.68") field(LOPR, "0.0") # 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, "BEND:UNDS:3570: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, "BEND:UNDS:3570:BCTRLGO") { field(DESC, "Update DES and perturb") field(PREC, "7") # Disable BACT limits field(DOL1, "1") field(LNK1, "BEND:UNDS:3570:BLIMITS.VAL") # Update BDES with the BCTRL (slider) value field(DOL2, "BEND:UNDS:3570:BCTRL.VAL") field(LNK2, "BEND:UNDS:3570:BDES PP") field(DOL3, "1") field(LNK3, "BEND:UNDS:3570:IDIRECT.PROC PP") field(DOL4, "1") field(LNK4, "BEND:UNDS:3570:CHECKSTDZLOST.PROC PP") field(DOL5, "BEND:UNDS:3570:BCTRL.VAL") field(LNK5, "BEND:UNDS:3570:BCTRLSUB PP") # Re-enable BACT limits field(DOL6, "0") field(LNK6, "BEND:UNDS:3570:BLIMITS.VAL") } # Convert B-field to Current and output to ISETPT record(sub, "BEND:UNDS:3570:BCTRLSUB") { field(DESC, "Feedback") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "BEND:UNDS:3570:POLYCOEF") field(INPC, "BEND:UNDS:3570:POLYCOEF.A") field(INPD, "BEND:UNDS:3570:POLYCOEF.B") field(INPE, "BEND:UNDS:3570:BDES.DRVH") field(INPF, "BEND:UNDS:3570:BDES.DRVL") field(PREC, "7") field(EGU, "kG-m") field(HOPR, "2.68") field(LOPR, "0.0") field(MDEL, "-1") field(BRSV, "INVALID") field(FLNK, "BEND:UNDS:3570:ISETPT") } record(ao, "BEND:UNDS:3570:BDESPREVTRIM") { field(DESC, "trim bdes for undo") field(DTYP, "Soft Channel") field(DRVH, "2.68") field(DRVL, "0.0") field(EGU, "kG-m") field(HOPR, "2.68") field(LOPR, "0.0") field(PREC, "7") field(PINI, "YES") info(autosaveFields,"VAL") } record(stringin, "BEND:UNDS:3570:MADNAME") { field(DESC, "MAD deck nomenclature") field(PINI, "YES") field(VAL, "BCXSS4") } record(ai, "BEND:UNDS:3570: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, "3650.467106") } record(ao, "BEND:UNDS:3570:BMAX") { field(DESC, "Max B-Field") field(DTYP, "Soft Channel") field(DRVH, "2.68") field(DRVL, "0.0") field(EGU, "kG-m") field(HOPR, "2.68") field(LOPR, "0.0") field(PREC, "7") field(PINI, "YES") field(VAL, "2.68") field(FLNK, "BEND:UNDS:3570:BSTEP") } record(ao, "BEND:UNDS:3570:BMIN") { field(DESC, "Min B-Field") field(DTYP, "Soft Channel") field(DRVH, "2.68") field(DRVL, "0.0") field(EGU, "kG-m") field(HOPR, "2.68") field(LOPR, "0.0") field(PREC, "7") field(PINI, "YES") field(VAL, "0.0") field(FLNK, "BEND:UNDS:3570:BSTEP") } record(ao, "BEND:UNDS:3570:BDESSAVE") { field(DESC, "bdes for save/load") field(DTYP, "Soft Channel") field(DRVH, "2.68") field(DRVL, "0.0") field(EGU, "kG-m") field(HOPR, "2.68") field(LOPR, "0.0") field(PINI, "YES") field(PREC, "7") } # This record is processed by BEND:UNDS:3570: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, "BEND:UNDS:3570:BCON") { field(DESC, "Config B-Field ") field(DTYP, "Soft Channel") field(PREC, "7") field(EGU, "kG-m") field(HOPR, "2.68") field(LOPR, "0.0") field(DRVH, "2.68") field(DRVL, "0.0") # 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 , "BEND:UNDS:3570:ICON2BCON") field(OMSL, "closed_loop") field(OUT, "BEND:UNDS:3570:B2ICON PP") info(autosaveFields,"VAL") } record(sub, "BEND:UNDS:3570:B2ICON") { field(DESC, "Convert Desired ICon to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "BEND:UNDS:3570:POLYCOEF") field(INPC, "BEND:UNDS:3570:POLYCOEF.A") field(INPD, "BEND:UNDS:3570:POLYCOEF.B") field(PREC, "7") field(EGU, "kG-m") field(HOPR, "2.68") field(LOPR, "0.0") field(MDEL, "-1") field(INPE, "BEND:UNDS:3570:BCON.DRVH") field(INPF, "BEND:UNDS:3570:BCON.DRVL") field(BRSV, "INVALID") field(FLNK, "BEND:UNDS:3570: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, "BEND:UNDS:3570:BSTEP") { field(DESC, "B-Field step size") field(CALC, "(C==3)||(D==3)?0:ABS(A-B)*0.005") field(INPA, "BEND:UNDS:3570:BMAX") field(INPB, "BEND:UNDS:3570:BMIN") field(INPC, "BEND:UNDS:3570:BMIN.SEVR") field(INPD, "BEND:UNDS:3570:BMAX.SEVR") field(EGU, "kG-m") 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,"BEND:UNDS:3570:BCTRLDISABLECALC") { field(DESC, "Calc for disabling BCTRL") field(ASG, "Internal") field(CALC, "A?2:1") field(INPA, "BEND:UNDS:3570:ONLINE CP") field(OUT, "BEND:UNDS:3570:BCTRLDISABLEFOUT PP") } record(fanout, "BEND:UNDS:3570:BCTRLDISABLEFOUT") { field(DESC, "Disable BCTRL fanout") field(SELM, "Specified") field(SELL, "BEND:UNDS:3570:BCTRLDISABLECALC") field(LNK1, "BEND:UNDS:3570:BCTRLDISABLE") field(LNK2, "BEND:UNDS:3570:BCTRLENABLE") } record(stringout, "BEND:UNDS:3570:BCTRLDISABLE") { field(DESC, "Disable BCTRL") field(DTYP, "Soft Channel") field(OUT, "BEND:UNDS:3570:BCTRL.ASG") field(VAL, "NOWRITE") field(FLNK, "BEND:UNDS:3570:BCTRLDISV_UPDATE") } record(stringout, "BEND:UNDS:3570:BCTRLENABLE") { field(DESC, "Enable BCTRL") field(DTYP, "Soft Channel") field(OUT, "BEND:UNDS:3570:BCTRL.ASG") field(VAL, "") field(FLNK, "BEND:UNDS:3570:BCTRLDISV_UPDATE") } record(calcout, "BEND:UNDS:3570:BCTRLDISV_UPDATE") { field(DESC, "Calc for updating BCTRL.DISV") field(ASG, "Internal") field(CALC, "A") field(INPA, "BEND:UNDS:3570:ONLINE") field(OUT, "BEND:UNDS:3570: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,"BEND:UNDS:3570:BACT and MON\n are processed via links from \n BEND:UNDS:3570:IACT (device raw value readback 1)\n and\n BEND:UNDS:3570: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 BEND:UNDS:3570:POLYCOEF\nC = First polynomial coefficient (offset if linear)\nD = Second polynomial coefficient (slope if linear)\nE = BEND:UNDS:3570: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,"BEND:UNDS:3570:BDES\n is processed when set by CA users or \n BEND:UNDS:3570: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,"BEND:UNDS:3570: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 BEND:UNDS:3570: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 (BEND:UNDS:3570: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,"BEND:UNDS:3570:B*LIMITS and BEND:UNDS:3570:BLIMITS:\n Calculate alarm and warning limits based on \n deltas from BEND:UNDS:3570: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,"BEND:UNDS:3570: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,"BEND:UNDS:3570: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, "BEND:UNDS:3570: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, "BEND:UNDS:3570:MPSBTOL") { field(DESC, "Absolute mps tol") field(EGU, "kG-m") field(PREC, "2") field(CALC, "ABS(A)*0.02") field(INPA, "BEND:UNDS:3570:BMAX") field(PINI, "YES") } # # 21-Aug-2013: K. Luchini # Set channel access security so that users # cannot easily change values. record(ao, "BEND:UNDS:3570:MPSBMAX") { field(DESC, "MPS Max B-field") field(EGU, "kG-m") field(PREC, "7") field(DRVH, "2.68") field(DRVL, "0.0") field(PINI, "YES") field(VAL, "2.68") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "BEND:UNDS:3570:MPSBMIN") { field(DESC, "MPS Min B-field") field(EGU, "kG-m") field(PREC, "7") field(DRVH, "2.68") field(DRVL, "0.0") field(PINI, "YES") field(VAL, "0.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "BEND:UNDS:3570:MPSBLLIM") { field(DESC, "MPS Low Limit B-field") field(EGU, "kG-m") field(PREC, "7") field(DRVH, "2.68") field(DRVL, "0.0") field(PINI, "YES") field(VAL, "0.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "BEND:UNDS:3570:MPSBLLIM2") { field(DESC, "MPS Low Limit #2 B-field") field(EGU, "kG-m") field(PREC, "7") field(DRVH, "2.68") field(DRVL, "0.0") field(PINI, "YES") field(VAL, "0.0") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } # Set the default to Std record(mbbo, "BEND:UNDS:3570: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, "BEND:UNDS:3570:MPSLIMITS.E PP") } record(aSub, "BEND:UNDS:3570: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, "BEND:UNDS:3570:MPS.RVAL") field(INPB, "BEND:UNDS:3570:BADIFF") field(INPC, "BEND:UNDS:3570:BDELTAS.N") field(INPD, "BEND:UNDS:3570:BACT") field(INPE, "BEND:UNDS:3570:MPSBITMASK.RVAL") field(INPF, "BEND:UNDS:3570:MPSBLLIM") field(INPG, "BEND:UNDS:3570:MPSBMIN") field(INPH, "BEND:UNDS:3570:MPSBMAX") field(INPI, "BEND:UNDS:3570: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, "BEND:UNDS:3570:INTOL.RVAL PP") field(OUTB, "BEND:UNDS:3570:INTOL_BMIN.RVAL PP") field(OUTC, "BEND:UNDS:3570:INTOL_BRANGE.RVAL PP") field(OUTD, "BEND:UNDS:3570: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, "BEND:UNDS:3570:INTOL") { field(DESC, "BACT within MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "BEND:UNDS:3570:MPSLIMITS.VALA") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "BEND:UNDS:3570:INTOL_BMIN") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "BEND:UNDS:3570:MPSLIMITS.VALB") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "BEND:UNDS:3570:INTOL_BMIN2") { field(DESC, "MPS tol #2") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "BEND:UNDS:3570:MPSLIMITS.VALD") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "BEND:UNDS:3570:INTOL_BRANGE") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "BEND:UNDS:3570: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, "BEND:UNDS:3570:CHCKITOL") { field(DESC, "Absolute Check I Tolerance") field(EGU, "A") field(FLNK, "BEND:UNDS:3570:TRIMITOL") field(CALC, "ABS(A*B)") field(INPA, "BEND:UNDS:3570:CHCKBTOL") field(INPB, "BEND:UNDS:3570:POLYCOEF.B") field(PREC, "9") } record(calc, "BEND:UNDS:3570:TRIMBTOL") { field(EGU, "kG-m") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(DESC, "Absolute Trim Tolerance") field(CALC, "ABS(A)/2") field(INPA, "BEND:UNDS:3570:CHCKBTOL") field(FLNK, "BEND:UNDS:3570:CHCKITOL") } record(calc, "BEND:UNDS:3570:CHCKBTOL") { field(DESC, "Check absolute tolerance") field(EGU, "A") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(FLNK, "BEND:UNDS:3570:TRIMBTOL") field(CALC, "MAX(ABS(A),ABS(C))*(B/1000000)") field(INPA, "BEND:UNDS:3570:BDES.HOPR") field(INPB, "BEND:UNDS:3570:STABILITY") field(INPC, "BEND:UNDS:3570:BDES.LOPR") } record(longout, "BEND:UNDS:3570: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, "BEND:UNDS:3570:CHCKBTOL") } record(calc, "BEND:UNDS:3570:TRIMITOL") { field(DESC, "Absolute Trim I Tolerance") field(EGU, "kG-m") field(CALC, "ABS(A*B)") field(INPA, "BEND:UNDS:3570:POLYCOEF.B") field(INPB, "BEND:UNDS:3570:TRIMBTOL") field(PREC, "9") } record(ai, "BEND:UNDS:3570:TRIMBTOLR") { field(DESC, "Relative trim tol") field(PREC, "4") field(EGU, "%") field(HOPR, "1.0") field(LOPR, "0.0") field(PINI, "YES") } record(ai, "BEND:UNDS:3570: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, "BEND:UNDS:3570:FBCKFCOM") { field(ZNAM, "CA") field(ONAM, "FCOM") field(DESC, "CA Mode") field(PINI, "YES") field(SDIS, "0") } record(bo, "BEND:UNDS:3570:PAU") { field(ZNAM, "NotConfigured") field(ONAM, "Configured") field(DESC, "PAU Present") field(PINI, "YES") field(SDIS, "0") field(FLNK, "BEND:UNDS:3570:PAUGO") } record(fanout, "BEND:UNDS:3570:PAUGO") { field(DESC, "PAU control") field(LNK1, "BEND:UNDS:3570:PAUSTOP") field(LNK2, "BEND:UNDS:3570: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, "BEND:UNDS:3570:PAUSTART") { field(DESC, "Setup for PAU On") field(SDIS, "BEND:UNDS:3570: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, "BEND:UNDS:3570:PAUSTOP") { field(DESC, "Setup for PAU Off") field(SDIS, "BEND:UNDS:3570: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, "BEND:UNDS:3570:MCORDEVNAME") { field(DESC, "PS device name") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, "BEND:UNDS:3510:") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "BEND:UNDS:3570: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, "BEND:UNDS:3570:PSTYPE.RVAL") field(INPC, "BEND:UNDS:3570:TURNEDOFF.RVAL") field(INPD, "BEND:UNDS:3570:CONFIG.RVAL") field(INPE, "BEND:UNDS:3570:PSCATEGORY.RVAL") field(INPF, "BEND:UNDS:3570:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "BEND:UNDS:3570:AUTOCTRL.RVAL") field(INPJ, "BEND:UNDS:3570:OUTOFSERVICE.RVAL") field(INPL, "BEND:UNDS:3570:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "BEND:UNDS:3570:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "BEND:UNDS:3570:PAU") field(INPP, "BEND:UNDS:3570:CALBDISABLE.RVAL") field(INPQ, "BEND:UNDS:3570:PTRBDISABLE.RVAL") field(INPR, "BEND:UNDS:3570:TRIMDISABLE.RVAL") field(INPS, "BEND:UNDS:3570:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "BEND:UNDS:3570:FBCK") field(INPU, "BEND:UNDS:3570:TRIMTYPE.RVAL") field(INPV, "BEND:UNDS:3570:STDZDIRECT.RVAL") field(INPW, "BEND:UNDS:3570:DEGAUSENABLE.RVAL") field(FLNK, "BEND:UNDS:3570:HSTA") } record(longin, "BEND:UNDS:3570:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "BEND:UNDS:3570:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "BEND:UNDS:3570: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, "BEND:UNDS:3570: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, "BEND:UNDS:3570: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, "BEND:UNDS:3570: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, "BEND:UNDS:3570: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, "BEND:UNDS:3570: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 BEND:UNDS:3570:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses BEND:UNDS:3570:FBCK. # This PV should be replaced by BEND:UNDS:3570: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, "BEND:UNDS:3570: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, "BEND:UNDS:3570: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, "BEND:UNDS:3570: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, "BEND:UNDS:3510:OUTOFSERVICE CPP NMS") field(OMSL, "closed_loop") field(FLNK, "BEND:UNDS:3570:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"BEND:UNDS:3570:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "BEND:UNDS:3570:OUTOFSERVICE NPP NMS") field(OUT, "BEND:UNDS:3570:ONLINE PP") } record(bo, "BEND:UNDS:3570:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "BEND:UNDS:3570: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, "BEND:UNDS:3570: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, "BEND:UNDS:3570: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, "BEND:UNDS:3570: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, "BEND:UNDS:3570: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, "BEND:UNDS:3570: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, "BEND:UNDS:3570: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, "BEND:UNDS:3570: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, "BEND:UNDS:3570: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, "BEND:UNDS:3570: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, "BEND:UNDS:3570: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, "BEND:UNDS:3570:TRIMTYPE") } record(stringout, "BEND:UNDS:3570:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "BEND:UNDS:3510:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "BEND:UNDS:3570:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "BEND:UNDS:3570:STATE.RVAL") field(INPB, "BEND:UNDS:3570:INTLKSUMY.RVAL") field(OUT, "BEND:UNDS:3570:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "BEND:UNDS:3570: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, "BEND:UNDS:3570:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "BEND:UNDS:3570:STATE.RVAL") field(INPB, "BEND:UNDS:3570:INTLKSUMY.RVAL") field(OUT, "BEND:UNDS:3570:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "BEND:UNDS:3570:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "BEND:UNDS:3570:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "BEND:UNDS:3570: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, "BEND:UNDS:3570: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, "BEND:UNDS:3570: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, "BEND:UNDS:3570: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,"BEND:UNDS:3570: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("BEND:UNDS:3570:TURNEDOFF",3140,1907,0,1,"BEND:UNDS:3570:TURNEDOFF") #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "BEND:UNDS:3570:STATSUB") { field(DESC, "Build STATus ") field(INAM, "mgntInit") field(SNAM, "mgntSlcStat") field(INPA, "BEND:UNDS:3570:BACT.STAT") field(INPB, "BEND:UNDS:3570:BDES.STAT") field(INPC, "BEND:UNDS:3570: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, "BEND:UNDS:3570:BACT.SEVR") field(INPH, "BEND:UNDS:3570:BDES.SEVR") field(INPI, "BEND:UNDS:3570: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, "BEND:UNDS:3570:STATE.RVAL") field(INPN, "BEND:UNDS:3570:STDZOK") field(INPO, "BEND:UNDS:3570:CALBOK") field(INPP, "BEND:UNDS:3570:OUTOFSERVICE.RVAL") field(INPQ, "BEND:UNDS:3570:CONFIG.RVAL") field(INPR, "BEND:UNDS:3570:HSTA") field(INPS, "BEND:UNDS:3570:CTRL.RVAL") field(INPT, "BEND:UNDS:3570:DEGAUSOK") field(INPV, "BEND:UNDS:3570: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, "BEND:UNDS:3570:STAT") } record(longout, "BEND:UNDS:3570:STAT") { field(DESC, "STAT sent to SLC") field(SCAN, "Passive") field(FLNK, "BEND:UNDS:3570:STATCTRLSUB") field(DOL, "BEND:UNDS:3570:STATSUB.VAL") field(OMSL, "closed_loop") } record(sSub, "BEND:UNDS:3570:STATCTRLSUB") { field(DESC, "Decode SLC STAT into mbbo") field(INAM, "mgntInit") field(SNAM, "mgntStatDecode") field(INPA, "BEND:UNDS:3570:STAT") field(INPB, "BEND:UNDS:3570:HSTA") field(INPD, "BEND:UNDS:3570:ONOFFCTRL.RVAL") field(FLNK, "BEND:UNDS:3570:STATMSG") } record(mbbo, "BEND:UNDS:3570: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, "BEND:UNDS:3570:UNAVAILGO") field(DOL, "BEND:UNDS:3570:STATCTRLSUB.W") } record(seq, "BEND:UNDS:3570:UNAVAILGO") { field(DESC, "Process UNAVAIL") field(DOL1, "BEND:UNDS:3570:STATSUB.U") field(LNK1, "BEND:UNDS:3570:UNAVAIL PP") } record(stringout, "BEND:UNDS:3570:SNLSTATMSG") { field(DTYP, "Soft Channel") } #! TextBox(TB0,820,1000,1200,1220,0,"Dialog",12,1,16777215,"BEND:UNDS:3570:STATUSSUB - future\nOverall device status - takes input from action snls, record sevrs, master snl(s) and outputs final status\n\nInputs:\nA - BEND:UNDS:3570:CTRLSTATUS - snl status\nB - MGNT:CTRLSTATUS - master list status\nC\nD - BEND:UNDS:3570: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,"BEND:UNDS:3570STATSUB\nformat control bo's into slc STAT\n\nInputs:\nA - BEND:UNDS:3570:STATUS\nC - BEND:UNDS:3570:ON\nD - BEND:UNDS:3570:STDZOK\nE - BEND:UNDS:3570:CALBOK\nF - BEND:UNDS:3570:BACTDRIFT (future)\nG -\nH- BEND:UNDS:3570:DACSTATUS\nI -BEND:UNDS:3570:ADCSTATUS\nJ - BEND:UNDS:3570:BACTSTATUS\nK - BEND:UNDS:3570:BDESSTATUS\nL - BEND:UNDS:3570:RIPLSTATUS\n\nOutput:\nP - BEND:UNDS:3570: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, "BEND:UNDS:3570: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, "BEND:UNDS:3570: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, "BEND:UNDS:3570: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, "BEND:UNDS:3570: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, "BEND:UNDS:3570:IDESTOTAL"){ field(DESC, "Calc total current") field(CALC, "A+B") field(EGU, "kG-m") field(PREC, "7") field(INPA, "BEND:UNDS:3510:IDES CP NMS") field(INPB, "BTRM:UNDS:3570:BDES CP NMS") field(OUT, "BEND:UNDS:3570:IDES2BDES.E PP") } record(sub, "BEND:UNDS:3570:IDES2BDES") { field(DESC, "Cal BDES") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "BEND:UNDS:3570:IDES2BDES") field(INPB, "BEND:UNDS:3570:POLYCOEF") field(INPC, "BEND:UNDS:3570:POLYCOEF.A") field(INPD, "BEND:UNDS:3570:POLYCOEF.B") field(INPE, "BEND:UNDS:3570:IDESTOTAL MS") field(INPF, "BEND:UNDS:3510:BDELTAS PP") field(INPG, "100") field(EGU, "kG-m") field(HOPR, "2.68") field(LOPR, "0.0") field(HIHI, "2.68") field(LOLO, "0.0") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "2.68") field(LOW, "0.0") field(FLNK, "BEND:UNDS:3570: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, "BEND:UNDS:3570:IACTCALC"){ field(DESC, "Calc total act current") field(CALC, "A+B") field(EGU, "kG-m") field(PREC, "7") field(INPA, "BEND:UNDS:3570:IACT CP NMS") field(INPB, "BTRM:UNDS:3570:BACT") field(OUT, "BEND:UNDS:3570: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, "BEND:UNDS:3570:IMONCALC"){ field(DESC, "Calc total mon current") field(CALC, "A+B") field(EGU, "kG-m") field(PREC, "7") field(INPA, "BEND:UNDS:3570:IMON CP NMS") field(INPB, "BTRM:UNDS:3570:BMON") field(OUT, "BEND:UNDS:3570: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, "BEND:UNDS:3570:ICONTOTAL"){ field(DESC, "Calc total current") field(CALC, "A+B") field(EGU, "kG-m") field(PREC, "7") field(INPA, "BEND:UNDS:3510:ICON CP NMS") field(INPB, "BTRM:UNDS:3570:BCON CP NMS") field(OUT, "BEND:UNDS:3570:ICON2BCON.E PP") } record(sub, "BEND:UNDS:3570:ICON2BCON") { field(DESC, "Cal BCON") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "BEND:UNDS:3570:ICON2BCON") field(INPB, "BEND:UNDS:3570:POLYCOEF") field(INPC, "BEND:UNDS:3570:POLYCOEF.A") field(INPD, "BEND:UNDS:3570:POLYCOEF.B") field(INPE, "BEND:UNDS:3570:ICONTOTAL MS") field(INPF, "BEND:UNDS:3510:BDELTAS PP") field(INPG, "100") field(EGU, "kG-m") field(HOPR, "2.68") field(LOPR, "0.0") field(HIHI, "2.68") field(LOLO, "0.0") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "2.68") field(LOW, "0.0") field(FLNK, "BEND:UNDS:3570:BCON") } #! 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, "BEND:LTUS:165:IACT") { field(DESC, "Current") field(INP, "BEND:LTUS:166:IACT CP NMS") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "BEND:LTUS:165:IACTCALC") info(autosaveFields,"HYST") } record(bi, "BEND:LTUS:165:STATE") { field(DESC, "PS On/Off Status") field(DTYP, "Raw Soft Channel") field(INP, "BEND:LTUS:166:STATE CP MS") field(ZSV, "MAJOR") field(ZNAM, "OFF") field(ONAM, "ON") } record(ao, "BEND:LTUS:165:IDES") { field(DESC, "Desired Current") field(PREC, "3") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(MDEL, "-1") field(HIHI, "250.0") field(LOLO, "0.0") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "BEND:LTUS:165:BDELTAS") field(DRVH, "250.0") field(DRVL, "0.0") field(DOL, "BEND:LTUS:165: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, "BEND:LTUS:165:ICTRL PP") } # This record is processed by BEND:LTUS:165:ICON") # Note: we are not setting alarms here. record(ao, "BEND:LTUS:165:ICON") { field(DESC, "Config I") field(DTYP, "Soft Channel") field(PREC, "3") field(HOPR, "250.0") field(LOPR, "0.0") field(DRVH, "250.0") field(DRVL, "0.0") field(DOL, "BEND:LTUS:165:B2ICON.K") field(OMSL, "closed_loop") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:165:INOM") { field(DESC, "Nominal Current") field(DOL, "BEND:LTUS:165:BNOM.K") field(OMSL, "closed_loop") field(PREC, "3") field(EGU, "A") field(DRVH, "250.0") field(DRVL, "0.0") field(HOPR, "250.0") field(LOPR, "0.0") } record(ao, "BEND:LTUS:165:ICTRL") { field(DESC, "Set Current") field(PREC, "3") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(DRVH, "250.0") field(DRVL, "0.0") field(MDEL, "-1") field(FLNK, "BEND:LTUS:165:ICTRLGO") field(OMSL, "supervisory") info(autosavefields,"VAL") } record(seq, "BEND:LTUS:165:ICTRLGO") { field(DESC, "Process Current Setpoint") field(PREC, "3") # Set ISETPT to supervisory field(DOL1, "0") field(LNK1, "BEND:LTUS:165:ISETPT.OMSL") field(DOL2, "BEND:LTUS:165:ICTRL") field(LNK2, "BEND:LTUS:165:ISETPT PP") # Set ISETPT to closed loop - get data from BCTRLSUB.K field(DOL3, "1") field(LNK3, "BEND:LTUS:165:ISETPT.OMSL") } record(ao, "BEND:LTUS:165:IMAX") { field(DESC, "Max I") field(DTYP, "Soft Channel") field(DRVH, "250.0") field(DRVL, "0.0") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(PREC, "3") field(PINI, "YES") field(VAL, "250.0") field(FLNK, "BEND:LTUS:165:IMIN") } record(ao, "BEND:LTUS:165:IMIN") { field(DESC, "Min I") field(DTYP, "Soft Channel") field(DRVH, "250.0") field(DRVL, "0.0") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(PREC, "3") field(VAL, "0.0") field(FLNK, "BEND:LTUS:165:IRANGE") } record(sel, "BEND:LTUS:165:IACTPREVOK") { field(DESC, "Last Good Current") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(PREC, "3") field(NVL, "BEND:LTUS:165:BACT.SEVR") field(INPA, "BEND:LTUS:165:IACT NPP MS") field(INPB, "BEND:LTUS:165:IACTPREVOK NPP MS") field(INPC, "BEND:LTUS:165:IACTPREVOK NPP MS") field(INPD, "BEND:LTUS:165:IACTPREVOK NPP MS") } record(sub, "BEND:LTUS:165:IACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "BEND:LTUS:165:IDES") field(INPB, "BEND:LTUS:165:ISETPT.DRVH") field(INPC, "BEND:LTUS:165:ISETPT.DRVL") field(INPD, "BEND:LTUS:165:IDELTAS.I") field(INPE, "BEND:LTUS:165:IDELTAS.J") field(INPG, "BEND:LTUS:165:STATE") field(INPH, "BEND:LTUS:165:HSTA") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(sub, "BEND:LTUS:165:IMONLIMITS") { field(DESC, "Aux Current Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "BEND:LTUS:165:IDES") field(INPB, "BEND:LTUS:165:ISETPT.DRVH") field(INPC, "BEND:LTUS:165:ISETPT.DRVL") field(INPD, "BEND:LTUS:165:IDELTAS.K") field(INPE, "BEND:LTUS:165:IDELTAS.L") field(INPG, "BEND:LTUS:165:STATE") field(INPH, "BEND:LTUS:165:HSTA") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(seq, "BEND:LTUS:165:ILIMITS") { field(DESC, "Set ACT and MON Limits") field(PREC, "3") field(DOL1, "BEND:LTUS:165:BLIMITS") field(LNK1, "BEND:LTUS:165:IACTLIMITS.F PP") field(DOL2, "BEND:LTUS:165:IACTLIMITS.I") field(LNK2, "BEND:LTUS:165:IACT.HIGH") field(DOL3, "BEND:LTUS:165:IACTLIMITS.J") field(LNK3, "BEND:LTUS:165:IACT.LOW") field(DOL4, "BEND:LTUS:165:IACTLIMITS.K") field(LNK4, "BEND:LTUS:165:IACT.HIHI") field(DOL5, "BEND:LTUS:165:IACTLIMITS.L") field(LNK5, "BEND:LTUS:165:IACT.LOLO") field(DOL6, "BEND:LTUS:165:BLIMITS") field(LNK6, "BEND:LTUS:165:IMONLIMITS.F PP") field(DOL7, "BEND:LTUS:165:IMONLIMITS.I") field(LNK7, "BEND:LTUS:165:IMON.HIGH") field(DOL8, "BEND:LTUS:165:IMONLIMITS.J") field(LNK8, "BEND:LTUS:165:IMON.LOW") field(DOL9, "BEND:LTUS:165:IMONLIMITS.K") field(LNK9, "BEND:LTUS:165:IMON.HIHI") field(DOLA, "BEND:LTUS:165:IMONLIMITS.L") field(LNKA, "BEND:LTUS:165: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, "BEND:LTUS:165:IDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntRawDeltas") field(INPD, "BEND:LTUS:165:TRIMBTOL") field(INPE, "BEND:LTUS:165:CHCKBTOL") field(INPF, "BEND:LTUS:165:BDELTAS.K") field(INPG, "BEND:LTUS:165:BDELTAS.L") field(INPH, "BEND:LTUS:165: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, "BEND:LTUS:165:STDZITOLR") field(INPC, "BEND:LTUS:165:STDZITOL") field(FLNK, "") } # All ps controllers with on/off control will set the macro ONOF # as follows: # # ONOF = BEND:LTUS:166: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, "BEND:LTUS:165: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 = BEND:LTUS:166:RESET PP # record(bo, "BEND:LTUS:165: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, "BEND:LTUS:165:RAMPSTATE") { field(DESC, "PS Ramp Status") field(DTYP, "Soft Channel") field(DOL, "BEND:LTUS:166: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, "BEND:LTUS:165: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, "BEND:LTUS:165:TRIMRAMPRATE") field(OUT, "") field(FLNK, "BEND:LTUS:165:STDZDLY") } record(ao, "BEND:LTUS:165:ISETPT") { field(DESC, "Current Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(DRVH, "250.0") field(DRVL, "0.0") field(MDEL, "-1") field(OUT, "") field(DOL, "BEND:LTUS:165: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, "BEND:LTUS:165:IMON") { field(DESC, "Aux Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(INP, "BEND:LTUS:166:IMON CP NMS") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "BEND:LTUS:165:IMONCALC") } record(ao, "BEND:LTUS:165:IRIPL") { field(DESC, "Ripple Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(DOL, "BEND:LTUS:166:IRIPL CP NMS") field(OMSL, "closed_loop") field(EGU, "A") field(DRVH, "1.0") field(HOPR, "1.0") field(PREC, "3") field(FLNK, "BEND:LTUS:165:IRIPLOK") } record(sub, "BEND:LTUS:165:IRIPLOK") { field(DESC, "Ripple Current Status") field(INAM, "mgntInit") field(SNAM, "mgntRiplOK") field(INPA, "BEND:LTUS:165:IRIPL.VAL") field(INPB, "BEND:LTUS:165: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, "BEND:LTUS:165:R") { field(DESC, "Resistance") field(EGU, "Ohms") field(PREC, "4") field(PINI, "YES") field(DOL, "BEND:LTUS:166: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, "BEND:LTUS:165:IGND") { field(DESC, "Ground Current") field(EGU, "A") field(PREC, "6") field(PINI, "YES") field(DOL, "BEND:LTUS:166:IGND CP MS") field(OMSL, "closed_loop") } record(bi, "BEND:LTUS:165:INTLKSUMY") { field(DESC, "Interlock Summary") field(INP, "BEND:LTUS:166:INTLKSUMY CP MS") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(ZNAM, "OK") field(ONAM, "FAULT") field(PINI, "NO") } record(mbbo, "BEND:LTUS:165: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, "BEND:LTUS:166:COOLING CP NMS") field(OMSL, "closed_loop") } # The following PV is processed by :BACTFO # which is processed by :BACT record(fanout, "BEND:LTUS:165:IACTFO") { field(DESC, "IACT processing") field(SELM, "All") field(LNK1, "BEND:LTUS:165:IACTPREVOK") field(LNK2, "BEND:LTUS:165:IDIFF") field(LNK3, "BEND:LTUS:165:IADIFF") field(LNK4, "BEND:LTUS:165:IRATIO") field(LNK5, "BEND:LTUS:165:IDIRECT") field(LNK6, "BEND:LTUS:165:IACTPOL_CHECK") } record(calc, "BEND:LTUS:165:IDIFF") { field(DESC, "IDES-IACT") field(CALC, "A-B") field(INPA, "BEND:LTUS:165:IDES") field(INPB, "BEND:LTUS:165:IACT") field(EGU, "A") field(PREC, "9") field(HOPR, "250.0") field(LOPR, "0.0") } record(calc, "BEND:LTUS:165:IADIFF") { field(DESC, "Absolute IDES-IACT") field(CALC, "A<0?ABS(A):A") field(INPA, "BEND:LTUS:165:IDIFF") field(PREC, "9") } record(calc, "BEND:LTUS:165:IRATIO") { field(DESC, "IDES-IACT/IMAX") field(CALC, "B?A/B:0") field(INPA, "BEND:LTUS:165:IDIFF") field(INPB, "BEND:LTUS:165:IDES.DRVH") field(PREC, "9") } record(calcout, "BEND:LTUS:165:IRANGE") { field(DESC, "Current Range") field(PINI, "YES") field(CALC, "ABS(A-B)") field(INPA, "BEND:LTUS:165:IMIN") field(INPB, "BEND:LTUS:165: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, "BEND:LTUS:165: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, "BEND:LTUS:165:IACT") field(FLNK, "BEND:LTUS:165:IACTPOL") } record(bo, "BEND:LTUS:165:IACTPOL") { field(DESC, "Actual I Polarity") field(DTYP, "Raw Soft Channel") field(DOL, "BEND:LTUS:165: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,"BEND:LTUS:165:I*LIMITS:\n Calculate alarm and warning limits based on \n deltas from BEND:LTUS:165:IDELTAS and the\n BEND:LTUS:165: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,"BEND:LTUS:165:IACT: \n Get copy of BEND:LTUS:165:I. \n",null) #! TextBox(TB12,1280,3100,1760,3200,0,"Dialog",12,1,16777215,"BEND:LTUS:165: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,"BEND:LTUS:165:IDES:\n Contains raw value calculated by \nBEND:LTUS:165: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 \nBEND:LTUS:165:BDELTAS.\n",null) #! TextBox(TB10,56,1940,316,2340,0,"Dialog",12,1,16777215,"BEND:LTUS:165: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 BEND:LTUS:165: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 BEND:LTUS:165: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,"BEND:LTUS:165:ISETPT:\n Sets the hardware. When fast feedback is set on, this record is\n set to closed loop mode by BEND:LTUS:165:FBCKSTART sequence. When \n the loop is closed, this record takes input calculated by \n BFBCK only. When fast feedback is set off, BEND:LTUS:165:FBCKSTOP \n will set it back to supervisory so that the value can be set by \n BEND:LTUS:165: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, "BEND:LTUS:165:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:165:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "BEND:LTUS:165:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "BEND:LTUS:165:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "BEND:LTUS:165:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "BEND:LTUS:165:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "1") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "BEND:LTUS:165: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, "BEND:LTUS:165:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "BEND:LTUS:165:TRIMTYPE.RVAL") field(INPB, "BEND:LTUS:165:CONFIG.RVAL") field(OUT, "BEND:LTUS:165:TRIMMAXNUM PP") } record(longout, "BEND:LTUS:165: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, "BEND:LTUS:165: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, "BEND:LTUS:166:TRIMRAMPRATE CP NMS") field(OMSL, "closed_loop") field(VAL, "") field(OUT, "BEND:LTUS:165:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "BEND:LTUS:165: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, "BEND:LTUS:166:TRIMSETL CP NMS") field(OMSL, "closed_loop") field(VAL, "") } record(bo, "BEND:LTUS:165: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, "BEND:LTUS:165: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, "BEND:LTUS:165: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, "BEND:LTUS:165:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "0") } record(ao, "BEND:LTUS:165: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, "BEND:LTUS:165:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "BEND:LTUS:165: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, "BEND:LTUS:165: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, "BEND:LTUS:165:IMOVE") field(INPB, "BEND:LTUS:165:IACT") field(INPC, "BEND:LTUS:165:IRAMPRATE") field(INPD, "1.577") field(INPE, "BEND:LTUS:165:TRIMDLYPCT") field(INPF, "BEND:LTUS:165:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "BEND:LTUS:165:RAMPTIME_LEFT PP") } record(longout, "BEND:LTUS:165:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "BEND:LTUS:165:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "BEND:LTUS:165:RAMPDONE_CALC") } record(calc, "BEND:LTUS:165:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "BEND:LTUS:165:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "BEND:LTUS:165:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "BEND:LTUS:165: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, "BEND:LTUS:165:RAMPTIME_LEFT") field(OUT, "BEND:LTUS:165:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "BEND:LTUS:165:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "BEND:LTUS:165:RAMPTIME_LEFT NMS") field(OUT, "BEND:LTUS:165:RAMPDONE PP") } record(bo, "BEND:LTUS:165:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "BEND:LTUS:165:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "BEND:LTUS:165: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, "BEND:LTUS:165: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, "BEND:LTUS:165:STDZINIT") { field(DESC, "Proc. Stdz PVs on boot") field(PINI, "YES") field(DOL1, "1") field(DOL2, "1") field(DOL3, "1") field(LNK1, "BEND:LTUS:165:DEBUG.PROC PP") field(LNK2, "BEND:LTUS:165:STDZCYCLENUM.PROC PP") field(LNK3, "BEND:LTUS:165:STDZDISABLE.PROC PP") field(LNK4, "BEND:LTUS:165: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, "BEND:LTUS:165:STDZSUB") { field(DESC, "Stdz subroutine") field(INAM, "mgntStdzInit") field(SNAM, "mgntStdz") field(BRSV, "INVALID") field(INPA, "BEND:LTUS:165:STDZIMIN NPP NMS") field(INPB, "BEND:LTUS:165:STDZIMAX NPP NMS") field(INPC, "BEND:LTUS:165:STDZIFINAL NPP NMS") field(INPD, "BEND:LTUS:165:STDZCYCLENUM NPP NMS") field(INPE, "BEND:LTUS:165:STDZDIRECT.RVAL NPP NMS") field(INPF, "BEND:LTUS:165:STDZDISABLE.RVAL CPP NMS") field(INPG, "BEND:LTUS:165: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, "BEND:LTUS:165:STDZWF PP") field(OUTB, "BEND:LTUS:165: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, "BEND:LTUS:165:STDZWF") } record(mbbo, "BEND:LTUS:165: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, "BEND:LTUS:165: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, "BEND:LTUS:165:STDZMAINPS") { field(DESC, "Stdz by main or self") field(PINI, "YES") field(DTYP, "Soft Channel") field(ZNAM, "SELF") field(ONAM, "MAIN") } record(bo, "BEND:LTUS:165: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, "BEND:LTUS:165: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, "BEND:LTUS:165: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, "BEND:LTUS:165:STDZTOD") { field(DESC, "Successful Standardize Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "BEND:LTUS:165:STDZLOSTTOD") { field(DESC, "Standardize Lost Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(longout, "BEND:LTUS:165:STDZCYCLECNT") { field(DESC, "Cycle Count") field(PINI, "YES") } record(longout, "BEND:LTUS:165: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, "BEND:LTUS:165:STDZDIRECT") } # The default standardize direction is "UP" for # all LCLS Magnets.. record(bo, "BEND:LTUS:165:STDZDIRECT") { field(DESC, "Standardize Direction ") field(ZNAM, "UP") field(ONAM, "DOWN") field(VAL, "0") field(FLNK, "BEND:LTUS:165:STDZIMIN") } record(ao, "BEND:LTUS:165:STDZIMIN") { field(DESC, "Min-STDZ Current") field(PREC, "1") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(VAL, "0.0") field(FLNK, "BEND:LTUS:165:STDZIMAX") } record(ao, "BEND:LTUS:165:STDZIMAX") { field(DESC, "Max. Standarize Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(VAL, "250.0") field(FLNK, "BEND:LTUS:165:STDZIFINAL") } record(ao, "BEND:LTUS:165:STDZIFINAL") { field(DESC, "Final SDTZ Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(VAL, "0.0") field(FLNK, "BEND:LTUS:165: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, "BEND:LTUS:165: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, "BEND:LTUS:165:STDZITOL") { field(DESC, "Stdz min tolerance") field(PREC, "5") field(CALC, "MAX(ABS(A),ABS(B))*C") field(INPA, "BEND:LTUS:165:STDZIMIN CP NMS") field(INPB, "BEND:LTUS:165:STDZIMAX CP MMS") field(INPC, "0.05") field(INPD, "BEND:LTUS:165:STDZITOLR CP MMS") field(EGU, "A") field(FLNK, "BEND:LTUS:165:IDELTAS") field(PINI, "YES") } # D - factor (3.154/2 = 1.577) for EPSC, otherwise, set to 1.0 record(calc, "BEND:LTUS:165:STDZDLY") { field(DESC, "Ramp time for stdz cycle") field(CALC, "C>0?MAX(1,ABS((A-B)/C)*D):0") field(INPA, "BEND:LTUS:165:STDZIMIN CP NMS") field(INPB, "BEND:LTUS:165:STDZIMAX CP NMS") field(INPC, "BEND:LTUS:165:TRIMRAMPRATE CP NMS") field(INPD, "1.0") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") } record(calc, "BEND:LTUS:165:STDZRAMPDLY") { field(DESC, "Ramp delay total") field(CALC, "MAX(1,((A/100)*B+B))") field(PREC, "5") field(INPA, "BEND:LTUS:165:TRIMDLYPCT CP MS") field(INPB, "BEND:LTUS:165: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, "BEND:LTUS:165:STDZMINIDLY") { field(DESC, "Mini-stdz delay") field(CALC, "A") field(PREC, "5") field(A, "1.0") field(EGU, "sec") field(PINI, "YES") } record(ao, "BEND:LTUS:165: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, "BEND:LTUS:165:STDZMINIDELTA") { field(DESC, "Stdz mini % of IMAX") field(CALC, "(B/100)*(A-C)") field(INPA, "BEND:LTUS:165:IDES.HOPR") field(INPB, "BEND:LTUS:165:STDZMINIPCT CPP NMS") field(INPC, "BEND:LTUS:165:IDES.LOPR") field(PREC, "5") } record(calc, "BEND:LTUS:165:STDZMINISETPT") { field(DESC, "Mini Stdz delta") field(CALC, "C==0?MAX(E-D,B):MIN(E+D,A)") field(INPA, "BEND:LTUS:165:IDES.HOPR") field(INPB, "BEND:LTUS:165:IDES.LOPR") field(INPC, "BEND:LTUS:165:STDZDIRECT.RVAL") field(INPD, "BEND:LTUS:165:STDZMINIDELTA") field(INPE, "BEND:LTUS:165:IDES") field(PREC, "5") field(FLNK, "BEND:LTUS:165: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, "BEND:LTUS:165:STDZMINISETPTOOR") { field(DESC, "Mini Stdz setpoint out of range") field(CALC, "C==0?(E-DA)") field(INPA, "BEND:LTUS:165:IDES.HOPR") field(INPB, "BEND:LTUS:165:IDES.LOPR") field(INPC, "BEND:LTUS:165:STDZDIRECT.RVAL") field(INPD, "BEND:LTUS:165:STDZMINIDELTA") field(INPE, "BEND:LTUS:165: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, "BEND:LTUS:165: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, "BEND:LTUS:165:IADJUST.RVAL") field(INPB, "BEND:LTUS:165:STDZDIRECT.RVAL") field(INPC, "BEND:LTUS:165:STDZOK.RVAL") field(INPD, "BEND:LTUS:165:STDZDISABLE.RVAL") field(INPE, "BEND:LTUS:165:STATE.RVAL CPP NMS") field(INPF, "BEND:LTUS:165:ICTRL.RVAL") field(INPG, "BEND:LTUS:165:STATE.SEVR") field(INPH, "BEND:LTUS:165:BDELTAS.M") field(INPI, "BEND:LTUS:165:IACT.SEVR") field(OUT, "BEND:LTUS:165:STDZLOSTGO.SELN PP NMS") field(OOPT, "Transition To Non-zero") } record(seq, "BEND:LTUS:165:STDZLOSTGO") { field(DESC, "Process lost stdz") field(SELM, "Mask") field(DOL1, "1") field(DOL2, "0") field(LNK1, "BEND:LTUS:165:STDZLOSTTOD.PROC") field(LNK2, "BEND:LTUS:165:STDZOK PP") } # Record maximum current after standardize # Reset to IACT from sequence after trim # Disable processing during (mini-)standardize or trim record(calc, "BEND:LTUS:165:STDZIACTMAX") { field(DESC, "Max act current after stdz") field(CALC, "MAX(A, B)") field(DISV, "0") field(SDIS, "BEND:LTUS:165:CHECKPWRDIP_ENABLE") field(INPA, "BEND:LTUS:165:IACT CP") field(INPB, "BEND:LTUS:165:STDZIACTMAX") field(EGU, "A") field(FLNK, "BEND:LTUS:165:CHECKPWRDIP") } # Detect power dip if STDZOK is YES, STDZ is enabled, and IACT is valid # If IACT drops below STDZIACTMAX by more than the trim tolerance, clear STDZOK # Warning: Take the absolute value of the trim tolerance, or else quads of # negative polarity will always lose STDZ since their IDELTAS.I are negative. # Note: Large quads and bends are prone to losing STDZ even if they are # perturbed toward higher current since their current tends to overshoot # by greater than the trim tolerance before settling down. record(calcout, "BEND:LTUS:165:CHECKPWRDIP") { field(DESC, "Detect power dip") field(CALC, "(A-B>ABS(C))?3:0") field(DISV, "0") field(SDIS, "BEND:LTUS:165:CHECKPWRDIP_ENABLE") field(INPA, "BEND:LTUS:165:STDZIACTMAX") field(INPB, "BEND:LTUS:165:IACT") field(INPC, "BEND:LTUS:165:IDELTAS.I") field(OUT, "BEND:LTUS:165:STDZLOSTGO.SELN PP NMS") field(OOPT, "When Non-zero") } # Enable processing of STDZIACTMAX and CHECKPWRDIP only if # STDZOK = YES, STDZDISABLE = NO, CTRL != Trim (2), and # CTRL != Stdz (4) record(calc, "BEND:LTUS:165:CHECKPWRDIP_ENABLE") { field(CALC, "A&&!B&&(C#2)&&(C#4)") field(INPA, "BEND:LTUS:165:STDZOK.RVAL CP") field(INPB, "BEND:LTUS:165:STDZDISABLE.RVAL CP") field(INPC, "BEND:LTUS:165:CTRL.RVAL CP") } #! 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, "BEND:LTUS:165: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, "BEND:LTUS:165: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, "BEND:LTUS:165:CALBSET") { field(DESC, "Use DAC Calbration") field(SCAN, "10 second") field(CALC, "A&&(B==0)&&C?31:960") field(INPA, "BEND:LTUS:165:CALBOK") field(INPB, "BEND:LTUS:165:CALBDISABLE") field(INPC, "BEND:LTUS:165:CALBSLOPE") field(OOPT, "On Change") field(OUT, "BEND:LTUS:165: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, "BEND:LTUS:165:CALB_SEQ") { field(DESC, "Output Calib Values") field(SELM, "Mask") field(SELL, "BEND:LTUS:165: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, "BEND:LTUS:165:CALBSLOPE") field(DOL3, "BEND:LTUS:165: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, "BEND:LTUS:165:CALBTOD") { field(DESC, "Calibration Success Time") field(PINI, "YES") # field(DOL, "") field(OMSL, "supervisory") field(DTYP, "Soft Channel") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:165: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, "BEND:LTUS:165: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, "BEND:LTUS:165: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, "BEND:LTUS:165:CALBOFFSET") { field(DESC, "Calc DAC Offset") field(PREC, "6") field(EGU, "Counts") field(PINI, "YES") } record(bo, "BEND:LTUS:165: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, "BEND:LTUS:165:DACSLOPE") { field(DESC, "V to DAC slope") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "supervisory") field(PINI, "YES") field(FLNK, "BEND:LTUS:165:DACOFFSET") } # Default Offset used in conversion from Volts to DAC Counts record(ao, "BEND:LTUS:165:DACOFFSET") { field(DESC, "V to DAC offset") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "supervisory") field(PINI, "YES") field(FLNK, "BEND:LTUS:165: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, "BEND:LTUS:165: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, "BEND:LTUS:165:IACT") field(INPD, "BEND:LTUS:165:DACSLOPE") field(INPE, "BEND:LTUS:165:DACOFFSET") field(EGU, "Counts") field(PREC, "6") } record(ao, "BEND:LTUS:165:DAC") { field(DESC, "DAC Set point") field(EGU, "Counts") field(DOL, "") field(OMSL, "supervisory") field(PREC, "6") field(PINI, "YES") } record(ao, "BEND:LTUS:165:CALBIMIN") { field(DESC, "Calibration Min Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(DRVH, "250.0") field(HOPR, "250.0") field(DRVL, "0.0") field(LOPR, "0.0") field(PREC, "3") field(EGU, "A") field(VAL, "0.0") field(FLNK, "BEND:LTUS:165:CALBIMAX") } record(ao, "BEND:LTUS:165:CALBIMAX") { field(DESC, "Calibration Max Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(DRVH, "250.0") field(HOPR, "250.0") field(LOPR, "0.0") field(DRVL, "0.0") field(EGU, "A") field(VAL, "250.0") field(FLNK, "BEND:LTUS:165:CALBSTEPNUM") } record(ao, "BEND:LTUS:165:CALBIFINAL") { field(DESC, "Calibration Last Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(PREC, "3") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(VAL, "0") } record(longout, "BEND:LTUS:165: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, "BEND:LTUS:165:CALBIDELTA") } record(calc, "BEND:LTUS:165:CALBIDELTA") { field(DESC, "Step size for CALB") field(CALC, "C=0?0:ABS((A-B)/C)") field(INPA, "BEND:LTUS:165:CALBIMAX") field(INPB, "BEND:LTUS:165:CALBIMIN") field(INPC, "BEND:LTUS:165: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, "BEND:LTUS:165:CALBIMULT") { field(DESC, "IACT vs ISETPT mult") field(CALC, "C#0||A=0?1:ABS(B/A)") field(INPA, "BEND:LTUS:166:ISETPT.DRVH") field(INPB, "BEND:LTUS:166:IACT.HOPR") field(INPC, "BEND:LTUS:165:PSCONTROLLER.RVAL CPP") field(EGU, "A") field(PINI, "YES") } # SNL dbputs DAC values here. 6-10 steps are possible. record(waveform, "BEND:LTUS:165:CALBICTRLWF") { field(DESC, "ICTRL setpoint array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") } record(waveform, "BEND:LTUS:165:DACWF") { field(DESC, "DAC count array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "BEND:LTUS:165:DACSA") } # Used only for xygraph edm plot record(subArray, "BEND:LTUS:165:DACSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "BEND:LTUS:165: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, "BEND:LTUS:165:CALCDACWF") { field(DESC, "Calc DAC counts array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "BEND:LTUS:165:CALCDACSA") } # Used only for xygraph edm plot record(subArray, "BEND:LTUS:165:CALCDACSA") { field(DESC, "Calc DAC counts") field(DTYP, "Soft Channel") field(INP, "BEND:LTUS:165: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, "BEND:LTUS:165:CALBYWF") { field(DESC, "mx + b") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "BEND:LTUS:165:CALBYSA") } # Used only for xygraph edm plot record(subArray, "BEND:LTUS:165:CALBYSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "BEND:LTUS:165:CALBYWF") field(MALM, "10") field(NELM, "6") field(INDX, "0") field(FTVL, "DOUBLE") } record(waveform, "BEND:LTUS:165:CALBIACTWF") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "BEND:LTUS:165:CALBIACTSA") } # Used only for xygraph edm plot record(subArray, "BEND:LTUS:165:CALBIACTSA") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(MALM, "10") field(NELM, "6") field(INP, "BEND:LTUS:165:CALBIACTWF") field(INDX, "0") field(FTVL, "DOUBLE") field(FLNK, "BEND:LTUS:165:CALBLIMITS") } # Check that measured current during calibration is within # tolerance. record(aSub, "BEND:LTUS:165: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, "BEND:LTUS:165:CALBSTEPNUM") field(INPB, "BEND:LTUS:165:CALBIACTWF") field(INPC, "BEND:LTUS:165: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, "BEND:LTUS:165: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, "BEND:LTUS:165:STDZITOL") field(INPH, "BEND:LTUS:165:DACSLOPE") field(INPI, "BEND:LTUS:165: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, "BEND:LTUS:165: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, "BEND:LTUS:165:CALBSTEPNUM") field(INPB, "BEND:LTUS:165:CALBIACTWF") field(INPC, "BEND:LTUS:165:DACWF") field(INPF, "BEND:LTUS:165: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 BEND:LTUS:165CALBOK 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, "BEND:LTUS:165:DEGAUSINIT") { field(DESC, "Proc. Degauss PVs on boot") field(PINI, "YES") field(DOL, "1") field(OUTA, "BEND:LTUS:165:DEGAUSIMIN.PROC PP") field(OUTB, "BEND:LTUS:165:DEGAUSIMAX.PROC PP") field(OUTC, "BEND:LTUS:165:DEGAUSTYPE.PROC PP") field(OUTD, "BEND:LTUS:165:DEGAUSSTEP.PROC PP") field(OUTE, "BEND:LTUS:165:MADNAME.PROC PP") field(OUTF, "BEND:LTUS:165:PSTYPE.PROC PP") field(OUTG, "BEND:LTUS:165: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, "BEND:LTUS:165:DEGAUSSUB") { field(DESC, "Degauss subroutine") field(INAM, "mgntDegaussInit") field(SNAM, "mgntDegauss") field(BRSV, "INVALID") field(INPA, "BEND:LTUS:165:DEGAUSIMIN NPP NMS") field(INPB, "BEND:LTUS:165:DEGAUSIMAX NPP NMS") field(INPC, "BEND:LTUS:165:DEGAUSTYPE.RVAL NPP NMS") field(INPE, "BEND:LTUS:165:DEGAUSMETHOD.RVAL NPP NMS") field(INPF, "BEND:LTUS:165:PSTYPE NPP NMS") field(INPG, "BEND:LTUS:165:DEBUG.RVAL NPP NMS") field(INPH, "BEND:LTUS:165: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, "BEND:LTUS:165:DEGAUSWF PP") field(OUTB, "BEND:LTUS:165:DEGAUSMSG PP") field(OUTC, "BEND:LTUS:165: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, "BEND:LTUS:165:DEGAUSWF") { field(DESC, "Degauss Setpts") field(NELM, "60") field(FTVL, "DOUBLE") } record(mbbo,"BEND:LTUS:165: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, "BEND:LTUS:165: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, "BEND:LTUS:165: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, "BEND:LTUS:165: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, "BEND:LTUS:165: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, "BEND:LTUS:165:DEGAUSIMIN") { field(DESC, "Min. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "250.0") field(LOPR, "-250.0") field(DRVH, "250.0") field(DRVL, "-250.0") field(VAL, "-250.0") } record(ao, "BEND:LTUS:165:DEGAUSIMAX") { field(DESC, "Max. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "250.0") field(LOPR, "-250.0") field(DRVH, "250.0") field(DRVL, "-250.0") field(VAL, "250.0") } # 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,"BEND:LTUS:165: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, "BEND:LTUS:165: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,"BEND:LTUS:165: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, "BEND:LTUS:165: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, "BEND:LTUS:165: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, "BEND:LTUS:165: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, "BEND:LTUS:165:DEGAUSTOD") { field(DESC, "Successful Degauss Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "BEND:LTUS:165:DEGAUSLOSTTOD") { field(DESC, "Degauss Lost Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:165:DEGAUSTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "BEND:LTUS:165:DEGAUSTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "BEND:LTUS:165: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, "BEND:LTUS:165:DEGAUSGO") { field(DESC, "Set bdes of btrms to zero") field(ASG, "Internal") field(OUTA, "") field(OUTB, "") field(OUTC, "") field(OUTD, "") } # =========== CRYO ONLY =========== record(bo, "BEND:LTUS:165: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, "BEND:LTUS:165:DEGAUS_IMAX_CHECK") { field(DESC, "Check if imax shoud chg") field(CALC, "(C==4)&&(ABS(B)>ABS(A))?1:0") field(INPA, "BEND:LTUS:165:DEGAUS_IMAX") field(INPB, "BEND:LTUS:165:ISETPT") field(INPC, "BEND:LTUS:165:DEGAUSTYPE.RVAL") field(OUT, "BEND:LTUS:165:DEGAUS_IMAX_UPDATE.SELN") field(FLNK, "BEND:LTUS:165:DEGAUS_IMAX_UPDATE") } record(seq, "BEND:LTUS:165:DEGAUS_IMAX_UPDATE") { field(DESC, "Degauss IMAX Update") field(SELM, "Specified") field(DOL1, "BEND:LTUS:165:ISETPT") field(LNK1, "BEND:LTUS:165:DEGAUS_IMAX PP") } # Set the maximum current after a successful # degauss. This pv is updated by the # sequence. record(ao, "BEND:LTUS:165:DEGAUS_IMAX") { field(DESC, "Max I set afer a degauss") field(EGU, "Amps") field(PINI, "YES") field(PREC, "6") field(HOPR, "250.0") field(LOPR, "-250.0") field(DRVH, "250.0") field(DRVL, "-250.0") field(VAL, "250.0") field(FLNK, "BEND:LTUS:165:DEGAUS_IMAXPOL_CHECK") info(autosaveFields,"VAL,RVAL") } # Set the polarity if degauss_imax record(calcout, "BEND:LTUS:165:DEGAUS_IMAXPOL_CHECK") { field(DESC, "Determine polarity of imax") field(CALC, "A>=0?0:1") field(INPA, "BEND:LTUS:165:DEGAUS_IMAX") field(FLNK, "BEND:LTUS:165:DEGAUS_IMAXPOL") } record(bo, "BEND:LTUS:165:DEGAUS_IMAXPOL") { field(DESC, "Polarity of imax I") field(DTYP, "Raw Soft Channel") field(DOL, "BEND:LTUS:165:DEGAUS_IMAXPOL_CHECK") field(OMSL, "closed_loop") field(ZNAM, "Positive") field(ONAM, "Negative") field(FLNK, "BEND:LTUS:165: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, "BEND:LTUS:165:DEGAUS_ABSIMAX") { field(DESC, "Absolute Max. Degauss I") field(CALC, "ABS(A)") field(INPA, "BEND:LTUS:165:DEGAUS_IMAX") field(PREC, "6") field(EGU, "Amps") field(HOPR, "250.0") field(LOPR, "-250.0") info(autosaveFields,"VAL RVAL") } # IACT Polarity record(calcout, "BEND:LTUS:165:IACTPOL_CHECK") { field(DESC, "Determine IACT polarity") field(SCAN, "5 second") field(CALC, "ABS(A-B)>C?(A>=0?0:1):D") field(INPA, "BEND:LTUS:165:IACT") field(INPB, "BEND:LTUS:165:IACTPOL_CHECK.LA") field(INPC, "0.0001") field(INPD, "BEND:LTUS:165:IACTPOL_CHECK.PVAL") field(OOPT, "On Change") field(FLNK, "BEND:LTUS:165:IACTPOL") } record(bo, "BEND:LTUS:165: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,"BEND:LTUS:165: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, "BEND:LTUS:165:DEGAUSENABLE CP") field(INPB, "BEND:LTUS:165:DEGAUSOK") field(INPC, "BEND:LTUS:165:STATE CP") field(INPD, "BEND:LTUS:165:STATE.SEVR") field(OUT, "BEND:LTUS:165:DEGAUS_STATE_SEQ.SELN PP") field(ASG, "Internal") } record(seq, "BEND:LTUS:165:DEGAUS_STATE_SEQ") { field(DESC, "Degauss State Sequence") field(SELM, "Specified") field(SELL, "BEND:LTUS:165:DEGAUS_STATE_CHECK") field(LNK1, "BEND:LTUS:165:DEGAUS_STATE_DISABLE.PROC PP") field(LNK2, "BEND:LTUS:165:DEGAUS_STATE_LOST.PROC PP") field(LNK3, "BEND:LTUS:165:DEGAUS_STATE_GOOD.PROC PP") field(LNK4, "BEND:LTUS:165: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, "BEND:LTUS:165:DEGAUS_STATE_DISABLE") { field(DESC, "Degauss not used") field(LNK1, "BEND:LTUS:165:DEGAUSOK.ZSV") field(LNK2, "BEND:LTUS:165: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, "BEND:LTUS:165:STATMSG.FRSV") field(LNK4, "BEND:LTUS:165: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, "BEND:LTUS:165:DEGAUS_STATE_LOST") { field(DESC, "Degauss lost and ps On") field(DOL1, "1") field(LNK1, "BEND:LTUS:165:DEGAUSOK.ZSV") field(LNK2, "BEND:LTUS:165: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, "BEND:LTUS:165:STATMSG.FRSV") field(LNK4, "BEND:LTUS:165: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, "BEND:LTUS:165:DEGAUS_STATE_OFF") { field(DESC, "Degaused lost and ps Off") field(DOL1, "2") field(LNK1, "BEND:LTUS:165: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, "BEND:LTUS:165:STATMSG.FRSV") field(LNK3, "BEND:LTUS:165: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, "BEND:LTUS:165:DEGAUS_STATE_GOOD") { field(DESC, "Degauss good") field(DOL1, "1") field(LNK1, "BEND:LTUS:165: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, "BEND:LTUS:165:STATMSG.FRSV PP") field(LNK3, "BEND:LTUS:165:STATMSG.FVSV PP") field(LNK4, "") field(ASG, "Internal") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(mbbo, "BEND:LTUS:165:FUNC") { field(DESC, "BEND:LTUS:165 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, "0") field(FFVL, "0") field(OUT, "BEND:LTUS:165:CTRL CA") } # :CTRL pv is processed at boot in the # sequence mgntCtrl.st Processed in sequence # record(mbbo, "BEND:LTUS:165:CTRL") { field(DESC, "BEND:LTUS:165 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, "BEND:LTUS:165:SELECTEN.A PP") field(SDIS, "0") } # If a function has been selected set this unit to busy record(calcout, "BEND:LTUS:165:SELECTEN") { field(DESC, "Control Select Enable") field(CALC, "A>0?1:A") field(FLNK, "BEND:LTUS:165:BUSY") } # Set to FREE on IOC reboot record(bo, "BEND:LTUS:165:BUSY") { field(DESC, "BEND:LTUS:165 Ctrl Done") field(DOL, "BEND:LTUS:165:SELECTEN") field(ZNAM, "FREE") field(ONAM, "BUSY") field(PINI, "YES") field(FLNK, "BEND:LTUS:165:SELECT") } record(bo, "BEND:LTUS:165:SELECT") { field(ZNAM, "NO") field(ONAM, "YES") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") } record(bo, "BEND:LTUS:165: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, "BEND:LTUS:165:CTRLSTATE") { field(DESC, "BEND:LTUS:165 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("BEND:LTUS:165:CTRL",20,20,0,0,"BEND:LTUS:165:CTRL") #! Field("BEND:LTUS:165:CTRL.OUT",16777215,1,"BEND:LTUS:165:CTRL.OUT") #! Link("BEND:LTUS:165:CTRL.OUT","BEND:LTUS:165:SELECTEN.A") #! Field("BEND:LTUS:165:CTRL.VAL",16777215,1,"BEND:LTUS:165:CTRL.VAL") #! Record("BEND:LTUS:165:SELECTEN",321,381,0,0,"BEND:LTUS:165:SELECTEN") #! Field("BEND:LTUS:165:SELECTEN.A",16777215,0,"BEND:LTUS:165:SELECTEN.A") #! Field("BEND:LTUS:165:SELECTEN.FLNK",16777215,1,"BEND:LTUS:165:SELECTEN.FLNK") #! Link("BEND:LTUS:165:SELECTEN.FLNK","BEND:LTUS:165:BUSY") #! Field("BEND:LTUS:165:SELECTEN.VAL",16777215,1,"BEND:LTUS:165:SELECTEN.VAL") #! Record("BEND:LTUS:165:BUSY",623,274,0,0,"BEND:LTUS:165:BUSY") #! Field("BEND:LTUS:165:BUSY.DOL",16777215,0,"BEND:LTUS:165:BUSY.DOL") #! Link("BEND:LTUS:165:BUSY.DOL","BEND:LTUS:165:SELECTEN.VAL") #! Field("BEND:LTUS:165:BUSY.FLNK",16777215,1,"BEND:LTUS:165:BUSY.FLNK") #! Link("BEND:LTUS:165:BUSY.FLNK","BEND:LTUS:165:SELECT") #! Record("BEND:LTUS:165:SELECT",669,508,0,1,"BEND:LTUS:165:SELECT") #! Record("BEND:LTUS:165:FUNC",940,120,0,0,"BEND:LTUS:165:FUNC") #! Field("BEND:LTUS:165:FUNC.OUT",16777215,0,"BEND:LTUS:165:FUNC.OUT") #! Link("BEND:LTUS:165:FUNC.OUT","BEND:LTUS:165:CTRL.VAL") #! Record("BEND:LTUS:165:ABORT",193,41,0,0,"BEND:LTUS:165:ABORT") #! Record("BEND:LTUS:165:CTRLSTATE",369,34,0,0,"BEND:LTUS:165: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,"BEND:LTUS:165:SELECT is used for Multi-device selection.\nIt is enabled when associated BEND:LTUS:165:CTRL is \"0\" (DONE).\nIt is disabled when associated BEND:LTUS:165: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,"BEND:LTUS:165: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, "BEND:LTUS:165:BCTRL_INIT") { field(DESC, "Process BCTRL on boot") field(PINI, "YES") field(CALC, "A=3?1:0") field(INPA, "BEND:LTUS:165:BCTRL.SEVR") field(OUT, "BEND:LTUS:165: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, "BEND:LTUS:165:BACT") { field(DESC, "Actual B") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "BEND:LTUS:165:BACT") field(INPB, "BEND:LTUS:165:POLYCOEF") field(INPC, "BEND:LTUS:165:POLYCOEF.A") field(INPD, "BEND:LTUS:165:POLYCOEF.B") field(INPE, "BEND:LTUS:165:IACTCALC MS") field(INPF, "BEND:LTUS:165:BDELTAS PP") field(INPG, "100") field(EGU, "kG-m") field(HOPR, "4.5216") field(LOPR, "0.0128") field(HIHI, "4.5216") field(LOLO, "0.0128") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "4.5216") field(LOW, "0.0128") field(FLNK, "BEND:LTUS:165: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, "BEND:LTUS:165:BDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntPhyDeltas") field(EGU, "kG-m") field(HOPR, "1") field(PREC, "7") field(BRSV, "INVALID") field(INPA, "BEND:LTUS:165:BDES") field(INPB, "BEND:LTUS:165:TRIMBTOL") field(INPC, "BEND:LTUS:165:TRIMBTOLR") field(INPD, "BEND:LTUS:165:CHCKBTOL") field(INPE, "BEND:LTUS:165:CHCKBTOLR") field(F, "2.0") field(INPG, "30") field(INPH, "BEND:LTUS:165:BACT.VAL") # # MPS absolute and relative tolerances field(INPP, "BEND:LTUS:165:MPSBTOL") field(INPQ, "BEND:LTUS:165:MPSBTOLR") field(FLNK, "BEND:LTUS:165:BCONLIMITS") info(autosaveFields,"F") } # This record is processed by BDELTAS record(aSub, "BEND:LTUS:165:BCONLIMITS") { field(DESC, "Config B-field Limits") field(INAM, "mgntInit") field(SNAM, "mgntBCONLimits") field(INPA, "BEND:LTUS:165:BDES") field(INPB, "BEND:LTUS:165:BDELTAS.I") field(INPG, "BEND:LTUS:165:DEBUG.RVAL") field(FTA, "DOUBLE") field(FTB, "DOUBLE") field(FTG, "ULONG") field(OUTA, "BEND:LTUS:165:BCON.HIGH") field(OUTB, "BEND:LTUS:165:BCON.LOW") field(OUTC, "BEND:LTUS:165:BCON.HIHI") field(OUTD, "BEND:LTUS:165:BCON.LOLO PP") field(FTVA, "DOUBLE") field(FTVB, "DOUBLE") field(FTVC, "DOUBLE") field(FTVD, "DOUBLE") field(BRSV, "INVALID") field(FLNK, "BEND:LTUS:165:IDELTAS") } # The following PV is processed by :BACT # which is processed by :BACT # record(fanout, "BEND:LTUS:165:BACTFO") { field(DESC, "BACT processing") field(SELM, "All") field(LNK1, "BEND:LTUS:165:BDIFF") field(LNK2, "BEND:LTUS:165:BADIFF") field(LNK3, "BEND:LTUS:165:BRATIO") field(LNK4, "BEND:LTUS:165:MPSLIMITS") field(LNK5, "BEND:LTUS:165:I2BSTATUS") field(LNK6, "BEND:LTUS:165:IACTFO.PROC") } record(calc, "BEND:LTUS:165:BDIFF") { field(DESC, "BDES-BACT") field(CALC, "A-B") field(INPA, "BEND:LTUS:165:BDES") field(INPB, "BEND:LTUS:165:BACT") field(EGU, "kG-m") field(PREC, "7") } record(calc, "BEND:LTUS:165:BADIFF") { field(DESC, "Absolute BDES-BACT") field(INPA, "BEND:LTUS:165:BDIFF") field(EGU, "kG-m") field(PREC, "7") field(CALC, "A<0?ABS(A):A") } record(calc, "BEND:LTUS:165:BRATIO") { field(DESC, "BACT Error") field(CALC, "B?A/B:0") field(INPA, "BEND:LTUS:165:BDIFF") field(INPB, "BEND:LTUS:165:BDES.HOPR") field(EGU, "kG-m") field(PREC, "7") } record(mbbi, "BEND:LTUS:165: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, "BEND:LTUS:165:BACT.J") } # Note: for a string slave set the MONFL # macro to the following: # MONFL=:IMONCALC MS record(sub, "BEND:LTUS:165:BMON") { field(DESC, "Second Transductor") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "BEND:LTUS:165:BMON") field(INPB, "BEND:LTUS:165:POLYCOEF") field(INPC, "BEND:LTUS:165:POLYCOEF.A") field(INPD, "BEND:LTUS:165:POLYCOEF.B") field(INPE, "BEND:LTUS:165:IMONCALC MS") field(INPF, "BEND:LTUS:165:BDELTAS.VAL") field(INPG, "100") field(EGU, "kG-m") field(HOPR, "4.5216") field(LOPR, "0.0128") field(HIHI, "4.5216") field(LOLO, "0.0128") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "4.5216") field(LOW, "0.0128") } # 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=BEND:LTUS:166:BDES CP record(ao, "BEND:LTUS:165:BDES") { field(DESC, "Desired B-Field") field(PINI, "NO") field(DRVH, "4.5216") field(DRVL, "0.0128") field(HOPR, "4.5216") field(LOPR, "0.0128") field(PREC, "7") field(EGU, "kG-m") field(MDEL, "-1") field(OMSL, "closed_loop") field(DOL, "BEND:LTUS:165:IDES2BDES") field(OUT, "BEND:LTUS:165:B2IDES PP") info(autosaveFields,"VAL") } record(sub, "BEND:LTUS:165:B2IDES") { field(DESC, "Convert Desired B-Field to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "BEND:LTUS:165:POLYCOEF") field(INPC, "BEND:LTUS:165:POLYCOEF.A") field(INPD, "BEND:LTUS:165:POLYCOEF.B") field(PREC, "7") field(EGU, "kG-m") field(HOPR, "4.5216") field(LOPR, "0.0128") field(MDEL, "-1") field(INPE, "BEND:LTUS:165:BDES.DRVH") field(INPF, "BEND:LTUS:165:BDES.DRVL") field(BRSV, "INVALID") field(FLNK, "BEND:LTUS:165:IDES") } record(sub, "BEND:LTUS:165:BNOM") { field(DESC, "Nominal Field") field(PINI, "YES") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "BEND:LTUS:165:POLYCOEF") field(INPC, "BEND:LTUS:165:POLYCOEF.A") field(INPD, "BEND:LTUS:165:POLYCOEF.B") field(INPE, "BEND:LTUS:165:BDES.DRVH") field(INPF, "BEND:LTUS:165:BDES.DRVL") field(EGU, "kG-m") field(HOPR, "4.5216") field(LOPR, "0.0128") field(PREC, "7") field(VAL, "0.0") field(FLNK, "BEND:LTUS:165:INOM") } record(sub, "BEND:LTUS:165:BACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "BEND:LTUS:165:BDES.VAL") field(INPB, "BEND:LTUS:165:BDES.DRVH") field(INPC, "BEND:LTUS:165:BDES.DRVL") field(INPD, "BEND:LTUS:165:BDELTAS.I") field(INPE, "BEND:LTUS:165:BDELTAS.J") field(INPG, "BEND:LTUS:165:STATE") field(INPH, "BEND:LTUS:165:HSTA") field(EGU, "kG-m") field(HOPR, "4.5216") field(LOPR, "0.0128") field(PREC, "7") field(BRSV, "INVALID") } record(sub, "BEND:LTUS:165:BMONLIMITS") { field(DESC, "MON Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "BEND:LTUS:165:BDES.VAL") field(INPB, "BEND:LTUS:165:BDES.DRVH") field(INPC, "BEND:LTUS:165:BDES.DRVL") field(INPD, "BEND:LTUS:165:BDELTAS.K") field(INPE, "BEND:LTUS:165:BDELTAS.L") field(INPG, "BEND:LTUS:165:STATE") field(INPH, "BEND:LTUS:165:HSTA") field(EGU, "kG-m") field(HOPR, "4.5216") field(LOPR, "0.0128") field(PREC, "7") field(BRSV, "INVALID") } record(seq, "BEND:LTUS:165:BLIMITS") { field(DESC, "ACT Limits") field(PREC, "7") field(DOL1, "BEND:LTUS:165:BLIMITS") field(LNK1, "BEND:LTUS:165:BACTLIMITS.F PP") field(DOL2, "BEND:LTUS:165:BACTLIMITS.I") field(LNK2, "BEND:LTUS:165:BACT.HIGH") field(DOL3, "BEND:LTUS:165:BACTLIMITS.J") field(LNK3, "BEND:LTUS:165:BACT.LOW") field(DOL4, "BEND:LTUS:165:BACTLIMITS.K") field(LNK4, "BEND:LTUS:165:BACT.HIHI") field(DOL5, "BEND:LTUS:165:BACTLIMITS.L") field(LNK5, "BEND:LTUS:165:BACT.LOLO") field(DOL6, "BEND:LTUS:165:BLIMITS") field(LNK6, "BEND:LTUS:165:BMONLIMITS.F PP") field(DOL7, "BEND:LTUS:165:BMONLIMITS.I") field(LNK7, "BEND:LTUS:165:BMON.HIGH") field(DOL8, "BEND:LTUS:165:BMONLIMITS.J") field(LNK8, "BEND:LTUS:165:BMON.LOW") field(DOL9, "BEND:LTUS:165:BMONLIMITS.K") field(LNK9, "BEND:LTUS:165:BMON.HIHI") field(DOLA, "BEND:LTUS:165:BMONLIMITS.L") field(LNKA, "BEND:LTUS:165:BMON.LOLO") field(FLNK, "BEND:LTUS:165:ILIMITS") field(SCAN, "5 second") } record(ao, "BEND:LTUS:165:BCTRL") { field(DESC, "B-Perturb") field(PREC, "7") field(EGU, "kG-m") field(DRVH, "4.5216") field(DRVL, "0.0128") field(HOPR, "4.5216") field(LOPR, "0.0128") # 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, "BEND:LTUS:165: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, "BEND:LTUS:165:BCTRLGO") { field(DESC, "Update DES and perturb") field(PREC, "7") # Disable BACT limits field(DOL1, "1") field(LNK1, "BEND:LTUS:165:BLIMITS.VAL") # Update BDES with the BCTRL (slider) value field(DOL2, "BEND:LTUS:165:BCTRL.VAL") field(LNK2, "BEND:LTUS:165:BDES PP") field(DOL3, "1") field(LNK3, "BEND:LTUS:165:IDIRECT.PROC PP") field(DOL4, "1") field(LNK4, "BEND:LTUS:165:CHECKSTDZLOST.PROC PP") field(DOL5, "BEND:LTUS:165:BCTRL.VAL") field(LNK5, "BEND:LTUS:165:BCTRLSUB PP") # Re-enable BACT limits field(DOL6, "0") field(LNK6, "BEND:LTUS:165:BLIMITS.VAL") } # Convert B-field to Current and output to ISETPT record(sub, "BEND:LTUS:165:BCTRLSUB") { field(DESC, "Feedback") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "BEND:LTUS:165:POLYCOEF") field(INPC, "BEND:LTUS:165:POLYCOEF.A") field(INPD, "BEND:LTUS:165:POLYCOEF.B") field(INPE, "BEND:LTUS:165:BDES.DRVH") field(INPF, "BEND:LTUS:165:BDES.DRVL") field(PREC, "7") field(EGU, "kG-m") field(HOPR, "4.5216") field(LOPR, "0.0128") field(MDEL, "-1") field(BRSV, "INVALID") field(FLNK, "BEND:LTUS:165:ISETPT") } record(ao, "BEND:LTUS:165:BDESPREVTRIM") { field(DESC, "trim bdes for undo") field(DTYP, "Soft Channel") field(DRVH, "4.5216") field(DRVL, "0.0128") field(EGU, "kG-m") field(HOPR, "4.5216") field(LOPR, "0.0128") field(PREC, "7") field(PINI, "YES") info(autosaveFields,"VAL") } record(stringin, "BEND:LTUS:165:MADNAME") { field(DESC, "MAD deck nomenclature") field(PINI, "YES") field(VAL, "BCX31B1") } record(ai, "BEND:LTUS:165: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, "3245.24204") } record(ao, "BEND:LTUS:165:BMAX") { field(DESC, "Max B-Field") field(DTYP, "Soft Channel") field(DRVH, "4.5216") field(DRVL, "0.0128") field(EGU, "kG-m") field(HOPR, "4.5216") field(LOPR, "0.0128") field(PREC, "7") field(PINI, "YES") field(VAL, "4.5216") field(FLNK, "BEND:LTUS:165:BSTEP") } record(ao, "BEND:LTUS:165:BMIN") { field(DESC, "Min B-Field") field(DTYP, "Soft Channel") field(DRVH, "4.5216") field(DRVL, "0.0128") field(EGU, "kG-m") field(HOPR, "4.5216") field(LOPR, "0.0128") field(PREC, "7") field(PINI, "YES") field(VAL, "0.0128") field(FLNK, "BEND:LTUS:165:BSTEP") } record(ao, "BEND:LTUS:165:BDESSAVE") { field(DESC, "bdes for save/load") field(DTYP, "Soft Channel") field(DRVH, "4.5216") field(DRVL, "0.0128") field(EGU, "kG-m") field(HOPR, "4.5216") field(LOPR, "0.0128") field(PINI, "YES") field(PREC, "7") } # This record is processed by BEND:LTUS:165: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, "BEND:LTUS:165:BCON") { field(DESC, "Config B-Field ") field(DTYP, "Soft Channel") field(PREC, "7") field(EGU, "kG-m") field(HOPR, "4.5216") field(LOPR, "0.0128") field(DRVH, "4.5216") field(DRVL, "0.0128") # 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 , "BEND:LTUS:165:ICON2BCON") field(OMSL, "closed_loop") field(OUT, "BEND:LTUS:165:B2ICON PP") info(autosaveFields,"VAL") } record(sub, "BEND:LTUS:165:B2ICON") { field(DESC, "Convert Desired ICon to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "BEND:LTUS:165:POLYCOEF") field(INPC, "BEND:LTUS:165:POLYCOEF.A") field(INPD, "BEND:LTUS:165:POLYCOEF.B") field(PREC, "7") field(EGU, "kG-m") field(HOPR, "4.5216") field(LOPR, "0.0128") field(MDEL, "-1") field(INPE, "BEND:LTUS:165:BCON.DRVH") field(INPF, "BEND:LTUS:165:BCON.DRVL") field(BRSV, "INVALID") field(FLNK, "BEND:LTUS:165: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, "BEND:LTUS:165:BSTEP") { field(DESC, "B-Field step size") field(CALC, "(C==3)||(D==3)?0:ABS(A-B)*0.005") field(INPA, "BEND:LTUS:165:BMAX") field(INPB, "BEND:LTUS:165:BMIN") field(INPC, "BEND:LTUS:165:BMIN.SEVR") field(INPD, "BEND:LTUS:165:BMAX.SEVR") field(EGU, "kG-m") 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,"BEND:LTUS:165:BCTRLDISABLECALC") { field(DESC, "Calc for disabling BCTRL") field(ASG, "Internal") field(CALC, "A?2:1") field(INPA, "BEND:LTUS:165:ONLINE CP") field(OUT, "BEND:LTUS:165:BCTRLDISABLEFOUT PP") } record(fanout, "BEND:LTUS:165:BCTRLDISABLEFOUT") { field(DESC, "Disable BCTRL fanout") field(SELM, "Specified") field(SELL, "BEND:LTUS:165:BCTRLDISABLECALC") field(LNK1, "BEND:LTUS:165:BCTRLDISABLE") field(LNK2, "BEND:LTUS:165:BCTRLENABLE") } record(stringout, "BEND:LTUS:165:BCTRLDISABLE") { field(DESC, "Disable BCTRL") field(DTYP, "Soft Channel") field(OUT, "BEND:LTUS:165:BCTRL.ASG") field(VAL, "NOWRITE") field(FLNK, "BEND:LTUS:165:BCTRLDISV_UPDATE") } record(stringout, "BEND:LTUS:165:BCTRLENABLE") { field(DESC, "Enable BCTRL") field(DTYP, "Soft Channel") field(OUT, "BEND:LTUS:165:BCTRL.ASG") field(VAL, "") field(FLNK, "BEND:LTUS:165:BCTRLDISV_UPDATE") } record(calcout, "BEND:LTUS:165:BCTRLDISV_UPDATE") { field(DESC, "Calc for updating BCTRL.DISV") field(ASG, "Internal") field(CALC, "A") field(INPA, "BEND:LTUS:165:ONLINE") field(OUT, "BEND:LTUS:165: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,"BEND:LTUS:165:BACT and MON\n are processed via links from \n BEND:LTUS:165:IACT (device raw value readback 1)\n and\n BEND:LTUS:165: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 BEND:LTUS:165:POLYCOEF\nC = First polynomial coefficient (offset if linear)\nD = Second polynomial coefficient (slope if linear)\nE = BEND:LTUS:165: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,"BEND:LTUS:165:BDES\n is processed when set by CA users or \n BEND:LTUS:165: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,"BEND:LTUS:165: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 BEND:LTUS:165: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 (BEND:LTUS:165: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,"BEND:LTUS:165:B*LIMITS and BEND:LTUS:165:BLIMITS:\n Calculate alarm and warning limits based on \n deltas from BEND:LTUS:165: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,"BEND:LTUS:165: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,"BEND:LTUS:165: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, "BEND:LTUS:165: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, "BEND:LTUS:165:MPSBTOL") { field(DESC, "Absolute mps tol") field(EGU, "kG-m") field(PREC, "2") field(CALC, "ABS(A)*0.02") field(INPA, "BEND:LTUS:165:BMAX") field(PINI, "YES") } # # 21-Aug-2013: K. Luchini # Set channel access security so that users # cannot easily change values. record(ao, "BEND:LTUS:165:MPSBMAX") { field(DESC, "MPS Max B-field") field(EGU, "kG-m") field(PREC, "7") field(DRVH, "4.5216") field(DRVL, "0.0128") field(PINI, "YES") field(VAL, "4.5216") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:165:MPSBMIN") { field(DESC, "MPS Min B-field") field(EGU, "kG-m") field(PREC, "7") field(DRVH, "4.5216") field(DRVL, "0.0128") field(PINI, "YES") field(VAL, "0.0128") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:165:MPSBLLIM") { field(DESC, "MPS Low Limit B-field") field(EGU, "kG-m") field(PREC, "7") field(DRVH, "4.5216") field(DRVL, "0.0128") field(PINI, "YES") field(VAL, "0.0128") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:165:MPSBLLIM2") { field(DESC, "MPS Low Limit #2 B-field") field(EGU, "kG-m") field(PREC, "7") field(DRVH, "4.5216") field(DRVL, "0.0128") field(PINI, "YES") field(VAL, "0.0128") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } # Set the default to Std record(mbbo, "BEND:LTUS:165: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, "BEND:LTUS:165:MPSLIMITS.E PP") } record(aSub, "BEND:LTUS:165: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, "BEND:LTUS:165:MPS.RVAL") field(INPB, "BEND:LTUS:165:BADIFF") field(INPC, "BEND:LTUS:165:BDELTAS.N") field(INPD, "BEND:LTUS:165:BACT") field(INPE, "BEND:LTUS:165:MPSBITMASK.RVAL") field(INPF, "BEND:LTUS:165:MPSBLLIM") field(INPG, "BEND:LTUS:165:MPSBMIN") field(INPH, "BEND:LTUS:165:MPSBMAX") field(INPI, "BEND:LTUS:165: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, "BEND:LTUS:165:INTOL.RVAL PP") field(OUTB, "BEND:LTUS:165:INTOL_BMIN.RVAL PP") field(OUTC, "BEND:LTUS:165:INTOL_BRANGE.RVAL PP") field(OUTD, "BEND:LTUS:165: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, "BEND:LTUS:165:INTOL") { field(DESC, "BACT within MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "BEND:LTUS:165:MPSLIMITS.VALA") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "BEND:LTUS:165:INTOL_BMIN") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "BEND:LTUS:165:MPSLIMITS.VALB") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "BEND:LTUS:165:INTOL_BMIN2") { field(DESC, "MPS tol #2") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "BEND:LTUS:165:MPSLIMITS.VALD") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "BEND:LTUS:165:INTOL_BRANGE") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "BEND:LTUS:165: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, "BEND:LTUS:165:CHCKITOL") { field(DESC, "Absolute Check I Tolerance") field(EGU, "A") field(FLNK, "BEND:LTUS:165:TRIMITOL") field(CALC, "ABS(A*B)") field(INPA, "BEND:LTUS:165:CHCKBTOL") field(INPB, "BEND:LTUS:165:POLYCOEF.B") field(PREC, "9") } record(calc, "BEND:LTUS:165:TRIMBTOL") { field(EGU, "kG-m") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(DESC, "Absolute Trim Tolerance") field(CALC, "ABS(A)/2") field(INPA, "BEND:LTUS:165:CHCKBTOL") field(FLNK, "BEND:LTUS:165:CHCKITOL") } record(calc, "BEND:LTUS:165:CHCKBTOL") { field(DESC, "Check absolute tolerance") field(EGU, "A") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(FLNK, "BEND:LTUS:165:TRIMBTOL") field(CALC, "MAX(ABS(A),ABS(C))*(B/1000000)") field(INPA, "BEND:LTUS:165:BDES.HOPR") field(INPB, "BEND:LTUS:165:STABILITY") field(INPC, "BEND:LTUS:165:BDES.LOPR") } record(longout, "BEND:LTUS:165: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, "BEND:LTUS:165:CHCKBTOL") } record(calc, "BEND:LTUS:165:TRIMITOL") { field(DESC, "Absolute Trim I Tolerance") field(EGU, "kG-m") field(CALC, "ABS(A*B)") field(INPA, "BEND:LTUS:165:POLYCOEF.B") field(INPB, "BEND:LTUS:165:TRIMBTOL") field(PREC, "9") } record(ai, "BEND:LTUS:165:TRIMBTOLR") { field(DESC, "Relative trim tol") field(PREC, "4") field(EGU, "%") field(HOPR, "1.0") field(LOPR, "0.0") field(PINI, "YES") } record(ai, "BEND:LTUS:165: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, "BEND:LTUS:165:FBCKFCOM") { field(ZNAM, "CA") field(ONAM, "FCOM") field(DESC, "CA Mode") field(PINI, "YES") field(SDIS, "0") } record(bo, "BEND:LTUS:165:PAU") { field(ZNAM, "NotConfigured") field(ONAM, "Configured") field(DESC, "PAU Present") field(PINI, "YES") field(SDIS, "0") field(FLNK, "BEND:LTUS:165:PAUGO") } record(fanout, "BEND:LTUS:165:PAUGO") { field(DESC, "PAU control") field(LNK1, "BEND:LTUS:165:PAUSTOP") field(LNK2, "BEND:LTUS:165: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, "BEND:LTUS:165:PAUSTART") { field(DESC, "Setup for PAU On") field(SDIS, "BEND:LTUS:165: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, "BEND:LTUS:165:PAUSTOP") { field(DESC, "Setup for PAU Off") field(SDIS, "BEND:LTUS:165: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, "BEND:LTUS:165:MCORDEVNAME") { field(DESC, "PS device name") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, "BEND:LTUS:166:") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "BEND:LTUS:165: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, "BEND:LTUS:165:PSTYPE.RVAL") field(INPC, "BEND:LTUS:165:TURNEDOFF.RVAL") field(INPD, "BEND:LTUS:165:CONFIG.RVAL") field(INPE, "BEND:LTUS:165:PSCATEGORY.RVAL") field(INPF, "BEND:LTUS:165:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "BEND:LTUS:165:AUTOCTRL.RVAL") field(INPJ, "BEND:LTUS:165:OUTOFSERVICE.RVAL") field(INPL, "BEND:LTUS:165:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "BEND:LTUS:165:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "BEND:LTUS:165:PAU") field(INPP, "BEND:LTUS:165:CALBDISABLE.RVAL") field(INPQ, "BEND:LTUS:165:PTRBDISABLE.RVAL") field(INPR, "BEND:LTUS:165:TRIMDISABLE.RVAL") field(INPS, "BEND:LTUS:165:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "BEND:LTUS:165:FBCK") field(INPU, "BEND:LTUS:165:TRIMTYPE.RVAL") field(INPV, "BEND:LTUS:165:STDZDIRECT.RVAL") field(INPW, "BEND:LTUS:165:DEGAUSENABLE.RVAL") field(FLNK, "BEND:LTUS:165:HSTA") } record(longin, "BEND:LTUS:165:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "BEND:LTUS:165:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "BEND:LTUS:165: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, "BEND:LTUS:165: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, "BEND:LTUS:165: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, "BEND:LTUS:165: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, "BEND:LTUS:165: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, "BEND:LTUS:165: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 BEND:LTUS:165:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses BEND:LTUS:165:FBCK. # This PV should be replaced by BEND:LTUS:165: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, "BEND:LTUS:165: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, "BEND:LTUS:165: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, "BEND:LTUS:165: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, "BEND:LTUS:166:OUTOFSERVICE CPP NMS") field(OMSL, "closed_loop") field(FLNK, "BEND:LTUS:165:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"BEND:LTUS:165:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "BEND:LTUS:165:OUTOFSERVICE NPP NMS") field(OUT, "BEND:LTUS:165:ONLINE PP") } record(bo, "BEND:LTUS:165:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "BEND:LTUS:165: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, "BEND:LTUS:165: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, "BEND:LTUS:165: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, "BEND:LTUS:165: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, "BEND:LTUS:165: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, "BEND:LTUS:165: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, "BEND:LTUS:165: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, "BEND:LTUS:165: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, "BEND:LTUS:165: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, "BEND:LTUS:165: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, "BEND:LTUS:165: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, "BEND:LTUS:165:TRIMTYPE") } record(stringout, "BEND:LTUS:165:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "BEND:LTUS:166:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "BEND:LTUS:165:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "BEND:LTUS:165:STATE.RVAL") field(INPB, "BEND:LTUS:165:INTLKSUMY.RVAL") field(OUT, "BEND:LTUS:165:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "BEND:LTUS:165: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, "BEND:LTUS:165:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "BEND:LTUS:165:STATE.RVAL") field(INPB, "BEND:LTUS:165:INTLKSUMY.RVAL") field(OUT, "BEND:LTUS:165:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "BEND:LTUS:165:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "BEND:LTUS:165:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "BEND:LTUS:165: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, "BEND:LTUS:165: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, "BEND:LTUS:165: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, "BEND:LTUS:165: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,"BEND:LTUS:165: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("BEND:LTUS:165:TURNEDOFF",3140,1907,0,1,"BEND:LTUS:165:TURNEDOFF") #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "BEND:LTUS:165:STATSUB") { field(DESC, "Build STATus ") field(INAM, "mgntInit") field(SNAM, "mgntSlcStat") field(INPA, "BEND:LTUS:165:BACT.STAT") field(INPB, "BEND:LTUS:165:BDES.STAT") field(INPC, "BEND:LTUS:165: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, "BEND:LTUS:165:BACT.SEVR") field(INPH, "BEND:LTUS:165:BDES.SEVR") field(INPI, "BEND:LTUS:165: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, "BEND:LTUS:165:STATE.RVAL") field(INPN, "BEND:LTUS:165:STDZOK") field(INPO, "BEND:LTUS:165:CALBOK") field(INPP, "BEND:LTUS:165:OUTOFSERVICE.RVAL") field(INPQ, "BEND:LTUS:165:CONFIG.RVAL") field(INPR, "BEND:LTUS:165:HSTA") field(INPS, "BEND:LTUS:165:CTRL.RVAL") field(INPT, "BEND:LTUS:165:DEGAUSOK") field(INPV, "BEND:LTUS:165: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, "BEND:LTUS:165:STAT") } record(longout, "BEND:LTUS:165:STAT") { field(DESC, "STAT sent to SLC") field(SCAN, "Passive") field(FLNK, "BEND:LTUS:165:STATCTRLSUB") field(DOL, "BEND:LTUS:165:STATSUB.VAL") field(OMSL, "closed_loop") } record(sSub, "BEND:LTUS:165:STATCTRLSUB") { field(DESC, "Decode SLC STAT into mbbo") field(INAM, "mgntInit") field(SNAM, "mgntStatDecode") field(INPA, "BEND:LTUS:165:STAT") field(INPB, "BEND:LTUS:165:HSTA") field(INPD, "BEND:LTUS:165:ONOFFCTRL.RVAL") field(FLNK, "BEND:LTUS:165:STATMSG") } record(mbbo, "BEND:LTUS:165: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, "BEND:LTUS:165:UNAVAILGO") field(DOL, "BEND:LTUS:165:STATCTRLSUB.W") } record(seq, "BEND:LTUS:165:UNAVAILGO") { field(DESC, "Process UNAVAIL") field(DOL1, "BEND:LTUS:165:STATSUB.U") field(LNK1, "BEND:LTUS:165:UNAVAIL PP") } record(stringout, "BEND:LTUS:165:SNLSTATMSG") { field(DTYP, "Soft Channel") } #! TextBox(TB0,820,1000,1200,1220,0,"Dialog",12,1,16777215,"BEND:LTUS:165:STATUSSUB - future\nOverall device status - takes input from action snls, record sevrs, master snl(s) and outputs final status\n\nInputs:\nA - BEND:LTUS:165:CTRLSTATUS - snl status\nB - MGNT:CTRLSTATUS - master list status\nC\nD - BEND:LTUS:165: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,"BEND:LTUS:165STATSUB\nformat control bo's into slc STAT\n\nInputs:\nA - BEND:LTUS:165:STATUS\nC - BEND:LTUS:165:ON\nD - BEND:LTUS:165:STDZOK\nE - BEND:LTUS:165:CALBOK\nF - BEND:LTUS:165:BACTDRIFT (future)\nG -\nH- BEND:LTUS:165:DACSTATUS\nI -BEND:LTUS:165:ADCSTATUS\nJ - BEND:LTUS:165:BACTSTATUS\nK - BEND:LTUS:165:BDESSTATUS\nL - BEND:LTUS:165:RIPLSTATUS\n\nOutput:\nP - BEND:LTUS:165: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, "BEND:LTUS:165: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, "BEND:LTUS:165: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, "BEND:LTUS:165: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, "BEND:LTUS:165: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, "BEND:LTUS:165:IDESTOTAL"){ field(DESC, "Calc total current") field(CALC, "A+B") field(EGU, "kG-m") field(PREC, "7") field(INPA, "BEND:LTUS:166:IDES CP NMS") field(INPB, "BTRM:LTUS:165:BDES CP NMS") field(OUT, "BEND:LTUS:165:IDES2BDES.E PP") } record(sub, "BEND:LTUS:165:IDES2BDES") { field(DESC, "Cal BDES") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "BEND:LTUS:165:IDES2BDES") field(INPB, "BEND:LTUS:165:POLYCOEF") field(INPC, "BEND:LTUS:165:POLYCOEF.A") field(INPD, "BEND:LTUS:165:POLYCOEF.B") field(INPE, "BEND:LTUS:165:IDESTOTAL MS") field(INPF, "BEND:LTUS:166:BDELTAS PP") field(INPG, "100") field(EGU, "kG-m") field(HOPR, "4.5216") field(LOPR, "0.0128") field(HIHI, "4.5216") field(LOLO, "0.0128") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "4.5216") field(LOW, "0.0128") field(FLNK, "BEND:LTUS:165: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, "BEND:LTUS:165:IACTCALC"){ field(DESC, "Calc total act current") field(CALC, "A+B") field(EGU, "kG-m") field(PREC, "7") field(INPA, "BEND:LTUS:165:IACT CP NMS") field(INPB, "BTRM:LTUS:165:BACT") field(OUT, "BEND:LTUS:165: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, "BEND:LTUS:165:IMONCALC"){ field(DESC, "Calc total mon current") field(CALC, "A+B") field(EGU, "kG-m") field(PREC, "7") field(INPA, "BEND:LTUS:165:IMON CP NMS") field(INPB, "BTRM:LTUS:165:BMON") field(OUT, "BEND:LTUS:165: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, "BEND:LTUS:165:ICONTOTAL"){ field(DESC, "Calc total current") field(CALC, "A+B") field(EGU, "kG-m") field(PREC, "7") field(INPA, "BEND:LTUS:166:ICON CP NMS") field(INPB, "BTRM:LTUS:165:BCON CP NMS") field(OUT, "BEND:LTUS:165:ICON2BCON.E PP") } record(sub, "BEND:LTUS:165:ICON2BCON") { field(DESC, "Cal BCON") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "BEND:LTUS:165:ICON2BCON") field(INPB, "BEND:LTUS:165:POLYCOEF") field(INPC, "BEND:LTUS:165:POLYCOEF.A") field(INPD, "BEND:LTUS:165:POLYCOEF.B") field(INPE, "BEND:LTUS:165:ICONTOTAL MS") field(INPF, "BEND:LTUS:166:BDELTAS PP") field(INPG, "100") field(EGU, "kG-m") field(HOPR, "4.5216") field(LOPR, "0.0128") field(HIHI, "4.5216") field(LOLO, "0.0128") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "4.5216") field(LOW, "0.0128") field(FLNK, "BEND:LTUS:165:BCON") } #! 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, "BEND:LTUS:167:IACT") { field(DESC, "Current") field(INP, "BEND:LTUS:166:IACT CP NMS") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "BEND:LTUS:167:IACTCALC") info(autosaveFields,"HYST") } record(bi, "BEND:LTUS:167:STATE") { field(DESC, "PS On/Off Status") field(DTYP, "Raw Soft Channel") field(INP, "BEND:LTUS:166:STATE CP MS") field(ZSV, "MAJOR") field(ZNAM, "OFF") field(ONAM, "ON") } record(ao, "BEND:LTUS:167:IDES") { field(DESC, "Desired Current") field(PREC, "3") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(MDEL, "-1") field(HIHI, "250.0") field(LOLO, "0.0") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "BEND:LTUS:167:BDELTAS") field(DRVH, "250.0") field(DRVL, "0.0") field(DOL, "BEND:LTUS:167: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, "BEND:LTUS:167:ICTRL PP") } # This record is processed by BEND:LTUS:167:ICON") # Note: we are not setting alarms here. record(ao, "BEND:LTUS:167:ICON") { field(DESC, "Config I") field(DTYP, "Soft Channel") field(PREC, "3") field(HOPR, "250.0") field(LOPR, "0.0") field(DRVH, "250.0") field(DRVL, "0.0") field(DOL, "BEND:LTUS:167:B2ICON.K") field(OMSL, "closed_loop") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:167:INOM") { field(DESC, "Nominal Current") field(DOL, "BEND:LTUS:167:BNOM.K") field(OMSL, "closed_loop") field(PREC, "3") field(EGU, "A") field(DRVH, "250.0") field(DRVL, "0.0") field(HOPR, "250.0") field(LOPR, "0.0") } record(ao, "BEND:LTUS:167:ICTRL") { field(DESC, "Set Current") field(PREC, "3") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(DRVH, "250.0") field(DRVL, "0.0") field(MDEL, "-1") field(FLNK, "BEND:LTUS:167:ICTRLGO") field(OMSL, "supervisory") info(autosavefields,"VAL") } record(seq, "BEND:LTUS:167:ICTRLGO") { field(DESC, "Process Current Setpoint") field(PREC, "3") # Set ISETPT to supervisory field(DOL1, "0") field(LNK1, "BEND:LTUS:167:ISETPT.OMSL") field(DOL2, "BEND:LTUS:167:ICTRL") field(LNK2, "BEND:LTUS:167:ISETPT PP") # Set ISETPT to closed loop - get data from BCTRLSUB.K field(DOL3, "1") field(LNK3, "BEND:LTUS:167:ISETPT.OMSL") } record(ao, "BEND:LTUS:167:IMAX") { field(DESC, "Max I") field(DTYP, "Soft Channel") field(DRVH, "250.0") field(DRVL, "0.0") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(PREC, "3") field(PINI, "YES") field(VAL, "250.0") field(FLNK, "BEND:LTUS:167:IMIN") } record(ao, "BEND:LTUS:167:IMIN") { field(DESC, "Min I") field(DTYP, "Soft Channel") field(DRVH, "250.0") field(DRVL, "0.0") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(PREC, "3") field(VAL, "0.0") field(FLNK, "BEND:LTUS:167:IRANGE") } record(sel, "BEND:LTUS:167:IACTPREVOK") { field(DESC, "Last Good Current") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(PREC, "3") field(NVL, "BEND:LTUS:167:BACT.SEVR") field(INPA, "BEND:LTUS:167:IACT NPP MS") field(INPB, "BEND:LTUS:167:IACTPREVOK NPP MS") field(INPC, "BEND:LTUS:167:IACTPREVOK NPP MS") field(INPD, "BEND:LTUS:167:IACTPREVOK NPP MS") } record(sub, "BEND:LTUS:167:IACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "BEND:LTUS:167:IDES") field(INPB, "BEND:LTUS:167:ISETPT.DRVH") field(INPC, "BEND:LTUS:167:ISETPT.DRVL") field(INPD, "BEND:LTUS:167:IDELTAS.I") field(INPE, "BEND:LTUS:167:IDELTAS.J") field(INPG, "BEND:LTUS:167:STATE") field(INPH, "BEND:LTUS:167:HSTA") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(sub, "BEND:LTUS:167:IMONLIMITS") { field(DESC, "Aux Current Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "BEND:LTUS:167:IDES") field(INPB, "BEND:LTUS:167:ISETPT.DRVH") field(INPC, "BEND:LTUS:167:ISETPT.DRVL") field(INPD, "BEND:LTUS:167:IDELTAS.K") field(INPE, "BEND:LTUS:167:IDELTAS.L") field(INPG, "BEND:LTUS:167:STATE") field(INPH, "BEND:LTUS:167:HSTA") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(seq, "BEND:LTUS:167:ILIMITS") { field(DESC, "Set ACT and MON Limits") field(PREC, "3") field(DOL1, "BEND:LTUS:167:BLIMITS") field(LNK1, "BEND:LTUS:167:IACTLIMITS.F PP") field(DOL2, "BEND:LTUS:167:IACTLIMITS.I") field(LNK2, "BEND:LTUS:167:IACT.HIGH") field(DOL3, "BEND:LTUS:167:IACTLIMITS.J") field(LNK3, "BEND:LTUS:167:IACT.LOW") field(DOL4, "BEND:LTUS:167:IACTLIMITS.K") field(LNK4, "BEND:LTUS:167:IACT.HIHI") field(DOL5, "BEND:LTUS:167:IACTLIMITS.L") field(LNK5, "BEND:LTUS:167:IACT.LOLO") field(DOL6, "BEND:LTUS:167:BLIMITS") field(LNK6, "BEND:LTUS:167:IMONLIMITS.F PP") field(DOL7, "BEND:LTUS:167:IMONLIMITS.I") field(LNK7, "BEND:LTUS:167:IMON.HIGH") field(DOL8, "BEND:LTUS:167:IMONLIMITS.J") field(LNK8, "BEND:LTUS:167:IMON.LOW") field(DOL9, "BEND:LTUS:167:IMONLIMITS.K") field(LNK9, "BEND:LTUS:167:IMON.HIHI") field(DOLA, "BEND:LTUS:167:IMONLIMITS.L") field(LNKA, "BEND:LTUS:167: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, "BEND:LTUS:167:IDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntRawDeltas") field(INPD, "BEND:LTUS:167:TRIMBTOL") field(INPE, "BEND:LTUS:167:CHCKBTOL") field(INPF, "BEND:LTUS:167:BDELTAS.K") field(INPG, "BEND:LTUS:167:BDELTAS.L") field(INPH, "BEND:LTUS:167: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, "BEND:LTUS:167:STDZITOLR") field(INPC, "BEND:LTUS:167:STDZITOL") field(FLNK, "") } # All ps controllers with on/off control will set the macro ONOF # as follows: # # ONOF = BEND:LTUS:166: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, "BEND:LTUS:167: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 = BEND:LTUS:166:RESET PP # record(bo, "BEND:LTUS:167: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, "BEND:LTUS:167:RAMPSTATE") { field(DESC, "PS Ramp Status") field(DTYP, "Soft Channel") field(DOL, "BEND:LTUS:166: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, "BEND:LTUS:167: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, "BEND:LTUS:167:TRIMRAMPRATE") field(OUT, "") field(FLNK, "BEND:LTUS:167:STDZDLY") } record(ao, "BEND:LTUS:167:ISETPT") { field(DESC, "Current Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(DRVH, "250.0") field(DRVL, "0.0") field(MDEL, "-1") field(OUT, "") field(DOL, "BEND:LTUS:167: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, "BEND:LTUS:167:IMON") { field(DESC, "Aux Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(INP, "BEND:LTUS:166:IMON CP NMS") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "BEND:LTUS:167:IMONCALC") } record(ao, "BEND:LTUS:167:IRIPL") { field(DESC, "Ripple Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(DOL, "BEND:LTUS:166:IRIPL CP NMS") field(OMSL, "closed_loop") field(EGU, "A") field(DRVH, "1.0") field(HOPR, "1.0") field(PREC, "3") field(FLNK, "BEND:LTUS:167:IRIPLOK") } record(sub, "BEND:LTUS:167:IRIPLOK") { field(DESC, "Ripple Current Status") field(INAM, "mgntInit") field(SNAM, "mgntRiplOK") field(INPA, "BEND:LTUS:167:IRIPL.VAL") field(INPB, "BEND:LTUS:167: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, "BEND:LTUS:167:R") { field(DESC, "Resistance") field(EGU, "Ohms") field(PREC, "4") field(PINI, "YES") field(DOL, "BEND:LTUS:166: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, "BEND:LTUS:167:IGND") { field(DESC, "Ground Current") field(EGU, "A") field(PREC, "6") field(PINI, "YES") field(DOL, "BEND:LTUS:166:IGND CP MS") field(OMSL, "closed_loop") } record(bi, "BEND:LTUS:167:INTLKSUMY") { field(DESC, "Interlock Summary") field(INP, "BEND:LTUS:166:INTLKSUMY CP MS") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(ZNAM, "OK") field(ONAM, "FAULT") field(PINI, "NO") } record(mbbo, "BEND:LTUS:167: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, "BEND:LTUS:166:COOLING CP NMS") field(OMSL, "closed_loop") } # The following PV is processed by :BACTFO # which is processed by :BACT record(fanout, "BEND:LTUS:167:IACTFO") { field(DESC, "IACT processing") field(SELM, "All") field(LNK1, "BEND:LTUS:167:IACTPREVOK") field(LNK2, "BEND:LTUS:167:IDIFF") field(LNK3, "BEND:LTUS:167:IADIFF") field(LNK4, "BEND:LTUS:167:IRATIO") field(LNK5, "BEND:LTUS:167:IDIRECT") field(LNK6, "BEND:LTUS:167:IACTPOL_CHECK") } record(calc, "BEND:LTUS:167:IDIFF") { field(DESC, "IDES-IACT") field(CALC, "A-B") field(INPA, "BEND:LTUS:167:IDES") field(INPB, "BEND:LTUS:167:IACT") field(EGU, "A") field(PREC, "9") field(HOPR, "250.0") field(LOPR, "0.0") } record(calc, "BEND:LTUS:167:IADIFF") { field(DESC, "Absolute IDES-IACT") field(CALC, "A<0?ABS(A):A") field(INPA, "BEND:LTUS:167:IDIFF") field(PREC, "9") } record(calc, "BEND:LTUS:167:IRATIO") { field(DESC, "IDES-IACT/IMAX") field(CALC, "B?A/B:0") field(INPA, "BEND:LTUS:167:IDIFF") field(INPB, "BEND:LTUS:167:IDES.DRVH") field(PREC, "9") } record(calcout, "BEND:LTUS:167:IRANGE") { field(DESC, "Current Range") field(PINI, "YES") field(CALC, "ABS(A-B)") field(INPA, "BEND:LTUS:167:IMIN") field(INPB, "BEND:LTUS:167: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, "BEND:LTUS:167: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, "BEND:LTUS:167:IACT") field(FLNK, "BEND:LTUS:167:IACTPOL") } record(bo, "BEND:LTUS:167:IACTPOL") { field(DESC, "Actual I Polarity") field(DTYP, "Raw Soft Channel") field(DOL, "BEND:LTUS:167: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,"BEND:LTUS:167:I*LIMITS:\n Calculate alarm and warning limits based on \n deltas from BEND:LTUS:167:IDELTAS and the\n BEND:LTUS:167: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,"BEND:LTUS:167:IACT: \n Get copy of BEND:LTUS:167:I. \n",null) #! TextBox(TB12,1280,3100,1760,3200,0,"Dialog",12,1,16777215,"BEND:LTUS:167: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,"BEND:LTUS:167:IDES:\n Contains raw value calculated by \nBEND:LTUS:167: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 \nBEND:LTUS:167:BDELTAS.\n",null) #! TextBox(TB10,56,1940,316,2340,0,"Dialog",12,1,16777215,"BEND:LTUS:167: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 BEND:LTUS:167: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 BEND:LTUS:167: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,"BEND:LTUS:167:ISETPT:\n Sets the hardware. When fast feedback is set on, this record is\n set to closed loop mode by BEND:LTUS:167:FBCKSTART sequence. When \n the loop is closed, this record takes input calculated by \n BFBCK only. When fast feedback is set off, BEND:LTUS:167:FBCKSTOP \n will set it back to supervisory so that the value can be set by \n BEND:LTUS:167: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, "BEND:LTUS:167:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:167:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "BEND:LTUS:167:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "BEND:LTUS:167:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "BEND:LTUS:167:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "BEND:LTUS:167:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "1") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "BEND:LTUS:167: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, "BEND:LTUS:167:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "BEND:LTUS:167:TRIMTYPE.RVAL") field(INPB, "BEND:LTUS:167:CONFIG.RVAL") field(OUT, "BEND:LTUS:167:TRIMMAXNUM PP") } record(longout, "BEND:LTUS:167: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, "BEND:LTUS:167: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, "BEND:LTUS:166:TRIMRAMPRATE CP NMS") field(OMSL, "closed_loop") field(VAL, "") field(OUT, "BEND:LTUS:167:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "BEND:LTUS:167: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, "BEND:LTUS:166:TRIMSETL CP NMS") field(OMSL, "closed_loop") field(VAL, "") } record(bo, "BEND:LTUS:167: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, "BEND:LTUS:167: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, "BEND:LTUS:167: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, "BEND:LTUS:167:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "0") } record(ao, "BEND:LTUS:167: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, "BEND:LTUS:167:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "BEND:LTUS:167: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, "BEND:LTUS:167: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, "BEND:LTUS:167:IMOVE") field(INPB, "BEND:LTUS:167:IACT") field(INPC, "BEND:LTUS:167:IRAMPRATE") field(INPD, "1.577") field(INPE, "BEND:LTUS:167:TRIMDLYPCT") field(INPF, "BEND:LTUS:167:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "BEND:LTUS:167:RAMPTIME_LEFT PP") } record(longout, "BEND:LTUS:167:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "BEND:LTUS:167:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "BEND:LTUS:167:RAMPDONE_CALC") } record(calc, "BEND:LTUS:167:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "BEND:LTUS:167:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "BEND:LTUS:167:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "BEND:LTUS:167: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, "BEND:LTUS:167:RAMPTIME_LEFT") field(OUT, "BEND:LTUS:167:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "BEND:LTUS:167:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "BEND:LTUS:167:RAMPTIME_LEFT NMS") field(OUT, "BEND:LTUS:167:RAMPDONE PP") } record(bo, "BEND:LTUS:167:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "BEND:LTUS:167:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "BEND:LTUS:167: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, "BEND:LTUS:167: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, "BEND:LTUS:167:STDZINIT") { field(DESC, "Proc. Stdz PVs on boot") field(PINI, "YES") field(DOL1, "1") field(DOL2, "1") field(DOL3, "1") field(LNK1, "BEND:LTUS:167:DEBUG.PROC PP") field(LNK2, "BEND:LTUS:167:STDZCYCLENUM.PROC PP") field(LNK3, "BEND:LTUS:167:STDZDISABLE.PROC PP") field(LNK4, "BEND:LTUS:167: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, "BEND:LTUS:167:STDZSUB") { field(DESC, "Stdz subroutine") field(INAM, "mgntStdzInit") field(SNAM, "mgntStdz") field(BRSV, "INVALID") field(INPA, "BEND:LTUS:167:STDZIMIN NPP NMS") field(INPB, "BEND:LTUS:167:STDZIMAX NPP NMS") field(INPC, "BEND:LTUS:167:STDZIFINAL NPP NMS") field(INPD, "BEND:LTUS:167:STDZCYCLENUM NPP NMS") field(INPE, "BEND:LTUS:167:STDZDIRECT.RVAL NPP NMS") field(INPF, "BEND:LTUS:167:STDZDISABLE.RVAL CPP NMS") field(INPG, "BEND:LTUS:167: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, "BEND:LTUS:167:STDZWF PP") field(OUTB, "BEND:LTUS:167: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, "BEND:LTUS:167:STDZWF") } record(mbbo, "BEND:LTUS:167: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, "BEND:LTUS:167: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, "BEND:LTUS:167:STDZMAINPS") { field(DESC, "Stdz by main or self") field(PINI, "YES") field(DTYP, "Soft Channel") field(ZNAM, "SELF") field(ONAM, "MAIN") } record(bo, "BEND:LTUS:167: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, "BEND:LTUS:167: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, "BEND:LTUS:167: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, "BEND:LTUS:167:STDZTOD") { field(DESC, "Successful Standardize Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "BEND:LTUS:167:STDZLOSTTOD") { field(DESC, "Standardize Lost Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(longout, "BEND:LTUS:167:STDZCYCLECNT") { field(DESC, "Cycle Count") field(PINI, "YES") } record(longout, "BEND:LTUS:167: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, "BEND:LTUS:167:STDZDIRECT") } # The default standardize direction is "UP" for # all LCLS Magnets.. record(bo, "BEND:LTUS:167:STDZDIRECT") { field(DESC, "Standardize Direction ") field(ZNAM, "UP") field(ONAM, "DOWN") field(VAL, "0") field(FLNK, "BEND:LTUS:167:STDZIMIN") } record(ao, "BEND:LTUS:167:STDZIMIN") { field(DESC, "Min-STDZ Current") field(PREC, "1") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(VAL, "0.0") field(FLNK, "BEND:LTUS:167:STDZIMAX") } record(ao, "BEND:LTUS:167:STDZIMAX") { field(DESC, "Max. Standarize Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(VAL, "250.0") field(FLNK, "BEND:LTUS:167:STDZIFINAL") } record(ao, "BEND:LTUS:167:STDZIFINAL") { field(DESC, "Final SDTZ Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(VAL, "0.0") field(FLNK, "BEND:LTUS:167: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, "BEND:LTUS:167: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, "BEND:LTUS:167:STDZITOL") { field(DESC, "Stdz min tolerance") field(PREC, "5") field(CALC, "MAX(ABS(A),ABS(B))*C") field(INPA, "BEND:LTUS:167:STDZIMIN CP NMS") field(INPB, "BEND:LTUS:167:STDZIMAX CP MMS") field(INPC, "0.05") field(INPD, "BEND:LTUS:167:STDZITOLR CP MMS") field(EGU, "A") field(FLNK, "BEND:LTUS:167:IDELTAS") field(PINI, "YES") } # D - factor (3.154/2 = 1.577) for EPSC, otherwise, set to 1.0 record(calc, "BEND:LTUS:167:STDZDLY") { field(DESC, "Ramp time for stdz cycle") field(CALC, "C>0?MAX(1,ABS((A-B)/C)*D):0") field(INPA, "BEND:LTUS:167:STDZIMIN CP NMS") field(INPB, "BEND:LTUS:167:STDZIMAX CP NMS") field(INPC, "BEND:LTUS:167:TRIMRAMPRATE CP NMS") field(INPD, "1.0") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") } record(calc, "BEND:LTUS:167:STDZRAMPDLY") { field(DESC, "Ramp delay total") field(CALC, "MAX(1,((A/100)*B+B))") field(PREC, "5") field(INPA, "BEND:LTUS:167:TRIMDLYPCT CP MS") field(INPB, "BEND:LTUS:167: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, "BEND:LTUS:167:STDZMINIDLY") { field(DESC, "Mini-stdz delay") field(CALC, "A") field(PREC, "5") field(A, "1.0") field(EGU, "sec") field(PINI, "YES") } record(ao, "BEND:LTUS:167: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, "BEND:LTUS:167:STDZMINIDELTA") { field(DESC, "Stdz mini % of IMAX") field(CALC, "(B/100)*(A-C)") field(INPA, "BEND:LTUS:167:IDES.HOPR") field(INPB, "BEND:LTUS:167:STDZMINIPCT CPP NMS") field(INPC, "BEND:LTUS:167:IDES.LOPR") field(PREC, "5") } record(calc, "BEND:LTUS:167:STDZMINISETPT") { field(DESC, "Mini Stdz delta") field(CALC, "C==0?MAX(E-D,B):MIN(E+D,A)") field(INPA, "BEND:LTUS:167:IDES.HOPR") field(INPB, "BEND:LTUS:167:IDES.LOPR") field(INPC, "BEND:LTUS:167:STDZDIRECT.RVAL") field(INPD, "BEND:LTUS:167:STDZMINIDELTA") field(INPE, "BEND:LTUS:167:IDES") field(PREC, "5") field(FLNK, "BEND:LTUS:167: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, "BEND:LTUS:167:STDZMINISETPTOOR") { field(DESC, "Mini Stdz setpoint out of range") field(CALC, "C==0?(E-DA)") field(INPA, "BEND:LTUS:167:IDES.HOPR") field(INPB, "BEND:LTUS:167:IDES.LOPR") field(INPC, "BEND:LTUS:167:STDZDIRECT.RVAL") field(INPD, "BEND:LTUS:167:STDZMINIDELTA") field(INPE, "BEND:LTUS:167: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, "BEND:LTUS:167: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, "BEND:LTUS:167:IADJUST.RVAL") field(INPB, "BEND:LTUS:167:STDZDIRECT.RVAL") field(INPC, "BEND:LTUS:167:STDZOK.RVAL") field(INPD, "BEND:LTUS:167:STDZDISABLE.RVAL") field(INPE, "BEND:LTUS:167:STATE.RVAL CPP NMS") field(INPF, "BEND:LTUS:167:ICTRL.RVAL") field(INPG, "BEND:LTUS:167:STATE.SEVR") field(INPH, "BEND:LTUS:167:BDELTAS.M") field(INPI, "BEND:LTUS:167:IACT.SEVR") field(OUT, "BEND:LTUS:167:STDZLOSTGO.SELN PP NMS") field(OOPT, "Transition To Non-zero") } record(seq, "BEND:LTUS:167:STDZLOSTGO") { field(DESC, "Process lost stdz") field(SELM, "Mask") field(DOL1, "1") field(DOL2, "0") field(LNK1, "BEND:LTUS:167:STDZLOSTTOD.PROC") field(LNK2, "BEND:LTUS:167:STDZOK PP") } # Record maximum current after standardize # Reset to IACT from sequence after trim # Disable processing during (mini-)standardize or trim record(calc, "BEND:LTUS:167:STDZIACTMAX") { field(DESC, "Max act current after stdz") field(CALC, "MAX(A, B)") field(DISV, "0") field(SDIS, "BEND:LTUS:167:CHECKPWRDIP_ENABLE") field(INPA, "BEND:LTUS:167:IACT CP") field(INPB, "BEND:LTUS:167:STDZIACTMAX") field(EGU, "A") field(FLNK, "BEND:LTUS:167:CHECKPWRDIP") } # Detect power dip if STDZOK is YES, STDZ is enabled, and IACT is valid # If IACT drops below STDZIACTMAX by more than the trim tolerance, clear STDZOK # Warning: Take the absolute value of the trim tolerance, or else quads of # negative polarity will always lose STDZ since their IDELTAS.I are negative. # Note: Large quads and bends are prone to losing STDZ even if they are # perturbed toward higher current since their current tends to overshoot # by greater than the trim tolerance before settling down. record(calcout, "BEND:LTUS:167:CHECKPWRDIP") { field(DESC, "Detect power dip") field(CALC, "(A-B>ABS(C))?3:0") field(DISV, "0") field(SDIS, "BEND:LTUS:167:CHECKPWRDIP_ENABLE") field(INPA, "BEND:LTUS:167:STDZIACTMAX") field(INPB, "BEND:LTUS:167:IACT") field(INPC, "BEND:LTUS:167:IDELTAS.I") field(OUT, "BEND:LTUS:167:STDZLOSTGO.SELN PP NMS") field(OOPT, "When Non-zero") } # Enable processing of STDZIACTMAX and CHECKPWRDIP only if # STDZOK = YES, STDZDISABLE = NO, CTRL != Trim (2), and # CTRL != Stdz (4) record(calc, "BEND:LTUS:167:CHECKPWRDIP_ENABLE") { field(CALC, "A&&!B&&(C#2)&&(C#4)") field(INPA, "BEND:LTUS:167:STDZOK.RVAL CP") field(INPB, "BEND:LTUS:167:STDZDISABLE.RVAL CP") field(INPC, "BEND:LTUS:167:CTRL.RVAL CP") } #! 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, "BEND:LTUS:167: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, "BEND:LTUS:167: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, "BEND:LTUS:167:CALBSET") { field(DESC, "Use DAC Calbration") field(SCAN, "10 second") field(CALC, "A&&(B==0)&&C?31:960") field(INPA, "BEND:LTUS:167:CALBOK") field(INPB, "BEND:LTUS:167:CALBDISABLE") field(INPC, "BEND:LTUS:167:CALBSLOPE") field(OOPT, "On Change") field(OUT, "BEND:LTUS:167: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, "BEND:LTUS:167:CALB_SEQ") { field(DESC, "Output Calib Values") field(SELM, "Mask") field(SELL, "BEND:LTUS:167: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, "BEND:LTUS:167:CALBSLOPE") field(DOL3, "BEND:LTUS:167: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, "BEND:LTUS:167:CALBTOD") { field(DESC, "Calibration Success Time") field(PINI, "YES") # field(DOL, "") field(OMSL, "supervisory") field(DTYP, "Soft Channel") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:167: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, "BEND:LTUS:167: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, "BEND:LTUS:167: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, "BEND:LTUS:167:CALBOFFSET") { field(DESC, "Calc DAC Offset") field(PREC, "6") field(EGU, "Counts") field(PINI, "YES") } record(bo, "BEND:LTUS:167: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, "BEND:LTUS:167:DACSLOPE") { field(DESC, "V to DAC slope") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "supervisory") field(PINI, "YES") field(FLNK, "BEND:LTUS:167:DACOFFSET") } # Default Offset used in conversion from Volts to DAC Counts record(ao, "BEND:LTUS:167:DACOFFSET") { field(DESC, "V to DAC offset") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "supervisory") field(PINI, "YES") field(FLNK, "BEND:LTUS:167: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, "BEND:LTUS:167: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, "BEND:LTUS:167:IACT") field(INPD, "BEND:LTUS:167:DACSLOPE") field(INPE, "BEND:LTUS:167:DACOFFSET") field(EGU, "Counts") field(PREC, "6") } record(ao, "BEND:LTUS:167:DAC") { field(DESC, "DAC Set point") field(EGU, "Counts") field(DOL, "") field(OMSL, "supervisory") field(PREC, "6") field(PINI, "YES") } record(ao, "BEND:LTUS:167:CALBIMIN") { field(DESC, "Calibration Min Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(DRVH, "250.0") field(HOPR, "250.0") field(DRVL, "0.0") field(LOPR, "0.0") field(PREC, "3") field(EGU, "A") field(VAL, "0.0") field(FLNK, "BEND:LTUS:167:CALBIMAX") } record(ao, "BEND:LTUS:167:CALBIMAX") { field(DESC, "Calibration Max Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(DRVH, "250.0") field(HOPR, "250.0") field(LOPR, "0.0") field(DRVL, "0.0") field(EGU, "A") field(VAL, "250.0") field(FLNK, "BEND:LTUS:167:CALBSTEPNUM") } record(ao, "BEND:LTUS:167:CALBIFINAL") { field(DESC, "Calibration Last Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(PREC, "3") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(VAL, "0") } record(longout, "BEND:LTUS:167: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, "BEND:LTUS:167:CALBIDELTA") } record(calc, "BEND:LTUS:167:CALBIDELTA") { field(DESC, "Step size for CALB") field(CALC, "C=0?0:ABS((A-B)/C)") field(INPA, "BEND:LTUS:167:CALBIMAX") field(INPB, "BEND:LTUS:167:CALBIMIN") field(INPC, "BEND:LTUS:167: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, "BEND:LTUS:167:CALBIMULT") { field(DESC, "IACT vs ISETPT mult") field(CALC, "C#0||A=0?1:ABS(B/A)") field(INPA, "BEND:LTUS:166:ISETPT.DRVH") field(INPB, "BEND:LTUS:166:IACT.HOPR") field(INPC, "BEND:LTUS:167:PSCONTROLLER.RVAL CPP") field(EGU, "A") field(PINI, "YES") } # SNL dbputs DAC values here. 6-10 steps are possible. record(waveform, "BEND:LTUS:167:CALBICTRLWF") { field(DESC, "ICTRL setpoint array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") } record(waveform, "BEND:LTUS:167:DACWF") { field(DESC, "DAC count array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "BEND:LTUS:167:DACSA") } # Used only for xygraph edm plot record(subArray, "BEND:LTUS:167:DACSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "BEND:LTUS:167: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, "BEND:LTUS:167:CALCDACWF") { field(DESC, "Calc DAC counts array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "BEND:LTUS:167:CALCDACSA") } # Used only for xygraph edm plot record(subArray, "BEND:LTUS:167:CALCDACSA") { field(DESC, "Calc DAC counts") field(DTYP, "Soft Channel") field(INP, "BEND:LTUS:167: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, "BEND:LTUS:167:CALBYWF") { field(DESC, "mx + b") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "BEND:LTUS:167:CALBYSA") } # Used only for xygraph edm plot record(subArray, "BEND:LTUS:167:CALBYSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "BEND:LTUS:167:CALBYWF") field(MALM, "10") field(NELM, "6") field(INDX, "0") field(FTVL, "DOUBLE") } record(waveform, "BEND:LTUS:167:CALBIACTWF") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "BEND:LTUS:167:CALBIACTSA") } # Used only for xygraph edm plot record(subArray, "BEND:LTUS:167:CALBIACTSA") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(MALM, "10") field(NELM, "6") field(INP, "BEND:LTUS:167:CALBIACTWF") field(INDX, "0") field(FTVL, "DOUBLE") field(FLNK, "BEND:LTUS:167:CALBLIMITS") } # Check that measured current during calibration is within # tolerance. record(aSub, "BEND:LTUS:167: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, "BEND:LTUS:167:CALBSTEPNUM") field(INPB, "BEND:LTUS:167:CALBIACTWF") field(INPC, "BEND:LTUS:167: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, "BEND:LTUS:167: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, "BEND:LTUS:167:STDZITOL") field(INPH, "BEND:LTUS:167:DACSLOPE") field(INPI, "BEND:LTUS:167: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, "BEND:LTUS:167: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, "BEND:LTUS:167:CALBSTEPNUM") field(INPB, "BEND:LTUS:167:CALBIACTWF") field(INPC, "BEND:LTUS:167:DACWF") field(INPF, "BEND:LTUS:167: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 BEND:LTUS:167CALBOK 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, "BEND:LTUS:167:DEGAUSINIT") { field(DESC, "Proc. Degauss PVs on boot") field(PINI, "YES") field(DOL, "1") field(OUTA, "BEND:LTUS:167:DEGAUSIMIN.PROC PP") field(OUTB, "BEND:LTUS:167:DEGAUSIMAX.PROC PP") field(OUTC, "BEND:LTUS:167:DEGAUSTYPE.PROC PP") field(OUTD, "BEND:LTUS:167:DEGAUSSTEP.PROC PP") field(OUTE, "BEND:LTUS:167:MADNAME.PROC PP") field(OUTF, "BEND:LTUS:167:PSTYPE.PROC PP") field(OUTG, "BEND:LTUS:167: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, "BEND:LTUS:167:DEGAUSSUB") { field(DESC, "Degauss subroutine") field(INAM, "mgntDegaussInit") field(SNAM, "mgntDegauss") field(BRSV, "INVALID") field(INPA, "BEND:LTUS:167:DEGAUSIMIN NPP NMS") field(INPB, "BEND:LTUS:167:DEGAUSIMAX NPP NMS") field(INPC, "BEND:LTUS:167:DEGAUSTYPE.RVAL NPP NMS") field(INPE, "BEND:LTUS:167:DEGAUSMETHOD.RVAL NPP NMS") field(INPF, "BEND:LTUS:167:PSTYPE NPP NMS") field(INPG, "BEND:LTUS:167:DEBUG.RVAL NPP NMS") field(INPH, "BEND:LTUS:167: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, "BEND:LTUS:167:DEGAUSWF PP") field(OUTB, "BEND:LTUS:167:DEGAUSMSG PP") field(OUTC, "BEND:LTUS:167: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, "BEND:LTUS:167:DEGAUSWF") { field(DESC, "Degauss Setpts") field(NELM, "60") field(FTVL, "DOUBLE") } record(mbbo,"BEND:LTUS:167: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, "BEND:LTUS:167: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, "BEND:LTUS:167: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, "BEND:LTUS:167: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, "BEND:LTUS:167: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, "BEND:LTUS:167:DEGAUSIMIN") { field(DESC, "Min. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "250.0") field(LOPR, "-250.0") field(DRVH, "250.0") field(DRVL, "-250.0") field(VAL, "-250.0") } record(ao, "BEND:LTUS:167:DEGAUSIMAX") { field(DESC, "Max. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "250.0") field(LOPR, "-250.0") field(DRVH, "250.0") field(DRVL, "-250.0") field(VAL, "250.0") } # 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,"BEND:LTUS:167: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, "BEND:LTUS:167: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,"BEND:LTUS:167: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, "BEND:LTUS:167: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, "BEND:LTUS:167: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, "BEND:LTUS:167: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, "BEND:LTUS:167:DEGAUSTOD") { field(DESC, "Successful Degauss Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "BEND:LTUS:167:DEGAUSLOSTTOD") { field(DESC, "Degauss Lost Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:167:DEGAUSTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "BEND:LTUS:167:DEGAUSTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "BEND:LTUS:167: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, "BEND:LTUS:167:DEGAUSGO") { field(DESC, "Set bdes of btrms to zero") field(ASG, "Internal") field(OUTA, "") field(OUTB, "") field(OUTC, "") field(OUTD, "") } # =========== CRYO ONLY =========== record(bo, "BEND:LTUS:167: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, "BEND:LTUS:167:DEGAUS_IMAX_CHECK") { field(DESC, "Check if imax shoud chg") field(CALC, "(C==4)&&(ABS(B)>ABS(A))?1:0") field(INPA, "BEND:LTUS:167:DEGAUS_IMAX") field(INPB, "BEND:LTUS:167:ISETPT") field(INPC, "BEND:LTUS:167:DEGAUSTYPE.RVAL") field(OUT, "BEND:LTUS:167:DEGAUS_IMAX_UPDATE.SELN") field(FLNK, "BEND:LTUS:167:DEGAUS_IMAX_UPDATE") } record(seq, "BEND:LTUS:167:DEGAUS_IMAX_UPDATE") { field(DESC, "Degauss IMAX Update") field(SELM, "Specified") field(DOL1, "BEND:LTUS:167:ISETPT") field(LNK1, "BEND:LTUS:167:DEGAUS_IMAX PP") } # Set the maximum current after a successful # degauss. This pv is updated by the # sequence. record(ao, "BEND:LTUS:167:DEGAUS_IMAX") { field(DESC, "Max I set afer a degauss") field(EGU, "Amps") field(PINI, "YES") field(PREC, "6") field(HOPR, "250.0") field(LOPR, "-250.0") field(DRVH, "250.0") field(DRVL, "-250.0") field(VAL, "250.0") field(FLNK, "BEND:LTUS:167:DEGAUS_IMAXPOL_CHECK") info(autosaveFields,"VAL,RVAL") } # Set the polarity if degauss_imax record(calcout, "BEND:LTUS:167:DEGAUS_IMAXPOL_CHECK") { field(DESC, "Determine polarity of imax") field(CALC, "A>=0?0:1") field(INPA, "BEND:LTUS:167:DEGAUS_IMAX") field(FLNK, "BEND:LTUS:167:DEGAUS_IMAXPOL") } record(bo, "BEND:LTUS:167:DEGAUS_IMAXPOL") { field(DESC, "Polarity of imax I") field(DTYP, "Raw Soft Channel") field(DOL, "BEND:LTUS:167:DEGAUS_IMAXPOL_CHECK") field(OMSL, "closed_loop") field(ZNAM, "Positive") field(ONAM, "Negative") field(FLNK, "BEND:LTUS:167: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, "BEND:LTUS:167:DEGAUS_ABSIMAX") { field(DESC, "Absolute Max. Degauss I") field(CALC, "ABS(A)") field(INPA, "BEND:LTUS:167:DEGAUS_IMAX") field(PREC, "6") field(EGU, "Amps") field(HOPR, "250.0") field(LOPR, "-250.0") info(autosaveFields,"VAL RVAL") } # IACT Polarity record(calcout, "BEND:LTUS:167:IACTPOL_CHECK") { field(DESC, "Determine IACT polarity") field(SCAN, "5 second") field(CALC, "ABS(A-B)>C?(A>=0?0:1):D") field(INPA, "BEND:LTUS:167:IACT") field(INPB, "BEND:LTUS:167:IACTPOL_CHECK.LA") field(INPC, "0.0001") field(INPD, "BEND:LTUS:167:IACTPOL_CHECK.PVAL") field(OOPT, "On Change") field(FLNK, "BEND:LTUS:167:IACTPOL") } record(bo, "BEND:LTUS:167: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,"BEND:LTUS:167: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, "BEND:LTUS:167:DEGAUSENABLE CP") field(INPB, "BEND:LTUS:167:DEGAUSOK") field(INPC, "BEND:LTUS:167:STATE CP") field(INPD, "BEND:LTUS:167:STATE.SEVR") field(OUT, "BEND:LTUS:167:DEGAUS_STATE_SEQ.SELN PP") field(ASG, "Internal") } record(seq, "BEND:LTUS:167:DEGAUS_STATE_SEQ") { field(DESC, "Degauss State Sequence") field(SELM, "Specified") field(SELL, "BEND:LTUS:167:DEGAUS_STATE_CHECK") field(LNK1, "BEND:LTUS:167:DEGAUS_STATE_DISABLE.PROC PP") field(LNK2, "BEND:LTUS:167:DEGAUS_STATE_LOST.PROC PP") field(LNK3, "BEND:LTUS:167:DEGAUS_STATE_GOOD.PROC PP") field(LNK4, "BEND:LTUS:167: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, "BEND:LTUS:167:DEGAUS_STATE_DISABLE") { field(DESC, "Degauss not used") field(LNK1, "BEND:LTUS:167:DEGAUSOK.ZSV") field(LNK2, "BEND:LTUS:167: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, "BEND:LTUS:167:STATMSG.FRSV") field(LNK4, "BEND:LTUS:167: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, "BEND:LTUS:167:DEGAUS_STATE_LOST") { field(DESC, "Degauss lost and ps On") field(DOL1, "1") field(LNK1, "BEND:LTUS:167:DEGAUSOK.ZSV") field(LNK2, "BEND:LTUS:167: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, "BEND:LTUS:167:STATMSG.FRSV") field(LNK4, "BEND:LTUS:167: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, "BEND:LTUS:167:DEGAUS_STATE_OFF") { field(DESC, "Degaused lost and ps Off") field(DOL1, "2") field(LNK1, "BEND:LTUS:167: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, "BEND:LTUS:167:STATMSG.FRSV") field(LNK3, "BEND:LTUS:167: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, "BEND:LTUS:167:DEGAUS_STATE_GOOD") { field(DESC, "Degauss good") field(DOL1, "1") field(LNK1, "BEND:LTUS:167: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, "BEND:LTUS:167:STATMSG.FRSV PP") field(LNK3, "BEND:LTUS:167:STATMSG.FVSV PP") field(LNK4, "") field(ASG, "Internal") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(mbbo, "BEND:LTUS:167:FUNC") { field(DESC, "BEND:LTUS:167 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, "0") field(FFVL, "0") field(OUT, "BEND:LTUS:167:CTRL CA") } # :CTRL pv is processed at boot in the # sequence mgntCtrl.st Processed in sequence # record(mbbo, "BEND:LTUS:167:CTRL") { field(DESC, "BEND:LTUS:167 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, "BEND:LTUS:167:SELECTEN.A PP") field(SDIS, "0") } # If a function has been selected set this unit to busy record(calcout, "BEND:LTUS:167:SELECTEN") { field(DESC, "Control Select Enable") field(CALC, "A>0?1:A") field(FLNK, "BEND:LTUS:167:BUSY") } # Set to FREE on IOC reboot record(bo, "BEND:LTUS:167:BUSY") { field(DESC, "BEND:LTUS:167 Ctrl Done") field(DOL, "BEND:LTUS:167:SELECTEN") field(ZNAM, "FREE") field(ONAM, "BUSY") field(PINI, "YES") field(FLNK, "BEND:LTUS:167:SELECT") } record(bo, "BEND:LTUS:167:SELECT") { field(ZNAM, "NO") field(ONAM, "YES") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") } record(bo, "BEND:LTUS:167: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, "BEND:LTUS:167:CTRLSTATE") { field(DESC, "BEND:LTUS:167 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("BEND:LTUS:167:CTRL",20,20,0,0,"BEND:LTUS:167:CTRL") #! Field("BEND:LTUS:167:CTRL.OUT",16777215,1,"BEND:LTUS:167:CTRL.OUT") #! Link("BEND:LTUS:167:CTRL.OUT","BEND:LTUS:167:SELECTEN.A") #! Field("BEND:LTUS:167:CTRL.VAL",16777215,1,"BEND:LTUS:167:CTRL.VAL") #! Record("BEND:LTUS:167:SELECTEN",321,381,0,0,"BEND:LTUS:167:SELECTEN") #! Field("BEND:LTUS:167:SELECTEN.A",16777215,0,"BEND:LTUS:167:SELECTEN.A") #! Field("BEND:LTUS:167:SELECTEN.FLNK",16777215,1,"BEND:LTUS:167:SELECTEN.FLNK") #! Link("BEND:LTUS:167:SELECTEN.FLNK","BEND:LTUS:167:BUSY") #! Field("BEND:LTUS:167:SELECTEN.VAL",16777215,1,"BEND:LTUS:167:SELECTEN.VAL") #! Record("BEND:LTUS:167:BUSY",623,274,0,0,"BEND:LTUS:167:BUSY") #! Field("BEND:LTUS:167:BUSY.DOL",16777215,0,"BEND:LTUS:167:BUSY.DOL") #! Link("BEND:LTUS:167:BUSY.DOL","BEND:LTUS:167:SELECTEN.VAL") #! Field("BEND:LTUS:167:BUSY.FLNK",16777215,1,"BEND:LTUS:167:BUSY.FLNK") #! Link("BEND:LTUS:167:BUSY.FLNK","BEND:LTUS:167:SELECT") #! Record("BEND:LTUS:167:SELECT",669,508,0,1,"BEND:LTUS:167:SELECT") #! Record("BEND:LTUS:167:FUNC",940,120,0,0,"BEND:LTUS:167:FUNC") #! Field("BEND:LTUS:167:FUNC.OUT",16777215,0,"BEND:LTUS:167:FUNC.OUT") #! Link("BEND:LTUS:167:FUNC.OUT","BEND:LTUS:167:CTRL.VAL") #! Record("BEND:LTUS:167:ABORT",193,41,0,0,"BEND:LTUS:167:ABORT") #! Record("BEND:LTUS:167:CTRLSTATE",369,34,0,0,"BEND:LTUS:167: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,"BEND:LTUS:167:SELECT is used for Multi-device selection.\nIt is enabled when associated BEND:LTUS:167:CTRL is \"0\" (DONE).\nIt is disabled when associated BEND:LTUS:167: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,"BEND:LTUS:167: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, "BEND:LTUS:167:BCTRL_INIT") { field(DESC, "Process BCTRL on boot") field(PINI, "YES") field(CALC, "A=3?1:0") field(INPA, "BEND:LTUS:167:BCTRL.SEVR") field(OUT, "BEND:LTUS:167: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, "BEND:LTUS:167:BACT") { field(DESC, "Actual B") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "BEND:LTUS:167:BACT") field(INPB, "BEND:LTUS:167:POLYCOEF") field(INPC, "BEND:LTUS:167:POLYCOEF.A") field(INPD, "BEND:LTUS:167:POLYCOEF.B") field(INPE, "BEND:LTUS:167:IACTCALC MS") field(INPF, "BEND:LTUS:167:BDELTAS PP") field(INPG, "100") field(EGU, "kG-m") field(HOPR, "4.5125") field(LOPR, "0.0135") field(HIHI, "4.5125") field(LOLO, "0.0135") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "4.5125") field(LOW, "0.0135") field(FLNK, "BEND:LTUS:167: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, "BEND:LTUS:167:BDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntPhyDeltas") field(EGU, "kG-m") field(HOPR, "1") field(PREC, "7") field(BRSV, "INVALID") field(INPA, "BEND:LTUS:167:BDES") field(INPB, "BEND:LTUS:167:TRIMBTOL") field(INPC, "BEND:LTUS:167:TRIMBTOLR") field(INPD, "BEND:LTUS:167:CHCKBTOL") field(INPE, "BEND:LTUS:167:CHCKBTOLR") field(F, "2.0") field(INPG, "30") field(INPH, "BEND:LTUS:167:BACT.VAL") # # MPS absolute and relative tolerances field(INPP, "BEND:LTUS:167:MPSBTOL") field(INPQ, "BEND:LTUS:167:MPSBTOLR") field(FLNK, "BEND:LTUS:167:BCONLIMITS") info(autosaveFields,"F") } # This record is processed by BDELTAS record(aSub, "BEND:LTUS:167:BCONLIMITS") { field(DESC, "Config B-field Limits") field(INAM, "mgntInit") field(SNAM, "mgntBCONLimits") field(INPA, "BEND:LTUS:167:BDES") field(INPB, "BEND:LTUS:167:BDELTAS.I") field(INPG, "BEND:LTUS:167:DEBUG.RVAL") field(FTA, "DOUBLE") field(FTB, "DOUBLE") field(FTG, "ULONG") field(OUTA, "BEND:LTUS:167:BCON.HIGH") field(OUTB, "BEND:LTUS:167:BCON.LOW") field(OUTC, "BEND:LTUS:167:BCON.HIHI") field(OUTD, "BEND:LTUS:167:BCON.LOLO PP") field(FTVA, "DOUBLE") field(FTVB, "DOUBLE") field(FTVC, "DOUBLE") field(FTVD, "DOUBLE") field(BRSV, "INVALID") field(FLNK, "BEND:LTUS:167:IDELTAS") } # The following PV is processed by :BACT # which is processed by :BACT # record(fanout, "BEND:LTUS:167:BACTFO") { field(DESC, "BACT processing") field(SELM, "All") field(LNK1, "BEND:LTUS:167:BDIFF") field(LNK2, "BEND:LTUS:167:BADIFF") field(LNK3, "BEND:LTUS:167:BRATIO") field(LNK4, "BEND:LTUS:167:MPSLIMITS") field(LNK5, "BEND:LTUS:167:I2BSTATUS") field(LNK6, "BEND:LTUS:167:IACTFO.PROC") } record(calc, "BEND:LTUS:167:BDIFF") { field(DESC, "BDES-BACT") field(CALC, "A-B") field(INPA, "BEND:LTUS:167:BDES") field(INPB, "BEND:LTUS:167:BACT") field(EGU, "kG-m") field(PREC, "7") } record(calc, "BEND:LTUS:167:BADIFF") { field(DESC, "Absolute BDES-BACT") field(INPA, "BEND:LTUS:167:BDIFF") field(EGU, "kG-m") field(PREC, "7") field(CALC, "A<0?ABS(A):A") } record(calc, "BEND:LTUS:167:BRATIO") { field(DESC, "BACT Error") field(CALC, "B?A/B:0") field(INPA, "BEND:LTUS:167:BDIFF") field(INPB, "BEND:LTUS:167:BDES.HOPR") field(EGU, "kG-m") field(PREC, "7") } record(mbbi, "BEND:LTUS:167: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, "BEND:LTUS:167:BACT.J") } # Note: for a string slave set the MONFL # macro to the following: # MONFL=:IMONCALC MS record(sub, "BEND:LTUS:167:BMON") { field(DESC, "Second Transductor") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "BEND:LTUS:167:BMON") field(INPB, "BEND:LTUS:167:POLYCOEF") field(INPC, "BEND:LTUS:167:POLYCOEF.A") field(INPD, "BEND:LTUS:167:POLYCOEF.B") field(INPE, "BEND:LTUS:167:IMONCALC MS") field(INPF, "BEND:LTUS:167:BDELTAS.VAL") field(INPG, "100") field(EGU, "kG-m") field(HOPR, "4.5125") field(LOPR, "0.0135") field(HIHI, "4.5125") field(LOLO, "0.0135") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "4.5125") field(LOW, "0.0135") } # 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=BEND:LTUS:166:BDES CP record(ao, "BEND:LTUS:167:BDES") { field(DESC, "Desired B-Field") field(PINI, "NO") field(DRVH, "4.5125") field(DRVL, "0.0135") field(HOPR, "4.5125") field(LOPR, "0.0135") field(PREC, "7") field(EGU, "kG-m") field(MDEL, "-1") field(OMSL, "closed_loop") field(DOL, "BEND:LTUS:167:IDES2BDES") field(OUT, "BEND:LTUS:167:B2IDES PP") info(autosaveFields,"VAL") } record(sub, "BEND:LTUS:167:B2IDES") { field(DESC, "Convert Desired B-Field to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "BEND:LTUS:167:POLYCOEF") field(INPC, "BEND:LTUS:167:POLYCOEF.A") field(INPD, "BEND:LTUS:167:POLYCOEF.B") field(PREC, "7") field(EGU, "kG-m") field(HOPR, "4.5125") field(LOPR, "0.0135") field(MDEL, "-1") field(INPE, "BEND:LTUS:167:BDES.DRVH") field(INPF, "BEND:LTUS:167:BDES.DRVL") field(BRSV, "INVALID") field(FLNK, "BEND:LTUS:167:IDES") } record(sub, "BEND:LTUS:167:BNOM") { field(DESC, "Nominal Field") field(PINI, "YES") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "BEND:LTUS:167:POLYCOEF") field(INPC, "BEND:LTUS:167:POLYCOEF.A") field(INPD, "BEND:LTUS:167:POLYCOEF.B") field(INPE, "BEND:LTUS:167:BDES.DRVH") field(INPF, "BEND:LTUS:167:BDES.DRVL") field(EGU, "kG-m") field(HOPR, "4.5125") field(LOPR, "0.0135") field(PREC, "7") field(VAL, "0.0") field(FLNK, "BEND:LTUS:167:INOM") } record(sub, "BEND:LTUS:167:BACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "BEND:LTUS:167:BDES.VAL") field(INPB, "BEND:LTUS:167:BDES.DRVH") field(INPC, "BEND:LTUS:167:BDES.DRVL") field(INPD, "BEND:LTUS:167:BDELTAS.I") field(INPE, "BEND:LTUS:167:BDELTAS.J") field(INPG, "BEND:LTUS:167:STATE") field(INPH, "BEND:LTUS:167:HSTA") field(EGU, "kG-m") field(HOPR, "4.5125") field(LOPR, "0.0135") field(PREC, "7") field(BRSV, "INVALID") } record(sub, "BEND:LTUS:167:BMONLIMITS") { field(DESC, "MON Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "BEND:LTUS:167:BDES.VAL") field(INPB, "BEND:LTUS:167:BDES.DRVH") field(INPC, "BEND:LTUS:167:BDES.DRVL") field(INPD, "BEND:LTUS:167:BDELTAS.K") field(INPE, "BEND:LTUS:167:BDELTAS.L") field(INPG, "BEND:LTUS:167:STATE") field(INPH, "BEND:LTUS:167:HSTA") field(EGU, "kG-m") field(HOPR, "4.5125") field(LOPR, "0.0135") field(PREC, "7") field(BRSV, "INVALID") } record(seq, "BEND:LTUS:167:BLIMITS") { field(DESC, "ACT Limits") field(PREC, "7") field(DOL1, "BEND:LTUS:167:BLIMITS") field(LNK1, "BEND:LTUS:167:BACTLIMITS.F PP") field(DOL2, "BEND:LTUS:167:BACTLIMITS.I") field(LNK2, "BEND:LTUS:167:BACT.HIGH") field(DOL3, "BEND:LTUS:167:BACTLIMITS.J") field(LNK3, "BEND:LTUS:167:BACT.LOW") field(DOL4, "BEND:LTUS:167:BACTLIMITS.K") field(LNK4, "BEND:LTUS:167:BACT.HIHI") field(DOL5, "BEND:LTUS:167:BACTLIMITS.L") field(LNK5, "BEND:LTUS:167:BACT.LOLO") field(DOL6, "BEND:LTUS:167:BLIMITS") field(LNK6, "BEND:LTUS:167:BMONLIMITS.F PP") field(DOL7, "BEND:LTUS:167:BMONLIMITS.I") field(LNK7, "BEND:LTUS:167:BMON.HIGH") field(DOL8, "BEND:LTUS:167:BMONLIMITS.J") field(LNK8, "BEND:LTUS:167:BMON.LOW") field(DOL9, "BEND:LTUS:167:BMONLIMITS.K") field(LNK9, "BEND:LTUS:167:BMON.HIHI") field(DOLA, "BEND:LTUS:167:BMONLIMITS.L") field(LNKA, "BEND:LTUS:167:BMON.LOLO") field(FLNK, "BEND:LTUS:167:ILIMITS") field(SCAN, "5 second") } record(ao, "BEND:LTUS:167:BCTRL") { field(DESC, "B-Perturb") field(PREC, "7") field(EGU, "kG-m") field(DRVH, "4.5125") field(DRVL, "0.0135") field(HOPR, "4.5125") field(LOPR, "0.0135") # 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, "BEND:LTUS:167: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, "BEND:LTUS:167:BCTRLGO") { field(DESC, "Update DES and perturb") field(PREC, "7") # Disable BACT limits field(DOL1, "1") field(LNK1, "BEND:LTUS:167:BLIMITS.VAL") # Update BDES with the BCTRL (slider) value field(DOL2, "BEND:LTUS:167:BCTRL.VAL") field(LNK2, "BEND:LTUS:167:BDES PP") field(DOL3, "1") field(LNK3, "BEND:LTUS:167:IDIRECT.PROC PP") field(DOL4, "1") field(LNK4, "BEND:LTUS:167:CHECKSTDZLOST.PROC PP") field(DOL5, "BEND:LTUS:167:BCTRL.VAL") field(LNK5, "BEND:LTUS:167:BCTRLSUB PP") # Re-enable BACT limits field(DOL6, "0") field(LNK6, "BEND:LTUS:167:BLIMITS.VAL") } # Convert B-field to Current and output to ISETPT record(sub, "BEND:LTUS:167:BCTRLSUB") { field(DESC, "Feedback") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "BEND:LTUS:167:POLYCOEF") field(INPC, "BEND:LTUS:167:POLYCOEF.A") field(INPD, "BEND:LTUS:167:POLYCOEF.B") field(INPE, "BEND:LTUS:167:BDES.DRVH") field(INPF, "BEND:LTUS:167:BDES.DRVL") field(PREC, "7") field(EGU, "kG-m") field(HOPR, "4.5125") field(LOPR, "0.0135") field(MDEL, "-1") field(BRSV, "INVALID") field(FLNK, "BEND:LTUS:167:ISETPT") } record(ao, "BEND:LTUS:167:BDESPREVTRIM") { field(DESC, "trim bdes for undo") field(DTYP, "Soft Channel") field(DRVH, "4.5125") field(DRVL, "0.0135") field(EGU, "kG-m") field(HOPR, "4.5125") field(LOPR, "0.0135") field(PREC, "7") field(PINI, "YES") info(autosaveFields,"VAL") } record(stringin, "BEND:LTUS:167:MADNAME") { field(DESC, "MAD deck nomenclature") field(PINI, "YES") field(VAL, "BCX31B3") } record(ai, "BEND:LTUS:167: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, "3246.34204") } record(ao, "BEND:LTUS:167:BMAX") { field(DESC, "Max B-Field") field(DTYP, "Soft Channel") field(DRVH, "4.5125") field(DRVL, "0.0135") field(EGU, "kG-m") field(HOPR, "4.5125") field(LOPR, "0.0135") field(PREC, "7") field(PINI, "YES") field(VAL, "4.5125") field(FLNK, "BEND:LTUS:167:BSTEP") } record(ao, "BEND:LTUS:167:BMIN") { field(DESC, "Min B-Field") field(DTYP, "Soft Channel") field(DRVH, "4.5125") field(DRVL, "0.0135") field(EGU, "kG-m") field(HOPR, "4.5125") field(LOPR, "0.0135") field(PREC, "7") field(PINI, "YES") field(VAL, "0.0135") field(FLNK, "BEND:LTUS:167:BSTEP") } record(ao, "BEND:LTUS:167:BDESSAVE") { field(DESC, "bdes for save/load") field(DTYP, "Soft Channel") field(DRVH, "4.5125") field(DRVL, "0.0135") field(EGU, "kG-m") field(HOPR, "4.5125") field(LOPR, "0.0135") field(PINI, "YES") field(PREC, "7") } # This record is processed by BEND:LTUS:167: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, "BEND:LTUS:167:BCON") { field(DESC, "Config B-Field ") field(DTYP, "Soft Channel") field(PREC, "7") field(EGU, "kG-m") field(HOPR, "4.5125") field(LOPR, "0.0135") field(DRVH, "4.5125") field(DRVL, "0.0135") # 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 , "BEND:LTUS:167:ICON2BCON") field(OMSL, "closed_loop") field(OUT, "BEND:LTUS:167:B2ICON PP") info(autosaveFields,"VAL") } record(sub, "BEND:LTUS:167:B2ICON") { field(DESC, "Convert Desired ICon to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "BEND:LTUS:167:POLYCOEF") field(INPC, "BEND:LTUS:167:POLYCOEF.A") field(INPD, "BEND:LTUS:167:POLYCOEF.B") field(PREC, "7") field(EGU, "kG-m") field(HOPR, "4.5125") field(LOPR, "0.0135") field(MDEL, "-1") field(INPE, "BEND:LTUS:167:BCON.DRVH") field(INPF, "BEND:LTUS:167:BCON.DRVL") field(BRSV, "INVALID") field(FLNK, "BEND:LTUS:167: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, "BEND:LTUS:167:BSTEP") { field(DESC, "B-Field step size") field(CALC, "(C==3)||(D==3)?0:ABS(A-B)*0.005") field(INPA, "BEND:LTUS:167:BMAX") field(INPB, "BEND:LTUS:167:BMIN") field(INPC, "BEND:LTUS:167:BMIN.SEVR") field(INPD, "BEND:LTUS:167:BMAX.SEVR") field(EGU, "kG-m") 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,"BEND:LTUS:167:BCTRLDISABLECALC") { field(DESC, "Calc for disabling BCTRL") field(ASG, "Internal") field(CALC, "A?2:1") field(INPA, "BEND:LTUS:167:ONLINE CP") field(OUT, "BEND:LTUS:167:BCTRLDISABLEFOUT PP") } record(fanout, "BEND:LTUS:167:BCTRLDISABLEFOUT") { field(DESC, "Disable BCTRL fanout") field(SELM, "Specified") field(SELL, "BEND:LTUS:167:BCTRLDISABLECALC") field(LNK1, "BEND:LTUS:167:BCTRLDISABLE") field(LNK2, "BEND:LTUS:167:BCTRLENABLE") } record(stringout, "BEND:LTUS:167:BCTRLDISABLE") { field(DESC, "Disable BCTRL") field(DTYP, "Soft Channel") field(OUT, "BEND:LTUS:167:BCTRL.ASG") field(VAL, "NOWRITE") field(FLNK, "BEND:LTUS:167:BCTRLDISV_UPDATE") } record(stringout, "BEND:LTUS:167:BCTRLENABLE") { field(DESC, "Enable BCTRL") field(DTYP, "Soft Channel") field(OUT, "BEND:LTUS:167:BCTRL.ASG") field(VAL, "") field(FLNK, "BEND:LTUS:167:BCTRLDISV_UPDATE") } record(calcout, "BEND:LTUS:167:BCTRLDISV_UPDATE") { field(DESC, "Calc for updating BCTRL.DISV") field(ASG, "Internal") field(CALC, "A") field(INPA, "BEND:LTUS:167:ONLINE") field(OUT, "BEND:LTUS:167: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,"BEND:LTUS:167:BACT and MON\n are processed via links from \n BEND:LTUS:167:IACT (device raw value readback 1)\n and\n BEND:LTUS:167: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 BEND:LTUS:167:POLYCOEF\nC = First polynomial coefficient (offset if linear)\nD = Second polynomial coefficient (slope if linear)\nE = BEND:LTUS:167: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,"BEND:LTUS:167:BDES\n is processed when set by CA users or \n BEND:LTUS:167: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,"BEND:LTUS:167: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 BEND:LTUS:167: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 (BEND:LTUS:167: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,"BEND:LTUS:167:B*LIMITS and BEND:LTUS:167:BLIMITS:\n Calculate alarm and warning limits based on \n deltas from BEND:LTUS:167: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,"BEND:LTUS:167: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,"BEND:LTUS:167: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, "BEND:LTUS:167: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, "BEND:LTUS:167:MPSBTOL") { field(DESC, "Absolute mps tol") field(EGU, "kG-m") field(PREC, "2") field(CALC, "ABS(A)*0.02") field(INPA, "BEND:LTUS:167:BMAX") field(PINI, "YES") } # # 21-Aug-2013: K. Luchini # Set channel access security so that users # cannot easily change values. record(ao, "BEND:LTUS:167:MPSBMAX") { field(DESC, "MPS Max B-field") field(EGU, "kG-m") field(PREC, "7") field(DRVH, "4.5125") field(DRVL, "0.0135") field(PINI, "YES") field(VAL, "4.5125") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:167:MPSBMIN") { field(DESC, "MPS Min B-field") field(EGU, "kG-m") field(PREC, "7") field(DRVH, "4.5125") field(DRVL, "0.0135") field(PINI, "YES") field(VAL, "0.0135") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:167:MPSBLLIM") { field(DESC, "MPS Low Limit B-field") field(EGU, "kG-m") field(PREC, "7") field(DRVH, "4.5125") field(DRVL, "0.0135") field(PINI, "YES") field(VAL, "0.0135") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:167:MPSBLLIM2") { field(DESC, "MPS Low Limit #2 B-field") field(EGU, "kG-m") field(PREC, "7") field(DRVH, "4.5125") field(DRVL, "0.0135") field(PINI, "YES") field(VAL, "0.0135") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } # Set the default to Std record(mbbo, "BEND:LTUS:167: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, "BEND:LTUS:167:MPSLIMITS.E PP") } record(aSub, "BEND:LTUS:167: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, "BEND:LTUS:167:MPS.RVAL") field(INPB, "BEND:LTUS:167:BADIFF") field(INPC, "BEND:LTUS:167:BDELTAS.N") field(INPD, "BEND:LTUS:167:BACT") field(INPE, "BEND:LTUS:167:MPSBITMASK.RVAL") field(INPF, "BEND:LTUS:167:MPSBLLIM") field(INPG, "BEND:LTUS:167:MPSBMIN") field(INPH, "BEND:LTUS:167:MPSBMAX") field(INPI, "BEND:LTUS:167: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, "BEND:LTUS:167:INTOL.RVAL PP") field(OUTB, "BEND:LTUS:167:INTOL_BMIN.RVAL PP") field(OUTC, "BEND:LTUS:167:INTOL_BRANGE.RVAL PP") field(OUTD, "BEND:LTUS:167: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, "BEND:LTUS:167:INTOL") { field(DESC, "BACT within MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "BEND:LTUS:167:MPSLIMITS.VALA") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "BEND:LTUS:167:INTOL_BMIN") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "BEND:LTUS:167:MPSLIMITS.VALB") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "BEND:LTUS:167:INTOL_BMIN2") { field(DESC, "MPS tol #2") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "BEND:LTUS:167:MPSLIMITS.VALD") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "BEND:LTUS:167:INTOL_BRANGE") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "BEND:LTUS:167: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, "BEND:LTUS:167:CHCKITOL") { field(DESC, "Absolute Check I Tolerance") field(EGU, "A") field(FLNK, "BEND:LTUS:167:TRIMITOL") field(CALC, "ABS(A*B)") field(INPA, "BEND:LTUS:167:CHCKBTOL") field(INPB, "BEND:LTUS:167:POLYCOEF.B") field(PREC, "9") } record(calc, "BEND:LTUS:167:TRIMBTOL") { field(EGU, "kG-m") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(DESC, "Absolute Trim Tolerance") field(CALC, "ABS(A)/2") field(INPA, "BEND:LTUS:167:CHCKBTOL") field(FLNK, "BEND:LTUS:167:CHCKITOL") } record(calc, "BEND:LTUS:167:CHCKBTOL") { field(DESC, "Check absolute tolerance") field(EGU, "A") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(FLNK, "BEND:LTUS:167:TRIMBTOL") field(CALC, "MAX(ABS(A),ABS(C))*(B/1000000)") field(INPA, "BEND:LTUS:167:BDES.HOPR") field(INPB, "BEND:LTUS:167:STABILITY") field(INPC, "BEND:LTUS:167:BDES.LOPR") } record(longout, "BEND:LTUS:167: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, "BEND:LTUS:167:CHCKBTOL") } record(calc, "BEND:LTUS:167:TRIMITOL") { field(DESC, "Absolute Trim I Tolerance") field(EGU, "kG-m") field(CALC, "ABS(A*B)") field(INPA, "BEND:LTUS:167:POLYCOEF.B") field(INPB, "BEND:LTUS:167:TRIMBTOL") field(PREC, "9") } record(ai, "BEND:LTUS:167:TRIMBTOLR") { field(DESC, "Relative trim tol") field(PREC, "4") field(EGU, "%") field(HOPR, "1.0") field(LOPR, "0.0") field(PINI, "YES") } record(ai, "BEND:LTUS:167: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, "BEND:LTUS:167:FBCKFCOM") { field(ZNAM, "CA") field(ONAM, "FCOM") field(DESC, "CA Mode") field(PINI, "YES") field(SDIS, "0") } record(bo, "BEND:LTUS:167:PAU") { field(ZNAM, "NotConfigured") field(ONAM, "Configured") field(DESC, "PAU Present") field(PINI, "YES") field(SDIS, "0") field(FLNK, "BEND:LTUS:167:PAUGO") } record(fanout, "BEND:LTUS:167:PAUGO") { field(DESC, "PAU control") field(LNK1, "BEND:LTUS:167:PAUSTOP") field(LNK2, "BEND:LTUS:167: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, "BEND:LTUS:167:PAUSTART") { field(DESC, "Setup for PAU On") field(SDIS, "BEND:LTUS:167: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, "BEND:LTUS:167:PAUSTOP") { field(DESC, "Setup for PAU Off") field(SDIS, "BEND:LTUS:167: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, "BEND:LTUS:167:MCORDEVNAME") { field(DESC, "PS device name") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, "BEND:LTUS:166:") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "BEND:LTUS:167: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, "BEND:LTUS:167:PSTYPE.RVAL") field(INPC, "BEND:LTUS:167:TURNEDOFF.RVAL") field(INPD, "BEND:LTUS:167:CONFIG.RVAL") field(INPE, "BEND:LTUS:167:PSCATEGORY.RVAL") field(INPF, "BEND:LTUS:167:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "BEND:LTUS:167:AUTOCTRL.RVAL") field(INPJ, "BEND:LTUS:167:OUTOFSERVICE.RVAL") field(INPL, "BEND:LTUS:167:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "BEND:LTUS:167:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "BEND:LTUS:167:PAU") field(INPP, "BEND:LTUS:167:CALBDISABLE.RVAL") field(INPQ, "BEND:LTUS:167:PTRBDISABLE.RVAL") field(INPR, "BEND:LTUS:167:TRIMDISABLE.RVAL") field(INPS, "BEND:LTUS:167:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "BEND:LTUS:167:FBCK") field(INPU, "BEND:LTUS:167:TRIMTYPE.RVAL") field(INPV, "BEND:LTUS:167:STDZDIRECT.RVAL") field(INPW, "BEND:LTUS:167:DEGAUSENABLE.RVAL") field(FLNK, "BEND:LTUS:167:HSTA") } record(longin, "BEND:LTUS:167:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "BEND:LTUS:167:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "BEND:LTUS:167: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, "BEND:LTUS:167: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, "BEND:LTUS:167: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, "BEND:LTUS:167: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, "BEND:LTUS:167: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, "BEND:LTUS:167: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 BEND:LTUS:167:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses BEND:LTUS:167:FBCK. # This PV should be replaced by BEND:LTUS:167: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, "BEND:LTUS:167: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, "BEND:LTUS:167: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, "BEND:LTUS:167: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, "BEND:LTUS:166:OUTOFSERVICE CPP NMS") field(OMSL, "closed_loop") field(FLNK, "BEND:LTUS:167:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"BEND:LTUS:167:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "BEND:LTUS:167:OUTOFSERVICE NPP NMS") field(OUT, "BEND:LTUS:167:ONLINE PP") } record(bo, "BEND:LTUS:167:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "BEND:LTUS:167: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, "BEND:LTUS:167: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, "BEND:LTUS:167: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, "BEND:LTUS:167: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, "BEND:LTUS:167: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, "BEND:LTUS:167: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, "BEND:LTUS:167: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, "BEND:LTUS:167: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, "BEND:LTUS:167: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, "BEND:LTUS:167: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, "BEND:LTUS:167: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, "BEND:LTUS:167:TRIMTYPE") } record(stringout, "BEND:LTUS:167:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "BEND:LTUS:166:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "BEND:LTUS:167:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "BEND:LTUS:167:STATE.RVAL") field(INPB, "BEND:LTUS:167:INTLKSUMY.RVAL") field(OUT, "BEND:LTUS:167:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "BEND:LTUS:167: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, "BEND:LTUS:167:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "BEND:LTUS:167:STATE.RVAL") field(INPB, "BEND:LTUS:167:INTLKSUMY.RVAL") field(OUT, "BEND:LTUS:167:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "BEND:LTUS:167:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "BEND:LTUS:167:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "BEND:LTUS:167: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, "BEND:LTUS:167: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, "BEND:LTUS:167: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, "BEND:LTUS:167: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,"BEND:LTUS:167: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("BEND:LTUS:167:TURNEDOFF",3140,1907,0,1,"BEND:LTUS:167:TURNEDOFF") #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "BEND:LTUS:167:STATSUB") { field(DESC, "Build STATus ") field(INAM, "mgntInit") field(SNAM, "mgntSlcStat") field(INPA, "BEND:LTUS:167:BACT.STAT") field(INPB, "BEND:LTUS:167:BDES.STAT") field(INPC, "BEND:LTUS:167: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, "BEND:LTUS:167:BACT.SEVR") field(INPH, "BEND:LTUS:167:BDES.SEVR") field(INPI, "BEND:LTUS:167: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, "BEND:LTUS:167:STATE.RVAL") field(INPN, "BEND:LTUS:167:STDZOK") field(INPO, "BEND:LTUS:167:CALBOK") field(INPP, "BEND:LTUS:167:OUTOFSERVICE.RVAL") field(INPQ, "BEND:LTUS:167:CONFIG.RVAL") field(INPR, "BEND:LTUS:167:HSTA") field(INPS, "BEND:LTUS:167:CTRL.RVAL") field(INPT, "BEND:LTUS:167:DEGAUSOK") field(INPV, "BEND:LTUS:167: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, "BEND:LTUS:167:STAT") } record(longout, "BEND:LTUS:167:STAT") { field(DESC, "STAT sent to SLC") field(SCAN, "Passive") field(FLNK, "BEND:LTUS:167:STATCTRLSUB") field(DOL, "BEND:LTUS:167:STATSUB.VAL") field(OMSL, "closed_loop") } record(sSub, "BEND:LTUS:167:STATCTRLSUB") { field(DESC, "Decode SLC STAT into mbbo") field(INAM, "mgntInit") field(SNAM, "mgntStatDecode") field(INPA, "BEND:LTUS:167:STAT") field(INPB, "BEND:LTUS:167:HSTA") field(INPD, "BEND:LTUS:167:ONOFFCTRL.RVAL") field(FLNK, "BEND:LTUS:167:STATMSG") } record(mbbo, "BEND:LTUS:167: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, "BEND:LTUS:167:UNAVAILGO") field(DOL, "BEND:LTUS:167:STATCTRLSUB.W") } record(seq, "BEND:LTUS:167:UNAVAILGO") { field(DESC, "Process UNAVAIL") field(DOL1, "BEND:LTUS:167:STATSUB.U") field(LNK1, "BEND:LTUS:167:UNAVAIL PP") } record(stringout, "BEND:LTUS:167:SNLSTATMSG") { field(DTYP, "Soft Channel") } #! TextBox(TB0,820,1000,1200,1220,0,"Dialog",12,1,16777215,"BEND:LTUS:167:STATUSSUB - future\nOverall device status - takes input from action snls, record sevrs, master snl(s) and outputs final status\n\nInputs:\nA - BEND:LTUS:167:CTRLSTATUS - snl status\nB - MGNT:CTRLSTATUS - master list status\nC\nD - BEND:LTUS:167: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,"BEND:LTUS:167STATSUB\nformat control bo's into slc STAT\n\nInputs:\nA - BEND:LTUS:167:STATUS\nC - BEND:LTUS:167:ON\nD - BEND:LTUS:167:STDZOK\nE - BEND:LTUS:167:CALBOK\nF - BEND:LTUS:167:BACTDRIFT (future)\nG -\nH- BEND:LTUS:167:DACSTATUS\nI -BEND:LTUS:167:ADCSTATUS\nJ - BEND:LTUS:167:BACTSTATUS\nK - BEND:LTUS:167:BDESSTATUS\nL - BEND:LTUS:167:RIPLSTATUS\n\nOutput:\nP - BEND:LTUS:167: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, "BEND:LTUS:167: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, "BEND:LTUS:167: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, "BEND:LTUS:167: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, "BEND:LTUS:167: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, "BEND:LTUS:167:IDESTOTAL"){ field(DESC, "Calc total current") field(CALC, "A+B") field(EGU, "kG-m") field(PREC, "7") field(INPA, "BEND:LTUS:166:IDES CP NMS") field(INPB, "BTRM:LTUS:167:BDES CP NMS") field(OUT, "BEND:LTUS:167:IDES2BDES.E PP") } record(sub, "BEND:LTUS:167:IDES2BDES") { field(DESC, "Cal BDES") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "BEND:LTUS:167:IDES2BDES") field(INPB, "BEND:LTUS:167:POLYCOEF") field(INPC, "BEND:LTUS:167:POLYCOEF.A") field(INPD, "BEND:LTUS:167:POLYCOEF.B") field(INPE, "BEND:LTUS:167:IDESTOTAL MS") field(INPF, "BEND:LTUS:166:BDELTAS PP") field(INPG, "100") field(EGU, "kG-m") field(HOPR, "4.5125") field(LOPR, "0.0135") field(HIHI, "4.5125") field(LOLO, "0.0135") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "4.5125") field(LOW, "0.0135") field(FLNK, "BEND:LTUS:167: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, "BEND:LTUS:167:IACTCALC"){ field(DESC, "Calc total act current") field(CALC, "A+B") field(EGU, "kG-m") field(PREC, "7") field(INPA, "BEND:LTUS:167:IACT CP NMS") field(INPB, "BTRM:LTUS:167:BACT") field(OUT, "BEND:LTUS:167: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, "BEND:LTUS:167:IMONCALC"){ field(DESC, "Calc total mon current") field(CALC, "A+B") field(EGU, "kG-m") field(PREC, "7") field(INPA, "BEND:LTUS:167:IMON CP NMS") field(INPB, "BTRM:LTUS:167:BMON") field(OUT, "BEND:LTUS:167: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, "BEND:LTUS:167:ICONTOTAL"){ field(DESC, "Calc total current") field(CALC, "A+B") field(EGU, "kG-m") field(PREC, "7") field(INPA, "BEND:LTUS:166:ICON CP NMS") field(INPB, "BTRM:LTUS:167:BCON CP NMS") field(OUT, "BEND:LTUS:167:ICON2BCON.E PP") } record(sub, "BEND:LTUS:167:ICON2BCON") { field(DESC, "Cal BCON") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "BEND:LTUS:167:ICON2BCON") field(INPB, "BEND:LTUS:167:POLYCOEF") field(INPC, "BEND:LTUS:167:POLYCOEF.A") field(INPD, "BEND:LTUS:167:POLYCOEF.B") field(INPE, "BEND:LTUS:167:ICONTOTAL MS") field(INPF, "BEND:LTUS:166:BDELTAS PP") field(INPG, "100") field(EGU, "kG-m") field(HOPR, "4.5125") field(LOPR, "0.0135") field(HIHI, "4.5125") field(LOLO, "0.0135") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "4.5125") field(LOW, "0.0135") field(FLNK, "BEND:LTUS:167:BCON") } #! 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, "BEND:LTUS:168:IACT") { field(DESC, "Current") field(INP, "BEND:LTUS:166:IACT CP NMS") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "BEND:LTUS:168:IACTCALC") info(autosaveFields,"HYST") } record(bi, "BEND:LTUS:168:STATE") { field(DESC, "PS On/Off Status") field(DTYP, "Raw Soft Channel") field(INP, "BEND:LTUS:166:STATE CP MS") field(ZSV, "MAJOR") field(ZNAM, "OFF") field(ONAM, "ON") } record(ao, "BEND:LTUS:168:IDES") { field(DESC, "Desired Current") field(PREC, "3") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(MDEL, "-1") field(HIHI, "250.0") field(LOLO, "0.0") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "BEND:LTUS:168:BDELTAS") field(DRVH, "250.0") field(DRVL, "0.0") field(DOL, "BEND:LTUS:168: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, "BEND:LTUS:168:ICTRL PP") } # This record is processed by BEND:LTUS:168:ICON") # Note: we are not setting alarms here. record(ao, "BEND:LTUS:168:ICON") { field(DESC, "Config I") field(DTYP, "Soft Channel") field(PREC, "3") field(HOPR, "250.0") field(LOPR, "0.0") field(DRVH, "250.0") field(DRVL, "0.0") field(DOL, "BEND:LTUS:168:B2ICON.K") field(OMSL, "closed_loop") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:168:INOM") { field(DESC, "Nominal Current") field(DOL, "BEND:LTUS:168:BNOM.K") field(OMSL, "closed_loop") field(PREC, "3") field(EGU, "A") field(DRVH, "250.0") field(DRVL, "0.0") field(HOPR, "250.0") field(LOPR, "0.0") } record(ao, "BEND:LTUS:168:ICTRL") { field(DESC, "Set Current") field(PREC, "3") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(DRVH, "250.0") field(DRVL, "0.0") field(MDEL, "-1") field(FLNK, "BEND:LTUS:168:ICTRLGO") field(OMSL, "supervisory") info(autosavefields,"VAL") } record(seq, "BEND:LTUS:168:ICTRLGO") { field(DESC, "Process Current Setpoint") field(PREC, "3") # Set ISETPT to supervisory field(DOL1, "0") field(LNK1, "BEND:LTUS:168:ISETPT.OMSL") field(DOL2, "BEND:LTUS:168:ICTRL") field(LNK2, "BEND:LTUS:168:ISETPT PP") # Set ISETPT to closed loop - get data from BCTRLSUB.K field(DOL3, "1") field(LNK3, "BEND:LTUS:168:ISETPT.OMSL") } record(ao, "BEND:LTUS:168:IMAX") { field(DESC, "Max I") field(DTYP, "Soft Channel") field(DRVH, "250.0") field(DRVL, "0.0") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(PREC, "3") field(PINI, "YES") field(VAL, "250.0") field(FLNK, "BEND:LTUS:168:IMIN") } record(ao, "BEND:LTUS:168:IMIN") { field(DESC, "Min I") field(DTYP, "Soft Channel") field(DRVH, "250.0") field(DRVL, "0.0") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(PREC, "3") field(VAL, "0.0") field(FLNK, "BEND:LTUS:168:IRANGE") } record(sel, "BEND:LTUS:168:IACTPREVOK") { field(DESC, "Last Good Current") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(PREC, "3") field(NVL, "BEND:LTUS:168:BACT.SEVR") field(INPA, "BEND:LTUS:168:IACT NPP MS") field(INPB, "BEND:LTUS:168:IACTPREVOK NPP MS") field(INPC, "BEND:LTUS:168:IACTPREVOK NPP MS") field(INPD, "BEND:LTUS:168:IACTPREVOK NPP MS") } record(sub, "BEND:LTUS:168:IACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "BEND:LTUS:168:IDES") field(INPB, "BEND:LTUS:168:ISETPT.DRVH") field(INPC, "BEND:LTUS:168:ISETPT.DRVL") field(INPD, "BEND:LTUS:168:IDELTAS.I") field(INPE, "BEND:LTUS:168:IDELTAS.J") field(INPG, "BEND:LTUS:168:STATE") field(INPH, "BEND:LTUS:168:HSTA") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(sub, "BEND:LTUS:168:IMONLIMITS") { field(DESC, "Aux Current Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "BEND:LTUS:168:IDES") field(INPB, "BEND:LTUS:168:ISETPT.DRVH") field(INPC, "BEND:LTUS:168:ISETPT.DRVL") field(INPD, "BEND:LTUS:168:IDELTAS.K") field(INPE, "BEND:LTUS:168:IDELTAS.L") field(INPG, "BEND:LTUS:168:STATE") field(INPH, "BEND:LTUS:168:HSTA") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(seq, "BEND:LTUS:168:ILIMITS") { field(DESC, "Set ACT and MON Limits") field(PREC, "3") field(DOL1, "BEND:LTUS:168:BLIMITS") field(LNK1, "BEND:LTUS:168:IACTLIMITS.F PP") field(DOL2, "BEND:LTUS:168:IACTLIMITS.I") field(LNK2, "BEND:LTUS:168:IACT.HIGH") field(DOL3, "BEND:LTUS:168:IACTLIMITS.J") field(LNK3, "BEND:LTUS:168:IACT.LOW") field(DOL4, "BEND:LTUS:168:IACTLIMITS.K") field(LNK4, "BEND:LTUS:168:IACT.HIHI") field(DOL5, "BEND:LTUS:168:IACTLIMITS.L") field(LNK5, "BEND:LTUS:168:IACT.LOLO") field(DOL6, "BEND:LTUS:168:BLIMITS") field(LNK6, "BEND:LTUS:168:IMONLIMITS.F PP") field(DOL7, "BEND:LTUS:168:IMONLIMITS.I") field(LNK7, "BEND:LTUS:168:IMON.HIGH") field(DOL8, "BEND:LTUS:168:IMONLIMITS.J") field(LNK8, "BEND:LTUS:168:IMON.LOW") field(DOL9, "BEND:LTUS:168:IMONLIMITS.K") field(LNK9, "BEND:LTUS:168:IMON.HIHI") field(DOLA, "BEND:LTUS:168:IMONLIMITS.L") field(LNKA, "BEND:LTUS:168: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, "BEND:LTUS:168:IDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntRawDeltas") field(INPD, "BEND:LTUS:168:TRIMBTOL") field(INPE, "BEND:LTUS:168:CHCKBTOL") field(INPF, "BEND:LTUS:168:BDELTAS.K") field(INPG, "BEND:LTUS:168:BDELTAS.L") field(INPH, "BEND:LTUS:168: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, "BEND:LTUS:168:STDZITOLR") field(INPC, "BEND:LTUS:168:STDZITOL") field(FLNK, "") } # All ps controllers with on/off control will set the macro ONOF # as follows: # # ONOF = BEND:LTUS:166: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, "BEND:LTUS:168: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 = BEND:LTUS:166:RESET PP # record(bo, "BEND:LTUS:168: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, "BEND:LTUS:168:RAMPSTATE") { field(DESC, "PS Ramp Status") field(DTYP, "Soft Channel") field(DOL, "BEND:LTUS:166: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, "BEND:LTUS:168: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, "BEND:LTUS:168:TRIMRAMPRATE") field(OUT, "") field(FLNK, "BEND:LTUS:168:STDZDLY") } record(ao, "BEND:LTUS:168:ISETPT") { field(DESC, "Current Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(DRVH, "250.0") field(DRVL, "0.0") field(MDEL, "-1") field(OUT, "") field(DOL, "BEND:LTUS:168: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, "BEND:LTUS:168:IMON") { field(DESC, "Aux Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(INP, "BEND:LTUS:166:IMON CP NMS") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "BEND:LTUS:168:IMONCALC") } record(ao, "BEND:LTUS:168:IRIPL") { field(DESC, "Ripple Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(DOL, "BEND:LTUS:166:IRIPL CP NMS") field(OMSL, "closed_loop") field(EGU, "A") field(DRVH, "1.0") field(HOPR, "1.0") field(PREC, "3") field(FLNK, "BEND:LTUS:168:IRIPLOK") } record(sub, "BEND:LTUS:168:IRIPLOK") { field(DESC, "Ripple Current Status") field(INAM, "mgntInit") field(SNAM, "mgntRiplOK") field(INPA, "BEND:LTUS:168:IRIPL.VAL") field(INPB, "BEND:LTUS:168: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, "BEND:LTUS:168:R") { field(DESC, "Resistance") field(EGU, "Ohms") field(PREC, "4") field(PINI, "YES") field(DOL, "BEND:LTUS:166: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, "BEND:LTUS:168:IGND") { field(DESC, "Ground Current") field(EGU, "A") field(PREC, "6") field(PINI, "YES") field(DOL, "BEND:LTUS:166:IGND CP MS") field(OMSL, "closed_loop") } record(bi, "BEND:LTUS:168:INTLKSUMY") { field(DESC, "Interlock Summary") field(INP, "BEND:LTUS:166:INTLKSUMY CP MS") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(ZNAM, "OK") field(ONAM, "FAULT") field(PINI, "NO") } record(mbbo, "BEND:LTUS:168: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, "BEND:LTUS:166:COOLING CP NMS") field(OMSL, "closed_loop") } # The following PV is processed by :BACTFO # which is processed by :BACT record(fanout, "BEND:LTUS:168:IACTFO") { field(DESC, "IACT processing") field(SELM, "All") field(LNK1, "BEND:LTUS:168:IACTPREVOK") field(LNK2, "BEND:LTUS:168:IDIFF") field(LNK3, "BEND:LTUS:168:IADIFF") field(LNK4, "BEND:LTUS:168:IRATIO") field(LNK5, "BEND:LTUS:168:IDIRECT") field(LNK6, "BEND:LTUS:168:IACTPOL_CHECK") } record(calc, "BEND:LTUS:168:IDIFF") { field(DESC, "IDES-IACT") field(CALC, "A-B") field(INPA, "BEND:LTUS:168:IDES") field(INPB, "BEND:LTUS:168:IACT") field(EGU, "A") field(PREC, "9") field(HOPR, "250.0") field(LOPR, "0.0") } record(calc, "BEND:LTUS:168:IADIFF") { field(DESC, "Absolute IDES-IACT") field(CALC, "A<0?ABS(A):A") field(INPA, "BEND:LTUS:168:IDIFF") field(PREC, "9") } record(calc, "BEND:LTUS:168:IRATIO") { field(DESC, "IDES-IACT/IMAX") field(CALC, "B?A/B:0") field(INPA, "BEND:LTUS:168:IDIFF") field(INPB, "BEND:LTUS:168:IDES.DRVH") field(PREC, "9") } record(calcout, "BEND:LTUS:168:IRANGE") { field(DESC, "Current Range") field(PINI, "YES") field(CALC, "ABS(A-B)") field(INPA, "BEND:LTUS:168:IMIN") field(INPB, "BEND:LTUS:168: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, "BEND:LTUS:168: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, "BEND:LTUS:168:IACT") field(FLNK, "BEND:LTUS:168:IACTPOL") } record(bo, "BEND:LTUS:168:IACTPOL") { field(DESC, "Actual I Polarity") field(DTYP, "Raw Soft Channel") field(DOL, "BEND:LTUS:168: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,"BEND:LTUS:168:I*LIMITS:\n Calculate alarm and warning limits based on \n deltas from BEND:LTUS:168:IDELTAS and the\n BEND:LTUS:168: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,"BEND:LTUS:168:IACT: \n Get copy of BEND:LTUS:168:I. \n",null) #! TextBox(TB12,1280,3100,1760,3200,0,"Dialog",12,1,16777215,"BEND:LTUS:168: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,"BEND:LTUS:168:IDES:\n Contains raw value calculated by \nBEND:LTUS:168: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 \nBEND:LTUS:168:BDELTAS.\n",null) #! TextBox(TB10,56,1940,316,2340,0,"Dialog",12,1,16777215,"BEND:LTUS:168: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 BEND:LTUS:168: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 BEND:LTUS:168: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,"BEND:LTUS:168:ISETPT:\n Sets the hardware. When fast feedback is set on, this record is\n set to closed loop mode by BEND:LTUS:168:FBCKSTART sequence. When \n the loop is closed, this record takes input calculated by \n BFBCK only. When fast feedback is set off, BEND:LTUS:168:FBCKSTOP \n will set it back to supervisory so that the value can be set by \n BEND:LTUS:168: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, "BEND:LTUS:168:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:168:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "BEND:LTUS:168:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "BEND:LTUS:168:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "BEND:LTUS:168:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "BEND:LTUS:168:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "1") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "BEND:LTUS:168: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, "BEND:LTUS:168:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "BEND:LTUS:168:TRIMTYPE.RVAL") field(INPB, "BEND:LTUS:168:CONFIG.RVAL") field(OUT, "BEND:LTUS:168:TRIMMAXNUM PP") } record(longout, "BEND:LTUS:168: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, "BEND:LTUS:168: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, "BEND:LTUS:166:TRIMRAMPRATE CP NMS") field(OMSL, "closed_loop") field(VAL, "") field(OUT, "BEND:LTUS:168:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "BEND:LTUS:168: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, "BEND:LTUS:166:TRIMSETL CP NMS") field(OMSL, "closed_loop") field(VAL, "") } record(bo, "BEND:LTUS:168: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, "BEND:LTUS:168: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, "BEND:LTUS:168: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, "BEND:LTUS:168:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "0") } record(ao, "BEND:LTUS:168: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, "BEND:LTUS:168:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "BEND:LTUS:168: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, "BEND:LTUS:168: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, "BEND:LTUS:168:IMOVE") field(INPB, "BEND:LTUS:168:IACT") field(INPC, "BEND:LTUS:168:IRAMPRATE") field(INPD, "1.577") field(INPE, "BEND:LTUS:168:TRIMDLYPCT") field(INPF, "BEND:LTUS:168:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "BEND:LTUS:168:RAMPTIME_LEFT PP") } record(longout, "BEND:LTUS:168:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "BEND:LTUS:168:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "BEND:LTUS:168:RAMPDONE_CALC") } record(calc, "BEND:LTUS:168:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "BEND:LTUS:168:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "BEND:LTUS:168:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "BEND:LTUS:168: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, "BEND:LTUS:168:RAMPTIME_LEFT") field(OUT, "BEND:LTUS:168:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "BEND:LTUS:168:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "BEND:LTUS:168:RAMPTIME_LEFT NMS") field(OUT, "BEND:LTUS:168:RAMPDONE PP") } record(bo, "BEND:LTUS:168:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "BEND:LTUS:168:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "BEND:LTUS:168: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, "BEND:LTUS:168: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, "BEND:LTUS:168:STDZINIT") { field(DESC, "Proc. Stdz PVs on boot") field(PINI, "YES") field(DOL1, "1") field(DOL2, "1") field(DOL3, "1") field(LNK1, "BEND:LTUS:168:DEBUG.PROC PP") field(LNK2, "BEND:LTUS:168:STDZCYCLENUM.PROC PP") field(LNK3, "BEND:LTUS:168:STDZDISABLE.PROC PP") field(LNK4, "BEND:LTUS:168: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, "BEND:LTUS:168:STDZSUB") { field(DESC, "Stdz subroutine") field(INAM, "mgntStdzInit") field(SNAM, "mgntStdz") field(BRSV, "INVALID") field(INPA, "BEND:LTUS:168:STDZIMIN NPP NMS") field(INPB, "BEND:LTUS:168:STDZIMAX NPP NMS") field(INPC, "BEND:LTUS:168:STDZIFINAL NPP NMS") field(INPD, "BEND:LTUS:168:STDZCYCLENUM NPP NMS") field(INPE, "BEND:LTUS:168:STDZDIRECT.RVAL NPP NMS") field(INPF, "BEND:LTUS:168:STDZDISABLE.RVAL CPP NMS") field(INPG, "BEND:LTUS:168: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, "BEND:LTUS:168:STDZWF PP") field(OUTB, "BEND:LTUS:168: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, "BEND:LTUS:168:STDZWF") } record(mbbo, "BEND:LTUS:168: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, "BEND:LTUS:168: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, "BEND:LTUS:168:STDZMAINPS") { field(DESC, "Stdz by main or self") field(PINI, "YES") field(DTYP, "Soft Channel") field(ZNAM, "SELF") field(ONAM, "MAIN") } record(bo, "BEND:LTUS:168: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, "BEND:LTUS:168: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, "BEND:LTUS:168: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, "BEND:LTUS:168:STDZTOD") { field(DESC, "Successful Standardize Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "BEND:LTUS:168:STDZLOSTTOD") { field(DESC, "Standardize Lost Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(longout, "BEND:LTUS:168:STDZCYCLECNT") { field(DESC, "Cycle Count") field(PINI, "YES") } record(longout, "BEND:LTUS:168: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, "BEND:LTUS:168:STDZDIRECT") } # The default standardize direction is "UP" for # all LCLS Magnets.. record(bo, "BEND:LTUS:168:STDZDIRECT") { field(DESC, "Standardize Direction ") field(ZNAM, "UP") field(ONAM, "DOWN") field(VAL, "0") field(FLNK, "BEND:LTUS:168:STDZIMIN") } record(ao, "BEND:LTUS:168:STDZIMIN") { field(DESC, "Min-STDZ Current") field(PREC, "1") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(VAL, "0.0") field(FLNK, "BEND:LTUS:168:STDZIMAX") } record(ao, "BEND:LTUS:168:STDZIMAX") { field(DESC, "Max. Standarize Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(VAL, "250.0") field(FLNK, "BEND:LTUS:168:STDZIFINAL") } record(ao, "BEND:LTUS:168:STDZIFINAL") { field(DESC, "Final SDTZ Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(VAL, "0.0") field(FLNK, "BEND:LTUS:168: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, "BEND:LTUS:168: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, "BEND:LTUS:168:STDZITOL") { field(DESC, "Stdz min tolerance") field(PREC, "5") field(CALC, "MAX(ABS(A),ABS(B))*C") field(INPA, "BEND:LTUS:168:STDZIMIN CP NMS") field(INPB, "BEND:LTUS:168:STDZIMAX CP MMS") field(INPC, "0.05") field(INPD, "BEND:LTUS:168:STDZITOLR CP MMS") field(EGU, "A") field(FLNK, "BEND:LTUS:168:IDELTAS") field(PINI, "YES") } # D - factor (3.154/2 = 1.577) for EPSC, otherwise, set to 1.0 record(calc, "BEND:LTUS:168:STDZDLY") { field(DESC, "Ramp time for stdz cycle") field(CALC, "C>0?MAX(1,ABS((A-B)/C)*D):0") field(INPA, "BEND:LTUS:168:STDZIMIN CP NMS") field(INPB, "BEND:LTUS:168:STDZIMAX CP NMS") field(INPC, "BEND:LTUS:168:TRIMRAMPRATE CP NMS") field(INPD, "1.0") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") } record(calc, "BEND:LTUS:168:STDZRAMPDLY") { field(DESC, "Ramp delay total") field(CALC, "MAX(1,((A/100)*B+B))") field(PREC, "5") field(INPA, "BEND:LTUS:168:TRIMDLYPCT CP MS") field(INPB, "BEND:LTUS:168: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, "BEND:LTUS:168:STDZMINIDLY") { field(DESC, "Mini-stdz delay") field(CALC, "A") field(PREC, "5") field(A, "1.0") field(EGU, "sec") field(PINI, "YES") } record(ao, "BEND:LTUS:168: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, "BEND:LTUS:168:STDZMINIDELTA") { field(DESC, "Stdz mini % of IMAX") field(CALC, "(B/100)*(A-C)") field(INPA, "BEND:LTUS:168:IDES.HOPR") field(INPB, "BEND:LTUS:168:STDZMINIPCT CPP NMS") field(INPC, "BEND:LTUS:168:IDES.LOPR") field(PREC, "5") } record(calc, "BEND:LTUS:168:STDZMINISETPT") { field(DESC, "Mini Stdz delta") field(CALC, "C==0?MAX(E-D,B):MIN(E+D,A)") field(INPA, "BEND:LTUS:168:IDES.HOPR") field(INPB, "BEND:LTUS:168:IDES.LOPR") field(INPC, "BEND:LTUS:168:STDZDIRECT.RVAL") field(INPD, "BEND:LTUS:168:STDZMINIDELTA") field(INPE, "BEND:LTUS:168:IDES") field(PREC, "5") field(FLNK, "BEND:LTUS:168: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, "BEND:LTUS:168:STDZMINISETPTOOR") { field(DESC, "Mini Stdz setpoint out of range") field(CALC, "C==0?(E-DA)") field(INPA, "BEND:LTUS:168:IDES.HOPR") field(INPB, "BEND:LTUS:168:IDES.LOPR") field(INPC, "BEND:LTUS:168:STDZDIRECT.RVAL") field(INPD, "BEND:LTUS:168:STDZMINIDELTA") field(INPE, "BEND:LTUS:168: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, "BEND:LTUS:168: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, "BEND:LTUS:168:IADJUST.RVAL") field(INPB, "BEND:LTUS:168:STDZDIRECT.RVAL") field(INPC, "BEND:LTUS:168:STDZOK.RVAL") field(INPD, "BEND:LTUS:168:STDZDISABLE.RVAL") field(INPE, "BEND:LTUS:168:STATE.RVAL CPP NMS") field(INPF, "BEND:LTUS:168:ICTRL.RVAL") field(INPG, "BEND:LTUS:168:STATE.SEVR") field(INPH, "BEND:LTUS:168:BDELTAS.M") field(INPI, "BEND:LTUS:168:IACT.SEVR") field(OUT, "BEND:LTUS:168:STDZLOSTGO.SELN PP NMS") field(OOPT, "Transition To Non-zero") } record(seq, "BEND:LTUS:168:STDZLOSTGO") { field(DESC, "Process lost stdz") field(SELM, "Mask") field(DOL1, "1") field(DOL2, "0") field(LNK1, "BEND:LTUS:168:STDZLOSTTOD.PROC") field(LNK2, "BEND:LTUS:168:STDZOK PP") } # Record maximum current after standardize # Reset to IACT from sequence after trim # Disable processing during (mini-)standardize or trim record(calc, "BEND:LTUS:168:STDZIACTMAX") { field(DESC, "Max act current after stdz") field(CALC, "MAX(A, B)") field(DISV, "0") field(SDIS, "BEND:LTUS:168:CHECKPWRDIP_ENABLE") field(INPA, "BEND:LTUS:168:IACT CP") field(INPB, "BEND:LTUS:168:STDZIACTMAX") field(EGU, "A") field(FLNK, "BEND:LTUS:168:CHECKPWRDIP") } # Detect power dip if STDZOK is YES, STDZ is enabled, and IACT is valid # If IACT drops below STDZIACTMAX by more than the trim tolerance, clear STDZOK # Warning: Take the absolute value of the trim tolerance, or else quads of # negative polarity will always lose STDZ since their IDELTAS.I are negative. # Note: Large quads and bends are prone to losing STDZ even if they are # perturbed toward higher current since their current tends to overshoot # by greater than the trim tolerance before settling down. record(calcout, "BEND:LTUS:168:CHECKPWRDIP") { field(DESC, "Detect power dip") field(CALC, "(A-B>ABS(C))?3:0") field(DISV, "0") field(SDIS, "BEND:LTUS:168:CHECKPWRDIP_ENABLE") field(INPA, "BEND:LTUS:168:STDZIACTMAX") field(INPB, "BEND:LTUS:168:IACT") field(INPC, "BEND:LTUS:168:IDELTAS.I") field(OUT, "BEND:LTUS:168:STDZLOSTGO.SELN PP NMS") field(OOPT, "When Non-zero") } # Enable processing of STDZIACTMAX and CHECKPWRDIP only if # STDZOK = YES, STDZDISABLE = NO, CTRL != Trim (2), and # CTRL != Stdz (4) record(calc, "BEND:LTUS:168:CHECKPWRDIP_ENABLE") { field(CALC, "A&&!B&&(C#2)&&(C#4)") field(INPA, "BEND:LTUS:168:STDZOK.RVAL CP") field(INPB, "BEND:LTUS:168:STDZDISABLE.RVAL CP") field(INPC, "BEND:LTUS:168:CTRL.RVAL CP") } #! 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, "BEND:LTUS:168: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, "BEND:LTUS:168: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, "BEND:LTUS:168:CALBSET") { field(DESC, "Use DAC Calbration") field(SCAN, "10 second") field(CALC, "A&&(B==0)&&C?31:960") field(INPA, "BEND:LTUS:168:CALBOK") field(INPB, "BEND:LTUS:168:CALBDISABLE") field(INPC, "BEND:LTUS:168:CALBSLOPE") field(OOPT, "On Change") field(OUT, "BEND:LTUS:168: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, "BEND:LTUS:168:CALB_SEQ") { field(DESC, "Output Calib Values") field(SELM, "Mask") field(SELL, "BEND:LTUS:168: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, "BEND:LTUS:168:CALBSLOPE") field(DOL3, "BEND:LTUS:168: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, "BEND:LTUS:168:CALBTOD") { field(DESC, "Calibration Success Time") field(PINI, "YES") # field(DOL, "") field(OMSL, "supervisory") field(DTYP, "Soft Channel") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:168: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, "BEND:LTUS:168: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, "BEND:LTUS:168: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, "BEND:LTUS:168:CALBOFFSET") { field(DESC, "Calc DAC Offset") field(PREC, "6") field(EGU, "Counts") field(PINI, "YES") } record(bo, "BEND:LTUS:168: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, "BEND:LTUS:168:DACSLOPE") { field(DESC, "V to DAC slope") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "supervisory") field(PINI, "YES") field(FLNK, "BEND:LTUS:168:DACOFFSET") } # Default Offset used in conversion from Volts to DAC Counts record(ao, "BEND:LTUS:168:DACOFFSET") { field(DESC, "V to DAC offset") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "supervisory") field(PINI, "YES") field(FLNK, "BEND:LTUS:168: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, "BEND:LTUS:168: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, "BEND:LTUS:168:IACT") field(INPD, "BEND:LTUS:168:DACSLOPE") field(INPE, "BEND:LTUS:168:DACOFFSET") field(EGU, "Counts") field(PREC, "6") } record(ao, "BEND:LTUS:168:DAC") { field(DESC, "DAC Set point") field(EGU, "Counts") field(DOL, "") field(OMSL, "supervisory") field(PREC, "6") field(PINI, "YES") } record(ao, "BEND:LTUS:168:CALBIMIN") { field(DESC, "Calibration Min Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(DRVH, "250.0") field(HOPR, "250.0") field(DRVL, "0.0") field(LOPR, "0.0") field(PREC, "3") field(EGU, "A") field(VAL, "0.0") field(FLNK, "BEND:LTUS:168:CALBIMAX") } record(ao, "BEND:LTUS:168:CALBIMAX") { field(DESC, "Calibration Max Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(DRVH, "250.0") field(HOPR, "250.0") field(LOPR, "0.0") field(DRVL, "0.0") field(EGU, "A") field(VAL, "250.0") field(FLNK, "BEND:LTUS:168:CALBSTEPNUM") } record(ao, "BEND:LTUS:168:CALBIFINAL") { field(DESC, "Calibration Last Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(PREC, "3") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(VAL, "0") } record(longout, "BEND:LTUS:168: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, "BEND:LTUS:168:CALBIDELTA") } record(calc, "BEND:LTUS:168:CALBIDELTA") { field(DESC, "Step size for CALB") field(CALC, "C=0?0:ABS((A-B)/C)") field(INPA, "BEND:LTUS:168:CALBIMAX") field(INPB, "BEND:LTUS:168:CALBIMIN") field(INPC, "BEND:LTUS:168: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, "BEND:LTUS:168:CALBIMULT") { field(DESC, "IACT vs ISETPT mult") field(CALC, "C#0||A=0?1:ABS(B/A)") field(INPA, "BEND:LTUS:166:ISETPT.DRVH") field(INPB, "BEND:LTUS:166:IACT.HOPR") field(INPC, "BEND:LTUS:168:PSCONTROLLER.RVAL CPP") field(EGU, "A") field(PINI, "YES") } # SNL dbputs DAC values here. 6-10 steps are possible. record(waveform, "BEND:LTUS:168:CALBICTRLWF") { field(DESC, "ICTRL setpoint array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") } record(waveform, "BEND:LTUS:168:DACWF") { field(DESC, "DAC count array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "BEND:LTUS:168:DACSA") } # Used only for xygraph edm plot record(subArray, "BEND:LTUS:168:DACSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "BEND:LTUS:168: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, "BEND:LTUS:168:CALCDACWF") { field(DESC, "Calc DAC counts array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "BEND:LTUS:168:CALCDACSA") } # Used only for xygraph edm plot record(subArray, "BEND:LTUS:168:CALCDACSA") { field(DESC, "Calc DAC counts") field(DTYP, "Soft Channel") field(INP, "BEND:LTUS:168: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, "BEND:LTUS:168:CALBYWF") { field(DESC, "mx + b") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "BEND:LTUS:168:CALBYSA") } # Used only for xygraph edm plot record(subArray, "BEND:LTUS:168:CALBYSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "BEND:LTUS:168:CALBYWF") field(MALM, "10") field(NELM, "6") field(INDX, "0") field(FTVL, "DOUBLE") } record(waveform, "BEND:LTUS:168:CALBIACTWF") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "BEND:LTUS:168:CALBIACTSA") } # Used only for xygraph edm plot record(subArray, "BEND:LTUS:168:CALBIACTSA") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(MALM, "10") field(NELM, "6") field(INP, "BEND:LTUS:168:CALBIACTWF") field(INDX, "0") field(FTVL, "DOUBLE") field(FLNK, "BEND:LTUS:168:CALBLIMITS") } # Check that measured current during calibration is within # tolerance. record(aSub, "BEND:LTUS:168: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, "BEND:LTUS:168:CALBSTEPNUM") field(INPB, "BEND:LTUS:168:CALBIACTWF") field(INPC, "BEND:LTUS:168: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, "BEND:LTUS:168: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, "BEND:LTUS:168:STDZITOL") field(INPH, "BEND:LTUS:168:DACSLOPE") field(INPI, "BEND:LTUS:168: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, "BEND:LTUS:168: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, "BEND:LTUS:168:CALBSTEPNUM") field(INPB, "BEND:LTUS:168:CALBIACTWF") field(INPC, "BEND:LTUS:168:DACWF") field(INPF, "BEND:LTUS:168: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 BEND:LTUS:168CALBOK 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, "BEND:LTUS:168:DEGAUSINIT") { field(DESC, "Proc. Degauss PVs on boot") field(PINI, "YES") field(DOL, "1") field(OUTA, "BEND:LTUS:168:DEGAUSIMIN.PROC PP") field(OUTB, "BEND:LTUS:168:DEGAUSIMAX.PROC PP") field(OUTC, "BEND:LTUS:168:DEGAUSTYPE.PROC PP") field(OUTD, "BEND:LTUS:168:DEGAUSSTEP.PROC PP") field(OUTE, "BEND:LTUS:168:MADNAME.PROC PP") field(OUTF, "BEND:LTUS:168:PSTYPE.PROC PP") field(OUTG, "BEND:LTUS:168: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, "BEND:LTUS:168:DEGAUSSUB") { field(DESC, "Degauss subroutine") field(INAM, "mgntDegaussInit") field(SNAM, "mgntDegauss") field(BRSV, "INVALID") field(INPA, "BEND:LTUS:168:DEGAUSIMIN NPP NMS") field(INPB, "BEND:LTUS:168:DEGAUSIMAX NPP NMS") field(INPC, "BEND:LTUS:168:DEGAUSTYPE.RVAL NPP NMS") field(INPE, "BEND:LTUS:168:DEGAUSMETHOD.RVAL NPP NMS") field(INPF, "BEND:LTUS:168:PSTYPE NPP NMS") field(INPG, "BEND:LTUS:168:DEBUG.RVAL NPP NMS") field(INPH, "BEND:LTUS:168: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, "BEND:LTUS:168:DEGAUSWF PP") field(OUTB, "BEND:LTUS:168:DEGAUSMSG PP") field(OUTC, "BEND:LTUS:168: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, "BEND:LTUS:168:DEGAUSWF") { field(DESC, "Degauss Setpts") field(NELM, "60") field(FTVL, "DOUBLE") } record(mbbo,"BEND:LTUS:168: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, "BEND:LTUS:168: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, "BEND:LTUS:168: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, "BEND:LTUS:168: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, "BEND:LTUS:168: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, "BEND:LTUS:168:DEGAUSIMIN") { field(DESC, "Min. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "250.0") field(LOPR, "-250.0") field(DRVH, "250.0") field(DRVL, "-250.0") field(VAL, "-250.0") } record(ao, "BEND:LTUS:168:DEGAUSIMAX") { field(DESC, "Max. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "250.0") field(LOPR, "-250.0") field(DRVH, "250.0") field(DRVL, "-250.0") field(VAL, "250.0") } # 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,"BEND:LTUS:168: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, "BEND:LTUS:168: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,"BEND:LTUS:168: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, "BEND:LTUS:168: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, "BEND:LTUS:168: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, "BEND:LTUS:168: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, "BEND:LTUS:168:DEGAUSTOD") { field(DESC, "Successful Degauss Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "BEND:LTUS:168:DEGAUSLOSTTOD") { field(DESC, "Degauss Lost Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:168:DEGAUSTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "BEND:LTUS:168:DEGAUSTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "BEND:LTUS:168: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, "BEND:LTUS:168:DEGAUSGO") { field(DESC, "Set bdes of btrms to zero") field(ASG, "Internal") field(OUTA, "") field(OUTB, "") field(OUTC, "") field(OUTD, "") } # =========== CRYO ONLY =========== record(bo, "BEND:LTUS:168: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, "BEND:LTUS:168:DEGAUS_IMAX_CHECK") { field(DESC, "Check if imax shoud chg") field(CALC, "(C==4)&&(ABS(B)>ABS(A))?1:0") field(INPA, "BEND:LTUS:168:DEGAUS_IMAX") field(INPB, "BEND:LTUS:168:ISETPT") field(INPC, "BEND:LTUS:168:DEGAUSTYPE.RVAL") field(OUT, "BEND:LTUS:168:DEGAUS_IMAX_UPDATE.SELN") field(FLNK, "BEND:LTUS:168:DEGAUS_IMAX_UPDATE") } record(seq, "BEND:LTUS:168:DEGAUS_IMAX_UPDATE") { field(DESC, "Degauss IMAX Update") field(SELM, "Specified") field(DOL1, "BEND:LTUS:168:ISETPT") field(LNK1, "BEND:LTUS:168:DEGAUS_IMAX PP") } # Set the maximum current after a successful # degauss. This pv is updated by the # sequence. record(ao, "BEND:LTUS:168:DEGAUS_IMAX") { field(DESC, "Max I set afer a degauss") field(EGU, "Amps") field(PINI, "YES") field(PREC, "6") field(HOPR, "250.0") field(LOPR, "-250.0") field(DRVH, "250.0") field(DRVL, "-250.0") field(VAL, "250.0") field(FLNK, "BEND:LTUS:168:DEGAUS_IMAXPOL_CHECK") info(autosaveFields,"VAL,RVAL") } # Set the polarity if degauss_imax record(calcout, "BEND:LTUS:168:DEGAUS_IMAXPOL_CHECK") { field(DESC, "Determine polarity of imax") field(CALC, "A>=0?0:1") field(INPA, "BEND:LTUS:168:DEGAUS_IMAX") field(FLNK, "BEND:LTUS:168:DEGAUS_IMAXPOL") } record(bo, "BEND:LTUS:168:DEGAUS_IMAXPOL") { field(DESC, "Polarity of imax I") field(DTYP, "Raw Soft Channel") field(DOL, "BEND:LTUS:168:DEGAUS_IMAXPOL_CHECK") field(OMSL, "closed_loop") field(ZNAM, "Positive") field(ONAM, "Negative") field(FLNK, "BEND:LTUS:168: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, "BEND:LTUS:168:DEGAUS_ABSIMAX") { field(DESC, "Absolute Max. Degauss I") field(CALC, "ABS(A)") field(INPA, "BEND:LTUS:168:DEGAUS_IMAX") field(PREC, "6") field(EGU, "Amps") field(HOPR, "250.0") field(LOPR, "-250.0") info(autosaveFields,"VAL RVAL") } # IACT Polarity record(calcout, "BEND:LTUS:168:IACTPOL_CHECK") { field(DESC, "Determine IACT polarity") field(SCAN, "5 second") field(CALC, "ABS(A-B)>C?(A>=0?0:1):D") field(INPA, "BEND:LTUS:168:IACT") field(INPB, "BEND:LTUS:168:IACTPOL_CHECK.LA") field(INPC, "0.0001") field(INPD, "BEND:LTUS:168:IACTPOL_CHECK.PVAL") field(OOPT, "On Change") field(FLNK, "BEND:LTUS:168:IACTPOL") } record(bo, "BEND:LTUS:168: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,"BEND:LTUS:168: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, "BEND:LTUS:168:DEGAUSENABLE CP") field(INPB, "BEND:LTUS:168:DEGAUSOK") field(INPC, "BEND:LTUS:168:STATE CP") field(INPD, "BEND:LTUS:168:STATE.SEVR") field(OUT, "BEND:LTUS:168:DEGAUS_STATE_SEQ.SELN PP") field(ASG, "Internal") } record(seq, "BEND:LTUS:168:DEGAUS_STATE_SEQ") { field(DESC, "Degauss State Sequence") field(SELM, "Specified") field(SELL, "BEND:LTUS:168:DEGAUS_STATE_CHECK") field(LNK1, "BEND:LTUS:168:DEGAUS_STATE_DISABLE.PROC PP") field(LNK2, "BEND:LTUS:168:DEGAUS_STATE_LOST.PROC PP") field(LNK3, "BEND:LTUS:168:DEGAUS_STATE_GOOD.PROC PP") field(LNK4, "BEND:LTUS:168: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, "BEND:LTUS:168:DEGAUS_STATE_DISABLE") { field(DESC, "Degauss not used") field(LNK1, "BEND:LTUS:168:DEGAUSOK.ZSV") field(LNK2, "BEND:LTUS:168: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, "BEND:LTUS:168:STATMSG.FRSV") field(LNK4, "BEND:LTUS:168: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, "BEND:LTUS:168:DEGAUS_STATE_LOST") { field(DESC, "Degauss lost and ps On") field(DOL1, "1") field(LNK1, "BEND:LTUS:168:DEGAUSOK.ZSV") field(LNK2, "BEND:LTUS:168: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, "BEND:LTUS:168:STATMSG.FRSV") field(LNK4, "BEND:LTUS:168: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, "BEND:LTUS:168:DEGAUS_STATE_OFF") { field(DESC, "Degaused lost and ps Off") field(DOL1, "2") field(LNK1, "BEND:LTUS:168: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, "BEND:LTUS:168:STATMSG.FRSV") field(LNK3, "BEND:LTUS:168: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, "BEND:LTUS:168:DEGAUS_STATE_GOOD") { field(DESC, "Degauss good") field(DOL1, "1") field(LNK1, "BEND:LTUS:168: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, "BEND:LTUS:168:STATMSG.FRSV PP") field(LNK3, "BEND:LTUS:168:STATMSG.FVSV PP") field(LNK4, "") field(ASG, "Internal") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(mbbo, "BEND:LTUS:168:FUNC") { field(DESC, "BEND:LTUS:168 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, "0") field(FFVL, "0") field(OUT, "BEND:LTUS:168:CTRL CA") } # :CTRL pv is processed at boot in the # sequence mgntCtrl.st Processed in sequence # record(mbbo, "BEND:LTUS:168:CTRL") { field(DESC, "BEND:LTUS:168 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, "BEND:LTUS:168:SELECTEN.A PP") field(SDIS, "0") } # If a function has been selected set this unit to busy record(calcout, "BEND:LTUS:168:SELECTEN") { field(DESC, "Control Select Enable") field(CALC, "A>0?1:A") field(FLNK, "BEND:LTUS:168:BUSY") } # Set to FREE on IOC reboot record(bo, "BEND:LTUS:168:BUSY") { field(DESC, "BEND:LTUS:168 Ctrl Done") field(DOL, "BEND:LTUS:168:SELECTEN") field(ZNAM, "FREE") field(ONAM, "BUSY") field(PINI, "YES") field(FLNK, "BEND:LTUS:168:SELECT") } record(bo, "BEND:LTUS:168:SELECT") { field(ZNAM, "NO") field(ONAM, "YES") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") } record(bo, "BEND:LTUS:168: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, "BEND:LTUS:168:CTRLSTATE") { field(DESC, "BEND:LTUS:168 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("BEND:LTUS:168:CTRL",20,20,0,0,"BEND:LTUS:168:CTRL") #! Field("BEND:LTUS:168:CTRL.OUT",16777215,1,"BEND:LTUS:168:CTRL.OUT") #! Link("BEND:LTUS:168:CTRL.OUT","BEND:LTUS:168:SELECTEN.A") #! Field("BEND:LTUS:168:CTRL.VAL",16777215,1,"BEND:LTUS:168:CTRL.VAL") #! Record("BEND:LTUS:168:SELECTEN",321,381,0,0,"BEND:LTUS:168:SELECTEN") #! Field("BEND:LTUS:168:SELECTEN.A",16777215,0,"BEND:LTUS:168:SELECTEN.A") #! Field("BEND:LTUS:168:SELECTEN.FLNK",16777215,1,"BEND:LTUS:168:SELECTEN.FLNK") #! Link("BEND:LTUS:168:SELECTEN.FLNK","BEND:LTUS:168:BUSY") #! Field("BEND:LTUS:168:SELECTEN.VAL",16777215,1,"BEND:LTUS:168:SELECTEN.VAL") #! Record("BEND:LTUS:168:BUSY",623,274,0,0,"BEND:LTUS:168:BUSY") #! Field("BEND:LTUS:168:BUSY.DOL",16777215,0,"BEND:LTUS:168:BUSY.DOL") #! Link("BEND:LTUS:168:BUSY.DOL","BEND:LTUS:168:SELECTEN.VAL") #! Field("BEND:LTUS:168:BUSY.FLNK",16777215,1,"BEND:LTUS:168:BUSY.FLNK") #! Link("BEND:LTUS:168:BUSY.FLNK","BEND:LTUS:168:SELECT") #! Record("BEND:LTUS:168:SELECT",669,508,0,1,"BEND:LTUS:168:SELECT") #! Record("BEND:LTUS:168:FUNC",940,120,0,0,"BEND:LTUS:168:FUNC") #! Field("BEND:LTUS:168:FUNC.OUT",16777215,0,"BEND:LTUS:168:FUNC.OUT") #! Link("BEND:LTUS:168:FUNC.OUT","BEND:LTUS:168:CTRL.VAL") #! Record("BEND:LTUS:168:ABORT",193,41,0,0,"BEND:LTUS:168:ABORT") #! Record("BEND:LTUS:168:CTRLSTATE",369,34,0,0,"BEND:LTUS:168: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,"BEND:LTUS:168:SELECT is used for Multi-device selection.\nIt is enabled when associated BEND:LTUS:168:CTRL is \"0\" (DONE).\nIt is disabled when associated BEND:LTUS:168: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,"BEND:LTUS:168: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, "BEND:LTUS:168:BCTRL_INIT") { field(DESC, "Process BCTRL on boot") field(PINI, "YES") field(CALC, "A=3?1:0") field(INPA, "BEND:LTUS:168:BCTRL.SEVR") field(OUT, "BEND:LTUS:168: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, "BEND:LTUS:168:BACT") { field(DESC, "Actual B") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "BEND:LTUS:168:BACT") field(INPB, "BEND:LTUS:168:POLYCOEF") field(INPC, "BEND:LTUS:168:POLYCOEF.A") field(INPD, "BEND:LTUS:168:POLYCOEF.B") field(INPE, "BEND:LTUS:168:IACTCALC MS") field(INPF, "BEND:LTUS:168:BDELTAS PP") field(INPG, "100") field(EGU, "kG-m") field(HOPR, "4.5326") field(LOPR, "0.0131") field(HIHI, "4.5326") field(LOLO, "0.0131") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "4.5326") field(LOW, "0.0131") field(FLNK, "BEND:LTUS:168: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, "BEND:LTUS:168:BDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntPhyDeltas") field(EGU, "kG-m") field(HOPR, "1") field(PREC, "7") field(BRSV, "INVALID") field(INPA, "BEND:LTUS:168:BDES") field(INPB, "BEND:LTUS:168:TRIMBTOL") field(INPC, "BEND:LTUS:168:TRIMBTOLR") field(INPD, "BEND:LTUS:168:CHCKBTOL") field(INPE, "BEND:LTUS:168:CHCKBTOLR") field(F, "2.0") field(INPG, "30") field(INPH, "BEND:LTUS:168:BACT.VAL") # # MPS absolute and relative tolerances field(INPP, "BEND:LTUS:168:MPSBTOL") field(INPQ, "BEND:LTUS:168:MPSBTOLR") field(FLNK, "BEND:LTUS:168:BCONLIMITS") info(autosaveFields,"F") } # This record is processed by BDELTAS record(aSub, "BEND:LTUS:168:BCONLIMITS") { field(DESC, "Config B-field Limits") field(INAM, "mgntInit") field(SNAM, "mgntBCONLimits") field(INPA, "BEND:LTUS:168:BDES") field(INPB, "BEND:LTUS:168:BDELTAS.I") field(INPG, "BEND:LTUS:168:DEBUG.RVAL") field(FTA, "DOUBLE") field(FTB, "DOUBLE") field(FTG, "ULONG") field(OUTA, "BEND:LTUS:168:BCON.HIGH") field(OUTB, "BEND:LTUS:168:BCON.LOW") field(OUTC, "BEND:LTUS:168:BCON.HIHI") field(OUTD, "BEND:LTUS:168:BCON.LOLO PP") field(FTVA, "DOUBLE") field(FTVB, "DOUBLE") field(FTVC, "DOUBLE") field(FTVD, "DOUBLE") field(BRSV, "INVALID") field(FLNK, "BEND:LTUS:168:IDELTAS") } # The following PV is processed by :BACT # which is processed by :BACT # record(fanout, "BEND:LTUS:168:BACTFO") { field(DESC, "BACT processing") field(SELM, "All") field(LNK1, "BEND:LTUS:168:BDIFF") field(LNK2, "BEND:LTUS:168:BADIFF") field(LNK3, "BEND:LTUS:168:BRATIO") field(LNK4, "BEND:LTUS:168:MPSLIMITS") field(LNK5, "BEND:LTUS:168:I2BSTATUS") field(LNK6, "BEND:LTUS:168:IACTFO.PROC") } record(calc, "BEND:LTUS:168:BDIFF") { field(DESC, "BDES-BACT") field(CALC, "A-B") field(INPA, "BEND:LTUS:168:BDES") field(INPB, "BEND:LTUS:168:BACT") field(EGU, "kG-m") field(PREC, "7") } record(calc, "BEND:LTUS:168:BADIFF") { field(DESC, "Absolute BDES-BACT") field(INPA, "BEND:LTUS:168:BDIFF") field(EGU, "kG-m") field(PREC, "7") field(CALC, "A<0?ABS(A):A") } record(calc, "BEND:LTUS:168:BRATIO") { field(DESC, "BACT Error") field(CALC, "B?A/B:0") field(INPA, "BEND:LTUS:168:BDIFF") field(INPB, "BEND:LTUS:168:BDES.HOPR") field(EGU, "kG-m") field(PREC, "7") } record(mbbi, "BEND:LTUS:168: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, "BEND:LTUS:168:BACT.J") } # Note: for a string slave set the MONFL # macro to the following: # MONFL=:IMONCALC MS record(sub, "BEND:LTUS:168:BMON") { field(DESC, "Second Transductor") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "BEND:LTUS:168:BMON") field(INPB, "BEND:LTUS:168:POLYCOEF") field(INPC, "BEND:LTUS:168:POLYCOEF.A") field(INPD, "BEND:LTUS:168:POLYCOEF.B") field(INPE, "BEND:LTUS:168:IMONCALC MS") field(INPF, "BEND:LTUS:168:BDELTAS.VAL") field(INPG, "100") field(EGU, "kG-m") field(HOPR, "4.5326") field(LOPR, "0.0131") field(HIHI, "4.5326") field(LOLO, "0.0131") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "4.5326") field(LOW, "0.0131") } # 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=BEND:LTUS:166:BDES CP record(ao, "BEND:LTUS:168:BDES") { field(DESC, "Desired B-Field") field(PINI, "NO") field(DRVH, "4.5326") field(DRVL, "0.0131") field(HOPR, "4.5326") field(LOPR, "0.0131") field(PREC, "7") field(EGU, "kG-m") field(MDEL, "-1") field(OMSL, "closed_loop") field(DOL, "BEND:LTUS:168:IDES2BDES") field(OUT, "BEND:LTUS:168:B2IDES PP") info(autosaveFields,"VAL") } record(sub, "BEND:LTUS:168:B2IDES") { field(DESC, "Convert Desired B-Field to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "BEND:LTUS:168:POLYCOEF") field(INPC, "BEND:LTUS:168:POLYCOEF.A") field(INPD, "BEND:LTUS:168:POLYCOEF.B") field(PREC, "7") field(EGU, "kG-m") field(HOPR, "4.5326") field(LOPR, "0.0131") field(MDEL, "-1") field(INPE, "BEND:LTUS:168:BDES.DRVH") field(INPF, "BEND:LTUS:168:BDES.DRVL") field(BRSV, "INVALID") field(FLNK, "BEND:LTUS:168:IDES") } record(sub, "BEND:LTUS:168:BNOM") { field(DESC, "Nominal Field") field(PINI, "YES") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "BEND:LTUS:168:POLYCOEF") field(INPC, "BEND:LTUS:168:POLYCOEF.A") field(INPD, "BEND:LTUS:168:POLYCOEF.B") field(INPE, "BEND:LTUS:168:BDES.DRVH") field(INPF, "BEND:LTUS:168:BDES.DRVL") field(EGU, "kG-m") field(HOPR, "4.5326") field(LOPR, "0.0131") field(PREC, "7") field(VAL, "0.0") field(FLNK, "BEND:LTUS:168:INOM") } record(sub, "BEND:LTUS:168:BACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "BEND:LTUS:168:BDES.VAL") field(INPB, "BEND:LTUS:168:BDES.DRVH") field(INPC, "BEND:LTUS:168:BDES.DRVL") field(INPD, "BEND:LTUS:168:BDELTAS.I") field(INPE, "BEND:LTUS:168:BDELTAS.J") field(INPG, "BEND:LTUS:168:STATE") field(INPH, "BEND:LTUS:168:HSTA") field(EGU, "kG-m") field(HOPR, "4.5326") field(LOPR, "0.0131") field(PREC, "7") field(BRSV, "INVALID") } record(sub, "BEND:LTUS:168:BMONLIMITS") { field(DESC, "MON Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "BEND:LTUS:168:BDES.VAL") field(INPB, "BEND:LTUS:168:BDES.DRVH") field(INPC, "BEND:LTUS:168:BDES.DRVL") field(INPD, "BEND:LTUS:168:BDELTAS.K") field(INPE, "BEND:LTUS:168:BDELTAS.L") field(INPG, "BEND:LTUS:168:STATE") field(INPH, "BEND:LTUS:168:HSTA") field(EGU, "kG-m") field(HOPR, "4.5326") field(LOPR, "0.0131") field(PREC, "7") field(BRSV, "INVALID") } record(seq, "BEND:LTUS:168:BLIMITS") { field(DESC, "ACT Limits") field(PREC, "7") field(DOL1, "BEND:LTUS:168:BLIMITS") field(LNK1, "BEND:LTUS:168:BACTLIMITS.F PP") field(DOL2, "BEND:LTUS:168:BACTLIMITS.I") field(LNK2, "BEND:LTUS:168:BACT.HIGH") field(DOL3, "BEND:LTUS:168:BACTLIMITS.J") field(LNK3, "BEND:LTUS:168:BACT.LOW") field(DOL4, "BEND:LTUS:168:BACTLIMITS.K") field(LNK4, "BEND:LTUS:168:BACT.HIHI") field(DOL5, "BEND:LTUS:168:BACTLIMITS.L") field(LNK5, "BEND:LTUS:168:BACT.LOLO") field(DOL6, "BEND:LTUS:168:BLIMITS") field(LNK6, "BEND:LTUS:168:BMONLIMITS.F PP") field(DOL7, "BEND:LTUS:168:BMONLIMITS.I") field(LNK7, "BEND:LTUS:168:BMON.HIGH") field(DOL8, "BEND:LTUS:168:BMONLIMITS.J") field(LNK8, "BEND:LTUS:168:BMON.LOW") field(DOL9, "BEND:LTUS:168:BMONLIMITS.K") field(LNK9, "BEND:LTUS:168:BMON.HIHI") field(DOLA, "BEND:LTUS:168:BMONLIMITS.L") field(LNKA, "BEND:LTUS:168:BMON.LOLO") field(FLNK, "BEND:LTUS:168:ILIMITS") field(SCAN, "5 second") } record(ao, "BEND:LTUS:168:BCTRL") { field(DESC, "B-Perturb") field(PREC, "7") field(EGU, "kG-m") field(DRVH, "4.5326") field(DRVL, "0.0131") field(HOPR, "4.5326") field(LOPR, "0.0131") # 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, "BEND:LTUS:168: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, "BEND:LTUS:168:BCTRLGO") { field(DESC, "Update DES and perturb") field(PREC, "7") # Disable BACT limits field(DOL1, "1") field(LNK1, "BEND:LTUS:168:BLIMITS.VAL") # Update BDES with the BCTRL (slider) value field(DOL2, "BEND:LTUS:168:BCTRL.VAL") field(LNK2, "BEND:LTUS:168:BDES PP") field(DOL3, "1") field(LNK3, "BEND:LTUS:168:IDIRECT.PROC PP") field(DOL4, "1") field(LNK4, "BEND:LTUS:168:CHECKSTDZLOST.PROC PP") field(DOL5, "BEND:LTUS:168:BCTRL.VAL") field(LNK5, "BEND:LTUS:168:BCTRLSUB PP") # Re-enable BACT limits field(DOL6, "0") field(LNK6, "BEND:LTUS:168:BLIMITS.VAL") } # Convert B-field to Current and output to ISETPT record(sub, "BEND:LTUS:168:BCTRLSUB") { field(DESC, "Feedback") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "BEND:LTUS:168:POLYCOEF") field(INPC, "BEND:LTUS:168:POLYCOEF.A") field(INPD, "BEND:LTUS:168:POLYCOEF.B") field(INPE, "BEND:LTUS:168:BDES.DRVH") field(INPF, "BEND:LTUS:168:BDES.DRVL") field(PREC, "7") field(EGU, "kG-m") field(HOPR, "4.5326") field(LOPR, "0.0131") field(MDEL, "-1") field(BRSV, "INVALID") field(FLNK, "BEND:LTUS:168:ISETPT") } record(ao, "BEND:LTUS:168:BDESPREVTRIM") { field(DESC, "trim bdes for undo") field(DTYP, "Soft Channel") field(DRVH, "4.5326") field(DRVL, "0.0131") field(EGU, "kG-m") field(HOPR, "4.5326") field(LOPR, "0.0131") field(PREC, "7") field(PINI, "YES") info(autosaveFields,"VAL") } record(stringin, "BEND:LTUS:168:MADNAME") { field(DESC, "MAD deck nomenclature") field(PINI, "YES") field(VAL, "BCX31B4") } record(ai, "BEND:LTUS:168: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, "3246.89204") } record(ao, "BEND:LTUS:168:BMAX") { field(DESC, "Max B-Field") field(DTYP, "Soft Channel") field(DRVH, "4.5326") field(DRVL, "0.0131") field(EGU, "kG-m") field(HOPR, "4.5326") field(LOPR, "0.0131") field(PREC, "7") field(PINI, "YES") field(VAL, "4.5326") field(FLNK, "BEND:LTUS:168:BSTEP") } record(ao, "BEND:LTUS:168:BMIN") { field(DESC, "Min B-Field") field(DTYP, "Soft Channel") field(DRVH, "4.5326") field(DRVL, "0.0131") field(EGU, "kG-m") field(HOPR, "4.5326") field(LOPR, "0.0131") field(PREC, "7") field(PINI, "YES") field(VAL, "0.0131") field(FLNK, "BEND:LTUS:168:BSTEP") } record(ao, "BEND:LTUS:168:BDESSAVE") { field(DESC, "bdes for save/load") field(DTYP, "Soft Channel") field(DRVH, "4.5326") field(DRVL, "0.0131") field(EGU, "kG-m") field(HOPR, "4.5326") field(LOPR, "0.0131") field(PINI, "YES") field(PREC, "7") } # This record is processed by BEND:LTUS:168: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, "BEND:LTUS:168:BCON") { field(DESC, "Config B-Field ") field(DTYP, "Soft Channel") field(PREC, "7") field(EGU, "kG-m") field(HOPR, "4.5326") field(LOPR, "0.0131") field(DRVH, "4.5326") field(DRVL, "0.0131") # 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 , "BEND:LTUS:168:ICON2BCON") field(OMSL, "closed_loop") field(OUT, "BEND:LTUS:168:B2ICON PP") info(autosaveFields,"VAL") } record(sub, "BEND:LTUS:168:B2ICON") { field(DESC, "Convert Desired ICon to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "BEND:LTUS:168:POLYCOEF") field(INPC, "BEND:LTUS:168:POLYCOEF.A") field(INPD, "BEND:LTUS:168:POLYCOEF.B") field(PREC, "7") field(EGU, "kG-m") field(HOPR, "4.5326") field(LOPR, "0.0131") field(MDEL, "-1") field(INPE, "BEND:LTUS:168:BCON.DRVH") field(INPF, "BEND:LTUS:168:BCON.DRVL") field(BRSV, "INVALID") field(FLNK, "BEND:LTUS:168: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, "BEND:LTUS:168:BSTEP") { field(DESC, "B-Field step size") field(CALC, "(C==3)||(D==3)?0:ABS(A-B)*0.005") field(INPA, "BEND:LTUS:168:BMAX") field(INPB, "BEND:LTUS:168:BMIN") field(INPC, "BEND:LTUS:168:BMIN.SEVR") field(INPD, "BEND:LTUS:168:BMAX.SEVR") field(EGU, "kG-m") 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,"BEND:LTUS:168:BCTRLDISABLECALC") { field(DESC, "Calc for disabling BCTRL") field(ASG, "Internal") field(CALC, "A?2:1") field(INPA, "BEND:LTUS:168:ONLINE CP") field(OUT, "BEND:LTUS:168:BCTRLDISABLEFOUT PP") } record(fanout, "BEND:LTUS:168:BCTRLDISABLEFOUT") { field(DESC, "Disable BCTRL fanout") field(SELM, "Specified") field(SELL, "BEND:LTUS:168:BCTRLDISABLECALC") field(LNK1, "BEND:LTUS:168:BCTRLDISABLE") field(LNK2, "BEND:LTUS:168:BCTRLENABLE") } record(stringout, "BEND:LTUS:168:BCTRLDISABLE") { field(DESC, "Disable BCTRL") field(DTYP, "Soft Channel") field(OUT, "BEND:LTUS:168:BCTRL.ASG") field(VAL, "NOWRITE") field(FLNK, "BEND:LTUS:168:BCTRLDISV_UPDATE") } record(stringout, "BEND:LTUS:168:BCTRLENABLE") { field(DESC, "Enable BCTRL") field(DTYP, "Soft Channel") field(OUT, "BEND:LTUS:168:BCTRL.ASG") field(VAL, "") field(FLNK, "BEND:LTUS:168:BCTRLDISV_UPDATE") } record(calcout, "BEND:LTUS:168:BCTRLDISV_UPDATE") { field(DESC, "Calc for updating BCTRL.DISV") field(ASG, "Internal") field(CALC, "A") field(INPA, "BEND:LTUS:168:ONLINE") field(OUT, "BEND:LTUS:168: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,"BEND:LTUS:168:BACT and MON\n are processed via links from \n BEND:LTUS:168:IACT (device raw value readback 1)\n and\n BEND:LTUS:168: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 BEND:LTUS:168:POLYCOEF\nC = First polynomial coefficient (offset if linear)\nD = Second polynomial coefficient (slope if linear)\nE = BEND:LTUS:168: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,"BEND:LTUS:168:BDES\n is processed when set by CA users or \n BEND:LTUS:168: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,"BEND:LTUS:168: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 BEND:LTUS:168: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 (BEND:LTUS:168: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,"BEND:LTUS:168:B*LIMITS and BEND:LTUS:168:BLIMITS:\n Calculate alarm and warning limits based on \n deltas from BEND:LTUS:168: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,"BEND:LTUS:168: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,"BEND:LTUS:168: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, "BEND:LTUS:168: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, "BEND:LTUS:168:MPSBTOL") { field(DESC, "Absolute mps tol") field(EGU, "kG-m") field(PREC, "2") field(CALC, "ABS(A)*0.02") field(INPA, "BEND:LTUS:168:BMAX") field(PINI, "YES") } # # 21-Aug-2013: K. Luchini # Set channel access security so that users # cannot easily change values. record(ao, "BEND:LTUS:168:MPSBMAX") { field(DESC, "MPS Max B-field") field(EGU, "kG-m") field(PREC, "7") field(DRVH, "4.5326") field(DRVL, "0.0131") field(PINI, "YES") field(VAL, "4.5326") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:168:MPSBMIN") { field(DESC, "MPS Min B-field") field(EGU, "kG-m") field(PREC, "7") field(DRVH, "4.5326") field(DRVL, "0.0131") field(PINI, "YES") field(VAL, "0.0131") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:168:MPSBLLIM") { field(DESC, "MPS Low Limit B-field") field(EGU, "kG-m") field(PREC, "7") field(DRVH, "4.5326") field(DRVL, "0.0131") field(PINI, "YES") field(VAL, "0.0131") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:168:MPSBLLIM2") { field(DESC, "MPS Low Limit #2 B-field") field(EGU, "kG-m") field(PREC, "7") field(DRVH, "4.5326") field(DRVL, "0.0131") field(PINI, "YES") field(VAL, "0.0131") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } # Set the default to Std record(mbbo, "BEND:LTUS:168: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, "BEND:LTUS:168:MPSLIMITS.E PP") } record(aSub, "BEND:LTUS:168: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, "BEND:LTUS:168:MPS.RVAL") field(INPB, "BEND:LTUS:168:BADIFF") field(INPC, "BEND:LTUS:168:BDELTAS.N") field(INPD, "BEND:LTUS:168:BACT") field(INPE, "BEND:LTUS:168:MPSBITMASK.RVAL") field(INPF, "BEND:LTUS:168:MPSBLLIM") field(INPG, "BEND:LTUS:168:MPSBMIN") field(INPH, "BEND:LTUS:168:MPSBMAX") field(INPI, "BEND:LTUS:168: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, "BEND:LTUS:168:INTOL.RVAL PP") field(OUTB, "BEND:LTUS:168:INTOL_BMIN.RVAL PP") field(OUTC, "BEND:LTUS:168:INTOL_BRANGE.RVAL PP") field(OUTD, "BEND:LTUS:168: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, "BEND:LTUS:168:INTOL") { field(DESC, "BACT within MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "BEND:LTUS:168:MPSLIMITS.VALA") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "BEND:LTUS:168:INTOL_BMIN") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "BEND:LTUS:168:MPSLIMITS.VALB") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "BEND:LTUS:168:INTOL_BMIN2") { field(DESC, "MPS tol #2") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "BEND:LTUS:168:MPSLIMITS.VALD") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "BEND:LTUS:168:INTOL_BRANGE") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "BEND:LTUS:168: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, "BEND:LTUS:168:CHCKITOL") { field(DESC, "Absolute Check I Tolerance") field(EGU, "A") field(FLNK, "BEND:LTUS:168:TRIMITOL") field(CALC, "ABS(A*B)") field(INPA, "BEND:LTUS:168:CHCKBTOL") field(INPB, "BEND:LTUS:168:POLYCOEF.B") field(PREC, "9") } record(calc, "BEND:LTUS:168:TRIMBTOL") { field(EGU, "kG-m") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(DESC, "Absolute Trim Tolerance") field(CALC, "ABS(A)/2") field(INPA, "BEND:LTUS:168:CHCKBTOL") field(FLNK, "BEND:LTUS:168:CHCKITOL") } record(calc, "BEND:LTUS:168:CHCKBTOL") { field(DESC, "Check absolute tolerance") field(EGU, "A") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(FLNK, "BEND:LTUS:168:TRIMBTOL") field(CALC, "MAX(ABS(A),ABS(C))*(B/1000000)") field(INPA, "BEND:LTUS:168:BDES.HOPR") field(INPB, "BEND:LTUS:168:STABILITY") field(INPC, "BEND:LTUS:168:BDES.LOPR") } record(longout, "BEND:LTUS:168: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, "BEND:LTUS:168:CHCKBTOL") } record(calc, "BEND:LTUS:168:TRIMITOL") { field(DESC, "Absolute Trim I Tolerance") field(EGU, "kG-m") field(CALC, "ABS(A*B)") field(INPA, "BEND:LTUS:168:POLYCOEF.B") field(INPB, "BEND:LTUS:168:TRIMBTOL") field(PREC, "9") } record(ai, "BEND:LTUS:168:TRIMBTOLR") { field(DESC, "Relative trim tol") field(PREC, "4") field(EGU, "%") field(HOPR, "1.0") field(LOPR, "0.0") field(PINI, "YES") } record(ai, "BEND:LTUS:168: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, "BEND:LTUS:168:FBCKFCOM") { field(ZNAM, "CA") field(ONAM, "FCOM") field(DESC, "CA Mode") field(PINI, "YES") field(SDIS, "0") } record(bo, "BEND:LTUS:168:PAU") { field(ZNAM, "NotConfigured") field(ONAM, "Configured") field(DESC, "PAU Present") field(PINI, "YES") field(SDIS, "0") field(FLNK, "BEND:LTUS:168:PAUGO") } record(fanout, "BEND:LTUS:168:PAUGO") { field(DESC, "PAU control") field(LNK1, "BEND:LTUS:168:PAUSTOP") field(LNK2, "BEND:LTUS:168: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, "BEND:LTUS:168:PAUSTART") { field(DESC, "Setup for PAU On") field(SDIS, "BEND:LTUS:168: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, "BEND:LTUS:168:PAUSTOP") { field(DESC, "Setup for PAU Off") field(SDIS, "BEND:LTUS:168: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, "BEND:LTUS:168:MCORDEVNAME") { field(DESC, "PS device name") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, "BEND:LTUS:166:") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "BEND:LTUS:168: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, "BEND:LTUS:168:PSTYPE.RVAL") field(INPC, "BEND:LTUS:168:TURNEDOFF.RVAL") field(INPD, "BEND:LTUS:168:CONFIG.RVAL") field(INPE, "BEND:LTUS:168:PSCATEGORY.RVAL") field(INPF, "BEND:LTUS:168:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "BEND:LTUS:168:AUTOCTRL.RVAL") field(INPJ, "BEND:LTUS:168:OUTOFSERVICE.RVAL") field(INPL, "BEND:LTUS:168:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "BEND:LTUS:168:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "BEND:LTUS:168:PAU") field(INPP, "BEND:LTUS:168:CALBDISABLE.RVAL") field(INPQ, "BEND:LTUS:168:PTRBDISABLE.RVAL") field(INPR, "BEND:LTUS:168:TRIMDISABLE.RVAL") field(INPS, "BEND:LTUS:168:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "BEND:LTUS:168:FBCK") field(INPU, "BEND:LTUS:168:TRIMTYPE.RVAL") field(INPV, "BEND:LTUS:168:STDZDIRECT.RVAL") field(INPW, "BEND:LTUS:168:DEGAUSENABLE.RVAL") field(FLNK, "BEND:LTUS:168:HSTA") } record(longin, "BEND:LTUS:168:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "BEND:LTUS:168:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "BEND:LTUS:168: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, "BEND:LTUS:168: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, "BEND:LTUS:168: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, "BEND:LTUS:168: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, "BEND:LTUS:168: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, "BEND:LTUS:168: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 BEND:LTUS:168:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses BEND:LTUS:168:FBCK. # This PV should be replaced by BEND:LTUS:168: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, "BEND:LTUS:168: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, "BEND:LTUS:168: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, "BEND:LTUS:168: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, "BEND:LTUS:166:OUTOFSERVICE CPP NMS") field(OMSL, "closed_loop") field(FLNK, "BEND:LTUS:168:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"BEND:LTUS:168:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "BEND:LTUS:168:OUTOFSERVICE NPP NMS") field(OUT, "BEND:LTUS:168:ONLINE PP") } record(bo, "BEND:LTUS:168:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "BEND:LTUS:168: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, "BEND:LTUS:168: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, "BEND:LTUS:168: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, "BEND:LTUS:168: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, "BEND:LTUS:168: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, "BEND:LTUS:168: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, "BEND:LTUS:168: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, "BEND:LTUS:168: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, "BEND:LTUS:168: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, "BEND:LTUS:168: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, "BEND:LTUS:168: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, "BEND:LTUS:168:TRIMTYPE") } record(stringout, "BEND:LTUS:168:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "BEND:LTUS:166:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "BEND:LTUS:168:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "BEND:LTUS:168:STATE.RVAL") field(INPB, "BEND:LTUS:168:INTLKSUMY.RVAL") field(OUT, "BEND:LTUS:168:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "BEND:LTUS:168: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, "BEND:LTUS:168:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "BEND:LTUS:168:STATE.RVAL") field(INPB, "BEND:LTUS:168:INTLKSUMY.RVAL") field(OUT, "BEND:LTUS:168:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "BEND:LTUS:168:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "BEND:LTUS:168:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "BEND:LTUS:168: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, "BEND:LTUS:168: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, "BEND:LTUS:168: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, "BEND:LTUS:168: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,"BEND:LTUS:168: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("BEND:LTUS:168:TURNEDOFF",3140,1907,0,1,"BEND:LTUS:168:TURNEDOFF") #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "BEND:LTUS:168:STATSUB") { field(DESC, "Build STATus ") field(INAM, "mgntInit") field(SNAM, "mgntSlcStat") field(INPA, "BEND:LTUS:168:BACT.STAT") field(INPB, "BEND:LTUS:168:BDES.STAT") field(INPC, "BEND:LTUS:168: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, "BEND:LTUS:168:BACT.SEVR") field(INPH, "BEND:LTUS:168:BDES.SEVR") field(INPI, "BEND:LTUS:168: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, "BEND:LTUS:168:STATE.RVAL") field(INPN, "BEND:LTUS:168:STDZOK") field(INPO, "BEND:LTUS:168:CALBOK") field(INPP, "BEND:LTUS:168:OUTOFSERVICE.RVAL") field(INPQ, "BEND:LTUS:168:CONFIG.RVAL") field(INPR, "BEND:LTUS:168:HSTA") field(INPS, "BEND:LTUS:168:CTRL.RVAL") field(INPT, "BEND:LTUS:168:DEGAUSOK") field(INPV, "BEND:LTUS:168: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, "BEND:LTUS:168:STAT") } record(longout, "BEND:LTUS:168:STAT") { field(DESC, "STAT sent to SLC") field(SCAN, "Passive") field(FLNK, "BEND:LTUS:168:STATCTRLSUB") field(DOL, "BEND:LTUS:168:STATSUB.VAL") field(OMSL, "closed_loop") } record(sSub, "BEND:LTUS:168:STATCTRLSUB") { field(DESC, "Decode SLC STAT into mbbo") field(INAM, "mgntInit") field(SNAM, "mgntStatDecode") field(INPA, "BEND:LTUS:168:STAT") field(INPB, "BEND:LTUS:168:HSTA") field(INPD, "BEND:LTUS:168:ONOFFCTRL.RVAL") field(FLNK, "BEND:LTUS:168:STATMSG") } record(mbbo, "BEND:LTUS:168: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, "BEND:LTUS:168:UNAVAILGO") field(DOL, "BEND:LTUS:168:STATCTRLSUB.W") } record(seq, "BEND:LTUS:168:UNAVAILGO") { field(DESC, "Process UNAVAIL") field(DOL1, "BEND:LTUS:168:STATSUB.U") field(LNK1, "BEND:LTUS:168:UNAVAIL PP") } record(stringout, "BEND:LTUS:168:SNLSTATMSG") { field(DTYP, "Soft Channel") } #! TextBox(TB0,820,1000,1200,1220,0,"Dialog",12,1,16777215,"BEND:LTUS:168:STATUSSUB - future\nOverall device status - takes input from action snls, record sevrs, master snl(s) and outputs final status\n\nInputs:\nA - BEND:LTUS:168:CTRLSTATUS - snl status\nB - MGNT:CTRLSTATUS - master list status\nC\nD - BEND:LTUS:168: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,"BEND:LTUS:168STATSUB\nformat control bo's into slc STAT\n\nInputs:\nA - BEND:LTUS:168:STATUS\nC - BEND:LTUS:168:ON\nD - BEND:LTUS:168:STDZOK\nE - BEND:LTUS:168:CALBOK\nF - BEND:LTUS:168:BACTDRIFT (future)\nG -\nH- BEND:LTUS:168:DACSTATUS\nI -BEND:LTUS:168:ADCSTATUS\nJ - BEND:LTUS:168:BACTSTATUS\nK - BEND:LTUS:168:BDESSTATUS\nL - BEND:LTUS:168:RIPLSTATUS\n\nOutput:\nP - BEND:LTUS:168: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, "BEND:LTUS:168: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, "BEND:LTUS:168: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, "BEND:LTUS:168: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, "BEND:LTUS:168: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, "BEND:LTUS:168:IDESTOTAL"){ field(DESC, "Calc total current") field(CALC, "A+B") field(EGU, "kG-m") field(PREC, "7") field(INPA, "BEND:LTUS:166:IDES CP NMS") field(INPB, "BTRM:LTUS:168:BDES CP NMS") field(OUT, "BEND:LTUS:168:IDES2BDES.E PP") } record(sub, "BEND:LTUS:168:IDES2BDES") { field(DESC, "Cal BDES") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "BEND:LTUS:168:IDES2BDES") field(INPB, "BEND:LTUS:168:POLYCOEF") field(INPC, "BEND:LTUS:168:POLYCOEF.A") field(INPD, "BEND:LTUS:168:POLYCOEF.B") field(INPE, "BEND:LTUS:168:IDESTOTAL MS") field(INPF, "BEND:LTUS:166:BDELTAS PP") field(INPG, "100") field(EGU, "kG-m") field(HOPR, "4.5326") field(LOPR, "0.0131") field(HIHI, "4.5326") field(LOLO, "0.0131") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "4.5326") field(LOW, "0.0131") field(FLNK, "BEND:LTUS:168: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, "BEND:LTUS:168:IACTCALC"){ field(DESC, "Calc total act current") field(CALC, "A+B") field(EGU, "kG-m") field(PREC, "7") field(INPA, "BEND:LTUS:168:IACT CP NMS") field(INPB, "BTRM:LTUS:168:BACT") field(OUT, "BEND:LTUS:168: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, "BEND:LTUS:168:IMONCALC"){ field(DESC, "Calc total mon current") field(CALC, "A+B") field(EGU, "kG-m") field(PREC, "7") field(INPA, "BEND:LTUS:168:IMON CP NMS") field(INPB, "BTRM:LTUS:168:BMON") field(OUT, "BEND:LTUS:168: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, "BEND:LTUS:168:ICONTOTAL"){ field(DESC, "Calc total current") field(CALC, "A+B") field(EGU, "kG-m") field(PREC, "7") field(INPA, "BEND:LTUS:166:ICON CP NMS") field(INPB, "BTRM:LTUS:168:BCON CP NMS") field(OUT, "BEND:LTUS:168:ICON2BCON.E PP") } record(sub, "BEND:LTUS:168:ICON2BCON") { field(DESC, "Cal BCON") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "BEND:LTUS:168:ICON2BCON") field(INPB, "BEND:LTUS:168:POLYCOEF") field(INPC, "BEND:LTUS:168:POLYCOEF.A") field(INPD, "BEND:LTUS:168:POLYCOEF.B") field(INPE, "BEND:LTUS:168:ICONTOTAL MS") field(INPF, "BEND:LTUS:166:BDELTAS PP") field(INPG, "100") field(EGU, "kG-m") field(HOPR, "4.5326") field(LOPR, "0.0131") field(HIHI, "4.5326") field(LOLO, "0.0131") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "4.5326") field(LOW, "0.0131") field(FLNK, "BEND:LTUS:168:BCON") } #! 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, "BEND:LTUS:475:IACT") { field(DESC, "Current") field(INP, "BEND:LTUS:476:IACT CP NMS") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "BEND:LTUS:475:IACTCALC") info(autosaveFields,"HYST") } record(bi, "BEND:LTUS:475:STATE") { field(DESC, "PS On/Off Status") field(DTYP, "Raw Soft Channel") field(INP, "BEND:LTUS:476:STATE CP MS") field(ZSV, "MAJOR") field(ZNAM, "OFF") field(ONAM, "ON") } record(ao, "BEND:LTUS:475:IDES") { field(DESC, "Desired Current") field(PREC, "3") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(MDEL, "-1") field(HIHI, "250.0") field(LOLO, "0.0") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "BEND:LTUS:475:BDELTAS") field(DRVH, "250.0") field(DRVL, "0.0") field(DOL, "BEND:LTUS:475: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, "BEND:LTUS:475:ICTRL PP") } # This record is processed by BEND:LTUS:475:ICON") # Note: we are not setting alarms here. record(ao, "BEND:LTUS:475:ICON") { field(DESC, "Config I") field(DTYP, "Soft Channel") field(PREC, "3") field(HOPR, "250.0") field(LOPR, "0.0") field(DRVH, "250.0") field(DRVL, "0.0") field(DOL, "BEND:LTUS:475:B2ICON.K") field(OMSL, "closed_loop") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:475:INOM") { field(DESC, "Nominal Current") field(DOL, "BEND:LTUS:475:BNOM.K") field(OMSL, "closed_loop") field(PREC, "3") field(EGU, "A") field(DRVH, "250.0") field(DRVL, "0.0") field(HOPR, "250.0") field(LOPR, "0.0") } record(ao, "BEND:LTUS:475:ICTRL") { field(DESC, "Set Current") field(PREC, "3") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(DRVH, "250.0") field(DRVL, "0.0") field(MDEL, "-1") field(FLNK, "BEND:LTUS:475:ICTRLGO") field(OMSL, "supervisory") info(autosavefields,"VAL") } record(seq, "BEND:LTUS:475:ICTRLGO") { field(DESC, "Process Current Setpoint") field(PREC, "3") # Set ISETPT to supervisory field(DOL1, "0") field(LNK1, "BEND:LTUS:475:ISETPT.OMSL") field(DOL2, "BEND:LTUS:475:ICTRL") field(LNK2, "BEND:LTUS:475:ISETPT PP") # Set ISETPT to closed loop - get data from BCTRLSUB.K field(DOL3, "1") field(LNK3, "BEND:LTUS:475:ISETPT.OMSL") } record(ao, "BEND:LTUS:475:IMAX") { field(DESC, "Max I") field(DTYP, "Soft Channel") field(DRVH, "250.0") field(DRVL, "0.0") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(PREC, "3") field(PINI, "YES") field(VAL, "250.0") field(FLNK, "BEND:LTUS:475:IMIN") } record(ao, "BEND:LTUS:475:IMIN") { field(DESC, "Min I") field(DTYP, "Soft Channel") field(DRVH, "250.0") field(DRVL, "0.0") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(PREC, "3") field(VAL, "0.0") field(FLNK, "BEND:LTUS:475:IRANGE") } record(sel, "BEND:LTUS:475:IACTPREVOK") { field(DESC, "Last Good Current") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(PREC, "3") field(NVL, "BEND:LTUS:475:BACT.SEVR") field(INPA, "BEND:LTUS:475:IACT NPP MS") field(INPB, "BEND:LTUS:475:IACTPREVOK NPP MS") field(INPC, "BEND:LTUS:475:IACTPREVOK NPP MS") field(INPD, "BEND:LTUS:475:IACTPREVOK NPP MS") } record(sub, "BEND:LTUS:475:IACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "BEND:LTUS:475:IDES") field(INPB, "BEND:LTUS:475:ISETPT.DRVH") field(INPC, "BEND:LTUS:475:ISETPT.DRVL") field(INPD, "BEND:LTUS:475:IDELTAS.I") field(INPE, "BEND:LTUS:475:IDELTAS.J") field(INPG, "BEND:LTUS:475:STATE") field(INPH, "BEND:LTUS:475:HSTA") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(sub, "BEND:LTUS:475:IMONLIMITS") { field(DESC, "Aux Current Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "BEND:LTUS:475:IDES") field(INPB, "BEND:LTUS:475:ISETPT.DRVH") field(INPC, "BEND:LTUS:475:ISETPT.DRVL") field(INPD, "BEND:LTUS:475:IDELTAS.K") field(INPE, "BEND:LTUS:475:IDELTAS.L") field(INPG, "BEND:LTUS:475:STATE") field(INPH, "BEND:LTUS:475:HSTA") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(seq, "BEND:LTUS:475:ILIMITS") { field(DESC, "Set ACT and MON Limits") field(PREC, "3") field(DOL1, "BEND:LTUS:475:BLIMITS") field(LNK1, "BEND:LTUS:475:IACTLIMITS.F PP") field(DOL2, "BEND:LTUS:475:IACTLIMITS.I") field(LNK2, "BEND:LTUS:475:IACT.HIGH") field(DOL3, "BEND:LTUS:475:IACTLIMITS.J") field(LNK3, "BEND:LTUS:475:IACT.LOW") field(DOL4, "BEND:LTUS:475:IACTLIMITS.K") field(LNK4, "BEND:LTUS:475:IACT.HIHI") field(DOL5, "BEND:LTUS:475:IACTLIMITS.L") field(LNK5, "BEND:LTUS:475:IACT.LOLO") field(DOL6, "BEND:LTUS:475:BLIMITS") field(LNK6, "BEND:LTUS:475:IMONLIMITS.F PP") field(DOL7, "BEND:LTUS:475:IMONLIMITS.I") field(LNK7, "BEND:LTUS:475:IMON.HIGH") field(DOL8, "BEND:LTUS:475:IMONLIMITS.J") field(LNK8, "BEND:LTUS:475:IMON.LOW") field(DOL9, "BEND:LTUS:475:IMONLIMITS.K") field(LNK9, "BEND:LTUS:475:IMON.HIHI") field(DOLA, "BEND:LTUS:475:IMONLIMITS.L") field(LNKA, "BEND:LTUS:475: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, "BEND:LTUS:475:IDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntRawDeltas") field(INPD, "BEND:LTUS:475:TRIMBTOL") field(INPE, "BEND:LTUS:475:CHCKBTOL") field(INPF, "BEND:LTUS:475:BDELTAS.K") field(INPG, "BEND:LTUS:475:BDELTAS.L") field(INPH, "BEND:LTUS:475: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, "BEND:LTUS:475:STDZITOLR") field(INPC, "BEND:LTUS:475:STDZITOL") field(FLNK, "") } # All ps controllers with on/off control will set the macro ONOF # as follows: # # ONOF = BEND:LTUS:476: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, "BEND:LTUS:475: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 = BEND:LTUS:476:RESET PP # record(bo, "BEND:LTUS:475: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, "BEND:LTUS:475:RAMPSTATE") { field(DESC, "PS Ramp Status") field(DTYP, "Soft Channel") field(DOL, "BEND:LTUS:476: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, "BEND:LTUS:475: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, "BEND:LTUS:475:TRIMRAMPRATE") field(OUT, "") field(FLNK, "BEND:LTUS:475:STDZDLY") } record(ao, "BEND:LTUS:475:ISETPT") { field(DESC, "Current Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(DRVH, "250.0") field(DRVL, "0.0") field(MDEL, "-1") field(OUT, "") field(DOL, "BEND:LTUS:475: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, "BEND:LTUS:475:IMON") { field(DESC, "Aux Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(INP, "BEND:LTUS:476:IMON CP NMS") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "BEND:LTUS:475:IMONCALC") } record(ao, "BEND:LTUS:475:IRIPL") { field(DESC, "Ripple Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(DOL, "BEND:LTUS:476:IRIPL CP NMS") field(OMSL, "closed_loop") field(EGU, "A") field(DRVH, "1.0") field(HOPR, "1.0") field(PREC, "3") field(FLNK, "BEND:LTUS:475:IRIPLOK") } record(sub, "BEND:LTUS:475:IRIPLOK") { field(DESC, "Ripple Current Status") field(INAM, "mgntInit") field(SNAM, "mgntRiplOK") field(INPA, "BEND:LTUS:475:IRIPL.VAL") field(INPB, "BEND:LTUS:475: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, "BEND:LTUS:475:R") { field(DESC, "Resistance") field(EGU, "Ohms") field(PREC, "4") field(PINI, "YES") field(DOL, "BEND:LTUS:476: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, "BEND:LTUS:475:IGND") { field(DESC, "Ground Current") field(EGU, "A") field(PREC, "6") field(PINI, "YES") field(DOL, "BEND:LTUS:476:IGND CP MS") field(OMSL, "closed_loop") } record(bi, "BEND:LTUS:475:INTLKSUMY") { field(DESC, "Interlock Summary") field(INP, "BEND:LTUS:476:INTLKSUMY CP MS") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(ZNAM, "OK") field(ONAM, "FAULT") field(PINI, "NO") } record(mbbo, "BEND:LTUS:475: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, "BEND:LTUS:476:COOLING CP NMS") field(OMSL, "closed_loop") } # The following PV is processed by :BACTFO # which is processed by :BACT record(fanout, "BEND:LTUS:475:IACTFO") { field(DESC, "IACT processing") field(SELM, "All") field(LNK1, "BEND:LTUS:475:IACTPREVOK") field(LNK2, "BEND:LTUS:475:IDIFF") field(LNK3, "BEND:LTUS:475:IADIFF") field(LNK4, "BEND:LTUS:475:IRATIO") field(LNK5, "BEND:LTUS:475:IDIRECT") field(LNK6, "BEND:LTUS:475:IACTPOL_CHECK") } record(calc, "BEND:LTUS:475:IDIFF") { field(DESC, "IDES-IACT") field(CALC, "A-B") field(INPA, "BEND:LTUS:475:IDES") field(INPB, "BEND:LTUS:475:IACT") field(EGU, "A") field(PREC, "9") field(HOPR, "250.0") field(LOPR, "0.0") } record(calc, "BEND:LTUS:475:IADIFF") { field(DESC, "Absolute IDES-IACT") field(CALC, "A<0?ABS(A):A") field(INPA, "BEND:LTUS:475:IDIFF") field(PREC, "9") } record(calc, "BEND:LTUS:475:IRATIO") { field(DESC, "IDES-IACT/IMAX") field(CALC, "B?A/B:0") field(INPA, "BEND:LTUS:475:IDIFF") field(INPB, "BEND:LTUS:475:IDES.DRVH") field(PREC, "9") } record(calcout, "BEND:LTUS:475:IRANGE") { field(DESC, "Current Range") field(PINI, "YES") field(CALC, "ABS(A-B)") field(INPA, "BEND:LTUS:475:IMIN") field(INPB, "BEND:LTUS:475: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, "BEND:LTUS:475: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, "BEND:LTUS:475:IACT") field(FLNK, "BEND:LTUS:475:IACTPOL") } record(bo, "BEND:LTUS:475:IACTPOL") { field(DESC, "Actual I Polarity") field(DTYP, "Raw Soft Channel") field(DOL, "BEND:LTUS:475: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,"BEND:LTUS:475:I*LIMITS:\n Calculate alarm and warning limits based on \n deltas from BEND:LTUS:475:IDELTAS and the\n BEND:LTUS:475: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,"BEND:LTUS:475:IACT: \n Get copy of BEND:LTUS:475:I. \n",null) #! TextBox(TB12,1280,3100,1760,3200,0,"Dialog",12,1,16777215,"BEND:LTUS:475: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,"BEND:LTUS:475:IDES:\n Contains raw value calculated by \nBEND:LTUS:475: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 \nBEND:LTUS:475:BDELTAS.\n",null) #! TextBox(TB10,56,1940,316,2340,0,"Dialog",12,1,16777215,"BEND:LTUS:475: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 BEND:LTUS:475: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 BEND:LTUS:475: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,"BEND:LTUS:475:ISETPT:\n Sets the hardware. When fast feedback is set on, this record is\n set to closed loop mode by BEND:LTUS:475:FBCKSTART sequence. When \n the loop is closed, this record takes input calculated by \n BFBCK only. When fast feedback is set off, BEND:LTUS:475:FBCKSTOP \n will set it back to supervisory so that the value can be set by \n BEND:LTUS:475: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, "BEND:LTUS:475:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:475:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "BEND:LTUS:475:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "BEND:LTUS:475:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "BEND:LTUS:475:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "BEND:LTUS:475:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "1") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "BEND:LTUS:475: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, "BEND:LTUS:475:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "BEND:LTUS:475:TRIMTYPE.RVAL") field(INPB, "BEND:LTUS:475:CONFIG.RVAL") field(OUT, "BEND:LTUS:475:TRIMMAXNUM PP") } record(longout, "BEND:LTUS:475: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, "BEND:LTUS:475: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, "BEND:LTUS:476:TRIMRAMPRATE CP NMS") field(OMSL, "closed_loop") field(VAL, "") field(OUT, "BEND:LTUS:475:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "BEND:LTUS:475: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, "BEND:LTUS:476:TRIMSETL CP NMS") field(OMSL, "closed_loop") field(VAL, "") } record(bo, "BEND:LTUS:475: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, "BEND:LTUS:475: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, "BEND:LTUS:475: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, "BEND:LTUS:475:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "0") } record(ao, "BEND:LTUS:475: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, "BEND:LTUS:475:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "BEND:LTUS:475: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, "BEND:LTUS:475: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, "BEND:LTUS:475:IMOVE") field(INPB, "BEND:LTUS:475:IACT") field(INPC, "BEND:LTUS:475:IRAMPRATE") field(INPD, "1.577") field(INPE, "BEND:LTUS:475:TRIMDLYPCT") field(INPF, "BEND:LTUS:475:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "BEND:LTUS:475:RAMPTIME_LEFT PP") } record(longout, "BEND:LTUS:475:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "BEND:LTUS:475:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "BEND:LTUS:475:RAMPDONE_CALC") } record(calc, "BEND:LTUS:475:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "BEND:LTUS:475:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "BEND:LTUS:475:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "BEND:LTUS:475: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, "BEND:LTUS:475:RAMPTIME_LEFT") field(OUT, "BEND:LTUS:475:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "BEND:LTUS:475:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "BEND:LTUS:475:RAMPTIME_LEFT NMS") field(OUT, "BEND:LTUS:475:RAMPDONE PP") } record(bo, "BEND:LTUS:475:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "BEND:LTUS:475:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "BEND:LTUS:475: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, "BEND:LTUS:475: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, "BEND:LTUS:475:STDZINIT") { field(DESC, "Proc. Stdz PVs on boot") field(PINI, "YES") field(DOL1, "1") field(DOL2, "1") field(DOL3, "1") field(LNK1, "BEND:LTUS:475:DEBUG.PROC PP") field(LNK2, "BEND:LTUS:475:STDZCYCLENUM.PROC PP") field(LNK3, "BEND:LTUS:475:STDZDISABLE.PROC PP") field(LNK4, "BEND:LTUS:475: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, "BEND:LTUS:475:STDZSUB") { field(DESC, "Stdz subroutine") field(INAM, "mgntStdzInit") field(SNAM, "mgntStdz") field(BRSV, "INVALID") field(INPA, "BEND:LTUS:475:STDZIMIN NPP NMS") field(INPB, "BEND:LTUS:475:STDZIMAX NPP NMS") field(INPC, "BEND:LTUS:475:STDZIFINAL NPP NMS") field(INPD, "BEND:LTUS:475:STDZCYCLENUM NPP NMS") field(INPE, "BEND:LTUS:475:STDZDIRECT.RVAL NPP NMS") field(INPF, "BEND:LTUS:475:STDZDISABLE.RVAL CPP NMS") field(INPG, "BEND:LTUS:475: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, "BEND:LTUS:475:STDZWF PP") field(OUTB, "BEND:LTUS:475: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, "BEND:LTUS:475:STDZWF") } record(mbbo, "BEND:LTUS:475: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, "BEND:LTUS:475: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, "BEND:LTUS:475:STDZMAINPS") { field(DESC, "Stdz by main or self") field(PINI, "YES") field(DTYP, "Soft Channel") field(ZNAM, "SELF") field(ONAM, "MAIN") } record(bo, "BEND:LTUS:475: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, "BEND:LTUS:475: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, "BEND:LTUS:475: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, "BEND:LTUS:475:STDZTOD") { field(DESC, "Successful Standardize Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "BEND:LTUS:475:STDZLOSTTOD") { field(DESC, "Standardize Lost Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(longout, "BEND:LTUS:475:STDZCYCLECNT") { field(DESC, "Cycle Count") field(PINI, "YES") } record(longout, "BEND:LTUS:475: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, "BEND:LTUS:475:STDZDIRECT") } # The default standardize direction is "UP" for # all LCLS Magnets.. record(bo, "BEND:LTUS:475:STDZDIRECT") { field(DESC, "Standardize Direction ") field(ZNAM, "UP") field(ONAM, "DOWN") field(VAL, "0") field(FLNK, "BEND:LTUS:475:STDZIMIN") } record(ao, "BEND:LTUS:475:STDZIMIN") { field(DESC, "Min-STDZ Current") field(PREC, "1") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(VAL, "0.0") field(FLNK, "BEND:LTUS:475:STDZIMAX") } record(ao, "BEND:LTUS:475:STDZIMAX") { field(DESC, "Max. Standarize Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(VAL, "250.0") field(FLNK, "BEND:LTUS:475:STDZIFINAL") } record(ao, "BEND:LTUS:475:STDZIFINAL") { field(DESC, "Final SDTZ Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(VAL, "0.0") field(FLNK, "BEND:LTUS:475: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, "BEND:LTUS:475: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, "BEND:LTUS:475:STDZITOL") { field(DESC, "Stdz min tolerance") field(PREC, "5") field(CALC, "MAX(ABS(A),ABS(B))*C") field(INPA, "BEND:LTUS:475:STDZIMIN CP NMS") field(INPB, "BEND:LTUS:475:STDZIMAX CP MMS") field(INPC, "0.05") field(INPD, "BEND:LTUS:475:STDZITOLR CP MMS") field(EGU, "A") field(FLNK, "BEND:LTUS:475:IDELTAS") field(PINI, "YES") } # D - factor (3.154/2 = 1.577) for EPSC, otherwise, set to 1.0 record(calc, "BEND:LTUS:475:STDZDLY") { field(DESC, "Ramp time for stdz cycle") field(CALC, "C>0?MAX(1,ABS((A-B)/C)*D):0") field(INPA, "BEND:LTUS:475:STDZIMIN CP NMS") field(INPB, "BEND:LTUS:475:STDZIMAX CP NMS") field(INPC, "BEND:LTUS:475:TRIMRAMPRATE CP NMS") field(INPD, "1.0") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") } record(calc, "BEND:LTUS:475:STDZRAMPDLY") { field(DESC, "Ramp delay total") field(CALC, "MAX(1,((A/100)*B+B))") field(PREC, "5") field(INPA, "BEND:LTUS:475:TRIMDLYPCT CP MS") field(INPB, "BEND:LTUS:475: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, "BEND:LTUS:475:STDZMINIDLY") { field(DESC, "Mini-stdz delay") field(CALC, "A") field(PREC, "5") field(A, "1.0") field(EGU, "sec") field(PINI, "YES") } record(ao, "BEND:LTUS:475: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, "BEND:LTUS:475:STDZMINIDELTA") { field(DESC, "Stdz mini % of IMAX") field(CALC, "(B/100)*(A-C)") field(INPA, "BEND:LTUS:475:IDES.HOPR") field(INPB, "BEND:LTUS:475:STDZMINIPCT CPP NMS") field(INPC, "BEND:LTUS:475:IDES.LOPR") field(PREC, "5") } record(calc, "BEND:LTUS:475:STDZMINISETPT") { field(DESC, "Mini Stdz delta") field(CALC, "C==0?MAX(E-D,B):MIN(E+D,A)") field(INPA, "BEND:LTUS:475:IDES.HOPR") field(INPB, "BEND:LTUS:475:IDES.LOPR") field(INPC, "BEND:LTUS:475:STDZDIRECT.RVAL") field(INPD, "BEND:LTUS:475:STDZMINIDELTA") field(INPE, "BEND:LTUS:475:IDES") field(PREC, "5") field(FLNK, "BEND:LTUS:475: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, "BEND:LTUS:475:STDZMINISETPTOOR") { field(DESC, "Mini Stdz setpoint out of range") field(CALC, "C==0?(E-DA)") field(INPA, "BEND:LTUS:475:IDES.HOPR") field(INPB, "BEND:LTUS:475:IDES.LOPR") field(INPC, "BEND:LTUS:475:STDZDIRECT.RVAL") field(INPD, "BEND:LTUS:475:STDZMINIDELTA") field(INPE, "BEND:LTUS:475: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, "BEND:LTUS:475: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, "BEND:LTUS:475:IADJUST.RVAL") field(INPB, "BEND:LTUS:475:STDZDIRECT.RVAL") field(INPC, "BEND:LTUS:475:STDZOK.RVAL") field(INPD, "BEND:LTUS:475:STDZDISABLE.RVAL") field(INPE, "BEND:LTUS:475:STATE.RVAL CPP NMS") field(INPF, "BEND:LTUS:475:ICTRL.RVAL") field(INPG, "BEND:LTUS:475:STATE.SEVR") field(INPH, "BEND:LTUS:475:BDELTAS.M") field(INPI, "BEND:LTUS:475:IACT.SEVR") field(OUT, "BEND:LTUS:475:STDZLOSTGO.SELN PP NMS") field(OOPT, "Transition To Non-zero") } record(seq, "BEND:LTUS:475:STDZLOSTGO") { field(DESC, "Process lost stdz") field(SELM, "Mask") field(DOL1, "1") field(DOL2, "0") field(LNK1, "BEND:LTUS:475:STDZLOSTTOD.PROC") field(LNK2, "BEND:LTUS:475:STDZOK PP") } # Record maximum current after standardize # Reset to IACT from sequence after trim # Disable processing during (mini-)standardize or trim record(calc, "BEND:LTUS:475:STDZIACTMAX") { field(DESC, "Max act current after stdz") field(CALC, "MAX(A, B)") field(DISV, "0") field(SDIS, "BEND:LTUS:475:CHECKPWRDIP_ENABLE") field(INPA, "BEND:LTUS:475:IACT CP") field(INPB, "BEND:LTUS:475:STDZIACTMAX") field(EGU, "A") field(FLNK, "BEND:LTUS:475:CHECKPWRDIP") } # Detect power dip if STDZOK is YES, STDZ is enabled, and IACT is valid # If IACT drops below STDZIACTMAX by more than the trim tolerance, clear STDZOK # Warning: Take the absolute value of the trim tolerance, or else quads of # negative polarity will always lose STDZ since their IDELTAS.I are negative. # Note: Large quads and bends are prone to losing STDZ even if they are # perturbed toward higher current since their current tends to overshoot # by greater than the trim tolerance before settling down. record(calcout, "BEND:LTUS:475:CHECKPWRDIP") { field(DESC, "Detect power dip") field(CALC, "(A-B>ABS(C))?3:0") field(DISV, "0") field(SDIS, "BEND:LTUS:475:CHECKPWRDIP_ENABLE") field(INPA, "BEND:LTUS:475:STDZIACTMAX") field(INPB, "BEND:LTUS:475:IACT") field(INPC, "BEND:LTUS:475:IDELTAS.I") field(OUT, "BEND:LTUS:475:STDZLOSTGO.SELN PP NMS") field(OOPT, "When Non-zero") } # Enable processing of STDZIACTMAX and CHECKPWRDIP only if # STDZOK = YES, STDZDISABLE = NO, CTRL != Trim (2), and # CTRL != Stdz (4) record(calc, "BEND:LTUS:475:CHECKPWRDIP_ENABLE") { field(CALC, "A&&!B&&(C#2)&&(C#4)") field(INPA, "BEND:LTUS:475:STDZOK.RVAL CP") field(INPB, "BEND:LTUS:475:STDZDISABLE.RVAL CP") field(INPC, "BEND:LTUS:475:CTRL.RVAL CP") } #! 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, "BEND:LTUS:475: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, "BEND:LTUS:475: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, "BEND:LTUS:475:CALBSET") { field(DESC, "Use DAC Calbration") field(SCAN, "10 second") field(CALC, "A&&(B==0)&&C?31:960") field(INPA, "BEND:LTUS:475:CALBOK") field(INPB, "BEND:LTUS:475:CALBDISABLE") field(INPC, "BEND:LTUS:475:CALBSLOPE") field(OOPT, "On Change") field(OUT, "BEND:LTUS:475: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, "BEND:LTUS:475:CALB_SEQ") { field(DESC, "Output Calib Values") field(SELM, "Mask") field(SELL, "BEND:LTUS:475: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, "BEND:LTUS:475:CALBSLOPE") field(DOL3, "BEND:LTUS:475: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, "BEND:LTUS:475:CALBTOD") { field(DESC, "Calibration Success Time") field(PINI, "YES") # field(DOL, "") field(OMSL, "supervisory") field(DTYP, "Soft Channel") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:475: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, "BEND:LTUS:475: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, "BEND:LTUS:475: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, "BEND:LTUS:475:CALBOFFSET") { field(DESC, "Calc DAC Offset") field(PREC, "6") field(EGU, "Counts") field(PINI, "YES") } record(bo, "BEND:LTUS:475: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, "BEND:LTUS:475:DACSLOPE") { field(DESC, "V to DAC slope") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "supervisory") field(PINI, "YES") field(FLNK, "BEND:LTUS:475:DACOFFSET") } # Default Offset used in conversion from Volts to DAC Counts record(ao, "BEND:LTUS:475:DACOFFSET") { field(DESC, "V to DAC offset") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "supervisory") field(PINI, "YES") field(FLNK, "BEND:LTUS:475: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, "BEND:LTUS:475: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, "BEND:LTUS:475:IACT") field(INPD, "BEND:LTUS:475:DACSLOPE") field(INPE, "BEND:LTUS:475:DACOFFSET") field(EGU, "Counts") field(PREC, "6") } record(ao, "BEND:LTUS:475:DAC") { field(DESC, "DAC Set point") field(EGU, "Counts") field(DOL, "") field(OMSL, "supervisory") field(PREC, "6") field(PINI, "YES") } record(ao, "BEND:LTUS:475:CALBIMIN") { field(DESC, "Calibration Min Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(DRVH, "250.0") field(HOPR, "250.0") field(DRVL, "0.0") field(LOPR, "0.0") field(PREC, "3") field(EGU, "A") field(VAL, "0.0") field(FLNK, "BEND:LTUS:475:CALBIMAX") } record(ao, "BEND:LTUS:475:CALBIMAX") { field(DESC, "Calibration Max Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(DRVH, "250.0") field(HOPR, "250.0") field(LOPR, "0.0") field(DRVL, "0.0") field(EGU, "A") field(VAL, "250.0") field(FLNK, "BEND:LTUS:475:CALBSTEPNUM") } record(ao, "BEND:LTUS:475:CALBIFINAL") { field(DESC, "Calibration Last Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(PREC, "3") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(VAL, "0") } record(longout, "BEND:LTUS:475: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, "BEND:LTUS:475:CALBIDELTA") } record(calc, "BEND:LTUS:475:CALBIDELTA") { field(DESC, "Step size for CALB") field(CALC, "C=0?0:ABS((A-B)/C)") field(INPA, "BEND:LTUS:475:CALBIMAX") field(INPB, "BEND:LTUS:475:CALBIMIN") field(INPC, "BEND:LTUS:475: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, "BEND:LTUS:475:CALBIMULT") { field(DESC, "IACT vs ISETPT mult") field(CALC, "C#0||A=0?1:ABS(B/A)") field(INPA, "BEND:LTUS:476:ISETPT.DRVH") field(INPB, "BEND:LTUS:476:IACT.HOPR") field(INPC, "BEND:LTUS:475:PSCONTROLLER.RVAL CPP") field(EGU, "A") field(PINI, "YES") } # SNL dbputs DAC values here. 6-10 steps are possible. record(waveform, "BEND:LTUS:475:CALBICTRLWF") { field(DESC, "ICTRL setpoint array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") } record(waveform, "BEND:LTUS:475:DACWF") { field(DESC, "DAC count array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "BEND:LTUS:475:DACSA") } # Used only for xygraph edm plot record(subArray, "BEND:LTUS:475:DACSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "BEND:LTUS:475: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, "BEND:LTUS:475:CALCDACWF") { field(DESC, "Calc DAC counts array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "BEND:LTUS:475:CALCDACSA") } # Used only for xygraph edm plot record(subArray, "BEND:LTUS:475:CALCDACSA") { field(DESC, "Calc DAC counts") field(DTYP, "Soft Channel") field(INP, "BEND:LTUS:475: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, "BEND:LTUS:475:CALBYWF") { field(DESC, "mx + b") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "BEND:LTUS:475:CALBYSA") } # Used only for xygraph edm plot record(subArray, "BEND:LTUS:475:CALBYSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "BEND:LTUS:475:CALBYWF") field(MALM, "10") field(NELM, "6") field(INDX, "0") field(FTVL, "DOUBLE") } record(waveform, "BEND:LTUS:475:CALBIACTWF") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "BEND:LTUS:475:CALBIACTSA") } # Used only for xygraph edm plot record(subArray, "BEND:LTUS:475:CALBIACTSA") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(MALM, "10") field(NELM, "6") field(INP, "BEND:LTUS:475:CALBIACTWF") field(INDX, "0") field(FTVL, "DOUBLE") field(FLNK, "BEND:LTUS:475:CALBLIMITS") } # Check that measured current during calibration is within # tolerance. record(aSub, "BEND:LTUS:475: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, "BEND:LTUS:475:CALBSTEPNUM") field(INPB, "BEND:LTUS:475:CALBIACTWF") field(INPC, "BEND:LTUS:475: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, "BEND:LTUS:475: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, "BEND:LTUS:475:STDZITOL") field(INPH, "BEND:LTUS:475:DACSLOPE") field(INPI, "BEND:LTUS:475: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, "BEND:LTUS:475: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, "BEND:LTUS:475:CALBSTEPNUM") field(INPB, "BEND:LTUS:475:CALBIACTWF") field(INPC, "BEND:LTUS:475:DACWF") field(INPF, "BEND:LTUS:475: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 BEND:LTUS:475CALBOK 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, "BEND:LTUS:475:DEGAUSINIT") { field(DESC, "Proc. Degauss PVs on boot") field(PINI, "YES") field(DOL, "1") field(OUTA, "BEND:LTUS:475:DEGAUSIMIN.PROC PP") field(OUTB, "BEND:LTUS:475:DEGAUSIMAX.PROC PP") field(OUTC, "BEND:LTUS:475:DEGAUSTYPE.PROC PP") field(OUTD, "BEND:LTUS:475:DEGAUSSTEP.PROC PP") field(OUTE, "BEND:LTUS:475:MADNAME.PROC PP") field(OUTF, "BEND:LTUS:475:PSTYPE.PROC PP") field(OUTG, "BEND:LTUS:475: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, "BEND:LTUS:475:DEGAUSSUB") { field(DESC, "Degauss subroutine") field(INAM, "mgntDegaussInit") field(SNAM, "mgntDegauss") field(BRSV, "INVALID") field(INPA, "BEND:LTUS:475:DEGAUSIMIN NPP NMS") field(INPB, "BEND:LTUS:475:DEGAUSIMAX NPP NMS") field(INPC, "BEND:LTUS:475:DEGAUSTYPE.RVAL NPP NMS") field(INPE, "BEND:LTUS:475:DEGAUSMETHOD.RVAL NPP NMS") field(INPF, "BEND:LTUS:475:PSTYPE NPP NMS") field(INPG, "BEND:LTUS:475:DEBUG.RVAL NPP NMS") field(INPH, "BEND:LTUS:475: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, "BEND:LTUS:475:DEGAUSWF PP") field(OUTB, "BEND:LTUS:475:DEGAUSMSG PP") field(OUTC, "BEND:LTUS:475: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, "BEND:LTUS:475:DEGAUSWF") { field(DESC, "Degauss Setpts") field(NELM, "60") field(FTVL, "DOUBLE") } record(mbbo,"BEND:LTUS:475: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, "BEND:LTUS:475: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, "BEND:LTUS:475: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, "BEND:LTUS:475: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, "BEND:LTUS:475: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, "BEND:LTUS:475:DEGAUSIMIN") { field(DESC, "Min. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "250.0") field(LOPR, "-250.0") field(DRVH, "250.0") field(DRVL, "-250.0") field(VAL, "-250.0") } record(ao, "BEND:LTUS:475:DEGAUSIMAX") { field(DESC, "Max. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "250.0") field(LOPR, "-250.0") field(DRVH, "250.0") field(DRVL, "-250.0") field(VAL, "250.0") } # 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,"BEND:LTUS:475: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, "BEND:LTUS:475: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,"BEND:LTUS:475: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, "BEND:LTUS:475: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, "BEND:LTUS:475: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, "BEND:LTUS:475: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, "BEND:LTUS:475:DEGAUSTOD") { field(DESC, "Successful Degauss Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "BEND:LTUS:475:DEGAUSLOSTTOD") { field(DESC, "Degauss Lost Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:475:DEGAUSTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "BEND:LTUS:475:DEGAUSTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "BEND:LTUS:475: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, "BEND:LTUS:475:DEGAUSGO") { field(DESC, "Set bdes of btrms to zero") field(ASG, "Internal") field(OUTA, "") field(OUTB, "") field(OUTC, "") field(OUTD, "") } # =========== CRYO ONLY =========== record(bo, "BEND:LTUS:475: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, "BEND:LTUS:475:DEGAUS_IMAX_CHECK") { field(DESC, "Check if imax shoud chg") field(CALC, "(C==4)&&(ABS(B)>ABS(A))?1:0") field(INPA, "BEND:LTUS:475:DEGAUS_IMAX") field(INPB, "BEND:LTUS:475:ISETPT") field(INPC, "BEND:LTUS:475:DEGAUSTYPE.RVAL") field(OUT, "BEND:LTUS:475:DEGAUS_IMAX_UPDATE.SELN") field(FLNK, "BEND:LTUS:475:DEGAUS_IMAX_UPDATE") } record(seq, "BEND:LTUS:475:DEGAUS_IMAX_UPDATE") { field(DESC, "Degauss IMAX Update") field(SELM, "Specified") field(DOL1, "BEND:LTUS:475:ISETPT") field(LNK1, "BEND:LTUS:475:DEGAUS_IMAX PP") } # Set the maximum current after a successful # degauss. This pv is updated by the # sequence. record(ao, "BEND:LTUS:475:DEGAUS_IMAX") { field(DESC, "Max I set afer a degauss") field(EGU, "Amps") field(PINI, "YES") field(PREC, "6") field(HOPR, "250.0") field(LOPR, "-250.0") field(DRVH, "250.0") field(DRVL, "-250.0") field(VAL, "250.0") field(FLNK, "BEND:LTUS:475:DEGAUS_IMAXPOL_CHECK") info(autosaveFields,"VAL,RVAL") } # Set the polarity if degauss_imax record(calcout, "BEND:LTUS:475:DEGAUS_IMAXPOL_CHECK") { field(DESC, "Determine polarity of imax") field(CALC, "A>=0?0:1") field(INPA, "BEND:LTUS:475:DEGAUS_IMAX") field(FLNK, "BEND:LTUS:475:DEGAUS_IMAXPOL") } record(bo, "BEND:LTUS:475:DEGAUS_IMAXPOL") { field(DESC, "Polarity of imax I") field(DTYP, "Raw Soft Channel") field(DOL, "BEND:LTUS:475:DEGAUS_IMAXPOL_CHECK") field(OMSL, "closed_loop") field(ZNAM, "Positive") field(ONAM, "Negative") field(FLNK, "BEND:LTUS:475: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, "BEND:LTUS:475:DEGAUS_ABSIMAX") { field(DESC, "Absolute Max. Degauss I") field(CALC, "ABS(A)") field(INPA, "BEND:LTUS:475:DEGAUS_IMAX") field(PREC, "6") field(EGU, "Amps") field(HOPR, "250.0") field(LOPR, "-250.0") info(autosaveFields,"VAL RVAL") } # IACT Polarity record(calcout, "BEND:LTUS:475:IACTPOL_CHECK") { field(DESC, "Determine IACT polarity") field(SCAN, "5 second") field(CALC, "ABS(A-B)>C?(A>=0?0:1):D") field(INPA, "BEND:LTUS:475:IACT") field(INPB, "BEND:LTUS:475:IACTPOL_CHECK.LA") field(INPC, "0.0001") field(INPD, "BEND:LTUS:475:IACTPOL_CHECK.PVAL") field(OOPT, "On Change") field(FLNK, "BEND:LTUS:475:IACTPOL") } record(bo, "BEND:LTUS:475: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,"BEND:LTUS:475: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, "BEND:LTUS:475:DEGAUSENABLE CP") field(INPB, "BEND:LTUS:475:DEGAUSOK") field(INPC, "BEND:LTUS:475:STATE CP") field(INPD, "BEND:LTUS:475:STATE.SEVR") field(OUT, "BEND:LTUS:475:DEGAUS_STATE_SEQ.SELN PP") field(ASG, "Internal") } record(seq, "BEND:LTUS:475:DEGAUS_STATE_SEQ") { field(DESC, "Degauss State Sequence") field(SELM, "Specified") field(SELL, "BEND:LTUS:475:DEGAUS_STATE_CHECK") field(LNK1, "BEND:LTUS:475:DEGAUS_STATE_DISABLE.PROC PP") field(LNK2, "BEND:LTUS:475:DEGAUS_STATE_LOST.PROC PP") field(LNK3, "BEND:LTUS:475:DEGAUS_STATE_GOOD.PROC PP") field(LNK4, "BEND:LTUS:475: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, "BEND:LTUS:475:DEGAUS_STATE_DISABLE") { field(DESC, "Degauss not used") field(LNK1, "BEND:LTUS:475:DEGAUSOK.ZSV") field(LNK2, "BEND:LTUS:475: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, "BEND:LTUS:475:STATMSG.FRSV") field(LNK4, "BEND:LTUS:475: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, "BEND:LTUS:475:DEGAUS_STATE_LOST") { field(DESC, "Degauss lost and ps On") field(DOL1, "1") field(LNK1, "BEND:LTUS:475:DEGAUSOK.ZSV") field(LNK2, "BEND:LTUS:475: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, "BEND:LTUS:475:STATMSG.FRSV") field(LNK4, "BEND:LTUS:475: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, "BEND:LTUS:475:DEGAUS_STATE_OFF") { field(DESC, "Degaused lost and ps Off") field(DOL1, "2") field(LNK1, "BEND:LTUS:475: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, "BEND:LTUS:475:STATMSG.FRSV") field(LNK3, "BEND:LTUS:475: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, "BEND:LTUS:475:DEGAUS_STATE_GOOD") { field(DESC, "Degauss good") field(DOL1, "1") field(LNK1, "BEND:LTUS:475: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, "BEND:LTUS:475:STATMSG.FRSV PP") field(LNK3, "BEND:LTUS:475:STATMSG.FVSV PP") field(LNK4, "") field(ASG, "Internal") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(mbbo, "BEND:LTUS:475:FUNC") { field(DESC, "BEND:LTUS:475 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, "0") field(FFVL, "0") field(OUT, "BEND:LTUS:475:CTRL CA") } # :CTRL pv is processed at boot in the # sequence mgntCtrl.st Processed in sequence # record(mbbo, "BEND:LTUS:475:CTRL") { field(DESC, "BEND:LTUS:475 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, "BEND:LTUS:475:SELECTEN.A PP") field(SDIS, "0") } # If a function has been selected set this unit to busy record(calcout, "BEND:LTUS:475:SELECTEN") { field(DESC, "Control Select Enable") field(CALC, "A>0?1:A") field(FLNK, "BEND:LTUS:475:BUSY") } # Set to FREE on IOC reboot record(bo, "BEND:LTUS:475:BUSY") { field(DESC, "BEND:LTUS:475 Ctrl Done") field(DOL, "BEND:LTUS:475:SELECTEN") field(ZNAM, "FREE") field(ONAM, "BUSY") field(PINI, "YES") field(FLNK, "BEND:LTUS:475:SELECT") } record(bo, "BEND:LTUS:475:SELECT") { field(ZNAM, "NO") field(ONAM, "YES") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") } record(bo, "BEND:LTUS:475: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, "BEND:LTUS:475:CTRLSTATE") { field(DESC, "BEND:LTUS:475 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("BEND:LTUS:475:CTRL",20,20,0,0,"BEND:LTUS:475:CTRL") #! Field("BEND:LTUS:475:CTRL.OUT",16777215,1,"BEND:LTUS:475:CTRL.OUT") #! Link("BEND:LTUS:475:CTRL.OUT","BEND:LTUS:475:SELECTEN.A") #! Field("BEND:LTUS:475:CTRL.VAL",16777215,1,"BEND:LTUS:475:CTRL.VAL") #! Record("BEND:LTUS:475:SELECTEN",321,381,0,0,"BEND:LTUS:475:SELECTEN") #! Field("BEND:LTUS:475:SELECTEN.A",16777215,0,"BEND:LTUS:475:SELECTEN.A") #! Field("BEND:LTUS:475:SELECTEN.FLNK",16777215,1,"BEND:LTUS:475:SELECTEN.FLNK") #! Link("BEND:LTUS:475:SELECTEN.FLNK","BEND:LTUS:475:BUSY") #! Field("BEND:LTUS:475:SELECTEN.VAL",16777215,1,"BEND:LTUS:475:SELECTEN.VAL") #! Record("BEND:LTUS:475:BUSY",623,274,0,0,"BEND:LTUS:475:BUSY") #! Field("BEND:LTUS:475:BUSY.DOL",16777215,0,"BEND:LTUS:475:BUSY.DOL") #! Link("BEND:LTUS:475:BUSY.DOL","BEND:LTUS:475:SELECTEN.VAL") #! Field("BEND:LTUS:475:BUSY.FLNK",16777215,1,"BEND:LTUS:475:BUSY.FLNK") #! Link("BEND:LTUS:475:BUSY.FLNK","BEND:LTUS:475:SELECT") #! Record("BEND:LTUS:475:SELECT",669,508,0,1,"BEND:LTUS:475:SELECT") #! Record("BEND:LTUS:475:FUNC",940,120,0,0,"BEND:LTUS:475:FUNC") #! Field("BEND:LTUS:475:FUNC.OUT",16777215,0,"BEND:LTUS:475:FUNC.OUT") #! Link("BEND:LTUS:475:FUNC.OUT","BEND:LTUS:475:CTRL.VAL") #! Record("BEND:LTUS:475:ABORT",193,41,0,0,"BEND:LTUS:475:ABORT") #! Record("BEND:LTUS:475:CTRLSTATE",369,34,0,0,"BEND:LTUS:475: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,"BEND:LTUS:475:SELECT is used for Multi-device selection.\nIt is enabled when associated BEND:LTUS:475:CTRL is \"0\" (DONE).\nIt is disabled when associated BEND:LTUS:475: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,"BEND:LTUS:475: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, "BEND:LTUS:475:BCTRL_INIT") { field(DESC, "Process BCTRL on boot") field(PINI, "YES") field(CALC, "A=3?1:0") field(INPA, "BEND:LTUS:475:BCTRL.SEVR") field(OUT, "BEND:LTUS:475: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, "BEND:LTUS:475:BACT") { field(DESC, "Actual B") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "BEND:LTUS:475:BACT") field(INPB, "BEND:LTUS:475:POLYCOEF") field(INPC, "BEND:LTUS:475:POLYCOEF.A") field(INPD, "BEND:LTUS:475:POLYCOEF.B") field(INPE, "BEND:LTUS:475:IACTCALC MS") field(INPF, "BEND:LTUS:475:BDELTAS PP") field(INPG, "100") field(EGU, "kG-m") field(HOPR, "4.5072") field(LOPR, "0.0134") field(HIHI, "4.5072") field(LOLO, "0.0134") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "4.5072") field(LOW, "0.0134") field(FLNK, "BEND:LTUS:475: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, "BEND:LTUS:475:BDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntPhyDeltas") field(EGU, "kG-m") field(HOPR, "1") field(PREC, "7") field(BRSV, "INVALID") field(INPA, "BEND:LTUS:475:BDES") field(INPB, "BEND:LTUS:475:TRIMBTOL") field(INPC, "BEND:LTUS:475:TRIMBTOLR") field(INPD, "BEND:LTUS:475:CHCKBTOL") field(INPE, "BEND:LTUS:475:CHCKBTOLR") field(F, "2.0") field(INPG, "30") field(INPH, "BEND:LTUS:475:BACT.VAL") # # MPS absolute and relative tolerances field(INPP, "BEND:LTUS:475:MPSBTOL") field(INPQ, "BEND:LTUS:475:MPSBTOLR") field(FLNK, "BEND:LTUS:475:BCONLIMITS") info(autosaveFields,"F") } # This record is processed by BDELTAS record(aSub, "BEND:LTUS:475:BCONLIMITS") { field(DESC, "Config B-field Limits") field(INAM, "mgntInit") field(SNAM, "mgntBCONLimits") field(INPA, "BEND:LTUS:475:BDES") field(INPB, "BEND:LTUS:475:BDELTAS.I") field(INPG, "BEND:LTUS:475:DEBUG.RVAL") field(FTA, "DOUBLE") field(FTB, "DOUBLE") field(FTG, "ULONG") field(OUTA, "BEND:LTUS:475:BCON.HIGH") field(OUTB, "BEND:LTUS:475:BCON.LOW") field(OUTC, "BEND:LTUS:475:BCON.HIHI") field(OUTD, "BEND:LTUS:475:BCON.LOLO PP") field(FTVA, "DOUBLE") field(FTVB, "DOUBLE") field(FTVC, "DOUBLE") field(FTVD, "DOUBLE") field(BRSV, "INVALID") field(FLNK, "BEND:LTUS:475:IDELTAS") } # The following PV is processed by :BACT # which is processed by :BACT # record(fanout, "BEND:LTUS:475:BACTFO") { field(DESC, "BACT processing") field(SELM, "All") field(LNK1, "BEND:LTUS:475:BDIFF") field(LNK2, "BEND:LTUS:475:BADIFF") field(LNK3, "BEND:LTUS:475:BRATIO") field(LNK4, "BEND:LTUS:475:MPSLIMITS") field(LNK5, "BEND:LTUS:475:I2BSTATUS") field(LNK6, "BEND:LTUS:475:IACTFO.PROC") } record(calc, "BEND:LTUS:475:BDIFF") { field(DESC, "BDES-BACT") field(CALC, "A-B") field(INPA, "BEND:LTUS:475:BDES") field(INPB, "BEND:LTUS:475:BACT") field(EGU, "kG-m") field(PREC, "7") } record(calc, "BEND:LTUS:475:BADIFF") { field(DESC, "Absolute BDES-BACT") field(INPA, "BEND:LTUS:475:BDIFF") field(EGU, "kG-m") field(PREC, "7") field(CALC, "A<0?ABS(A):A") } record(calc, "BEND:LTUS:475:BRATIO") { field(DESC, "BACT Error") field(CALC, "B?A/B:0") field(INPA, "BEND:LTUS:475:BDIFF") field(INPB, "BEND:LTUS:475:BDES.HOPR") field(EGU, "kG-m") field(PREC, "7") } record(mbbi, "BEND:LTUS:475: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, "BEND:LTUS:475:BACT.J") } # Note: for a string slave set the MONFL # macro to the following: # MONFL=:IMONCALC MS record(sub, "BEND:LTUS:475:BMON") { field(DESC, "Second Transductor") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "BEND:LTUS:475:BMON") field(INPB, "BEND:LTUS:475:POLYCOEF") field(INPC, "BEND:LTUS:475:POLYCOEF.A") field(INPD, "BEND:LTUS:475:POLYCOEF.B") field(INPE, "BEND:LTUS:475:IMONCALC MS") field(INPF, "BEND:LTUS:475:BDELTAS.VAL") field(INPG, "100") field(EGU, "kG-m") field(HOPR, "4.5072") field(LOPR, "0.0134") field(HIHI, "4.5072") field(LOLO, "0.0134") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "4.5072") field(LOW, "0.0134") } # 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=BEND:LTUS:476:BDES CP record(ao, "BEND:LTUS:475:BDES") { field(DESC, "Desired B-Field") field(PINI, "NO") field(DRVH, "4.5072") field(DRVL, "0.0134") field(HOPR, "4.5072") field(LOPR, "0.0134") field(PREC, "7") field(EGU, "kG-m") field(MDEL, "-1") field(OMSL, "closed_loop") field(DOL, "BEND:LTUS:475:IDES2BDES") field(OUT, "BEND:LTUS:475:B2IDES PP") info(autosaveFields,"VAL") } record(sub, "BEND:LTUS:475:B2IDES") { field(DESC, "Convert Desired B-Field to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "BEND:LTUS:475:POLYCOEF") field(INPC, "BEND:LTUS:475:POLYCOEF.A") field(INPD, "BEND:LTUS:475:POLYCOEF.B") field(PREC, "7") field(EGU, "kG-m") field(HOPR, "4.5072") field(LOPR, "0.0134") field(MDEL, "-1") field(INPE, "BEND:LTUS:475:BDES.DRVH") field(INPF, "BEND:LTUS:475:BDES.DRVL") field(BRSV, "INVALID") field(FLNK, "BEND:LTUS:475:IDES") } record(sub, "BEND:LTUS:475:BNOM") { field(DESC, "Nominal Field") field(PINI, "YES") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "BEND:LTUS:475:POLYCOEF") field(INPC, "BEND:LTUS:475:POLYCOEF.A") field(INPD, "BEND:LTUS:475:POLYCOEF.B") field(INPE, "BEND:LTUS:475:BDES.DRVH") field(INPF, "BEND:LTUS:475:BDES.DRVL") field(EGU, "kG-m") field(HOPR, "4.5072") field(LOPR, "0.0134") field(PREC, "7") field(VAL, "0.0") field(FLNK, "BEND:LTUS:475:INOM") } record(sub, "BEND:LTUS:475:BACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "BEND:LTUS:475:BDES.VAL") field(INPB, "BEND:LTUS:475:BDES.DRVH") field(INPC, "BEND:LTUS:475:BDES.DRVL") field(INPD, "BEND:LTUS:475:BDELTAS.I") field(INPE, "BEND:LTUS:475:BDELTAS.J") field(INPG, "BEND:LTUS:475:STATE") field(INPH, "BEND:LTUS:475:HSTA") field(EGU, "kG-m") field(HOPR, "4.5072") field(LOPR, "0.0134") field(PREC, "7") field(BRSV, "INVALID") } record(sub, "BEND:LTUS:475:BMONLIMITS") { field(DESC, "MON Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "BEND:LTUS:475:BDES.VAL") field(INPB, "BEND:LTUS:475:BDES.DRVH") field(INPC, "BEND:LTUS:475:BDES.DRVL") field(INPD, "BEND:LTUS:475:BDELTAS.K") field(INPE, "BEND:LTUS:475:BDELTAS.L") field(INPG, "BEND:LTUS:475:STATE") field(INPH, "BEND:LTUS:475:HSTA") field(EGU, "kG-m") field(HOPR, "4.5072") field(LOPR, "0.0134") field(PREC, "7") field(BRSV, "INVALID") } record(seq, "BEND:LTUS:475:BLIMITS") { field(DESC, "ACT Limits") field(PREC, "7") field(DOL1, "BEND:LTUS:475:BLIMITS") field(LNK1, "BEND:LTUS:475:BACTLIMITS.F PP") field(DOL2, "BEND:LTUS:475:BACTLIMITS.I") field(LNK2, "BEND:LTUS:475:BACT.HIGH") field(DOL3, "BEND:LTUS:475:BACTLIMITS.J") field(LNK3, "BEND:LTUS:475:BACT.LOW") field(DOL4, "BEND:LTUS:475:BACTLIMITS.K") field(LNK4, "BEND:LTUS:475:BACT.HIHI") field(DOL5, "BEND:LTUS:475:BACTLIMITS.L") field(LNK5, "BEND:LTUS:475:BACT.LOLO") field(DOL6, "BEND:LTUS:475:BLIMITS") field(LNK6, "BEND:LTUS:475:BMONLIMITS.F PP") field(DOL7, "BEND:LTUS:475:BMONLIMITS.I") field(LNK7, "BEND:LTUS:475:BMON.HIGH") field(DOL8, "BEND:LTUS:475:BMONLIMITS.J") field(LNK8, "BEND:LTUS:475:BMON.LOW") field(DOL9, "BEND:LTUS:475:BMONLIMITS.K") field(LNK9, "BEND:LTUS:475:BMON.HIHI") field(DOLA, "BEND:LTUS:475:BMONLIMITS.L") field(LNKA, "BEND:LTUS:475:BMON.LOLO") field(FLNK, "BEND:LTUS:475:ILIMITS") field(SCAN, "5 second") } record(ao, "BEND:LTUS:475:BCTRL") { field(DESC, "B-Perturb") field(PREC, "7") field(EGU, "kG-m") field(DRVH, "4.5072") field(DRVL, "0.0134") field(HOPR, "4.5072") field(LOPR, "0.0134") # 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, "BEND:LTUS:475: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, "BEND:LTUS:475:BCTRLGO") { field(DESC, "Update DES and perturb") field(PREC, "7") # Disable BACT limits field(DOL1, "1") field(LNK1, "BEND:LTUS:475:BLIMITS.VAL") # Update BDES with the BCTRL (slider) value field(DOL2, "BEND:LTUS:475:BCTRL.VAL") field(LNK2, "BEND:LTUS:475:BDES PP") field(DOL3, "1") field(LNK3, "BEND:LTUS:475:IDIRECT.PROC PP") field(DOL4, "1") field(LNK4, "BEND:LTUS:475:CHECKSTDZLOST.PROC PP") field(DOL5, "BEND:LTUS:475:BCTRL.VAL") field(LNK5, "BEND:LTUS:475:BCTRLSUB PP") # Re-enable BACT limits field(DOL6, "0") field(LNK6, "BEND:LTUS:475:BLIMITS.VAL") } # Convert B-field to Current and output to ISETPT record(sub, "BEND:LTUS:475:BCTRLSUB") { field(DESC, "Feedback") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "BEND:LTUS:475:POLYCOEF") field(INPC, "BEND:LTUS:475:POLYCOEF.A") field(INPD, "BEND:LTUS:475:POLYCOEF.B") field(INPE, "BEND:LTUS:475:BDES.DRVH") field(INPF, "BEND:LTUS:475:BDES.DRVL") field(PREC, "7") field(EGU, "kG-m") field(HOPR, "4.5072") field(LOPR, "0.0134") field(MDEL, "-1") field(BRSV, "INVALID") field(FLNK, "BEND:LTUS:475:ISETPT") } record(ao, "BEND:LTUS:475:BDESPREVTRIM") { field(DESC, "trim bdes for undo") field(DTYP, "Soft Channel") field(DRVH, "4.5072") field(DRVL, "0.0134") field(EGU, "kG-m") field(HOPR, "4.5072") field(LOPR, "0.0134") field(PREC, "7") field(PINI, "YES") info(autosaveFields,"VAL") } record(stringin, "BEND:LTUS:475:MADNAME") { field(DESC, "MAD deck nomenclature") field(PINI, "YES") field(VAL, "BCX32B1") } record(ai, "BEND:LTUS:475: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, "3353.975579") } record(ao, "BEND:LTUS:475:BMAX") { field(DESC, "Max B-Field") field(DTYP, "Soft Channel") field(DRVH, "4.5072") field(DRVL, "0.0134") field(EGU, "kG-m") field(HOPR, "4.5072") field(LOPR, "0.0134") field(PREC, "7") field(PINI, "YES") field(VAL, "4.5072") field(FLNK, "BEND:LTUS:475:BSTEP") } record(ao, "BEND:LTUS:475:BMIN") { field(DESC, "Min B-Field") field(DTYP, "Soft Channel") field(DRVH, "4.5072") field(DRVL, "0.0134") field(EGU, "kG-m") field(HOPR, "4.5072") field(LOPR, "0.0134") field(PREC, "7") field(PINI, "YES") field(VAL, "0.0134") field(FLNK, "BEND:LTUS:475:BSTEP") } record(ao, "BEND:LTUS:475:BDESSAVE") { field(DESC, "bdes for save/load") field(DTYP, "Soft Channel") field(DRVH, "4.5072") field(DRVL, "0.0134") field(EGU, "kG-m") field(HOPR, "4.5072") field(LOPR, "0.0134") field(PINI, "YES") field(PREC, "7") } # This record is processed by BEND:LTUS:475: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, "BEND:LTUS:475:BCON") { field(DESC, "Config B-Field ") field(DTYP, "Soft Channel") field(PREC, "7") field(EGU, "kG-m") field(HOPR, "4.5072") field(LOPR, "0.0134") field(DRVH, "4.5072") field(DRVL, "0.0134") # 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 , "BEND:LTUS:475:ICON2BCON") field(OMSL, "closed_loop") field(OUT, "BEND:LTUS:475:B2ICON PP") info(autosaveFields,"VAL") } record(sub, "BEND:LTUS:475:B2ICON") { field(DESC, "Convert Desired ICon to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "BEND:LTUS:475:POLYCOEF") field(INPC, "BEND:LTUS:475:POLYCOEF.A") field(INPD, "BEND:LTUS:475:POLYCOEF.B") field(PREC, "7") field(EGU, "kG-m") field(HOPR, "4.5072") field(LOPR, "0.0134") field(MDEL, "-1") field(INPE, "BEND:LTUS:475:BCON.DRVH") field(INPF, "BEND:LTUS:475:BCON.DRVL") field(BRSV, "INVALID") field(FLNK, "BEND:LTUS:475: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, "BEND:LTUS:475:BSTEP") { field(DESC, "B-Field step size") field(CALC, "(C==3)||(D==3)?0:ABS(A-B)*0.005") field(INPA, "BEND:LTUS:475:BMAX") field(INPB, "BEND:LTUS:475:BMIN") field(INPC, "BEND:LTUS:475:BMIN.SEVR") field(INPD, "BEND:LTUS:475:BMAX.SEVR") field(EGU, "kG-m") 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,"BEND:LTUS:475:BCTRLDISABLECALC") { field(DESC, "Calc for disabling BCTRL") field(ASG, "Internal") field(CALC, "A?2:1") field(INPA, "BEND:LTUS:475:ONLINE CP") field(OUT, "BEND:LTUS:475:BCTRLDISABLEFOUT PP") } record(fanout, "BEND:LTUS:475:BCTRLDISABLEFOUT") { field(DESC, "Disable BCTRL fanout") field(SELM, "Specified") field(SELL, "BEND:LTUS:475:BCTRLDISABLECALC") field(LNK1, "BEND:LTUS:475:BCTRLDISABLE") field(LNK2, "BEND:LTUS:475:BCTRLENABLE") } record(stringout, "BEND:LTUS:475:BCTRLDISABLE") { field(DESC, "Disable BCTRL") field(DTYP, "Soft Channel") field(OUT, "BEND:LTUS:475:BCTRL.ASG") field(VAL, "NOWRITE") field(FLNK, "BEND:LTUS:475:BCTRLDISV_UPDATE") } record(stringout, "BEND:LTUS:475:BCTRLENABLE") { field(DESC, "Enable BCTRL") field(DTYP, "Soft Channel") field(OUT, "BEND:LTUS:475:BCTRL.ASG") field(VAL, "") field(FLNK, "BEND:LTUS:475:BCTRLDISV_UPDATE") } record(calcout, "BEND:LTUS:475:BCTRLDISV_UPDATE") { field(DESC, "Calc for updating BCTRL.DISV") field(ASG, "Internal") field(CALC, "A") field(INPA, "BEND:LTUS:475:ONLINE") field(OUT, "BEND:LTUS:475: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,"BEND:LTUS:475:BACT and MON\n are processed via links from \n BEND:LTUS:475:IACT (device raw value readback 1)\n and\n BEND:LTUS:475: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 BEND:LTUS:475:POLYCOEF\nC = First polynomial coefficient (offset if linear)\nD = Second polynomial coefficient (slope if linear)\nE = BEND:LTUS:475: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,"BEND:LTUS:475:BDES\n is processed when set by CA users or \n BEND:LTUS:475: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,"BEND:LTUS:475: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 BEND:LTUS:475: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 (BEND:LTUS:475: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,"BEND:LTUS:475:B*LIMITS and BEND:LTUS:475:BLIMITS:\n Calculate alarm and warning limits based on \n deltas from BEND:LTUS:475: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,"BEND:LTUS:475: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,"BEND:LTUS:475: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, "BEND:LTUS:475: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, "BEND:LTUS:475:MPSBTOL") { field(DESC, "Absolute mps tol") field(EGU, "kG-m") field(PREC, "2") field(CALC, "ABS(A)*0.02") field(INPA, "BEND:LTUS:475:BMAX") field(PINI, "YES") } # # 21-Aug-2013: K. Luchini # Set channel access security so that users # cannot easily change values. record(ao, "BEND:LTUS:475:MPSBMAX") { field(DESC, "MPS Max B-field") field(EGU, "kG-m") field(PREC, "7") field(DRVH, "4.5072") field(DRVL, "0.0134") field(PINI, "YES") field(VAL, "4.5072") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:475:MPSBMIN") { field(DESC, "MPS Min B-field") field(EGU, "kG-m") field(PREC, "7") field(DRVH, "4.5072") field(DRVL, "0.0134") field(PINI, "YES") field(VAL, "0.0134") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:475:MPSBLLIM") { field(DESC, "MPS Low Limit B-field") field(EGU, "kG-m") field(PREC, "7") field(DRVH, "4.5072") field(DRVL, "0.0134") field(PINI, "YES") field(VAL, "0.0134") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:475:MPSBLLIM2") { field(DESC, "MPS Low Limit #2 B-field") field(EGU, "kG-m") field(PREC, "7") field(DRVH, "4.5072") field(DRVL, "0.0134") field(PINI, "YES") field(VAL, "0.0134") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } # Set the default to Std record(mbbo, "BEND:LTUS:475: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, "BEND:LTUS:475:MPSLIMITS.E PP") } record(aSub, "BEND:LTUS:475: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, "BEND:LTUS:475:MPS.RVAL") field(INPB, "BEND:LTUS:475:BADIFF") field(INPC, "BEND:LTUS:475:BDELTAS.N") field(INPD, "BEND:LTUS:475:BACT") field(INPE, "BEND:LTUS:475:MPSBITMASK.RVAL") field(INPF, "BEND:LTUS:475:MPSBLLIM") field(INPG, "BEND:LTUS:475:MPSBMIN") field(INPH, "BEND:LTUS:475:MPSBMAX") field(INPI, "BEND:LTUS:475: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, "BEND:LTUS:475:INTOL.RVAL PP") field(OUTB, "BEND:LTUS:475:INTOL_BMIN.RVAL PP") field(OUTC, "BEND:LTUS:475:INTOL_BRANGE.RVAL PP") field(OUTD, "BEND:LTUS:475: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, "BEND:LTUS:475:INTOL") { field(DESC, "BACT within MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "BEND:LTUS:475:MPSLIMITS.VALA") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "BEND:LTUS:475:INTOL_BMIN") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "BEND:LTUS:475:MPSLIMITS.VALB") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "BEND:LTUS:475:INTOL_BMIN2") { field(DESC, "MPS tol #2") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "BEND:LTUS:475:MPSLIMITS.VALD") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "BEND:LTUS:475:INTOL_BRANGE") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "BEND:LTUS:475: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, "BEND:LTUS:475:CHCKITOL") { field(DESC, "Absolute Check I Tolerance") field(EGU, "A") field(FLNK, "BEND:LTUS:475:TRIMITOL") field(CALC, "ABS(A*B)") field(INPA, "BEND:LTUS:475:CHCKBTOL") field(INPB, "BEND:LTUS:475:POLYCOEF.B") field(PREC, "9") } record(calc, "BEND:LTUS:475:TRIMBTOL") { field(EGU, "kG-m") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(DESC, "Absolute Trim Tolerance") field(CALC, "ABS(A)/2") field(INPA, "BEND:LTUS:475:CHCKBTOL") field(FLNK, "BEND:LTUS:475:CHCKITOL") } record(calc, "BEND:LTUS:475:CHCKBTOL") { field(DESC, "Check absolute tolerance") field(EGU, "A") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(FLNK, "BEND:LTUS:475:TRIMBTOL") field(CALC, "MAX(ABS(A),ABS(C))*(B/1000000)") field(INPA, "BEND:LTUS:475:BDES.HOPR") field(INPB, "BEND:LTUS:475:STABILITY") field(INPC, "BEND:LTUS:475:BDES.LOPR") } record(longout, "BEND:LTUS:475: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, "BEND:LTUS:475:CHCKBTOL") } record(calc, "BEND:LTUS:475:TRIMITOL") { field(DESC, "Absolute Trim I Tolerance") field(EGU, "kG-m") field(CALC, "ABS(A*B)") field(INPA, "BEND:LTUS:475:POLYCOEF.B") field(INPB, "BEND:LTUS:475:TRIMBTOL") field(PREC, "9") } record(ai, "BEND:LTUS:475:TRIMBTOLR") { field(DESC, "Relative trim tol") field(PREC, "4") field(EGU, "%") field(HOPR, "1.0") field(LOPR, "0.0") field(PINI, "YES") } record(ai, "BEND:LTUS:475: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, "BEND:LTUS:475:FBCKFCOM") { field(ZNAM, "CA") field(ONAM, "FCOM") field(DESC, "CA Mode") field(PINI, "YES") field(SDIS, "0") } record(bo, "BEND:LTUS:475:PAU") { field(ZNAM, "NotConfigured") field(ONAM, "Configured") field(DESC, "PAU Present") field(PINI, "YES") field(SDIS, "0") field(FLNK, "BEND:LTUS:475:PAUGO") } record(fanout, "BEND:LTUS:475:PAUGO") { field(DESC, "PAU control") field(LNK1, "BEND:LTUS:475:PAUSTOP") field(LNK2, "BEND:LTUS:475: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, "BEND:LTUS:475:PAUSTART") { field(DESC, "Setup for PAU On") field(SDIS, "BEND:LTUS:475: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, "BEND:LTUS:475:PAUSTOP") { field(DESC, "Setup for PAU Off") field(SDIS, "BEND:LTUS:475: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, "BEND:LTUS:475:MCORDEVNAME") { field(DESC, "PS device name") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, "BEND:LTUS:476:") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "BEND:LTUS:475: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, "BEND:LTUS:475:PSTYPE.RVAL") field(INPC, "BEND:LTUS:475:TURNEDOFF.RVAL") field(INPD, "BEND:LTUS:475:CONFIG.RVAL") field(INPE, "BEND:LTUS:475:PSCATEGORY.RVAL") field(INPF, "BEND:LTUS:475:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "BEND:LTUS:475:AUTOCTRL.RVAL") field(INPJ, "BEND:LTUS:475:OUTOFSERVICE.RVAL") field(INPL, "BEND:LTUS:475:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "BEND:LTUS:475:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "BEND:LTUS:475:PAU") field(INPP, "BEND:LTUS:475:CALBDISABLE.RVAL") field(INPQ, "BEND:LTUS:475:PTRBDISABLE.RVAL") field(INPR, "BEND:LTUS:475:TRIMDISABLE.RVAL") field(INPS, "BEND:LTUS:475:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "BEND:LTUS:475:FBCK") field(INPU, "BEND:LTUS:475:TRIMTYPE.RVAL") field(INPV, "BEND:LTUS:475:STDZDIRECT.RVAL") field(INPW, "BEND:LTUS:475:DEGAUSENABLE.RVAL") field(FLNK, "BEND:LTUS:475:HSTA") } record(longin, "BEND:LTUS:475:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "BEND:LTUS:475:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "BEND:LTUS:475: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, "BEND:LTUS:475: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, "BEND:LTUS:475: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, "BEND:LTUS:475: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, "BEND:LTUS:475: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, "BEND:LTUS:475: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 BEND:LTUS:475:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses BEND:LTUS:475:FBCK. # This PV should be replaced by BEND:LTUS:475: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, "BEND:LTUS:475: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, "BEND:LTUS:475: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, "BEND:LTUS:475: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, "BEND:LTUS:476:OUTOFSERVICE CPP NMS") field(OMSL, "closed_loop") field(FLNK, "BEND:LTUS:475:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"BEND:LTUS:475:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "BEND:LTUS:475:OUTOFSERVICE NPP NMS") field(OUT, "BEND:LTUS:475:ONLINE PP") } record(bo, "BEND:LTUS:475:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "BEND:LTUS:475: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, "BEND:LTUS:475: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, "BEND:LTUS:475: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, "BEND:LTUS:475: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, "BEND:LTUS:475: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, "BEND:LTUS:475: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, "BEND:LTUS:475: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, "BEND:LTUS:475: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, "BEND:LTUS:475: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, "BEND:LTUS:475: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, "BEND:LTUS:475: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, "BEND:LTUS:475:TRIMTYPE") } record(stringout, "BEND:LTUS:475:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "BEND:LTUS:476:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "BEND:LTUS:475:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "BEND:LTUS:475:STATE.RVAL") field(INPB, "BEND:LTUS:475:INTLKSUMY.RVAL") field(OUT, "BEND:LTUS:475:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "BEND:LTUS:475: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, "BEND:LTUS:475:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "BEND:LTUS:475:STATE.RVAL") field(INPB, "BEND:LTUS:475:INTLKSUMY.RVAL") field(OUT, "BEND:LTUS:475:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "BEND:LTUS:475:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "BEND:LTUS:475:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "BEND:LTUS:475: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, "BEND:LTUS:475: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, "BEND:LTUS:475: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, "BEND:LTUS:475: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,"BEND:LTUS:475: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("BEND:LTUS:475:TURNEDOFF",3140,1907,0,1,"BEND:LTUS:475:TURNEDOFF") #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "BEND:LTUS:475:STATSUB") { field(DESC, "Build STATus ") field(INAM, "mgntInit") field(SNAM, "mgntSlcStat") field(INPA, "BEND:LTUS:475:BACT.STAT") field(INPB, "BEND:LTUS:475:BDES.STAT") field(INPC, "BEND:LTUS:475: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, "BEND:LTUS:475:BACT.SEVR") field(INPH, "BEND:LTUS:475:BDES.SEVR") field(INPI, "BEND:LTUS:475: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, "BEND:LTUS:475:STATE.RVAL") field(INPN, "BEND:LTUS:475:STDZOK") field(INPO, "BEND:LTUS:475:CALBOK") field(INPP, "BEND:LTUS:475:OUTOFSERVICE.RVAL") field(INPQ, "BEND:LTUS:475:CONFIG.RVAL") field(INPR, "BEND:LTUS:475:HSTA") field(INPS, "BEND:LTUS:475:CTRL.RVAL") field(INPT, "BEND:LTUS:475:DEGAUSOK") field(INPV, "BEND:LTUS:475: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, "BEND:LTUS:475:STAT") } record(longout, "BEND:LTUS:475:STAT") { field(DESC, "STAT sent to SLC") field(SCAN, "Passive") field(FLNK, "BEND:LTUS:475:STATCTRLSUB") field(DOL, "BEND:LTUS:475:STATSUB.VAL") field(OMSL, "closed_loop") } record(sSub, "BEND:LTUS:475:STATCTRLSUB") { field(DESC, "Decode SLC STAT into mbbo") field(INAM, "mgntInit") field(SNAM, "mgntStatDecode") field(INPA, "BEND:LTUS:475:STAT") field(INPB, "BEND:LTUS:475:HSTA") field(INPD, "BEND:LTUS:475:ONOFFCTRL.RVAL") field(FLNK, "BEND:LTUS:475:STATMSG") } record(mbbo, "BEND:LTUS:475: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, "BEND:LTUS:475:UNAVAILGO") field(DOL, "BEND:LTUS:475:STATCTRLSUB.W") } record(seq, "BEND:LTUS:475:UNAVAILGO") { field(DESC, "Process UNAVAIL") field(DOL1, "BEND:LTUS:475:STATSUB.U") field(LNK1, "BEND:LTUS:475:UNAVAIL PP") } record(stringout, "BEND:LTUS:475:SNLSTATMSG") { field(DTYP, "Soft Channel") } #! TextBox(TB0,820,1000,1200,1220,0,"Dialog",12,1,16777215,"BEND:LTUS:475:STATUSSUB - future\nOverall device status - takes input from action snls, record sevrs, master snl(s) and outputs final status\n\nInputs:\nA - BEND:LTUS:475:CTRLSTATUS - snl status\nB - MGNT:CTRLSTATUS - master list status\nC\nD - BEND:LTUS:475: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,"BEND:LTUS:475STATSUB\nformat control bo's into slc STAT\n\nInputs:\nA - BEND:LTUS:475:STATUS\nC - BEND:LTUS:475:ON\nD - BEND:LTUS:475:STDZOK\nE - BEND:LTUS:475:CALBOK\nF - BEND:LTUS:475:BACTDRIFT (future)\nG -\nH- BEND:LTUS:475:DACSTATUS\nI -BEND:LTUS:475:ADCSTATUS\nJ - BEND:LTUS:475:BACTSTATUS\nK - BEND:LTUS:475:BDESSTATUS\nL - BEND:LTUS:475:RIPLSTATUS\n\nOutput:\nP - BEND:LTUS:475: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, "BEND:LTUS:475: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, "BEND:LTUS:475: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, "BEND:LTUS:475: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, "BEND:LTUS:475: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, "BEND:LTUS:475:IDESTOTAL"){ field(DESC, "Calc total current") field(CALC, "A+B") field(EGU, "kG-m") field(PREC, "7") field(INPA, "BEND:LTUS:476:IDES CP NMS") field(INPB, "BTRM:LTUS:475:BDES CP NMS") field(OUT, "BEND:LTUS:475:IDES2BDES.E PP") } record(sub, "BEND:LTUS:475:IDES2BDES") { field(DESC, "Cal BDES") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "BEND:LTUS:475:IDES2BDES") field(INPB, "BEND:LTUS:475:POLYCOEF") field(INPC, "BEND:LTUS:475:POLYCOEF.A") field(INPD, "BEND:LTUS:475:POLYCOEF.B") field(INPE, "BEND:LTUS:475:IDESTOTAL MS") field(INPF, "BEND:LTUS:476:BDELTAS PP") field(INPG, "100") field(EGU, "kG-m") field(HOPR, "4.5072") field(LOPR, "0.0134") field(HIHI, "4.5072") field(LOLO, "0.0134") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "4.5072") field(LOW, "0.0134") field(FLNK, "BEND:LTUS:475: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, "BEND:LTUS:475:IACTCALC"){ field(DESC, "Calc total act current") field(CALC, "A+B") field(EGU, "kG-m") field(PREC, "7") field(INPA, "BEND:LTUS:475:IACT CP NMS") field(INPB, "BTRM:LTUS:475:BACT") field(OUT, "BEND:LTUS:475: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, "BEND:LTUS:475:IMONCALC"){ field(DESC, "Calc total mon current") field(CALC, "A+B") field(EGU, "kG-m") field(PREC, "7") field(INPA, "BEND:LTUS:475:IMON CP NMS") field(INPB, "BTRM:LTUS:475:BMON") field(OUT, "BEND:LTUS:475: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, "BEND:LTUS:475:ICONTOTAL"){ field(DESC, "Calc total current") field(CALC, "A+B") field(EGU, "kG-m") field(PREC, "7") field(INPA, "BEND:LTUS:476:ICON CP NMS") field(INPB, "BTRM:LTUS:475:BCON CP NMS") field(OUT, "BEND:LTUS:475:ICON2BCON.E PP") } record(sub, "BEND:LTUS:475:ICON2BCON") { field(DESC, "Cal BCON") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "BEND:LTUS:475:ICON2BCON") field(INPB, "BEND:LTUS:475:POLYCOEF") field(INPC, "BEND:LTUS:475:POLYCOEF.A") field(INPD, "BEND:LTUS:475:POLYCOEF.B") field(INPE, "BEND:LTUS:475:ICONTOTAL MS") field(INPF, "BEND:LTUS:476:BDELTAS PP") field(INPG, "100") field(EGU, "kG-m") field(HOPR, "4.5072") field(LOPR, "0.0134") field(HIHI, "4.5072") field(LOLO, "0.0134") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "4.5072") field(LOW, "0.0134") field(FLNK, "BEND:LTUS:475:BCON") } #! 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, "BEND:LTUS:477:IACT") { field(DESC, "Current") field(INP, "BEND:LTUS:476:IACT CP NMS") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "BEND:LTUS:477:IACTCALC") info(autosaveFields,"HYST") } record(bi, "BEND:LTUS:477:STATE") { field(DESC, "PS On/Off Status") field(DTYP, "Raw Soft Channel") field(INP, "BEND:LTUS:476:STATE CP MS") field(ZSV, "MAJOR") field(ZNAM, "OFF") field(ONAM, "ON") } record(ao, "BEND:LTUS:477:IDES") { field(DESC, "Desired Current") field(PREC, "3") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(MDEL, "-1") field(HIHI, "250.0") field(LOLO, "0.0") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "BEND:LTUS:477:BDELTAS") field(DRVH, "250.0") field(DRVL, "0.0") field(DOL, "BEND:LTUS:477: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, "BEND:LTUS:477:ICTRL PP") } # This record is processed by BEND:LTUS:477:ICON") # Note: we are not setting alarms here. record(ao, "BEND:LTUS:477:ICON") { field(DESC, "Config I") field(DTYP, "Soft Channel") field(PREC, "3") field(HOPR, "250.0") field(LOPR, "0.0") field(DRVH, "250.0") field(DRVL, "0.0") field(DOL, "BEND:LTUS:477:B2ICON.K") field(OMSL, "closed_loop") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:477:INOM") { field(DESC, "Nominal Current") field(DOL, "BEND:LTUS:477:BNOM.K") field(OMSL, "closed_loop") field(PREC, "3") field(EGU, "A") field(DRVH, "250.0") field(DRVL, "0.0") field(HOPR, "250.0") field(LOPR, "0.0") } record(ao, "BEND:LTUS:477:ICTRL") { field(DESC, "Set Current") field(PREC, "3") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(DRVH, "250.0") field(DRVL, "0.0") field(MDEL, "-1") field(FLNK, "BEND:LTUS:477:ICTRLGO") field(OMSL, "supervisory") info(autosavefields,"VAL") } record(seq, "BEND:LTUS:477:ICTRLGO") { field(DESC, "Process Current Setpoint") field(PREC, "3") # Set ISETPT to supervisory field(DOL1, "0") field(LNK1, "BEND:LTUS:477:ISETPT.OMSL") field(DOL2, "BEND:LTUS:477:ICTRL") field(LNK2, "BEND:LTUS:477:ISETPT PP") # Set ISETPT to closed loop - get data from BCTRLSUB.K field(DOL3, "1") field(LNK3, "BEND:LTUS:477:ISETPT.OMSL") } record(ao, "BEND:LTUS:477:IMAX") { field(DESC, "Max I") field(DTYP, "Soft Channel") field(DRVH, "250.0") field(DRVL, "0.0") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(PREC, "3") field(PINI, "YES") field(VAL, "250.0") field(FLNK, "BEND:LTUS:477:IMIN") } record(ao, "BEND:LTUS:477:IMIN") { field(DESC, "Min I") field(DTYP, "Soft Channel") field(DRVH, "250.0") field(DRVL, "0.0") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(PREC, "3") field(VAL, "0.0") field(FLNK, "BEND:LTUS:477:IRANGE") } record(sel, "BEND:LTUS:477:IACTPREVOK") { field(DESC, "Last Good Current") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(PREC, "3") field(NVL, "BEND:LTUS:477:BACT.SEVR") field(INPA, "BEND:LTUS:477:IACT NPP MS") field(INPB, "BEND:LTUS:477:IACTPREVOK NPP MS") field(INPC, "BEND:LTUS:477:IACTPREVOK NPP MS") field(INPD, "BEND:LTUS:477:IACTPREVOK NPP MS") } record(sub, "BEND:LTUS:477:IACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "BEND:LTUS:477:IDES") field(INPB, "BEND:LTUS:477:ISETPT.DRVH") field(INPC, "BEND:LTUS:477:ISETPT.DRVL") field(INPD, "BEND:LTUS:477:IDELTAS.I") field(INPE, "BEND:LTUS:477:IDELTAS.J") field(INPG, "BEND:LTUS:477:STATE") field(INPH, "BEND:LTUS:477:HSTA") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(sub, "BEND:LTUS:477:IMONLIMITS") { field(DESC, "Aux Current Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "BEND:LTUS:477:IDES") field(INPB, "BEND:LTUS:477:ISETPT.DRVH") field(INPC, "BEND:LTUS:477:ISETPT.DRVL") field(INPD, "BEND:LTUS:477:IDELTAS.K") field(INPE, "BEND:LTUS:477:IDELTAS.L") field(INPG, "BEND:LTUS:477:STATE") field(INPH, "BEND:LTUS:477:HSTA") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(seq, "BEND:LTUS:477:ILIMITS") { field(DESC, "Set ACT and MON Limits") field(PREC, "3") field(DOL1, "BEND:LTUS:477:BLIMITS") field(LNK1, "BEND:LTUS:477:IACTLIMITS.F PP") field(DOL2, "BEND:LTUS:477:IACTLIMITS.I") field(LNK2, "BEND:LTUS:477:IACT.HIGH") field(DOL3, "BEND:LTUS:477:IACTLIMITS.J") field(LNK3, "BEND:LTUS:477:IACT.LOW") field(DOL4, "BEND:LTUS:477:IACTLIMITS.K") field(LNK4, "BEND:LTUS:477:IACT.HIHI") field(DOL5, "BEND:LTUS:477:IACTLIMITS.L") field(LNK5, "BEND:LTUS:477:IACT.LOLO") field(DOL6, "BEND:LTUS:477:BLIMITS") field(LNK6, "BEND:LTUS:477:IMONLIMITS.F PP") field(DOL7, "BEND:LTUS:477:IMONLIMITS.I") field(LNK7, "BEND:LTUS:477:IMON.HIGH") field(DOL8, "BEND:LTUS:477:IMONLIMITS.J") field(LNK8, "BEND:LTUS:477:IMON.LOW") field(DOL9, "BEND:LTUS:477:IMONLIMITS.K") field(LNK9, "BEND:LTUS:477:IMON.HIHI") field(DOLA, "BEND:LTUS:477:IMONLIMITS.L") field(LNKA, "BEND:LTUS:477: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, "BEND:LTUS:477:IDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntRawDeltas") field(INPD, "BEND:LTUS:477:TRIMBTOL") field(INPE, "BEND:LTUS:477:CHCKBTOL") field(INPF, "BEND:LTUS:477:BDELTAS.K") field(INPG, "BEND:LTUS:477:BDELTAS.L") field(INPH, "BEND:LTUS:477: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, "BEND:LTUS:477:STDZITOLR") field(INPC, "BEND:LTUS:477:STDZITOL") field(FLNK, "") } # All ps controllers with on/off control will set the macro ONOF # as follows: # # ONOF = BEND:LTUS:476: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, "BEND:LTUS:477: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 = BEND:LTUS:476:RESET PP # record(bo, "BEND:LTUS:477: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, "BEND:LTUS:477:RAMPSTATE") { field(DESC, "PS Ramp Status") field(DTYP, "Soft Channel") field(DOL, "BEND:LTUS:476: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, "BEND:LTUS:477: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, "BEND:LTUS:477:TRIMRAMPRATE") field(OUT, "") field(FLNK, "BEND:LTUS:477:STDZDLY") } record(ao, "BEND:LTUS:477:ISETPT") { field(DESC, "Current Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(DRVH, "250.0") field(DRVL, "0.0") field(MDEL, "-1") field(OUT, "") field(DOL, "BEND:LTUS:477: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, "BEND:LTUS:477:IMON") { field(DESC, "Aux Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(INP, "BEND:LTUS:476:IMON CP NMS") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "BEND:LTUS:477:IMONCALC") } record(ao, "BEND:LTUS:477:IRIPL") { field(DESC, "Ripple Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(DOL, "BEND:LTUS:476:IRIPL CP NMS") field(OMSL, "closed_loop") field(EGU, "A") field(DRVH, "1.0") field(HOPR, "1.0") field(PREC, "3") field(FLNK, "BEND:LTUS:477:IRIPLOK") } record(sub, "BEND:LTUS:477:IRIPLOK") { field(DESC, "Ripple Current Status") field(INAM, "mgntInit") field(SNAM, "mgntRiplOK") field(INPA, "BEND:LTUS:477:IRIPL.VAL") field(INPB, "BEND:LTUS:477: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, "BEND:LTUS:477:R") { field(DESC, "Resistance") field(EGU, "Ohms") field(PREC, "4") field(PINI, "YES") field(DOL, "BEND:LTUS:476: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, "BEND:LTUS:477:IGND") { field(DESC, "Ground Current") field(EGU, "A") field(PREC, "6") field(PINI, "YES") field(DOL, "BEND:LTUS:476:IGND CP MS") field(OMSL, "closed_loop") } record(bi, "BEND:LTUS:477:INTLKSUMY") { field(DESC, "Interlock Summary") field(INP, "BEND:LTUS:476:INTLKSUMY CP MS") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(ZNAM, "OK") field(ONAM, "FAULT") field(PINI, "NO") } record(mbbo, "BEND:LTUS:477: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, "BEND:LTUS:476:COOLING CP NMS") field(OMSL, "closed_loop") } # The following PV is processed by :BACTFO # which is processed by :BACT record(fanout, "BEND:LTUS:477:IACTFO") { field(DESC, "IACT processing") field(SELM, "All") field(LNK1, "BEND:LTUS:477:IACTPREVOK") field(LNK2, "BEND:LTUS:477:IDIFF") field(LNK3, "BEND:LTUS:477:IADIFF") field(LNK4, "BEND:LTUS:477:IRATIO") field(LNK5, "BEND:LTUS:477:IDIRECT") field(LNK6, "BEND:LTUS:477:IACTPOL_CHECK") } record(calc, "BEND:LTUS:477:IDIFF") { field(DESC, "IDES-IACT") field(CALC, "A-B") field(INPA, "BEND:LTUS:477:IDES") field(INPB, "BEND:LTUS:477:IACT") field(EGU, "A") field(PREC, "9") field(HOPR, "250.0") field(LOPR, "0.0") } record(calc, "BEND:LTUS:477:IADIFF") { field(DESC, "Absolute IDES-IACT") field(CALC, "A<0?ABS(A):A") field(INPA, "BEND:LTUS:477:IDIFF") field(PREC, "9") } record(calc, "BEND:LTUS:477:IRATIO") { field(DESC, "IDES-IACT/IMAX") field(CALC, "B?A/B:0") field(INPA, "BEND:LTUS:477:IDIFF") field(INPB, "BEND:LTUS:477:IDES.DRVH") field(PREC, "9") } record(calcout, "BEND:LTUS:477:IRANGE") { field(DESC, "Current Range") field(PINI, "YES") field(CALC, "ABS(A-B)") field(INPA, "BEND:LTUS:477:IMIN") field(INPB, "BEND:LTUS:477: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, "BEND:LTUS:477: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, "BEND:LTUS:477:IACT") field(FLNK, "BEND:LTUS:477:IACTPOL") } record(bo, "BEND:LTUS:477:IACTPOL") { field(DESC, "Actual I Polarity") field(DTYP, "Raw Soft Channel") field(DOL, "BEND:LTUS:477: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,"BEND:LTUS:477:I*LIMITS:\n Calculate alarm and warning limits based on \n deltas from BEND:LTUS:477:IDELTAS and the\n BEND:LTUS:477: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,"BEND:LTUS:477:IACT: \n Get copy of BEND:LTUS:477:I. \n",null) #! TextBox(TB12,1280,3100,1760,3200,0,"Dialog",12,1,16777215,"BEND:LTUS:477: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,"BEND:LTUS:477:IDES:\n Contains raw value calculated by \nBEND:LTUS:477: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 \nBEND:LTUS:477:BDELTAS.\n",null) #! TextBox(TB10,56,1940,316,2340,0,"Dialog",12,1,16777215,"BEND:LTUS:477: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 BEND:LTUS:477: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 BEND:LTUS:477: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,"BEND:LTUS:477:ISETPT:\n Sets the hardware. When fast feedback is set on, this record is\n set to closed loop mode by BEND:LTUS:477:FBCKSTART sequence. When \n the loop is closed, this record takes input calculated by \n BFBCK only. When fast feedback is set off, BEND:LTUS:477:FBCKSTOP \n will set it back to supervisory so that the value can be set by \n BEND:LTUS:477: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, "BEND:LTUS:477:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:477:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "BEND:LTUS:477:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "BEND:LTUS:477:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "BEND:LTUS:477:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "BEND:LTUS:477:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "1") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "BEND:LTUS:477: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, "BEND:LTUS:477:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "BEND:LTUS:477:TRIMTYPE.RVAL") field(INPB, "BEND:LTUS:477:CONFIG.RVAL") field(OUT, "BEND:LTUS:477:TRIMMAXNUM PP") } record(longout, "BEND:LTUS:477: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, "BEND:LTUS:477: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, "BEND:LTUS:476:TRIMRAMPRATE CP NMS") field(OMSL, "closed_loop") field(VAL, "") field(OUT, "BEND:LTUS:477:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "BEND:LTUS:477: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, "BEND:LTUS:476:TRIMSETL CP NMS") field(OMSL, "closed_loop") field(VAL, "") } record(bo, "BEND:LTUS:477: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, "BEND:LTUS:477: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, "BEND:LTUS:477: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, "BEND:LTUS:477:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "0") } record(ao, "BEND:LTUS:477: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, "BEND:LTUS:477:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "BEND:LTUS:477: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, "BEND:LTUS:477: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, "BEND:LTUS:477:IMOVE") field(INPB, "BEND:LTUS:477:IACT") field(INPC, "BEND:LTUS:477:IRAMPRATE") field(INPD, "1.577") field(INPE, "BEND:LTUS:477:TRIMDLYPCT") field(INPF, "BEND:LTUS:477:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "BEND:LTUS:477:RAMPTIME_LEFT PP") } record(longout, "BEND:LTUS:477:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "BEND:LTUS:477:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "BEND:LTUS:477:RAMPDONE_CALC") } record(calc, "BEND:LTUS:477:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "BEND:LTUS:477:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "BEND:LTUS:477:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "BEND:LTUS:477: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, "BEND:LTUS:477:RAMPTIME_LEFT") field(OUT, "BEND:LTUS:477:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "BEND:LTUS:477:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "BEND:LTUS:477:RAMPTIME_LEFT NMS") field(OUT, "BEND:LTUS:477:RAMPDONE PP") } record(bo, "BEND:LTUS:477:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "BEND:LTUS:477:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "BEND:LTUS:477: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, "BEND:LTUS:477: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, "BEND:LTUS:477:STDZINIT") { field(DESC, "Proc. Stdz PVs on boot") field(PINI, "YES") field(DOL1, "1") field(DOL2, "1") field(DOL3, "1") field(LNK1, "BEND:LTUS:477:DEBUG.PROC PP") field(LNK2, "BEND:LTUS:477:STDZCYCLENUM.PROC PP") field(LNK3, "BEND:LTUS:477:STDZDISABLE.PROC PP") field(LNK4, "BEND:LTUS:477: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, "BEND:LTUS:477:STDZSUB") { field(DESC, "Stdz subroutine") field(INAM, "mgntStdzInit") field(SNAM, "mgntStdz") field(BRSV, "INVALID") field(INPA, "BEND:LTUS:477:STDZIMIN NPP NMS") field(INPB, "BEND:LTUS:477:STDZIMAX NPP NMS") field(INPC, "BEND:LTUS:477:STDZIFINAL NPP NMS") field(INPD, "BEND:LTUS:477:STDZCYCLENUM NPP NMS") field(INPE, "BEND:LTUS:477:STDZDIRECT.RVAL NPP NMS") field(INPF, "BEND:LTUS:477:STDZDISABLE.RVAL CPP NMS") field(INPG, "BEND:LTUS:477: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, "BEND:LTUS:477:STDZWF PP") field(OUTB, "BEND:LTUS:477: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, "BEND:LTUS:477:STDZWF") } record(mbbo, "BEND:LTUS:477: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, "BEND:LTUS:477: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, "BEND:LTUS:477:STDZMAINPS") { field(DESC, "Stdz by main or self") field(PINI, "YES") field(DTYP, "Soft Channel") field(ZNAM, "SELF") field(ONAM, "MAIN") } record(bo, "BEND:LTUS:477: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, "BEND:LTUS:477: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, "BEND:LTUS:477: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, "BEND:LTUS:477:STDZTOD") { field(DESC, "Successful Standardize Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "BEND:LTUS:477:STDZLOSTTOD") { field(DESC, "Standardize Lost Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(longout, "BEND:LTUS:477:STDZCYCLECNT") { field(DESC, "Cycle Count") field(PINI, "YES") } record(longout, "BEND:LTUS:477: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, "BEND:LTUS:477:STDZDIRECT") } # The default standardize direction is "UP" for # all LCLS Magnets.. record(bo, "BEND:LTUS:477:STDZDIRECT") { field(DESC, "Standardize Direction ") field(ZNAM, "UP") field(ONAM, "DOWN") field(VAL, "0") field(FLNK, "BEND:LTUS:477:STDZIMIN") } record(ao, "BEND:LTUS:477:STDZIMIN") { field(DESC, "Min-STDZ Current") field(PREC, "1") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(VAL, "0.0") field(FLNK, "BEND:LTUS:477:STDZIMAX") } record(ao, "BEND:LTUS:477:STDZIMAX") { field(DESC, "Max. Standarize Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(VAL, "250.0") field(FLNK, "BEND:LTUS:477:STDZIFINAL") } record(ao, "BEND:LTUS:477:STDZIFINAL") { field(DESC, "Final SDTZ Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(VAL, "0.0") field(FLNK, "BEND:LTUS:477: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, "BEND:LTUS:477: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, "BEND:LTUS:477:STDZITOL") { field(DESC, "Stdz min tolerance") field(PREC, "5") field(CALC, "MAX(ABS(A),ABS(B))*C") field(INPA, "BEND:LTUS:477:STDZIMIN CP NMS") field(INPB, "BEND:LTUS:477:STDZIMAX CP MMS") field(INPC, "0.05") field(INPD, "BEND:LTUS:477:STDZITOLR CP MMS") field(EGU, "A") field(FLNK, "BEND:LTUS:477:IDELTAS") field(PINI, "YES") } # D - factor (3.154/2 = 1.577) for EPSC, otherwise, set to 1.0 record(calc, "BEND:LTUS:477:STDZDLY") { field(DESC, "Ramp time for stdz cycle") field(CALC, "C>0?MAX(1,ABS((A-B)/C)*D):0") field(INPA, "BEND:LTUS:477:STDZIMIN CP NMS") field(INPB, "BEND:LTUS:477:STDZIMAX CP NMS") field(INPC, "BEND:LTUS:477:TRIMRAMPRATE CP NMS") field(INPD, "1.0") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") } record(calc, "BEND:LTUS:477:STDZRAMPDLY") { field(DESC, "Ramp delay total") field(CALC, "MAX(1,((A/100)*B+B))") field(PREC, "5") field(INPA, "BEND:LTUS:477:TRIMDLYPCT CP MS") field(INPB, "BEND:LTUS:477: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, "BEND:LTUS:477:STDZMINIDLY") { field(DESC, "Mini-stdz delay") field(CALC, "A") field(PREC, "5") field(A, "1.0") field(EGU, "sec") field(PINI, "YES") } record(ao, "BEND:LTUS:477: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, "BEND:LTUS:477:STDZMINIDELTA") { field(DESC, "Stdz mini % of IMAX") field(CALC, "(B/100)*(A-C)") field(INPA, "BEND:LTUS:477:IDES.HOPR") field(INPB, "BEND:LTUS:477:STDZMINIPCT CPP NMS") field(INPC, "BEND:LTUS:477:IDES.LOPR") field(PREC, "5") } record(calc, "BEND:LTUS:477:STDZMINISETPT") { field(DESC, "Mini Stdz delta") field(CALC, "C==0?MAX(E-D,B):MIN(E+D,A)") field(INPA, "BEND:LTUS:477:IDES.HOPR") field(INPB, "BEND:LTUS:477:IDES.LOPR") field(INPC, "BEND:LTUS:477:STDZDIRECT.RVAL") field(INPD, "BEND:LTUS:477:STDZMINIDELTA") field(INPE, "BEND:LTUS:477:IDES") field(PREC, "5") field(FLNK, "BEND:LTUS:477: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, "BEND:LTUS:477:STDZMINISETPTOOR") { field(DESC, "Mini Stdz setpoint out of range") field(CALC, "C==0?(E-DA)") field(INPA, "BEND:LTUS:477:IDES.HOPR") field(INPB, "BEND:LTUS:477:IDES.LOPR") field(INPC, "BEND:LTUS:477:STDZDIRECT.RVAL") field(INPD, "BEND:LTUS:477:STDZMINIDELTA") field(INPE, "BEND:LTUS:477: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, "BEND:LTUS:477: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, "BEND:LTUS:477:IADJUST.RVAL") field(INPB, "BEND:LTUS:477:STDZDIRECT.RVAL") field(INPC, "BEND:LTUS:477:STDZOK.RVAL") field(INPD, "BEND:LTUS:477:STDZDISABLE.RVAL") field(INPE, "BEND:LTUS:477:STATE.RVAL CPP NMS") field(INPF, "BEND:LTUS:477:ICTRL.RVAL") field(INPG, "BEND:LTUS:477:STATE.SEVR") field(INPH, "BEND:LTUS:477:BDELTAS.M") field(INPI, "BEND:LTUS:477:IACT.SEVR") field(OUT, "BEND:LTUS:477:STDZLOSTGO.SELN PP NMS") field(OOPT, "Transition To Non-zero") } record(seq, "BEND:LTUS:477:STDZLOSTGO") { field(DESC, "Process lost stdz") field(SELM, "Mask") field(DOL1, "1") field(DOL2, "0") field(LNK1, "BEND:LTUS:477:STDZLOSTTOD.PROC") field(LNK2, "BEND:LTUS:477:STDZOK PP") } # Record maximum current after standardize # Reset to IACT from sequence after trim # Disable processing during (mini-)standardize or trim record(calc, "BEND:LTUS:477:STDZIACTMAX") { field(DESC, "Max act current after stdz") field(CALC, "MAX(A, B)") field(DISV, "0") field(SDIS, "BEND:LTUS:477:CHECKPWRDIP_ENABLE") field(INPA, "BEND:LTUS:477:IACT CP") field(INPB, "BEND:LTUS:477:STDZIACTMAX") field(EGU, "A") field(FLNK, "BEND:LTUS:477:CHECKPWRDIP") } # Detect power dip if STDZOK is YES, STDZ is enabled, and IACT is valid # If IACT drops below STDZIACTMAX by more than the trim tolerance, clear STDZOK # Warning: Take the absolute value of the trim tolerance, or else quads of # negative polarity will always lose STDZ since their IDELTAS.I are negative. # Note: Large quads and bends are prone to losing STDZ even if they are # perturbed toward higher current since their current tends to overshoot # by greater than the trim tolerance before settling down. record(calcout, "BEND:LTUS:477:CHECKPWRDIP") { field(DESC, "Detect power dip") field(CALC, "(A-B>ABS(C))?3:0") field(DISV, "0") field(SDIS, "BEND:LTUS:477:CHECKPWRDIP_ENABLE") field(INPA, "BEND:LTUS:477:STDZIACTMAX") field(INPB, "BEND:LTUS:477:IACT") field(INPC, "BEND:LTUS:477:IDELTAS.I") field(OUT, "BEND:LTUS:477:STDZLOSTGO.SELN PP NMS") field(OOPT, "When Non-zero") } # Enable processing of STDZIACTMAX and CHECKPWRDIP only if # STDZOK = YES, STDZDISABLE = NO, CTRL != Trim (2), and # CTRL != Stdz (4) record(calc, "BEND:LTUS:477:CHECKPWRDIP_ENABLE") { field(CALC, "A&&!B&&(C#2)&&(C#4)") field(INPA, "BEND:LTUS:477:STDZOK.RVAL CP") field(INPB, "BEND:LTUS:477:STDZDISABLE.RVAL CP") field(INPC, "BEND:LTUS:477:CTRL.RVAL CP") } #! 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, "BEND:LTUS:477: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, "BEND:LTUS:477: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, "BEND:LTUS:477:CALBSET") { field(DESC, "Use DAC Calbration") field(SCAN, "10 second") field(CALC, "A&&(B==0)&&C?31:960") field(INPA, "BEND:LTUS:477:CALBOK") field(INPB, "BEND:LTUS:477:CALBDISABLE") field(INPC, "BEND:LTUS:477:CALBSLOPE") field(OOPT, "On Change") field(OUT, "BEND:LTUS:477: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, "BEND:LTUS:477:CALB_SEQ") { field(DESC, "Output Calib Values") field(SELM, "Mask") field(SELL, "BEND:LTUS:477: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, "BEND:LTUS:477:CALBSLOPE") field(DOL3, "BEND:LTUS:477: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, "BEND:LTUS:477:CALBTOD") { field(DESC, "Calibration Success Time") field(PINI, "YES") # field(DOL, "") field(OMSL, "supervisory") field(DTYP, "Soft Channel") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:477: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, "BEND:LTUS:477: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, "BEND:LTUS:477: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, "BEND:LTUS:477:CALBOFFSET") { field(DESC, "Calc DAC Offset") field(PREC, "6") field(EGU, "Counts") field(PINI, "YES") } record(bo, "BEND:LTUS:477: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, "BEND:LTUS:477:DACSLOPE") { field(DESC, "V to DAC slope") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "supervisory") field(PINI, "YES") field(FLNK, "BEND:LTUS:477:DACOFFSET") } # Default Offset used in conversion from Volts to DAC Counts record(ao, "BEND:LTUS:477:DACOFFSET") { field(DESC, "V to DAC offset") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "supervisory") field(PINI, "YES") field(FLNK, "BEND:LTUS:477: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, "BEND:LTUS:477: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, "BEND:LTUS:477:IACT") field(INPD, "BEND:LTUS:477:DACSLOPE") field(INPE, "BEND:LTUS:477:DACOFFSET") field(EGU, "Counts") field(PREC, "6") } record(ao, "BEND:LTUS:477:DAC") { field(DESC, "DAC Set point") field(EGU, "Counts") field(DOL, "") field(OMSL, "supervisory") field(PREC, "6") field(PINI, "YES") } record(ao, "BEND:LTUS:477:CALBIMIN") { field(DESC, "Calibration Min Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(DRVH, "250.0") field(HOPR, "250.0") field(DRVL, "0.0") field(LOPR, "0.0") field(PREC, "3") field(EGU, "A") field(VAL, "0.0") field(FLNK, "BEND:LTUS:477:CALBIMAX") } record(ao, "BEND:LTUS:477:CALBIMAX") { field(DESC, "Calibration Max Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(DRVH, "250.0") field(HOPR, "250.0") field(LOPR, "0.0") field(DRVL, "0.0") field(EGU, "A") field(VAL, "250.0") field(FLNK, "BEND:LTUS:477:CALBSTEPNUM") } record(ao, "BEND:LTUS:477:CALBIFINAL") { field(DESC, "Calibration Last Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(PREC, "3") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(VAL, "0") } record(longout, "BEND:LTUS:477: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, "BEND:LTUS:477:CALBIDELTA") } record(calc, "BEND:LTUS:477:CALBIDELTA") { field(DESC, "Step size for CALB") field(CALC, "C=0?0:ABS((A-B)/C)") field(INPA, "BEND:LTUS:477:CALBIMAX") field(INPB, "BEND:LTUS:477:CALBIMIN") field(INPC, "BEND:LTUS:477: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, "BEND:LTUS:477:CALBIMULT") { field(DESC, "IACT vs ISETPT mult") field(CALC, "C#0||A=0?1:ABS(B/A)") field(INPA, "BEND:LTUS:476:ISETPT.DRVH") field(INPB, "BEND:LTUS:476:IACT.HOPR") field(INPC, "BEND:LTUS:477:PSCONTROLLER.RVAL CPP") field(EGU, "A") field(PINI, "YES") } # SNL dbputs DAC values here. 6-10 steps are possible. record(waveform, "BEND:LTUS:477:CALBICTRLWF") { field(DESC, "ICTRL setpoint array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") } record(waveform, "BEND:LTUS:477:DACWF") { field(DESC, "DAC count array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "BEND:LTUS:477:DACSA") } # Used only for xygraph edm plot record(subArray, "BEND:LTUS:477:DACSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "BEND:LTUS:477: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, "BEND:LTUS:477:CALCDACWF") { field(DESC, "Calc DAC counts array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "BEND:LTUS:477:CALCDACSA") } # Used only for xygraph edm plot record(subArray, "BEND:LTUS:477:CALCDACSA") { field(DESC, "Calc DAC counts") field(DTYP, "Soft Channel") field(INP, "BEND:LTUS:477: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, "BEND:LTUS:477:CALBYWF") { field(DESC, "mx + b") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "BEND:LTUS:477:CALBYSA") } # Used only for xygraph edm plot record(subArray, "BEND:LTUS:477:CALBYSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "BEND:LTUS:477:CALBYWF") field(MALM, "10") field(NELM, "6") field(INDX, "0") field(FTVL, "DOUBLE") } record(waveform, "BEND:LTUS:477:CALBIACTWF") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "BEND:LTUS:477:CALBIACTSA") } # Used only for xygraph edm plot record(subArray, "BEND:LTUS:477:CALBIACTSA") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(MALM, "10") field(NELM, "6") field(INP, "BEND:LTUS:477:CALBIACTWF") field(INDX, "0") field(FTVL, "DOUBLE") field(FLNK, "BEND:LTUS:477:CALBLIMITS") } # Check that measured current during calibration is within # tolerance. record(aSub, "BEND:LTUS:477: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, "BEND:LTUS:477:CALBSTEPNUM") field(INPB, "BEND:LTUS:477:CALBIACTWF") field(INPC, "BEND:LTUS:477: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, "BEND:LTUS:477: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, "BEND:LTUS:477:STDZITOL") field(INPH, "BEND:LTUS:477:DACSLOPE") field(INPI, "BEND:LTUS:477: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, "BEND:LTUS:477: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, "BEND:LTUS:477:CALBSTEPNUM") field(INPB, "BEND:LTUS:477:CALBIACTWF") field(INPC, "BEND:LTUS:477:DACWF") field(INPF, "BEND:LTUS:477: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 BEND:LTUS:477CALBOK 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, "BEND:LTUS:477:DEGAUSINIT") { field(DESC, "Proc. Degauss PVs on boot") field(PINI, "YES") field(DOL, "1") field(OUTA, "BEND:LTUS:477:DEGAUSIMIN.PROC PP") field(OUTB, "BEND:LTUS:477:DEGAUSIMAX.PROC PP") field(OUTC, "BEND:LTUS:477:DEGAUSTYPE.PROC PP") field(OUTD, "BEND:LTUS:477:DEGAUSSTEP.PROC PP") field(OUTE, "BEND:LTUS:477:MADNAME.PROC PP") field(OUTF, "BEND:LTUS:477:PSTYPE.PROC PP") field(OUTG, "BEND:LTUS:477: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, "BEND:LTUS:477:DEGAUSSUB") { field(DESC, "Degauss subroutine") field(INAM, "mgntDegaussInit") field(SNAM, "mgntDegauss") field(BRSV, "INVALID") field(INPA, "BEND:LTUS:477:DEGAUSIMIN NPP NMS") field(INPB, "BEND:LTUS:477:DEGAUSIMAX NPP NMS") field(INPC, "BEND:LTUS:477:DEGAUSTYPE.RVAL NPP NMS") field(INPE, "BEND:LTUS:477:DEGAUSMETHOD.RVAL NPP NMS") field(INPF, "BEND:LTUS:477:PSTYPE NPP NMS") field(INPG, "BEND:LTUS:477:DEBUG.RVAL NPP NMS") field(INPH, "BEND:LTUS:477: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, "BEND:LTUS:477:DEGAUSWF PP") field(OUTB, "BEND:LTUS:477:DEGAUSMSG PP") field(OUTC, "BEND:LTUS:477: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, "BEND:LTUS:477:DEGAUSWF") { field(DESC, "Degauss Setpts") field(NELM, "60") field(FTVL, "DOUBLE") } record(mbbo,"BEND:LTUS:477: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, "BEND:LTUS:477: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, "BEND:LTUS:477: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, "BEND:LTUS:477: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, "BEND:LTUS:477: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, "BEND:LTUS:477:DEGAUSIMIN") { field(DESC, "Min. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "250.0") field(LOPR, "-250.0") field(DRVH, "250.0") field(DRVL, "-250.0") field(VAL, "-250.0") } record(ao, "BEND:LTUS:477:DEGAUSIMAX") { field(DESC, "Max. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "250.0") field(LOPR, "-250.0") field(DRVH, "250.0") field(DRVL, "-250.0") field(VAL, "250.0") } # 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,"BEND:LTUS:477: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, "BEND:LTUS:477: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,"BEND:LTUS:477: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, "BEND:LTUS:477: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, "BEND:LTUS:477: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, "BEND:LTUS:477: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, "BEND:LTUS:477:DEGAUSTOD") { field(DESC, "Successful Degauss Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "BEND:LTUS:477:DEGAUSLOSTTOD") { field(DESC, "Degauss Lost Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:477:DEGAUSTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "BEND:LTUS:477:DEGAUSTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "BEND:LTUS:477: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, "BEND:LTUS:477:DEGAUSGO") { field(DESC, "Set bdes of btrms to zero") field(ASG, "Internal") field(OUTA, "") field(OUTB, "") field(OUTC, "") field(OUTD, "") } # =========== CRYO ONLY =========== record(bo, "BEND:LTUS:477: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, "BEND:LTUS:477:DEGAUS_IMAX_CHECK") { field(DESC, "Check if imax shoud chg") field(CALC, "(C==4)&&(ABS(B)>ABS(A))?1:0") field(INPA, "BEND:LTUS:477:DEGAUS_IMAX") field(INPB, "BEND:LTUS:477:ISETPT") field(INPC, "BEND:LTUS:477:DEGAUSTYPE.RVAL") field(OUT, "BEND:LTUS:477:DEGAUS_IMAX_UPDATE.SELN") field(FLNK, "BEND:LTUS:477:DEGAUS_IMAX_UPDATE") } record(seq, "BEND:LTUS:477:DEGAUS_IMAX_UPDATE") { field(DESC, "Degauss IMAX Update") field(SELM, "Specified") field(DOL1, "BEND:LTUS:477:ISETPT") field(LNK1, "BEND:LTUS:477:DEGAUS_IMAX PP") } # Set the maximum current after a successful # degauss. This pv is updated by the # sequence. record(ao, "BEND:LTUS:477:DEGAUS_IMAX") { field(DESC, "Max I set afer a degauss") field(EGU, "Amps") field(PINI, "YES") field(PREC, "6") field(HOPR, "250.0") field(LOPR, "-250.0") field(DRVH, "250.0") field(DRVL, "-250.0") field(VAL, "250.0") field(FLNK, "BEND:LTUS:477:DEGAUS_IMAXPOL_CHECK") info(autosaveFields,"VAL,RVAL") } # Set the polarity if degauss_imax record(calcout, "BEND:LTUS:477:DEGAUS_IMAXPOL_CHECK") { field(DESC, "Determine polarity of imax") field(CALC, "A>=0?0:1") field(INPA, "BEND:LTUS:477:DEGAUS_IMAX") field(FLNK, "BEND:LTUS:477:DEGAUS_IMAXPOL") } record(bo, "BEND:LTUS:477:DEGAUS_IMAXPOL") { field(DESC, "Polarity of imax I") field(DTYP, "Raw Soft Channel") field(DOL, "BEND:LTUS:477:DEGAUS_IMAXPOL_CHECK") field(OMSL, "closed_loop") field(ZNAM, "Positive") field(ONAM, "Negative") field(FLNK, "BEND:LTUS:477: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, "BEND:LTUS:477:DEGAUS_ABSIMAX") { field(DESC, "Absolute Max. Degauss I") field(CALC, "ABS(A)") field(INPA, "BEND:LTUS:477:DEGAUS_IMAX") field(PREC, "6") field(EGU, "Amps") field(HOPR, "250.0") field(LOPR, "-250.0") info(autosaveFields,"VAL RVAL") } # IACT Polarity record(calcout, "BEND:LTUS:477:IACTPOL_CHECK") { field(DESC, "Determine IACT polarity") field(SCAN, "5 second") field(CALC, "ABS(A-B)>C?(A>=0?0:1):D") field(INPA, "BEND:LTUS:477:IACT") field(INPB, "BEND:LTUS:477:IACTPOL_CHECK.LA") field(INPC, "0.0001") field(INPD, "BEND:LTUS:477:IACTPOL_CHECK.PVAL") field(OOPT, "On Change") field(FLNK, "BEND:LTUS:477:IACTPOL") } record(bo, "BEND:LTUS:477: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,"BEND:LTUS:477: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, "BEND:LTUS:477:DEGAUSENABLE CP") field(INPB, "BEND:LTUS:477:DEGAUSOK") field(INPC, "BEND:LTUS:477:STATE CP") field(INPD, "BEND:LTUS:477:STATE.SEVR") field(OUT, "BEND:LTUS:477:DEGAUS_STATE_SEQ.SELN PP") field(ASG, "Internal") } record(seq, "BEND:LTUS:477:DEGAUS_STATE_SEQ") { field(DESC, "Degauss State Sequence") field(SELM, "Specified") field(SELL, "BEND:LTUS:477:DEGAUS_STATE_CHECK") field(LNK1, "BEND:LTUS:477:DEGAUS_STATE_DISABLE.PROC PP") field(LNK2, "BEND:LTUS:477:DEGAUS_STATE_LOST.PROC PP") field(LNK3, "BEND:LTUS:477:DEGAUS_STATE_GOOD.PROC PP") field(LNK4, "BEND:LTUS:477: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, "BEND:LTUS:477:DEGAUS_STATE_DISABLE") { field(DESC, "Degauss not used") field(LNK1, "BEND:LTUS:477:DEGAUSOK.ZSV") field(LNK2, "BEND:LTUS:477: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, "BEND:LTUS:477:STATMSG.FRSV") field(LNK4, "BEND:LTUS:477: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, "BEND:LTUS:477:DEGAUS_STATE_LOST") { field(DESC, "Degauss lost and ps On") field(DOL1, "1") field(LNK1, "BEND:LTUS:477:DEGAUSOK.ZSV") field(LNK2, "BEND:LTUS:477: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, "BEND:LTUS:477:STATMSG.FRSV") field(LNK4, "BEND:LTUS:477: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, "BEND:LTUS:477:DEGAUS_STATE_OFF") { field(DESC, "Degaused lost and ps Off") field(DOL1, "2") field(LNK1, "BEND:LTUS:477: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, "BEND:LTUS:477:STATMSG.FRSV") field(LNK3, "BEND:LTUS:477: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, "BEND:LTUS:477:DEGAUS_STATE_GOOD") { field(DESC, "Degauss good") field(DOL1, "1") field(LNK1, "BEND:LTUS:477: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, "BEND:LTUS:477:STATMSG.FRSV PP") field(LNK3, "BEND:LTUS:477:STATMSG.FVSV PP") field(LNK4, "") field(ASG, "Internal") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(mbbo, "BEND:LTUS:477:FUNC") { field(DESC, "BEND:LTUS:477 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, "0") field(FFVL, "0") field(OUT, "BEND:LTUS:477:CTRL CA") } # :CTRL pv is processed at boot in the # sequence mgntCtrl.st Processed in sequence # record(mbbo, "BEND:LTUS:477:CTRL") { field(DESC, "BEND:LTUS:477 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, "BEND:LTUS:477:SELECTEN.A PP") field(SDIS, "0") } # If a function has been selected set this unit to busy record(calcout, "BEND:LTUS:477:SELECTEN") { field(DESC, "Control Select Enable") field(CALC, "A>0?1:A") field(FLNK, "BEND:LTUS:477:BUSY") } # Set to FREE on IOC reboot record(bo, "BEND:LTUS:477:BUSY") { field(DESC, "BEND:LTUS:477 Ctrl Done") field(DOL, "BEND:LTUS:477:SELECTEN") field(ZNAM, "FREE") field(ONAM, "BUSY") field(PINI, "YES") field(FLNK, "BEND:LTUS:477:SELECT") } record(bo, "BEND:LTUS:477:SELECT") { field(ZNAM, "NO") field(ONAM, "YES") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") } record(bo, "BEND:LTUS:477: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, "BEND:LTUS:477:CTRLSTATE") { field(DESC, "BEND:LTUS:477 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("BEND:LTUS:477:CTRL",20,20,0,0,"BEND:LTUS:477:CTRL") #! Field("BEND:LTUS:477:CTRL.OUT",16777215,1,"BEND:LTUS:477:CTRL.OUT") #! Link("BEND:LTUS:477:CTRL.OUT","BEND:LTUS:477:SELECTEN.A") #! Field("BEND:LTUS:477:CTRL.VAL",16777215,1,"BEND:LTUS:477:CTRL.VAL") #! Record("BEND:LTUS:477:SELECTEN",321,381,0,0,"BEND:LTUS:477:SELECTEN") #! Field("BEND:LTUS:477:SELECTEN.A",16777215,0,"BEND:LTUS:477:SELECTEN.A") #! Field("BEND:LTUS:477:SELECTEN.FLNK",16777215,1,"BEND:LTUS:477:SELECTEN.FLNK") #! Link("BEND:LTUS:477:SELECTEN.FLNK","BEND:LTUS:477:BUSY") #! Field("BEND:LTUS:477:SELECTEN.VAL",16777215,1,"BEND:LTUS:477:SELECTEN.VAL") #! Record("BEND:LTUS:477:BUSY",623,274,0,0,"BEND:LTUS:477:BUSY") #! Field("BEND:LTUS:477:BUSY.DOL",16777215,0,"BEND:LTUS:477:BUSY.DOL") #! Link("BEND:LTUS:477:BUSY.DOL","BEND:LTUS:477:SELECTEN.VAL") #! Field("BEND:LTUS:477:BUSY.FLNK",16777215,1,"BEND:LTUS:477:BUSY.FLNK") #! Link("BEND:LTUS:477:BUSY.FLNK","BEND:LTUS:477:SELECT") #! Record("BEND:LTUS:477:SELECT",669,508,0,1,"BEND:LTUS:477:SELECT") #! Record("BEND:LTUS:477:FUNC",940,120,0,0,"BEND:LTUS:477:FUNC") #! Field("BEND:LTUS:477:FUNC.OUT",16777215,0,"BEND:LTUS:477:FUNC.OUT") #! Link("BEND:LTUS:477:FUNC.OUT","BEND:LTUS:477:CTRL.VAL") #! Record("BEND:LTUS:477:ABORT",193,41,0,0,"BEND:LTUS:477:ABORT") #! Record("BEND:LTUS:477:CTRLSTATE",369,34,0,0,"BEND:LTUS:477: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,"BEND:LTUS:477:SELECT is used for Multi-device selection.\nIt is enabled when associated BEND:LTUS:477:CTRL is \"0\" (DONE).\nIt is disabled when associated BEND:LTUS:477: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,"BEND:LTUS:477: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, "BEND:LTUS:477:BCTRL_INIT") { field(DESC, "Process BCTRL on boot") field(PINI, "YES") field(CALC, "A=3?1:0") field(INPA, "BEND:LTUS:477:BCTRL.SEVR") field(OUT, "BEND:LTUS:477: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, "BEND:LTUS:477:BACT") { field(DESC, "Actual B") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "BEND:LTUS:477:BACT") field(INPB, "BEND:LTUS:477:POLYCOEF") field(INPC, "BEND:LTUS:477:POLYCOEF.A") field(INPD, "BEND:LTUS:477:POLYCOEF.B") field(INPE, "BEND:LTUS:477:IACTCALC MS") field(INPF, "BEND:LTUS:477:BDELTAS PP") field(INPG, "100") field(EGU, "kG-m") field(HOPR, "4.5191") field(LOPR, "0.0149") field(HIHI, "4.5191") field(LOLO, "0.0149") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "4.5191") field(LOW, "0.0149") field(FLNK, "BEND:LTUS:477: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, "BEND:LTUS:477:BDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntPhyDeltas") field(EGU, "kG-m") field(HOPR, "1") field(PREC, "7") field(BRSV, "INVALID") field(INPA, "BEND:LTUS:477:BDES") field(INPB, "BEND:LTUS:477:TRIMBTOL") field(INPC, "BEND:LTUS:477:TRIMBTOLR") field(INPD, "BEND:LTUS:477:CHCKBTOL") field(INPE, "BEND:LTUS:477:CHCKBTOLR") field(F, "2.0") field(INPG, "30") field(INPH, "BEND:LTUS:477:BACT.VAL") # # MPS absolute and relative tolerances field(INPP, "BEND:LTUS:477:MPSBTOL") field(INPQ, "BEND:LTUS:477:MPSBTOLR") field(FLNK, "BEND:LTUS:477:BCONLIMITS") info(autosaveFields,"F") } # This record is processed by BDELTAS record(aSub, "BEND:LTUS:477:BCONLIMITS") { field(DESC, "Config B-field Limits") field(INAM, "mgntInit") field(SNAM, "mgntBCONLimits") field(INPA, "BEND:LTUS:477:BDES") field(INPB, "BEND:LTUS:477:BDELTAS.I") field(INPG, "BEND:LTUS:477:DEBUG.RVAL") field(FTA, "DOUBLE") field(FTB, "DOUBLE") field(FTG, "ULONG") field(OUTA, "BEND:LTUS:477:BCON.HIGH") field(OUTB, "BEND:LTUS:477:BCON.LOW") field(OUTC, "BEND:LTUS:477:BCON.HIHI") field(OUTD, "BEND:LTUS:477:BCON.LOLO PP") field(FTVA, "DOUBLE") field(FTVB, "DOUBLE") field(FTVC, "DOUBLE") field(FTVD, "DOUBLE") field(BRSV, "INVALID") field(FLNK, "BEND:LTUS:477:IDELTAS") } # The following PV is processed by :BACT # which is processed by :BACT # record(fanout, "BEND:LTUS:477:BACTFO") { field(DESC, "BACT processing") field(SELM, "All") field(LNK1, "BEND:LTUS:477:BDIFF") field(LNK2, "BEND:LTUS:477:BADIFF") field(LNK3, "BEND:LTUS:477:BRATIO") field(LNK4, "BEND:LTUS:477:MPSLIMITS") field(LNK5, "BEND:LTUS:477:I2BSTATUS") field(LNK6, "BEND:LTUS:477:IACTFO.PROC") } record(calc, "BEND:LTUS:477:BDIFF") { field(DESC, "BDES-BACT") field(CALC, "A-B") field(INPA, "BEND:LTUS:477:BDES") field(INPB, "BEND:LTUS:477:BACT") field(EGU, "kG-m") field(PREC, "7") } record(calc, "BEND:LTUS:477:BADIFF") { field(DESC, "Absolute BDES-BACT") field(INPA, "BEND:LTUS:477:BDIFF") field(EGU, "kG-m") field(PREC, "7") field(CALC, "A<0?ABS(A):A") } record(calc, "BEND:LTUS:477:BRATIO") { field(DESC, "BACT Error") field(CALC, "B?A/B:0") field(INPA, "BEND:LTUS:477:BDIFF") field(INPB, "BEND:LTUS:477:BDES.HOPR") field(EGU, "kG-m") field(PREC, "7") } record(mbbi, "BEND:LTUS:477: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, "BEND:LTUS:477:BACT.J") } # Note: for a string slave set the MONFL # macro to the following: # MONFL=:IMONCALC MS record(sub, "BEND:LTUS:477:BMON") { field(DESC, "Second Transductor") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "BEND:LTUS:477:BMON") field(INPB, "BEND:LTUS:477:POLYCOEF") field(INPC, "BEND:LTUS:477:POLYCOEF.A") field(INPD, "BEND:LTUS:477:POLYCOEF.B") field(INPE, "BEND:LTUS:477:IMONCALC MS") field(INPF, "BEND:LTUS:477:BDELTAS.VAL") field(INPG, "100") field(EGU, "kG-m") field(HOPR, "4.5191") field(LOPR, "0.0149") field(HIHI, "4.5191") field(LOLO, "0.0149") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "4.5191") field(LOW, "0.0149") } # 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=BEND:LTUS:476:BDES CP record(ao, "BEND:LTUS:477:BDES") { field(DESC, "Desired B-Field") field(PINI, "NO") field(DRVH, "4.5191") field(DRVL, "0.0149") field(HOPR, "4.5191") field(LOPR, "0.0149") field(PREC, "7") field(EGU, "kG-m") field(MDEL, "-1") field(OMSL, "closed_loop") field(DOL, "BEND:LTUS:477:IDES2BDES") field(OUT, "BEND:LTUS:477:B2IDES PP") info(autosaveFields,"VAL") } record(sub, "BEND:LTUS:477:B2IDES") { field(DESC, "Convert Desired B-Field to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "BEND:LTUS:477:POLYCOEF") field(INPC, "BEND:LTUS:477:POLYCOEF.A") field(INPD, "BEND:LTUS:477:POLYCOEF.B") field(PREC, "7") field(EGU, "kG-m") field(HOPR, "4.5191") field(LOPR, "0.0149") field(MDEL, "-1") field(INPE, "BEND:LTUS:477:BDES.DRVH") field(INPF, "BEND:LTUS:477:BDES.DRVL") field(BRSV, "INVALID") field(FLNK, "BEND:LTUS:477:IDES") } record(sub, "BEND:LTUS:477:BNOM") { field(DESC, "Nominal Field") field(PINI, "YES") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "BEND:LTUS:477:POLYCOEF") field(INPC, "BEND:LTUS:477:POLYCOEF.A") field(INPD, "BEND:LTUS:477:POLYCOEF.B") field(INPE, "BEND:LTUS:477:BDES.DRVH") field(INPF, "BEND:LTUS:477:BDES.DRVL") field(EGU, "kG-m") field(HOPR, "4.5191") field(LOPR, "0.0149") field(PREC, "7") field(VAL, "0.0") field(FLNK, "BEND:LTUS:477:INOM") } record(sub, "BEND:LTUS:477:BACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "BEND:LTUS:477:BDES.VAL") field(INPB, "BEND:LTUS:477:BDES.DRVH") field(INPC, "BEND:LTUS:477:BDES.DRVL") field(INPD, "BEND:LTUS:477:BDELTAS.I") field(INPE, "BEND:LTUS:477:BDELTAS.J") field(INPG, "BEND:LTUS:477:STATE") field(INPH, "BEND:LTUS:477:HSTA") field(EGU, "kG-m") field(HOPR, "4.5191") field(LOPR, "0.0149") field(PREC, "7") field(BRSV, "INVALID") } record(sub, "BEND:LTUS:477:BMONLIMITS") { field(DESC, "MON Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "BEND:LTUS:477:BDES.VAL") field(INPB, "BEND:LTUS:477:BDES.DRVH") field(INPC, "BEND:LTUS:477:BDES.DRVL") field(INPD, "BEND:LTUS:477:BDELTAS.K") field(INPE, "BEND:LTUS:477:BDELTAS.L") field(INPG, "BEND:LTUS:477:STATE") field(INPH, "BEND:LTUS:477:HSTA") field(EGU, "kG-m") field(HOPR, "4.5191") field(LOPR, "0.0149") field(PREC, "7") field(BRSV, "INVALID") } record(seq, "BEND:LTUS:477:BLIMITS") { field(DESC, "ACT Limits") field(PREC, "7") field(DOL1, "BEND:LTUS:477:BLIMITS") field(LNK1, "BEND:LTUS:477:BACTLIMITS.F PP") field(DOL2, "BEND:LTUS:477:BACTLIMITS.I") field(LNK2, "BEND:LTUS:477:BACT.HIGH") field(DOL3, "BEND:LTUS:477:BACTLIMITS.J") field(LNK3, "BEND:LTUS:477:BACT.LOW") field(DOL4, "BEND:LTUS:477:BACTLIMITS.K") field(LNK4, "BEND:LTUS:477:BACT.HIHI") field(DOL5, "BEND:LTUS:477:BACTLIMITS.L") field(LNK5, "BEND:LTUS:477:BACT.LOLO") field(DOL6, "BEND:LTUS:477:BLIMITS") field(LNK6, "BEND:LTUS:477:BMONLIMITS.F PP") field(DOL7, "BEND:LTUS:477:BMONLIMITS.I") field(LNK7, "BEND:LTUS:477:BMON.HIGH") field(DOL8, "BEND:LTUS:477:BMONLIMITS.J") field(LNK8, "BEND:LTUS:477:BMON.LOW") field(DOL9, "BEND:LTUS:477:BMONLIMITS.K") field(LNK9, "BEND:LTUS:477:BMON.HIHI") field(DOLA, "BEND:LTUS:477:BMONLIMITS.L") field(LNKA, "BEND:LTUS:477:BMON.LOLO") field(FLNK, "BEND:LTUS:477:ILIMITS") field(SCAN, "5 second") } record(ao, "BEND:LTUS:477:BCTRL") { field(DESC, "B-Perturb") field(PREC, "7") field(EGU, "kG-m") field(DRVH, "4.5191") field(DRVL, "0.0149") field(HOPR, "4.5191") field(LOPR, "0.0149") # 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, "BEND:LTUS:477: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, "BEND:LTUS:477:BCTRLGO") { field(DESC, "Update DES and perturb") field(PREC, "7") # Disable BACT limits field(DOL1, "1") field(LNK1, "BEND:LTUS:477:BLIMITS.VAL") # Update BDES with the BCTRL (slider) value field(DOL2, "BEND:LTUS:477:BCTRL.VAL") field(LNK2, "BEND:LTUS:477:BDES PP") field(DOL3, "1") field(LNK3, "BEND:LTUS:477:IDIRECT.PROC PP") field(DOL4, "1") field(LNK4, "BEND:LTUS:477:CHECKSTDZLOST.PROC PP") field(DOL5, "BEND:LTUS:477:BCTRL.VAL") field(LNK5, "BEND:LTUS:477:BCTRLSUB PP") # Re-enable BACT limits field(DOL6, "0") field(LNK6, "BEND:LTUS:477:BLIMITS.VAL") } # Convert B-field to Current and output to ISETPT record(sub, "BEND:LTUS:477:BCTRLSUB") { field(DESC, "Feedback") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "BEND:LTUS:477:POLYCOEF") field(INPC, "BEND:LTUS:477:POLYCOEF.A") field(INPD, "BEND:LTUS:477:POLYCOEF.B") field(INPE, "BEND:LTUS:477:BDES.DRVH") field(INPF, "BEND:LTUS:477:BDES.DRVL") field(PREC, "7") field(EGU, "kG-m") field(HOPR, "4.5191") field(LOPR, "0.0149") field(MDEL, "-1") field(BRSV, "INVALID") field(FLNK, "BEND:LTUS:477:ISETPT") } record(ao, "BEND:LTUS:477:BDESPREVTRIM") { field(DESC, "trim bdes for undo") field(DTYP, "Soft Channel") field(DRVH, "4.5191") field(DRVL, "0.0149") field(EGU, "kG-m") field(HOPR, "4.5191") field(LOPR, "0.0149") field(PREC, "7") field(PINI, "YES") info(autosaveFields,"VAL") } record(stringin, "BEND:LTUS:477:MADNAME") { field(DESC, "MAD deck nomenclature") field(PINI, "YES") field(VAL, "BCX32B3") } record(ai, "BEND:LTUS:477: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, "3355.075579") } record(ao, "BEND:LTUS:477:BMAX") { field(DESC, "Max B-Field") field(DTYP, "Soft Channel") field(DRVH, "4.5191") field(DRVL, "0.0149") field(EGU, "kG-m") field(HOPR, "4.5191") field(LOPR, "0.0149") field(PREC, "7") field(PINI, "YES") field(VAL, "4.5191") field(FLNK, "BEND:LTUS:477:BSTEP") } record(ao, "BEND:LTUS:477:BMIN") { field(DESC, "Min B-Field") field(DTYP, "Soft Channel") field(DRVH, "4.5191") field(DRVL, "0.0149") field(EGU, "kG-m") field(HOPR, "4.5191") field(LOPR, "0.0149") field(PREC, "7") field(PINI, "YES") field(VAL, "0.0149") field(FLNK, "BEND:LTUS:477:BSTEP") } record(ao, "BEND:LTUS:477:BDESSAVE") { field(DESC, "bdes for save/load") field(DTYP, "Soft Channel") field(DRVH, "4.5191") field(DRVL, "0.0149") field(EGU, "kG-m") field(HOPR, "4.5191") field(LOPR, "0.0149") field(PINI, "YES") field(PREC, "7") } # This record is processed by BEND:LTUS:477: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, "BEND:LTUS:477:BCON") { field(DESC, "Config B-Field ") field(DTYP, "Soft Channel") field(PREC, "7") field(EGU, "kG-m") field(HOPR, "4.5191") field(LOPR, "0.0149") field(DRVH, "4.5191") field(DRVL, "0.0149") # 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 , "BEND:LTUS:477:ICON2BCON") field(OMSL, "closed_loop") field(OUT, "BEND:LTUS:477:B2ICON PP") info(autosaveFields,"VAL") } record(sub, "BEND:LTUS:477:B2ICON") { field(DESC, "Convert Desired ICon to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "BEND:LTUS:477:POLYCOEF") field(INPC, "BEND:LTUS:477:POLYCOEF.A") field(INPD, "BEND:LTUS:477:POLYCOEF.B") field(PREC, "7") field(EGU, "kG-m") field(HOPR, "4.5191") field(LOPR, "0.0149") field(MDEL, "-1") field(INPE, "BEND:LTUS:477:BCON.DRVH") field(INPF, "BEND:LTUS:477:BCON.DRVL") field(BRSV, "INVALID") field(FLNK, "BEND:LTUS:477: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, "BEND:LTUS:477:BSTEP") { field(DESC, "B-Field step size") field(CALC, "(C==3)||(D==3)?0:ABS(A-B)*0.005") field(INPA, "BEND:LTUS:477:BMAX") field(INPB, "BEND:LTUS:477:BMIN") field(INPC, "BEND:LTUS:477:BMIN.SEVR") field(INPD, "BEND:LTUS:477:BMAX.SEVR") field(EGU, "kG-m") 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,"BEND:LTUS:477:BCTRLDISABLECALC") { field(DESC, "Calc for disabling BCTRL") field(ASG, "Internal") field(CALC, "A?2:1") field(INPA, "BEND:LTUS:477:ONLINE CP") field(OUT, "BEND:LTUS:477:BCTRLDISABLEFOUT PP") } record(fanout, "BEND:LTUS:477:BCTRLDISABLEFOUT") { field(DESC, "Disable BCTRL fanout") field(SELM, "Specified") field(SELL, "BEND:LTUS:477:BCTRLDISABLECALC") field(LNK1, "BEND:LTUS:477:BCTRLDISABLE") field(LNK2, "BEND:LTUS:477:BCTRLENABLE") } record(stringout, "BEND:LTUS:477:BCTRLDISABLE") { field(DESC, "Disable BCTRL") field(DTYP, "Soft Channel") field(OUT, "BEND:LTUS:477:BCTRL.ASG") field(VAL, "NOWRITE") field(FLNK, "BEND:LTUS:477:BCTRLDISV_UPDATE") } record(stringout, "BEND:LTUS:477:BCTRLENABLE") { field(DESC, "Enable BCTRL") field(DTYP, "Soft Channel") field(OUT, "BEND:LTUS:477:BCTRL.ASG") field(VAL, "") field(FLNK, "BEND:LTUS:477:BCTRLDISV_UPDATE") } record(calcout, "BEND:LTUS:477:BCTRLDISV_UPDATE") { field(DESC, "Calc for updating BCTRL.DISV") field(ASG, "Internal") field(CALC, "A") field(INPA, "BEND:LTUS:477:ONLINE") field(OUT, "BEND:LTUS:477: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,"BEND:LTUS:477:BACT and MON\n are processed via links from \n BEND:LTUS:477:IACT (device raw value readback 1)\n and\n BEND:LTUS:477: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 BEND:LTUS:477:POLYCOEF\nC = First polynomial coefficient (offset if linear)\nD = Second polynomial coefficient (slope if linear)\nE = BEND:LTUS:477: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,"BEND:LTUS:477:BDES\n is processed when set by CA users or \n BEND:LTUS:477: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,"BEND:LTUS:477: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 BEND:LTUS:477: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 (BEND:LTUS:477: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,"BEND:LTUS:477:B*LIMITS and BEND:LTUS:477:BLIMITS:\n Calculate alarm and warning limits based on \n deltas from BEND:LTUS:477: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,"BEND:LTUS:477: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,"BEND:LTUS:477: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, "BEND:LTUS:477: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, "BEND:LTUS:477:MPSBTOL") { field(DESC, "Absolute mps tol") field(EGU, "kG-m") field(PREC, "2") field(CALC, "ABS(A)*0.02") field(INPA, "BEND:LTUS:477:BMAX") field(PINI, "YES") } # # 21-Aug-2013: K. Luchini # Set channel access security so that users # cannot easily change values. record(ao, "BEND:LTUS:477:MPSBMAX") { field(DESC, "MPS Max B-field") field(EGU, "kG-m") field(PREC, "7") field(DRVH, "4.5191") field(DRVL, "0.0149") field(PINI, "YES") field(VAL, "4.5191") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:477:MPSBMIN") { field(DESC, "MPS Min B-field") field(EGU, "kG-m") field(PREC, "7") field(DRVH, "4.5191") field(DRVL, "0.0149") field(PINI, "YES") field(VAL, "0.0149") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:477:MPSBLLIM") { field(DESC, "MPS Low Limit B-field") field(EGU, "kG-m") field(PREC, "7") field(DRVH, "4.5191") field(DRVL, "0.0149") field(PINI, "YES") field(VAL, "0.0149") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:477:MPSBLLIM2") { field(DESC, "MPS Low Limit #2 B-field") field(EGU, "kG-m") field(PREC, "7") field(DRVH, "4.5191") field(DRVL, "0.0149") field(PINI, "YES") field(VAL, "0.0149") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } # Set the default to Std record(mbbo, "BEND:LTUS:477: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, "BEND:LTUS:477:MPSLIMITS.E PP") } record(aSub, "BEND:LTUS:477: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, "BEND:LTUS:477:MPS.RVAL") field(INPB, "BEND:LTUS:477:BADIFF") field(INPC, "BEND:LTUS:477:BDELTAS.N") field(INPD, "BEND:LTUS:477:BACT") field(INPE, "BEND:LTUS:477:MPSBITMASK.RVAL") field(INPF, "BEND:LTUS:477:MPSBLLIM") field(INPG, "BEND:LTUS:477:MPSBMIN") field(INPH, "BEND:LTUS:477:MPSBMAX") field(INPI, "BEND:LTUS:477: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, "BEND:LTUS:477:INTOL.RVAL PP") field(OUTB, "BEND:LTUS:477:INTOL_BMIN.RVAL PP") field(OUTC, "BEND:LTUS:477:INTOL_BRANGE.RVAL PP") field(OUTD, "BEND:LTUS:477: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, "BEND:LTUS:477:INTOL") { field(DESC, "BACT within MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "BEND:LTUS:477:MPSLIMITS.VALA") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "BEND:LTUS:477:INTOL_BMIN") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "BEND:LTUS:477:MPSLIMITS.VALB") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "BEND:LTUS:477:INTOL_BMIN2") { field(DESC, "MPS tol #2") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "BEND:LTUS:477:MPSLIMITS.VALD") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "BEND:LTUS:477:INTOL_BRANGE") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "BEND:LTUS:477: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, "BEND:LTUS:477:CHCKITOL") { field(DESC, "Absolute Check I Tolerance") field(EGU, "A") field(FLNK, "BEND:LTUS:477:TRIMITOL") field(CALC, "ABS(A*B)") field(INPA, "BEND:LTUS:477:CHCKBTOL") field(INPB, "BEND:LTUS:477:POLYCOEF.B") field(PREC, "9") } record(calc, "BEND:LTUS:477:TRIMBTOL") { field(EGU, "kG-m") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(DESC, "Absolute Trim Tolerance") field(CALC, "ABS(A)/2") field(INPA, "BEND:LTUS:477:CHCKBTOL") field(FLNK, "BEND:LTUS:477:CHCKITOL") } record(calc, "BEND:LTUS:477:CHCKBTOL") { field(DESC, "Check absolute tolerance") field(EGU, "A") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(FLNK, "BEND:LTUS:477:TRIMBTOL") field(CALC, "MAX(ABS(A),ABS(C))*(B/1000000)") field(INPA, "BEND:LTUS:477:BDES.HOPR") field(INPB, "BEND:LTUS:477:STABILITY") field(INPC, "BEND:LTUS:477:BDES.LOPR") } record(longout, "BEND:LTUS:477: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, "BEND:LTUS:477:CHCKBTOL") } record(calc, "BEND:LTUS:477:TRIMITOL") { field(DESC, "Absolute Trim I Tolerance") field(EGU, "kG-m") field(CALC, "ABS(A*B)") field(INPA, "BEND:LTUS:477:POLYCOEF.B") field(INPB, "BEND:LTUS:477:TRIMBTOL") field(PREC, "9") } record(ai, "BEND:LTUS:477:TRIMBTOLR") { field(DESC, "Relative trim tol") field(PREC, "4") field(EGU, "%") field(HOPR, "1.0") field(LOPR, "0.0") field(PINI, "YES") } record(ai, "BEND:LTUS:477: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, "BEND:LTUS:477:FBCKFCOM") { field(ZNAM, "CA") field(ONAM, "FCOM") field(DESC, "CA Mode") field(PINI, "YES") field(SDIS, "0") } record(bo, "BEND:LTUS:477:PAU") { field(ZNAM, "NotConfigured") field(ONAM, "Configured") field(DESC, "PAU Present") field(PINI, "YES") field(SDIS, "0") field(FLNK, "BEND:LTUS:477:PAUGO") } record(fanout, "BEND:LTUS:477:PAUGO") { field(DESC, "PAU control") field(LNK1, "BEND:LTUS:477:PAUSTOP") field(LNK2, "BEND:LTUS:477: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, "BEND:LTUS:477:PAUSTART") { field(DESC, "Setup for PAU On") field(SDIS, "BEND:LTUS:477: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, "BEND:LTUS:477:PAUSTOP") { field(DESC, "Setup for PAU Off") field(SDIS, "BEND:LTUS:477: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, "BEND:LTUS:477:MCORDEVNAME") { field(DESC, "PS device name") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, "BEND:LTUS:476:") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "BEND:LTUS:477: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, "BEND:LTUS:477:PSTYPE.RVAL") field(INPC, "BEND:LTUS:477:TURNEDOFF.RVAL") field(INPD, "BEND:LTUS:477:CONFIG.RVAL") field(INPE, "BEND:LTUS:477:PSCATEGORY.RVAL") field(INPF, "BEND:LTUS:477:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "BEND:LTUS:477:AUTOCTRL.RVAL") field(INPJ, "BEND:LTUS:477:OUTOFSERVICE.RVAL") field(INPL, "BEND:LTUS:477:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "BEND:LTUS:477:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "BEND:LTUS:477:PAU") field(INPP, "BEND:LTUS:477:CALBDISABLE.RVAL") field(INPQ, "BEND:LTUS:477:PTRBDISABLE.RVAL") field(INPR, "BEND:LTUS:477:TRIMDISABLE.RVAL") field(INPS, "BEND:LTUS:477:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "BEND:LTUS:477:FBCK") field(INPU, "BEND:LTUS:477:TRIMTYPE.RVAL") field(INPV, "BEND:LTUS:477:STDZDIRECT.RVAL") field(INPW, "BEND:LTUS:477:DEGAUSENABLE.RVAL") field(FLNK, "BEND:LTUS:477:HSTA") } record(longin, "BEND:LTUS:477:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "BEND:LTUS:477:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "BEND:LTUS:477: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, "BEND:LTUS:477: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, "BEND:LTUS:477: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, "BEND:LTUS:477: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, "BEND:LTUS:477: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, "BEND:LTUS:477: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 BEND:LTUS:477:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses BEND:LTUS:477:FBCK. # This PV should be replaced by BEND:LTUS:477: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, "BEND:LTUS:477: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, "BEND:LTUS:477: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, "BEND:LTUS:477: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, "BEND:LTUS:476:OUTOFSERVICE CPP NMS") field(OMSL, "closed_loop") field(FLNK, "BEND:LTUS:477:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"BEND:LTUS:477:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "BEND:LTUS:477:OUTOFSERVICE NPP NMS") field(OUT, "BEND:LTUS:477:ONLINE PP") } record(bo, "BEND:LTUS:477:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "BEND:LTUS:477: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, "BEND:LTUS:477: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, "BEND:LTUS:477: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, "BEND:LTUS:477: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, "BEND:LTUS:477: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, "BEND:LTUS:477: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, "BEND:LTUS:477: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, "BEND:LTUS:477: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, "BEND:LTUS:477: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, "BEND:LTUS:477: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, "BEND:LTUS:477: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, "BEND:LTUS:477:TRIMTYPE") } record(stringout, "BEND:LTUS:477:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "BEND:LTUS:476:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "BEND:LTUS:477:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "BEND:LTUS:477:STATE.RVAL") field(INPB, "BEND:LTUS:477:INTLKSUMY.RVAL") field(OUT, "BEND:LTUS:477:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "BEND:LTUS:477: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, "BEND:LTUS:477:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "BEND:LTUS:477:STATE.RVAL") field(INPB, "BEND:LTUS:477:INTLKSUMY.RVAL") field(OUT, "BEND:LTUS:477:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "BEND:LTUS:477:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "BEND:LTUS:477:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "BEND:LTUS:477: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, "BEND:LTUS:477: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, "BEND:LTUS:477: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, "BEND:LTUS:477: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,"BEND:LTUS:477: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("BEND:LTUS:477:TURNEDOFF",3140,1907,0,1,"BEND:LTUS:477:TURNEDOFF") #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "BEND:LTUS:477:STATSUB") { field(DESC, "Build STATus ") field(INAM, "mgntInit") field(SNAM, "mgntSlcStat") field(INPA, "BEND:LTUS:477:BACT.STAT") field(INPB, "BEND:LTUS:477:BDES.STAT") field(INPC, "BEND:LTUS:477: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, "BEND:LTUS:477:BACT.SEVR") field(INPH, "BEND:LTUS:477:BDES.SEVR") field(INPI, "BEND:LTUS:477: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, "BEND:LTUS:477:STATE.RVAL") field(INPN, "BEND:LTUS:477:STDZOK") field(INPO, "BEND:LTUS:477:CALBOK") field(INPP, "BEND:LTUS:477:OUTOFSERVICE.RVAL") field(INPQ, "BEND:LTUS:477:CONFIG.RVAL") field(INPR, "BEND:LTUS:477:HSTA") field(INPS, "BEND:LTUS:477:CTRL.RVAL") field(INPT, "BEND:LTUS:477:DEGAUSOK") field(INPV, "BEND:LTUS:477: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, "BEND:LTUS:477:STAT") } record(longout, "BEND:LTUS:477:STAT") { field(DESC, "STAT sent to SLC") field(SCAN, "Passive") field(FLNK, "BEND:LTUS:477:STATCTRLSUB") field(DOL, "BEND:LTUS:477:STATSUB.VAL") field(OMSL, "closed_loop") } record(sSub, "BEND:LTUS:477:STATCTRLSUB") { field(DESC, "Decode SLC STAT into mbbo") field(INAM, "mgntInit") field(SNAM, "mgntStatDecode") field(INPA, "BEND:LTUS:477:STAT") field(INPB, "BEND:LTUS:477:HSTA") field(INPD, "BEND:LTUS:477:ONOFFCTRL.RVAL") field(FLNK, "BEND:LTUS:477:STATMSG") } record(mbbo, "BEND:LTUS:477: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, "BEND:LTUS:477:UNAVAILGO") field(DOL, "BEND:LTUS:477:STATCTRLSUB.W") } record(seq, "BEND:LTUS:477:UNAVAILGO") { field(DESC, "Process UNAVAIL") field(DOL1, "BEND:LTUS:477:STATSUB.U") field(LNK1, "BEND:LTUS:477:UNAVAIL PP") } record(stringout, "BEND:LTUS:477:SNLSTATMSG") { field(DTYP, "Soft Channel") } #! TextBox(TB0,820,1000,1200,1220,0,"Dialog",12,1,16777215,"BEND:LTUS:477:STATUSSUB - future\nOverall device status - takes input from action snls, record sevrs, master snl(s) and outputs final status\n\nInputs:\nA - BEND:LTUS:477:CTRLSTATUS - snl status\nB - MGNT:CTRLSTATUS - master list status\nC\nD - BEND:LTUS:477: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,"BEND:LTUS:477STATSUB\nformat control bo's into slc STAT\n\nInputs:\nA - BEND:LTUS:477:STATUS\nC - BEND:LTUS:477:ON\nD - BEND:LTUS:477:STDZOK\nE - BEND:LTUS:477:CALBOK\nF - BEND:LTUS:477:BACTDRIFT (future)\nG -\nH- BEND:LTUS:477:DACSTATUS\nI -BEND:LTUS:477:ADCSTATUS\nJ - BEND:LTUS:477:BACTSTATUS\nK - BEND:LTUS:477:BDESSTATUS\nL - BEND:LTUS:477:RIPLSTATUS\n\nOutput:\nP - BEND:LTUS:477: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, "BEND:LTUS:477: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, "BEND:LTUS:477: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, "BEND:LTUS:477: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, "BEND:LTUS:477: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, "BEND:LTUS:477:IDESTOTAL"){ field(DESC, "Calc total current") field(CALC, "A+B") field(EGU, "kG-m") field(PREC, "7") field(INPA, "BEND:LTUS:476:IDES CP NMS") field(INPB, "BTRM:LTUS:477:BDES CP NMS") field(OUT, "BEND:LTUS:477:IDES2BDES.E PP") } record(sub, "BEND:LTUS:477:IDES2BDES") { field(DESC, "Cal BDES") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "BEND:LTUS:477:IDES2BDES") field(INPB, "BEND:LTUS:477:POLYCOEF") field(INPC, "BEND:LTUS:477:POLYCOEF.A") field(INPD, "BEND:LTUS:477:POLYCOEF.B") field(INPE, "BEND:LTUS:477:IDESTOTAL MS") field(INPF, "BEND:LTUS:476:BDELTAS PP") field(INPG, "100") field(EGU, "kG-m") field(HOPR, "4.5191") field(LOPR, "0.0149") field(HIHI, "4.5191") field(LOLO, "0.0149") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "4.5191") field(LOW, "0.0149") field(FLNK, "BEND:LTUS:477: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, "BEND:LTUS:477:IACTCALC"){ field(DESC, "Calc total act current") field(CALC, "A+B") field(EGU, "kG-m") field(PREC, "7") field(INPA, "BEND:LTUS:477:IACT CP NMS") field(INPB, "BTRM:LTUS:477:BACT") field(OUT, "BEND:LTUS:477: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, "BEND:LTUS:477:IMONCALC"){ field(DESC, "Calc total mon current") field(CALC, "A+B") field(EGU, "kG-m") field(PREC, "7") field(INPA, "BEND:LTUS:477:IMON CP NMS") field(INPB, "BTRM:LTUS:477:BMON") field(OUT, "BEND:LTUS:477: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, "BEND:LTUS:477:ICONTOTAL"){ field(DESC, "Calc total current") field(CALC, "A+B") field(EGU, "kG-m") field(PREC, "7") field(INPA, "BEND:LTUS:476:ICON CP NMS") field(INPB, "BTRM:LTUS:477:BCON CP NMS") field(OUT, "BEND:LTUS:477:ICON2BCON.E PP") } record(sub, "BEND:LTUS:477:ICON2BCON") { field(DESC, "Cal BCON") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "BEND:LTUS:477:ICON2BCON") field(INPB, "BEND:LTUS:477:POLYCOEF") field(INPC, "BEND:LTUS:477:POLYCOEF.A") field(INPD, "BEND:LTUS:477:POLYCOEF.B") field(INPE, "BEND:LTUS:477:ICONTOTAL MS") field(INPF, "BEND:LTUS:476:BDELTAS PP") field(INPG, "100") field(EGU, "kG-m") field(HOPR, "4.5191") field(LOPR, "0.0149") field(HIHI, "4.5191") field(LOLO, "0.0149") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "4.5191") field(LOW, "0.0149") field(FLNK, "BEND:LTUS:477:BCON") } #! 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, "BEND:LTUS:478:IACT") { field(DESC, "Current") field(INP, "BEND:LTUS:476:IACT CP NMS") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "BEND:LTUS:478:IACTCALC") info(autosaveFields,"HYST") } record(bi, "BEND:LTUS:478:STATE") { field(DESC, "PS On/Off Status") field(DTYP, "Raw Soft Channel") field(INP, "BEND:LTUS:476:STATE CP MS") field(ZSV, "MAJOR") field(ZNAM, "OFF") field(ONAM, "ON") } record(ao, "BEND:LTUS:478:IDES") { field(DESC, "Desired Current") field(PREC, "3") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(MDEL, "-1") field(HIHI, "250.0") field(LOLO, "0.0") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "BEND:LTUS:478:BDELTAS") field(DRVH, "250.0") field(DRVL, "0.0") field(DOL, "BEND:LTUS:478: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, "BEND:LTUS:478:ICTRL PP") } # This record is processed by BEND:LTUS:478:ICON") # Note: we are not setting alarms here. record(ao, "BEND:LTUS:478:ICON") { field(DESC, "Config I") field(DTYP, "Soft Channel") field(PREC, "3") field(HOPR, "250.0") field(LOPR, "0.0") field(DRVH, "250.0") field(DRVL, "0.0") field(DOL, "BEND:LTUS:478:B2ICON.K") field(OMSL, "closed_loop") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:478:INOM") { field(DESC, "Nominal Current") field(DOL, "BEND:LTUS:478:BNOM.K") field(OMSL, "closed_loop") field(PREC, "3") field(EGU, "A") field(DRVH, "250.0") field(DRVL, "0.0") field(HOPR, "250.0") field(LOPR, "0.0") } record(ao, "BEND:LTUS:478:ICTRL") { field(DESC, "Set Current") field(PREC, "3") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(DRVH, "250.0") field(DRVL, "0.0") field(MDEL, "-1") field(FLNK, "BEND:LTUS:478:ICTRLGO") field(OMSL, "supervisory") info(autosavefields,"VAL") } record(seq, "BEND:LTUS:478:ICTRLGO") { field(DESC, "Process Current Setpoint") field(PREC, "3") # Set ISETPT to supervisory field(DOL1, "0") field(LNK1, "BEND:LTUS:478:ISETPT.OMSL") field(DOL2, "BEND:LTUS:478:ICTRL") field(LNK2, "BEND:LTUS:478:ISETPT PP") # Set ISETPT to closed loop - get data from BCTRLSUB.K field(DOL3, "1") field(LNK3, "BEND:LTUS:478:ISETPT.OMSL") } record(ao, "BEND:LTUS:478:IMAX") { field(DESC, "Max I") field(DTYP, "Soft Channel") field(DRVH, "250.0") field(DRVL, "0.0") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(PREC, "3") field(PINI, "YES") field(VAL, "250.0") field(FLNK, "BEND:LTUS:478:IMIN") } record(ao, "BEND:LTUS:478:IMIN") { field(DESC, "Min I") field(DTYP, "Soft Channel") field(DRVH, "250.0") field(DRVL, "0.0") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(PREC, "3") field(VAL, "0.0") field(FLNK, "BEND:LTUS:478:IRANGE") } record(sel, "BEND:LTUS:478:IACTPREVOK") { field(DESC, "Last Good Current") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(PREC, "3") field(NVL, "BEND:LTUS:478:BACT.SEVR") field(INPA, "BEND:LTUS:478:IACT NPP MS") field(INPB, "BEND:LTUS:478:IACTPREVOK NPP MS") field(INPC, "BEND:LTUS:478:IACTPREVOK NPP MS") field(INPD, "BEND:LTUS:478:IACTPREVOK NPP MS") } record(sub, "BEND:LTUS:478:IACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "BEND:LTUS:478:IDES") field(INPB, "BEND:LTUS:478:ISETPT.DRVH") field(INPC, "BEND:LTUS:478:ISETPT.DRVL") field(INPD, "BEND:LTUS:478:IDELTAS.I") field(INPE, "BEND:LTUS:478:IDELTAS.J") field(INPG, "BEND:LTUS:478:STATE") field(INPH, "BEND:LTUS:478:HSTA") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(sub, "BEND:LTUS:478:IMONLIMITS") { field(DESC, "Aux Current Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "BEND:LTUS:478:IDES") field(INPB, "BEND:LTUS:478:ISETPT.DRVH") field(INPC, "BEND:LTUS:478:ISETPT.DRVL") field(INPD, "BEND:LTUS:478:IDELTAS.K") field(INPE, "BEND:LTUS:478:IDELTAS.L") field(INPG, "BEND:LTUS:478:STATE") field(INPH, "BEND:LTUS:478:HSTA") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(seq, "BEND:LTUS:478:ILIMITS") { field(DESC, "Set ACT and MON Limits") field(PREC, "3") field(DOL1, "BEND:LTUS:478:BLIMITS") field(LNK1, "BEND:LTUS:478:IACTLIMITS.F PP") field(DOL2, "BEND:LTUS:478:IACTLIMITS.I") field(LNK2, "BEND:LTUS:478:IACT.HIGH") field(DOL3, "BEND:LTUS:478:IACTLIMITS.J") field(LNK3, "BEND:LTUS:478:IACT.LOW") field(DOL4, "BEND:LTUS:478:IACTLIMITS.K") field(LNK4, "BEND:LTUS:478:IACT.HIHI") field(DOL5, "BEND:LTUS:478:IACTLIMITS.L") field(LNK5, "BEND:LTUS:478:IACT.LOLO") field(DOL6, "BEND:LTUS:478:BLIMITS") field(LNK6, "BEND:LTUS:478:IMONLIMITS.F PP") field(DOL7, "BEND:LTUS:478:IMONLIMITS.I") field(LNK7, "BEND:LTUS:478:IMON.HIGH") field(DOL8, "BEND:LTUS:478:IMONLIMITS.J") field(LNK8, "BEND:LTUS:478:IMON.LOW") field(DOL9, "BEND:LTUS:478:IMONLIMITS.K") field(LNK9, "BEND:LTUS:478:IMON.HIHI") field(DOLA, "BEND:LTUS:478:IMONLIMITS.L") field(LNKA, "BEND:LTUS:478: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, "BEND:LTUS:478:IDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntRawDeltas") field(INPD, "BEND:LTUS:478:TRIMBTOL") field(INPE, "BEND:LTUS:478:CHCKBTOL") field(INPF, "BEND:LTUS:478:BDELTAS.K") field(INPG, "BEND:LTUS:478:BDELTAS.L") field(INPH, "BEND:LTUS:478: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, "BEND:LTUS:478:STDZITOLR") field(INPC, "BEND:LTUS:478:STDZITOL") field(FLNK, "") } # All ps controllers with on/off control will set the macro ONOF # as follows: # # ONOF = BEND:LTUS:476: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, "BEND:LTUS:478: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 = BEND:LTUS:476:RESET PP # record(bo, "BEND:LTUS:478: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, "BEND:LTUS:478:RAMPSTATE") { field(DESC, "PS Ramp Status") field(DTYP, "Soft Channel") field(DOL, "BEND:LTUS:476: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, "BEND:LTUS:478: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, "BEND:LTUS:478:TRIMRAMPRATE") field(OUT, "") field(FLNK, "BEND:LTUS:478:STDZDLY") } record(ao, "BEND:LTUS:478:ISETPT") { field(DESC, "Current Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(DRVH, "250.0") field(DRVL, "0.0") field(MDEL, "-1") field(OUT, "") field(DOL, "BEND:LTUS:478: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, "BEND:LTUS:478:IMON") { field(DESC, "Aux Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(INP, "BEND:LTUS:476:IMON CP NMS") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "BEND:LTUS:478:IMONCALC") } record(ao, "BEND:LTUS:478:IRIPL") { field(DESC, "Ripple Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(DOL, "BEND:LTUS:476:IRIPL CP NMS") field(OMSL, "closed_loop") field(EGU, "A") field(DRVH, "1.0") field(HOPR, "1.0") field(PREC, "3") field(FLNK, "BEND:LTUS:478:IRIPLOK") } record(sub, "BEND:LTUS:478:IRIPLOK") { field(DESC, "Ripple Current Status") field(INAM, "mgntInit") field(SNAM, "mgntRiplOK") field(INPA, "BEND:LTUS:478:IRIPL.VAL") field(INPB, "BEND:LTUS:478: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, "BEND:LTUS:478:R") { field(DESC, "Resistance") field(EGU, "Ohms") field(PREC, "4") field(PINI, "YES") field(DOL, "BEND:LTUS:476: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, "BEND:LTUS:478:IGND") { field(DESC, "Ground Current") field(EGU, "A") field(PREC, "6") field(PINI, "YES") field(DOL, "BEND:LTUS:476:IGND CP MS") field(OMSL, "closed_loop") } record(bi, "BEND:LTUS:478:INTLKSUMY") { field(DESC, "Interlock Summary") field(INP, "BEND:LTUS:476:INTLKSUMY CP MS") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(ZNAM, "OK") field(ONAM, "FAULT") field(PINI, "NO") } record(mbbo, "BEND:LTUS:478: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, "BEND:LTUS:476:COOLING CP NMS") field(OMSL, "closed_loop") } # The following PV is processed by :BACTFO # which is processed by :BACT record(fanout, "BEND:LTUS:478:IACTFO") { field(DESC, "IACT processing") field(SELM, "All") field(LNK1, "BEND:LTUS:478:IACTPREVOK") field(LNK2, "BEND:LTUS:478:IDIFF") field(LNK3, "BEND:LTUS:478:IADIFF") field(LNK4, "BEND:LTUS:478:IRATIO") field(LNK5, "BEND:LTUS:478:IDIRECT") field(LNK6, "BEND:LTUS:478:IACTPOL_CHECK") } record(calc, "BEND:LTUS:478:IDIFF") { field(DESC, "IDES-IACT") field(CALC, "A-B") field(INPA, "BEND:LTUS:478:IDES") field(INPB, "BEND:LTUS:478:IACT") field(EGU, "A") field(PREC, "9") field(HOPR, "250.0") field(LOPR, "0.0") } record(calc, "BEND:LTUS:478:IADIFF") { field(DESC, "Absolute IDES-IACT") field(CALC, "A<0?ABS(A):A") field(INPA, "BEND:LTUS:478:IDIFF") field(PREC, "9") } record(calc, "BEND:LTUS:478:IRATIO") { field(DESC, "IDES-IACT/IMAX") field(CALC, "B?A/B:0") field(INPA, "BEND:LTUS:478:IDIFF") field(INPB, "BEND:LTUS:478:IDES.DRVH") field(PREC, "9") } record(calcout, "BEND:LTUS:478:IRANGE") { field(DESC, "Current Range") field(PINI, "YES") field(CALC, "ABS(A-B)") field(INPA, "BEND:LTUS:478:IMIN") field(INPB, "BEND:LTUS:478: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, "BEND:LTUS:478: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, "BEND:LTUS:478:IACT") field(FLNK, "BEND:LTUS:478:IACTPOL") } record(bo, "BEND:LTUS:478:IACTPOL") { field(DESC, "Actual I Polarity") field(DTYP, "Raw Soft Channel") field(DOL, "BEND:LTUS:478: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,"BEND:LTUS:478:I*LIMITS:\n Calculate alarm and warning limits based on \n deltas from BEND:LTUS:478:IDELTAS and the\n BEND:LTUS:478: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,"BEND:LTUS:478:IACT: \n Get copy of BEND:LTUS:478:I. \n",null) #! TextBox(TB12,1280,3100,1760,3200,0,"Dialog",12,1,16777215,"BEND:LTUS:478: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,"BEND:LTUS:478:IDES:\n Contains raw value calculated by \nBEND:LTUS:478: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 \nBEND:LTUS:478:BDELTAS.\n",null) #! TextBox(TB10,56,1940,316,2340,0,"Dialog",12,1,16777215,"BEND:LTUS:478: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 BEND:LTUS:478: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 BEND:LTUS:478: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,"BEND:LTUS:478:ISETPT:\n Sets the hardware. When fast feedback is set on, this record is\n set to closed loop mode by BEND:LTUS:478:FBCKSTART sequence. When \n the loop is closed, this record takes input calculated by \n BFBCK only. When fast feedback is set off, BEND:LTUS:478:FBCKSTOP \n will set it back to supervisory so that the value can be set by \n BEND:LTUS:478: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, "BEND:LTUS:478:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:478:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "BEND:LTUS:478:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "BEND:LTUS:478:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "BEND:LTUS:478:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "BEND:LTUS:478:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "1") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "BEND:LTUS:478: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, "BEND:LTUS:478:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "BEND:LTUS:478:TRIMTYPE.RVAL") field(INPB, "BEND:LTUS:478:CONFIG.RVAL") field(OUT, "BEND:LTUS:478:TRIMMAXNUM PP") } record(longout, "BEND:LTUS:478: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, "BEND:LTUS:478: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, "BEND:LTUS:476:TRIMRAMPRATE CP NMS") field(OMSL, "closed_loop") field(VAL, "") field(OUT, "BEND:LTUS:478:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "BEND:LTUS:478: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, "BEND:LTUS:476:TRIMSETL CP NMS") field(OMSL, "closed_loop") field(VAL, "") } record(bo, "BEND:LTUS:478: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, "BEND:LTUS:478: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, "BEND:LTUS:478: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, "BEND:LTUS:478:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "0") } record(ao, "BEND:LTUS:478: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, "BEND:LTUS:478:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "BEND:LTUS:478: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, "BEND:LTUS:478: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, "BEND:LTUS:478:IMOVE") field(INPB, "BEND:LTUS:478:IACT") field(INPC, "BEND:LTUS:478:IRAMPRATE") field(INPD, "1.577") field(INPE, "BEND:LTUS:478:TRIMDLYPCT") field(INPF, "BEND:LTUS:478:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "BEND:LTUS:478:RAMPTIME_LEFT PP") } record(longout, "BEND:LTUS:478:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "BEND:LTUS:478:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "BEND:LTUS:478:RAMPDONE_CALC") } record(calc, "BEND:LTUS:478:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "BEND:LTUS:478:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "BEND:LTUS:478:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "BEND:LTUS:478: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, "BEND:LTUS:478:RAMPTIME_LEFT") field(OUT, "BEND:LTUS:478:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "BEND:LTUS:478:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "BEND:LTUS:478:RAMPTIME_LEFT NMS") field(OUT, "BEND:LTUS:478:RAMPDONE PP") } record(bo, "BEND:LTUS:478:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "BEND:LTUS:478:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "BEND:LTUS:478: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, "BEND:LTUS:478: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, "BEND:LTUS:478:STDZINIT") { field(DESC, "Proc. Stdz PVs on boot") field(PINI, "YES") field(DOL1, "1") field(DOL2, "1") field(DOL3, "1") field(LNK1, "BEND:LTUS:478:DEBUG.PROC PP") field(LNK2, "BEND:LTUS:478:STDZCYCLENUM.PROC PP") field(LNK3, "BEND:LTUS:478:STDZDISABLE.PROC PP") field(LNK4, "BEND:LTUS:478: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, "BEND:LTUS:478:STDZSUB") { field(DESC, "Stdz subroutine") field(INAM, "mgntStdzInit") field(SNAM, "mgntStdz") field(BRSV, "INVALID") field(INPA, "BEND:LTUS:478:STDZIMIN NPP NMS") field(INPB, "BEND:LTUS:478:STDZIMAX NPP NMS") field(INPC, "BEND:LTUS:478:STDZIFINAL NPP NMS") field(INPD, "BEND:LTUS:478:STDZCYCLENUM NPP NMS") field(INPE, "BEND:LTUS:478:STDZDIRECT.RVAL NPP NMS") field(INPF, "BEND:LTUS:478:STDZDISABLE.RVAL CPP NMS") field(INPG, "BEND:LTUS:478: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, "BEND:LTUS:478:STDZWF PP") field(OUTB, "BEND:LTUS:478: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, "BEND:LTUS:478:STDZWF") } record(mbbo, "BEND:LTUS:478: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, "BEND:LTUS:478: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, "BEND:LTUS:478:STDZMAINPS") { field(DESC, "Stdz by main or self") field(PINI, "YES") field(DTYP, "Soft Channel") field(ZNAM, "SELF") field(ONAM, "MAIN") } record(bo, "BEND:LTUS:478: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, "BEND:LTUS:478: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, "BEND:LTUS:478: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, "BEND:LTUS:478:STDZTOD") { field(DESC, "Successful Standardize Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "BEND:LTUS:478:STDZLOSTTOD") { field(DESC, "Standardize Lost Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(longout, "BEND:LTUS:478:STDZCYCLECNT") { field(DESC, "Cycle Count") field(PINI, "YES") } record(longout, "BEND:LTUS:478: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, "BEND:LTUS:478:STDZDIRECT") } # The default standardize direction is "UP" for # all LCLS Magnets.. record(bo, "BEND:LTUS:478:STDZDIRECT") { field(DESC, "Standardize Direction ") field(ZNAM, "UP") field(ONAM, "DOWN") field(VAL, "0") field(FLNK, "BEND:LTUS:478:STDZIMIN") } record(ao, "BEND:LTUS:478:STDZIMIN") { field(DESC, "Min-STDZ Current") field(PREC, "1") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(VAL, "0.0") field(FLNK, "BEND:LTUS:478:STDZIMAX") } record(ao, "BEND:LTUS:478:STDZIMAX") { field(DESC, "Max. Standarize Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(VAL, "250.0") field(FLNK, "BEND:LTUS:478:STDZIFINAL") } record(ao, "BEND:LTUS:478:STDZIFINAL") { field(DESC, "Final SDTZ Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(VAL, "0.0") field(FLNK, "BEND:LTUS:478: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, "BEND:LTUS:478: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, "BEND:LTUS:478:STDZITOL") { field(DESC, "Stdz min tolerance") field(PREC, "5") field(CALC, "MAX(ABS(A),ABS(B))*C") field(INPA, "BEND:LTUS:478:STDZIMIN CP NMS") field(INPB, "BEND:LTUS:478:STDZIMAX CP MMS") field(INPC, "0.05") field(INPD, "BEND:LTUS:478:STDZITOLR CP MMS") field(EGU, "A") field(FLNK, "BEND:LTUS:478:IDELTAS") field(PINI, "YES") } # D - factor (3.154/2 = 1.577) for EPSC, otherwise, set to 1.0 record(calc, "BEND:LTUS:478:STDZDLY") { field(DESC, "Ramp time for stdz cycle") field(CALC, "C>0?MAX(1,ABS((A-B)/C)*D):0") field(INPA, "BEND:LTUS:478:STDZIMIN CP NMS") field(INPB, "BEND:LTUS:478:STDZIMAX CP NMS") field(INPC, "BEND:LTUS:478:TRIMRAMPRATE CP NMS") field(INPD, "1.0") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") } record(calc, "BEND:LTUS:478:STDZRAMPDLY") { field(DESC, "Ramp delay total") field(CALC, "MAX(1,((A/100)*B+B))") field(PREC, "5") field(INPA, "BEND:LTUS:478:TRIMDLYPCT CP MS") field(INPB, "BEND:LTUS:478: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, "BEND:LTUS:478:STDZMINIDLY") { field(DESC, "Mini-stdz delay") field(CALC, "A") field(PREC, "5") field(A, "1.0") field(EGU, "sec") field(PINI, "YES") } record(ao, "BEND:LTUS:478: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, "BEND:LTUS:478:STDZMINIDELTA") { field(DESC, "Stdz mini % of IMAX") field(CALC, "(B/100)*(A-C)") field(INPA, "BEND:LTUS:478:IDES.HOPR") field(INPB, "BEND:LTUS:478:STDZMINIPCT CPP NMS") field(INPC, "BEND:LTUS:478:IDES.LOPR") field(PREC, "5") } record(calc, "BEND:LTUS:478:STDZMINISETPT") { field(DESC, "Mini Stdz delta") field(CALC, "C==0?MAX(E-D,B):MIN(E+D,A)") field(INPA, "BEND:LTUS:478:IDES.HOPR") field(INPB, "BEND:LTUS:478:IDES.LOPR") field(INPC, "BEND:LTUS:478:STDZDIRECT.RVAL") field(INPD, "BEND:LTUS:478:STDZMINIDELTA") field(INPE, "BEND:LTUS:478:IDES") field(PREC, "5") field(FLNK, "BEND:LTUS:478: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, "BEND:LTUS:478:STDZMINISETPTOOR") { field(DESC, "Mini Stdz setpoint out of range") field(CALC, "C==0?(E-DA)") field(INPA, "BEND:LTUS:478:IDES.HOPR") field(INPB, "BEND:LTUS:478:IDES.LOPR") field(INPC, "BEND:LTUS:478:STDZDIRECT.RVAL") field(INPD, "BEND:LTUS:478:STDZMINIDELTA") field(INPE, "BEND:LTUS:478: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, "BEND:LTUS:478: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, "BEND:LTUS:478:IADJUST.RVAL") field(INPB, "BEND:LTUS:478:STDZDIRECT.RVAL") field(INPC, "BEND:LTUS:478:STDZOK.RVAL") field(INPD, "BEND:LTUS:478:STDZDISABLE.RVAL") field(INPE, "BEND:LTUS:478:STATE.RVAL CPP NMS") field(INPF, "BEND:LTUS:478:ICTRL.RVAL") field(INPG, "BEND:LTUS:478:STATE.SEVR") field(INPH, "BEND:LTUS:478:BDELTAS.M") field(INPI, "BEND:LTUS:478:IACT.SEVR") field(OUT, "BEND:LTUS:478:STDZLOSTGO.SELN PP NMS") field(OOPT, "Transition To Non-zero") } record(seq, "BEND:LTUS:478:STDZLOSTGO") { field(DESC, "Process lost stdz") field(SELM, "Mask") field(DOL1, "1") field(DOL2, "0") field(LNK1, "BEND:LTUS:478:STDZLOSTTOD.PROC") field(LNK2, "BEND:LTUS:478:STDZOK PP") } # Record maximum current after standardize # Reset to IACT from sequence after trim # Disable processing during (mini-)standardize or trim record(calc, "BEND:LTUS:478:STDZIACTMAX") { field(DESC, "Max act current after stdz") field(CALC, "MAX(A, B)") field(DISV, "0") field(SDIS, "BEND:LTUS:478:CHECKPWRDIP_ENABLE") field(INPA, "BEND:LTUS:478:IACT CP") field(INPB, "BEND:LTUS:478:STDZIACTMAX") field(EGU, "A") field(FLNK, "BEND:LTUS:478:CHECKPWRDIP") } # Detect power dip if STDZOK is YES, STDZ is enabled, and IACT is valid # If IACT drops below STDZIACTMAX by more than the trim tolerance, clear STDZOK # Warning: Take the absolute value of the trim tolerance, or else quads of # negative polarity will always lose STDZ since their IDELTAS.I are negative. # Note: Large quads and bends are prone to losing STDZ even if they are # perturbed toward higher current since their current tends to overshoot # by greater than the trim tolerance before settling down. record(calcout, "BEND:LTUS:478:CHECKPWRDIP") { field(DESC, "Detect power dip") field(CALC, "(A-B>ABS(C))?3:0") field(DISV, "0") field(SDIS, "BEND:LTUS:478:CHECKPWRDIP_ENABLE") field(INPA, "BEND:LTUS:478:STDZIACTMAX") field(INPB, "BEND:LTUS:478:IACT") field(INPC, "BEND:LTUS:478:IDELTAS.I") field(OUT, "BEND:LTUS:478:STDZLOSTGO.SELN PP NMS") field(OOPT, "When Non-zero") } # Enable processing of STDZIACTMAX and CHECKPWRDIP only if # STDZOK = YES, STDZDISABLE = NO, CTRL != Trim (2), and # CTRL != Stdz (4) record(calc, "BEND:LTUS:478:CHECKPWRDIP_ENABLE") { field(CALC, "A&&!B&&(C#2)&&(C#4)") field(INPA, "BEND:LTUS:478:STDZOK.RVAL CP") field(INPB, "BEND:LTUS:478:STDZDISABLE.RVAL CP") field(INPC, "BEND:LTUS:478:CTRL.RVAL CP") } #! 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, "BEND:LTUS:478: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, "BEND:LTUS:478: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, "BEND:LTUS:478:CALBSET") { field(DESC, "Use DAC Calbration") field(SCAN, "10 second") field(CALC, "A&&(B==0)&&C?31:960") field(INPA, "BEND:LTUS:478:CALBOK") field(INPB, "BEND:LTUS:478:CALBDISABLE") field(INPC, "BEND:LTUS:478:CALBSLOPE") field(OOPT, "On Change") field(OUT, "BEND:LTUS:478: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, "BEND:LTUS:478:CALB_SEQ") { field(DESC, "Output Calib Values") field(SELM, "Mask") field(SELL, "BEND:LTUS:478: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, "BEND:LTUS:478:CALBSLOPE") field(DOL3, "BEND:LTUS:478: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, "BEND:LTUS:478:CALBTOD") { field(DESC, "Calibration Success Time") field(PINI, "YES") # field(DOL, "") field(OMSL, "supervisory") field(DTYP, "Soft Channel") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:478: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, "BEND:LTUS:478: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, "BEND:LTUS:478: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, "BEND:LTUS:478:CALBOFFSET") { field(DESC, "Calc DAC Offset") field(PREC, "6") field(EGU, "Counts") field(PINI, "YES") } record(bo, "BEND:LTUS:478: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, "BEND:LTUS:478:DACSLOPE") { field(DESC, "V to DAC slope") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "supervisory") field(PINI, "YES") field(FLNK, "BEND:LTUS:478:DACOFFSET") } # Default Offset used in conversion from Volts to DAC Counts record(ao, "BEND:LTUS:478:DACOFFSET") { field(DESC, "V to DAC offset") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "supervisory") field(PINI, "YES") field(FLNK, "BEND:LTUS:478: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, "BEND:LTUS:478: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, "BEND:LTUS:478:IACT") field(INPD, "BEND:LTUS:478:DACSLOPE") field(INPE, "BEND:LTUS:478:DACOFFSET") field(EGU, "Counts") field(PREC, "6") } record(ao, "BEND:LTUS:478:DAC") { field(DESC, "DAC Set point") field(EGU, "Counts") field(DOL, "") field(OMSL, "supervisory") field(PREC, "6") field(PINI, "YES") } record(ao, "BEND:LTUS:478:CALBIMIN") { field(DESC, "Calibration Min Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(DRVH, "250.0") field(HOPR, "250.0") field(DRVL, "0.0") field(LOPR, "0.0") field(PREC, "3") field(EGU, "A") field(VAL, "0.0") field(FLNK, "BEND:LTUS:478:CALBIMAX") } record(ao, "BEND:LTUS:478:CALBIMAX") { field(DESC, "Calibration Max Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(DRVH, "250.0") field(HOPR, "250.0") field(LOPR, "0.0") field(DRVL, "0.0") field(EGU, "A") field(VAL, "250.0") field(FLNK, "BEND:LTUS:478:CALBSTEPNUM") } record(ao, "BEND:LTUS:478:CALBIFINAL") { field(DESC, "Calibration Last Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(PREC, "3") field(EGU, "A") field(HOPR, "250.0") field(LOPR, "0.0") field(VAL, "0") } record(longout, "BEND:LTUS:478: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, "BEND:LTUS:478:CALBIDELTA") } record(calc, "BEND:LTUS:478:CALBIDELTA") { field(DESC, "Step size for CALB") field(CALC, "C=0?0:ABS((A-B)/C)") field(INPA, "BEND:LTUS:478:CALBIMAX") field(INPB, "BEND:LTUS:478:CALBIMIN") field(INPC, "BEND:LTUS:478: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, "BEND:LTUS:478:CALBIMULT") { field(DESC, "IACT vs ISETPT mult") field(CALC, "C#0||A=0?1:ABS(B/A)") field(INPA, "BEND:LTUS:476:ISETPT.DRVH") field(INPB, "BEND:LTUS:476:IACT.HOPR") field(INPC, "BEND:LTUS:478:PSCONTROLLER.RVAL CPP") field(EGU, "A") field(PINI, "YES") } # SNL dbputs DAC values here. 6-10 steps are possible. record(waveform, "BEND:LTUS:478:CALBICTRLWF") { field(DESC, "ICTRL setpoint array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") } record(waveform, "BEND:LTUS:478:DACWF") { field(DESC, "DAC count array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "BEND:LTUS:478:DACSA") } # Used only for xygraph edm plot record(subArray, "BEND:LTUS:478:DACSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "BEND:LTUS:478: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, "BEND:LTUS:478:CALCDACWF") { field(DESC, "Calc DAC counts array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "BEND:LTUS:478:CALCDACSA") } # Used only for xygraph edm plot record(subArray, "BEND:LTUS:478:CALCDACSA") { field(DESC, "Calc DAC counts") field(DTYP, "Soft Channel") field(INP, "BEND:LTUS:478: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, "BEND:LTUS:478:CALBYWF") { field(DESC, "mx + b") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "BEND:LTUS:478:CALBYSA") } # Used only for xygraph edm plot record(subArray, "BEND:LTUS:478:CALBYSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "BEND:LTUS:478:CALBYWF") field(MALM, "10") field(NELM, "6") field(INDX, "0") field(FTVL, "DOUBLE") } record(waveform, "BEND:LTUS:478:CALBIACTWF") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "BEND:LTUS:478:CALBIACTSA") } # Used only for xygraph edm plot record(subArray, "BEND:LTUS:478:CALBIACTSA") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(MALM, "10") field(NELM, "6") field(INP, "BEND:LTUS:478:CALBIACTWF") field(INDX, "0") field(FTVL, "DOUBLE") field(FLNK, "BEND:LTUS:478:CALBLIMITS") } # Check that measured current during calibration is within # tolerance. record(aSub, "BEND:LTUS:478: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, "BEND:LTUS:478:CALBSTEPNUM") field(INPB, "BEND:LTUS:478:CALBIACTWF") field(INPC, "BEND:LTUS:478: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, "BEND:LTUS:478: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, "BEND:LTUS:478:STDZITOL") field(INPH, "BEND:LTUS:478:DACSLOPE") field(INPI, "BEND:LTUS:478: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, "BEND:LTUS:478: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, "BEND:LTUS:478:CALBSTEPNUM") field(INPB, "BEND:LTUS:478:CALBIACTWF") field(INPC, "BEND:LTUS:478:DACWF") field(INPF, "BEND:LTUS:478: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 BEND:LTUS:478CALBOK 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, "BEND:LTUS:478:DEGAUSINIT") { field(DESC, "Proc. Degauss PVs on boot") field(PINI, "YES") field(DOL, "1") field(OUTA, "BEND:LTUS:478:DEGAUSIMIN.PROC PP") field(OUTB, "BEND:LTUS:478:DEGAUSIMAX.PROC PP") field(OUTC, "BEND:LTUS:478:DEGAUSTYPE.PROC PP") field(OUTD, "BEND:LTUS:478:DEGAUSSTEP.PROC PP") field(OUTE, "BEND:LTUS:478:MADNAME.PROC PP") field(OUTF, "BEND:LTUS:478:PSTYPE.PROC PP") field(OUTG, "BEND:LTUS:478: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, "BEND:LTUS:478:DEGAUSSUB") { field(DESC, "Degauss subroutine") field(INAM, "mgntDegaussInit") field(SNAM, "mgntDegauss") field(BRSV, "INVALID") field(INPA, "BEND:LTUS:478:DEGAUSIMIN NPP NMS") field(INPB, "BEND:LTUS:478:DEGAUSIMAX NPP NMS") field(INPC, "BEND:LTUS:478:DEGAUSTYPE.RVAL NPP NMS") field(INPE, "BEND:LTUS:478:DEGAUSMETHOD.RVAL NPP NMS") field(INPF, "BEND:LTUS:478:PSTYPE NPP NMS") field(INPG, "BEND:LTUS:478:DEBUG.RVAL NPP NMS") field(INPH, "BEND:LTUS:478: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, "BEND:LTUS:478:DEGAUSWF PP") field(OUTB, "BEND:LTUS:478:DEGAUSMSG PP") field(OUTC, "BEND:LTUS:478: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, "BEND:LTUS:478:DEGAUSWF") { field(DESC, "Degauss Setpts") field(NELM, "60") field(FTVL, "DOUBLE") } record(mbbo,"BEND:LTUS:478: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, "BEND:LTUS:478: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, "BEND:LTUS:478: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, "BEND:LTUS:478: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, "BEND:LTUS:478: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, "BEND:LTUS:478:DEGAUSIMIN") { field(DESC, "Min. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "250.0") field(LOPR, "-250.0") field(DRVH, "250.0") field(DRVL, "-250.0") field(VAL, "-250.0") } record(ao, "BEND:LTUS:478:DEGAUSIMAX") { field(DESC, "Max. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "250.0") field(LOPR, "-250.0") field(DRVH, "250.0") field(DRVL, "-250.0") field(VAL, "250.0") } # 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,"BEND:LTUS:478: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, "BEND:LTUS:478: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,"BEND:LTUS:478: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, "BEND:LTUS:478: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, "BEND:LTUS:478: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, "BEND:LTUS:478: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, "BEND:LTUS:478:DEGAUSTOD") { field(DESC, "Successful Degauss Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "BEND:LTUS:478:DEGAUSLOSTTOD") { field(DESC, "Degauss Lost Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:478:DEGAUSTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "BEND:LTUS:478:DEGAUSTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "BEND:LTUS:478: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, "BEND:LTUS:478:DEGAUSGO") { field(DESC, "Set bdes of btrms to zero") field(ASG, "Internal") field(OUTA, "") field(OUTB, "") field(OUTC, "") field(OUTD, "") } # =========== CRYO ONLY =========== record(bo, "BEND:LTUS:478: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, "BEND:LTUS:478:DEGAUS_IMAX_CHECK") { field(DESC, "Check if imax shoud chg") field(CALC, "(C==4)&&(ABS(B)>ABS(A))?1:0") field(INPA, "BEND:LTUS:478:DEGAUS_IMAX") field(INPB, "BEND:LTUS:478:ISETPT") field(INPC, "BEND:LTUS:478:DEGAUSTYPE.RVAL") field(OUT, "BEND:LTUS:478:DEGAUS_IMAX_UPDATE.SELN") field(FLNK, "BEND:LTUS:478:DEGAUS_IMAX_UPDATE") } record(seq, "BEND:LTUS:478:DEGAUS_IMAX_UPDATE") { field(DESC, "Degauss IMAX Update") field(SELM, "Specified") field(DOL1, "BEND:LTUS:478:ISETPT") field(LNK1, "BEND:LTUS:478:DEGAUS_IMAX PP") } # Set the maximum current after a successful # degauss. This pv is updated by the # sequence. record(ao, "BEND:LTUS:478:DEGAUS_IMAX") { field(DESC, "Max I set afer a degauss") field(EGU, "Amps") field(PINI, "YES") field(PREC, "6") field(HOPR, "250.0") field(LOPR, "-250.0") field(DRVH, "250.0") field(DRVL, "-250.0") field(VAL, "250.0") field(FLNK, "BEND:LTUS:478:DEGAUS_IMAXPOL_CHECK") info(autosaveFields,"VAL,RVAL") } # Set the polarity if degauss_imax record(calcout, "BEND:LTUS:478:DEGAUS_IMAXPOL_CHECK") { field(DESC, "Determine polarity of imax") field(CALC, "A>=0?0:1") field(INPA, "BEND:LTUS:478:DEGAUS_IMAX") field(FLNK, "BEND:LTUS:478:DEGAUS_IMAXPOL") } record(bo, "BEND:LTUS:478:DEGAUS_IMAXPOL") { field(DESC, "Polarity of imax I") field(DTYP, "Raw Soft Channel") field(DOL, "BEND:LTUS:478:DEGAUS_IMAXPOL_CHECK") field(OMSL, "closed_loop") field(ZNAM, "Positive") field(ONAM, "Negative") field(FLNK, "BEND:LTUS:478: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, "BEND:LTUS:478:DEGAUS_ABSIMAX") { field(DESC, "Absolute Max. Degauss I") field(CALC, "ABS(A)") field(INPA, "BEND:LTUS:478:DEGAUS_IMAX") field(PREC, "6") field(EGU, "Amps") field(HOPR, "250.0") field(LOPR, "-250.0") info(autosaveFields,"VAL RVAL") } # IACT Polarity record(calcout, "BEND:LTUS:478:IACTPOL_CHECK") { field(DESC, "Determine IACT polarity") field(SCAN, "5 second") field(CALC, "ABS(A-B)>C?(A>=0?0:1):D") field(INPA, "BEND:LTUS:478:IACT") field(INPB, "BEND:LTUS:478:IACTPOL_CHECK.LA") field(INPC, "0.0001") field(INPD, "BEND:LTUS:478:IACTPOL_CHECK.PVAL") field(OOPT, "On Change") field(FLNK, "BEND:LTUS:478:IACTPOL") } record(bo, "BEND:LTUS:478: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,"BEND:LTUS:478: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, "BEND:LTUS:478:DEGAUSENABLE CP") field(INPB, "BEND:LTUS:478:DEGAUSOK") field(INPC, "BEND:LTUS:478:STATE CP") field(INPD, "BEND:LTUS:478:STATE.SEVR") field(OUT, "BEND:LTUS:478:DEGAUS_STATE_SEQ.SELN PP") field(ASG, "Internal") } record(seq, "BEND:LTUS:478:DEGAUS_STATE_SEQ") { field(DESC, "Degauss State Sequence") field(SELM, "Specified") field(SELL, "BEND:LTUS:478:DEGAUS_STATE_CHECK") field(LNK1, "BEND:LTUS:478:DEGAUS_STATE_DISABLE.PROC PP") field(LNK2, "BEND:LTUS:478:DEGAUS_STATE_LOST.PROC PP") field(LNK3, "BEND:LTUS:478:DEGAUS_STATE_GOOD.PROC PP") field(LNK4, "BEND:LTUS:478: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, "BEND:LTUS:478:DEGAUS_STATE_DISABLE") { field(DESC, "Degauss not used") field(LNK1, "BEND:LTUS:478:DEGAUSOK.ZSV") field(LNK2, "BEND:LTUS:478: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, "BEND:LTUS:478:STATMSG.FRSV") field(LNK4, "BEND:LTUS:478: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, "BEND:LTUS:478:DEGAUS_STATE_LOST") { field(DESC, "Degauss lost and ps On") field(DOL1, "1") field(LNK1, "BEND:LTUS:478:DEGAUSOK.ZSV") field(LNK2, "BEND:LTUS:478: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, "BEND:LTUS:478:STATMSG.FRSV") field(LNK4, "BEND:LTUS:478: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, "BEND:LTUS:478:DEGAUS_STATE_OFF") { field(DESC, "Degaused lost and ps Off") field(DOL1, "2") field(LNK1, "BEND:LTUS:478: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, "BEND:LTUS:478:STATMSG.FRSV") field(LNK3, "BEND:LTUS:478: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, "BEND:LTUS:478:DEGAUS_STATE_GOOD") { field(DESC, "Degauss good") field(DOL1, "1") field(LNK1, "BEND:LTUS:478: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, "BEND:LTUS:478:STATMSG.FRSV PP") field(LNK3, "BEND:LTUS:478:STATMSG.FVSV PP") field(LNK4, "") field(ASG, "Internal") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(mbbo, "BEND:LTUS:478:FUNC") { field(DESC, "BEND:LTUS:478 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, "0") field(FFVL, "0") field(OUT, "BEND:LTUS:478:CTRL CA") } # :CTRL pv is processed at boot in the # sequence mgntCtrl.st Processed in sequence # record(mbbo, "BEND:LTUS:478:CTRL") { field(DESC, "BEND:LTUS:478 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, "BEND:LTUS:478:SELECTEN.A PP") field(SDIS, "0") } # If a function has been selected set this unit to busy record(calcout, "BEND:LTUS:478:SELECTEN") { field(DESC, "Control Select Enable") field(CALC, "A>0?1:A") field(FLNK, "BEND:LTUS:478:BUSY") } # Set to FREE on IOC reboot record(bo, "BEND:LTUS:478:BUSY") { field(DESC, "BEND:LTUS:478 Ctrl Done") field(DOL, "BEND:LTUS:478:SELECTEN") field(ZNAM, "FREE") field(ONAM, "BUSY") field(PINI, "YES") field(FLNK, "BEND:LTUS:478:SELECT") } record(bo, "BEND:LTUS:478:SELECT") { field(ZNAM, "NO") field(ONAM, "YES") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") } record(bo, "BEND:LTUS:478: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, "BEND:LTUS:478:CTRLSTATE") { field(DESC, "BEND:LTUS:478 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("BEND:LTUS:478:CTRL",20,20,0,0,"BEND:LTUS:478:CTRL") #! Field("BEND:LTUS:478:CTRL.OUT",16777215,1,"BEND:LTUS:478:CTRL.OUT") #! Link("BEND:LTUS:478:CTRL.OUT","BEND:LTUS:478:SELECTEN.A") #! Field("BEND:LTUS:478:CTRL.VAL",16777215,1,"BEND:LTUS:478:CTRL.VAL") #! Record("BEND:LTUS:478:SELECTEN",321,381,0,0,"BEND:LTUS:478:SELECTEN") #! Field("BEND:LTUS:478:SELECTEN.A",16777215,0,"BEND:LTUS:478:SELECTEN.A") #! Field("BEND:LTUS:478:SELECTEN.FLNK",16777215,1,"BEND:LTUS:478:SELECTEN.FLNK") #! Link("BEND:LTUS:478:SELECTEN.FLNK","BEND:LTUS:478:BUSY") #! Field("BEND:LTUS:478:SELECTEN.VAL",16777215,1,"BEND:LTUS:478:SELECTEN.VAL") #! Record("BEND:LTUS:478:BUSY",623,274,0,0,"BEND:LTUS:478:BUSY") #! Field("BEND:LTUS:478:BUSY.DOL",16777215,0,"BEND:LTUS:478:BUSY.DOL") #! Link("BEND:LTUS:478:BUSY.DOL","BEND:LTUS:478:SELECTEN.VAL") #! Field("BEND:LTUS:478:BUSY.FLNK",16777215,1,"BEND:LTUS:478:BUSY.FLNK") #! Link("BEND:LTUS:478:BUSY.FLNK","BEND:LTUS:478:SELECT") #! Record("BEND:LTUS:478:SELECT",669,508,0,1,"BEND:LTUS:478:SELECT") #! Record("BEND:LTUS:478:FUNC",940,120,0,0,"BEND:LTUS:478:FUNC") #! Field("BEND:LTUS:478:FUNC.OUT",16777215,0,"BEND:LTUS:478:FUNC.OUT") #! Link("BEND:LTUS:478:FUNC.OUT","BEND:LTUS:478:CTRL.VAL") #! Record("BEND:LTUS:478:ABORT",193,41,0,0,"BEND:LTUS:478:ABORT") #! Record("BEND:LTUS:478:CTRLSTATE",369,34,0,0,"BEND:LTUS:478: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,"BEND:LTUS:478:SELECT is used for Multi-device selection.\nIt is enabled when associated BEND:LTUS:478:CTRL is \"0\" (DONE).\nIt is disabled when associated BEND:LTUS:478: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,"BEND:LTUS:478: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, "BEND:LTUS:478:BCTRL_INIT") { field(DESC, "Process BCTRL on boot") field(PINI, "YES") field(CALC, "A=3?1:0") field(INPA, "BEND:LTUS:478:BCTRL.SEVR") field(OUT, "BEND:LTUS:478: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, "BEND:LTUS:478:BACT") { field(DESC, "Actual B") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "BEND:LTUS:478:BACT") field(INPB, "BEND:LTUS:478:POLYCOEF") field(INPC, "BEND:LTUS:478:POLYCOEF.A") field(INPD, "BEND:LTUS:478:POLYCOEF.B") field(INPE, "BEND:LTUS:478:IACTCALC MS") field(INPF, "BEND:LTUS:478:BDELTAS PP") field(INPG, "100") field(EGU, "kG-m") field(HOPR, "4.5161") field(LOPR, "0.0125") field(HIHI, "4.5161") field(LOLO, "0.0125") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "4.5161") field(LOW, "0.0125") field(FLNK, "BEND:LTUS:478: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, "BEND:LTUS:478:BDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntPhyDeltas") field(EGU, "kG-m") field(HOPR, "1") field(PREC, "7") field(BRSV, "INVALID") field(INPA, "BEND:LTUS:478:BDES") field(INPB, "BEND:LTUS:478:TRIMBTOL") field(INPC, "BEND:LTUS:478:TRIMBTOLR") field(INPD, "BEND:LTUS:478:CHCKBTOL") field(INPE, "BEND:LTUS:478:CHCKBTOLR") field(F, "2.0") field(INPG, "30") field(INPH, "BEND:LTUS:478:BACT.VAL") # # MPS absolute and relative tolerances field(INPP, "BEND:LTUS:478:MPSBTOL") field(INPQ, "BEND:LTUS:478:MPSBTOLR") field(FLNK, "BEND:LTUS:478:BCONLIMITS") info(autosaveFields,"F") } # This record is processed by BDELTAS record(aSub, "BEND:LTUS:478:BCONLIMITS") { field(DESC, "Config B-field Limits") field(INAM, "mgntInit") field(SNAM, "mgntBCONLimits") field(INPA, "BEND:LTUS:478:BDES") field(INPB, "BEND:LTUS:478:BDELTAS.I") field(INPG, "BEND:LTUS:478:DEBUG.RVAL") field(FTA, "DOUBLE") field(FTB, "DOUBLE") field(FTG, "ULONG") field(OUTA, "BEND:LTUS:478:BCON.HIGH") field(OUTB, "BEND:LTUS:478:BCON.LOW") field(OUTC, "BEND:LTUS:478:BCON.HIHI") field(OUTD, "BEND:LTUS:478:BCON.LOLO PP") field(FTVA, "DOUBLE") field(FTVB, "DOUBLE") field(FTVC, "DOUBLE") field(FTVD, "DOUBLE") field(BRSV, "INVALID") field(FLNK, "BEND:LTUS:478:IDELTAS") } # The following PV is processed by :BACT # which is processed by :BACT # record(fanout, "BEND:LTUS:478:BACTFO") { field(DESC, "BACT processing") field(SELM, "All") field(LNK1, "BEND:LTUS:478:BDIFF") field(LNK2, "BEND:LTUS:478:BADIFF") field(LNK3, "BEND:LTUS:478:BRATIO") field(LNK4, "BEND:LTUS:478:MPSLIMITS") field(LNK5, "BEND:LTUS:478:I2BSTATUS") field(LNK6, "BEND:LTUS:478:IACTFO.PROC") } record(calc, "BEND:LTUS:478:BDIFF") { field(DESC, "BDES-BACT") field(CALC, "A-B") field(INPA, "BEND:LTUS:478:BDES") field(INPB, "BEND:LTUS:478:BACT") field(EGU, "kG-m") field(PREC, "7") } record(calc, "BEND:LTUS:478:BADIFF") { field(DESC, "Absolute BDES-BACT") field(INPA, "BEND:LTUS:478:BDIFF") field(EGU, "kG-m") field(PREC, "7") field(CALC, "A<0?ABS(A):A") } record(calc, "BEND:LTUS:478:BRATIO") { field(DESC, "BACT Error") field(CALC, "B?A/B:0") field(INPA, "BEND:LTUS:478:BDIFF") field(INPB, "BEND:LTUS:478:BDES.HOPR") field(EGU, "kG-m") field(PREC, "7") } record(mbbi, "BEND:LTUS:478: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, "BEND:LTUS:478:BACT.J") } # Note: for a string slave set the MONFL # macro to the following: # MONFL=:IMONCALC MS record(sub, "BEND:LTUS:478:BMON") { field(DESC, "Second Transductor") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "BEND:LTUS:478:BMON") field(INPB, "BEND:LTUS:478:POLYCOEF") field(INPC, "BEND:LTUS:478:POLYCOEF.A") field(INPD, "BEND:LTUS:478:POLYCOEF.B") field(INPE, "BEND:LTUS:478:IMONCALC MS") field(INPF, "BEND:LTUS:478:BDELTAS.VAL") field(INPG, "100") field(EGU, "kG-m") field(HOPR, "4.5161") field(LOPR, "0.0125") field(HIHI, "4.5161") field(LOLO, "0.0125") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "4.5161") field(LOW, "0.0125") } # 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=BEND:LTUS:476:BDES CP record(ao, "BEND:LTUS:478:BDES") { field(DESC, "Desired B-Field") field(PINI, "NO") field(DRVH, "4.5161") field(DRVL, "0.0125") field(HOPR, "4.5161") field(LOPR, "0.0125") field(PREC, "7") field(EGU, "kG-m") field(MDEL, "-1") field(OMSL, "closed_loop") field(DOL, "BEND:LTUS:478:IDES2BDES") field(OUT, "BEND:LTUS:478:B2IDES PP") info(autosaveFields,"VAL") } record(sub, "BEND:LTUS:478:B2IDES") { field(DESC, "Convert Desired B-Field to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "BEND:LTUS:478:POLYCOEF") field(INPC, "BEND:LTUS:478:POLYCOEF.A") field(INPD, "BEND:LTUS:478:POLYCOEF.B") field(PREC, "7") field(EGU, "kG-m") field(HOPR, "4.5161") field(LOPR, "0.0125") field(MDEL, "-1") field(INPE, "BEND:LTUS:478:BDES.DRVH") field(INPF, "BEND:LTUS:478:BDES.DRVL") field(BRSV, "INVALID") field(FLNK, "BEND:LTUS:478:IDES") } record(sub, "BEND:LTUS:478:BNOM") { field(DESC, "Nominal Field") field(PINI, "YES") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "BEND:LTUS:478:POLYCOEF") field(INPC, "BEND:LTUS:478:POLYCOEF.A") field(INPD, "BEND:LTUS:478:POLYCOEF.B") field(INPE, "BEND:LTUS:478:BDES.DRVH") field(INPF, "BEND:LTUS:478:BDES.DRVL") field(EGU, "kG-m") field(HOPR, "4.5161") field(LOPR, "0.0125") field(PREC, "7") field(VAL, "0.0") field(FLNK, "BEND:LTUS:478:INOM") } record(sub, "BEND:LTUS:478:BACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "BEND:LTUS:478:BDES.VAL") field(INPB, "BEND:LTUS:478:BDES.DRVH") field(INPC, "BEND:LTUS:478:BDES.DRVL") field(INPD, "BEND:LTUS:478:BDELTAS.I") field(INPE, "BEND:LTUS:478:BDELTAS.J") field(INPG, "BEND:LTUS:478:STATE") field(INPH, "BEND:LTUS:478:HSTA") field(EGU, "kG-m") field(HOPR, "4.5161") field(LOPR, "0.0125") field(PREC, "7") field(BRSV, "INVALID") } record(sub, "BEND:LTUS:478:BMONLIMITS") { field(DESC, "MON Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "BEND:LTUS:478:BDES.VAL") field(INPB, "BEND:LTUS:478:BDES.DRVH") field(INPC, "BEND:LTUS:478:BDES.DRVL") field(INPD, "BEND:LTUS:478:BDELTAS.K") field(INPE, "BEND:LTUS:478:BDELTAS.L") field(INPG, "BEND:LTUS:478:STATE") field(INPH, "BEND:LTUS:478:HSTA") field(EGU, "kG-m") field(HOPR, "4.5161") field(LOPR, "0.0125") field(PREC, "7") field(BRSV, "INVALID") } record(seq, "BEND:LTUS:478:BLIMITS") { field(DESC, "ACT Limits") field(PREC, "7") field(DOL1, "BEND:LTUS:478:BLIMITS") field(LNK1, "BEND:LTUS:478:BACTLIMITS.F PP") field(DOL2, "BEND:LTUS:478:BACTLIMITS.I") field(LNK2, "BEND:LTUS:478:BACT.HIGH") field(DOL3, "BEND:LTUS:478:BACTLIMITS.J") field(LNK3, "BEND:LTUS:478:BACT.LOW") field(DOL4, "BEND:LTUS:478:BACTLIMITS.K") field(LNK4, "BEND:LTUS:478:BACT.HIHI") field(DOL5, "BEND:LTUS:478:BACTLIMITS.L") field(LNK5, "BEND:LTUS:478:BACT.LOLO") field(DOL6, "BEND:LTUS:478:BLIMITS") field(LNK6, "BEND:LTUS:478:BMONLIMITS.F PP") field(DOL7, "BEND:LTUS:478:BMONLIMITS.I") field(LNK7, "BEND:LTUS:478:BMON.HIGH") field(DOL8, "BEND:LTUS:478:BMONLIMITS.J") field(LNK8, "BEND:LTUS:478:BMON.LOW") field(DOL9, "BEND:LTUS:478:BMONLIMITS.K") field(LNK9, "BEND:LTUS:478:BMON.HIHI") field(DOLA, "BEND:LTUS:478:BMONLIMITS.L") field(LNKA, "BEND:LTUS:478:BMON.LOLO") field(FLNK, "BEND:LTUS:478:ILIMITS") field(SCAN, "5 second") } record(ao, "BEND:LTUS:478:BCTRL") { field(DESC, "B-Perturb") field(PREC, "7") field(EGU, "kG-m") field(DRVH, "4.5161") field(DRVL, "0.0125") field(HOPR, "4.5161") field(LOPR, "0.0125") # 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, "BEND:LTUS:478: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, "BEND:LTUS:478:BCTRLGO") { field(DESC, "Update DES and perturb") field(PREC, "7") # Disable BACT limits field(DOL1, "1") field(LNK1, "BEND:LTUS:478:BLIMITS.VAL") # Update BDES with the BCTRL (slider) value field(DOL2, "BEND:LTUS:478:BCTRL.VAL") field(LNK2, "BEND:LTUS:478:BDES PP") field(DOL3, "1") field(LNK3, "BEND:LTUS:478:IDIRECT.PROC PP") field(DOL4, "1") field(LNK4, "BEND:LTUS:478:CHECKSTDZLOST.PROC PP") field(DOL5, "BEND:LTUS:478:BCTRL.VAL") field(LNK5, "BEND:LTUS:478:BCTRLSUB PP") # Re-enable BACT limits field(DOL6, "0") field(LNK6, "BEND:LTUS:478:BLIMITS.VAL") } # Convert B-field to Current and output to ISETPT record(sub, "BEND:LTUS:478:BCTRLSUB") { field(DESC, "Feedback") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "BEND:LTUS:478:POLYCOEF") field(INPC, "BEND:LTUS:478:POLYCOEF.A") field(INPD, "BEND:LTUS:478:POLYCOEF.B") field(INPE, "BEND:LTUS:478:BDES.DRVH") field(INPF, "BEND:LTUS:478:BDES.DRVL") field(PREC, "7") field(EGU, "kG-m") field(HOPR, "4.5161") field(LOPR, "0.0125") field(MDEL, "-1") field(BRSV, "INVALID") field(FLNK, "BEND:LTUS:478:ISETPT") } record(ao, "BEND:LTUS:478:BDESPREVTRIM") { field(DESC, "trim bdes for undo") field(DTYP, "Soft Channel") field(DRVH, "4.5161") field(DRVL, "0.0125") field(EGU, "kG-m") field(HOPR, "4.5161") field(LOPR, "0.0125") field(PREC, "7") field(PINI, "YES") info(autosaveFields,"VAL") } record(stringin, "BEND:LTUS:478:MADNAME") { field(DESC, "MAD deck nomenclature") field(PINI, "YES") field(VAL, "BCX32B4") } record(ai, "BEND:LTUS:478: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, "3355.625579") } record(ao, "BEND:LTUS:478:BMAX") { field(DESC, "Max B-Field") field(DTYP, "Soft Channel") field(DRVH, "4.5161") field(DRVL, "0.0125") field(EGU, "kG-m") field(HOPR, "4.5161") field(LOPR, "0.0125") field(PREC, "7") field(PINI, "YES") field(VAL, "4.5161") field(FLNK, "BEND:LTUS:478:BSTEP") } record(ao, "BEND:LTUS:478:BMIN") { field(DESC, "Min B-Field") field(DTYP, "Soft Channel") field(DRVH, "4.5161") field(DRVL, "0.0125") field(EGU, "kG-m") field(HOPR, "4.5161") field(LOPR, "0.0125") field(PREC, "7") field(PINI, "YES") field(VAL, "0.0125") field(FLNK, "BEND:LTUS:478:BSTEP") } record(ao, "BEND:LTUS:478:BDESSAVE") { field(DESC, "bdes for save/load") field(DTYP, "Soft Channel") field(DRVH, "4.5161") field(DRVL, "0.0125") field(EGU, "kG-m") field(HOPR, "4.5161") field(LOPR, "0.0125") field(PINI, "YES") field(PREC, "7") } # This record is processed by BEND:LTUS:478: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, "BEND:LTUS:478:BCON") { field(DESC, "Config B-Field ") field(DTYP, "Soft Channel") field(PREC, "7") field(EGU, "kG-m") field(HOPR, "4.5161") field(LOPR, "0.0125") field(DRVH, "4.5161") field(DRVL, "0.0125") # 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 , "BEND:LTUS:478:ICON2BCON") field(OMSL, "closed_loop") field(OUT, "BEND:LTUS:478:B2ICON PP") info(autosaveFields,"VAL") } record(sub, "BEND:LTUS:478:B2ICON") { field(DESC, "Convert Desired ICon to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "BEND:LTUS:478:POLYCOEF") field(INPC, "BEND:LTUS:478:POLYCOEF.A") field(INPD, "BEND:LTUS:478:POLYCOEF.B") field(PREC, "7") field(EGU, "kG-m") field(HOPR, "4.5161") field(LOPR, "0.0125") field(MDEL, "-1") field(INPE, "BEND:LTUS:478:BCON.DRVH") field(INPF, "BEND:LTUS:478:BCON.DRVL") field(BRSV, "INVALID") field(FLNK, "BEND:LTUS:478: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, "BEND:LTUS:478:BSTEP") { field(DESC, "B-Field step size") field(CALC, "(C==3)||(D==3)?0:ABS(A-B)*0.005") field(INPA, "BEND:LTUS:478:BMAX") field(INPB, "BEND:LTUS:478:BMIN") field(INPC, "BEND:LTUS:478:BMIN.SEVR") field(INPD, "BEND:LTUS:478:BMAX.SEVR") field(EGU, "kG-m") 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,"BEND:LTUS:478:BCTRLDISABLECALC") { field(DESC, "Calc for disabling BCTRL") field(ASG, "Internal") field(CALC, "A?2:1") field(INPA, "BEND:LTUS:478:ONLINE CP") field(OUT, "BEND:LTUS:478:BCTRLDISABLEFOUT PP") } record(fanout, "BEND:LTUS:478:BCTRLDISABLEFOUT") { field(DESC, "Disable BCTRL fanout") field(SELM, "Specified") field(SELL, "BEND:LTUS:478:BCTRLDISABLECALC") field(LNK1, "BEND:LTUS:478:BCTRLDISABLE") field(LNK2, "BEND:LTUS:478:BCTRLENABLE") } record(stringout, "BEND:LTUS:478:BCTRLDISABLE") { field(DESC, "Disable BCTRL") field(DTYP, "Soft Channel") field(OUT, "BEND:LTUS:478:BCTRL.ASG") field(VAL, "NOWRITE") field(FLNK, "BEND:LTUS:478:BCTRLDISV_UPDATE") } record(stringout, "BEND:LTUS:478:BCTRLENABLE") { field(DESC, "Enable BCTRL") field(DTYP, "Soft Channel") field(OUT, "BEND:LTUS:478:BCTRL.ASG") field(VAL, "") field(FLNK, "BEND:LTUS:478:BCTRLDISV_UPDATE") } record(calcout, "BEND:LTUS:478:BCTRLDISV_UPDATE") { field(DESC, "Calc for updating BCTRL.DISV") field(ASG, "Internal") field(CALC, "A") field(INPA, "BEND:LTUS:478:ONLINE") field(OUT, "BEND:LTUS:478: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,"BEND:LTUS:478:BACT and MON\n are processed via links from \n BEND:LTUS:478:IACT (device raw value readback 1)\n and\n BEND:LTUS:478: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 BEND:LTUS:478:POLYCOEF\nC = First polynomial coefficient (offset if linear)\nD = Second polynomial coefficient (slope if linear)\nE = BEND:LTUS:478: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,"BEND:LTUS:478:BDES\n is processed when set by CA users or \n BEND:LTUS:478: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,"BEND:LTUS:478: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 BEND:LTUS:478: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 (BEND:LTUS:478: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,"BEND:LTUS:478:B*LIMITS and BEND:LTUS:478:BLIMITS:\n Calculate alarm and warning limits based on \n deltas from BEND:LTUS:478: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,"BEND:LTUS:478: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,"BEND:LTUS:478: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, "BEND:LTUS:478: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, "BEND:LTUS:478:MPSBTOL") { field(DESC, "Absolute mps tol") field(EGU, "kG-m") field(PREC, "2") field(CALC, "ABS(A)*0.02") field(INPA, "BEND:LTUS:478:BMAX") field(PINI, "YES") } # # 21-Aug-2013: K. Luchini # Set channel access security so that users # cannot easily change values. record(ao, "BEND:LTUS:478:MPSBMAX") { field(DESC, "MPS Max B-field") field(EGU, "kG-m") field(PREC, "7") field(DRVH, "4.5161") field(DRVL, "0.0125") field(PINI, "YES") field(VAL, "4.5161") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:478:MPSBMIN") { field(DESC, "MPS Min B-field") field(EGU, "kG-m") field(PREC, "7") field(DRVH, "4.5161") field(DRVL, "0.0125") field(PINI, "YES") field(VAL, "0.0125") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:478:MPSBLLIM") { field(DESC, "MPS Low Limit B-field") field(EGU, "kG-m") field(PREC, "7") field(DRVH, "4.5161") field(DRVL, "0.0125") field(PINI, "YES") field(VAL, "0.0125") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:478:MPSBLLIM2") { field(DESC, "MPS Low Limit #2 B-field") field(EGU, "kG-m") field(PREC, "7") field(DRVH, "4.5161") field(DRVL, "0.0125") field(PINI, "YES") field(VAL, "0.0125") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } # Set the default to Std record(mbbo, "BEND:LTUS:478: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, "BEND:LTUS:478:MPSLIMITS.E PP") } record(aSub, "BEND:LTUS:478: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, "BEND:LTUS:478:MPS.RVAL") field(INPB, "BEND:LTUS:478:BADIFF") field(INPC, "BEND:LTUS:478:BDELTAS.N") field(INPD, "BEND:LTUS:478:BACT") field(INPE, "BEND:LTUS:478:MPSBITMASK.RVAL") field(INPF, "BEND:LTUS:478:MPSBLLIM") field(INPG, "BEND:LTUS:478:MPSBMIN") field(INPH, "BEND:LTUS:478:MPSBMAX") field(INPI, "BEND:LTUS:478: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, "BEND:LTUS:478:INTOL.RVAL PP") field(OUTB, "BEND:LTUS:478:INTOL_BMIN.RVAL PP") field(OUTC, "BEND:LTUS:478:INTOL_BRANGE.RVAL PP") field(OUTD, "BEND:LTUS:478: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, "BEND:LTUS:478:INTOL") { field(DESC, "BACT within MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "BEND:LTUS:478:MPSLIMITS.VALA") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "BEND:LTUS:478:INTOL_BMIN") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "BEND:LTUS:478:MPSLIMITS.VALB") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "BEND:LTUS:478:INTOL_BMIN2") { field(DESC, "MPS tol #2") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "BEND:LTUS:478:MPSLIMITS.VALD") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "BEND:LTUS:478:INTOL_BRANGE") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "BEND:LTUS:478: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, "BEND:LTUS:478:CHCKITOL") { field(DESC, "Absolute Check I Tolerance") field(EGU, "A") field(FLNK, "BEND:LTUS:478:TRIMITOL") field(CALC, "ABS(A*B)") field(INPA, "BEND:LTUS:478:CHCKBTOL") field(INPB, "BEND:LTUS:478:POLYCOEF.B") field(PREC, "9") } record(calc, "BEND:LTUS:478:TRIMBTOL") { field(EGU, "kG-m") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(DESC, "Absolute Trim Tolerance") field(CALC, "ABS(A)/2") field(INPA, "BEND:LTUS:478:CHCKBTOL") field(FLNK, "BEND:LTUS:478:CHCKITOL") } record(calc, "BEND:LTUS:478:CHCKBTOL") { field(DESC, "Check absolute tolerance") field(EGU, "A") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(FLNK, "BEND:LTUS:478:TRIMBTOL") field(CALC, "MAX(ABS(A),ABS(C))*(B/1000000)") field(INPA, "BEND:LTUS:478:BDES.HOPR") field(INPB, "BEND:LTUS:478:STABILITY") field(INPC, "BEND:LTUS:478:BDES.LOPR") } record(longout, "BEND:LTUS:478: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, "BEND:LTUS:478:CHCKBTOL") } record(calc, "BEND:LTUS:478:TRIMITOL") { field(DESC, "Absolute Trim I Tolerance") field(EGU, "kG-m") field(CALC, "ABS(A*B)") field(INPA, "BEND:LTUS:478:POLYCOEF.B") field(INPB, "BEND:LTUS:478:TRIMBTOL") field(PREC, "9") } record(ai, "BEND:LTUS:478:TRIMBTOLR") { field(DESC, "Relative trim tol") field(PREC, "4") field(EGU, "%") field(HOPR, "1.0") field(LOPR, "0.0") field(PINI, "YES") } record(ai, "BEND:LTUS:478: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, "BEND:LTUS:478:FBCKFCOM") { field(ZNAM, "CA") field(ONAM, "FCOM") field(DESC, "CA Mode") field(PINI, "YES") field(SDIS, "0") } record(bo, "BEND:LTUS:478:PAU") { field(ZNAM, "NotConfigured") field(ONAM, "Configured") field(DESC, "PAU Present") field(PINI, "YES") field(SDIS, "0") field(FLNK, "BEND:LTUS:478:PAUGO") } record(fanout, "BEND:LTUS:478:PAUGO") { field(DESC, "PAU control") field(LNK1, "BEND:LTUS:478:PAUSTOP") field(LNK2, "BEND:LTUS:478: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, "BEND:LTUS:478:PAUSTART") { field(DESC, "Setup for PAU On") field(SDIS, "BEND:LTUS:478: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, "BEND:LTUS:478:PAUSTOP") { field(DESC, "Setup for PAU Off") field(SDIS, "BEND:LTUS:478: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, "BEND:LTUS:478:MCORDEVNAME") { field(DESC, "PS device name") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, "BEND:LTUS:476:") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "BEND:LTUS:478: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, "BEND:LTUS:478:PSTYPE.RVAL") field(INPC, "BEND:LTUS:478:TURNEDOFF.RVAL") field(INPD, "BEND:LTUS:478:CONFIG.RVAL") field(INPE, "BEND:LTUS:478:PSCATEGORY.RVAL") field(INPF, "BEND:LTUS:478:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "BEND:LTUS:478:AUTOCTRL.RVAL") field(INPJ, "BEND:LTUS:478:OUTOFSERVICE.RVAL") field(INPL, "BEND:LTUS:478:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "BEND:LTUS:478:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "BEND:LTUS:478:PAU") field(INPP, "BEND:LTUS:478:CALBDISABLE.RVAL") field(INPQ, "BEND:LTUS:478:PTRBDISABLE.RVAL") field(INPR, "BEND:LTUS:478:TRIMDISABLE.RVAL") field(INPS, "BEND:LTUS:478:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "BEND:LTUS:478:FBCK") field(INPU, "BEND:LTUS:478:TRIMTYPE.RVAL") field(INPV, "BEND:LTUS:478:STDZDIRECT.RVAL") field(INPW, "BEND:LTUS:478:DEGAUSENABLE.RVAL") field(FLNK, "BEND:LTUS:478:HSTA") } record(longin, "BEND:LTUS:478:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "BEND:LTUS:478:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "BEND:LTUS:478: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, "BEND:LTUS:478: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, "BEND:LTUS:478: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, "BEND:LTUS:478: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, "BEND:LTUS:478: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, "BEND:LTUS:478: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 BEND:LTUS:478:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses BEND:LTUS:478:FBCK. # This PV should be replaced by BEND:LTUS:478: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, "BEND:LTUS:478: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, "BEND:LTUS:478: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, "BEND:LTUS:478: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, "BEND:LTUS:476:OUTOFSERVICE CPP NMS") field(OMSL, "closed_loop") field(FLNK, "BEND:LTUS:478:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"BEND:LTUS:478:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "BEND:LTUS:478:OUTOFSERVICE NPP NMS") field(OUT, "BEND:LTUS:478:ONLINE PP") } record(bo, "BEND:LTUS:478:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "BEND:LTUS:478: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, "BEND:LTUS:478: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, "BEND:LTUS:478: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, "BEND:LTUS:478: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, "BEND:LTUS:478: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, "BEND:LTUS:478: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, "BEND:LTUS:478: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, "BEND:LTUS:478: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, "BEND:LTUS:478: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, "BEND:LTUS:478: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, "BEND:LTUS:478: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, "BEND:LTUS:478:TRIMTYPE") } record(stringout, "BEND:LTUS:478:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "BEND:LTUS:476:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "BEND:LTUS:478:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "BEND:LTUS:478:STATE.RVAL") field(INPB, "BEND:LTUS:478:INTLKSUMY.RVAL") field(OUT, "BEND:LTUS:478:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "BEND:LTUS:478: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, "BEND:LTUS:478:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "BEND:LTUS:478:STATE.RVAL") field(INPB, "BEND:LTUS:478:INTLKSUMY.RVAL") field(OUT, "BEND:LTUS:478:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "BEND:LTUS:478:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "BEND:LTUS:478:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "BEND:LTUS:478: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, "BEND:LTUS:478: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, "BEND:LTUS:478: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, "BEND:LTUS:478: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,"BEND:LTUS:478: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("BEND:LTUS:478:TURNEDOFF",3140,1907,0,1,"BEND:LTUS:478:TURNEDOFF") #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "BEND:LTUS:478:STATSUB") { field(DESC, "Build STATus ") field(INAM, "mgntInit") field(SNAM, "mgntSlcStat") field(INPA, "BEND:LTUS:478:BACT.STAT") field(INPB, "BEND:LTUS:478:BDES.STAT") field(INPC, "BEND:LTUS:478: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, "BEND:LTUS:478:BACT.SEVR") field(INPH, "BEND:LTUS:478:BDES.SEVR") field(INPI, "BEND:LTUS:478: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, "BEND:LTUS:478:STATE.RVAL") field(INPN, "BEND:LTUS:478:STDZOK") field(INPO, "BEND:LTUS:478:CALBOK") field(INPP, "BEND:LTUS:478:OUTOFSERVICE.RVAL") field(INPQ, "BEND:LTUS:478:CONFIG.RVAL") field(INPR, "BEND:LTUS:478:HSTA") field(INPS, "BEND:LTUS:478:CTRL.RVAL") field(INPT, "BEND:LTUS:478:DEGAUSOK") field(INPV, "BEND:LTUS:478: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, "BEND:LTUS:478:STAT") } record(longout, "BEND:LTUS:478:STAT") { field(DESC, "STAT sent to SLC") field(SCAN, "Passive") field(FLNK, "BEND:LTUS:478:STATCTRLSUB") field(DOL, "BEND:LTUS:478:STATSUB.VAL") field(OMSL, "closed_loop") } record(sSub, "BEND:LTUS:478:STATCTRLSUB") { field(DESC, "Decode SLC STAT into mbbo") field(INAM, "mgntInit") field(SNAM, "mgntStatDecode") field(INPA, "BEND:LTUS:478:STAT") field(INPB, "BEND:LTUS:478:HSTA") field(INPD, "BEND:LTUS:478:ONOFFCTRL.RVAL") field(FLNK, "BEND:LTUS:478:STATMSG") } record(mbbo, "BEND:LTUS:478: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, "BEND:LTUS:478:UNAVAILGO") field(DOL, "BEND:LTUS:478:STATCTRLSUB.W") } record(seq, "BEND:LTUS:478:UNAVAILGO") { field(DESC, "Process UNAVAIL") field(DOL1, "BEND:LTUS:478:STATSUB.U") field(LNK1, "BEND:LTUS:478:UNAVAIL PP") } record(stringout, "BEND:LTUS:478:SNLSTATMSG") { field(DTYP, "Soft Channel") } #! TextBox(TB0,820,1000,1200,1220,0,"Dialog",12,1,16777215,"BEND:LTUS:478:STATUSSUB - future\nOverall device status - takes input from action snls, record sevrs, master snl(s) and outputs final status\n\nInputs:\nA - BEND:LTUS:478:CTRLSTATUS - snl status\nB - MGNT:CTRLSTATUS - master list status\nC\nD - BEND:LTUS:478: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,"BEND:LTUS:478STATSUB\nformat control bo's into slc STAT\n\nInputs:\nA - BEND:LTUS:478:STATUS\nC - BEND:LTUS:478:ON\nD - BEND:LTUS:478:STDZOK\nE - BEND:LTUS:478:CALBOK\nF - BEND:LTUS:478:BACTDRIFT (future)\nG -\nH- BEND:LTUS:478:DACSTATUS\nI -BEND:LTUS:478:ADCSTATUS\nJ - BEND:LTUS:478:BACTSTATUS\nK - BEND:LTUS:478:BDESSTATUS\nL - BEND:LTUS:478:RIPLSTATUS\n\nOutput:\nP - BEND:LTUS:478: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, "BEND:LTUS:478: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, "BEND:LTUS:478: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, "BEND:LTUS:478: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, "BEND:LTUS:478: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, "BEND:LTUS:478:IDESTOTAL"){ field(DESC, "Calc total current") field(CALC, "A+B") field(EGU, "kG-m") field(PREC, "7") field(INPA, "BEND:LTUS:476:IDES CP NMS") field(INPB, "BTRM:LTUS:478:BDES CP NMS") field(OUT, "BEND:LTUS:478:IDES2BDES.E PP") } record(sub, "BEND:LTUS:478:IDES2BDES") { field(DESC, "Cal BDES") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "BEND:LTUS:478:IDES2BDES") field(INPB, "BEND:LTUS:478:POLYCOEF") field(INPC, "BEND:LTUS:478:POLYCOEF.A") field(INPD, "BEND:LTUS:478:POLYCOEF.B") field(INPE, "BEND:LTUS:478:IDESTOTAL MS") field(INPF, "BEND:LTUS:476:BDELTAS PP") field(INPG, "100") field(EGU, "kG-m") field(HOPR, "4.5161") field(LOPR, "0.0125") field(HIHI, "4.5161") field(LOLO, "0.0125") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "4.5161") field(LOW, "0.0125") field(FLNK, "BEND:LTUS:478: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, "BEND:LTUS:478:IACTCALC"){ field(DESC, "Calc total act current") field(CALC, "A+B") field(EGU, "kG-m") field(PREC, "7") field(INPA, "BEND:LTUS:478:IACT CP NMS") field(INPB, "BTRM:LTUS:478:BACT") field(OUT, "BEND:LTUS:478: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, "BEND:LTUS:478:IMONCALC"){ field(DESC, "Calc total mon current") field(CALC, "A+B") field(EGU, "kG-m") field(PREC, "7") field(INPA, "BEND:LTUS:478:IMON CP NMS") field(INPB, "BTRM:LTUS:478:BMON") field(OUT, "BEND:LTUS:478: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, "BEND:LTUS:478:ICONTOTAL"){ field(DESC, "Calc total current") field(CALC, "A+B") field(EGU, "kG-m") field(PREC, "7") field(INPA, "BEND:LTUS:476:ICON CP NMS") field(INPB, "BTRM:LTUS:478:BCON CP NMS") field(OUT, "BEND:LTUS:478:ICON2BCON.E PP") } record(sub, "BEND:LTUS:478:ICON2BCON") { field(DESC, "Cal BCON") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "BEND:LTUS:478:ICON2BCON") field(INPB, "BEND:LTUS:478:POLYCOEF") field(INPC, "BEND:LTUS:478:POLYCOEF.A") field(INPD, "BEND:LTUS:478:POLYCOEF.B") field(INPE, "BEND:LTUS:478:ICONTOTAL MS") field(INPF, "BEND:LTUS:476:BDELTAS PP") field(INPG, "100") field(EGU, "kG-m") field(HOPR, "4.5161") field(LOPR, "0.0125") field(HIHI, "4.5161") field(LOLO, "0.0125") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "4.5161") field(LOW, "0.0125") field(FLNK, "BEND:LTUS:478:BCON") } #! 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, "BEND:LTUS:175:IACT") { field(DESC, "Current") field(INP, "BEND:DMPS:400:IACT CP NMS") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "BEND:LTUS:175:IACTCALC") info(autosaveFields,"HYST") } record(bi, "BEND:LTUS:175:STATE") { field(DESC, "PS On/Off Status") field(DTYP, "Raw Soft Channel") field(INP, "BEND:DMPS:400:STATE CP MS") field(ZSV, "MAJOR") field(ZNAM, "OFF") field(ONAM, "ON") } record(ao, "BEND:LTUS:175:IDES") { field(DESC, "Desired Current") field(PREC, "3") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(MDEL, "-1") field(HIHI, "200.0") field(LOLO, "0.0") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "BEND:LTUS:175:BDELTAS") field(DRVH, "200.0") field(DRVL, "0.0") field(DOL, "BEND:LTUS:175: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, "BEND:LTUS:175:ICTRL PP") } # This record is processed by BEND:LTUS:175:ICON") # Note: we are not setting alarms here. record(ao, "BEND:LTUS:175:ICON") { field(DESC, "Config I") field(DTYP, "Soft Channel") field(PREC, "3") field(HOPR, "200.0") field(LOPR, "0.0") field(DRVH, "200.0") field(DRVL, "0.0") field(DOL, "BEND:LTUS:175:B2ICON.K") field(OMSL, "closed_loop") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:175:INOM") { field(DESC, "Nominal Current") field(DOL, "BEND:LTUS:175:BNOM.K") field(OMSL, "closed_loop") field(PREC, "3") field(EGU, "A") field(DRVH, "200.0") field(DRVL, "0.0") field(HOPR, "200.0") field(LOPR, "0.0") } record(ao, "BEND:LTUS:175:ICTRL") { field(DESC, "Set Current") field(PREC, "3") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(DRVH, "200.0") field(DRVL, "0.0") field(MDEL, "-1") field(FLNK, "BEND:LTUS:175:ICTRLGO") field(OMSL, "supervisory") info(autosavefields,"VAL") } record(seq, "BEND:LTUS:175:ICTRLGO") { field(DESC, "Process Current Setpoint") field(PREC, "3") # Set ISETPT to supervisory field(DOL1, "0") field(LNK1, "BEND:LTUS:175:ISETPT.OMSL") field(DOL2, "BEND:LTUS:175:ICTRL") field(LNK2, "BEND:LTUS:175:ISETPT PP") # Set ISETPT to closed loop - get data from BCTRLSUB.K field(DOL3, "1") field(LNK3, "BEND:LTUS:175:ISETPT.OMSL") } record(ao, "BEND:LTUS:175:IMAX") { field(DESC, "Max I") field(DTYP, "Soft Channel") field(DRVH, "200.0") field(DRVL, "0.0") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(PREC, "3") field(PINI, "YES") field(VAL, "200.0") field(FLNK, "BEND:LTUS:175:IMIN") } record(ao, "BEND:LTUS:175:IMIN") { field(DESC, "Min I") field(DTYP, "Soft Channel") field(DRVH, "200.0") field(DRVL, "0.0") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(PREC, "3") field(VAL, "0.0") field(FLNK, "BEND:LTUS:175:IRANGE") } record(sel, "BEND:LTUS:175:IACTPREVOK") { field(DESC, "Last Good Current") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(PREC, "3") field(NVL, "BEND:LTUS:175:BACT.SEVR") field(INPA, "BEND:LTUS:175:IACT NPP MS") field(INPB, "BEND:LTUS:175:IACTPREVOK NPP MS") field(INPC, "BEND:LTUS:175:IACTPREVOK NPP MS") field(INPD, "BEND:LTUS:175:IACTPREVOK NPP MS") } record(sub, "BEND:LTUS:175:IACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "BEND:LTUS:175:IDES") field(INPB, "BEND:LTUS:175:ISETPT.DRVH") field(INPC, "BEND:LTUS:175:ISETPT.DRVL") field(INPD, "BEND:LTUS:175:IDELTAS.I") field(INPE, "BEND:LTUS:175:IDELTAS.J") field(INPG, "BEND:LTUS:175:STATE") field(INPH, "BEND:LTUS:175:HSTA") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(sub, "BEND:LTUS:175:IMONLIMITS") { field(DESC, "Aux Current Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "BEND:LTUS:175:IDES") field(INPB, "BEND:LTUS:175:ISETPT.DRVH") field(INPC, "BEND:LTUS:175:ISETPT.DRVL") field(INPD, "BEND:LTUS:175:IDELTAS.K") field(INPE, "BEND:LTUS:175:IDELTAS.L") field(INPG, "BEND:LTUS:175:STATE") field(INPH, "BEND:LTUS:175:HSTA") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(seq, "BEND:LTUS:175:ILIMITS") { field(DESC, "Set ACT and MON Limits") field(PREC, "3") field(DOL1, "BEND:LTUS:175:BLIMITS") field(LNK1, "BEND:LTUS:175:IACTLIMITS.F PP") field(DOL2, "BEND:LTUS:175:IACTLIMITS.I") field(LNK2, "BEND:LTUS:175:IACT.HIGH") field(DOL3, "BEND:LTUS:175:IACTLIMITS.J") field(LNK3, "BEND:LTUS:175:IACT.LOW") field(DOL4, "BEND:LTUS:175:IACTLIMITS.K") field(LNK4, "BEND:LTUS:175:IACT.HIHI") field(DOL5, "BEND:LTUS:175:IACTLIMITS.L") field(LNK5, "BEND:LTUS:175:IACT.LOLO") field(DOL6, "BEND:LTUS:175:BLIMITS") field(LNK6, "BEND:LTUS:175:IMONLIMITS.F PP") field(DOL7, "BEND:LTUS:175:IMONLIMITS.I") field(LNK7, "BEND:LTUS:175:IMON.HIGH") field(DOL8, "BEND:LTUS:175:IMONLIMITS.J") field(LNK8, "BEND:LTUS:175:IMON.LOW") field(DOL9, "BEND:LTUS:175:IMONLIMITS.K") field(LNK9, "BEND:LTUS:175:IMON.HIHI") field(DOLA, "BEND:LTUS:175:IMONLIMITS.L") field(LNKA, "BEND:LTUS:175: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, "BEND:LTUS:175:IDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntRawDeltas") field(INPD, "BEND:LTUS:175:TRIMBTOL") field(INPE, "BEND:LTUS:175:CHCKBTOL") field(INPF, "BEND:LTUS:175:BDELTAS.K") field(INPG, "BEND:LTUS:175:BDELTAS.L") field(INPH, "BEND:LTUS:175: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, "BEND:LTUS:175:STDZITOLR") field(INPC, "BEND:LTUS:175:STDZITOL") field(FLNK, "") } # All ps controllers with on/off control will set the macro ONOF # as follows: # # ONOF = BEND:DMPS:400: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, "BEND:LTUS:175: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 = BEND:DMPS:400:RESET PP # record(bo, "BEND:LTUS:175: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, "BEND:LTUS:175:RAMPSTATE") { field(DESC, "PS Ramp Status") field(DTYP, "Soft Channel") field(DOL, "BEND:DMPS:400: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, "BEND:LTUS:175: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, "BEND:LTUS:175:TRIMRAMPRATE") field(OUT, "") field(FLNK, "BEND:LTUS:175:STDZDLY") } record(ao, "BEND:LTUS:175:ISETPT") { field(DESC, "Current Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(DRVH, "200.0") field(DRVL, "0.0") field(MDEL, "-1") field(OUT, "") field(DOL, "BEND:LTUS:175: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, "BEND:LTUS:175:IMON") { field(DESC, "Aux Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(INP, "BEND:DMPS:400:IMON CP NMS") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "BEND:LTUS:175:IMONCALC") } record(ao, "BEND:LTUS:175:IRIPL") { field(DESC, "Ripple Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(DOL, "BEND:DMPS:400:IRIPL CP NMS") field(OMSL, "closed_loop") field(EGU, "A") field(DRVH, "1.0") field(HOPR, "1.0") field(PREC, "3") field(FLNK, "BEND:LTUS:175:IRIPLOK") } record(sub, "BEND:LTUS:175:IRIPLOK") { field(DESC, "Ripple Current Status") field(INAM, "mgntInit") field(SNAM, "mgntRiplOK") field(INPA, "BEND:LTUS:175:IRIPL.VAL") field(INPB, "BEND:LTUS:175: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, "BEND:LTUS:175:R") { field(DESC, "Resistance") field(EGU, "Ohms") field(PREC, "4") field(PINI, "YES") field(DOL, "BEND:DMPS:400: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, "BEND:LTUS:175:IGND") { field(DESC, "Ground Current") field(EGU, "A") field(PREC, "6") field(PINI, "YES") field(DOL, "BEND:DMPS:400:IGND CP MS") field(OMSL, "closed_loop") } record(bi, "BEND:LTUS:175:INTLKSUMY") { field(DESC, "Interlock Summary") field(INP, "BEND:DMPS:400:INTLKSUMY CP MS") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(ZNAM, "OK") field(ONAM, "FAULT") field(PINI, "NO") } record(mbbo, "BEND:LTUS:175: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, "BEND:DMPS:400:COOLING CP NMS") field(OMSL, "closed_loop") } # The following PV is processed by :BACTFO # which is processed by :BACT record(fanout, "BEND:LTUS:175:IACTFO") { field(DESC, "IACT processing") field(SELM, "All") field(LNK1, "BEND:LTUS:175:IACTPREVOK") field(LNK2, "BEND:LTUS:175:IDIFF") field(LNK3, "BEND:LTUS:175:IADIFF") field(LNK4, "BEND:LTUS:175:IRATIO") field(LNK5, "BEND:LTUS:175:IDIRECT") field(LNK6, "BEND:LTUS:175:IACTPOL_CHECK") } record(calc, "BEND:LTUS:175:IDIFF") { field(DESC, "IDES-IACT") field(CALC, "A-B") field(INPA, "BEND:LTUS:175:IDES") field(INPB, "BEND:LTUS:175:IACT") field(EGU, "A") field(PREC, "9") field(HOPR, "200.0") field(LOPR, "0.0") } record(calc, "BEND:LTUS:175:IADIFF") { field(DESC, "Absolute IDES-IACT") field(CALC, "A<0?ABS(A):A") field(INPA, "BEND:LTUS:175:IDIFF") field(PREC, "9") } record(calc, "BEND:LTUS:175:IRATIO") { field(DESC, "IDES-IACT/IMAX") field(CALC, "B?A/B:0") field(INPA, "BEND:LTUS:175:IDIFF") field(INPB, "BEND:LTUS:175:IDES.DRVH") field(PREC, "9") } record(calcout, "BEND:LTUS:175:IRANGE") { field(DESC, "Current Range") field(PINI, "YES") field(CALC, "ABS(A-B)") field(INPA, "BEND:LTUS:175:IMIN") field(INPB, "BEND:LTUS:175: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, "BEND:LTUS:175: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, "BEND:LTUS:175:IACT") field(FLNK, "BEND:LTUS:175:IACTPOL") } record(bo, "BEND:LTUS:175:IACTPOL") { field(DESC, "Actual I Polarity") field(DTYP, "Raw Soft Channel") field(DOL, "BEND:LTUS:175: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,"BEND:LTUS:175:I*LIMITS:\n Calculate alarm and warning limits based on \n deltas from BEND:LTUS:175:IDELTAS and the\n BEND:LTUS:175: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,"BEND:LTUS:175:IACT: \n Get copy of BEND:LTUS:175:I. \n",null) #! TextBox(TB12,1280,3100,1760,3200,0,"Dialog",12,1,16777215,"BEND:LTUS:175: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,"BEND:LTUS:175:IDES:\n Contains raw value calculated by \nBEND:LTUS:175: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 \nBEND:LTUS:175:BDELTAS.\n",null) #! TextBox(TB10,56,1940,316,2340,0,"Dialog",12,1,16777215,"BEND:LTUS:175: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 BEND:LTUS:175: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 BEND:LTUS:175: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,"BEND:LTUS:175:ISETPT:\n Sets the hardware. When fast feedback is set on, this record is\n set to closed loop mode by BEND:LTUS:175:FBCKSTART sequence. When \n the loop is closed, this record takes input calculated by \n BFBCK only. When fast feedback is set off, BEND:LTUS:175:FBCKSTOP \n will set it back to supervisory so that the value can be set by \n BEND:LTUS:175: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, "BEND:LTUS:175:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:175:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "BEND:LTUS:175:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "BEND:LTUS:175:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "BEND:LTUS:175:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "BEND:LTUS:175:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "1") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "BEND:LTUS:175: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, "BEND:LTUS:175:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "BEND:LTUS:175:TRIMTYPE.RVAL") field(INPB, "BEND:LTUS:175:CONFIG.RVAL") field(OUT, "BEND:LTUS:175:TRIMMAXNUM PP") } record(longout, "BEND:LTUS:175: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, "BEND:LTUS:175: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, "BEND:DMPS:400:TRIMRAMPRATE CP NMS") field(OMSL, "closed_loop") field(VAL, "") field(OUT, "BEND:LTUS:175:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "BEND:LTUS:175: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, "BEND:DMPS:400:TRIMSETL CP NMS") field(OMSL, "closed_loop") field(VAL, "") } record(bo, "BEND:LTUS:175: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, "BEND:LTUS:175: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, "BEND:LTUS:175: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, "BEND:LTUS:175:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "0") } record(ao, "BEND:LTUS:175: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, "BEND:LTUS:175:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "BEND:LTUS:175: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, "BEND:LTUS:175: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, "BEND:LTUS:175:IMOVE") field(INPB, "BEND:LTUS:175:IACT") field(INPC, "BEND:LTUS:175:IRAMPRATE") field(INPD, "1.577") field(INPE, "BEND:LTUS:175:TRIMDLYPCT") field(INPF, "BEND:LTUS:175:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "BEND:LTUS:175:RAMPTIME_LEFT PP") } record(longout, "BEND:LTUS:175:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "BEND:LTUS:175:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "BEND:LTUS:175:RAMPDONE_CALC") } record(calc, "BEND:LTUS:175:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "BEND:LTUS:175:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "BEND:LTUS:175:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "BEND:LTUS:175: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, "BEND:LTUS:175:RAMPTIME_LEFT") field(OUT, "BEND:LTUS:175:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "BEND:LTUS:175:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "BEND:LTUS:175:RAMPTIME_LEFT NMS") field(OUT, "BEND:LTUS:175:RAMPDONE PP") } record(bo, "BEND:LTUS:175:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "BEND:LTUS:175:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "BEND:LTUS:175: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, "BEND:LTUS:175: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, "BEND:LTUS:175:STDZINIT") { field(DESC, "Proc. Stdz PVs on boot") field(PINI, "YES") field(DOL1, "1") field(DOL2, "1") field(DOL3, "1") field(LNK1, "BEND:LTUS:175:DEBUG.PROC PP") field(LNK2, "BEND:LTUS:175:STDZCYCLENUM.PROC PP") field(LNK3, "BEND:LTUS:175:STDZDISABLE.PROC PP") field(LNK4, "BEND:LTUS:175: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, "BEND:LTUS:175:STDZSUB") { field(DESC, "Stdz subroutine") field(INAM, "mgntStdzInit") field(SNAM, "mgntStdz") field(BRSV, "INVALID") field(INPA, "BEND:LTUS:175:STDZIMIN NPP NMS") field(INPB, "BEND:LTUS:175:STDZIMAX NPP NMS") field(INPC, "BEND:LTUS:175:STDZIFINAL NPP NMS") field(INPD, "BEND:LTUS:175:STDZCYCLENUM NPP NMS") field(INPE, "BEND:LTUS:175:STDZDIRECT.RVAL NPP NMS") field(INPF, "BEND:LTUS:175:STDZDISABLE.RVAL CPP NMS") field(INPG, "BEND:LTUS:175: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, "BEND:LTUS:175:STDZWF PP") field(OUTB, "BEND:LTUS:175: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, "BEND:LTUS:175:STDZWF") } record(mbbo, "BEND:LTUS:175: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, "BEND:LTUS:175: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, "BEND:LTUS:175:STDZMAINPS") { field(DESC, "Stdz by main or self") field(PINI, "YES") field(DTYP, "Soft Channel") field(ZNAM, "SELF") field(ONAM, "MAIN") } record(bo, "BEND:LTUS:175: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, "BEND:LTUS:175: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, "BEND:LTUS:175: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, "BEND:LTUS:175:STDZTOD") { field(DESC, "Successful Standardize Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "BEND:LTUS:175:STDZLOSTTOD") { field(DESC, "Standardize Lost Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(longout, "BEND:LTUS:175:STDZCYCLECNT") { field(DESC, "Cycle Count") field(PINI, "YES") } record(longout, "BEND:LTUS:175: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, "BEND:LTUS:175:STDZDIRECT") } # The default standardize direction is "UP" for # all LCLS Magnets.. record(bo, "BEND:LTUS:175:STDZDIRECT") { field(DESC, "Standardize Direction ") field(ZNAM, "UP") field(ONAM, "DOWN") field(VAL, "0") field(FLNK, "BEND:LTUS:175:STDZIMIN") } record(ao, "BEND:LTUS:175:STDZIMIN") { field(DESC, "Min-STDZ Current") field(PREC, "1") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(VAL, "0.0") field(FLNK, "BEND:LTUS:175:STDZIMAX") } record(ao, "BEND:LTUS:175:STDZIMAX") { field(DESC, "Max. Standarize Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(VAL, "200.0") field(FLNK, "BEND:LTUS:175:STDZIFINAL") } record(ao, "BEND:LTUS:175:STDZIFINAL") { field(DESC, "Final SDTZ Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(VAL, "0.0") field(FLNK, "BEND:LTUS:175: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, "BEND:LTUS:175: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, "BEND:LTUS:175:STDZITOL") { field(DESC, "Stdz min tolerance") field(PREC, "5") field(CALC, "MAX(ABS(A),ABS(B))*C") field(INPA, "BEND:LTUS:175:STDZIMIN CP NMS") field(INPB, "BEND:LTUS:175:STDZIMAX CP MMS") field(INPC, "0.05") field(INPD, "BEND:LTUS:175:STDZITOLR CP MMS") field(EGU, "A") field(FLNK, "BEND:LTUS:175:IDELTAS") field(PINI, "YES") } # D - factor (3.154/2 = 1.577) for EPSC, otherwise, set to 1.0 record(calc, "BEND:LTUS:175:STDZDLY") { field(DESC, "Ramp time for stdz cycle") field(CALC, "C>0?MAX(1,ABS((A-B)/C)*D):0") field(INPA, "BEND:LTUS:175:STDZIMIN CP NMS") field(INPB, "BEND:LTUS:175:STDZIMAX CP NMS") field(INPC, "BEND:LTUS:175:TRIMRAMPRATE CP NMS") field(INPD, "1.0") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") } record(calc, "BEND:LTUS:175:STDZRAMPDLY") { field(DESC, "Ramp delay total") field(CALC, "MAX(1,((A/100)*B+B))") field(PREC, "5") field(INPA, "BEND:LTUS:175:TRIMDLYPCT CP MS") field(INPB, "BEND:LTUS:175: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, "BEND:LTUS:175:STDZMINIDLY") { field(DESC, "Mini-stdz delay") field(CALC, "A") field(PREC, "5") field(A, "1.0") field(EGU, "sec") field(PINI, "YES") } record(ao, "BEND:LTUS:175: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, "BEND:LTUS:175:STDZMINIDELTA") { field(DESC, "Stdz mini % of IMAX") field(CALC, "(B/100)*(A-C)") field(INPA, "BEND:LTUS:175:IDES.HOPR") field(INPB, "BEND:LTUS:175:STDZMINIPCT CPP NMS") field(INPC, "BEND:LTUS:175:IDES.LOPR") field(PREC, "5") } record(calc, "BEND:LTUS:175:STDZMINISETPT") { field(DESC, "Mini Stdz delta") field(CALC, "C==0?MAX(E-D,B):MIN(E+D,A)") field(INPA, "BEND:LTUS:175:IDES.HOPR") field(INPB, "BEND:LTUS:175:IDES.LOPR") field(INPC, "BEND:LTUS:175:STDZDIRECT.RVAL") field(INPD, "BEND:LTUS:175:STDZMINIDELTA") field(INPE, "BEND:LTUS:175:IDES") field(PREC, "5") field(FLNK, "BEND:LTUS:175: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, "BEND:LTUS:175:STDZMINISETPTOOR") { field(DESC, "Mini Stdz setpoint out of range") field(CALC, "C==0?(E-DA)") field(INPA, "BEND:LTUS:175:IDES.HOPR") field(INPB, "BEND:LTUS:175:IDES.LOPR") field(INPC, "BEND:LTUS:175:STDZDIRECT.RVAL") field(INPD, "BEND:LTUS:175:STDZMINIDELTA") field(INPE, "BEND:LTUS:175: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, "BEND:LTUS:175: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, "BEND:LTUS:175:IADJUST.RVAL") field(INPB, "BEND:LTUS:175:STDZDIRECT.RVAL") field(INPC, "BEND:LTUS:175:STDZOK.RVAL") field(INPD, "BEND:LTUS:175:STDZDISABLE.RVAL") field(INPE, "BEND:LTUS:175:STATE.RVAL CPP NMS") field(INPF, "BEND:LTUS:175:ICTRL.RVAL") field(INPG, "BEND:LTUS:175:STATE.SEVR") field(INPH, "BEND:LTUS:175:BDELTAS.M") field(INPI, "BEND:LTUS:175:IACT.SEVR") field(OUT, "BEND:LTUS:175:STDZLOSTGO.SELN PP NMS") field(OOPT, "Transition To Non-zero") } record(seq, "BEND:LTUS:175:STDZLOSTGO") { field(DESC, "Process lost stdz") field(SELM, "Mask") field(DOL1, "1") field(DOL2, "0") field(LNK1, "BEND:LTUS:175:STDZLOSTTOD.PROC") field(LNK2, "BEND:LTUS:175:STDZOK PP") } # Record maximum current after standardize # Reset to IACT from sequence after trim # Disable processing during (mini-)standardize or trim record(calc, "BEND:LTUS:175:STDZIACTMAX") { field(DESC, "Max act current after stdz") field(CALC, "MAX(A, B)") field(DISV, "0") field(SDIS, "BEND:LTUS:175:CHECKPWRDIP_ENABLE") field(INPA, "BEND:LTUS:175:IACT CP") field(INPB, "BEND:LTUS:175:STDZIACTMAX") field(EGU, "A") field(FLNK, "BEND:LTUS:175:CHECKPWRDIP") } # Detect power dip if STDZOK is YES, STDZ is enabled, and IACT is valid # If IACT drops below STDZIACTMAX by more than the trim tolerance, clear STDZOK # Warning: Take the absolute value of the trim tolerance, or else quads of # negative polarity will always lose STDZ since their IDELTAS.I are negative. # Note: Large quads and bends are prone to losing STDZ even if they are # perturbed toward higher current since their current tends to overshoot # by greater than the trim tolerance before settling down. record(calcout, "BEND:LTUS:175:CHECKPWRDIP") { field(DESC, "Detect power dip") field(CALC, "(A-B>ABS(C))?3:0") field(DISV, "0") field(SDIS, "BEND:LTUS:175:CHECKPWRDIP_ENABLE") field(INPA, "BEND:LTUS:175:STDZIACTMAX") field(INPB, "BEND:LTUS:175:IACT") field(INPC, "BEND:LTUS:175:IDELTAS.I") field(OUT, "BEND:LTUS:175:STDZLOSTGO.SELN PP NMS") field(OOPT, "When Non-zero") } # Enable processing of STDZIACTMAX and CHECKPWRDIP only if # STDZOK = YES, STDZDISABLE = NO, CTRL != Trim (2), and # CTRL != Stdz (4) record(calc, "BEND:LTUS:175:CHECKPWRDIP_ENABLE") { field(CALC, "A&&!B&&(C#2)&&(C#4)") field(INPA, "BEND:LTUS:175:STDZOK.RVAL CP") field(INPB, "BEND:LTUS:175:STDZDISABLE.RVAL CP") field(INPC, "BEND:LTUS:175:CTRL.RVAL CP") } #! 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, "BEND:LTUS:175: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, "BEND:LTUS:175: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, "BEND:LTUS:175:CALBSET") { field(DESC, "Use DAC Calbration") field(SCAN, "10 second") field(CALC, "A&&(B==0)&&C?31:960") field(INPA, "BEND:LTUS:175:CALBOK") field(INPB, "BEND:LTUS:175:CALBDISABLE") field(INPC, "BEND:LTUS:175:CALBSLOPE") field(OOPT, "On Change") field(OUT, "BEND:LTUS:175: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, "BEND:LTUS:175:CALB_SEQ") { field(DESC, "Output Calib Values") field(SELM, "Mask") field(SELL, "BEND:LTUS:175: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, "BEND:LTUS:175:CALBSLOPE") field(DOL3, "BEND:LTUS:175: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, "BEND:LTUS:175:CALBTOD") { field(DESC, "Calibration Success Time") field(PINI, "YES") # field(DOL, "") field(OMSL, "supervisory") field(DTYP, "Soft Channel") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:175: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, "BEND:LTUS:175: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, "BEND:LTUS:175: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, "BEND:LTUS:175:CALBOFFSET") { field(DESC, "Calc DAC Offset") field(PREC, "6") field(EGU, "Counts") field(PINI, "YES") } record(bo, "BEND:LTUS:175: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, "BEND:LTUS:175:DACSLOPE") { field(DESC, "V to DAC slope") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "supervisory") field(PINI, "YES") field(FLNK, "BEND:LTUS:175:DACOFFSET") } # Default Offset used in conversion from Volts to DAC Counts record(ao, "BEND:LTUS:175:DACOFFSET") { field(DESC, "V to DAC offset") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "supervisory") field(PINI, "YES") field(FLNK, "BEND:LTUS:175: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, "BEND:LTUS:175: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, "BEND:LTUS:175:IACT") field(INPD, "BEND:LTUS:175:DACSLOPE") field(INPE, "BEND:LTUS:175:DACOFFSET") field(EGU, "Counts") field(PREC, "6") } record(ao, "BEND:LTUS:175:DAC") { field(DESC, "DAC Set point") field(EGU, "Counts") field(DOL, "") field(OMSL, "supervisory") field(PREC, "6") field(PINI, "YES") } record(ao, "BEND:LTUS:175:CALBIMIN") { field(DESC, "Calibration Min Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(DRVH, "200.0") field(HOPR, "200.0") field(DRVL, "0.0") field(LOPR, "0.0") field(PREC, "3") field(EGU, "A") field(VAL, "0.0") field(FLNK, "BEND:LTUS:175:CALBIMAX") } record(ao, "BEND:LTUS:175:CALBIMAX") { field(DESC, "Calibration Max Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(DRVH, "200.0") field(HOPR, "200.0") field(LOPR, "0.0") field(DRVL, "0.0") field(EGU, "A") field(VAL, "200.0") field(FLNK, "BEND:LTUS:175:CALBSTEPNUM") } record(ao, "BEND:LTUS:175:CALBIFINAL") { field(DESC, "Calibration Last Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(PREC, "3") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(VAL, "0") } record(longout, "BEND:LTUS:175: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, "BEND:LTUS:175:CALBIDELTA") } record(calc, "BEND:LTUS:175:CALBIDELTA") { field(DESC, "Step size for CALB") field(CALC, "C=0?0:ABS((A-B)/C)") field(INPA, "BEND:LTUS:175:CALBIMAX") field(INPB, "BEND:LTUS:175:CALBIMIN") field(INPC, "BEND:LTUS:175: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, "BEND:LTUS:175:CALBIMULT") { field(DESC, "IACT vs ISETPT mult") field(CALC, "C#0||A=0?1:ABS(B/A)") field(INPA, "BEND:DMPS:400:ISETPT.DRVH") field(INPB, "BEND:DMPS:400:IACT.HOPR") field(INPC, "BEND:LTUS:175:PSCONTROLLER.RVAL CPP") field(EGU, "A") field(PINI, "YES") } # SNL dbputs DAC values here. 6-10 steps are possible. record(waveform, "BEND:LTUS:175:CALBICTRLWF") { field(DESC, "ICTRL setpoint array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") } record(waveform, "BEND:LTUS:175:DACWF") { field(DESC, "DAC count array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "BEND:LTUS:175:DACSA") } # Used only for xygraph edm plot record(subArray, "BEND:LTUS:175:DACSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "BEND:LTUS:175: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, "BEND:LTUS:175:CALCDACWF") { field(DESC, "Calc DAC counts array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "BEND:LTUS:175:CALCDACSA") } # Used only for xygraph edm plot record(subArray, "BEND:LTUS:175:CALCDACSA") { field(DESC, "Calc DAC counts") field(DTYP, "Soft Channel") field(INP, "BEND:LTUS:175: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, "BEND:LTUS:175:CALBYWF") { field(DESC, "mx + b") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "BEND:LTUS:175:CALBYSA") } # Used only for xygraph edm plot record(subArray, "BEND:LTUS:175:CALBYSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "BEND:LTUS:175:CALBYWF") field(MALM, "10") field(NELM, "6") field(INDX, "0") field(FTVL, "DOUBLE") } record(waveform, "BEND:LTUS:175:CALBIACTWF") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "BEND:LTUS:175:CALBIACTSA") } # Used only for xygraph edm plot record(subArray, "BEND:LTUS:175:CALBIACTSA") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(MALM, "10") field(NELM, "6") field(INP, "BEND:LTUS:175:CALBIACTWF") field(INDX, "0") field(FTVL, "DOUBLE") field(FLNK, "BEND:LTUS:175:CALBLIMITS") } # Check that measured current during calibration is within # tolerance. record(aSub, "BEND:LTUS:175: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, "BEND:LTUS:175:CALBSTEPNUM") field(INPB, "BEND:LTUS:175:CALBIACTWF") field(INPC, "BEND:LTUS:175: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, "BEND:LTUS:175: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, "BEND:LTUS:175:STDZITOL") field(INPH, "BEND:LTUS:175:DACSLOPE") field(INPI, "BEND:LTUS:175: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, "BEND:LTUS:175: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, "BEND:LTUS:175:CALBSTEPNUM") field(INPB, "BEND:LTUS:175:CALBIACTWF") field(INPC, "BEND:LTUS:175:DACWF") field(INPF, "BEND:LTUS:175: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 BEND:LTUS:175CALBOK 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, "BEND:LTUS:175:DEGAUSINIT") { field(DESC, "Proc. Degauss PVs on boot") field(PINI, "YES") field(DOL, "1") field(OUTA, "BEND:LTUS:175:DEGAUSIMIN.PROC PP") field(OUTB, "BEND:LTUS:175:DEGAUSIMAX.PROC PP") field(OUTC, "BEND:LTUS:175:DEGAUSTYPE.PROC PP") field(OUTD, "BEND:LTUS:175:DEGAUSSTEP.PROC PP") field(OUTE, "BEND:LTUS:175:MADNAME.PROC PP") field(OUTF, "BEND:LTUS:175:PSTYPE.PROC PP") field(OUTG, "BEND:LTUS:175: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, "BEND:LTUS:175:DEGAUSSUB") { field(DESC, "Degauss subroutine") field(INAM, "mgntDegaussInit") field(SNAM, "mgntDegauss") field(BRSV, "INVALID") field(INPA, "BEND:LTUS:175:DEGAUSIMIN NPP NMS") field(INPB, "BEND:LTUS:175:DEGAUSIMAX NPP NMS") field(INPC, "BEND:LTUS:175:DEGAUSTYPE.RVAL NPP NMS") field(INPE, "BEND:LTUS:175:DEGAUSMETHOD.RVAL NPP NMS") field(INPF, "BEND:LTUS:175:PSTYPE NPP NMS") field(INPG, "BEND:LTUS:175:DEBUG.RVAL NPP NMS") field(INPH, "BEND:LTUS:175: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, "BEND:LTUS:175:DEGAUSWF PP") field(OUTB, "BEND:LTUS:175:DEGAUSMSG PP") field(OUTC, "BEND:LTUS:175: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, "BEND:LTUS:175:DEGAUSWF") { field(DESC, "Degauss Setpts") field(NELM, "60") field(FTVL, "DOUBLE") } record(mbbo,"BEND:LTUS:175: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, "BEND:LTUS:175: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, "BEND:LTUS:175: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, "BEND:LTUS:175: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, "BEND:LTUS:175: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, "BEND:LTUS:175:DEGAUSIMIN") { field(DESC, "Min. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "200.0") field(LOPR, "-200.0") field(DRVH, "200.0") field(DRVL, "-200.0") field(VAL, "-200.0") } record(ao, "BEND:LTUS:175:DEGAUSIMAX") { field(DESC, "Max. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "200.0") field(LOPR, "-200.0") field(DRVH, "200.0") field(DRVL, "-200.0") field(VAL, "200.0") } # 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,"BEND:LTUS:175: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, "BEND:LTUS:175: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,"BEND:LTUS:175: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, "BEND:LTUS:175: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, "BEND:LTUS:175: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, "BEND:LTUS:175: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, "BEND:LTUS:175:DEGAUSTOD") { field(DESC, "Successful Degauss Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "BEND:LTUS:175:DEGAUSLOSTTOD") { field(DESC, "Degauss Lost Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:175:DEGAUSTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "BEND:LTUS:175:DEGAUSTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "BEND:LTUS:175: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, "BEND:LTUS:175:DEGAUSGO") { field(DESC, "Set bdes of btrms to zero") field(ASG, "Internal") field(OUTA, "") field(OUTB, "") field(OUTC, "") field(OUTD, "") } # =========== CRYO ONLY =========== record(bo, "BEND:LTUS:175: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, "BEND:LTUS:175:DEGAUS_IMAX_CHECK") { field(DESC, "Check if imax shoud chg") field(CALC, "(C==4)&&(ABS(B)>ABS(A))?1:0") field(INPA, "BEND:LTUS:175:DEGAUS_IMAX") field(INPB, "BEND:LTUS:175:ISETPT") field(INPC, "BEND:LTUS:175:DEGAUSTYPE.RVAL") field(OUT, "BEND:LTUS:175:DEGAUS_IMAX_UPDATE.SELN") field(FLNK, "BEND:LTUS:175:DEGAUS_IMAX_UPDATE") } record(seq, "BEND:LTUS:175:DEGAUS_IMAX_UPDATE") { field(DESC, "Degauss IMAX Update") field(SELM, "Specified") field(DOL1, "BEND:LTUS:175:ISETPT") field(LNK1, "BEND:LTUS:175:DEGAUS_IMAX PP") } # Set the maximum current after a successful # degauss. This pv is updated by the # sequence. record(ao, "BEND:LTUS:175:DEGAUS_IMAX") { field(DESC, "Max I set afer a degauss") field(EGU, "Amps") field(PINI, "YES") field(PREC, "6") field(HOPR, "200.0") field(LOPR, "-200.0") field(DRVH, "200.0") field(DRVL, "-200.0") field(VAL, "200.0") field(FLNK, "BEND:LTUS:175:DEGAUS_IMAXPOL_CHECK") info(autosaveFields,"VAL,RVAL") } # Set the polarity if degauss_imax record(calcout, "BEND:LTUS:175:DEGAUS_IMAXPOL_CHECK") { field(DESC, "Determine polarity of imax") field(CALC, "A>=0?0:1") field(INPA, "BEND:LTUS:175:DEGAUS_IMAX") field(FLNK, "BEND:LTUS:175:DEGAUS_IMAXPOL") } record(bo, "BEND:LTUS:175:DEGAUS_IMAXPOL") { field(DESC, "Polarity of imax I") field(DTYP, "Raw Soft Channel") field(DOL, "BEND:LTUS:175:DEGAUS_IMAXPOL_CHECK") field(OMSL, "closed_loop") field(ZNAM, "Positive") field(ONAM, "Negative") field(FLNK, "BEND:LTUS:175: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, "BEND:LTUS:175:DEGAUS_ABSIMAX") { field(DESC, "Absolute Max. Degauss I") field(CALC, "ABS(A)") field(INPA, "BEND:LTUS:175:DEGAUS_IMAX") field(PREC, "6") field(EGU, "Amps") field(HOPR, "200.0") field(LOPR, "-200.0") info(autosaveFields,"VAL RVAL") } # IACT Polarity record(calcout, "BEND:LTUS:175:IACTPOL_CHECK") { field(DESC, "Determine IACT polarity") field(SCAN, "5 second") field(CALC, "ABS(A-B)>C?(A>=0?0:1):D") field(INPA, "BEND:LTUS:175:IACT") field(INPB, "BEND:LTUS:175:IACTPOL_CHECK.LA") field(INPC, "0.0001") field(INPD, "BEND:LTUS:175:IACTPOL_CHECK.PVAL") field(OOPT, "On Change") field(FLNK, "BEND:LTUS:175:IACTPOL") } record(bo, "BEND:LTUS:175: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,"BEND:LTUS:175: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, "BEND:LTUS:175:DEGAUSENABLE CP") field(INPB, "BEND:LTUS:175:DEGAUSOK") field(INPC, "BEND:LTUS:175:STATE CP") field(INPD, "BEND:LTUS:175:STATE.SEVR") field(OUT, "BEND:LTUS:175:DEGAUS_STATE_SEQ.SELN PP") field(ASG, "Internal") } record(seq, "BEND:LTUS:175:DEGAUS_STATE_SEQ") { field(DESC, "Degauss State Sequence") field(SELM, "Specified") field(SELL, "BEND:LTUS:175:DEGAUS_STATE_CHECK") field(LNK1, "BEND:LTUS:175:DEGAUS_STATE_DISABLE.PROC PP") field(LNK2, "BEND:LTUS:175:DEGAUS_STATE_LOST.PROC PP") field(LNK3, "BEND:LTUS:175:DEGAUS_STATE_GOOD.PROC PP") field(LNK4, "BEND:LTUS:175: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, "BEND:LTUS:175:DEGAUS_STATE_DISABLE") { field(DESC, "Degauss not used") field(LNK1, "BEND:LTUS:175:DEGAUSOK.ZSV") field(LNK2, "BEND:LTUS:175: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, "BEND:LTUS:175:STATMSG.FRSV") field(LNK4, "BEND:LTUS:175: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, "BEND:LTUS:175:DEGAUS_STATE_LOST") { field(DESC, "Degauss lost and ps On") field(DOL1, "1") field(LNK1, "BEND:LTUS:175:DEGAUSOK.ZSV") field(LNK2, "BEND:LTUS:175: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, "BEND:LTUS:175:STATMSG.FRSV") field(LNK4, "BEND:LTUS:175: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, "BEND:LTUS:175:DEGAUS_STATE_OFF") { field(DESC, "Degaused lost and ps Off") field(DOL1, "2") field(LNK1, "BEND:LTUS:175: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, "BEND:LTUS:175:STATMSG.FRSV") field(LNK3, "BEND:LTUS:175: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, "BEND:LTUS:175:DEGAUS_STATE_GOOD") { field(DESC, "Degauss good") field(DOL1, "1") field(LNK1, "BEND:LTUS:175: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, "BEND:LTUS:175:STATMSG.FRSV PP") field(LNK3, "BEND:LTUS:175:STATMSG.FVSV PP") field(LNK4, "") field(ASG, "Internal") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(mbbo, "BEND:LTUS:175:FUNC") { field(DESC, "BEND:LTUS:175 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, "0") field(FFVL, "0") field(OUT, "BEND:LTUS:175:CTRL CA") } # :CTRL pv is processed at boot in the # sequence mgntCtrl.st Processed in sequence # record(mbbo, "BEND:LTUS:175:CTRL") { field(DESC, "BEND:LTUS:175 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, "BEND:LTUS:175:SELECTEN.A PP") field(SDIS, "0") } # If a function has been selected set this unit to busy record(calcout, "BEND:LTUS:175:SELECTEN") { field(DESC, "Control Select Enable") field(CALC, "A>0?1:A") field(FLNK, "BEND:LTUS:175:BUSY") } # Set to FREE on IOC reboot record(bo, "BEND:LTUS:175:BUSY") { field(DESC, "BEND:LTUS:175 Ctrl Done") field(DOL, "BEND:LTUS:175:SELECTEN") field(ZNAM, "FREE") field(ONAM, "BUSY") field(PINI, "YES") field(FLNK, "BEND:LTUS:175:SELECT") } record(bo, "BEND:LTUS:175:SELECT") { field(ZNAM, "NO") field(ONAM, "YES") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") } record(bo, "BEND:LTUS:175: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, "BEND:LTUS:175:CTRLSTATE") { field(DESC, "BEND:LTUS:175 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("BEND:LTUS:175:CTRL",20,20,0,0,"BEND:LTUS:175:CTRL") #! Field("BEND:LTUS:175:CTRL.OUT",16777215,1,"BEND:LTUS:175:CTRL.OUT") #! Link("BEND:LTUS:175:CTRL.OUT","BEND:LTUS:175:SELECTEN.A") #! Field("BEND:LTUS:175:CTRL.VAL",16777215,1,"BEND:LTUS:175:CTRL.VAL") #! Record("BEND:LTUS:175:SELECTEN",321,381,0,0,"BEND:LTUS:175:SELECTEN") #! Field("BEND:LTUS:175:SELECTEN.A",16777215,0,"BEND:LTUS:175:SELECTEN.A") #! Field("BEND:LTUS:175:SELECTEN.FLNK",16777215,1,"BEND:LTUS:175:SELECTEN.FLNK") #! Link("BEND:LTUS:175:SELECTEN.FLNK","BEND:LTUS:175:BUSY") #! Field("BEND:LTUS:175:SELECTEN.VAL",16777215,1,"BEND:LTUS:175:SELECTEN.VAL") #! Record("BEND:LTUS:175:BUSY",623,274,0,0,"BEND:LTUS:175:BUSY") #! Field("BEND:LTUS:175:BUSY.DOL",16777215,0,"BEND:LTUS:175:BUSY.DOL") #! Link("BEND:LTUS:175:BUSY.DOL","BEND:LTUS:175:SELECTEN.VAL") #! Field("BEND:LTUS:175:BUSY.FLNK",16777215,1,"BEND:LTUS:175:BUSY.FLNK") #! Link("BEND:LTUS:175:BUSY.FLNK","BEND:LTUS:175:SELECT") #! Record("BEND:LTUS:175:SELECT",669,508,0,1,"BEND:LTUS:175:SELECT") #! Record("BEND:LTUS:175:FUNC",940,120,0,0,"BEND:LTUS:175:FUNC") #! Field("BEND:LTUS:175:FUNC.OUT",16777215,0,"BEND:LTUS:175:FUNC.OUT") #! Link("BEND:LTUS:175:FUNC.OUT","BEND:LTUS:175:CTRL.VAL") #! Record("BEND:LTUS:175:ABORT",193,41,0,0,"BEND:LTUS:175:ABORT") #! Record("BEND:LTUS:175:CTRLSTATE",369,34,0,0,"BEND:LTUS:175: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,"BEND:LTUS:175:SELECT is used for Multi-device selection.\nIt is enabled when associated BEND:LTUS:175:CTRL is \"0\" (DONE).\nIt is disabled when associated BEND:LTUS:175: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,"BEND:LTUS:175: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, "BEND:LTUS:175:BCTRL_INIT") { field(DESC, "Process BCTRL on boot") field(PINI, "YES") field(CALC, "A=3?1:0") field(INPA, "BEND:LTUS:175:BCTRL.SEVR") field(OUT, "BEND:LTUS:175: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, "BEND:LTUS:175:BACT") { field(DESC, "Actual B") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "BEND:LTUS:175:BACT") field(INPB, "BEND:LTUS:175:POLYCOEF") field(INPC, "BEND:LTUS:175:POLYCOEF.A") field(INPD, "BEND:LTUS:175:POLYCOEF.B") field(INPE, "BEND:LTUS:175:IACTCALC MS") field(INPF, "BEND:LTUS:175:BDELTAS PP") field(INPG, "100") field(EGU, "GeV/c") field(HOPR, "15.8154") field(LOPR, "0.0835") field(HIHI, "15.8154") field(LOLO, "0.0835") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "15.8154") field(LOW, "0.0835") field(FLNK, "BEND:LTUS:175: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, "BEND:LTUS:175:BDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntPhyDeltas") field(EGU, "GeV/c") field(HOPR, "1") field(PREC, "7") field(BRSV, "INVALID") field(INPA, "BEND:LTUS:175:BDES") field(INPB, "BEND:LTUS:175:TRIMBTOL") field(INPC, "BEND:LTUS:175:TRIMBTOLR") field(INPD, "BEND:LTUS:175:CHCKBTOL") field(INPE, "BEND:LTUS:175:CHCKBTOLR") field(F, "2.0") field(INPG, "30") field(INPH, "BEND:LTUS:175:BACT.VAL") # # MPS absolute and relative tolerances field(INPP, "BEND:LTUS:175:MPSBTOL") field(INPQ, "BEND:LTUS:175:MPSBTOLR") field(FLNK, "BEND:LTUS:175:BCONLIMITS") info(autosaveFields,"F") } # This record is processed by BDELTAS record(aSub, "BEND:LTUS:175:BCONLIMITS") { field(DESC, "Config B-field Limits") field(INAM, "mgntInit") field(SNAM, "mgntBCONLimits") field(INPA, "BEND:LTUS:175:BDES") field(INPB, "BEND:LTUS:175:BDELTAS.I") field(INPG, "BEND:LTUS:175:DEBUG.RVAL") field(FTA, "DOUBLE") field(FTB, "DOUBLE") field(FTG, "ULONG") field(OUTA, "BEND:LTUS:175:BCON.HIGH") field(OUTB, "BEND:LTUS:175:BCON.LOW") field(OUTC, "BEND:LTUS:175:BCON.HIHI") field(OUTD, "BEND:LTUS:175:BCON.LOLO PP") field(FTVA, "DOUBLE") field(FTVB, "DOUBLE") field(FTVC, "DOUBLE") field(FTVD, "DOUBLE") field(BRSV, "INVALID") field(FLNK, "BEND:LTUS:175:IDELTAS") } # The following PV is processed by :BACT # which is processed by :BACT # record(fanout, "BEND:LTUS:175:BACTFO") { field(DESC, "BACT processing") field(SELM, "All") field(LNK1, "BEND:LTUS:175:BDIFF") field(LNK2, "BEND:LTUS:175:BADIFF") field(LNK3, "BEND:LTUS:175:BRATIO") field(LNK4, "BEND:LTUS:175:MPSLIMITS") field(LNK5, "BEND:LTUS:175:I2BSTATUS") field(LNK6, "BEND:LTUS:175:IACTFO.PROC") } record(calc, "BEND:LTUS:175:BDIFF") { field(DESC, "BDES-BACT") field(CALC, "A-B") field(INPA, "BEND:LTUS:175:BDES") field(INPB, "BEND:LTUS:175:BACT") field(EGU, "GeV/c") field(PREC, "7") } record(calc, "BEND:LTUS:175:BADIFF") { field(DESC, "Absolute BDES-BACT") field(INPA, "BEND:LTUS:175:BDIFF") field(EGU, "GeV/c") field(PREC, "7") field(CALC, "A<0?ABS(A):A") } record(calc, "BEND:LTUS:175:BRATIO") { field(DESC, "BACT Error") field(CALC, "B?A/B:0") field(INPA, "BEND:LTUS:175:BDIFF") field(INPB, "BEND:LTUS:175:BDES.HOPR") field(EGU, "GeV/c") field(PREC, "7") } record(mbbi, "BEND:LTUS:175: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, "BEND:LTUS:175:BACT.J") } # Note: for a string slave set the MONFL # macro to the following: # MONFL=:IMONCALC MS record(sub, "BEND:LTUS:175:BMON") { field(DESC, "Second Transductor") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "BEND:LTUS:175:BMON") field(INPB, "BEND:LTUS:175:POLYCOEF") field(INPC, "BEND:LTUS:175:POLYCOEF.A") field(INPD, "BEND:LTUS:175:POLYCOEF.B") field(INPE, "BEND:LTUS:175:IMONCALC MS") field(INPF, "BEND:LTUS:175:BDELTAS.VAL") field(INPG, "100") field(EGU, "GeV/c") field(HOPR, "15.8154") field(LOPR, "0.0835") field(HIHI, "15.8154") field(LOLO, "0.0835") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "15.8154") field(LOW, "0.0835") } # 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=BEND:DMPS:400:BDES CP record(ao, "BEND:LTUS:175:BDES") { field(DESC, "Desired B-Field") field(PINI, "NO") field(DRVH, "15.8154") field(DRVL, "0.0835") field(HOPR, "15.8154") field(LOPR, "0.0835") field(PREC, "7") field(EGU, "GeV/c") field(MDEL, "-1") field(OMSL, "closed_loop") field(DOL, "BEND:LTUS:175:IDES2BDES") field(OUT, "BEND:LTUS:175:B2IDES PP") info(autosaveFields,"VAL") } record(sub, "BEND:LTUS:175:B2IDES") { field(DESC, "Convert Desired B-Field to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "BEND:LTUS:175:POLYCOEF") field(INPC, "BEND:LTUS:175:POLYCOEF.A") field(INPD, "BEND:LTUS:175:POLYCOEF.B") field(PREC, "7") field(EGU, "GeV/c") field(HOPR, "15.8154") field(LOPR, "0.0835") field(MDEL, "-1") field(INPE, "BEND:LTUS:175:BDES.DRVH") field(INPF, "BEND:LTUS:175:BDES.DRVL") field(BRSV, "INVALID") field(FLNK, "BEND:LTUS:175:IDES") } record(sub, "BEND:LTUS:175:BNOM") { field(DESC, "Nominal Field") field(PINI, "YES") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "BEND:LTUS:175:POLYCOEF") field(INPC, "BEND:LTUS:175:POLYCOEF.A") field(INPD, "BEND:LTUS:175:POLYCOEF.B") field(INPE, "BEND:LTUS:175:BDES.DRVH") field(INPF, "BEND:LTUS:175:BDES.DRVL") field(EGU, "GeV/c") field(HOPR, "15.8154") field(LOPR, "0.0835") field(PREC, "7") field(VAL, "0.0") field(FLNK, "BEND:LTUS:175:INOM") } record(sub, "BEND:LTUS:175:BACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "BEND:LTUS:175:BDES.VAL") field(INPB, "BEND:LTUS:175:BDES.DRVH") field(INPC, "BEND:LTUS:175:BDES.DRVL") field(INPD, "BEND:LTUS:175:BDELTAS.I") field(INPE, "BEND:LTUS:175:BDELTAS.J") field(INPG, "BEND:LTUS:175:STATE") field(INPH, "BEND:LTUS:175:HSTA") field(EGU, "GeV/c") field(HOPR, "15.8154") field(LOPR, "0.0835") field(PREC, "7") field(BRSV, "INVALID") } record(sub, "BEND:LTUS:175:BMONLIMITS") { field(DESC, "MON Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "BEND:LTUS:175:BDES.VAL") field(INPB, "BEND:LTUS:175:BDES.DRVH") field(INPC, "BEND:LTUS:175:BDES.DRVL") field(INPD, "BEND:LTUS:175:BDELTAS.K") field(INPE, "BEND:LTUS:175:BDELTAS.L") field(INPG, "BEND:LTUS:175:STATE") field(INPH, "BEND:LTUS:175:HSTA") field(EGU, "GeV/c") field(HOPR, "15.8154") field(LOPR, "0.0835") field(PREC, "7") field(BRSV, "INVALID") } record(seq, "BEND:LTUS:175:BLIMITS") { field(DESC, "ACT Limits") field(PREC, "7") field(DOL1, "BEND:LTUS:175:BLIMITS") field(LNK1, "BEND:LTUS:175:BACTLIMITS.F PP") field(DOL2, "BEND:LTUS:175:BACTLIMITS.I") field(LNK2, "BEND:LTUS:175:BACT.HIGH") field(DOL3, "BEND:LTUS:175:BACTLIMITS.J") field(LNK3, "BEND:LTUS:175:BACT.LOW") field(DOL4, "BEND:LTUS:175:BACTLIMITS.K") field(LNK4, "BEND:LTUS:175:BACT.HIHI") field(DOL5, "BEND:LTUS:175:BACTLIMITS.L") field(LNK5, "BEND:LTUS:175:BACT.LOLO") field(DOL6, "BEND:LTUS:175:BLIMITS") field(LNK6, "BEND:LTUS:175:BMONLIMITS.F PP") field(DOL7, "BEND:LTUS:175:BMONLIMITS.I") field(LNK7, "BEND:LTUS:175:BMON.HIGH") field(DOL8, "BEND:LTUS:175:BMONLIMITS.J") field(LNK8, "BEND:LTUS:175:BMON.LOW") field(DOL9, "BEND:LTUS:175:BMONLIMITS.K") field(LNK9, "BEND:LTUS:175:BMON.HIHI") field(DOLA, "BEND:LTUS:175:BMONLIMITS.L") field(LNKA, "BEND:LTUS:175:BMON.LOLO") field(FLNK, "BEND:LTUS:175:ILIMITS") field(SCAN, "5 second") } record(ao, "BEND:LTUS:175:BCTRL") { field(DESC, "B-Perturb") field(PREC, "7") field(EGU, "GeV/c") field(DRVH, "15.8154") field(DRVL, "0.0835") field(HOPR, "15.8154") field(LOPR, "0.0835") # 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, "BEND:LTUS:175: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, "BEND:LTUS:175:BCTRLGO") { field(DESC, "Update DES and perturb") field(PREC, "7") # Disable BACT limits field(DOL1, "1") field(LNK1, "BEND:LTUS:175:BLIMITS.VAL") # Update BDES with the BCTRL (slider) value field(DOL2, "BEND:LTUS:175:BCTRL.VAL") field(LNK2, "BEND:LTUS:175:BDES PP") field(DOL3, "1") field(LNK3, "BEND:LTUS:175:IDIRECT.PROC PP") field(DOL4, "1") field(LNK4, "BEND:LTUS:175:CHECKSTDZLOST.PROC PP") field(DOL5, "BEND:LTUS:175:BCTRL.VAL") field(LNK5, "BEND:LTUS:175:BCTRLSUB PP") # Re-enable BACT limits field(DOL6, "0") field(LNK6, "BEND:LTUS:175:BLIMITS.VAL") } # Convert B-field to Current and output to ISETPT record(sub, "BEND:LTUS:175:BCTRLSUB") { field(DESC, "Feedback") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "BEND:LTUS:175:POLYCOEF") field(INPC, "BEND:LTUS:175:POLYCOEF.A") field(INPD, "BEND:LTUS:175:POLYCOEF.B") field(INPE, "BEND:LTUS:175:BDES.DRVH") field(INPF, "BEND:LTUS:175:BDES.DRVL") field(PREC, "7") field(EGU, "GeV/c") field(HOPR, "15.8154") field(LOPR, "0.0835") field(MDEL, "-1") field(BRSV, "INVALID") field(FLNK, "BEND:LTUS:175:ISETPT") } record(ao, "BEND:LTUS:175:BDESPREVTRIM") { field(DESC, "trim bdes for undo") field(DTYP, "Soft Channel") field(DRVH, "15.8154") field(DRVL, "0.0835") field(EGU, "GeV/c") field(HOPR, "15.8154") field(LOPR, "0.0835") field(PREC, "7") field(PINI, "YES") info(autosaveFields,"VAL") } record(stringin, "BEND:LTUS:175:MADNAME") { field(DESC, "MAD deck nomenclature") field(PINI, "YES") field(VAL, "BX31B") } record(ai, "BEND:LTUS:175: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, "3248.89504") } record(ao, "BEND:LTUS:175:BMAX") { field(DESC, "Max B-Field") field(DTYP, "Soft Channel") field(DRVH, "15.8154") field(DRVL, "0.0835") field(EGU, "GeV/c") field(HOPR, "15.8154") field(LOPR, "0.0835") field(PREC, "7") field(PINI, "YES") field(VAL, "15.8154") field(FLNK, "BEND:LTUS:175:BSTEP") } record(ao, "BEND:LTUS:175:BMIN") { field(DESC, "Min B-Field") field(DTYP, "Soft Channel") field(DRVH, "15.8154") field(DRVL, "0.0835") field(EGU, "GeV/c") field(HOPR, "15.8154") field(LOPR, "0.0835") field(PREC, "7") field(PINI, "YES") field(VAL, "0.0835") field(FLNK, "BEND:LTUS:175:BSTEP") } record(ao, "BEND:LTUS:175:BDESSAVE") { field(DESC, "bdes for save/load") field(DTYP, "Soft Channel") field(DRVH, "15.8154") field(DRVL, "0.0835") field(EGU, "GeV/c") field(HOPR, "15.8154") field(LOPR, "0.0835") field(PINI, "YES") field(PREC, "7") } # This record is processed by BEND:LTUS:175: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, "BEND:LTUS:175:BCON") { field(DESC, "Config B-Field ") field(DTYP, "Soft Channel") field(PREC, "7") field(EGU, "GeV/c") field(HOPR, "15.8154") field(LOPR, "0.0835") field(DRVH, "15.8154") field(DRVL, "0.0835") # 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 , "BEND:LTUS:175:ICON2BCON") field(OMSL, "closed_loop") field(OUT, "BEND:LTUS:175:B2ICON PP") info(autosaveFields,"VAL") } record(sub, "BEND:LTUS:175:B2ICON") { field(DESC, "Convert Desired ICon to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "BEND:LTUS:175:POLYCOEF") field(INPC, "BEND:LTUS:175:POLYCOEF.A") field(INPD, "BEND:LTUS:175:POLYCOEF.B") field(PREC, "7") field(EGU, "GeV/c") field(HOPR, "15.8154") field(LOPR, "0.0835") field(MDEL, "-1") field(INPE, "BEND:LTUS:175:BCON.DRVH") field(INPF, "BEND:LTUS:175:BCON.DRVL") field(BRSV, "INVALID") field(FLNK, "BEND:LTUS:175: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, "BEND:LTUS:175:BSTEP") { field(DESC, "B-Field step size") field(CALC, "(C==3)||(D==3)?0:ABS(A-B)*0.005") field(INPA, "BEND:LTUS:175:BMAX") field(INPB, "BEND:LTUS:175:BMIN") field(INPC, "BEND:LTUS:175:BMIN.SEVR") field(INPD, "BEND:LTUS:175:BMAX.SEVR") field(EGU, "GeV/c") 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,"BEND:LTUS:175:BCTRLDISABLECALC") { field(DESC, "Calc for disabling BCTRL") field(ASG, "Internal") field(CALC, "A?2:1") field(INPA, "BEND:LTUS:175:ONLINE CP") field(OUT, "BEND:LTUS:175:BCTRLDISABLEFOUT PP") } record(fanout, "BEND:LTUS:175:BCTRLDISABLEFOUT") { field(DESC, "Disable BCTRL fanout") field(SELM, "Specified") field(SELL, "BEND:LTUS:175:BCTRLDISABLECALC") field(LNK1, "BEND:LTUS:175:BCTRLDISABLE") field(LNK2, "BEND:LTUS:175:BCTRLENABLE") } record(stringout, "BEND:LTUS:175:BCTRLDISABLE") { field(DESC, "Disable BCTRL") field(DTYP, "Soft Channel") field(OUT, "BEND:LTUS:175:BCTRL.ASG") field(VAL, "NOWRITE") field(FLNK, "BEND:LTUS:175:BCTRLDISV_UPDATE") } record(stringout, "BEND:LTUS:175:BCTRLENABLE") { field(DESC, "Enable BCTRL") field(DTYP, "Soft Channel") field(OUT, "BEND:LTUS:175:BCTRL.ASG") field(VAL, "") field(FLNK, "BEND:LTUS:175:BCTRLDISV_UPDATE") } record(calcout, "BEND:LTUS:175:BCTRLDISV_UPDATE") { field(DESC, "Calc for updating BCTRL.DISV") field(ASG, "Internal") field(CALC, "A") field(INPA, "BEND:LTUS:175:ONLINE") field(OUT, "BEND:LTUS:175: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,"BEND:LTUS:175:BACT and MON\n are processed via links from \n BEND:LTUS:175:IACT (device raw value readback 1)\n and\n BEND:LTUS:175: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 BEND:LTUS:175:POLYCOEF\nC = First polynomial coefficient (offset if linear)\nD = Second polynomial coefficient (slope if linear)\nE = BEND:LTUS:175: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,"BEND:LTUS:175:BDES\n is processed when set by CA users or \n BEND:LTUS:175: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,"BEND:LTUS:175: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 BEND:LTUS:175: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 (BEND:LTUS:175: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,"BEND:LTUS:175:B*LIMITS and BEND:LTUS:175:BLIMITS:\n Calculate alarm and warning limits based on \n deltas from BEND:LTUS:175: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,"BEND:LTUS:175: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,"BEND:LTUS:175: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, "BEND:LTUS:175: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, "BEND:LTUS:175:MPSBTOL") { field(DESC, "Absolute mps tol") field(EGU, "GeV/c") field(PREC, "2") field(CALC, "ABS(A)*0.02") field(INPA, "BEND:LTUS:175:BMAX") field(PINI, "YES") } # # 21-Aug-2013: K. Luchini # Set channel access security so that users # cannot easily change values. record(ao, "BEND:LTUS:175:MPSBMAX") { field(DESC, "MPS Max B-field") field(EGU, "GeV/c") field(PREC, "7") field(DRVH, "15.8154") field(DRVL, "0.0835") field(PINI, "YES") field(VAL, "15.8154") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:175:MPSBMIN") { field(DESC, "MPS Min B-field") field(EGU, "GeV/c") field(PREC, "7") field(DRVH, "15.8154") field(DRVL, "0.0835") field(PINI, "YES") field(VAL, "0.0835") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:175:MPSBLLIM") { field(DESC, "MPS Low Limit B-field") field(EGU, "GeV/c") field(PREC, "7") field(DRVH, "15.8154") field(DRVL, "0.0835") field(PINI, "YES") field(VAL, "0.0835") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:175:MPSBLLIM2") { field(DESC, "MPS Low Limit #2 B-field") field(EGU, "GeV/c") field(PREC, "7") field(DRVH, "15.8154") field(DRVL, "0.0835") field(PINI, "YES") field(VAL, "0.0835") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } # Set the default to Std record(mbbo, "BEND:LTUS:175: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, "BEND:LTUS:175:MPSLIMITS.E PP") } record(aSub, "BEND:LTUS:175: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, "BEND:LTUS:175:MPS.RVAL") field(INPB, "BEND:LTUS:175:BADIFF") field(INPC, "BEND:LTUS:175:BDELTAS.N") field(INPD, "BEND:LTUS:175:BACT") field(INPE, "BEND:LTUS:175:MPSBITMASK.RVAL") field(INPF, "BEND:LTUS:175:MPSBLLIM") field(INPG, "BEND:LTUS:175:MPSBMIN") field(INPH, "BEND:LTUS:175:MPSBMAX") field(INPI, "BEND:LTUS:175: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, "BEND:LTUS:175:INTOL.RVAL PP") field(OUTB, "BEND:LTUS:175:INTOL_BMIN.RVAL PP") field(OUTC, "BEND:LTUS:175:INTOL_BRANGE.RVAL PP") field(OUTD, "BEND:LTUS:175: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, "BEND:LTUS:175:INTOL") { field(DESC, "BACT within MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "BEND:LTUS:175:MPSLIMITS.VALA") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "BEND:LTUS:175:INTOL_BMIN") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "BEND:LTUS:175:MPSLIMITS.VALB") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "BEND:LTUS:175:INTOL_BMIN2") { field(DESC, "MPS tol #2") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "BEND:LTUS:175:MPSLIMITS.VALD") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "BEND:LTUS:175:INTOL_BRANGE") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "BEND:LTUS:175: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, "BEND:LTUS:175:CHCKITOL") { field(DESC, "Absolute Check I Tolerance") field(EGU, "A") field(FLNK, "BEND:LTUS:175:TRIMITOL") field(CALC, "ABS(A*B)") field(INPA, "BEND:LTUS:175:CHCKBTOL") field(INPB, "BEND:LTUS:175:POLYCOEF.B") field(PREC, "9") } record(calc, "BEND:LTUS:175:TRIMBTOL") { field(EGU, "GeV/c") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(DESC, "Absolute Trim Tolerance") field(CALC, "ABS(A)/2") field(INPA, "BEND:LTUS:175:CHCKBTOL") field(FLNK, "BEND:LTUS:175:CHCKITOL") } record(calc, "BEND:LTUS:175:CHCKBTOL") { field(DESC, "Check absolute tolerance") field(EGU, "A") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(FLNK, "BEND:LTUS:175:TRIMBTOL") field(CALC, "MAX(ABS(A),ABS(C))*(B/1000000)") field(INPA, "BEND:LTUS:175:BDES.HOPR") field(INPB, "BEND:LTUS:175:STABILITY") field(INPC, "BEND:LTUS:175:BDES.LOPR") } record(longout, "BEND:LTUS:175: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, "BEND:LTUS:175:CHCKBTOL") } record(calc, "BEND:LTUS:175:TRIMITOL") { field(DESC, "Absolute Trim I Tolerance") field(EGU, "GeV/c") field(CALC, "ABS(A*B)") field(INPA, "BEND:LTUS:175:POLYCOEF.B") field(INPB, "BEND:LTUS:175:TRIMBTOL") field(PREC, "9") } record(ai, "BEND:LTUS:175:TRIMBTOLR") { field(DESC, "Relative trim tol") field(PREC, "4") field(EGU, "%") field(HOPR, "1.0") field(LOPR, "0.0") field(PINI, "YES") } record(ai, "BEND:LTUS:175: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, "BEND:LTUS:175:FBCKFCOM") { field(ZNAM, "CA") field(ONAM, "FCOM") field(DESC, "CA Mode") field(PINI, "YES") field(SDIS, "0") } record(bo, "BEND:LTUS:175:PAU") { field(ZNAM, "NotConfigured") field(ONAM, "Configured") field(DESC, "PAU Present") field(PINI, "YES") field(SDIS, "0") field(FLNK, "BEND:LTUS:175:PAUGO") } record(fanout, "BEND:LTUS:175:PAUGO") { field(DESC, "PAU control") field(LNK1, "BEND:LTUS:175:PAUSTOP") field(LNK2, "BEND:LTUS:175: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, "BEND:LTUS:175:PAUSTART") { field(DESC, "Setup for PAU On") field(SDIS, "BEND:LTUS:175: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, "BEND:LTUS:175:PAUSTOP") { field(DESC, "Setup for PAU Off") field(SDIS, "BEND:LTUS:175: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, "BEND:LTUS:175:MCORDEVNAME") { field(DESC, "PS device name") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, "BEND:DMPS:400:") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "BEND:LTUS:175: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, "BEND:LTUS:175:PSTYPE.RVAL") field(INPC, "BEND:LTUS:175:TURNEDOFF.RVAL") field(INPD, "BEND:LTUS:175:CONFIG.RVAL") field(INPE, "BEND:LTUS:175:PSCATEGORY.RVAL") field(INPF, "BEND:LTUS:175:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "BEND:LTUS:175:AUTOCTRL.RVAL") field(INPJ, "BEND:LTUS:175:OUTOFSERVICE.RVAL") field(INPL, "BEND:LTUS:175:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "BEND:LTUS:175:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "BEND:LTUS:175:PAU") field(INPP, "BEND:LTUS:175:CALBDISABLE.RVAL") field(INPQ, "BEND:LTUS:175:PTRBDISABLE.RVAL") field(INPR, "BEND:LTUS:175:TRIMDISABLE.RVAL") field(INPS, "BEND:LTUS:175:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "BEND:LTUS:175:FBCK") field(INPU, "BEND:LTUS:175:TRIMTYPE.RVAL") field(INPV, "BEND:LTUS:175:STDZDIRECT.RVAL") field(INPW, "BEND:LTUS:175:DEGAUSENABLE.RVAL") field(FLNK, "BEND:LTUS:175:HSTA") } record(longin, "BEND:LTUS:175:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "BEND:LTUS:175:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "BEND:LTUS:175: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, "BEND:LTUS:175: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, "BEND:LTUS:175: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, "BEND:LTUS:175: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, "BEND:LTUS:175: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, "BEND:LTUS:175: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 BEND:LTUS:175:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses BEND:LTUS:175:FBCK. # This PV should be replaced by BEND:LTUS:175: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, "BEND:LTUS:175: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, "BEND:LTUS:175: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, "BEND:LTUS:175: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, "BEND:DMPS:400:OUTOFSERVICE CPP NMS") field(OMSL, "closed_loop") field(FLNK, "BEND:LTUS:175:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"BEND:LTUS:175:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "BEND:LTUS:175:OUTOFSERVICE NPP NMS") field(OUT, "BEND:LTUS:175:ONLINE PP") } record(bo, "BEND:LTUS:175:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "BEND:LTUS:175: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, "BEND:LTUS:175: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, "BEND:LTUS:175: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, "BEND:LTUS:175: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, "BEND:LTUS:175: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, "BEND:LTUS:175: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, "BEND:LTUS:175: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, "BEND:LTUS:175: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, "BEND:LTUS:175: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, "BEND:LTUS:175: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, "BEND:LTUS:175: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, "BEND:LTUS:175:TRIMTYPE") } record(stringout, "BEND:LTUS:175:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "BEND:DMPS:400:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "BEND:LTUS:175:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "BEND:LTUS:175:STATE.RVAL") field(INPB, "BEND:LTUS:175:INTLKSUMY.RVAL") field(OUT, "BEND:LTUS:175:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "BEND:LTUS:175: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, "BEND:LTUS:175:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "BEND:LTUS:175:STATE.RVAL") field(INPB, "BEND:LTUS:175:INTLKSUMY.RVAL") field(OUT, "BEND:LTUS:175:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "BEND:LTUS:175:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "BEND:LTUS:175:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "BEND:LTUS:175: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, "BEND:LTUS:175: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, "BEND:LTUS:175: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, "BEND:LTUS:175: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,"BEND:LTUS:175: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("BEND:LTUS:175:TURNEDOFF",3140,1907,0,1,"BEND:LTUS:175:TURNEDOFF") #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "BEND:LTUS:175:STATSUB") { field(DESC, "Build STATus ") field(INAM, "mgntInit") field(SNAM, "mgntSlcStat") field(INPA, "BEND:LTUS:175:BACT.STAT") field(INPB, "BEND:LTUS:175:BDES.STAT") field(INPC, "BEND:LTUS:175: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, "BEND:LTUS:175:BACT.SEVR") field(INPH, "BEND:LTUS:175:BDES.SEVR") field(INPI, "BEND:LTUS:175: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, "BEND:LTUS:175:STATE.RVAL") field(INPN, "BEND:LTUS:175:STDZOK") field(INPO, "BEND:LTUS:175:CALBOK") field(INPP, "BEND:LTUS:175:OUTOFSERVICE.RVAL") field(INPQ, "BEND:LTUS:175:CONFIG.RVAL") field(INPR, "BEND:LTUS:175:HSTA") field(INPS, "BEND:LTUS:175:CTRL.RVAL") field(INPT, "BEND:LTUS:175:DEGAUSOK") field(INPV, "BEND:LTUS:175: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, "BEND:LTUS:175:STAT") } record(longout, "BEND:LTUS:175:STAT") { field(DESC, "STAT sent to SLC") field(SCAN, "Passive") field(FLNK, "BEND:LTUS:175:STATCTRLSUB") field(DOL, "BEND:LTUS:175:STATSUB.VAL") field(OMSL, "closed_loop") } record(sSub, "BEND:LTUS:175:STATCTRLSUB") { field(DESC, "Decode SLC STAT into mbbo") field(INAM, "mgntInit") field(SNAM, "mgntStatDecode") field(INPA, "BEND:LTUS:175:STAT") field(INPB, "BEND:LTUS:175:HSTA") field(INPD, "BEND:LTUS:175:ONOFFCTRL.RVAL") field(FLNK, "BEND:LTUS:175:STATMSG") } record(mbbo, "BEND:LTUS:175: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, "BEND:LTUS:175:UNAVAILGO") field(DOL, "BEND:LTUS:175:STATCTRLSUB.W") } record(seq, "BEND:LTUS:175:UNAVAILGO") { field(DESC, "Process UNAVAIL") field(DOL1, "BEND:LTUS:175:STATSUB.U") field(LNK1, "BEND:LTUS:175:UNAVAIL PP") } record(stringout, "BEND:LTUS:175:SNLSTATMSG") { field(DTYP, "Soft Channel") } #! TextBox(TB0,820,1000,1200,1220,0,"Dialog",12,1,16777215,"BEND:LTUS:175:STATUSSUB - future\nOverall device status - takes input from action snls, record sevrs, master snl(s) and outputs final status\n\nInputs:\nA - BEND:LTUS:175:CTRLSTATUS - snl status\nB - MGNT:CTRLSTATUS - master list status\nC\nD - BEND:LTUS:175: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,"BEND:LTUS:175STATSUB\nformat control bo's into slc STAT\n\nInputs:\nA - BEND:LTUS:175:STATUS\nC - BEND:LTUS:175:ON\nD - BEND:LTUS:175:STDZOK\nE - BEND:LTUS:175:CALBOK\nF - BEND:LTUS:175:BACTDRIFT (future)\nG -\nH- BEND:LTUS:175:DACSTATUS\nI -BEND:LTUS:175:ADCSTATUS\nJ - BEND:LTUS:175:BACTSTATUS\nK - BEND:LTUS:175:BDESSTATUS\nL - BEND:LTUS:175:RIPLSTATUS\n\nOutput:\nP - BEND:LTUS:175: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, "BEND:LTUS:175: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, "BEND:LTUS:175: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, "BEND:LTUS:175: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, "BEND:LTUS:175: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, "BEND:LTUS:175:IDESTOTAL"){ field(DESC, "Calc total current") field(CALC, "A+B") field(EGU, "GeV/c") field(PREC, "7") field(INPA, "BEND:DMPS:400:IDES CP NMS") field(INPB, "BTRM:LTUS:175:BDES CP NMS") field(OUT, "BEND:LTUS:175:IDES2BDES.E PP") } record(sub, "BEND:LTUS:175:IDES2BDES") { field(DESC, "Cal BDES") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "BEND:LTUS:175:IDES2BDES") field(INPB, "BEND:LTUS:175:POLYCOEF") field(INPC, "BEND:LTUS:175:POLYCOEF.A") field(INPD, "BEND:LTUS:175:POLYCOEF.B") field(INPE, "BEND:LTUS:175:IDESTOTAL MS") field(INPF, "BEND:DMPS:400:BDELTAS PP") field(INPG, "100") field(EGU, "GeV/c") field(HOPR, "15.8154") field(LOPR, "0.0835") field(HIHI, "15.8154") field(LOLO, "0.0835") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "15.8154") field(LOW, "0.0835") field(FLNK, "BEND:LTUS:175: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, "BEND:LTUS:175:IACTCALC"){ field(DESC, "Calc total act current") field(CALC, "A+B") field(EGU, "GeV/c") field(PREC, "7") field(INPA, "BEND:LTUS:175:IACT CP NMS") field(INPB, "BTRM:LTUS:175:BACT") field(OUT, "BEND:LTUS:175: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, "BEND:LTUS:175:IMONCALC"){ field(DESC, "Calc total mon current") field(CALC, "A+B") field(EGU, "GeV/c") field(PREC, "7") field(INPA, "BEND:LTUS:175:IMON CP NMS") field(INPB, "BTRM:LTUS:175:BMON") field(OUT, "BEND:LTUS:175: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, "BEND:LTUS:175:ICONTOTAL"){ field(DESC, "Calc total current") field(CALC, "A+B") field(EGU, "GeV/c") field(PREC, "7") field(INPA, "BEND:DMPS:400:ICON CP NMS") field(INPB, "BTRM:LTUS:175:BCON CP NMS") field(OUT, "BEND:LTUS:175:ICON2BCON.E PP") } record(sub, "BEND:LTUS:175:ICON2BCON") { field(DESC, "Cal BCON") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "BEND:LTUS:175:ICON2BCON") field(INPB, "BEND:LTUS:175:POLYCOEF") field(INPC, "BEND:LTUS:175:POLYCOEF.A") field(INPD, "BEND:LTUS:175:POLYCOEF.B") field(INPE, "BEND:LTUS:175:ICONTOTAL MS") field(INPF, "BEND:DMPS:400:BDELTAS PP") field(INPG, "100") field(EGU, "GeV/c") field(HOPR, "15.8154") field(LOPR, "0.0835") field(HIHI, "15.8154") field(LOLO, "0.0835") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "15.8154") field(LOW, "0.0835") field(FLNK, "BEND:LTUS:175:BCON") } #! 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, "BEND:LTUS:460:IACT") { field(DESC, "Current") field(INP, "BEND:DMPS:400:IACT CP NMS") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "BEND:LTUS:460:IACTCALC") info(autosaveFields,"HYST") } record(bi, "BEND:LTUS:460:STATE") { field(DESC, "PS On/Off Status") field(DTYP, "Raw Soft Channel") field(INP, "BEND:DMPS:400:STATE CP MS") field(ZSV, "MAJOR") field(ZNAM, "OFF") field(ONAM, "ON") } record(ao, "BEND:LTUS:460:IDES") { field(DESC, "Desired Current") field(PREC, "3") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(MDEL, "-1") field(HIHI, "200.0") field(LOLO, "0.0") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "BEND:LTUS:460:BDELTAS") field(DRVH, "200.0") field(DRVL, "0.0") field(DOL, "BEND:LTUS:460: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, "BEND:LTUS:460:ICTRL PP") } # This record is processed by BEND:LTUS:460:ICON") # Note: we are not setting alarms here. record(ao, "BEND:LTUS:460:ICON") { field(DESC, "Config I") field(DTYP, "Soft Channel") field(PREC, "3") field(HOPR, "200.0") field(LOPR, "0.0") field(DRVH, "200.0") field(DRVL, "0.0") field(DOL, "BEND:LTUS:460:B2ICON.K") field(OMSL, "closed_loop") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:460:INOM") { field(DESC, "Nominal Current") field(DOL, "BEND:LTUS:460:BNOM.K") field(OMSL, "closed_loop") field(PREC, "3") field(EGU, "A") field(DRVH, "200.0") field(DRVL, "0.0") field(HOPR, "200.0") field(LOPR, "0.0") } record(ao, "BEND:LTUS:460:ICTRL") { field(DESC, "Set Current") field(PREC, "3") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(DRVH, "200.0") field(DRVL, "0.0") field(MDEL, "-1") field(FLNK, "BEND:LTUS:460:ICTRLGO") field(OMSL, "supervisory") info(autosavefields,"VAL") } record(seq, "BEND:LTUS:460:ICTRLGO") { field(DESC, "Process Current Setpoint") field(PREC, "3") # Set ISETPT to supervisory field(DOL1, "0") field(LNK1, "BEND:LTUS:460:ISETPT.OMSL") field(DOL2, "BEND:LTUS:460:ICTRL") field(LNK2, "BEND:LTUS:460:ISETPT PP") # Set ISETPT to closed loop - get data from BCTRLSUB.K field(DOL3, "1") field(LNK3, "BEND:LTUS:460:ISETPT.OMSL") } record(ao, "BEND:LTUS:460:IMAX") { field(DESC, "Max I") field(DTYP, "Soft Channel") field(DRVH, "200.0") field(DRVL, "0.0") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(PREC, "3") field(PINI, "YES") field(VAL, "200.0") field(FLNK, "BEND:LTUS:460:IMIN") } record(ao, "BEND:LTUS:460:IMIN") { field(DESC, "Min I") field(DTYP, "Soft Channel") field(DRVH, "200.0") field(DRVL, "0.0") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(PREC, "3") field(VAL, "0.0") field(FLNK, "BEND:LTUS:460:IRANGE") } record(sel, "BEND:LTUS:460:IACTPREVOK") { field(DESC, "Last Good Current") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(PREC, "3") field(NVL, "BEND:LTUS:460:BACT.SEVR") field(INPA, "BEND:LTUS:460:IACT NPP MS") field(INPB, "BEND:LTUS:460:IACTPREVOK NPP MS") field(INPC, "BEND:LTUS:460:IACTPREVOK NPP MS") field(INPD, "BEND:LTUS:460:IACTPREVOK NPP MS") } record(sub, "BEND:LTUS:460:IACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "BEND:LTUS:460:IDES") field(INPB, "BEND:LTUS:460:ISETPT.DRVH") field(INPC, "BEND:LTUS:460:ISETPT.DRVL") field(INPD, "BEND:LTUS:460:IDELTAS.I") field(INPE, "BEND:LTUS:460:IDELTAS.J") field(INPG, "BEND:LTUS:460:STATE") field(INPH, "BEND:LTUS:460:HSTA") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(sub, "BEND:LTUS:460:IMONLIMITS") { field(DESC, "Aux Current Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "BEND:LTUS:460:IDES") field(INPB, "BEND:LTUS:460:ISETPT.DRVH") field(INPC, "BEND:LTUS:460:ISETPT.DRVL") field(INPD, "BEND:LTUS:460:IDELTAS.K") field(INPE, "BEND:LTUS:460:IDELTAS.L") field(INPG, "BEND:LTUS:460:STATE") field(INPH, "BEND:LTUS:460:HSTA") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(seq, "BEND:LTUS:460:ILIMITS") { field(DESC, "Set ACT and MON Limits") field(PREC, "3") field(DOL1, "BEND:LTUS:460:BLIMITS") field(LNK1, "BEND:LTUS:460:IACTLIMITS.F PP") field(DOL2, "BEND:LTUS:460:IACTLIMITS.I") field(LNK2, "BEND:LTUS:460:IACT.HIGH") field(DOL3, "BEND:LTUS:460:IACTLIMITS.J") field(LNK3, "BEND:LTUS:460:IACT.LOW") field(DOL4, "BEND:LTUS:460:IACTLIMITS.K") field(LNK4, "BEND:LTUS:460:IACT.HIHI") field(DOL5, "BEND:LTUS:460:IACTLIMITS.L") field(LNK5, "BEND:LTUS:460:IACT.LOLO") field(DOL6, "BEND:LTUS:460:BLIMITS") field(LNK6, "BEND:LTUS:460:IMONLIMITS.F PP") field(DOL7, "BEND:LTUS:460:IMONLIMITS.I") field(LNK7, "BEND:LTUS:460:IMON.HIGH") field(DOL8, "BEND:LTUS:460:IMONLIMITS.J") field(LNK8, "BEND:LTUS:460:IMON.LOW") field(DOL9, "BEND:LTUS:460:IMONLIMITS.K") field(LNK9, "BEND:LTUS:460:IMON.HIHI") field(DOLA, "BEND:LTUS:460:IMONLIMITS.L") field(LNKA, "BEND:LTUS:460: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, "BEND:LTUS:460:IDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntRawDeltas") field(INPD, "BEND:LTUS:460:TRIMBTOL") field(INPE, "BEND:LTUS:460:CHCKBTOL") field(INPF, "BEND:LTUS:460:BDELTAS.K") field(INPG, "BEND:LTUS:460:BDELTAS.L") field(INPH, "BEND:LTUS:460: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, "BEND:LTUS:460:STDZITOLR") field(INPC, "BEND:LTUS:460:STDZITOL") field(FLNK, "") } # All ps controllers with on/off control will set the macro ONOF # as follows: # # ONOF = BEND:DMPS:400: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, "BEND:LTUS:460: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 = BEND:DMPS:400:RESET PP # record(bo, "BEND:LTUS:460: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, "BEND:LTUS:460:RAMPSTATE") { field(DESC, "PS Ramp Status") field(DTYP, "Soft Channel") field(DOL, "BEND:DMPS:400: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, "BEND:LTUS:460: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, "BEND:LTUS:460:TRIMRAMPRATE") field(OUT, "") field(FLNK, "BEND:LTUS:460:STDZDLY") } record(ao, "BEND:LTUS:460:ISETPT") { field(DESC, "Current Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(DRVH, "200.0") field(DRVL, "0.0") field(MDEL, "-1") field(OUT, "") field(DOL, "BEND:LTUS:460: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, "BEND:LTUS:460:IMON") { field(DESC, "Aux Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(INP, "BEND:DMPS:400:IMON CP NMS") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "BEND:LTUS:460:IMONCALC") } record(ao, "BEND:LTUS:460:IRIPL") { field(DESC, "Ripple Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(DOL, "BEND:DMPS:400:IRIPL CP NMS") field(OMSL, "closed_loop") field(EGU, "A") field(DRVH, "1.0") field(HOPR, "1.0") field(PREC, "3") field(FLNK, "BEND:LTUS:460:IRIPLOK") } record(sub, "BEND:LTUS:460:IRIPLOK") { field(DESC, "Ripple Current Status") field(INAM, "mgntInit") field(SNAM, "mgntRiplOK") field(INPA, "BEND:LTUS:460:IRIPL.VAL") field(INPB, "BEND:LTUS:460: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, "BEND:LTUS:460:R") { field(DESC, "Resistance") field(EGU, "Ohms") field(PREC, "4") field(PINI, "YES") field(DOL, "BEND:DMPS:400: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, "BEND:LTUS:460:IGND") { field(DESC, "Ground Current") field(EGU, "A") field(PREC, "6") field(PINI, "YES") field(DOL, "BEND:DMPS:400:IGND CP MS") field(OMSL, "closed_loop") } record(bi, "BEND:LTUS:460:INTLKSUMY") { field(DESC, "Interlock Summary") field(INP, "BEND:DMPS:400:INTLKSUMY CP MS") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(ZNAM, "OK") field(ONAM, "FAULT") field(PINI, "NO") } record(mbbo, "BEND:LTUS:460: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, "BEND:DMPS:400:COOLING CP NMS") field(OMSL, "closed_loop") } # The following PV is processed by :BACTFO # which is processed by :BACT record(fanout, "BEND:LTUS:460:IACTFO") { field(DESC, "IACT processing") field(SELM, "All") field(LNK1, "BEND:LTUS:460:IACTPREVOK") field(LNK2, "BEND:LTUS:460:IDIFF") field(LNK3, "BEND:LTUS:460:IADIFF") field(LNK4, "BEND:LTUS:460:IRATIO") field(LNK5, "BEND:LTUS:460:IDIRECT") field(LNK6, "BEND:LTUS:460:IACTPOL_CHECK") } record(calc, "BEND:LTUS:460:IDIFF") { field(DESC, "IDES-IACT") field(CALC, "A-B") field(INPA, "BEND:LTUS:460:IDES") field(INPB, "BEND:LTUS:460:IACT") field(EGU, "A") field(PREC, "9") field(HOPR, "200.0") field(LOPR, "0.0") } record(calc, "BEND:LTUS:460:IADIFF") { field(DESC, "Absolute IDES-IACT") field(CALC, "A<0?ABS(A):A") field(INPA, "BEND:LTUS:460:IDIFF") field(PREC, "9") } record(calc, "BEND:LTUS:460:IRATIO") { field(DESC, "IDES-IACT/IMAX") field(CALC, "B?A/B:0") field(INPA, "BEND:LTUS:460:IDIFF") field(INPB, "BEND:LTUS:460:IDES.DRVH") field(PREC, "9") } record(calcout, "BEND:LTUS:460:IRANGE") { field(DESC, "Current Range") field(PINI, "YES") field(CALC, "ABS(A-B)") field(INPA, "BEND:LTUS:460:IMIN") field(INPB, "BEND:LTUS:460: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, "BEND:LTUS:460: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, "BEND:LTUS:460:IACT") field(FLNK, "BEND:LTUS:460:IACTPOL") } record(bo, "BEND:LTUS:460:IACTPOL") { field(DESC, "Actual I Polarity") field(DTYP, "Raw Soft Channel") field(DOL, "BEND:LTUS:460: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,"BEND:LTUS:460:I*LIMITS:\n Calculate alarm and warning limits based on \n deltas from BEND:LTUS:460:IDELTAS and the\n BEND:LTUS:460: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,"BEND:LTUS:460:IACT: \n Get copy of BEND:LTUS:460:I. \n",null) #! TextBox(TB12,1280,3100,1760,3200,0,"Dialog",12,1,16777215,"BEND:LTUS:460: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,"BEND:LTUS:460:IDES:\n Contains raw value calculated by \nBEND:LTUS:460: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 \nBEND:LTUS:460:BDELTAS.\n",null) #! TextBox(TB10,56,1940,316,2340,0,"Dialog",12,1,16777215,"BEND:LTUS:460: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 BEND:LTUS:460: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 BEND:LTUS:460: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,"BEND:LTUS:460:ISETPT:\n Sets the hardware. When fast feedback is set on, this record is\n set to closed loop mode by BEND:LTUS:460:FBCKSTART sequence. When \n the loop is closed, this record takes input calculated by \n BFBCK only. When fast feedback is set off, BEND:LTUS:460:FBCKSTOP \n will set it back to supervisory so that the value can be set by \n BEND:LTUS:460: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, "BEND:LTUS:460:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:460:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "BEND:LTUS:460:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "BEND:LTUS:460:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "BEND:LTUS:460:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "BEND:LTUS:460:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "1") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "BEND:LTUS:460: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, "BEND:LTUS:460:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "BEND:LTUS:460:TRIMTYPE.RVAL") field(INPB, "BEND:LTUS:460:CONFIG.RVAL") field(OUT, "BEND:LTUS:460:TRIMMAXNUM PP") } record(longout, "BEND:LTUS:460: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, "BEND:LTUS:460: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, "BEND:DMPS:400:TRIMRAMPRATE CP NMS") field(OMSL, "closed_loop") field(VAL, "") field(OUT, "BEND:LTUS:460:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "BEND:LTUS:460: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, "BEND:DMPS:400:TRIMSETL CP NMS") field(OMSL, "closed_loop") field(VAL, "") } record(bo, "BEND:LTUS:460: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, "BEND:LTUS:460: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, "BEND:LTUS:460: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, "BEND:LTUS:460:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "0") } record(ao, "BEND:LTUS:460: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, "BEND:LTUS:460:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "BEND:LTUS:460: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, "BEND:LTUS:460: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, "BEND:LTUS:460:IMOVE") field(INPB, "BEND:LTUS:460:IACT") field(INPC, "BEND:LTUS:460:IRAMPRATE") field(INPD, "1.577") field(INPE, "BEND:LTUS:460:TRIMDLYPCT") field(INPF, "BEND:LTUS:460:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "BEND:LTUS:460:RAMPTIME_LEFT PP") } record(longout, "BEND:LTUS:460:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "BEND:LTUS:460:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "BEND:LTUS:460:RAMPDONE_CALC") } record(calc, "BEND:LTUS:460:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "BEND:LTUS:460:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "BEND:LTUS:460:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "BEND:LTUS:460: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, "BEND:LTUS:460:RAMPTIME_LEFT") field(OUT, "BEND:LTUS:460:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "BEND:LTUS:460:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "BEND:LTUS:460:RAMPTIME_LEFT NMS") field(OUT, "BEND:LTUS:460:RAMPDONE PP") } record(bo, "BEND:LTUS:460:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "BEND:LTUS:460:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "BEND:LTUS:460: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, "BEND:LTUS:460: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, "BEND:LTUS:460:STDZINIT") { field(DESC, "Proc. Stdz PVs on boot") field(PINI, "YES") field(DOL1, "1") field(DOL2, "1") field(DOL3, "1") field(LNK1, "BEND:LTUS:460:DEBUG.PROC PP") field(LNK2, "BEND:LTUS:460:STDZCYCLENUM.PROC PP") field(LNK3, "BEND:LTUS:460:STDZDISABLE.PROC PP") field(LNK4, "BEND:LTUS:460: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, "BEND:LTUS:460:STDZSUB") { field(DESC, "Stdz subroutine") field(INAM, "mgntStdzInit") field(SNAM, "mgntStdz") field(BRSV, "INVALID") field(INPA, "BEND:LTUS:460:STDZIMIN NPP NMS") field(INPB, "BEND:LTUS:460:STDZIMAX NPP NMS") field(INPC, "BEND:LTUS:460:STDZIFINAL NPP NMS") field(INPD, "BEND:LTUS:460:STDZCYCLENUM NPP NMS") field(INPE, "BEND:LTUS:460:STDZDIRECT.RVAL NPP NMS") field(INPF, "BEND:LTUS:460:STDZDISABLE.RVAL CPP NMS") field(INPG, "BEND:LTUS:460: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, "BEND:LTUS:460:STDZWF PP") field(OUTB, "BEND:LTUS:460: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, "BEND:LTUS:460:STDZWF") } record(mbbo, "BEND:LTUS:460: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, "BEND:LTUS:460: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, "BEND:LTUS:460:STDZMAINPS") { field(DESC, "Stdz by main or self") field(PINI, "YES") field(DTYP, "Soft Channel") field(ZNAM, "SELF") field(ONAM, "MAIN") } record(bo, "BEND:LTUS:460: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, "BEND:LTUS:460: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, "BEND:LTUS:460: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, "BEND:LTUS:460:STDZTOD") { field(DESC, "Successful Standardize Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "BEND:LTUS:460:STDZLOSTTOD") { field(DESC, "Standardize Lost Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(longout, "BEND:LTUS:460:STDZCYCLECNT") { field(DESC, "Cycle Count") field(PINI, "YES") } record(longout, "BEND:LTUS:460: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, "BEND:LTUS:460:STDZDIRECT") } # The default standardize direction is "UP" for # all LCLS Magnets.. record(bo, "BEND:LTUS:460:STDZDIRECT") { field(DESC, "Standardize Direction ") field(ZNAM, "UP") field(ONAM, "DOWN") field(VAL, "0") field(FLNK, "BEND:LTUS:460:STDZIMIN") } record(ao, "BEND:LTUS:460:STDZIMIN") { field(DESC, "Min-STDZ Current") field(PREC, "1") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(VAL, "0.0") field(FLNK, "BEND:LTUS:460:STDZIMAX") } record(ao, "BEND:LTUS:460:STDZIMAX") { field(DESC, "Max. Standarize Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(VAL, "200.0") field(FLNK, "BEND:LTUS:460:STDZIFINAL") } record(ao, "BEND:LTUS:460:STDZIFINAL") { field(DESC, "Final SDTZ Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(VAL, "0.0") field(FLNK, "BEND:LTUS:460: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, "BEND:LTUS:460: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, "BEND:LTUS:460:STDZITOL") { field(DESC, "Stdz min tolerance") field(PREC, "5") field(CALC, "MAX(ABS(A),ABS(B))*C") field(INPA, "BEND:LTUS:460:STDZIMIN CP NMS") field(INPB, "BEND:LTUS:460:STDZIMAX CP MMS") field(INPC, "0.05") field(INPD, "BEND:LTUS:460:STDZITOLR CP MMS") field(EGU, "A") field(FLNK, "BEND:LTUS:460:IDELTAS") field(PINI, "YES") } # D - factor (3.154/2 = 1.577) for EPSC, otherwise, set to 1.0 record(calc, "BEND:LTUS:460:STDZDLY") { field(DESC, "Ramp time for stdz cycle") field(CALC, "C>0?MAX(1,ABS((A-B)/C)*D):0") field(INPA, "BEND:LTUS:460:STDZIMIN CP NMS") field(INPB, "BEND:LTUS:460:STDZIMAX CP NMS") field(INPC, "BEND:LTUS:460:TRIMRAMPRATE CP NMS") field(INPD, "1.0") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") } record(calc, "BEND:LTUS:460:STDZRAMPDLY") { field(DESC, "Ramp delay total") field(CALC, "MAX(1,((A/100)*B+B))") field(PREC, "5") field(INPA, "BEND:LTUS:460:TRIMDLYPCT CP MS") field(INPB, "BEND:LTUS:460: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, "BEND:LTUS:460:STDZMINIDLY") { field(DESC, "Mini-stdz delay") field(CALC, "A") field(PREC, "5") field(A, "1.0") field(EGU, "sec") field(PINI, "YES") } record(ao, "BEND:LTUS:460: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, "BEND:LTUS:460:STDZMINIDELTA") { field(DESC, "Stdz mini % of IMAX") field(CALC, "(B/100)*(A-C)") field(INPA, "BEND:LTUS:460:IDES.HOPR") field(INPB, "BEND:LTUS:460:STDZMINIPCT CPP NMS") field(INPC, "BEND:LTUS:460:IDES.LOPR") field(PREC, "5") } record(calc, "BEND:LTUS:460:STDZMINISETPT") { field(DESC, "Mini Stdz delta") field(CALC, "C==0?MAX(E-D,B):MIN(E+D,A)") field(INPA, "BEND:LTUS:460:IDES.HOPR") field(INPB, "BEND:LTUS:460:IDES.LOPR") field(INPC, "BEND:LTUS:460:STDZDIRECT.RVAL") field(INPD, "BEND:LTUS:460:STDZMINIDELTA") field(INPE, "BEND:LTUS:460:IDES") field(PREC, "5") field(FLNK, "BEND:LTUS:460: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, "BEND:LTUS:460:STDZMINISETPTOOR") { field(DESC, "Mini Stdz setpoint out of range") field(CALC, "C==0?(E-DA)") field(INPA, "BEND:LTUS:460:IDES.HOPR") field(INPB, "BEND:LTUS:460:IDES.LOPR") field(INPC, "BEND:LTUS:460:STDZDIRECT.RVAL") field(INPD, "BEND:LTUS:460:STDZMINIDELTA") field(INPE, "BEND:LTUS:460: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, "BEND:LTUS:460: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, "BEND:LTUS:460:IADJUST.RVAL") field(INPB, "BEND:LTUS:460:STDZDIRECT.RVAL") field(INPC, "BEND:LTUS:460:STDZOK.RVAL") field(INPD, "BEND:LTUS:460:STDZDISABLE.RVAL") field(INPE, "BEND:LTUS:460:STATE.RVAL CPP NMS") field(INPF, "BEND:LTUS:460:ICTRL.RVAL") field(INPG, "BEND:LTUS:460:STATE.SEVR") field(INPH, "BEND:LTUS:460:BDELTAS.M") field(INPI, "BEND:LTUS:460:IACT.SEVR") field(OUT, "BEND:LTUS:460:STDZLOSTGO.SELN PP NMS") field(OOPT, "Transition To Non-zero") } record(seq, "BEND:LTUS:460:STDZLOSTGO") { field(DESC, "Process lost stdz") field(SELM, "Mask") field(DOL1, "1") field(DOL2, "0") field(LNK1, "BEND:LTUS:460:STDZLOSTTOD.PROC") field(LNK2, "BEND:LTUS:460:STDZOK PP") } # Record maximum current after standardize # Reset to IACT from sequence after trim # Disable processing during (mini-)standardize or trim record(calc, "BEND:LTUS:460:STDZIACTMAX") { field(DESC, "Max act current after stdz") field(CALC, "MAX(A, B)") field(DISV, "0") field(SDIS, "BEND:LTUS:460:CHECKPWRDIP_ENABLE") field(INPA, "BEND:LTUS:460:IACT CP") field(INPB, "BEND:LTUS:460:STDZIACTMAX") field(EGU, "A") field(FLNK, "BEND:LTUS:460:CHECKPWRDIP") } # Detect power dip if STDZOK is YES, STDZ is enabled, and IACT is valid # If IACT drops below STDZIACTMAX by more than the trim tolerance, clear STDZOK # Warning: Take the absolute value of the trim tolerance, or else quads of # negative polarity will always lose STDZ since their IDELTAS.I are negative. # Note: Large quads and bends are prone to losing STDZ even if they are # perturbed toward higher current since their current tends to overshoot # by greater than the trim tolerance before settling down. record(calcout, "BEND:LTUS:460:CHECKPWRDIP") { field(DESC, "Detect power dip") field(CALC, "(A-B>ABS(C))?3:0") field(DISV, "0") field(SDIS, "BEND:LTUS:460:CHECKPWRDIP_ENABLE") field(INPA, "BEND:LTUS:460:STDZIACTMAX") field(INPB, "BEND:LTUS:460:IACT") field(INPC, "BEND:LTUS:460:IDELTAS.I") field(OUT, "BEND:LTUS:460:STDZLOSTGO.SELN PP NMS") field(OOPT, "When Non-zero") } # Enable processing of STDZIACTMAX and CHECKPWRDIP only if # STDZOK = YES, STDZDISABLE = NO, CTRL != Trim (2), and # CTRL != Stdz (4) record(calc, "BEND:LTUS:460:CHECKPWRDIP_ENABLE") { field(CALC, "A&&!B&&(C#2)&&(C#4)") field(INPA, "BEND:LTUS:460:STDZOK.RVAL CP") field(INPB, "BEND:LTUS:460:STDZDISABLE.RVAL CP") field(INPC, "BEND:LTUS:460:CTRL.RVAL CP") } #! 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, "BEND:LTUS:460: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, "BEND:LTUS:460: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, "BEND:LTUS:460:CALBSET") { field(DESC, "Use DAC Calbration") field(SCAN, "10 second") field(CALC, "A&&(B==0)&&C?31:960") field(INPA, "BEND:LTUS:460:CALBOK") field(INPB, "BEND:LTUS:460:CALBDISABLE") field(INPC, "BEND:LTUS:460:CALBSLOPE") field(OOPT, "On Change") field(OUT, "BEND:LTUS:460: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, "BEND:LTUS:460:CALB_SEQ") { field(DESC, "Output Calib Values") field(SELM, "Mask") field(SELL, "BEND:LTUS:460: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, "BEND:LTUS:460:CALBSLOPE") field(DOL3, "BEND:LTUS:460: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, "BEND:LTUS:460:CALBTOD") { field(DESC, "Calibration Success Time") field(PINI, "YES") # field(DOL, "") field(OMSL, "supervisory") field(DTYP, "Soft Channel") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:460: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, "BEND:LTUS:460: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, "BEND:LTUS:460: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, "BEND:LTUS:460:CALBOFFSET") { field(DESC, "Calc DAC Offset") field(PREC, "6") field(EGU, "Counts") field(PINI, "YES") } record(bo, "BEND:LTUS:460: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, "BEND:LTUS:460:DACSLOPE") { field(DESC, "V to DAC slope") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "supervisory") field(PINI, "YES") field(FLNK, "BEND:LTUS:460:DACOFFSET") } # Default Offset used in conversion from Volts to DAC Counts record(ao, "BEND:LTUS:460:DACOFFSET") { field(DESC, "V to DAC offset") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "supervisory") field(PINI, "YES") field(FLNK, "BEND:LTUS:460: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, "BEND:LTUS:460: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, "BEND:LTUS:460:IACT") field(INPD, "BEND:LTUS:460:DACSLOPE") field(INPE, "BEND:LTUS:460:DACOFFSET") field(EGU, "Counts") field(PREC, "6") } record(ao, "BEND:LTUS:460:DAC") { field(DESC, "DAC Set point") field(EGU, "Counts") field(DOL, "") field(OMSL, "supervisory") field(PREC, "6") field(PINI, "YES") } record(ao, "BEND:LTUS:460:CALBIMIN") { field(DESC, "Calibration Min Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(DRVH, "200.0") field(HOPR, "200.0") field(DRVL, "0.0") field(LOPR, "0.0") field(PREC, "3") field(EGU, "A") field(VAL, "0.0") field(FLNK, "BEND:LTUS:460:CALBIMAX") } record(ao, "BEND:LTUS:460:CALBIMAX") { field(DESC, "Calibration Max Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(DRVH, "200.0") field(HOPR, "200.0") field(LOPR, "0.0") field(DRVL, "0.0") field(EGU, "A") field(VAL, "200.0") field(FLNK, "BEND:LTUS:460:CALBSTEPNUM") } record(ao, "BEND:LTUS:460:CALBIFINAL") { field(DESC, "Calibration Last Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(PREC, "3") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(VAL, "0") } record(longout, "BEND:LTUS:460: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, "BEND:LTUS:460:CALBIDELTA") } record(calc, "BEND:LTUS:460:CALBIDELTA") { field(DESC, "Step size for CALB") field(CALC, "C=0?0:ABS((A-B)/C)") field(INPA, "BEND:LTUS:460:CALBIMAX") field(INPB, "BEND:LTUS:460:CALBIMIN") field(INPC, "BEND:LTUS:460: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, "BEND:LTUS:460:CALBIMULT") { field(DESC, "IACT vs ISETPT mult") field(CALC, "C#0||A=0?1:ABS(B/A)") field(INPA, "BEND:DMPS:400:ISETPT.DRVH") field(INPB, "BEND:DMPS:400:IACT.HOPR") field(INPC, "BEND:LTUS:460:PSCONTROLLER.RVAL CPP") field(EGU, "A") field(PINI, "YES") } # SNL dbputs DAC values here. 6-10 steps are possible. record(waveform, "BEND:LTUS:460:CALBICTRLWF") { field(DESC, "ICTRL setpoint array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") } record(waveform, "BEND:LTUS:460:DACWF") { field(DESC, "DAC count array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "BEND:LTUS:460:DACSA") } # Used only for xygraph edm plot record(subArray, "BEND:LTUS:460:DACSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "BEND:LTUS:460: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, "BEND:LTUS:460:CALCDACWF") { field(DESC, "Calc DAC counts array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "BEND:LTUS:460:CALCDACSA") } # Used only for xygraph edm plot record(subArray, "BEND:LTUS:460:CALCDACSA") { field(DESC, "Calc DAC counts") field(DTYP, "Soft Channel") field(INP, "BEND:LTUS:460: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, "BEND:LTUS:460:CALBYWF") { field(DESC, "mx + b") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "BEND:LTUS:460:CALBYSA") } # Used only for xygraph edm plot record(subArray, "BEND:LTUS:460:CALBYSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "BEND:LTUS:460:CALBYWF") field(MALM, "10") field(NELM, "6") field(INDX, "0") field(FTVL, "DOUBLE") } record(waveform, "BEND:LTUS:460:CALBIACTWF") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "BEND:LTUS:460:CALBIACTSA") } # Used only for xygraph edm plot record(subArray, "BEND:LTUS:460:CALBIACTSA") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(MALM, "10") field(NELM, "6") field(INP, "BEND:LTUS:460:CALBIACTWF") field(INDX, "0") field(FTVL, "DOUBLE") field(FLNK, "BEND:LTUS:460:CALBLIMITS") } # Check that measured current during calibration is within # tolerance. record(aSub, "BEND:LTUS:460: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, "BEND:LTUS:460:CALBSTEPNUM") field(INPB, "BEND:LTUS:460:CALBIACTWF") field(INPC, "BEND:LTUS:460: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, "BEND:LTUS:460: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, "BEND:LTUS:460:STDZITOL") field(INPH, "BEND:LTUS:460:DACSLOPE") field(INPI, "BEND:LTUS:460: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, "BEND:LTUS:460: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, "BEND:LTUS:460:CALBSTEPNUM") field(INPB, "BEND:LTUS:460:CALBIACTWF") field(INPC, "BEND:LTUS:460:DACWF") field(INPF, "BEND:LTUS:460: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 BEND:LTUS:460CALBOK 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, "BEND:LTUS:460:DEGAUSINIT") { field(DESC, "Proc. Degauss PVs on boot") field(PINI, "YES") field(DOL, "1") field(OUTA, "BEND:LTUS:460:DEGAUSIMIN.PROC PP") field(OUTB, "BEND:LTUS:460:DEGAUSIMAX.PROC PP") field(OUTC, "BEND:LTUS:460:DEGAUSTYPE.PROC PP") field(OUTD, "BEND:LTUS:460:DEGAUSSTEP.PROC PP") field(OUTE, "BEND:LTUS:460:MADNAME.PROC PP") field(OUTF, "BEND:LTUS:460:PSTYPE.PROC PP") field(OUTG, "BEND:LTUS:460: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, "BEND:LTUS:460:DEGAUSSUB") { field(DESC, "Degauss subroutine") field(INAM, "mgntDegaussInit") field(SNAM, "mgntDegauss") field(BRSV, "INVALID") field(INPA, "BEND:LTUS:460:DEGAUSIMIN NPP NMS") field(INPB, "BEND:LTUS:460:DEGAUSIMAX NPP NMS") field(INPC, "BEND:LTUS:460:DEGAUSTYPE.RVAL NPP NMS") field(INPE, "BEND:LTUS:460:DEGAUSMETHOD.RVAL NPP NMS") field(INPF, "BEND:LTUS:460:PSTYPE NPP NMS") field(INPG, "BEND:LTUS:460:DEBUG.RVAL NPP NMS") field(INPH, "BEND:LTUS:460: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, "BEND:LTUS:460:DEGAUSWF PP") field(OUTB, "BEND:LTUS:460:DEGAUSMSG PP") field(OUTC, "BEND:LTUS:460: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, "BEND:LTUS:460:DEGAUSWF") { field(DESC, "Degauss Setpts") field(NELM, "60") field(FTVL, "DOUBLE") } record(mbbo,"BEND:LTUS:460: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, "BEND:LTUS:460: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, "BEND:LTUS:460: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, "BEND:LTUS:460: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, "BEND:LTUS:460: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, "BEND:LTUS:460:DEGAUSIMIN") { field(DESC, "Min. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "200.0") field(LOPR, "-200.0") field(DRVH, "200.0") field(DRVL, "-200.0") field(VAL, "-200.0") } record(ao, "BEND:LTUS:460:DEGAUSIMAX") { field(DESC, "Max. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "200.0") field(LOPR, "-200.0") field(DRVH, "200.0") field(DRVL, "-200.0") field(VAL, "200.0") } # 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,"BEND:LTUS:460: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, "BEND:LTUS:460: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,"BEND:LTUS:460: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, "BEND:LTUS:460: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, "BEND:LTUS:460: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, "BEND:LTUS:460: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, "BEND:LTUS:460:DEGAUSTOD") { field(DESC, "Successful Degauss Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "BEND:LTUS:460:DEGAUSLOSTTOD") { field(DESC, "Degauss Lost Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:460:DEGAUSTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "BEND:LTUS:460:DEGAUSTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "BEND:LTUS:460: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, "BEND:LTUS:460:DEGAUSGO") { field(DESC, "Set bdes of btrms to zero") field(ASG, "Internal") field(OUTA, "") field(OUTB, "") field(OUTC, "") field(OUTD, "") } # =========== CRYO ONLY =========== record(bo, "BEND:LTUS:460: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, "BEND:LTUS:460:DEGAUS_IMAX_CHECK") { field(DESC, "Check if imax shoud chg") field(CALC, "(C==4)&&(ABS(B)>ABS(A))?1:0") field(INPA, "BEND:LTUS:460:DEGAUS_IMAX") field(INPB, "BEND:LTUS:460:ISETPT") field(INPC, "BEND:LTUS:460:DEGAUSTYPE.RVAL") field(OUT, "BEND:LTUS:460:DEGAUS_IMAX_UPDATE.SELN") field(FLNK, "BEND:LTUS:460:DEGAUS_IMAX_UPDATE") } record(seq, "BEND:LTUS:460:DEGAUS_IMAX_UPDATE") { field(DESC, "Degauss IMAX Update") field(SELM, "Specified") field(DOL1, "BEND:LTUS:460:ISETPT") field(LNK1, "BEND:LTUS:460:DEGAUS_IMAX PP") } # Set the maximum current after a successful # degauss. This pv is updated by the # sequence. record(ao, "BEND:LTUS:460:DEGAUS_IMAX") { field(DESC, "Max I set afer a degauss") field(EGU, "Amps") field(PINI, "YES") field(PREC, "6") field(HOPR, "200.0") field(LOPR, "-200.0") field(DRVH, "200.0") field(DRVL, "-200.0") field(VAL, "200.0") field(FLNK, "BEND:LTUS:460:DEGAUS_IMAXPOL_CHECK") info(autosaveFields,"VAL,RVAL") } # Set the polarity if degauss_imax record(calcout, "BEND:LTUS:460:DEGAUS_IMAXPOL_CHECK") { field(DESC, "Determine polarity of imax") field(CALC, "A>=0?0:1") field(INPA, "BEND:LTUS:460:DEGAUS_IMAX") field(FLNK, "BEND:LTUS:460:DEGAUS_IMAXPOL") } record(bo, "BEND:LTUS:460:DEGAUS_IMAXPOL") { field(DESC, "Polarity of imax I") field(DTYP, "Raw Soft Channel") field(DOL, "BEND:LTUS:460:DEGAUS_IMAXPOL_CHECK") field(OMSL, "closed_loop") field(ZNAM, "Positive") field(ONAM, "Negative") field(FLNK, "BEND:LTUS:460: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, "BEND:LTUS:460:DEGAUS_ABSIMAX") { field(DESC, "Absolute Max. Degauss I") field(CALC, "ABS(A)") field(INPA, "BEND:LTUS:460:DEGAUS_IMAX") field(PREC, "6") field(EGU, "Amps") field(HOPR, "200.0") field(LOPR, "-200.0") info(autosaveFields,"VAL RVAL") } # IACT Polarity record(calcout, "BEND:LTUS:460:IACTPOL_CHECK") { field(DESC, "Determine IACT polarity") field(SCAN, "5 second") field(CALC, "ABS(A-B)>C?(A>=0?0:1):D") field(INPA, "BEND:LTUS:460:IACT") field(INPB, "BEND:LTUS:460:IACTPOL_CHECK.LA") field(INPC, "0.0001") field(INPD, "BEND:LTUS:460:IACTPOL_CHECK.PVAL") field(OOPT, "On Change") field(FLNK, "BEND:LTUS:460:IACTPOL") } record(bo, "BEND:LTUS:460: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,"BEND:LTUS:460: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, "BEND:LTUS:460:DEGAUSENABLE CP") field(INPB, "BEND:LTUS:460:DEGAUSOK") field(INPC, "BEND:LTUS:460:STATE CP") field(INPD, "BEND:LTUS:460:STATE.SEVR") field(OUT, "BEND:LTUS:460:DEGAUS_STATE_SEQ.SELN PP") field(ASG, "Internal") } record(seq, "BEND:LTUS:460:DEGAUS_STATE_SEQ") { field(DESC, "Degauss State Sequence") field(SELM, "Specified") field(SELL, "BEND:LTUS:460:DEGAUS_STATE_CHECK") field(LNK1, "BEND:LTUS:460:DEGAUS_STATE_DISABLE.PROC PP") field(LNK2, "BEND:LTUS:460:DEGAUS_STATE_LOST.PROC PP") field(LNK3, "BEND:LTUS:460:DEGAUS_STATE_GOOD.PROC PP") field(LNK4, "BEND:LTUS:460: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, "BEND:LTUS:460:DEGAUS_STATE_DISABLE") { field(DESC, "Degauss not used") field(LNK1, "BEND:LTUS:460:DEGAUSOK.ZSV") field(LNK2, "BEND:LTUS:460: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, "BEND:LTUS:460:STATMSG.FRSV") field(LNK4, "BEND:LTUS:460: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, "BEND:LTUS:460:DEGAUS_STATE_LOST") { field(DESC, "Degauss lost and ps On") field(DOL1, "1") field(LNK1, "BEND:LTUS:460:DEGAUSOK.ZSV") field(LNK2, "BEND:LTUS:460: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, "BEND:LTUS:460:STATMSG.FRSV") field(LNK4, "BEND:LTUS:460: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, "BEND:LTUS:460:DEGAUS_STATE_OFF") { field(DESC, "Degaused lost and ps Off") field(DOL1, "2") field(LNK1, "BEND:LTUS:460: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, "BEND:LTUS:460:STATMSG.FRSV") field(LNK3, "BEND:LTUS:460: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, "BEND:LTUS:460:DEGAUS_STATE_GOOD") { field(DESC, "Degauss good") field(DOL1, "1") field(LNK1, "BEND:LTUS:460: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, "BEND:LTUS:460:STATMSG.FRSV PP") field(LNK3, "BEND:LTUS:460:STATMSG.FVSV PP") field(LNK4, "") field(ASG, "Internal") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(mbbo, "BEND:LTUS:460:FUNC") { field(DESC, "BEND:LTUS:460 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, "0") field(FFVL, "0") field(OUT, "BEND:LTUS:460:CTRL CA") } # :CTRL pv is processed at boot in the # sequence mgntCtrl.st Processed in sequence # record(mbbo, "BEND:LTUS:460:CTRL") { field(DESC, "BEND:LTUS:460 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, "BEND:LTUS:460:SELECTEN.A PP") field(SDIS, "0") } # If a function has been selected set this unit to busy record(calcout, "BEND:LTUS:460:SELECTEN") { field(DESC, "Control Select Enable") field(CALC, "A>0?1:A") field(FLNK, "BEND:LTUS:460:BUSY") } # Set to FREE on IOC reboot record(bo, "BEND:LTUS:460:BUSY") { field(DESC, "BEND:LTUS:460 Ctrl Done") field(DOL, "BEND:LTUS:460:SELECTEN") field(ZNAM, "FREE") field(ONAM, "BUSY") field(PINI, "YES") field(FLNK, "BEND:LTUS:460:SELECT") } record(bo, "BEND:LTUS:460:SELECT") { field(ZNAM, "NO") field(ONAM, "YES") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") } record(bo, "BEND:LTUS:460: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, "BEND:LTUS:460:CTRLSTATE") { field(DESC, "BEND:LTUS:460 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("BEND:LTUS:460:CTRL",20,20,0,0,"BEND:LTUS:460:CTRL") #! Field("BEND:LTUS:460:CTRL.OUT",16777215,1,"BEND:LTUS:460:CTRL.OUT") #! Link("BEND:LTUS:460:CTRL.OUT","BEND:LTUS:460:SELECTEN.A") #! Field("BEND:LTUS:460:CTRL.VAL",16777215,1,"BEND:LTUS:460:CTRL.VAL") #! Record("BEND:LTUS:460:SELECTEN",321,381,0,0,"BEND:LTUS:460:SELECTEN") #! Field("BEND:LTUS:460:SELECTEN.A",16777215,0,"BEND:LTUS:460:SELECTEN.A") #! Field("BEND:LTUS:460:SELECTEN.FLNK",16777215,1,"BEND:LTUS:460:SELECTEN.FLNK") #! Link("BEND:LTUS:460:SELECTEN.FLNK","BEND:LTUS:460:BUSY") #! Field("BEND:LTUS:460:SELECTEN.VAL",16777215,1,"BEND:LTUS:460:SELECTEN.VAL") #! Record("BEND:LTUS:460:BUSY",623,274,0,0,"BEND:LTUS:460:BUSY") #! Field("BEND:LTUS:460:BUSY.DOL",16777215,0,"BEND:LTUS:460:BUSY.DOL") #! Link("BEND:LTUS:460:BUSY.DOL","BEND:LTUS:460:SELECTEN.VAL") #! Field("BEND:LTUS:460:BUSY.FLNK",16777215,1,"BEND:LTUS:460:BUSY.FLNK") #! Link("BEND:LTUS:460:BUSY.FLNK","BEND:LTUS:460:SELECT") #! Record("BEND:LTUS:460:SELECT",669,508,0,1,"BEND:LTUS:460:SELECT") #! Record("BEND:LTUS:460:FUNC",940,120,0,0,"BEND:LTUS:460:FUNC") #! Field("BEND:LTUS:460:FUNC.OUT",16777215,0,"BEND:LTUS:460:FUNC.OUT") #! Link("BEND:LTUS:460:FUNC.OUT","BEND:LTUS:460:CTRL.VAL") #! Record("BEND:LTUS:460:ABORT",193,41,0,0,"BEND:LTUS:460:ABORT") #! Record("BEND:LTUS:460:CTRLSTATE",369,34,0,0,"BEND:LTUS:460: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,"BEND:LTUS:460:SELECT is used for Multi-device selection.\nIt is enabled when associated BEND:LTUS:460:CTRL is \"0\" (DONE).\nIt is disabled when associated BEND:LTUS:460: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,"BEND:LTUS:460: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, "BEND:LTUS:460:BCTRL_INIT") { field(DESC, "Process BCTRL on boot") field(PINI, "YES") field(CALC, "A=3?1:0") field(INPA, "BEND:LTUS:460:BCTRL.SEVR") field(OUT, "BEND:LTUS:460: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, "BEND:LTUS:460:BACT") { field(DESC, "Actual B") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "BEND:LTUS:460:BACT") field(INPB, "BEND:LTUS:460:POLYCOEF") field(INPC, "BEND:LTUS:460:POLYCOEF.A") field(INPD, "BEND:LTUS:460:POLYCOEF.B") field(INPE, "BEND:LTUS:460:IACTCALC MS") field(INPF, "BEND:LTUS:460:BDELTAS PP") field(INPG, "100") field(EGU, "GeV/c") field(HOPR, "15.7673") field(LOPR, "0.0802") field(HIHI, "15.7673") field(LOLO, "0.0802") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "15.7673") field(LOW, "0.0802") field(FLNK, "BEND:LTUS:460: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, "BEND:LTUS:460:BDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntPhyDeltas") field(EGU, "GeV/c") field(HOPR, "1") field(PREC, "7") field(BRSV, "INVALID") field(INPA, "BEND:LTUS:460:BDES") field(INPB, "BEND:LTUS:460:TRIMBTOL") field(INPC, "BEND:LTUS:460:TRIMBTOLR") field(INPD, "BEND:LTUS:460:CHCKBTOL") field(INPE, "BEND:LTUS:460:CHCKBTOLR") field(F, "2.0") field(INPG, "30") field(INPH, "BEND:LTUS:460:BACT.VAL") # # MPS absolute and relative tolerances field(INPP, "BEND:LTUS:460:MPSBTOL") field(INPQ, "BEND:LTUS:460:MPSBTOLR") field(FLNK, "BEND:LTUS:460:BCONLIMITS") info(autosaveFields,"F") } # This record is processed by BDELTAS record(aSub, "BEND:LTUS:460:BCONLIMITS") { field(DESC, "Config B-field Limits") field(INAM, "mgntInit") field(SNAM, "mgntBCONLimits") field(INPA, "BEND:LTUS:460:BDES") field(INPB, "BEND:LTUS:460:BDELTAS.I") field(INPG, "BEND:LTUS:460:DEBUG.RVAL") field(FTA, "DOUBLE") field(FTB, "DOUBLE") field(FTG, "ULONG") field(OUTA, "BEND:LTUS:460:BCON.HIGH") field(OUTB, "BEND:LTUS:460:BCON.LOW") field(OUTC, "BEND:LTUS:460:BCON.HIHI") field(OUTD, "BEND:LTUS:460:BCON.LOLO PP") field(FTVA, "DOUBLE") field(FTVB, "DOUBLE") field(FTVC, "DOUBLE") field(FTVD, "DOUBLE") field(BRSV, "INVALID") field(FLNK, "BEND:LTUS:460:IDELTAS") } # The following PV is processed by :BACT # which is processed by :BACT # record(fanout, "BEND:LTUS:460:BACTFO") { field(DESC, "BACT processing") field(SELM, "All") field(LNK1, "BEND:LTUS:460:BDIFF") field(LNK2, "BEND:LTUS:460:BADIFF") field(LNK3, "BEND:LTUS:460:BRATIO") field(LNK4, "BEND:LTUS:460:MPSLIMITS") field(LNK5, "BEND:LTUS:460:I2BSTATUS") field(LNK6, "BEND:LTUS:460:IACTFO.PROC") } record(calc, "BEND:LTUS:460:BDIFF") { field(DESC, "BDES-BACT") field(CALC, "A-B") field(INPA, "BEND:LTUS:460:BDES") field(INPB, "BEND:LTUS:460:BACT") field(EGU, "GeV/c") field(PREC, "7") } record(calc, "BEND:LTUS:460:BADIFF") { field(DESC, "Absolute BDES-BACT") field(INPA, "BEND:LTUS:460:BDIFF") field(EGU, "GeV/c") field(PREC, "7") field(CALC, "A<0?ABS(A):A") } record(calc, "BEND:LTUS:460:BRATIO") { field(DESC, "BACT Error") field(CALC, "B?A/B:0") field(INPA, "BEND:LTUS:460:BDIFF") field(INPB, "BEND:LTUS:460:BDES.HOPR") field(EGU, "GeV/c") field(PREC, "7") } record(mbbi, "BEND:LTUS:460: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, "BEND:LTUS:460:BACT.J") } # Note: for a string slave set the MONFL # macro to the following: # MONFL=:IMONCALC MS record(sub, "BEND:LTUS:460:BMON") { field(DESC, "Second Transductor") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "BEND:LTUS:460:BMON") field(INPB, "BEND:LTUS:460:POLYCOEF") field(INPC, "BEND:LTUS:460:POLYCOEF.A") field(INPD, "BEND:LTUS:460:POLYCOEF.B") field(INPE, "BEND:LTUS:460:IMONCALC MS") field(INPF, "BEND:LTUS:460:BDELTAS.VAL") field(INPG, "100") field(EGU, "GeV/c") field(HOPR, "15.7673") field(LOPR, "0.0802") field(HIHI, "15.7673") field(LOLO, "0.0802") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "15.7673") field(LOW, "0.0802") } # 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=BEND:DMPS:400:BDES CP record(ao, "BEND:LTUS:460:BDES") { field(DESC, "Desired B-Field") field(PINI, "NO") field(DRVH, "15.7673") field(DRVL, "0.0802") field(HOPR, "15.7673") field(LOPR, "0.0802") field(PREC, "7") field(EGU, "GeV/c") field(MDEL, "-1") field(OMSL, "closed_loop") field(DOL, "BEND:LTUS:460:IDES2BDES") field(OUT, "BEND:LTUS:460:B2IDES PP") info(autosaveFields,"VAL") } record(sub, "BEND:LTUS:460:B2IDES") { field(DESC, "Convert Desired B-Field to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "BEND:LTUS:460:POLYCOEF") field(INPC, "BEND:LTUS:460:POLYCOEF.A") field(INPD, "BEND:LTUS:460:POLYCOEF.B") field(PREC, "7") field(EGU, "GeV/c") field(HOPR, "15.7673") field(LOPR, "0.0802") field(MDEL, "-1") field(INPE, "BEND:LTUS:460:BDES.DRVH") field(INPF, "BEND:LTUS:460:BDES.DRVL") field(BRSV, "INVALID") field(FLNK, "BEND:LTUS:460:IDES") } record(sub, "BEND:LTUS:460:BNOM") { field(DESC, "Nominal Field") field(PINI, "YES") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "BEND:LTUS:460:POLYCOEF") field(INPC, "BEND:LTUS:460:POLYCOEF.A") field(INPD, "BEND:LTUS:460:POLYCOEF.B") field(INPE, "BEND:LTUS:460:BDES.DRVH") field(INPF, "BEND:LTUS:460:BDES.DRVL") field(EGU, "GeV/c") field(HOPR, "15.7673") field(LOPR, "0.0802") field(PREC, "7") field(VAL, "0.0") field(FLNK, "BEND:LTUS:460:INOM") } record(sub, "BEND:LTUS:460:BACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "BEND:LTUS:460:BDES.VAL") field(INPB, "BEND:LTUS:460:BDES.DRVH") field(INPC, "BEND:LTUS:460:BDES.DRVL") field(INPD, "BEND:LTUS:460:BDELTAS.I") field(INPE, "BEND:LTUS:460:BDELTAS.J") field(INPG, "BEND:LTUS:460:STATE") field(INPH, "BEND:LTUS:460:HSTA") field(EGU, "GeV/c") field(HOPR, "15.7673") field(LOPR, "0.0802") field(PREC, "7") field(BRSV, "INVALID") } record(sub, "BEND:LTUS:460:BMONLIMITS") { field(DESC, "MON Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "BEND:LTUS:460:BDES.VAL") field(INPB, "BEND:LTUS:460:BDES.DRVH") field(INPC, "BEND:LTUS:460:BDES.DRVL") field(INPD, "BEND:LTUS:460:BDELTAS.K") field(INPE, "BEND:LTUS:460:BDELTAS.L") field(INPG, "BEND:LTUS:460:STATE") field(INPH, "BEND:LTUS:460:HSTA") field(EGU, "GeV/c") field(HOPR, "15.7673") field(LOPR, "0.0802") field(PREC, "7") field(BRSV, "INVALID") } record(seq, "BEND:LTUS:460:BLIMITS") { field(DESC, "ACT Limits") field(PREC, "7") field(DOL1, "BEND:LTUS:460:BLIMITS") field(LNK1, "BEND:LTUS:460:BACTLIMITS.F PP") field(DOL2, "BEND:LTUS:460:BACTLIMITS.I") field(LNK2, "BEND:LTUS:460:BACT.HIGH") field(DOL3, "BEND:LTUS:460:BACTLIMITS.J") field(LNK3, "BEND:LTUS:460:BACT.LOW") field(DOL4, "BEND:LTUS:460:BACTLIMITS.K") field(LNK4, "BEND:LTUS:460:BACT.HIHI") field(DOL5, "BEND:LTUS:460:BACTLIMITS.L") field(LNK5, "BEND:LTUS:460:BACT.LOLO") field(DOL6, "BEND:LTUS:460:BLIMITS") field(LNK6, "BEND:LTUS:460:BMONLIMITS.F PP") field(DOL7, "BEND:LTUS:460:BMONLIMITS.I") field(LNK7, "BEND:LTUS:460:BMON.HIGH") field(DOL8, "BEND:LTUS:460:BMONLIMITS.J") field(LNK8, "BEND:LTUS:460:BMON.LOW") field(DOL9, "BEND:LTUS:460:BMONLIMITS.K") field(LNK9, "BEND:LTUS:460:BMON.HIHI") field(DOLA, "BEND:LTUS:460:BMONLIMITS.L") field(LNKA, "BEND:LTUS:460:BMON.LOLO") field(FLNK, "BEND:LTUS:460:ILIMITS") field(SCAN, "5 second") } record(ao, "BEND:LTUS:460:BCTRL") { field(DESC, "B-Perturb") field(PREC, "7") field(EGU, "GeV/c") field(DRVH, "15.7673") field(DRVL, "0.0802") field(HOPR, "15.7673") field(LOPR, "0.0802") # 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, "BEND:LTUS:460: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, "BEND:LTUS:460:BCTRLGO") { field(DESC, "Update DES and perturb") field(PREC, "7") # Disable BACT limits field(DOL1, "1") field(LNK1, "BEND:LTUS:460:BLIMITS.VAL") # Update BDES with the BCTRL (slider) value field(DOL2, "BEND:LTUS:460:BCTRL.VAL") field(LNK2, "BEND:LTUS:460:BDES PP") field(DOL3, "1") field(LNK3, "BEND:LTUS:460:IDIRECT.PROC PP") field(DOL4, "1") field(LNK4, "BEND:LTUS:460:CHECKSTDZLOST.PROC PP") field(DOL5, "BEND:LTUS:460:BCTRL.VAL") field(LNK5, "BEND:LTUS:460:BCTRLSUB PP") # Re-enable BACT limits field(DOL6, "0") field(LNK6, "BEND:LTUS:460:BLIMITS.VAL") } # Convert B-field to Current and output to ISETPT record(sub, "BEND:LTUS:460:BCTRLSUB") { field(DESC, "Feedback") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "BEND:LTUS:460:POLYCOEF") field(INPC, "BEND:LTUS:460:POLYCOEF.A") field(INPD, "BEND:LTUS:460:POLYCOEF.B") field(INPE, "BEND:LTUS:460:BDES.DRVH") field(INPF, "BEND:LTUS:460:BDES.DRVL") field(PREC, "7") field(EGU, "GeV/c") field(HOPR, "15.7673") field(LOPR, "0.0802") field(MDEL, "-1") field(BRSV, "INVALID") field(FLNK, "BEND:LTUS:460:ISETPT") } record(ao, "BEND:LTUS:460:BDESPREVTRIM") { field(DESC, "trim bdes for undo") field(DTYP, "Soft Channel") field(DRVH, "15.7673") field(DRVL, "0.0802") field(EGU, "GeV/c") field(HOPR, "15.7673") field(LOPR, "0.0802") field(PREC, "7") field(PINI, "YES") info(autosaveFields,"VAL") } record(stringin, "BEND:LTUS:460:MADNAME") { field(DESC, "MAD deck nomenclature") field(PINI, "YES") field(VAL, "BX32B") } record(ai, "BEND:LTUS:460: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, "3350.877679") } record(ao, "BEND:LTUS:460:BMAX") { field(DESC, "Max B-Field") field(DTYP, "Soft Channel") field(DRVH, "15.7673") field(DRVL, "0.0802") field(EGU, "GeV/c") field(HOPR, "15.7673") field(LOPR, "0.0802") field(PREC, "7") field(PINI, "YES") field(VAL, "15.7673") field(FLNK, "BEND:LTUS:460:BSTEP") } record(ao, "BEND:LTUS:460:BMIN") { field(DESC, "Min B-Field") field(DTYP, "Soft Channel") field(DRVH, "15.7673") field(DRVL, "0.0802") field(EGU, "GeV/c") field(HOPR, "15.7673") field(LOPR, "0.0802") field(PREC, "7") field(PINI, "YES") field(VAL, "0.0802") field(FLNK, "BEND:LTUS:460:BSTEP") } record(ao, "BEND:LTUS:460:BDESSAVE") { field(DESC, "bdes for save/load") field(DTYP, "Soft Channel") field(DRVH, "15.7673") field(DRVL, "0.0802") field(EGU, "GeV/c") field(HOPR, "15.7673") field(LOPR, "0.0802") field(PINI, "YES") field(PREC, "7") } # This record is processed by BEND:LTUS:460: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, "BEND:LTUS:460:BCON") { field(DESC, "Config B-Field ") field(DTYP, "Soft Channel") field(PREC, "7") field(EGU, "GeV/c") field(HOPR, "15.7673") field(LOPR, "0.0802") field(DRVH, "15.7673") field(DRVL, "0.0802") # 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 , "BEND:LTUS:460:ICON2BCON") field(OMSL, "closed_loop") field(OUT, "BEND:LTUS:460:B2ICON PP") info(autosaveFields,"VAL") } record(sub, "BEND:LTUS:460:B2ICON") { field(DESC, "Convert Desired ICon to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "BEND:LTUS:460:POLYCOEF") field(INPC, "BEND:LTUS:460:POLYCOEF.A") field(INPD, "BEND:LTUS:460:POLYCOEF.B") field(PREC, "7") field(EGU, "GeV/c") field(HOPR, "15.7673") field(LOPR, "0.0802") field(MDEL, "-1") field(INPE, "BEND:LTUS:460:BCON.DRVH") field(INPF, "BEND:LTUS:460:BCON.DRVL") field(BRSV, "INVALID") field(FLNK, "BEND:LTUS:460: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, "BEND:LTUS:460:BSTEP") { field(DESC, "B-Field step size") field(CALC, "(C==3)||(D==3)?0:ABS(A-B)*0.005") field(INPA, "BEND:LTUS:460:BMAX") field(INPB, "BEND:LTUS:460:BMIN") field(INPC, "BEND:LTUS:460:BMIN.SEVR") field(INPD, "BEND:LTUS:460:BMAX.SEVR") field(EGU, "GeV/c") 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,"BEND:LTUS:460:BCTRLDISABLECALC") { field(DESC, "Calc for disabling BCTRL") field(ASG, "Internal") field(CALC, "A?2:1") field(INPA, "BEND:LTUS:460:ONLINE CP") field(OUT, "BEND:LTUS:460:BCTRLDISABLEFOUT PP") } record(fanout, "BEND:LTUS:460:BCTRLDISABLEFOUT") { field(DESC, "Disable BCTRL fanout") field(SELM, "Specified") field(SELL, "BEND:LTUS:460:BCTRLDISABLECALC") field(LNK1, "BEND:LTUS:460:BCTRLDISABLE") field(LNK2, "BEND:LTUS:460:BCTRLENABLE") } record(stringout, "BEND:LTUS:460:BCTRLDISABLE") { field(DESC, "Disable BCTRL") field(DTYP, "Soft Channel") field(OUT, "BEND:LTUS:460:BCTRL.ASG") field(VAL, "NOWRITE") field(FLNK, "BEND:LTUS:460:BCTRLDISV_UPDATE") } record(stringout, "BEND:LTUS:460:BCTRLENABLE") { field(DESC, "Enable BCTRL") field(DTYP, "Soft Channel") field(OUT, "BEND:LTUS:460:BCTRL.ASG") field(VAL, "") field(FLNK, "BEND:LTUS:460:BCTRLDISV_UPDATE") } record(calcout, "BEND:LTUS:460:BCTRLDISV_UPDATE") { field(DESC, "Calc for updating BCTRL.DISV") field(ASG, "Internal") field(CALC, "A") field(INPA, "BEND:LTUS:460:ONLINE") field(OUT, "BEND:LTUS:460: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,"BEND:LTUS:460:BACT and MON\n are processed via links from \n BEND:LTUS:460:IACT (device raw value readback 1)\n and\n BEND:LTUS:460: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 BEND:LTUS:460:POLYCOEF\nC = First polynomial coefficient (offset if linear)\nD = Second polynomial coefficient (slope if linear)\nE = BEND:LTUS:460: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,"BEND:LTUS:460:BDES\n is processed when set by CA users or \n BEND:LTUS:460: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,"BEND:LTUS:460: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 BEND:LTUS:460: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 (BEND:LTUS:460: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,"BEND:LTUS:460:B*LIMITS and BEND:LTUS:460:BLIMITS:\n Calculate alarm and warning limits based on \n deltas from BEND:LTUS:460: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,"BEND:LTUS:460: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,"BEND:LTUS:460: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, "BEND:LTUS:460: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, "BEND:LTUS:460:MPSBTOL") { field(DESC, "Absolute mps tol") field(EGU, "GeV/c") field(PREC, "2") field(CALC, "ABS(A)*0.02") field(INPA, "BEND:LTUS:460:BMAX") field(PINI, "YES") } # # 21-Aug-2013: K. Luchini # Set channel access security so that users # cannot easily change values. record(ao, "BEND:LTUS:460:MPSBMAX") { field(DESC, "MPS Max B-field") field(EGU, "GeV/c") field(PREC, "7") field(DRVH, "15.7673") field(DRVL, "0.0802") field(PINI, "YES") field(VAL, "15.7673") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:460:MPSBMIN") { field(DESC, "MPS Min B-field") field(EGU, "GeV/c") field(PREC, "7") field(DRVH, "15.7673") field(DRVL, "0.0802") field(PINI, "YES") field(VAL, "0.0802") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:460:MPSBLLIM") { field(DESC, "MPS Low Limit B-field") field(EGU, "GeV/c") field(PREC, "7") field(DRVH, "15.7673") field(DRVL, "0.0802") field(PINI, "YES") field(VAL, "0.0802") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:460:MPSBLLIM2") { field(DESC, "MPS Low Limit #2 B-field") field(EGU, "GeV/c") field(PREC, "7") field(DRVH, "15.7673") field(DRVL, "0.0802") field(PINI, "YES") field(VAL, "0.0802") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } # Set the default to Std record(mbbo, "BEND:LTUS:460: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, "BEND:LTUS:460:MPSLIMITS.E PP") } record(aSub, "BEND:LTUS:460: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, "BEND:LTUS:460:MPS.RVAL") field(INPB, "BEND:LTUS:460:BADIFF") field(INPC, "BEND:LTUS:460:BDELTAS.N") field(INPD, "BEND:LTUS:460:BACT") field(INPE, "BEND:LTUS:460:MPSBITMASK.RVAL") field(INPF, "BEND:LTUS:460:MPSBLLIM") field(INPG, "BEND:LTUS:460:MPSBMIN") field(INPH, "BEND:LTUS:460:MPSBMAX") field(INPI, "BEND:LTUS:460: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, "BEND:LTUS:460:INTOL.RVAL PP") field(OUTB, "BEND:LTUS:460:INTOL_BMIN.RVAL PP") field(OUTC, "BEND:LTUS:460:INTOL_BRANGE.RVAL PP") field(OUTD, "BEND:LTUS:460: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, "BEND:LTUS:460:INTOL") { field(DESC, "BACT within MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "BEND:LTUS:460:MPSLIMITS.VALA") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "BEND:LTUS:460:INTOL_BMIN") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "BEND:LTUS:460:MPSLIMITS.VALB") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "BEND:LTUS:460:INTOL_BMIN2") { field(DESC, "MPS tol #2") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "BEND:LTUS:460:MPSLIMITS.VALD") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "BEND:LTUS:460:INTOL_BRANGE") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "BEND:LTUS:460: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, "BEND:LTUS:460:CHCKITOL") { field(DESC, "Absolute Check I Tolerance") field(EGU, "A") field(FLNK, "BEND:LTUS:460:TRIMITOL") field(CALC, "ABS(A*B)") field(INPA, "BEND:LTUS:460:CHCKBTOL") field(INPB, "BEND:LTUS:460:POLYCOEF.B") field(PREC, "9") } record(calc, "BEND:LTUS:460:TRIMBTOL") { field(EGU, "GeV/c") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(DESC, "Absolute Trim Tolerance") field(CALC, "ABS(A)/2") field(INPA, "BEND:LTUS:460:CHCKBTOL") field(FLNK, "BEND:LTUS:460:CHCKITOL") } record(calc, "BEND:LTUS:460:CHCKBTOL") { field(DESC, "Check absolute tolerance") field(EGU, "A") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(FLNK, "BEND:LTUS:460:TRIMBTOL") field(CALC, "MAX(ABS(A),ABS(C))*(B/1000000)") field(INPA, "BEND:LTUS:460:BDES.HOPR") field(INPB, "BEND:LTUS:460:STABILITY") field(INPC, "BEND:LTUS:460:BDES.LOPR") } record(longout, "BEND:LTUS:460: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, "BEND:LTUS:460:CHCKBTOL") } record(calc, "BEND:LTUS:460:TRIMITOL") { field(DESC, "Absolute Trim I Tolerance") field(EGU, "GeV/c") field(CALC, "ABS(A*B)") field(INPA, "BEND:LTUS:460:POLYCOEF.B") field(INPB, "BEND:LTUS:460:TRIMBTOL") field(PREC, "9") } record(ai, "BEND:LTUS:460:TRIMBTOLR") { field(DESC, "Relative trim tol") field(PREC, "4") field(EGU, "%") field(HOPR, "1.0") field(LOPR, "0.0") field(PINI, "YES") } record(ai, "BEND:LTUS:460: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, "BEND:LTUS:460:FBCKFCOM") { field(ZNAM, "CA") field(ONAM, "FCOM") field(DESC, "CA Mode") field(PINI, "YES") field(SDIS, "0") } record(bo, "BEND:LTUS:460:PAU") { field(ZNAM, "NotConfigured") field(ONAM, "Configured") field(DESC, "PAU Present") field(PINI, "YES") field(SDIS, "0") field(FLNK, "BEND:LTUS:460:PAUGO") } record(fanout, "BEND:LTUS:460:PAUGO") { field(DESC, "PAU control") field(LNK1, "BEND:LTUS:460:PAUSTOP") field(LNK2, "BEND:LTUS:460: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, "BEND:LTUS:460:PAUSTART") { field(DESC, "Setup for PAU On") field(SDIS, "BEND:LTUS:460: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, "BEND:LTUS:460:PAUSTOP") { field(DESC, "Setup for PAU Off") field(SDIS, "BEND:LTUS:460: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, "BEND:LTUS:460:MCORDEVNAME") { field(DESC, "PS device name") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, "BEND:DMPS:400:") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "BEND:LTUS:460: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, "BEND:LTUS:460:PSTYPE.RVAL") field(INPC, "BEND:LTUS:460:TURNEDOFF.RVAL") field(INPD, "BEND:LTUS:460:CONFIG.RVAL") field(INPE, "BEND:LTUS:460:PSCATEGORY.RVAL") field(INPF, "BEND:LTUS:460:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "BEND:LTUS:460:AUTOCTRL.RVAL") field(INPJ, "BEND:LTUS:460:OUTOFSERVICE.RVAL") field(INPL, "BEND:LTUS:460:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "BEND:LTUS:460:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "BEND:LTUS:460:PAU") field(INPP, "BEND:LTUS:460:CALBDISABLE.RVAL") field(INPQ, "BEND:LTUS:460:PTRBDISABLE.RVAL") field(INPR, "BEND:LTUS:460:TRIMDISABLE.RVAL") field(INPS, "BEND:LTUS:460:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "BEND:LTUS:460:FBCK") field(INPU, "BEND:LTUS:460:TRIMTYPE.RVAL") field(INPV, "BEND:LTUS:460:STDZDIRECT.RVAL") field(INPW, "BEND:LTUS:460:DEGAUSENABLE.RVAL") field(FLNK, "BEND:LTUS:460:HSTA") } record(longin, "BEND:LTUS:460:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "BEND:LTUS:460:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "BEND:LTUS:460: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, "BEND:LTUS:460: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, "BEND:LTUS:460: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, "BEND:LTUS:460: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, "BEND:LTUS:460: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, "BEND:LTUS:460: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 BEND:LTUS:460:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses BEND:LTUS:460:FBCK. # This PV should be replaced by BEND:LTUS:460: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, "BEND:LTUS:460: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, "BEND:LTUS:460: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, "BEND:LTUS:460: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, "BEND:DMPS:400:OUTOFSERVICE CPP NMS") field(OMSL, "closed_loop") field(FLNK, "BEND:LTUS:460:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"BEND:LTUS:460:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "BEND:LTUS:460:OUTOFSERVICE NPP NMS") field(OUT, "BEND:LTUS:460:ONLINE PP") } record(bo, "BEND:LTUS:460:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "BEND:LTUS:460: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, "BEND:LTUS:460: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, "BEND:LTUS:460: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, "BEND:LTUS:460: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, "BEND:LTUS:460: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, "BEND:LTUS:460: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, "BEND:LTUS:460: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, "BEND:LTUS:460: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, "BEND:LTUS:460: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, "BEND:LTUS:460: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, "BEND:LTUS:460: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, "BEND:LTUS:460:TRIMTYPE") } record(stringout, "BEND:LTUS:460:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "BEND:DMPS:400:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "BEND:LTUS:460:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "BEND:LTUS:460:STATE.RVAL") field(INPB, "BEND:LTUS:460:INTLKSUMY.RVAL") field(OUT, "BEND:LTUS:460:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "BEND:LTUS:460: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, "BEND:LTUS:460:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "BEND:LTUS:460:STATE.RVAL") field(INPB, "BEND:LTUS:460:INTLKSUMY.RVAL") field(OUT, "BEND:LTUS:460:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "BEND:LTUS:460:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "BEND:LTUS:460:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "BEND:LTUS:460: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, "BEND:LTUS:460: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, "BEND:LTUS:460: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, "BEND:LTUS:460: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,"BEND:LTUS:460: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("BEND:LTUS:460:TURNEDOFF",3140,1907,0,1,"BEND:LTUS:460:TURNEDOFF") #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "BEND:LTUS:460:STATSUB") { field(DESC, "Build STATus ") field(INAM, "mgntInit") field(SNAM, "mgntSlcStat") field(INPA, "BEND:LTUS:460:BACT.STAT") field(INPB, "BEND:LTUS:460:BDES.STAT") field(INPC, "BEND:LTUS:460: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, "BEND:LTUS:460:BACT.SEVR") field(INPH, "BEND:LTUS:460:BDES.SEVR") field(INPI, "BEND:LTUS:460: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, "BEND:LTUS:460:STATE.RVAL") field(INPN, "BEND:LTUS:460:STDZOK") field(INPO, "BEND:LTUS:460:CALBOK") field(INPP, "BEND:LTUS:460:OUTOFSERVICE.RVAL") field(INPQ, "BEND:LTUS:460:CONFIG.RVAL") field(INPR, "BEND:LTUS:460:HSTA") field(INPS, "BEND:LTUS:460:CTRL.RVAL") field(INPT, "BEND:LTUS:460:DEGAUSOK") field(INPV, "BEND:LTUS:460: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, "BEND:LTUS:460:STAT") } record(longout, "BEND:LTUS:460:STAT") { field(DESC, "STAT sent to SLC") field(SCAN, "Passive") field(FLNK, "BEND:LTUS:460:STATCTRLSUB") field(DOL, "BEND:LTUS:460:STATSUB.VAL") field(OMSL, "closed_loop") } record(sSub, "BEND:LTUS:460:STATCTRLSUB") { field(DESC, "Decode SLC STAT into mbbo") field(INAM, "mgntInit") field(SNAM, "mgntStatDecode") field(INPA, "BEND:LTUS:460:STAT") field(INPB, "BEND:LTUS:460:HSTA") field(INPD, "BEND:LTUS:460:ONOFFCTRL.RVAL") field(FLNK, "BEND:LTUS:460:STATMSG") } record(mbbo, "BEND:LTUS:460: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, "BEND:LTUS:460:UNAVAILGO") field(DOL, "BEND:LTUS:460:STATCTRLSUB.W") } record(seq, "BEND:LTUS:460:UNAVAILGO") { field(DESC, "Process UNAVAIL") field(DOL1, "BEND:LTUS:460:STATSUB.U") field(LNK1, "BEND:LTUS:460:UNAVAIL PP") } record(stringout, "BEND:LTUS:460:SNLSTATMSG") { field(DTYP, "Soft Channel") } #! TextBox(TB0,820,1000,1200,1220,0,"Dialog",12,1,16777215,"BEND:LTUS:460:STATUSSUB - future\nOverall device status - takes input from action snls, record sevrs, master snl(s) and outputs final status\n\nInputs:\nA - BEND:LTUS:460:CTRLSTATUS - snl status\nB - MGNT:CTRLSTATUS - master list status\nC\nD - BEND:LTUS:460: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,"BEND:LTUS:460STATSUB\nformat control bo's into slc STAT\n\nInputs:\nA - BEND:LTUS:460:STATUS\nC - BEND:LTUS:460:ON\nD - BEND:LTUS:460:STDZOK\nE - BEND:LTUS:460:CALBOK\nF - BEND:LTUS:460:BACTDRIFT (future)\nG -\nH- BEND:LTUS:460:DACSTATUS\nI -BEND:LTUS:460:ADCSTATUS\nJ - BEND:LTUS:460:BACTSTATUS\nK - BEND:LTUS:460:BDESSTATUS\nL - BEND:LTUS:460:RIPLSTATUS\n\nOutput:\nP - BEND:LTUS:460: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, "BEND:LTUS:460: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, "BEND:LTUS:460: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, "BEND:LTUS:460: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, "BEND:LTUS:460: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, "BEND:LTUS:460:IDESTOTAL"){ field(DESC, "Calc total current") field(CALC, "A+B") field(EGU, "GeV/c") field(PREC, "7") field(INPA, "BEND:DMPS:400:IDES CP NMS") field(INPB, "BTRM:LTUS:460:BDES CP NMS") field(OUT, "BEND:LTUS:460:IDES2BDES.E PP") } record(sub, "BEND:LTUS:460:IDES2BDES") { field(DESC, "Cal BDES") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "BEND:LTUS:460:IDES2BDES") field(INPB, "BEND:LTUS:460:POLYCOEF") field(INPC, "BEND:LTUS:460:POLYCOEF.A") field(INPD, "BEND:LTUS:460:POLYCOEF.B") field(INPE, "BEND:LTUS:460:IDESTOTAL MS") field(INPF, "BEND:DMPS:400:BDELTAS PP") field(INPG, "100") field(EGU, "GeV/c") field(HOPR, "15.7673") field(LOPR, "0.0802") field(HIHI, "15.7673") field(LOLO, "0.0802") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "15.7673") field(LOW, "0.0802") field(FLNK, "BEND:LTUS:460: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, "BEND:LTUS:460:IACTCALC"){ field(DESC, "Calc total act current") field(CALC, "A+B") field(EGU, "GeV/c") field(PREC, "7") field(INPA, "BEND:LTUS:460:IACT CP NMS") field(INPB, "BTRM:LTUS:460:BACT") field(OUT, "BEND:LTUS:460: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, "BEND:LTUS:460:IMONCALC"){ field(DESC, "Calc total mon current") field(CALC, "A+B") field(EGU, "GeV/c") field(PREC, "7") field(INPA, "BEND:LTUS:460:IMON CP NMS") field(INPB, "BTRM:LTUS:460:BMON") field(OUT, "BEND:LTUS:460: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, "BEND:LTUS:460:ICONTOTAL"){ field(DESC, "Calc total current") field(CALC, "A+B") field(EGU, "GeV/c") field(PREC, "7") field(INPA, "BEND:DMPS:400:ICON CP NMS") field(INPB, "BTRM:LTUS:460:BCON CP NMS") field(OUT, "BEND:LTUS:460:ICON2BCON.E PP") } record(sub, "BEND:LTUS:460:ICON2BCON") { field(DESC, "Cal BCON") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "BEND:LTUS:460:ICON2BCON") field(INPB, "BEND:LTUS:460:POLYCOEF") field(INPC, "BEND:LTUS:460:POLYCOEF.A") field(INPD, "BEND:LTUS:460:POLYCOEF.B") field(INPE, "BEND:LTUS:460:ICONTOTAL MS") field(INPF, "BEND:DMPS:400:BDELTAS PP") field(INPG, "100") field(EGU, "GeV/c") field(HOPR, "15.7673") field(LOPR, "0.0802") field(HIHI, "15.7673") field(LOLO, "0.0802") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "15.7673") field(LOW, "0.0802") field(FLNK, "BEND:LTUS:460:BCON") } #! 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, "BEND:LTUS:763:IACT") { field(DESC, "Current") field(INP, "BEND:LTUS:764:IACT CP NMS") field(EGU, "A") field(HOPR, "17.5") field(LOPR, "-17.5") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "BEND:LTUS:763:IACTCALC") info(autosaveFields,"HYST") } record(bi, "BEND:LTUS:763:STATE") { field(DESC, "PS On/Off Status") field(DTYP, "Raw Soft Channel") field(INP, "BEND:LTUS:764:STATE CP MS") field(ZSV, "MAJOR") field(ZNAM, "OFF") field(ONAM, "ON") } record(ao, "BEND:LTUS:763:IDES") { field(DESC, "Desired Current") field(PREC, "3") field(EGU, "A") field(HOPR, "17.5") field(LOPR, "-17.5") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(MDEL, "-1") field(HIHI, "17.5") field(LOLO, "-17.5") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "BEND:LTUS:763:BDELTAS") field(DRVH, "17.5") field(DRVL, "-17.5") field(DOL, "BEND:LTUS:763: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, "BEND:LTUS:763:ICTRL PP") } # This record is processed by BEND:LTUS:763:ICON") # Note: we are not setting alarms here. record(ao, "BEND:LTUS:763:ICON") { field(DESC, "Config I") field(DTYP, "Soft Channel") field(PREC, "3") field(HOPR, "17.5") field(LOPR, "-17.5") field(DRVH, "17.5") field(DRVL, "-17.5") field(DOL, "BEND:LTUS:763:B2ICON.K") field(OMSL, "closed_loop") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:763:INOM") { field(DESC, "Nominal Current") field(DOL, "BEND:LTUS:763:BNOM.K") field(OMSL, "closed_loop") field(PREC, "3") field(EGU, "A") field(DRVH, "17.5") field(DRVL, "-17.5") field(HOPR, "17.5") field(LOPR, "-17.5") } record(ao, "BEND:LTUS:763:ICTRL") { field(DESC, "Set Current") field(PREC, "3") field(EGU, "A") field(HOPR, "17.5") field(LOPR, "-17.5") field(DRVH, "17.5") field(DRVL, "-17.5") field(MDEL, "-1") field(FLNK, "BEND:LTUS:763:ICTRLGO") field(OMSL, "supervisory") info(autosavefields,"VAL") } record(seq, "BEND:LTUS:763:ICTRLGO") { field(DESC, "Process Current Setpoint") field(PREC, "3") # Set ISETPT to supervisory field(DOL1, "0") field(LNK1, "BEND:LTUS:763:ISETPT.OMSL") field(DOL2, "BEND:LTUS:763:ICTRL") field(LNK2, "BEND:LTUS:763:ISETPT PP") # Set ISETPT to closed loop - get data from BCTRLSUB.K field(DOL3, "1") field(LNK3, "BEND:LTUS:763:ISETPT.OMSL") } record(ao, "BEND:LTUS:763:IMAX") { field(DESC, "Max I") field(DTYP, "Soft Channel") field(DRVH, "17.5") field(DRVL, "-17.5") field(EGU, "A") field(HOPR, "17.5") field(LOPR, "-17.5") field(PREC, "3") field(PINI, "YES") field(VAL, "17.5") field(FLNK, "BEND:LTUS:763:IMIN") } record(ao, "BEND:LTUS:763:IMIN") { field(DESC, "Min I") field(DTYP, "Soft Channel") field(DRVH, "17.5") field(DRVL, "-17.5") field(EGU, "A") field(HOPR, "17.5") field(LOPR, "-17.5") field(PREC, "3") field(VAL, "-17.5") field(FLNK, "BEND:LTUS:763:IRANGE") } record(sel, "BEND:LTUS:763:IACTPREVOK") { field(DESC, "Last Good Current") field(EGU, "A") field(HOPR, "17.5") field(LOPR, "-17.5") field(PREC, "3") field(NVL, "BEND:LTUS:763:BACT.SEVR") field(INPA, "BEND:LTUS:763:IACT NPP MS") field(INPB, "BEND:LTUS:763:IACTPREVOK NPP MS") field(INPC, "BEND:LTUS:763:IACTPREVOK NPP MS") field(INPD, "BEND:LTUS:763:IACTPREVOK NPP MS") } record(sub, "BEND:LTUS:763:IACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "BEND:LTUS:763:IDES") field(INPB, "BEND:LTUS:763:ISETPT.DRVH") field(INPC, "BEND:LTUS:763:ISETPT.DRVL") field(INPD, "BEND:LTUS:763:IDELTAS.I") field(INPE, "BEND:LTUS:763:IDELTAS.J") field(INPG, "BEND:LTUS:763:STATE") field(INPH, "BEND:LTUS:763:HSTA") field(EGU, "A") field(HOPR, "17.5") field(LOPR, "-17.5") field(PREC, "3") field(BRSV, "INVALID") } record(sub, "BEND:LTUS:763:IMONLIMITS") { field(DESC, "Aux Current Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "BEND:LTUS:763:IDES") field(INPB, "BEND:LTUS:763:ISETPT.DRVH") field(INPC, "BEND:LTUS:763:ISETPT.DRVL") field(INPD, "BEND:LTUS:763:IDELTAS.K") field(INPE, "BEND:LTUS:763:IDELTAS.L") field(INPG, "BEND:LTUS:763:STATE") field(INPH, "BEND:LTUS:763:HSTA") field(EGU, "A") field(HOPR, "17.5") field(LOPR, "-17.5") field(PREC, "3") field(BRSV, "INVALID") } record(seq, "BEND:LTUS:763:ILIMITS") { field(DESC, "Set ACT and MON Limits") field(PREC, "3") field(DOL1, "BEND:LTUS:763:BLIMITS") field(LNK1, "BEND:LTUS:763:IACTLIMITS.F PP") field(DOL2, "BEND:LTUS:763:IACTLIMITS.I") field(LNK2, "BEND:LTUS:763:IACT.HIGH") field(DOL3, "BEND:LTUS:763:IACTLIMITS.J") field(LNK3, "BEND:LTUS:763:IACT.LOW") field(DOL4, "BEND:LTUS:763:IACTLIMITS.K") field(LNK4, "BEND:LTUS:763:IACT.HIHI") field(DOL5, "BEND:LTUS:763:IACTLIMITS.L") field(LNK5, "BEND:LTUS:763:IACT.LOLO") field(DOL6, "BEND:LTUS:763:BLIMITS") field(LNK6, "BEND:LTUS:763:IMONLIMITS.F PP") field(DOL7, "BEND:LTUS:763:IMONLIMITS.I") field(LNK7, "BEND:LTUS:763:IMON.HIGH") field(DOL8, "BEND:LTUS:763:IMONLIMITS.J") field(LNK8, "BEND:LTUS:763:IMON.LOW") field(DOL9, "BEND:LTUS:763:IMONLIMITS.K") field(LNK9, "BEND:LTUS:763:IMON.HIHI") field(DOLA, "BEND:LTUS:763:IMONLIMITS.L") field(LNKA, "BEND:LTUS:763: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, "BEND:LTUS:763:IDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntRawDeltas") field(INPD, "BEND:LTUS:763:TRIMBTOL") field(INPE, "BEND:LTUS:763:CHCKBTOL") field(INPF, "BEND:LTUS:763:BDELTAS.K") field(INPG, "BEND:LTUS:763:BDELTAS.L") field(INPH, "BEND:LTUS:763: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, "BEND:LTUS:763:STDZITOLR") field(INPC, "BEND:LTUS:763:STDZITOL") field(FLNK, "") } # All ps controllers with on/off control will set the macro ONOF # as follows: # # ONOF = BEND:LTUS:764: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, "BEND:LTUS:763: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 = BEND:LTUS:764:RESET PP # record(bo, "BEND:LTUS:763: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, "BEND:LTUS:763:RAMPSTATE") { field(DESC, "PS Ramp Status") field(DTYP, "Soft Channel") field(DOL, "BEND:LTUS:764: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, "BEND:LTUS:763: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, "BEND:LTUS:763:TRIMRAMPRATE") field(OUT, "") field(FLNK, "BEND:LTUS:763:STDZDLY") } record(ao, "BEND:LTUS:763:ISETPT") { field(DESC, "Current Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(EGU, "A") field(HOPR, "17.5") field(LOPR, "-17.5") field(DRVH, "17.5") field(DRVL, "-17.5") field(MDEL, "-1") field(OUT, "") field(DOL, "BEND:LTUS:763: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, "BEND:LTUS:763:IMON") { field(DESC, "Aux Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(INP, "BEND:LTUS:764:IMON CP NMS") field(EGU, "A") field(HOPR, "17.5") field(LOPR, "-17.5") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "BEND:LTUS:763:IMONCALC") } record(ao, "BEND:LTUS:763:IRIPL") { field(DESC, "Ripple Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(DOL, "BEND:LTUS:764:IRIPL CP NMS") field(OMSL, "closed_loop") field(EGU, "A") field(DRVH, "1.0") field(HOPR, "1.0") field(PREC, "3") field(FLNK, "BEND:LTUS:763:IRIPLOK") } record(sub, "BEND:LTUS:763:IRIPLOK") { field(DESC, "Ripple Current Status") field(INAM, "mgntInit") field(SNAM, "mgntRiplOK") field(INPA, "BEND:LTUS:763:IRIPL.VAL") field(INPB, "BEND:LTUS:763: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, "BEND:LTUS:763:R") { field(DESC, "Resistance") field(EGU, "Ohms") field(PREC, "4") field(PINI, "YES") field(DOL, "BEND:LTUS:764: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, "BEND:LTUS:763:IGND") { field(DESC, "Ground Current") field(EGU, "A") field(PREC, "6") field(PINI, "YES") field(DOL, "BEND:LTUS:764:IGND CP MS") field(OMSL, "closed_loop") } record(bi, "BEND:LTUS:763:INTLKSUMY") { field(DESC, "Interlock Summary") field(INP, "BEND:LTUS:764:INTLKSUMY CP MS") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(ZNAM, "OK") field(ONAM, "FAULT") field(PINI, "NO") } record(mbbo, "BEND:LTUS:763: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, "BEND:LTUS:764:COOLING CP NMS") field(OMSL, "closed_loop") } # The following PV is processed by :BACTFO # which is processed by :BACT record(fanout, "BEND:LTUS:763:IACTFO") { field(DESC, "IACT processing") field(SELM, "All") field(LNK1, "BEND:LTUS:763:IACTPREVOK") field(LNK2, "BEND:LTUS:763:IDIFF") field(LNK3, "BEND:LTUS:763:IADIFF") field(LNK4, "BEND:LTUS:763:IRATIO") field(LNK5, "BEND:LTUS:763:IDIRECT") field(LNK6, "BEND:LTUS:763:IACTPOL_CHECK") } record(calc, "BEND:LTUS:763:IDIFF") { field(DESC, "IDES-IACT") field(CALC, "A-B") field(INPA, "BEND:LTUS:763:IDES") field(INPB, "BEND:LTUS:763:IACT") field(EGU, "A") field(PREC, "9") field(HOPR, "17.5") field(LOPR, "-17.5") } record(calc, "BEND:LTUS:763:IADIFF") { field(DESC, "Absolute IDES-IACT") field(CALC, "A<0?ABS(A):A") field(INPA, "BEND:LTUS:763:IDIFF") field(PREC, "9") } record(calc, "BEND:LTUS:763:IRATIO") { field(DESC, "IDES-IACT/IMAX") field(CALC, "B?A/B:0") field(INPA, "BEND:LTUS:763:IDIFF") field(INPB, "BEND:LTUS:763:IDES.DRVH") field(PREC, "9") } record(calcout, "BEND:LTUS:763:IRANGE") { field(DESC, "Current Range") field(PINI, "YES") field(CALC, "ABS(A-B)") field(INPA, "BEND:LTUS:763:IMIN") field(INPB, "BEND:LTUS:763: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, "BEND:LTUS:763: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, "BEND:LTUS:763:IACT") field(FLNK, "BEND:LTUS:763:IACTPOL") } record(bo, "BEND:LTUS:763:IACTPOL") { field(DESC, "Actual I Polarity") field(DTYP, "Raw Soft Channel") field(DOL, "BEND:LTUS:763: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,"BEND:LTUS:763:I*LIMITS:\n Calculate alarm and warning limits based on \n deltas from BEND:LTUS:763:IDELTAS and the\n BEND:LTUS:763: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,"BEND:LTUS:763:IACT: \n Get copy of BEND:LTUS:763:I. \n",null) #! TextBox(TB12,1280,3100,1760,3200,0,"Dialog",12,1,16777215,"BEND:LTUS:763: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,"BEND:LTUS:763:IDES:\n Contains raw value calculated by \nBEND:LTUS:763: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 \nBEND:LTUS:763:BDELTAS.\n",null) #! TextBox(TB10,56,1940,316,2340,0,"Dialog",12,1,16777215,"BEND:LTUS:763: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 BEND:LTUS:763: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 BEND:LTUS:763: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,"BEND:LTUS:763:ISETPT:\n Sets the hardware. When fast feedback is set on, this record is\n set to closed loop mode by BEND:LTUS:763:FBCKSTART sequence. When \n the loop is closed, this record takes input calculated by \n BFBCK only. When fast feedback is set off, BEND:LTUS:763:FBCKSTOP \n will set it back to supervisory so that the value can be set by \n BEND:LTUS:763: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, "BEND:LTUS:763:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:763:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "BEND:LTUS:763:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "BEND:LTUS:763:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "BEND:LTUS:763:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "BEND:LTUS:763:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "1") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "BEND:LTUS:763: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, "BEND:LTUS:763:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "BEND:LTUS:763:TRIMTYPE.RVAL") field(INPB, "BEND:LTUS:763:CONFIG.RVAL") field(OUT, "BEND:LTUS:763:TRIMMAXNUM PP") } record(longout, "BEND:LTUS:763: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, "BEND:LTUS:763: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, "BEND:LTUS:764:TRIMRAMPRATE CP NMS") field(OMSL, "closed_loop") field(VAL, "") field(OUT, "BEND:LTUS:763:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "BEND:LTUS:763: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, "BEND:LTUS:764:TRIMSETL CP NMS") field(OMSL, "closed_loop") field(VAL, "") } record(bo, "BEND:LTUS:763: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, "BEND:LTUS:763: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, "BEND:LTUS:763: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, "BEND:LTUS:763:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "0") } record(ao, "BEND:LTUS:763: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, "BEND:LTUS:763:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "BEND:LTUS:763: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, "BEND:LTUS:763: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, "BEND:LTUS:763:IMOVE") field(INPB, "BEND:LTUS:763:IACT") field(INPC, "BEND:LTUS:763:IRAMPRATE") field(INPD, "1.577") field(INPE, "BEND:LTUS:763:TRIMDLYPCT") field(INPF, "BEND:LTUS:763:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "BEND:LTUS:763:RAMPTIME_LEFT PP") } record(longout, "BEND:LTUS:763:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "BEND:LTUS:763:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "BEND:LTUS:763:RAMPDONE_CALC") } record(calc, "BEND:LTUS:763:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "BEND:LTUS:763:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "BEND:LTUS:763:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "BEND:LTUS:763: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, "BEND:LTUS:763:RAMPTIME_LEFT") field(OUT, "BEND:LTUS:763:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "BEND:LTUS:763:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "BEND:LTUS:763:RAMPTIME_LEFT NMS") field(OUT, "BEND:LTUS:763:RAMPDONE PP") } record(bo, "BEND:LTUS:763:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "BEND:LTUS:763:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "BEND:LTUS:763: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, "BEND:LTUS:763: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, "BEND:LTUS:763:STDZINIT") { field(DESC, "Proc. Stdz PVs on boot") field(PINI, "YES") field(DOL1, "1") field(DOL2, "1") field(DOL3, "1") field(LNK1, "BEND:LTUS:763:DEBUG.PROC PP") field(LNK2, "BEND:LTUS:763:STDZCYCLENUM.PROC PP") field(LNK3, "BEND:LTUS:763:STDZDISABLE.PROC PP") field(LNK4, "BEND:LTUS:763: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, "BEND:LTUS:763:STDZSUB") { field(DESC, "Stdz subroutine") field(INAM, "mgntStdzInit") field(SNAM, "mgntStdz") field(BRSV, "INVALID") field(INPA, "BEND:LTUS:763:STDZIMIN NPP NMS") field(INPB, "BEND:LTUS:763:STDZIMAX NPP NMS") field(INPC, "BEND:LTUS:763:STDZIFINAL NPP NMS") field(INPD, "BEND:LTUS:763:STDZCYCLENUM NPP NMS") field(INPE, "BEND:LTUS:763:STDZDIRECT.RVAL NPP NMS") field(INPF, "BEND:LTUS:763:STDZDISABLE.RVAL CPP NMS") field(INPG, "BEND:LTUS:763: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, "BEND:LTUS:763:STDZWF PP") field(OUTB, "BEND:LTUS:763: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, "BEND:LTUS:763:STDZWF") } record(mbbo, "BEND:LTUS:763: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, "BEND:LTUS:763: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, "BEND:LTUS:763:STDZMAINPS") { field(DESC, "Stdz by main or self") field(PINI, "YES") field(DTYP, "Soft Channel") field(ZNAM, "SELF") field(ONAM, "MAIN") } record(bo, "BEND:LTUS:763: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, "BEND:LTUS:763: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, "BEND:LTUS:763: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, "BEND:LTUS:763:STDZTOD") { field(DESC, "Successful Standardize Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "BEND:LTUS:763:STDZLOSTTOD") { field(DESC, "Standardize Lost Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(longout, "BEND:LTUS:763:STDZCYCLECNT") { field(DESC, "Cycle Count") field(PINI, "YES") } record(longout, "BEND:LTUS:763: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, "BEND:LTUS:763:STDZDIRECT") } # The default standardize direction is "UP" for # all LCLS Magnets.. record(bo, "BEND:LTUS:763:STDZDIRECT") { field(DESC, "Standardize Direction ") field(ZNAM, "UP") field(ONAM, "DOWN") field(VAL, "0") field(FLNK, "BEND:LTUS:763:STDZIMIN") } record(ao, "BEND:LTUS:763:STDZIMIN") { field(DESC, "Min-STDZ Current") field(PREC, "1") field(EGU, "A") field(HOPR, "17.5") field(LOPR, "-17.5") field(VAL, "-17.5") field(FLNK, "BEND:LTUS:763:STDZIMAX") } record(ao, "BEND:LTUS:763:STDZIMAX") { field(DESC, "Max. Standarize Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "17.5") field(LOPR, "-17.5") field(VAL, "17.5") field(FLNK, "BEND:LTUS:763:STDZIFINAL") } record(ao, "BEND:LTUS:763:STDZIFINAL") { field(DESC, "Final SDTZ Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "17.5") field(LOPR, "-17.5") field(VAL, "-17.5") field(FLNK, "BEND:LTUS:763: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, "BEND:LTUS:763: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, "BEND:LTUS:763:STDZITOL") { field(DESC, "Stdz min tolerance") field(PREC, "5") field(CALC, "MAX(ABS(A),ABS(B))*C") field(INPA, "BEND:LTUS:763:STDZIMIN CP NMS") field(INPB, "BEND:LTUS:763:STDZIMAX CP MMS") field(INPC, "0.05") field(INPD, "BEND:LTUS:763:STDZITOLR CP MMS") field(EGU, "A") field(FLNK, "BEND:LTUS:763:IDELTAS") field(PINI, "YES") } # D - factor (3.154/2 = 1.577) for EPSC, otherwise, set to 1.0 record(calc, "BEND:LTUS:763:STDZDLY") { field(DESC, "Ramp time for stdz cycle") field(CALC, "C>0?MAX(1,ABS((A-B)/C)*D):0") field(INPA, "BEND:LTUS:763:STDZIMIN CP NMS") field(INPB, "BEND:LTUS:763:STDZIMAX CP NMS") field(INPC, "BEND:LTUS:763:TRIMRAMPRATE CP NMS") field(INPD, "1.0") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") } record(calc, "BEND:LTUS:763:STDZRAMPDLY") { field(DESC, "Ramp delay total") field(CALC, "MAX(1,((A/100)*B+B))") field(PREC, "5") field(INPA, "BEND:LTUS:763:TRIMDLYPCT CP MS") field(INPB, "BEND:LTUS:763: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, "BEND:LTUS:763:STDZMINIDLY") { field(DESC, "Mini-stdz delay") field(CALC, "A") field(PREC, "5") field(A, "1.0") field(EGU, "sec") field(PINI, "YES") } record(ao, "BEND:LTUS:763: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, "BEND:LTUS:763:STDZMINIDELTA") { field(DESC, "Stdz mini % of IMAX") field(CALC, "(B/100)*(A-C)") field(INPA, "BEND:LTUS:763:IDES.HOPR") field(INPB, "BEND:LTUS:763:STDZMINIPCT CPP NMS") field(INPC, "BEND:LTUS:763:IDES.LOPR") field(PREC, "5") } record(calc, "BEND:LTUS:763:STDZMINISETPT") { field(DESC, "Mini Stdz delta") field(CALC, "C==0?MAX(E-D,B):MIN(E+D,A)") field(INPA, "BEND:LTUS:763:IDES.HOPR") field(INPB, "BEND:LTUS:763:IDES.LOPR") field(INPC, "BEND:LTUS:763:STDZDIRECT.RVAL") field(INPD, "BEND:LTUS:763:STDZMINIDELTA") field(INPE, "BEND:LTUS:763:IDES") field(PREC, "5") field(FLNK, "BEND:LTUS:763: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, "BEND:LTUS:763:STDZMINISETPTOOR") { field(DESC, "Mini Stdz setpoint out of range") field(CALC, "C==0?(E-DA)") field(INPA, "BEND:LTUS:763:IDES.HOPR") field(INPB, "BEND:LTUS:763:IDES.LOPR") field(INPC, "BEND:LTUS:763:STDZDIRECT.RVAL") field(INPD, "BEND:LTUS:763:STDZMINIDELTA") field(INPE, "BEND:LTUS:763: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, "BEND:LTUS:763: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, "BEND:LTUS:763:IADJUST.RVAL") field(INPB, "BEND:LTUS:763:STDZDIRECT.RVAL") field(INPC, "BEND:LTUS:763:STDZOK.RVAL") field(INPD, "BEND:LTUS:763:STDZDISABLE.RVAL") field(INPE, "BEND:LTUS:763:STATE.RVAL CPP NMS") field(INPF, "BEND:LTUS:763:ICTRL.RVAL") field(INPG, "BEND:LTUS:763:STATE.SEVR") field(INPH, "BEND:LTUS:763:BDELTAS.M") field(INPI, "BEND:LTUS:763:IACT.SEVR") field(OUT, "BEND:LTUS:763:STDZLOSTGO.SELN PP NMS") field(OOPT, "Transition To Non-zero") } record(seq, "BEND:LTUS:763:STDZLOSTGO") { field(DESC, "Process lost stdz") field(SELM, "Mask") field(DOL1, "1") field(DOL2, "0") field(LNK1, "BEND:LTUS:763:STDZLOSTTOD.PROC") field(LNK2, "BEND:LTUS:763:STDZOK PP") } # Record maximum current after standardize # Reset to IACT from sequence after trim # Disable processing during (mini-)standardize or trim record(calc, "BEND:LTUS:763:STDZIACTMAX") { field(DESC, "Max act current after stdz") field(CALC, "MAX(A, B)") field(DISV, "0") field(SDIS, "BEND:LTUS:763:CHECKPWRDIP_ENABLE") field(INPA, "BEND:LTUS:763:IACT CP") field(INPB, "BEND:LTUS:763:STDZIACTMAX") field(EGU, "A") field(FLNK, "BEND:LTUS:763:CHECKPWRDIP") } # Detect power dip if STDZOK is YES, STDZ is enabled, and IACT is valid # If IACT drops below STDZIACTMAX by more than the trim tolerance, clear STDZOK # Warning: Take the absolute value of the trim tolerance, or else quads of # negative polarity will always lose STDZ since their IDELTAS.I are negative. # Note: Large quads and bends are prone to losing STDZ even if they are # perturbed toward higher current since their current tends to overshoot # by greater than the trim tolerance before settling down. record(calcout, "BEND:LTUS:763:CHECKPWRDIP") { field(DESC, "Detect power dip") field(CALC, "(A-B>ABS(C))?3:0") field(DISV, "0") field(SDIS, "BEND:LTUS:763:CHECKPWRDIP_ENABLE") field(INPA, "BEND:LTUS:763:STDZIACTMAX") field(INPB, "BEND:LTUS:763:IACT") field(INPC, "BEND:LTUS:763:IDELTAS.I") field(OUT, "BEND:LTUS:763:STDZLOSTGO.SELN PP NMS") field(OOPT, "When Non-zero") } # Enable processing of STDZIACTMAX and CHECKPWRDIP only if # STDZOK = YES, STDZDISABLE = NO, CTRL != Trim (2), and # CTRL != Stdz (4) record(calc, "BEND:LTUS:763:CHECKPWRDIP_ENABLE") { field(CALC, "A&&!B&&(C#2)&&(C#4)") field(INPA, "BEND:LTUS:763:STDZOK.RVAL CP") field(INPB, "BEND:LTUS:763:STDZDISABLE.RVAL CP") field(INPC, "BEND:LTUS:763:CTRL.RVAL CP") } #! 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, "BEND:LTUS:763: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, "BEND:LTUS:763: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, "BEND:LTUS:763:CALBSET") { field(DESC, "Use DAC Calbration") field(SCAN, "10 second") field(CALC, "A&&(B==0)&&C?31:960") field(INPA, "BEND:LTUS:763:CALBOK") field(INPB, "BEND:LTUS:763:CALBDISABLE") field(INPC, "BEND:LTUS:763:CALBSLOPE") field(OOPT, "On Change") field(OUT, "BEND:LTUS:763: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, "BEND:LTUS:763:CALB_SEQ") { field(DESC, "Output Calib Values") field(SELM, "Mask") field(SELL, "BEND:LTUS:763: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, "BEND:LTUS:763:CALBSLOPE") field(DOL3, "BEND:LTUS:763: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, "BEND:LTUS:763:CALBTOD") { field(DESC, "Calibration Success Time") field(PINI, "YES") # field(DOL, "") field(OMSL, "supervisory") field(DTYP, "Soft Channel") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:763: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, "BEND:LTUS:763: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, "BEND:LTUS:763: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, "BEND:LTUS:763:CALBOFFSET") { field(DESC, "Calc DAC Offset") field(PREC, "6") field(EGU, "Counts") field(PINI, "YES") } record(bo, "BEND:LTUS:763: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, "BEND:LTUS:763:DACSLOPE") { field(DESC, "V to DAC slope") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "supervisory") field(PINI, "YES") field(FLNK, "BEND:LTUS:763:DACOFFSET") } # Default Offset used in conversion from Volts to DAC Counts record(ao, "BEND:LTUS:763:DACOFFSET") { field(DESC, "V to DAC offset") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "supervisory") field(PINI, "YES") field(FLNK, "BEND:LTUS:763: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, "BEND:LTUS:763: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, "BEND:LTUS:763:IACT") field(INPD, "BEND:LTUS:763:DACSLOPE") field(INPE, "BEND:LTUS:763:DACOFFSET") field(EGU, "Counts") field(PREC, "6") } record(ao, "BEND:LTUS:763:DAC") { field(DESC, "DAC Set point") field(EGU, "Counts") field(DOL, "") field(OMSL, "supervisory") field(PREC, "6") field(PINI, "YES") } record(ao, "BEND:LTUS:763:CALBIMIN") { field(DESC, "Calibration Min Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(DRVH, "17.5") field(HOPR, "17.5") field(DRVL, "-17.5") field(LOPR, "-17.5") field(PREC, "3") field(EGU, "A") field(VAL, "0.0") field(FLNK, "BEND:LTUS:763:CALBIMAX") } record(ao, "BEND:LTUS:763:CALBIMAX") { field(DESC, "Calibration Max Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(DRVH, "17.5") field(HOPR, "17.5") field(LOPR, "-17.5") field(DRVL, "-17.5") field(EGU, "A") field(VAL, "17.5") field(FLNK, "BEND:LTUS:763:CALBSTEPNUM") } record(ao, "BEND:LTUS:763:CALBIFINAL") { field(DESC, "Calibration Last Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(PREC, "3") field(EGU, "A") field(HOPR, "17.5") field(LOPR, "-17.5") field(VAL, "0") } record(longout, "BEND:LTUS:763: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, "BEND:LTUS:763:CALBIDELTA") } record(calc, "BEND:LTUS:763:CALBIDELTA") { field(DESC, "Step size for CALB") field(CALC, "C=0?0:ABS((A-B)/C)") field(INPA, "BEND:LTUS:763:CALBIMAX") field(INPB, "BEND:LTUS:763:CALBIMIN") field(INPC, "BEND:LTUS:763: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, "BEND:LTUS:763:CALBIMULT") { field(DESC, "IACT vs ISETPT mult") field(CALC, "C#0||A=0?1:ABS(B/A)") field(INPA, "BEND:LTUS:764:ISETPT.DRVH") field(INPB, "BEND:LTUS:764:IACT.HOPR") field(INPC, "BEND:LTUS:763:PSCONTROLLER.RVAL CPP") field(EGU, "A") field(PINI, "YES") } # SNL dbputs DAC values here. 6-10 steps are possible. record(waveform, "BEND:LTUS:763:CALBICTRLWF") { field(DESC, "ICTRL setpoint array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") } record(waveform, "BEND:LTUS:763:DACWF") { field(DESC, "DAC count array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "BEND:LTUS:763:DACSA") } # Used only for xygraph edm plot record(subArray, "BEND:LTUS:763:DACSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "BEND:LTUS:763: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, "BEND:LTUS:763:CALCDACWF") { field(DESC, "Calc DAC counts array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "BEND:LTUS:763:CALCDACSA") } # Used only for xygraph edm plot record(subArray, "BEND:LTUS:763:CALCDACSA") { field(DESC, "Calc DAC counts") field(DTYP, "Soft Channel") field(INP, "BEND:LTUS:763: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, "BEND:LTUS:763:CALBYWF") { field(DESC, "mx + b") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "BEND:LTUS:763:CALBYSA") } # Used only for xygraph edm plot record(subArray, "BEND:LTUS:763:CALBYSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "BEND:LTUS:763:CALBYWF") field(MALM, "10") field(NELM, "6") field(INDX, "0") field(FTVL, "DOUBLE") } record(waveform, "BEND:LTUS:763:CALBIACTWF") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "BEND:LTUS:763:CALBIACTSA") } # Used only for xygraph edm plot record(subArray, "BEND:LTUS:763:CALBIACTSA") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(MALM, "10") field(NELM, "6") field(INP, "BEND:LTUS:763:CALBIACTWF") field(INDX, "0") field(FTVL, "DOUBLE") field(FLNK, "BEND:LTUS:763:CALBLIMITS") } # Check that measured current during calibration is within # tolerance. record(aSub, "BEND:LTUS:763: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, "BEND:LTUS:763:CALBSTEPNUM") field(INPB, "BEND:LTUS:763:CALBIACTWF") field(INPC, "BEND:LTUS:763: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, "BEND:LTUS:763: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, "BEND:LTUS:763:STDZITOL") field(INPH, "BEND:LTUS:763:DACSLOPE") field(INPI, "BEND:LTUS:763: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, "BEND:LTUS:763: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, "BEND:LTUS:763:CALBSTEPNUM") field(INPB, "BEND:LTUS:763:CALBIACTWF") field(INPC, "BEND:LTUS:763:DACWF") field(INPF, "BEND:LTUS:763: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 BEND:LTUS:763CALBOK 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, "BEND:LTUS:763:DEGAUSINIT") { field(DESC, "Proc. Degauss PVs on boot") field(PINI, "YES") field(DOL, "1") field(OUTA, "BEND:LTUS:763:DEGAUSIMIN.PROC PP") field(OUTB, "BEND:LTUS:763:DEGAUSIMAX.PROC PP") field(OUTC, "BEND:LTUS:763:DEGAUSTYPE.PROC PP") field(OUTD, "BEND:LTUS:763:DEGAUSSTEP.PROC PP") field(OUTE, "BEND:LTUS:763:MADNAME.PROC PP") field(OUTF, "BEND:LTUS:763:PSTYPE.PROC PP") field(OUTG, "BEND:LTUS:763: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, "BEND:LTUS:763:DEGAUSSUB") { field(DESC, "Degauss subroutine") field(INAM, "mgntDegaussInit") field(SNAM, "mgntDegauss") field(BRSV, "INVALID") field(INPA, "BEND:LTUS:763:DEGAUSIMIN NPP NMS") field(INPB, "BEND:LTUS:763:DEGAUSIMAX NPP NMS") field(INPC, "BEND:LTUS:763:DEGAUSTYPE.RVAL NPP NMS") field(INPE, "BEND:LTUS:763:DEGAUSMETHOD.RVAL NPP NMS") field(INPF, "BEND:LTUS:763:PSTYPE NPP NMS") field(INPG, "BEND:LTUS:763:DEBUG.RVAL NPP NMS") field(INPH, "BEND:LTUS:763: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, "BEND:LTUS:763:DEGAUSWF PP") field(OUTB, "BEND:LTUS:763:DEGAUSMSG PP") field(OUTC, "BEND:LTUS:763: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, "BEND:LTUS:763:DEGAUSWF") { field(DESC, "Degauss Setpts") field(NELM, "60") field(FTVL, "DOUBLE") } record(mbbo,"BEND:LTUS:763: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, "BEND:LTUS:763: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, "BEND:LTUS:763: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, "BEND:LTUS:763: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, "BEND:LTUS:763: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, "BEND:LTUS:763:DEGAUSIMIN") { field(DESC, "Min. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "17.5") field(LOPR, "-17.5") field(DRVH, "17.5") field(DRVL, "-17.5") field(VAL, "-17.5") } record(ao, "BEND:LTUS:763:DEGAUSIMAX") { field(DESC, "Max. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "17.5") field(LOPR, "-17.5") field(DRVH, "17.5") field(DRVL, "-17.5") field(VAL, "17.5") } # 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,"BEND:LTUS:763: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, "BEND:LTUS:763: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,"BEND:LTUS:763: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, "BEND:LTUS:763: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, "BEND:LTUS:763: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, "BEND:LTUS:763: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, "BEND:LTUS:763:DEGAUSTOD") { field(DESC, "Successful Degauss Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "BEND:LTUS:763:DEGAUSLOSTTOD") { field(DESC, "Degauss Lost Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:763:DEGAUSTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "BEND:LTUS:763:DEGAUSTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "BEND:LTUS:763: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, "BEND:LTUS:763:DEGAUSGO") { field(DESC, "Set bdes of btrms to zero") field(ASG, "Internal") field(OUTA, "") field(OUTB, "") field(OUTC, "") field(OUTD, "") } # =========== CRYO ONLY =========== record(bo, "BEND:LTUS:763: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, "BEND:LTUS:763:DEGAUS_IMAX_CHECK") { field(DESC, "Check if imax shoud chg") field(CALC, "(C==4)&&(ABS(B)>ABS(A))?1:0") field(INPA, "BEND:LTUS:763:DEGAUS_IMAX") field(INPB, "BEND:LTUS:763:ISETPT") field(INPC, "BEND:LTUS:763:DEGAUSTYPE.RVAL") field(OUT, "BEND:LTUS:763:DEGAUS_IMAX_UPDATE.SELN") field(FLNK, "BEND:LTUS:763:DEGAUS_IMAX_UPDATE") } record(seq, "BEND:LTUS:763:DEGAUS_IMAX_UPDATE") { field(DESC, "Degauss IMAX Update") field(SELM, "Specified") field(DOL1, "BEND:LTUS:763:ISETPT") field(LNK1, "BEND:LTUS:763:DEGAUS_IMAX PP") } # Set the maximum current after a successful # degauss. This pv is updated by the # sequence. record(ao, "BEND:LTUS:763:DEGAUS_IMAX") { field(DESC, "Max I set afer a degauss") field(EGU, "Amps") field(PINI, "YES") field(PREC, "6") field(HOPR, "17.5") field(LOPR, "-17.5") field(DRVH, "17.5") field(DRVL, "-17.5") field(VAL, "17.5") field(FLNK, "BEND:LTUS:763:DEGAUS_IMAXPOL_CHECK") info(autosaveFields,"VAL,RVAL") } # Set the polarity if degauss_imax record(calcout, "BEND:LTUS:763:DEGAUS_IMAXPOL_CHECK") { field(DESC, "Determine polarity of imax") field(CALC, "A>=0?0:1") field(INPA, "BEND:LTUS:763:DEGAUS_IMAX") field(FLNK, "BEND:LTUS:763:DEGAUS_IMAXPOL") } record(bo, "BEND:LTUS:763:DEGAUS_IMAXPOL") { field(DESC, "Polarity of imax I") field(DTYP, "Raw Soft Channel") field(DOL, "BEND:LTUS:763:DEGAUS_IMAXPOL_CHECK") field(OMSL, "closed_loop") field(ZNAM, "Positive") field(ONAM, "Negative") field(FLNK, "BEND:LTUS:763: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, "BEND:LTUS:763:DEGAUS_ABSIMAX") { field(DESC, "Absolute Max. Degauss I") field(CALC, "ABS(A)") field(INPA, "BEND:LTUS:763:DEGAUS_IMAX") field(PREC, "6") field(EGU, "Amps") field(HOPR, "17.5") field(LOPR, "-17.5") info(autosaveFields,"VAL RVAL") } # IACT Polarity record(calcout, "BEND:LTUS:763:IACTPOL_CHECK") { field(DESC, "Determine IACT polarity") field(SCAN, "5 second") field(CALC, "ABS(A-B)>C?(A>=0?0:1):D") field(INPA, "BEND:LTUS:763:IACT") field(INPB, "BEND:LTUS:763:IACTPOL_CHECK.LA") field(INPC, "0.0001") field(INPD, "BEND:LTUS:763:IACTPOL_CHECK.PVAL") field(OOPT, "On Change") field(FLNK, "BEND:LTUS:763:IACTPOL") } record(bo, "BEND:LTUS:763: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,"BEND:LTUS:763: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, "BEND:LTUS:763:DEGAUSENABLE CP") field(INPB, "BEND:LTUS:763:DEGAUSOK") field(INPC, "BEND:LTUS:763:STATE CP") field(INPD, "BEND:LTUS:763:STATE.SEVR") field(OUT, "BEND:LTUS:763:DEGAUS_STATE_SEQ.SELN PP") field(ASG, "Internal") } record(seq, "BEND:LTUS:763:DEGAUS_STATE_SEQ") { field(DESC, "Degauss State Sequence") field(SELM, "Specified") field(SELL, "BEND:LTUS:763:DEGAUS_STATE_CHECK") field(LNK1, "BEND:LTUS:763:DEGAUS_STATE_DISABLE.PROC PP") field(LNK2, "BEND:LTUS:763:DEGAUS_STATE_LOST.PROC PP") field(LNK3, "BEND:LTUS:763:DEGAUS_STATE_GOOD.PROC PP") field(LNK4, "BEND:LTUS:763: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, "BEND:LTUS:763:DEGAUS_STATE_DISABLE") { field(DESC, "Degauss not used") field(LNK1, "BEND:LTUS:763:DEGAUSOK.ZSV") field(LNK2, "BEND:LTUS:763: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, "BEND:LTUS:763:STATMSG.FRSV") field(LNK4, "BEND:LTUS:763: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, "BEND:LTUS:763:DEGAUS_STATE_LOST") { field(DESC, "Degauss lost and ps On") field(DOL1, "1") field(LNK1, "BEND:LTUS:763:DEGAUSOK.ZSV") field(LNK2, "BEND:LTUS:763: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, "BEND:LTUS:763:STATMSG.FRSV") field(LNK4, "BEND:LTUS:763: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, "BEND:LTUS:763:DEGAUS_STATE_OFF") { field(DESC, "Degaused lost and ps Off") field(DOL1, "2") field(LNK1, "BEND:LTUS:763: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, "BEND:LTUS:763:STATMSG.FRSV") field(LNK3, "BEND:LTUS:763: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, "BEND:LTUS:763:DEGAUS_STATE_GOOD") { field(DESC, "Degauss good") field(DOL1, "1") field(LNK1, "BEND:LTUS:763: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, "BEND:LTUS:763:STATMSG.FRSV PP") field(LNK3, "BEND:LTUS:763:STATMSG.FVSV PP") field(LNK4, "") field(ASG, "Internal") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(mbbo, "BEND:LTUS:763:FUNC") { field(DESC, "BEND:LTUS:763 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, "0") field(FFVL, "0") field(OUT, "BEND:LTUS:763:CTRL CA") } # :CTRL pv is processed at boot in the # sequence mgntCtrl.st Processed in sequence # record(mbbo, "BEND:LTUS:763:CTRL") { field(DESC, "BEND:LTUS:763 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, "BEND:LTUS:763:SELECTEN.A PP") field(SDIS, "0") } # If a function has been selected set this unit to busy record(calcout, "BEND:LTUS:763:SELECTEN") { field(DESC, "Control Select Enable") field(CALC, "A>0?1:A") field(FLNK, "BEND:LTUS:763:BUSY") } # Set to FREE on IOC reboot record(bo, "BEND:LTUS:763:BUSY") { field(DESC, "BEND:LTUS:763 Ctrl Done") field(DOL, "BEND:LTUS:763:SELECTEN") field(ZNAM, "FREE") field(ONAM, "BUSY") field(PINI, "YES") field(FLNK, "BEND:LTUS:763:SELECT") } record(bo, "BEND:LTUS:763:SELECT") { field(ZNAM, "NO") field(ONAM, "YES") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") } record(bo, "BEND:LTUS:763: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, "BEND:LTUS:763:CTRLSTATE") { field(DESC, "BEND:LTUS:763 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("BEND:LTUS:763:CTRL",20,20,0,0,"BEND:LTUS:763:CTRL") #! Field("BEND:LTUS:763:CTRL.OUT",16777215,1,"BEND:LTUS:763:CTRL.OUT") #! Link("BEND:LTUS:763:CTRL.OUT","BEND:LTUS:763:SELECTEN.A") #! Field("BEND:LTUS:763:CTRL.VAL",16777215,1,"BEND:LTUS:763:CTRL.VAL") #! Record("BEND:LTUS:763:SELECTEN",321,381,0,0,"BEND:LTUS:763:SELECTEN") #! Field("BEND:LTUS:763:SELECTEN.A",16777215,0,"BEND:LTUS:763:SELECTEN.A") #! Field("BEND:LTUS:763:SELECTEN.FLNK",16777215,1,"BEND:LTUS:763:SELECTEN.FLNK") #! Link("BEND:LTUS:763:SELECTEN.FLNK","BEND:LTUS:763:BUSY") #! Field("BEND:LTUS:763:SELECTEN.VAL",16777215,1,"BEND:LTUS:763:SELECTEN.VAL") #! Record("BEND:LTUS:763:BUSY",623,274,0,0,"BEND:LTUS:763:BUSY") #! Field("BEND:LTUS:763:BUSY.DOL",16777215,0,"BEND:LTUS:763:BUSY.DOL") #! Link("BEND:LTUS:763:BUSY.DOL","BEND:LTUS:763:SELECTEN.VAL") #! Field("BEND:LTUS:763:BUSY.FLNK",16777215,1,"BEND:LTUS:763:BUSY.FLNK") #! Link("BEND:LTUS:763:BUSY.FLNK","BEND:LTUS:763:SELECT") #! Record("BEND:LTUS:763:SELECT",669,508,0,1,"BEND:LTUS:763:SELECT") #! Record("BEND:LTUS:763:FUNC",940,120,0,0,"BEND:LTUS:763:FUNC") #! Field("BEND:LTUS:763:FUNC.OUT",16777215,0,"BEND:LTUS:763:FUNC.OUT") #! Link("BEND:LTUS:763:FUNC.OUT","BEND:LTUS:763:CTRL.VAL") #! Record("BEND:LTUS:763:ABORT",193,41,0,0,"BEND:LTUS:763:ABORT") #! Record("BEND:LTUS:763:CTRLSTATE",369,34,0,0,"BEND:LTUS:763: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,"BEND:LTUS:763:SELECT is used for Multi-device selection.\nIt is enabled when associated BEND:LTUS:763:CTRL is \"0\" (DONE).\nIt is disabled when associated BEND:LTUS:763: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,"BEND:LTUS:763: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, "BEND:LTUS:763:BCTRL_INIT") { field(DESC, "Process BCTRL on boot") field(PINI, "YES") field(CALC, "A=3?1:0") field(INPA, "BEND:LTUS:763:BCTRL.SEVR") field(OUT, "BEND:LTUS:763: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, "BEND:LTUS:763:BACT") { field(DESC, "Actual B") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "BEND:LTUS:763:BACT") field(INPB, "BEND:LTUS:763:POLYCOEF") field(INPC, "BEND:LTUS:763:POLYCOEF.A") field(INPD, "BEND:LTUS:763:POLYCOEF.B") field(INPE, "BEND:LTUS:763:IACTCALC MS") field(INPF, "BEND:LTUS:763:BDELTAS PP") field(INPG, "100") field(EGU, "kG-m") field(HOPR, "2.7687") field(LOPR, "-2.8011") field(HIHI, "2.7687") field(LOLO, "-2.8011") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "2.7687") field(LOW, "-2.8011") field(FLNK, "BEND:LTUS:763: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, "BEND:LTUS:763:BDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntPhyDeltas") field(EGU, "kG-m") field(HOPR, "1") field(PREC, "7") field(BRSV, "INVALID") field(INPA, "BEND:LTUS:763:BDES") field(INPB, "BEND:LTUS:763:TRIMBTOL") field(INPC, "BEND:LTUS:763:TRIMBTOLR") field(INPD, "BEND:LTUS:763:CHCKBTOL") field(INPE, "BEND:LTUS:763:CHCKBTOLR") field(F, "2.0") field(INPG, "30") field(INPH, "BEND:LTUS:763:BACT.VAL") # # MPS absolute and relative tolerances field(INPP, "BEND:LTUS:763:MPSBTOL") field(INPQ, "BEND:LTUS:763:MPSBTOLR") field(FLNK, "BEND:LTUS:763:BCONLIMITS") info(autosaveFields,"F") } # This record is processed by BDELTAS record(aSub, "BEND:LTUS:763:BCONLIMITS") { field(DESC, "Config B-field Limits") field(INAM, "mgntInit") field(SNAM, "mgntBCONLimits") field(INPA, "BEND:LTUS:763:BDES") field(INPB, "BEND:LTUS:763:BDELTAS.I") field(INPG, "BEND:LTUS:763:DEBUG.RVAL") field(FTA, "DOUBLE") field(FTB, "DOUBLE") field(FTG, "ULONG") field(OUTA, "BEND:LTUS:763:BCON.HIGH") field(OUTB, "BEND:LTUS:763:BCON.LOW") field(OUTC, "BEND:LTUS:763:BCON.HIHI") field(OUTD, "BEND:LTUS:763:BCON.LOLO PP") field(FTVA, "DOUBLE") field(FTVB, "DOUBLE") field(FTVC, "DOUBLE") field(FTVD, "DOUBLE") field(BRSV, "INVALID") field(FLNK, "BEND:LTUS:763:IDELTAS") } # The following PV is processed by :BACT # which is processed by :BACT # record(fanout, "BEND:LTUS:763:BACTFO") { field(DESC, "BACT processing") field(SELM, "All") field(LNK1, "BEND:LTUS:763:BDIFF") field(LNK2, "BEND:LTUS:763:BADIFF") field(LNK3, "BEND:LTUS:763:BRATIO") field(LNK4, "BEND:LTUS:763:MPSLIMITS") field(LNK5, "BEND:LTUS:763:I2BSTATUS") field(LNK6, "BEND:LTUS:763:IACTFO.PROC") } record(calc, "BEND:LTUS:763:BDIFF") { field(DESC, "BDES-BACT") field(CALC, "A-B") field(INPA, "BEND:LTUS:763:BDES") field(INPB, "BEND:LTUS:763:BACT") field(EGU, "kG-m") field(PREC, "7") } record(calc, "BEND:LTUS:763:BADIFF") { field(DESC, "Absolute BDES-BACT") field(INPA, "BEND:LTUS:763:BDIFF") field(EGU, "kG-m") field(PREC, "7") field(CALC, "A<0?ABS(A):A") } record(calc, "BEND:LTUS:763:BRATIO") { field(DESC, "BACT Error") field(CALC, "B?A/B:0") field(INPA, "BEND:LTUS:763:BDIFF") field(INPB, "BEND:LTUS:763:BDES.HOPR") field(EGU, "kG-m") field(PREC, "7") } record(mbbi, "BEND:LTUS:763: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, "BEND:LTUS:763:BACT.J") } # Note: for a string slave set the MONFL # macro to the following: # MONFL=:IMONCALC MS record(sub, "BEND:LTUS:763:BMON") { field(DESC, "Second Transductor") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "BEND:LTUS:763:BMON") field(INPB, "BEND:LTUS:763:POLYCOEF") field(INPC, "BEND:LTUS:763:POLYCOEF.A") field(INPD, "BEND:LTUS:763:POLYCOEF.B") field(INPE, "BEND:LTUS:763:IMONCALC MS") field(INPF, "BEND:LTUS:763:BDELTAS.VAL") field(INPG, "100") field(EGU, "kG-m") field(HOPR, "2.7687") field(LOPR, "-2.8011") field(HIHI, "2.7687") field(LOLO, "-2.8011") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "2.7687") field(LOW, "-2.8011") } # 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=BEND:LTUS:764:BDES CP record(ao, "BEND:LTUS:763:BDES") { field(DESC, "Desired B-Field") field(PINI, "NO") field(DRVH, "2.7687") field(DRVL, "-2.8011") field(HOPR, "2.7687") field(LOPR, "-2.8011") field(PREC, "7") field(EGU, "kG-m") field(MDEL, "-1") field(OMSL, "closed_loop") field(DOL, "BEND:LTUS:763:IDES2BDES") field(OUT, "BEND:LTUS:763:B2IDES PP") info(autosaveFields,"VAL") } record(sub, "BEND:LTUS:763:B2IDES") { field(DESC, "Convert Desired B-Field to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "BEND:LTUS:763:POLYCOEF") field(INPC, "BEND:LTUS:763:POLYCOEF.A") field(INPD, "BEND:LTUS:763:POLYCOEF.B") field(PREC, "7") field(EGU, "kG-m") field(HOPR, "2.7687") field(LOPR, "-2.8011") field(MDEL, "-1") field(INPE, "BEND:LTUS:763:BDES.DRVH") field(INPF, "BEND:LTUS:763:BDES.DRVL") field(BRSV, "INVALID") field(FLNK, "BEND:LTUS:763:IDES") } record(sub, "BEND:LTUS:763:BNOM") { field(DESC, "Nominal Field") field(PINI, "YES") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "BEND:LTUS:763:POLYCOEF") field(INPC, "BEND:LTUS:763:POLYCOEF.A") field(INPD, "BEND:LTUS:763:POLYCOEF.B") field(INPE, "BEND:LTUS:763:BDES.DRVH") field(INPF, "BEND:LTUS:763:BDES.DRVL") field(EGU, "kG-m") field(HOPR, "2.7687") field(LOPR, "-2.8011") field(PREC, "7") field(VAL, "0.0") field(FLNK, "BEND:LTUS:763:INOM") } record(sub, "BEND:LTUS:763:BACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "BEND:LTUS:763:BDES.VAL") field(INPB, "BEND:LTUS:763:BDES.DRVH") field(INPC, "BEND:LTUS:763:BDES.DRVL") field(INPD, "BEND:LTUS:763:BDELTAS.I") field(INPE, "BEND:LTUS:763:BDELTAS.J") field(INPG, "BEND:LTUS:763:STATE") field(INPH, "BEND:LTUS:763:HSTA") field(EGU, "kG-m") field(HOPR, "2.7687") field(LOPR, "-2.8011") field(PREC, "7") field(BRSV, "INVALID") } record(sub, "BEND:LTUS:763:BMONLIMITS") { field(DESC, "MON Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "BEND:LTUS:763:BDES.VAL") field(INPB, "BEND:LTUS:763:BDES.DRVH") field(INPC, "BEND:LTUS:763:BDES.DRVL") field(INPD, "BEND:LTUS:763:BDELTAS.K") field(INPE, "BEND:LTUS:763:BDELTAS.L") field(INPG, "BEND:LTUS:763:STATE") field(INPH, "BEND:LTUS:763:HSTA") field(EGU, "kG-m") field(HOPR, "2.7687") field(LOPR, "-2.8011") field(PREC, "7") field(BRSV, "INVALID") } record(seq, "BEND:LTUS:763:BLIMITS") { field(DESC, "ACT Limits") field(PREC, "7") field(DOL1, "BEND:LTUS:763:BLIMITS") field(LNK1, "BEND:LTUS:763:BACTLIMITS.F PP") field(DOL2, "BEND:LTUS:763:BACTLIMITS.I") field(LNK2, "BEND:LTUS:763:BACT.HIGH") field(DOL3, "BEND:LTUS:763:BACTLIMITS.J") field(LNK3, "BEND:LTUS:763:BACT.LOW") field(DOL4, "BEND:LTUS:763:BACTLIMITS.K") field(LNK4, "BEND:LTUS:763:BACT.HIHI") field(DOL5, "BEND:LTUS:763:BACTLIMITS.L") field(LNK5, "BEND:LTUS:763:BACT.LOLO") field(DOL6, "BEND:LTUS:763:BLIMITS") field(LNK6, "BEND:LTUS:763:BMONLIMITS.F PP") field(DOL7, "BEND:LTUS:763:BMONLIMITS.I") field(LNK7, "BEND:LTUS:763:BMON.HIGH") field(DOL8, "BEND:LTUS:763:BMONLIMITS.J") field(LNK8, "BEND:LTUS:763:BMON.LOW") field(DOL9, "BEND:LTUS:763:BMONLIMITS.K") field(LNK9, "BEND:LTUS:763:BMON.HIHI") field(DOLA, "BEND:LTUS:763:BMONLIMITS.L") field(LNKA, "BEND:LTUS:763:BMON.LOLO") field(FLNK, "BEND:LTUS:763:ILIMITS") field(SCAN, "5 second") } record(ao, "BEND:LTUS:763:BCTRL") { field(DESC, "B-Perturb") field(PREC, "7") field(EGU, "kG-m") field(DRVH, "2.7687") field(DRVL, "-2.8011") field(HOPR, "2.7687") field(LOPR, "-2.8011") # 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, "BEND:LTUS:763: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, "BEND:LTUS:763:BCTRLGO") { field(DESC, "Update DES and perturb") field(PREC, "7") # Disable BACT limits field(DOL1, "1") field(LNK1, "BEND:LTUS:763:BLIMITS.VAL") # Update BDES with the BCTRL (slider) value field(DOL2, "BEND:LTUS:763:BCTRL.VAL") field(LNK2, "BEND:LTUS:763:BDES PP") field(DOL3, "1") field(LNK3, "BEND:LTUS:763:IDIRECT.PROC PP") field(DOL4, "1") field(LNK4, "BEND:LTUS:763:CHECKSTDZLOST.PROC PP") field(DOL5, "BEND:LTUS:763:BCTRL.VAL") field(LNK5, "BEND:LTUS:763:BCTRLSUB PP") # Re-enable BACT limits field(DOL6, "0") field(LNK6, "BEND:LTUS:763:BLIMITS.VAL") } # Convert B-field to Current and output to ISETPT record(sub, "BEND:LTUS:763:BCTRLSUB") { field(DESC, "Feedback") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "BEND:LTUS:763:POLYCOEF") field(INPC, "BEND:LTUS:763:POLYCOEF.A") field(INPD, "BEND:LTUS:763:POLYCOEF.B") field(INPE, "BEND:LTUS:763:BDES.DRVH") field(INPF, "BEND:LTUS:763:BDES.DRVL") field(PREC, "7") field(EGU, "kG-m") field(HOPR, "2.7687") field(LOPR, "-2.8011") field(MDEL, "-1") field(BRSV, "INVALID") field(FLNK, "BEND:LTUS:763:ISETPT") } record(ao, "BEND:LTUS:763:BDESPREVTRIM") { field(DESC, "trim bdes for undo") field(DTYP, "Soft Channel") field(DRVH, "2.7687") field(DRVL, "-2.8011") field(EGU, "kG-m") field(HOPR, "2.7687") field(LOPR, "-2.8011") field(PREC, "7") field(PINI, "YES") info(autosaveFields,"VAL") } record(stringin, "BEND:LTUS:763:MADNAME") { field(DESC, "MAD deck nomenclature") field(PINI, "YES") field(VAL, "BCXXL1") } record(ai, "BEND:LTUS:763: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, "3507.444452") } record(ao, "BEND:LTUS:763:BMAX") { field(DESC, "Max B-Field") field(DTYP, "Soft Channel") field(DRVH, "2.7687") field(DRVL, "-2.8011") field(EGU, "kG-m") field(HOPR, "2.7687") field(LOPR, "-2.8011") field(PREC, "7") field(PINI, "YES") field(VAL, "2.7687") field(FLNK, "BEND:LTUS:763:BSTEP") } record(ao, "BEND:LTUS:763:BMIN") { field(DESC, "Min B-Field") field(DTYP, "Soft Channel") field(DRVH, "2.7687") field(DRVL, "-2.8011") field(EGU, "kG-m") field(HOPR, "2.7687") field(LOPR, "-2.8011") field(PREC, "7") field(PINI, "YES") field(VAL, "-2.8011") field(FLNK, "BEND:LTUS:763:BSTEP") } record(ao, "BEND:LTUS:763:BDESSAVE") { field(DESC, "bdes for save/load") field(DTYP, "Soft Channel") field(DRVH, "2.7687") field(DRVL, "-2.8011") field(EGU, "kG-m") field(HOPR, "2.7687") field(LOPR, "-2.8011") field(PINI, "YES") field(PREC, "7") } # This record is processed by BEND:LTUS:763: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, "BEND:LTUS:763:BCON") { field(DESC, "Config B-Field ") field(DTYP, "Soft Channel") field(PREC, "7") field(EGU, "kG-m") field(HOPR, "2.7687") field(LOPR, "-2.8011") field(DRVH, "2.7687") field(DRVL, "-2.8011") # 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 , "BEND:LTUS:763:ICON2BCON") field(OMSL, "closed_loop") field(OUT, "BEND:LTUS:763:B2ICON PP") info(autosaveFields,"VAL") } record(sub, "BEND:LTUS:763:B2ICON") { field(DESC, "Convert Desired ICon to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "BEND:LTUS:763:POLYCOEF") field(INPC, "BEND:LTUS:763:POLYCOEF.A") field(INPD, "BEND:LTUS:763:POLYCOEF.B") field(PREC, "7") field(EGU, "kG-m") field(HOPR, "2.7687") field(LOPR, "-2.8011") field(MDEL, "-1") field(INPE, "BEND:LTUS:763:BCON.DRVH") field(INPF, "BEND:LTUS:763:BCON.DRVL") field(BRSV, "INVALID") field(FLNK, "BEND:LTUS:763: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, "BEND:LTUS:763:BSTEP") { field(DESC, "B-Field step size") field(CALC, "(C==3)||(D==3)?0:ABS(A-B)*0.005") field(INPA, "BEND:LTUS:763:BMAX") field(INPB, "BEND:LTUS:763:BMIN") field(INPC, "BEND:LTUS:763:BMIN.SEVR") field(INPD, "BEND:LTUS:763:BMAX.SEVR") field(EGU, "kG-m") 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,"BEND:LTUS:763:BCTRLDISABLECALC") { field(DESC, "Calc for disabling BCTRL") field(ASG, "Internal") field(CALC, "A?2:1") field(INPA, "BEND:LTUS:763:ONLINE CP") field(OUT, "BEND:LTUS:763:BCTRLDISABLEFOUT PP") } record(fanout, "BEND:LTUS:763:BCTRLDISABLEFOUT") { field(DESC, "Disable BCTRL fanout") field(SELM, "Specified") field(SELL, "BEND:LTUS:763:BCTRLDISABLECALC") field(LNK1, "BEND:LTUS:763:BCTRLDISABLE") field(LNK2, "BEND:LTUS:763:BCTRLENABLE") } record(stringout, "BEND:LTUS:763:BCTRLDISABLE") { field(DESC, "Disable BCTRL") field(DTYP, "Soft Channel") field(OUT, "BEND:LTUS:763:BCTRL.ASG") field(VAL, "NOWRITE") field(FLNK, "BEND:LTUS:763:BCTRLDISV_UPDATE") } record(stringout, "BEND:LTUS:763:BCTRLENABLE") { field(DESC, "Enable BCTRL") field(DTYP, "Soft Channel") field(OUT, "BEND:LTUS:763:BCTRL.ASG") field(VAL, "") field(FLNK, "BEND:LTUS:763:BCTRLDISV_UPDATE") } record(calcout, "BEND:LTUS:763:BCTRLDISV_UPDATE") { field(DESC, "Calc for updating BCTRL.DISV") field(ASG, "Internal") field(CALC, "A") field(INPA, "BEND:LTUS:763:ONLINE") field(OUT, "BEND:LTUS:763: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,"BEND:LTUS:763:BACT and MON\n are processed via links from \n BEND:LTUS:763:IACT (device raw value readback 1)\n and\n BEND:LTUS:763: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 BEND:LTUS:763:POLYCOEF\nC = First polynomial coefficient (offset if linear)\nD = Second polynomial coefficient (slope if linear)\nE = BEND:LTUS:763: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,"BEND:LTUS:763:BDES\n is processed when set by CA users or \n BEND:LTUS:763: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,"BEND:LTUS:763: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 BEND:LTUS:763: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 (BEND:LTUS:763: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,"BEND:LTUS:763:B*LIMITS and BEND:LTUS:763:BLIMITS:\n Calculate alarm and warning limits based on \n deltas from BEND:LTUS:763: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,"BEND:LTUS:763: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,"BEND:LTUS:763: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, "BEND:LTUS:763: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, "BEND:LTUS:763:MPSBTOL") { field(DESC, "Absolute mps tol") field(EGU, "kG-m") field(PREC, "2") field(CALC, "ABS(A)*0.02") field(INPA, "BEND:LTUS:763:BMAX") field(PINI, "YES") } # # 21-Aug-2013: K. Luchini # Set channel access security so that users # cannot easily change values. record(ao, "BEND:LTUS:763:MPSBMAX") { field(DESC, "MPS Max B-field") field(EGU, "kG-m") field(PREC, "7") field(DRVH, "2.7687") field(DRVL, "-2.8011") field(PINI, "YES") field(VAL, "2.7687") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:763:MPSBMIN") { field(DESC, "MPS Min B-field") field(EGU, "kG-m") field(PREC, "7") field(DRVH, "2.7687") field(DRVL, "-2.8011") field(PINI, "YES") field(VAL, "-2.8011") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:763:MPSBLLIM") { field(DESC, "MPS Low Limit B-field") field(EGU, "kG-m") field(PREC, "7") field(DRVH, "2.7687") field(DRVL, "-2.8011") field(PINI, "YES") field(VAL, "-2.8011") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:763:MPSBLLIM2") { field(DESC, "MPS Low Limit #2 B-field") field(EGU, "kG-m") field(PREC, "7") field(DRVH, "2.7687") field(DRVL, "-2.8011") field(PINI, "YES") field(VAL, "-2.8011") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } # Set the default to Std record(mbbo, "BEND:LTUS:763: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, "BEND:LTUS:763:MPSLIMITS.E PP") } record(aSub, "BEND:LTUS:763: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, "BEND:LTUS:763:MPS.RVAL") field(INPB, "BEND:LTUS:763:BADIFF") field(INPC, "BEND:LTUS:763:BDELTAS.N") field(INPD, "BEND:LTUS:763:BACT") field(INPE, "BEND:LTUS:763:MPSBITMASK.RVAL") field(INPF, "BEND:LTUS:763:MPSBLLIM") field(INPG, "BEND:LTUS:763:MPSBMIN") field(INPH, "BEND:LTUS:763:MPSBMAX") field(INPI, "BEND:LTUS:763: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, "BEND:LTUS:763:INTOL.RVAL PP") field(OUTB, "BEND:LTUS:763:INTOL_BMIN.RVAL PP") field(OUTC, "BEND:LTUS:763:INTOL_BRANGE.RVAL PP") field(OUTD, "BEND:LTUS:763: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, "BEND:LTUS:763:INTOL") { field(DESC, "BACT within MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "BEND:LTUS:763:MPSLIMITS.VALA") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "BEND:LTUS:763:INTOL_BMIN") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "BEND:LTUS:763:MPSLIMITS.VALB") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "BEND:LTUS:763:INTOL_BMIN2") { field(DESC, "MPS tol #2") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "BEND:LTUS:763:MPSLIMITS.VALD") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "BEND:LTUS:763:INTOL_BRANGE") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "BEND:LTUS:763: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, "BEND:LTUS:763:CHCKITOL") { field(DESC, "Absolute Check I Tolerance") field(EGU, "A") field(FLNK, "BEND:LTUS:763:TRIMITOL") field(CALC, "ABS(A*B)") field(INPA, "BEND:LTUS:763:CHCKBTOL") field(INPB, "BEND:LTUS:763:POLYCOEF.B") field(PREC, "9") } record(calc, "BEND:LTUS:763:TRIMBTOL") { field(EGU, "kG-m") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(DESC, "Absolute Trim Tolerance") field(CALC, "ABS(A)/2") field(INPA, "BEND:LTUS:763:CHCKBTOL") field(FLNK, "BEND:LTUS:763:CHCKITOL") } record(calc, "BEND:LTUS:763:CHCKBTOL") { field(DESC, "Check absolute tolerance") field(EGU, "A") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(FLNK, "BEND:LTUS:763:TRIMBTOL") field(CALC, "MAX(ABS(A),ABS(C))*(B/1000000)") field(INPA, "BEND:LTUS:763:BDES.HOPR") field(INPB, "BEND:LTUS:763:STABILITY") field(INPC, "BEND:LTUS:763:BDES.LOPR") } record(longout, "BEND:LTUS:763: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, "BEND:LTUS:763:CHCKBTOL") } record(calc, "BEND:LTUS:763:TRIMITOL") { field(DESC, "Absolute Trim I Tolerance") field(EGU, "kG-m") field(CALC, "ABS(A*B)") field(INPA, "BEND:LTUS:763:POLYCOEF.B") field(INPB, "BEND:LTUS:763:TRIMBTOL") field(PREC, "9") } record(ai, "BEND:LTUS:763:TRIMBTOLR") { field(DESC, "Relative trim tol") field(PREC, "4") field(EGU, "%") field(HOPR, "1.0") field(LOPR, "0.0") field(PINI, "YES") } record(ai, "BEND:LTUS:763: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, "BEND:LTUS:763:FBCKFCOM") { field(ZNAM, "CA") field(ONAM, "FCOM") field(DESC, "CA Mode") field(PINI, "YES") field(SDIS, "0") } record(bo, "BEND:LTUS:763:PAU") { field(ZNAM, "NotConfigured") field(ONAM, "Configured") field(DESC, "PAU Present") field(PINI, "YES") field(SDIS, "0") field(FLNK, "BEND:LTUS:763:PAUGO") } record(fanout, "BEND:LTUS:763:PAUGO") { field(DESC, "PAU control") field(LNK1, "BEND:LTUS:763:PAUSTOP") field(LNK2, "BEND:LTUS:763: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, "BEND:LTUS:763:PAUSTART") { field(DESC, "Setup for PAU On") field(SDIS, "BEND:LTUS:763: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, "BEND:LTUS:763:PAUSTOP") { field(DESC, "Setup for PAU Off") field(SDIS, "BEND:LTUS:763: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, "BEND:LTUS:763:MCORDEVNAME") { field(DESC, "PS device name") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, "BEND:LTUS:764:") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "BEND:LTUS:763: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, "BEND:LTUS:763:PSTYPE.RVAL") field(INPC, "BEND:LTUS:763:TURNEDOFF.RVAL") field(INPD, "BEND:LTUS:763:CONFIG.RVAL") field(INPE, "BEND:LTUS:763:PSCATEGORY.RVAL") field(INPF, "BEND:LTUS:763:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "BEND:LTUS:763:AUTOCTRL.RVAL") field(INPJ, "BEND:LTUS:763:OUTOFSERVICE.RVAL") field(INPL, "BEND:LTUS:763:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "BEND:LTUS:763:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "BEND:LTUS:763:PAU") field(INPP, "BEND:LTUS:763:CALBDISABLE.RVAL") field(INPQ, "BEND:LTUS:763:PTRBDISABLE.RVAL") field(INPR, "BEND:LTUS:763:TRIMDISABLE.RVAL") field(INPS, "BEND:LTUS:763:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "BEND:LTUS:763:FBCK") field(INPU, "BEND:LTUS:763:TRIMTYPE.RVAL") field(INPV, "BEND:LTUS:763:STDZDIRECT.RVAL") field(INPW, "BEND:LTUS:763:DEGAUSENABLE.RVAL") field(FLNK, "BEND:LTUS:763:HSTA") } record(longin, "BEND:LTUS:763:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "BEND:LTUS:763:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "BEND:LTUS:763: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, "BEND:LTUS:763: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, "BEND:LTUS:763: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, "BEND:LTUS:763: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, "BEND:LTUS:763: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, "BEND:LTUS:763: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 BEND:LTUS:763:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses BEND:LTUS:763:FBCK. # This PV should be replaced by BEND:LTUS:763: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, "BEND:LTUS:763: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, "BEND:LTUS:763: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, "BEND:LTUS:763: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, "BEND:LTUS:764:OUTOFSERVICE CPP NMS") field(OMSL, "closed_loop") field(FLNK, "BEND:LTUS:763:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"BEND:LTUS:763:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "BEND:LTUS:763:OUTOFSERVICE NPP NMS") field(OUT, "BEND:LTUS:763:ONLINE PP") } record(bo, "BEND:LTUS:763:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "BEND:LTUS:763: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, "BEND:LTUS:763: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, "BEND:LTUS:763: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, "BEND:LTUS:763: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, "BEND:LTUS:763: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, "BEND:LTUS:763: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, "BEND:LTUS:763: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, "BEND:LTUS:763: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, "BEND:LTUS:763: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, "BEND:LTUS:763: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, "BEND:LTUS:763: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, "BEND:LTUS:763:TRIMTYPE") } record(stringout, "BEND:LTUS:763:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "BEND:LTUS:764:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "BEND:LTUS:763:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "BEND:LTUS:763:STATE.RVAL") field(INPB, "BEND:LTUS:763:INTLKSUMY.RVAL") field(OUT, "BEND:LTUS:763:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "BEND:LTUS:763: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, "BEND:LTUS:763:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "BEND:LTUS:763:STATE.RVAL") field(INPB, "BEND:LTUS:763:INTLKSUMY.RVAL") field(OUT, "BEND:LTUS:763:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "BEND:LTUS:763:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "BEND:LTUS:763:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "BEND:LTUS:763: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, "BEND:LTUS:763: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, "BEND:LTUS:763: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, "BEND:LTUS:763: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,"BEND:LTUS:763: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("BEND:LTUS:763:TURNEDOFF",3140,1907,0,1,"BEND:LTUS:763:TURNEDOFF") #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "BEND:LTUS:763:STATSUB") { field(DESC, "Build STATus ") field(INAM, "mgntInit") field(SNAM, "mgntSlcStat") field(INPA, "BEND:LTUS:763:BACT.STAT") field(INPB, "BEND:LTUS:763:BDES.STAT") field(INPC, "BEND:LTUS:763: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, "BEND:LTUS:763:BACT.SEVR") field(INPH, "BEND:LTUS:763:BDES.SEVR") field(INPI, "BEND:LTUS:763: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, "BEND:LTUS:763:STATE.RVAL") field(INPN, "BEND:LTUS:763:STDZOK") field(INPO, "BEND:LTUS:763:CALBOK") field(INPP, "BEND:LTUS:763:OUTOFSERVICE.RVAL") field(INPQ, "BEND:LTUS:763:CONFIG.RVAL") field(INPR, "BEND:LTUS:763:HSTA") field(INPS, "BEND:LTUS:763:CTRL.RVAL") field(INPT, "BEND:LTUS:763:DEGAUSOK") field(INPV, "BEND:LTUS:763: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, "BEND:LTUS:763:STAT") } record(longout, "BEND:LTUS:763:STAT") { field(DESC, "STAT sent to SLC") field(SCAN, "Passive") field(FLNK, "BEND:LTUS:763:STATCTRLSUB") field(DOL, "BEND:LTUS:763:STATSUB.VAL") field(OMSL, "closed_loop") } record(sSub, "BEND:LTUS:763:STATCTRLSUB") { field(DESC, "Decode SLC STAT into mbbo") field(INAM, "mgntInit") field(SNAM, "mgntStatDecode") field(INPA, "BEND:LTUS:763:STAT") field(INPB, "BEND:LTUS:763:HSTA") field(INPD, "BEND:LTUS:763:ONOFFCTRL.RVAL") field(FLNK, "BEND:LTUS:763:STATMSG") } record(mbbo, "BEND:LTUS:763: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, "BEND:LTUS:763:UNAVAILGO") field(DOL, "BEND:LTUS:763:STATCTRLSUB.W") } record(seq, "BEND:LTUS:763:UNAVAILGO") { field(DESC, "Process UNAVAIL") field(DOL1, "BEND:LTUS:763:STATSUB.U") field(LNK1, "BEND:LTUS:763:UNAVAIL PP") } record(stringout, "BEND:LTUS:763:SNLSTATMSG") { field(DTYP, "Soft Channel") } #! TextBox(TB0,820,1000,1200,1220,0,"Dialog",12,1,16777215,"BEND:LTUS:763:STATUSSUB - future\nOverall device status - takes input from action snls, record sevrs, master snl(s) and outputs final status\n\nInputs:\nA - BEND:LTUS:763:CTRLSTATUS - snl status\nB - MGNT:CTRLSTATUS - master list status\nC\nD - BEND:LTUS:763: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,"BEND:LTUS:763STATSUB\nformat control bo's into slc STAT\n\nInputs:\nA - BEND:LTUS:763:STATUS\nC - BEND:LTUS:763:ON\nD - BEND:LTUS:763:STDZOK\nE - BEND:LTUS:763:CALBOK\nF - BEND:LTUS:763:BACTDRIFT (future)\nG -\nH- BEND:LTUS:763:DACSTATUS\nI -BEND:LTUS:763:ADCSTATUS\nJ - BEND:LTUS:763:BACTSTATUS\nK - BEND:LTUS:763:BDESSTATUS\nL - BEND:LTUS:763:RIPLSTATUS\n\nOutput:\nP - BEND:LTUS:763: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, "BEND:LTUS:763: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, "BEND:LTUS:763: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, "BEND:LTUS:763: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, "BEND:LTUS:763: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, "BEND:LTUS:763:IDESTOTAL"){ field(DESC, "Calc total current") field(CALC, "A+B") field(EGU, "kG-m") field(PREC, "7") field(INPA, "BEND:LTUS:764:IDES CP NMS") field(INPB, "BTRM:LTUS:763:BDES CP NMS") field(OUT, "BEND:LTUS:763:IDES2BDES.E PP") } record(sub, "BEND:LTUS:763:IDES2BDES") { field(DESC, "Cal BDES") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "BEND:LTUS:763:IDES2BDES") field(INPB, "BEND:LTUS:763:POLYCOEF") field(INPC, "BEND:LTUS:763:POLYCOEF.A") field(INPD, "BEND:LTUS:763:POLYCOEF.B") field(INPE, "BEND:LTUS:763:IDESTOTAL MS") field(INPF, "BEND:LTUS:764:BDELTAS PP") field(INPG, "100") field(EGU, "kG-m") field(HOPR, "2.7687") field(LOPR, "-2.8011") field(HIHI, "2.7687") field(LOLO, "-2.8011") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "2.7687") field(LOW, "-2.8011") field(FLNK, "BEND:LTUS:763: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, "BEND:LTUS:763:IACTCALC"){ field(DESC, "Calc total act current") field(CALC, "A+B") field(EGU, "kG-m") field(PREC, "7") field(INPA, "BEND:LTUS:763:IACT CP NMS") field(INPB, "BTRM:LTUS:763:BACT") field(OUT, "BEND:LTUS:763: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, "BEND:LTUS:763:IMONCALC"){ field(DESC, "Calc total mon current") field(CALC, "A+B") field(EGU, "kG-m") field(PREC, "7") field(INPA, "BEND:LTUS:763:IMON CP NMS") field(INPB, "BTRM:LTUS:763:BMON") field(OUT, "BEND:LTUS:763: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, "BEND:LTUS:763:ICONTOTAL"){ field(DESC, "Calc total current") field(CALC, "A+B") field(EGU, "kG-m") field(PREC, "7") field(INPA, "BEND:LTUS:764:ICON CP NMS") field(INPB, "BTRM:LTUS:763:BCON CP NMS") field(OUT, "BEND:LTUS:763:ICON2BCON.E PP") } record(sub, "BEND:LTUS:763:ICON2BCON") { field(DESC, "Cal BCON") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "BEND:LTUS:763:ICON2BCON") field(INPB, "BEND:LTUS:763:POLYCOEF") field(INPC, "BEND:LTUS:763:POLYCOEF.A") field(INPD, "BEND:LTUS:763:POLYCOEF.B") field(INPE, "BEND:LTUS:763:ICONTOTAL MS") field(INPF, "BEND:LTUS:764:BDELTAS PP") field(INPG, "100") field(EGU, "kG-m") field(HOPR, "2.7687") field(LOPR, "-2.8011") field(HIHI, "2.7687") field(LOLO, "-2.8011") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "2.7687") field(LOW, "-2.8011") field(FLNK, "BEND:LTUS:763:BCON") } #! 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, "BEND:LTUS:765:IACT") { field(DESC, "Current") field(INP, "BEND:LTUS:764:IACT CP NMS") field(EGU, "A") field(HOPR, "17.5") field(LOPR, "-17.5") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "BEND:LTUS:765:IACTCALC") info(autosaveFields,"HYST") } record(bi, "BEND:LTUS:765:STATE") { field(DESC, "PS On/Off Status") field(DTYP, "Raw Soft Channel") field(INP, "BEND:LTUS:764:STATE CP MS") field(ZSV, "MAJOR") field(ZNAM, "OFF") field(ONAM, "ON") } record(ao, "BEND:LTUS:765:IDES") { field(DESC, "Desired Current") field(PREC, "3") field(EGU, "A") field(HOPR, "17.5") field(LOPR, "-17.5") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(MDEL, "-1") field(HIHI, "17.5") field(LOLO, "-17.5") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "BEND:LTUS:765:BDELTAS") field(DRVH, "17.5") field(DRVL, "-17.5") field(DOL, "BEND:LTUS:765: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, "BEND:LTUS:765:ICTRL PP") } # This record is processed by BEND:LTUS:765:ICON") # Note: we are not setting alarms here. record(ao, "BEND:LTUS:765:ICON") { field(DESC, "Config I") field(DTYP, "Soft Channel") field(PREC, "3") field(HOPR, "17.5") field(LOPR, "-17.5") field(DRVH, "17.5") field(DRVL, "-17.5") field(DOL, "BEND:LTUS:765:B2ICON.K") field(OMSL, "closed_loop") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:765:INOM") { field(DESC, "Nominal Current") field(DOL, "BEND:LTUS:765:BNOM.K") field(OMSL, "closed_loop") field(PREC, "3") field(EGU, "A") field(DRVH, "17.5") field(DRVL, "-17.5") field(HOPR, "17.5") field(LOPR, "-17.5") } record(ao, "BEND:LTUS:765:ICTRL") { field(DESC, "Set Current") field(PREC, "3") field(EGU, "A") field(HOPR, "17.5") field(LOPR, "-17.5") field(DRVH, "17.5") field(DRVL, "-17.5") field(MDEL, "-1") field(FLNK, "BEND:LTUS:765:ICTRLGO") field(OMSL, "supervisory") info(autosavefields,"VAL") } record(seq, "BEND:LTUS:765:ICTRLGO") { field(DESC, "Process Current Setpoint") field(PREC, "3") # Set ISETPT to supervisory field(DOL1, "0") field(LNK1, "BEND:LTUS:765:ISETPT.OMSL") field(DOL2, "BEND:LTUS:765:ICTRL") field(LNK2, "BEND:LTUS:765:ISETPT PP") # Set ISETPT to closed loop - get data from BCTRLSUB.K field(DOL3, "1") field(LNK3, "BEND:LTUS:765:ISETPT.OMSL") } record(ao, "BEND:LTUS:765:IMAX") { field(DESC, "Max I") field(DTYP, "Soft Channel") field(DRVH, "17.5") field(DRVL, "-17.5") field(EGU, "A") field(HOPR, "17.5") field(LOPR, "-17.5") field(PREC, "3") field(PINI, "YES") field(VAL, "17.5") field(FLNK, "BEND:LTUS:765:IMIN") } record(ao, "BEND:LTUS:765:IMIN") { field(DESC, "Min I") field(DTYP, "Soft Channel") field(DRVH, "17.5") field(DRVL, "-17.5") field(EGU, "A") field(HOPR, "17.5") field(LOPR, "-17.5") field(PREC, "3") field(VAL, "-17.5") field(FLNK, "BEND:LTUS:765:IRANGE") } record(sel, "BEND:LTUS:765:IACTPREVOK") { field(DESC, "Last Good Current") field(EGU, "A") field(HOPR, "17.5") field(LOPR, "-17.5") field(PREC, "3") field(NVL, "BEND:LTUS:765:BACT.SEVR") field(INPA, "BEND:LTUS:765:IACT NPP MS") field(INPB, "BEND:LTUS:765:IACTPREVOK NPP MS") field(INPC, "BEND:LTUS:765:IACTPREVOK NPP MS") field(INPD, "BEND:LTUS:765:IACTPREVOK NPP MS") } record(sub, "BEND:LTUS:765:IACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "BEND:LTUS:765:IDES") field(INPB, "BEND:LTUS:765:ISETPT.DRVH") field(INPC, "BEND:LTUS:765:ISETPT.DRVL") field(INPD, "BEND:LTUS:765:IDELTAS.I") field(INPE, "BEND:LTUS:765:IDELTAS.J") field(INPG, "BEND:LTUS:765:STATE") field(INPH, "BEND:LTUS:765:HSTA") field(EGU, "A") field(HOPR, "17.5") field(LOPR, "-17.5") field(PREC, "3") field(BRSV, "INVALID") } record(sub, "BEND:LTUS:765:IMONLIMITS") { field(DESC, "Aux Current Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "BEND:LTUS:765:IDES") field(INPB, "BEND:LTUS:765:ISETPT.DRVH") field(INPC, "BEND:LTUS:765:ISETPT.DRVL") field(INPD, "BEND:LTUS:765:IDELTAS.K") field(INPE, "BEND:LTUS:765:IDELTAS.L") field(INPG, "BEND:LTUS:765:STATE") field(INPH, "BEND:LTUS:765:HSTA") field(EGU, "A") field(HOPR, "17.5") field(LOPR, "-17.5") field(PREC, "3") field(BRSV, "INVALID") } record(seq, "BEND:LTUS:765:ILIMITS") { field(DESC, "Set ACT and MON Limits") field(PREC, "3") field(DOL1, "BEND:LTUS:765:BLIMITS") field(LNK1, "BEND:LTUS:765:IACTLIMITS.F PP") field(DOL2, "BEND:LTUS:765:IACTLIMITS.I") field(LNK2, "BEND:LTUS:765:IACT.HIGH") field(DOL3, "BEND:LTUS:765:IACTLIMITS.J") field(LNK3, "BEND:LTUS:765:IACT.LOW") field(DOL4, "BEND:LTUS:765:IACTLIMITS.K") field(LNK4, "BEND:LTUS:765:IACT.HIHI") field(DOL5, "BEND:LTUS:765:IACTLIMITS.L") field(LNK5, "BEND:LTUS:765:IACT.LOLO") field(DOL6, "BEND:LTUS:765:BLIMITS") field(LNK6, "BEND:LTUS:765:IMONLIMITS.F PP") field(DOL7, "BEND:LTUS:765:IMONLIMITS.I") field(LNK7, "BEND:LTUS:765:IMON.HIGH") field(DOL8, "BEND:LTUS:765:IMONLIMITS.J") field(LNK8, "BEND:LTUS:765:IMON.LOW") field(DOL9, "BEND:LTUS:765:IMONLIMITS.K") field(LNK9, "BEND:LTUS:765:IMON.HIHI") field(DOLA, "BEND:LTUS:765:IMONLIMITS.L") field(LNKA, "BEND:LTUS:765: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, "BEND:LTUS:765:IDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntRawDeltas") field(INPD, "BEND:LTUS:765:TRIMBTOL") field(INPE, "BEND:LTUS:765:CHCKBTOL") field(INPF, "BEND:LTUS:765:BDELTAS.K") field(INPG, "BEND:LTUS:765:BDELTAS.L") field(INPH, "BEND:LTUS:765: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, "BEND:LTUS:765:STDZITOLR") field(INPC, "BEND:LTUS:765:STDZITOL") field(FLNK, "") } # All ps controllers with on/off control will set the macro ONOF # as follows: # # ONOF = BEND:LTUS:764: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, "BEND:LTUS:765: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 = BEND:LTUS:764:RESET PP # record(bo, "BEND:LTUS:765: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, "BEND:LTUS:765:RAMPSTATE") { field(DESC, "PS Ramp Status") field(DTYP, "Soft Channel") field(DOL, "BEND:LTUS:764: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, "BEND:LTUS:765: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, "BEND:LTUS:765:TRIMRAMPRATE") field(OUT, "") field(FLNK, "BEND:LTUS:765:STDZDLY") } record(ao, "BEND:LTUS:765:ISETPT") { field(DESC, "Current Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(EGU, "A") field(HOPR, "17.5") field(LOPR, "-17.5") field(DRVH, "17.5") field(DRVL, "-17.5") field(MDEL, "-1") field(OUT, "") field(DOL, "BEND:LTUS:765: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, "BEND:LTUS:765:IMON") { field(DESC, "Aux Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(INP, "BEND:LTUS:764:IMON CP NMS") field(EGU, "A") field(HOPR, "17.5") field(LOPR, "-17.5") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "BEND:LTUS:765:IMONCALC") } record(ao, "BEND:LTUS:765:IRIPL") { field(DESC, "Ripple Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(DOL, "BEND:LTUS:764:IRIPL CP NMS") field(OMSL, "closed_loop") field(EGU, "A") field(DRVH, "1.0") field(HOPR, "1.0") field(PREC, "3") field(FLNK, "BEND:LTUS:765:IRIPLOK") } record(sub, "BEND:LTUS:765:IRIPLOK") { field(DESC, "Ripple Current Status") field(INAM, "mgntInit") field(SNAM, "mgntRiplOK") field(INPA, "BEND:LTUS:765:IRIPL.VAL") field(INPB, "BEND:LTUS:765: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, "BEND:LTUS:765:R") { field(DESC, "Resistance") field(EGU, "Ohms") field(PREC, "4") field(PINI, "YES") field(DOL, "BEND:LTUS:764: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, "BEND:LTUS:765:IGND") { field(DESC, "Ground Current") field(EGU, "A") field(PREC, "6") field(PINI, "YES") field(DOL, "BEND:LTUS:764:IGND CP MS") field(OMSL, "closed_loop") } record(bi, "BEND:LTUS:765:INTLKSUMY") { field(DESC, "Interlock Summary") field(INP, "BEND:LTUS:764:INTLKSUMY CP MS") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(ZNAM, "OK") field(ONAM, "FAULT") field(PINI, "NO") } record(mbbo, "BEND:LTUS:765: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, "BEND:LTUS:764:COOLING CP NMS") field(OMSL, "closed_loop") } # The following PV is processed by :BACTFO # which is processed by :BACT record(fanout, "BEND:LTUS:765:IACTFO") { field(DESC, "IACT processing") field(SELM, "All") field(LNK1, "BEND:LTUS:765:IACTPREVOK") field(LNK2, "BEND:LTUS:765:IDIFF") field(LNK3, "BEND:LTUS:765:IADIFF") field(LNK4, "BEND:LTUS:765:IRATIO") field(LNK5, "BEND:LTUS:765:IDIRECT") field(LNK6, "BEND:LTUS:765:IACTPOL_CHECK") } record(calc, "BEND:LTUS:765:IDIFF") { field(DESC, "IDES-IACT") field(CALC, "A-B") field(INPA, "BEND:LTUS:765:IDES") field(INPB, "BEND:LTUS:765:IACT") field(EGU, "A") field(PREC, "9") field(HOPR, "17.5") field(LOPR, "-17.5") } record(calc, "BEND:LTUS:765:IADIFF") { field(DESC, "Absolute IDES-IACT") field(CALC, "A<0?ABS(A):A") field(INPA, "BEND:LTUS:765:IDIFF") field(PREC, "9") } record(calc, "BEND:LTUS:765:IRATIO") { field(DESC, "IDES-IACT/IMAX") field(CALC, "B?A/B:0") field(INPA, "BEND:LTUS:765:IDIFF") field(INPB, "BEND:LTUS:765:IDES.DRVH") field(PREC, "9") } record(calcout, "BEND:LTUS:765:IRANGE") { field(DESC, "Current Range") field(PINI, "YES") field(CALC, "ABS(A-B)") field(INPA, "BEND:LTUS:765:IMIN") field(INPB, "BEND:LTUS:765: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, "BEND:LTUS:765: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, "BEND:LTUS:765:IACT") field(FLNK, "BEND:LTUS:765:IACTPOL") } record(bo, "BEND:LTUS:765:IACTPOL") { field(DESC, "Actual I Polarity") field(DTYP, "Raw Soft Channel") field(DOL, "BEND:LTUS:765: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,"BEND:LTUS:765:I*LIMITS:\n Calculate alarm and warning limits based on \n deltas from BEND:LTUS:765:IDELTAS and the\n BEND:LTUS:765: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,"BEND:LTUS:765:IACT: \n Get copy of BEND:LTUS:765:I. \n",null) #! TextBox(TB12,1280,3100,1760,3200,0,"Dialog",12,1,16777215,"BEND:LTUS:765: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,"BEND:LTUS:765:IDES:\n Contains raw value calculated by \nBEND:LTUS:765: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 \nBEND:LTUS:765:BDELTAS.\n",null) #! TextBox(TB10,56,1940,316,2340,0,"Dialog",12,1,16777215,"BEND:LTUS:765: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 BEND:LTUS:765: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 BEND:LTUS:765: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,"BEND:LTUS:765:ISETPT:\n Sets the hardware. When fast feedback is set on, this record is\n set to closed loop mode by BEND:LTUS:765:FBCKSTART sequence. When \n the loop is closed, this record takes input calculated by \n BFBCK only. When fast feedback is set off, BEND:LTUS:765:FBCKSTOP \n will set it back to supervisory so that the value can be set by \n BEND:LTUS:765: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, "BEND:LTUS:765:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:765:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "BEND:LTUS:765:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "BEND:LTUS:765:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "BEND:LTUS:765:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "BEND:LTUS:765:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "1") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "BEND:LTUS:765: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, "BEND:LTUS:765:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "BEND:LTUS:765:TRIMTYPE.RVAL") field(INPB, "BEND:LTUS:765:CONFIG.RVAL") field(OUT, "BEND:LTUS:765:TRIMMAXNUM PP") } record(longout, "BEND:LTUS:765: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, "BEND:LTUS:765: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, "BEND:LTUS:764:TRIMRAMPRATE CP NMS") field(OMSL, "closed_loop") field(VAL, "") field(OUT, "BEND:LTUS:765:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "BEND:LTUS:765: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, "BEND:LTUS:764:TRIMSETL CP NMS") field(OMSL, "closed_loop") field(VAL, "") } record(bo, "BEND:LTUS:765: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, "BEND:LTUS:765: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, "BEND:LTUS:765: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, "BEND:LTUS:765:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "0") } record(ao, "BEND:LTUS:765: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, "BEND:LTUS:765:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "BEND:LTUS:765: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, "BEND:LTUS:765: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, "BEND:LTUS:765:IMOVE") field(INPB, "BEND:LTUS:765:IACT") field(INPC, "BEND:LTUS:765:IRAMPRATE") field(INPD, "1.577") field(INPE, "BEND:LTUS:765:TRIMDLYPCT") field(INPF, "BEND:LTUS:765:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "BEND:LTUS:765:RAMPTIME_LEFT PP") } record(longout, "BEND:LTUS:765:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "BEND:LTUS:765:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "BEND:LTUS:765:RAMPDONE_CALC") } record(calc, "BEND:LTUS:765:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "BEND:LTUS:765:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "BEND:LTUS:765:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "BEND:LTUS:765: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, "BEND:LTUS:765:RAMPTIME_LEFT") field(OUT, "BEND:LTUS:765:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "BEND:LTUS:765:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "BEND:LTUS:765:RAMPTIME_LEFT NMS") field(OUT, "BEND:LTUS:765:RAMPDONE PP") } record(bo, "BEND:LTUS:765:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "BEND:LTUS:765:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "BEND:LTUS:765: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, "BEND:LTUS:765: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, "BEND:LTUS:765:STDZINIT") { field(DESC, "Proc. Stdz PVs on boot") field(PINI, "YES") field(DOL1, "1") field(DOL2, "1") field(DOL3, "1") field(LNK1, "BEND:LTUS:765:DEBUG.PROC PP") field(LNK2, "BEND:LTUS:765:STDZCYCLENUM.PROC PP") field(LNK3, "BEND:LTUS:765:STDZDISABLE.PROC PP") field(LNK4, "BEND:LTUS:765: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, "BEND:LTUS:765:STDZSUB") { field(DESC, "Stdz subroutine") field(INAM, "mgntStdzInit") field(SNAM, "mgntStdz") field(BRSV, "INVALID") field(INPA, "BEND:LTUS:765:STDZIMIN NPP NMS") field(INPB, "BEND:LTUS:765:STDZIMAX NPP NMS") field(INPC, "BEND:LTUS:765:STDZIFINAL NPP NMS") field(INPD, "BEND:LTUS:765:STDZCYCLENUM NPP NMS") field(INPE, "BEND:LTUS:765:STDZDIRECT.RVAL NPP NMS") field(INPF, "BEND:LTUS:765:STDZDISABLE.RVAL CPP NMS") field(INPG, "BEND:LTUS:765: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, "BEND:LTUS:765:STDZWF PP") field(OUTB, "BEND:LTUS:765: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, "BEND:LTUS:765:STDZWF") } record(mbbo, "BEND:LTUS:765: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, "BEND:LTUS:765: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, "BEND:LTUS:765:STDZMAINPS") { field(DESC, "Stdz by main or self") field(PINI, "YES") field(DTYP, "Soft Channel") field(ZNAM, "SELF") field(ONAM, "MAIN") } record(bo, "BEND:LTUS:765: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, "BEND:LTUS:765: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, "BEND:LTUS:765: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, "BEND:LTUS:765:STDZTOD") { field(DESC, "Successful Standardize Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "BEND:LTUS:765:STDZLOSTTOD") { field(DESC, "Standardize Lost Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(longout, "BEND:LTUS:765:STDZCYCLECNT") { field(DESC, "Cycle Count") field(PINI, "YES") } record(longout, "BEND:LTUS:765: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, "BEND:LTUS:765:STDZDIRECT") } # The default standardize direction is "UP" for # all LCLS Magnets.. record(bo, "BEND:LTUS:765:STDZDIRECT") { field(DESC, "Standardize Direction ") field(ZNAM, "UP") field(ONAM, "DOWN") field(VAL, "0") field(FLNK, "BEND:LTUS:765:STDZIMIN") } record(ao, "BEND:LTUS:765:STDZIMIN") { field(DESC, "Min-STDZ Current") field(PREC, "1") field(EGU, "A") field(HOPR, "17.5") field(LOPR, "-17.5") field(VAL, "-17.5") field(FLNK, "BEND:LTUS:765:STDZIMAX") } record(ao, "BEND:LTUS:765:STDZIMAX") { field(DESC, "Max. Standarize Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "17.5") field(LOPR, "-17.5") field(VAL, "17.5") field(FLNK, "BEND:LTUS:765:STDZIFINAL") } record(ao, "BEND:LTUS:765:STDZIFINAL") { field(DESC, "Final SDTZ Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "17.5") field(LOPR, "-17.5") field(VAL, "-17.5") field(FLNK, "BEND:LTUS:765: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, "BEND:LTUS:765: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, "BEND:LTUS:765:STDZITOL") { field(DESC, "Stdz min tolerance") field(PREC, "5") field(CALC, "MAX(ABS(A),ABS(B))*C") field(INPA, "BEND:LTUS:765:STDZIMIN CP NMS") field(INPB, "BEND:LTUS:765:STDZIMAX CP MMS") field(INPC, "0.05") field(INPD, "BEND:LTUS:765:STDZITOLR CP MMS") field(EGU, "A") field(FLNK, "BEND:LTUS:765:IDELTAS") field(PINI, "YES") } # D - factor (3.154/2 = 1.577) for EPSC, otherwise, set to 1.0 record(calc, "BEND:LTUS:765:STDZDLY") { field(DESC, "Ramp time for stdz cycle") field(CALC, "C>0?MAX(1,ABS((A-B)/C)*D):0") field(INPA, "BEND:LTUS:765:STDZIMIN CP NMS") field(INPB, "BEND:LTUS:765:STDZIMAX CP NMS") field(INPC, "BEND:LTUS:765:TRIMRAMPRATE CP NMS") field(INPD, "1.0") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") } record(calc, "BEND:LTUS:765:STDZRAMPDLY") { field(DESC, "Ramp delay total") field(CALC, "MAX(1,((A/100)*B+B))") field(PREC, "5") field(INPA, "BEND:LTUS:765:TRIMDLYPCT CP MS") field(INPB, "BEND:LTUS:765: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, "BEND:LTUS:765:STDZMINIDLY") { field(DESC, "Mini-stdz delay") field(CALC, "A") field(PREC, "5") field(A, "1.0") field(EGU, "sec") field(PINI, "YES") } record(ao, "BEND:LTUS:765: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, "BEND:LTUS:765:STDZMINIDELTA") { field(DESC, "Stdz mini % of IMAX") field(CALC, "(B/100)*(A-C)") field(INPA, "BEND:LTUS:765:IDES.HOPR") field(INPB, "BEND:LTUS:765:STDZMINIPCT CPP NMS") field(INPC, "BEND:LTUS:765:IDES.LOPR") field(PREC, "5") } record(calc, "BEND:LTUS:765:STDZMINISETPT") { field(DESC, "Mini Stdz delta") field(CALC, "C==0?MAX(E-D,B):MIN(E+D,A)") field(INPA, "BEND:LTUS:765:IDES.HOPR") field(INPB, "BEND:LTUS:765:IDES.LOPR") field(INPC, "BEND:LTUS:765:STDZDIRECT.RVAL") field(INPD, "BEND:LTUS:765:STDZMINIDELTA") field(INPE, "BEND:LTUS:765:IDES") field(PREC, "5") field(FLNK, "BEND:LTUS:765: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, "BEND:LTUS:765:STDZMINISETPTOOR") { field(DESC, "Mini Stdz setpoint out of range") field(CALC, "C==0?(E-DA)") field(INPA, "BEND:LTUS:765:IDES.HOPR") field(INPB, "BEND:LTUS:765:IDES.LOPR") field(INPC, "BEND:LTUS:765:STDZDIRECT.RVAL") field(INPD, "BEND:LTUS:765:STDZMINIDELTA") field(INPE, "BEND:LTUS:765: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, "BEND:LTUS:765: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, "BEND:LTUS:765:IADJUST.RVAL") field(INPB, "BEND:LTUS:765:STDZDIRECT.RVAL") field(INPC, "BEND:LTUS:765:STDZOK.RVAL") field(INPD, "BEND:LTUS:765:STDZDISABLE.RVAL") field(INPE, "BEND:LTUS:765:STATE.RVAL CPP NMS") field(INPF, "BEND:LTUS:765:ICTRL.RVAL") field(INPG, "BEND:LTUS:765:STATE.SEVR") field(INPH, "BEND:LTUS:765:BDELTAS.M") field(INPI, "BEND:LTUS:765:IACT.SEVR") field(OUT, "BEND:LTUS:765:STDZLOSTGO.SELN PP NMS") field(OOPT, "Transition To Non-zero") } record(seq, "BEND:LTUS:765:STDZLOSTGO") { field(DESC, "Process lost stdz") field(SELM, "Mask") field(DOL1, "1") field(DOL2, "0") field(LNK1, "BEND:LTUS:765:STDZLOSTTOD.PROC") field(LNK2, "BEND:LTUS:765:STDZOK PP") } # Record maximum current after standardize # Reset to IACT from sequence after trim # Disable processing during (mini-)standardize or trim record(calc, "BEND:LTUS:765:STDZIACTMAX") { field(DESC, "Max act current after stdz") field(CALC, "MAX(A, B)") field(DISV, "0") field(SDIS, "BEND:LTUS:765:CHECKPWRDIP_ENABLE") field(INPA, "BEND:LTUS:765:IACT CP") field(INPB, "BEND:LTUS:765:STDZIACTMAX") field(EGU, "A") field(FLNK, "BEND:LTUS:765:CHECKPWRDIP") } # Detect power dip if STDZOK is YES, STDZ is enabled, and IACT is valid # If IACT drops below STDZIACTMAX by more than the trim tolerance, clear STDZOK # Warning: Take the absolute value of the trim tolerance, or else quads of # negative polarity will always lose STDZ since their IDELTAS.I are negative. # Note: Large quads and bends are prone to losing STDZ even if they are # perturbed toward higher current since their current tends to overshoot # by greater than the trim tolerance before settling down. record(calcout, "BEND:LTUS:765:CHECKPWRDIP") { field(DESC, "Detect power dip") field(CALC, "(A-B>ABS(C))?3:0") field(DISV, "0") field(SDIS, "BEND:LTUS:765:CHECKPWRDIP_ENABLE") field(INPA, "BEND:LTUS:765:STDZIACTMAX") field(INPB, "BEND:LTUS:765:IACT") field(INPC, "BEND:LTUS:765:IDELTAS.I") field(OUT, "BEND:LTUS:765:STDZLOSTGO.SELN PP NMS") field(OOPT, "When Non-zero") } # Enable processing of STDZIACTMAX and CHECKPWRDIP only if # STDZOK = YES, STDZDISABLE = NO, CTRL != Trim (2), and # CTRL != Stdz (4) record(calc, "BEND:LTUS:765:CHECKPWRDIP_ENABLE") { field(CALC, "A&&!B&&(C#2)&&(C#4)") field(INPA, "BEND:LTUS:765:STDZOK.RVAL CP") field(INPB, "BEND:LTUS:765:STDZDISABLE.RVAL CP") field(INPC, "BEND:LTUS:765:CTRL.RVAL CP") } #! 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, "BEND:LTUS:765: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, "BEND:LTUS:765: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, "BEND:LTUS:765:CALBSET") { field(DESC, "Use DAC Calbration") field(SCAN, "10 second") field(CALC, "A&&(B==0)&&C?31:960") field(INPA, "BEND:LTUS:765:CALBOK") field(INPB, "BEND:LTUS:765:CALBDISABLE") field(INPC, "BEND:LTUS:765:CALBSLOPE") field(OOPT, "On Change") field(OUT, "BEND:LTUS:765: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, "BEND:LTUS:765:CALB_SEQ") { field(DESC, "Output Calib Values") field(SELM, "Mask") field(SELL, "BEND:LTUS:765: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, "BEND:LTUS:765:CALBSLOPE") field(DOL3, "BEND:LTUS:765: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, "BEND:LTUS:765:CALBTOD") { field(DESC, "Calibration Success Time") field(PINI, "YES") # field(DOL, "") field(OMSL, "supervisory") field(DTYP, "Soft Channel") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:765: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, "BEND:LTUS:765: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, "BEND:LTUS:765: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, "BEND:LTUS:765:CALBOFFSET") { field(DESC, "Calc DAC Offset") field(PREC, "6") field(EGU, "Counts") field(PINI, "YES") } record(bo, "BEND:LTUS:765: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, "BEND:LTUS:765:DACSLOPE") { field(DESC, "V to DAC slope") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "supervisory") field(PINI, "YES") field(FLNK, "BEND:LTUS:765:DACOFFSET") } # Default Offset used in conversion from Volts to DAC Counts record(ao, "BEND:LTUS:765:DACOFFSET") { field(DESC, "V to DAC offset") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "supervisory") field(PINI, "YES") field(FLNK, "BEND:LTUS:765: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, "BEND:LTUS:765: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, "BEND:LTUS:765:IACT") field(INPD, "BEND:LTUS:765:DACSLOPE") field(INPE, "BEND:LTUS:765:DACOFFSET") field(EGU, "Counts") field(PREC, "6") } record(ao, "BEND:LTUS:765:DAC") { field(DESC, "DAC Set point") field(EGU, "Counts") field(DOL, "") field(OMSL, "supervisory") field(PREC, "6") field(PINI, "YES") } record(ao, "BEND:LTUS:765:CALBIMIN") { field(DESC, "Calibration Min Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(DRVH, "17.5") field(HOPR, "17.5") field(DRVL, "-17.5") field(LOPR, "-17.5") field(PREC, "3") field(EGU, "A") field(VAL, "0.0") field(FLNK, "BEND:LTUS:765:CALBIMAX") } record(ao, "BEND:LTUS:765:CALBIMAX") { field(DESC, "Calibration Max Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(DRVH, "17.5") field(HOPR, "17.5") field(LOPR, "-17.5") field(DRVL, "-17.5") field(EGU, "A") field(VAL, "17.5") field(FLNK, "BEND:LTUS:765:CALBSTEPNUM") } record(ao, "BEND:LTUS:765:CALBIFINAL") { field(DESC, "Calibration Last Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(PREC, "3") field(EGU, "A") field(HOPR, "17.5") field(LOPR, "-17.5") field(VAL, "0") } record(longout, "BEND:LTUS:765: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, "BEND:LTUS:765:CALBIDELTA") } record(calc, "BEND:LTUS:765:CALBIDELTA") { field(DESC, "Step size for CALB") field(CALC, "C=0?0:ABS((A-B)/C)") field(INPA, "BEND:LTUS:765:CALBIMAX") field(INPB, "BEND:LTUS:765:CALBIMIN") field(INPC, "BEND:LTUS:765: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, "BEND:LTUS:765:CALBIMULT") { field(DESC, "IACT vs ISETPT mult") field(CALC, "C#0||A=0?1:ABS(B/A)") field(INPA, "BEND:LTUS:764:ISETPT.DRVH") field(INPB, "BEND:LTUS:764:IACT.HOPR") field(INPC, "BEND:LTUS:765:PSCONTROLLER.RVAL CPP") field(EGU, "A") field(PINI, "YES") } # SNL dbputs DAC values here. 6-10 steps are possible. record(waveform, "BEND:LTUS:765:CALBICTRLWF") { field(DESC, "ICTRL setpoint array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") } record(waveform, "BEND:LTUS:765:DACWF") { field(DESC, "DAC count array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "BEND:LTUS:765:DACSA") } # Used only for xygraph edm plot record(subArray, "BEND:LTUS:765:DACSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "BEND:LTUS:765: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, "BEND:LTUS:765:CALCDACWF") { field(DESC, "Calc DAC counts array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "BEND:LTUS:765:CALCDACSA") } # Used only for xygraph edm plot record(subArray, "BEND:LTUS:765:CALCDACSA") { field(DESC, "Calc DAC counts") field(DTYP, "Soft Channel") field(INP, "BEND:LTUS:765: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, "BEND:LTUS:765:CALBYWF") { field(DESC, "mx + b") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "BEND:LTUS:765:CALBYSA") } # Used only for xygraph edm plot record(subArray, "BEND:LTUS:765:CALBYSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "BEND:LTUS:765:CALBYWF") field(MALM, "10") field(NELM, "6") field(INDX, "0") field(FTVL, "DOUBLE") } record(waveform, "BEND:LTUS:765:CALBIACTWF") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "BEND:LTUS:765:CALBIACTSA") } # Used only for xygraph edm plot record(subArray, "BEND:LTUS:765:CALBIACTSA") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(MALM, "10") field(NELM, "6") field(INP, "BEND:LTUS:765:CALBIACTWF") field(INDX, "0") field(FTVL, "DOUBLE") field(FLNK, "BEND:LTUS:765:CALBLIMITS") } # Check that measured current during calibration is within # tolerance. record(aSub, "BEND:LTUS:765: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, "BEND:LTUS:765:CALBSTEPNUM") field(INPB, "BEND:LTUS:765:CALBIACTWF") field(INPC, "BEND:LTUS:765: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, "BEND:LTUS:765: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, "BEND:LTUS:765:STDZITOL") field(INPH, "BEND:LTUS:765:DACSLOPE") field(INPI, "BEND:LTUS:765: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, "BEND:LTUS:765: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, "BEND:LTUS:765:CALBSTEPNUM") field(INPB, "BEND:LTUS:765:CALBIACTWF") field(INPC, "BEND:LTUS:765:DACWF") field(INPF, "BEND:LTUS:765: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 BEND:LTUS:765CALBOK 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, "BEND:LTUS:765:DEGAUSINIT") { field(DESC, "Proc. Degauss PVs on boot") field(PINI, "YES") field(DOL, "1") field(OUTA, "BEND:LTUS:765:DEGAUSIMIN.PROC PP") field(OUTB, "BEND:LTUS:765:DEGAUSIMAX.PROC PP") field(OUTC, "BEND:LTUS:765:DEGAUSTYPE.PROC PP") field(OUTD, "BEND:LTUS:765:DEGAUSSTEP.PROC PP") field(OUTE, "BEND:LTUS:765:MADNAME.PROC PP") field(OUTF, "BEND:LTUS:765:PSTYPE.PROC PP") field(OUTG, "BEND:LTUS:765: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, "BEND:LTUS:765:DEGAUSSUB") { field(DESC, "Degauss subroutine") field(INAM, "mgntDegaussInit") field(SNAM, "mgntDegauss") field(BRSV, "INVALID") field(INPA, "BEND:LTUS:765:DEGAUSIMIN NPP NMS") field(INPB, "BEND:LTUS:765:DEGAUSIMAX NPP NMS") field(INPC, "BEND:LTUS:765:DEGAUSTYPE.RVAL NPP NMS") field(INPE, "BEND:LTUS:765:DEGAUSMETHOD.RVAL NPP NMS") field(INPF, "BEND:LTUS:765:PSTYPE NPP NMS") field(INPG, "BEND:LTUS:765:DEBUG.RVAL NPP NMS") field(INPH, "BEND:LTUS:765: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, "BEND:LTUS:765:DEGAUSWF PP") field(OUTB, "BEND:LTUS:765:DEGAUSMSG PP") field(OUTC, "BEND:LTUS:765: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, "BEND:LTUS:765:DEGAUSWF") { field(DESC, "Degauss Setpts") field(NELM, "60") field(FTVL, "DOUBLE") } record(mbbo,"BEND:LTUS:765: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, "BEND:LTUS:765: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, "BEND:LTUS:765: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, "BEND:LTUS:765: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, "BEND:LTUS:765: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, "BEND:LTUS:765:DEGAUSIMIN") { field(DESC, "Min. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "17.5") field(LOPR, "-17.5") field(DRVH, "17.5") field(DRVL, "-17.5") field(VAL, "-17.5") } record(ao, "BEND:LTUS:765:DEGAUSIMAX") { field(DESC, "Max. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "17.5") field(LOPR, "-17.5") field(DRVH, "17.5") field(DRVL, "-17.5") field(VAL, "17.5") } # 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,"BEND:LTUS:765: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, "BEND:LTUS:765: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,"BEND:LTUS:765: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, "BEND:LTUS:765: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, "BEND:LTUS:765: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, "BEND:LTUS:765: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, "BEND:LTUS:765:DEGAUSTOD") { field(DESC, "Successful Degauss Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "BEND:LTUS:765:DEGAUSLOSTTOD") { field(DESC, "Degauss Lost Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:765:DEGAUSTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "BEND:LTUS:765:DEGAUSTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "BEND:LTUS:765: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, "BEND:LTUS:765:DEGAUSGO") { field(DESC, "Set bdes of btrms to zero") field(ASG, "Internal") field(OUTA, "") field(OUTB, "") field(OUTC, "") field(OUTD, "") } # =========== CRYO ONLY =========== record(bo, "BEND:LTUS:765: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, "BEND:LTUS:765:DEGAUS_IMAX_CHECK") { field(DESC, "Check if imax shoud chg") field(CALC, "(C==4)&&(ABS(B)>ABS(A))?1:0") field(INPA, "BEND:LTUS:765:DEGAUS_IMAX") field(INPB, "BEND:LTUS:765:ISETPT") field(INPC, "BEND:LTUS:765:DEGAUSTYPE.RVAL") field(OUT, "BEND:LTUS:765:DEGAUS_IMAX_UPDATE.SELN") field(FLNK, "BEND:LTUS:765:DEGAUS_IMAX_UPDATE") } record(seq, "BEND:LTUS:765:DEGAUS_IMAX_UPDATE") { field(DESC, "Degauss IMAX Update") field(SELM, "Specified") field(DOL1, "BEND:LTUS:765:ISETPT") field(LNK1, "BEND:LTUS:765:DEGAUS_IMAX PP") } # Set the maximum current after a successful # degauss. This pv is updated by the # sequence. record(ao, "BEND:LTUS:765:DEGAUS_IMAX") { field(DESC, "Max I set afer a degauss") field(EGU, "Amps") field(PINI, "YES") field(PREC, "6") field(HOPR, "17.5") field(LOPR, "-17.5") field(DRVH, "17.5") field(DRVL, "-17.5") field(VAL, "17.5") field(FLNK, "BEND:LTUS:765:DEGAUS_IMAXPOL_CHECK") info(autosaveFields,"VAL,RVAL") } # Set the polarity if degauss_imax record(calcout, "BEND:LTUS:765:DEGAUS_IMAXPOL_CHECK") { field(DESC, "Determine polarity of imax") field(CALC, "A>=0?0:1") field(INPA, "BEND:LTUS:765:DEGAUS_IMAX") field(FLNK, "BEND:LTUS:765:DEGAUS_IMAXPOL") } record(bo, "BEND:LTUS:765:DEGAUS_IMAXPOL") { field(DESC, "Polarity of imax I") field(DTYP, "Raw Soft Channel") field(DOL, "BEND:LTUS:765:DEGAUS_IMAXPOL_CHECK") field(OMSL, "closed_loop") field(ZNAM, "Positive") field(ONAM, "Negative") field(FLNK, "BEND:LTUS:765: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, "BEND:LTUS:765:DEGAUS_ABSIMAX") { field(DESC, "Absolute Max. Degauss I") field(CALC, "ABS(A)") field(INPA, "BEND:LTUS:765:DEGAUS_IMAX") field(PREC, "6") field(EGU, "Amps") field(HOPR, "17.5") field(LOPR, "-17.5") info(autosaveFields,"VAL RVAL") } # IACT Polarity record(calcout, "BEND:LTUS:765:IACTPOL_CHECK") { field(DESC, "Determine IACT polarity") field(SCAN, "5 second") field(CALC, "ABS(A-B)>C?(A>=0?0:1):D") field(INPA, "BEND:LTUS:765:IACT") field(INPB, "BEND:LTUS:765:IACTPOL_CHECK.LA") field(INPC, "0.0001") field(INPD, "BEND:LTUS:765:IACTPOL_CHECK.PVAL") field(OOPT, "On Change") field(FLNK, "BEND:LTUS:765:IACTPOL") } record(bo, "BEND:LTUS:765: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,"BEND:LTUS:765: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, "BEND:LTUS:765:DEGAUSENABLE CP") field(INPB, "BEND:LTUS:765:DEGAUSOK") field(INPC, "BEND:LTUS:765:STATE CP") field(INPD, "BEND:LTUS:765:STATE.SEVR") field(OUT, "BEND:LTUS:765:DEGAUS_STATE_SEQ.SELN PP") field(ASG, "Internal") } record(seq, "BEND:LTUS:765:DEGAUS_STATE_SEQ") { field(DESC, "Degauss State Sequence") field(SELM, "Specified") field(SELL, "BEND:LTUS:765:DEGAUS_STATE_CHECK") field(LNK1, "BEND:LTUS:765:DEGAUS_STATE_DISABLE.PROC PP") field(LNK2, "BEND:LTUS:765:DEGAUS_STATE_LOST.PROC PP") field(LNK3, "BEND:LTUS:765:DEGAUS_STATE_GOOD.PROC PP") field(LNK4, "BEND:LTUS:765: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, "BEND:LTUS:765:DEGAUS_STATE_DISABLE") { field(DESC, "Degauss not used") field(LNK1, "BEND:LTUS:765:DEGAUSOK.ZSV") field(LNK2, "BEND:LTUS:765: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, "BEND:LTUS:765:STATMSG.FRSV") field(LNK4, "BEND:LTUS:765: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, "BEND:LTUS:765:DEGAUS_STATE_LOST") { field(DESC, "Degauss lost and ps On") field(DOL1, "1") field(LNK1, "BEND:LTUS:765:DEGAUSOK.ZSV") field(LNK2, "BEND:LTUS:765: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, "BEND:LTUS:765:STATMSG.FRSV") field(LNK4, "BEND:LTUS:765: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, "BEND:LTUS:765:DEGAUS_STATE_OFF") { field(DESC, "Degaused lost and ps Off") field(DOL1, "2") field(LNK1, "BEND:LTUS:765: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, "BEND:LTUS:765:STATMSG.FRSV") field(LNK3, "BEND:LTUS:765: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, "BEND:LTUS:765:DEGAUS_STATE_GOOD") { field(DESC, "Degauss good") field(DOL1, "1") field(LNK1, "BEND:LTUS:765: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, "BEND:LTUS:765:STATMSG.FRSV PP") field(LNK3, "BEND:LTUS:765:STATMSG.FVSV PP") field(LNK4, "") field(ASG, "Internal") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(mbbo, "BEND:LTUS:765:FUNC") { field(DESC, "BEND:LTUS:765 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, "0") field(FFVL, "0") field(OUT, "BEND:LTUS:765:CTRL CA") } # :CTRL pv is processed at boot in the # sequence mgntCtrl.st Processed in sequence # record(mbbo, "BEND:LTUS:765:CTRL") { field(DESC, "BEND:LTUS:765 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, "BEND:LTUS:765:SELECTEN.A PP") field(SDIS, "0") } # If a function has been selected set this unit to busy record(calcout, "BEND:LTUS:765:SELECTEN") { field(DESC, "Control Select Enable") field(CALC, "A>0?1:A") field(FLNK, "BEND:LTUS:765:BUSY") } # Set to FREE on IOC reboot record(bo, "BEND:LTUS:765:BUSY") { field(DESC, "BEND:LTUS:765 Ctrl Done") field(DOL, "BEND:LTUS:765:SELECTEN") field(ZNAM, "FREE") field(ONAM, "BUSY") field(PINI, "YES") field(FLNK, "BEND:LTUS:765:SELECT") } record(bo, "BEND:LTUS:765:SELECT") { field(ZNAM, "NO") field(ONAM, "YES") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") } record(bo, "BEND:LTUS:765: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, "BEND:LTUS:765:CTRLSTATE") { field(DESC, "BEND:LTUS:765 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("BEND:LTUS:765:CTRL",20,20,0,0,"BEND:LTUS:765:CTRL") #! Field("BEND:LTUS:765:CTRL.OUT",16777215,1,"BEND:LTUS:765:CTRL.OUT") #! Link("BEND:LTUS:765:CTRL.OUT","BEND:LTUS:765:SELECTEN.A") #! Field("BEND:LTUS:765:CTRL.VAL",16777215,1,"BEND:LTUS:765:CTRL.VAL") #! Record("BEND:LTUS:765:SELECTEN",321,381,0,0,"BEND:LTUS:765:SELECTEN") #! Field("BEND:LTUS:765:SELECTEN.A",16777215,0,"BEND:LTUS:765:SELECTEN.A") #! Field("BEND:LTUS:765:SELECTEN.FLNK",16777215,1,"BEND:LTUS:765:SELECTEN.FLNK") #! Link("BEND:LTUS:765:SELECTEN.FLNK","BEND:LTUS:765:BUSY") #! Field("BEND:LTUS:765:SELECTEN.VAL",16777215,1,"BEND:LTUS:765:SELECTEN.VAL") #! Record("BEND:LTUS:765:BUSY",623,274,0,0,"BEND:LTUS:765:BUSY") #! Field("BEND:LTUS:765:BUSY.DOL",16777215,0,"BEND:LTUS:765:BUSY.DOL") #! Link("BEND:LTUS:765:BUSY.DOL","BEND:LTUS:765:SELECTEN.VAL") #! Field("BEND:LTUS:765:BUSY.FLNK",16777215,1,"BEND:LTUS:765:BUSY.FLNK") #! Link("BEND:LTUS:765:BUSY.FLNK","BEND:LTUS:765:SELECT") #! Record("BEND:LTUS:765:SELECT",669,508,0,1,"BEND:LTUS:765:SELECT") #! Record("BEND:LTUS:765:FUNC",940,120,0,0,"BEND:LTUS:765:FUNC") #! Field("BEND:LTUS:765:FUNC.OUT",16777215,0,"BEND:LTUS:765:FUNC.OUT") #! Link("BEND:LTUS:765:FUNC.OUT","BEND:LTUS:765:CTRL.VAL") #! Record("BEND:LTUS:765:ABORT",193,41,0,0,"BEND:LTUS:765:ABORT") #! Record("BEND:LTUS:765:CTRLSTATE",369,34,0,0,"BEND:LTUS:765: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,"BEND:LTUS:765:SELECT is used for Multi-device selection.\nIt is enabled when associated BEND:LTUS:765:CTRL is \"0\" (DONE).\nIt is disabled when associated BEND:LTUS:765: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,"BEND:LTUS:765: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, "BEND:LTUS:765:BCTRL_INIT") { field(DESC, "Process BCTRL on boot") field(PINI, "YES") field(CALC, "A=3?1:0") field(INPA, "BEND:LTUS:765:BCTRL.SEVR") field(OUT, "BEND:LTUS:765: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, "BEND:LTUS:765:BACT") { field(DESC, "Actual B") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "BEND:LTUS:765:BACT") field(INPB, "BEND:LTUS:765:POLYCOEF") field(INPC, "BEND:LTUS:765:POLYCOEF.A") field(INPD, "BEND:LTUS:765:POLYCOEF.B") field(INPE, "BEND:LTUS:765:IACTCALC MS") field(INPF, "BEND:LTUS:765:BDELTAS PP") field(INPG, "100") field(EGU, "kG-m") field(HOPR, "2.7915") field(LOPR, "-2.7628") field(HIHI, "2.7915") field(LOLO, "-2.7628") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "2.7915") field(LOW, "-2.7628") field(FLNK, "BEND:LTUS:765: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, "BEND:LTUS:765:BDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntPhyDeltas") field(EGU, "kG-m") field(HOPR, "1") field(PREC, "7") field(BRSV, "INVALID") field(INPA, "BEND:LTUS:765:BDES") field(INPB, "BEND:LTUS:765:TRIMBTOL") field(INPC, "BEND:LTUS:765:TRIMBTOLR") field(INPD, "BEND:LTUS:765:CHCKBTOL") field(INPE, "BEND:LTUS:765:CHCKBTOLR") field(F, "2.0") field(INPG, "30") field(INPH, "BEND:LTUS:765:BACT.VAL") # # MPS absolute and relative tolerances field(INPP, "BEND:LTUS:765:MPSBTOL") field(INPQ, "BEND:LTUS:765:MPSBTOLR") field(FLNK, "BEND:LTUS:765:BCONLIMITS") info(autosaveFields,"F") } # This record is processed by BDELTAS record(aSub, "BEND:LTUS:765:BCONLIMITS") { field(DESC, "Config B-field Limits") field(INAM, "mgntInit") field(SNAM, "mgntBCONLimits") field(INPA, "BEND:LTUS:765:BDES") field(INPB, "BEND:LTUS:765:BDELTAS.I") field(INPG, "BEND:LTUS:765:DEBUG.RVAL") field(FTA, "DOUBLE") field(FTB, "DOUBLE") field(FTG, "ULONG") field(OUTA, "BEND:LTUS:765:BCON.HIGH") field(OUTB, "BEND:LTUS:765:BCON.LOW") field(OUTC, "BEND:LTUS:765:BCON.HIHI") field(OUTD, "BEND:LTUS:765:BCON.LOLO PP") field(FTVA, "DOUBLE") field(FTVB, "DOUBLE") field(FTVC, "DOUBLE") field(FTVD, "DOUBLE") field(BRSV, "INVALID") field(FLNK, "BEND:LTUS:765:IDELTAS") } # The following PV is processed by :BACT # which is processed by :BACT # record(fanout, "BEND:LTUS:765:BACTFO") { field(DESC, "BACT processing") field(SELM, "All") field(LNK1, "BEND:LTUS:765:BDIFF") field(LNK2, "BEND:LTUS:765:BADIFF") field(LNK3, "BEND:LTUS:765:BRATIO") field(LNK4, "BEND:LTUS:765:MPSLIMITS") field(LNK5, "BEND:LTUS:765:I2BSTATUS") field(LNK6, "BEND:LTUS:765:IACTFO.PROC") } record(calc, "BEND:LTUS:765:BDIFF") { field(DESC, "BDES-BACT") field(CALC, "A-B") field(INPA, "BEND:LTUS:765:BDES") field(INPB, "BEND:LTUS:765:BACT") field(EGU, "kG-m") field(PREC, "7") } record(calc, "BEND:LTUS:765:BADIFF") { field(DESC, "Absolute BDES-BACT") field(INPA, "BEND:LTUS:765:BDIFF") field(EGU, "kG-m") field(PREC, "7") field(CALC, "A<0?ABS(A):A") } record(calc, "BEND:LTUS:765:BRATIO") { field(DESC, "BACT Error") field(CALC, "B?A/B:0") field(INPA, "BEND:LTUS:765:BDIFF") field(INPB, "BEND:LTUS:765:BDES.HOPR") field(EGU, "kG-m") field(PREC, "7") } record(mbbi, "BEND:LTUS:765: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, "BEND:LTUS:765:BACT.J") } # Note: for a string slave set the MONFL # macro to the following: # MONFL=:IMONCALC MS record(sub, "BEND:LTUS:765:BMON") { field(DESC, "Second Transductor") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "BEND:LTUS:765:BMON") field(INPB, "BEND:LTUS:765:POLYCOEF") field(INPC, "BEND:LTUS:765:POLYCOEF.A") field(INPD, "BEND:LTUS:765:POLYCOEF.B") field(INPE, "BEND:LTUS:765:IMONCALC MS") field(INPF, "BEND:LTUS:765:BDELTAS.VAL") field(INPG, "100") field(EGU, "kG-m") field(HOPR, "2.7915") field(LOPR, "-2.7628") field(HIHI, "2.7915") field(LOLO, "-2.7628") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "2.7915") field(LOW, "-2.7628") } # 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=BEND:LTUS:764:BDES CP record(ao, "BEND:LTUS:765:BDES") { field(DESC, "Desired B-Field") field(PINI, "NO") field(DRVH, "2.7915") field(DRVL, "-2.7628") field(HOPR, "2.7915") field(LOPR, "-2.7628") field(PREC, "7") field(EGU, "kG-m") field(MDEL, "-1") field(OMSL, "closed_loop") field(DOL, "BEND:LTUS:765:IDES2BDES") field(OUT, "BEND:LTUS:765:B2IDES PP") info(autosaveFields,"VAL") } record(sub, "BEND:LTUS:765:B2IDES") { field(DESC, "Convert Desired B-Field to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "BEND:LTUS:765:POLYCOEF") field(INPC, "BEND:LTUS:765:POLYCOEF.A") field(INPD, "BEND:LTUS:765:POLYCOEF.B") field(PREC, "7") field(EGU, "kG-m") field(HOPR, "2.7915") field(LOPR, "-2.7628") field(MDEL, "-1") field(INPE, "BEND:LTUS:765:BDES.DRVH") field(INPF, "BEND:LTUS:765:BDES.DRVL") field(BRSV, "INVALID") field(FLNK, "BEND:LTUS:765:IDES") } record(sub, "BEND:LTUS:765:BNOM") { field(DESC, "Nominal Field") field(PINI, "YES") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "BEND:LTUS:765:POLYCOEF") field(INPC, "BEND:LTUS:765:POLYCOEF.A") field(INPD, "BEND:LTUS:765:POLYCOEF.B") field(INPE, "BEND:LTUS:765:BDES.DRVH") field(INPF, "BEND:LTUS:765:BDES.DRVL") field(EGU, "kG-m") field(HOPR, "2.7915") field(LOPR, "-2.7628") field(PREC, "7") field(VAL, "0.0") field(FLNK, "BEND:LTUS:765:INOM") } record(sub, "BEND:LTUS:765:BACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "BEND:LTUS:765:BDES.VAL") field(INPB, "BEND:LTUS:765:BDES.DRVH") field(INPC, "BEND:LTUS:765:BDES.DRVL") field(INPD, "BEND:LTUS:765:BDELTAS.I") field(INPE, "BEND:LTUS:765:BDELTAS.J") field(INPG, "BEND:LTUS:765:STATE") field(INPH, "BEND:LTUS:765:HSTA") field(EGU, "kG-m") field(HOPR, "2.7915") field(LOPR, "-2.7628") field(PREC, "7") field(BRSV, "INVALID") } record(sub, "BEND:LTUS:765:BMONLIMITS") { field(DESC, "MON Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "BEND:LTUS:765:BDES.VAL") field(INPB, "BEND:LTUS:765:BDES.DRVH") field(INPC, "BEND:LTUS:765:BDES.DRVL") field(INPD, "BEND:LTUS:765:BDELTAS.K") field(INPE, "BEND:LTUS:765:BDELTAS.L") field(INPG, "BEND:LTUS:765:STATE") field(INPH, "BEND:LTUS:765:HSTA") field(EGU, "kG-m") field(HOPR, "2.7915") field(LOPR, "-2.7628") field(PREC, "7") field(BRSV, "INVALID") } record(seq, "BEND:LTUS:765:BLIMITS") { field(DESC, "ACT Limits") field(PREC, "7") field(DOL1, "BEND:LTUS:765:BLIMITS") field(LNK1, "BEND:LTUS:765:BACTLIMITS.F PP") field(DOL2, "BEND:LTUS:765:BACTLIMITS.I") field(LNK2, "BEND:LTUS:765:BACT.HIGH") field(DOL3, "BEND:LTUS:765:BACTLIMITS.J") field(LNK3, "BEND:LTUS:765:BACT.LOW") field(DOL4, "BEND:LTUS:765:BACTLIMITS.K") field(LNK4, "BEND:LTUS:765:BACT.HIHI") field(DOL5, "BEND:LTUS:765:BACTLIMITS.L") field(LNK5, "BEND:LTUS:765:BACT.LOLO") field(DOL6, "BEND:LTUS:765:BLIMITS") field(LNK6, "BEND:LTUS:765:BMONLIMITS.F PP") field(DOL7, "BEND:LTUS:765:BMONLIMITS.I") field(LNK7, "BEND:LTUS:765:BMON.HIGH") field(DOL8, "BEND:LTUS:765:BMONLIMITS.J") field(LNK8, "BEND:LTUS:765:BMON.LOW") field(DOL9, "BEND:LTUS:765:BMONLIMITS.K") field(LNK9, "BEND:LTUS:765:BMON.HIHI") field(DOLA, "BEND:LTUS:765:BMONLIMITS.L") field(LNKA, "BEND:LTUS:765:BMON.LOLO") field(FLNK, "BEND:LTUS:765:ILIMITS") field(SCAN, "5 second") } record(ao, "BEND:LTUS:765:BCTRL") { field(DESC, "B-Perturb") field(PREC, "7") field(EGU, "kG-m") field(DRVH, "2.7915") field(DRVL, "-2.7628") field(HOPR, "2.7915") field(LOPR, "-2.7628") # 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, "BEND:LTUS:765: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, "BEND:LTUS:765:BCTRLGO") { field(DESC, "Update DES and perturb") field(PREC, "7") # Disable BACT limits field(DOL1, "1") field(LNK1, "BEND:LTUS:765:BLIMITS.VAL") # Update BDES with the BCTRL (slider) value field(DOL2, "BEND:LTUS:765:BCTRL.VAL") field(LNK2, "BEND:LTUS:765:BDES PP") field(DOL3, "1") field(LNK3, "BEND:LTUS:765:IDIRECT.PROC PP") field(DOL4, "1") field(LNK4, "BEND:LTUS:765:CHECKSTDZLOST.PROC PP") field(DOL5, "BEND:LTUS:765:BCTRL.VAL") field(LNK5, "BEND:LTUS:765:BCTRLSUB PP") # Re-enable BACT limits field(DOL6, "0") field(LNK6, "BEND:LTUS:765:BLIMITS.VAL") } # Convert B-field to Current and output to ISETPT record(sub, "BEND:LTUS:765:BCTRLSUB") { field(DESC, "Feedback") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "BEND:LTUS:765:POLYCOEF") field(INPC, "BEND:LTUS:765:POLYCOEF.A") field(INPD, "BEND:LTUS:765:POLYCOEF.B") field(INPE, "BEND:LTUS:765:BDES.DRVH") field(INPF, "BEND:LTUS:765:BDES.DRVL") field(PREC, "7") field(EGU, "kG-m") field(HOPR, "2.7915") field(LOPR, "-2.7628") field(MDEL, "-1") field(BRSV, "INVALID") field(FLNK, "BEND:LTUS:765:ISETPT") } record(ao, "BEND:LTUS:765:BDESPREVTRIM") { field(DESC, "trim bdes for undo") field(DTYP, "Soft Channel") field(DRVH, "2.7915") field(DRVL, "-2.7628") field(EGU, "kG-m") field(HOPR, "2.7915") field(LOPR, "-2.7628") field(PREC, "7") field(PINI, "YES") info(autosaveFields,"VAL") } record(stringin, "BEND:LTUS:765:MADNAME") { field(DESC, "MAD deck nomenclature") field(PINI, "YES") field(VAL, "BCXXL3") } record(ai, "BEND:LTUS:765: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, "3509.010435") } record(ao, "BEND:LTUS:765:BMAX") { field(DESC, "Max B-Field") field(DTYP, "Soft Channel") field(DRVH, "2.7915") field(DRVL, "-2.7628") field(EGU, "kG-m") field(HOPR, "2.7915") field(LOPR, "-2.7628") field(PREC, "7") field(PINI, "YES") field(VAL, "2.7915") field(FLNK, "BEND:LTUS:765:BSTEP") } record(ao, "BEND:LTUS:765:BMIN") { field(DESC, "Min B-Field") field(DTYP, "Soft Channel") field(DRVH, "2.7915") field(DRVL, "-2.7628") field(EGU, "kG-m") field(HOPR, "2.7915") field(LOPR, "-2.7628") field(PREC, "7") field(PINI, "YES") field(VAL, "-2.7628") field(FLNK, "BEND:LTUS:765:BSTEP") } record(ao, "BEND:LTUS:765:BDESSAVE") { field(DESC, "bdes for save/load") field(DTYP, "Soft Channel") field(DRVH, "2.7915") field(DRVL, "-2.7628") field(EGU, "kG-m") field(HOPR, "2.7915") field(LOPR, "-2.7628") field(PINI, "YES") field(PREC, "7") } # This record is processed by BEND:LTUS:765: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, "BEND:LTUS:765:BCON") { field(DESC, "Config B-Field ") field(DTYP, "Soft Channel") field(PREC, "7") field(EGU, "kG-m") field(HOPR, "2.7915") field(LOPR, "-2.7628") field(DRVH, "2.7915") field(DRVL, "-2.7628") # 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 , "BEND:LTUS:765:ICON2BCON") field(OMSL, "closed_loop") field(OUT, "BEND:LTUS:765:B2ICON PP") info(autosaveFields,"VAL") } record(sub, "BEND:LTUS:765:B2ICON") { field(DESC, "Convert Desired ICon to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "BEND:LTUS:765:POLYCOEF") field(INPC, "BEND:LTUS:765:POLYCOEF.A") field(INPD, "BEND:LTUS:765:POLYCOEF.B") field(PREC, "7") field(EGU, "kG-m") field(HOPR, "2.7915") field(LOPR, "-2.7628") field(MDEL, "-1") field(INPE, "BEND:LTUS:765:BCON.DRVH") field(INPF, "BEND:LTUS:765:BCON.DRVL") field(BRSV, "INVALID") field(FLNK, "BEND:LTUS:765: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, "BEND:LTUS:765:BSTEP") { field(DESC, "B-Field step size") field(CALC, "(C==3)||(D==3)?0:ABS(A-B)*0.005") field(INPA, "BEND:LTUS:765:BMAX") field(INPB, "BEND:LTUS:765:BMIN") field(INPC, "BEND:LTUS:765:BMIN.SEVR") field(INPD, "BEND:LTUS:765:BMAX.SEVR") field(EGU, "kG-m") 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,"BEND:LTUS:765:BCTRLDISABLECALC") { field(DESC, "Calc for disabling BCTRL") field(ASG, "Internal") field(CALC, "A?2:1") field(INPA, "BEND:LTUS:765:ONLINE CP") field(OUT, "BEND:LTUS:765:BCTRLDISABLEFOUT PP") } record(fanout, "BEND:LTUS:765:BCTRLDISABLEFOUT") { field(DESC, "Disable BCTRL fanout") field(SELM, "Specified") field(SELL, "BEND:LTUS:765:BCTRLDISABLECALC") field(LNK1, "BEND:LTUS:765:BCTRLDISABLE") field(LNK2, "BEND:LTUS:765:BCTRLENABLE") } record(stringout, "BEND:LTUS:765:BCTRLDISABLE") { field(DESC, "Disable BCTRL") field(DTYP, "Soft Channel") field(OUT, "BEND:LTUS:765:BCTRL.ASG") field(VAL, "NOWRITE") field(FLNK, "BEND:LTUS:765:BCTRLDISV_UPDATE") } record(stringout, "BEND:LTUS:765:BCTRLENABLE") { field(DESC, "Enable BCTRL") field(DTYP, "Soft Channel") field(OUT, "BEND:LTUS:765:BCTRL.ASG") field(VAL, "") field(FLNK, "BEND:LTUS:765:BCTRLDISV_UPDATE") } record(calcout, "BEND:LTUS:765:BCTRLDISV_UPDATE") { field(DESC, "Calc for updating BCTRL.DISV") field(ASG, "Internal") field(CALC, "A") field(INPA, "BEND:LTUS:765:ONLINE") field(OUT, "BEND:LTUS:765: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,"BEND:LTUS:765:BACT and MON\n are processed via links from \n BEND:LTUS:765:IACT (device raw value readback 1)\n and\n BEND:LTUS:765: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 BEND:LTUS:765:POLYCOEF\nC = First polynomial coefficient (offset if linear)\nD = Second polynomial coefficient (slope if linear)\nE = BEND:LTUS:765: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,"BEND:LTUS:765:BDES\n is processed when set by CA users or \n BEND:LTUS:765: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,"BEND:LTUS:765: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 BEND:LTUS:765: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 (BEND:LTUS:765: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,"BEND:LTUS:765:B*LIMITS and BEND:LTUS:765:BLIMITS:\n Calculate alarm and warning limits based on \n deltas from BEND:LTUS:765: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,"BEND:LTUS:765: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,"BEND:LTUS:765: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, "BEND:LTUS:765: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, "BEND:LTUS:765:MPSBTOL") { field(DESC, "Absolute mps tol") field(EGU, "kG-m") field(PREC, "2") field(CALC, "ABS(A)*0.02") field(INPA, "BEND:LTUS:765:BMAX") field(PINI, "YES") } # # 21-Aug-2013: K. Luchini # Set channel access security so that users # cannot easily change values. record(ao, "BEND:LTUS:765:MPSBMAX") { field(DESC, "MPS Max B-field") field(EGU, "kG-m") field(PREC, "7") field(DRVH, "2.7915") field(DRVL, "-2.7628") field(PINI, "YES") field(VAL, "2.7915") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:765:MPSBMIN") { field(DESC, "MPS Min B-field") field(EGU, "kG-m") field(PREC, "7") field(DRVH, "2.7915") field(DRVL, "-2.7628") field(PINI, "YES") field(VAL, "-2.7628") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:765:MPSBLLIM") { field(DESC, "MPS Low Limit B-field") field(EGU, "kG-m") field(PREC, "7") field(DRVH, "2.7915") field(DRVL, "-2.7628") field(PINI, "YES") field(VAL, "-2.7628") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:765:MPSBLLIM2") { field(DESC, "MPS Low Limit #2 B-field") field(EGU, "kG-m") field(PREC, "7") field(DRVH, "2.7915") field(DRVL, "-2.7628") field(PINI, "YES") field(VAL, "-2.7628") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } # Set the default to Std record(mbbo, "BEND:LTUS:765: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, "BEND:LTUS:765:MPSLIMITS.E PP") } record(aSub, "BEND:LTUS:765: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, "BEND:LTUS:765:MPS.RVAL") field(INPB, "BEND:LTUS:765:BADIFF") field(INPC, "BEND:LTUS:765:BDELTAS.N") field(INPD, "BEND:LTUS:765:BACT") field(INPE, "BEND:LTUS:765:MPSBITMASK.RVAL") field(INPF, "BEND:LTUS:765:MPSBLLIM") field(INPG, "BEND:LTUS:765:MPSBMIN") field(INPH, "BEND:LTUS:765:MPSBMAX") field(INPI, "BEND:LTUS:765: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, "BEND:LTUS:765:INTOL.RVAL PP") field(OUTB, "BEND:LTUS:765:INTOL_BMIN.RVAL PP") field(OUTC, "BEND:LTUS:765:INTOL_BRANGE.RVAL PP") field(OUTD, "BEND:LTUS:765: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, "BEND:LTUS:765:INTOL") { field(DESC, "BACT within MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "BEND:LTUS:765:MPSLIMITS.VALA") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "BEND:LTUS:765:INTOL_BMIN") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "BEND:LTUS:765:MPSLIMITS.VALB") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "BEND:LTUS:765:INTOL_BMIN2") { field(DESC, "MPS tol #2") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "BEND:LTUS:765:MPSLIMITS.VALD") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "BEND:LTUS:765:INTOL_BRANGE") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "BEND:LTUS:765: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, "BEND:LTUS:765:CHCKITOL") { field(DESC, "Absolute Check I Tolerance") field(EGU, "A") field(FLNK, "BEND:LTUS:765:TRIMITOL") field(CALC, "ABS(A*B)") field(INPA, "BEND:LTUS:765:CHCKBTOL") field(INPB, "BEND:LTUS:765:POLYCOEF.B") field(PREC, "9") } record(calc, "BEND:LTUS:765:TRIMBTOL") { field(EGU, "kG-m") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(DESC, "Absolute Trim Tolerance") field(CALC, "ABS(A)/2") field(INPA, "BEND:LTUS:765:CHCKBTOL") field(FLNK, "BEND:LTUS:765:CHCKITOL") } record(calc, "BEND:LTUS:765:CHCKBTOL") { field(DESC, "Check absolute tolerance") field(EGU, "A") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(FLNK, "BEND:LTUS:765:TRIMBTOL") field(CALC, "MAX(ABS(A),ABS(C))*(B/1000000)") field(INPA, "BEND:LTUS:765:BDES.HOPR") field(INPB, "BEND:LTUS:765:STABILITY") field(INPC, "BEND:LTUS:765:BDES.LOPR") } record(longout, "BEND:LTUS:765: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, "BEND:LTUS:765:CHCKBTOL") } record(calc, "BEND:LTUS:765:TRIMITOL") { field(DESC, "Absolute Trim I Tolerance") field(EGU, "kG-m") field(CALC, "ABS(A*B)") field(INPA, "BEND:LTUS:765:POLYCOEF.B") field(INPB, "BEND:LTUS:765:TRIMBTOL") field(PREC, "9") } record(ai, "BEND:LTUS:765:TRIMBTOLR") { field(DESC, "Relative trim tol") field(PREC, "4") field(EGU, "%") field(HOPR, "1.0") field(LOPR, "0.0") field(PINI, "YES") } record(ai, "BEND:LTUS:765: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, "BEND:LTUS:765:FBCKFCOM") { field(ZNAM, "CA") field(ONAM, "FCOM") field(DESC, "CA Mode") field(PINI, "YES") field(SDIS, "0") } record(bo, "BEND:LTUS:765:PAU") { field(ZNAM, "NotConfigured") field(ONAM, "Configured") field(DESC, "PAU Present") field(PINI, "YES") field(SDIS, "0") field(FLNK, "BEND:LTUS:765:PAUGO") } record(fanout, "BEND:LTUS:765:PAUGO") { field(DESC, "PAU control") field(LNK1, "BEND:LTUS:765:PAUSTOP") field(LNK2, "BEND:LTUS:765: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, "BEND:LTUS:765:PAUSTART") { field(DESC, "Setup for PAU On") field(SDIS, "BEND:LTUS:765: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, "BEND:LTUS:765:PAUSTOP") { field(DESC, "Setup for PAU Off") field(SDIS, "BEND:LTUS:765: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, "BEND:LTUS:765:MCORDEVNAME") { field(DESC, "PS device name") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, "BEND:LTUS:764:") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "BEND:LTUS:765: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, "BEND:LTUS:765:PSTYPE.RVAL") field(INPC, "BEND:LTUS:765:TURNEDOFF.RVAL") field(INPD, "BEND:LTUS:765:CONFIG.RVAL") field(INPE, "BEND:LTUS:765:PSCATEGORY.RVAL") field(INPF, "BEND:LTUS:765:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "BEND:LTUS:765:AUTOCTRL.RVAL") field(INPJ, "BEND:LTUS:765:OUTOFSERVICE.RVAL") field(INPL, "BEND:LTUS:765:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "BEND:LTUS:765:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "BEND:LTUS:765:PAU") field(INPP, "BEND:LTUS:765:CALBDISABLE.RVAL") field(INPQ, "BEND:LTUS:765:PTRBDISABLE.RVAL") field(INPR, "BEND:LTUS:765:TRIMDISABLE.RVAL") field(INPS, "BEND:LTUS:765:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "BEND:LTUS:765:FBCK") field(INPU, "BEND:LTUS:765:TRIMTYPE.RVAL") field(INPV, "BEND:LTUS:765:STDZDIRECT.RVAL") field(INPW, "BEND:LTUS:765:DEGAUSENABLE.RVAL") field(FLNK, "BEND:LTUS:765:HSTA") } record(longin, "BEND:LTUS:765:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "BEND:LTUS:765:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "BEND:LTUS:765: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, "BEND:LTUS:765: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, "BEND:LTUS:765: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, "BEND:LTUS:765: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, "BEND:LTUS:765: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, "BEND:LTUS:765: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 BEND:LTUS:765:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses BEND:LTUS:765:FBCK. # This PV should be replaced by BEND:LTUS:765: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, "BEND:LTUS:765: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, "BEND:LTUS:765: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, "BEND:LTUS:765: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, "BEND:LTUS:764:OUTOFSERVICE CPP NMS") field(OMSL, "closed_loop") field(FLNK, "BEND:LTUS:765:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"BEND:LTUS:765:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "BEND:LTUS:765:OUTOFSERVICE NPP NMS") field(OUT, "BEND:LTUS:765:ONLINE PP") } record(bo, "BEND:LTUS:765:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "BEND:LTUS:765: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, "BEND:LTUS:765: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, "BEND:LTUS:765: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, "BEND:LTUS:765: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, "BEND:LTUS:765: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, "BEND:LTUS:765: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, "BEND:LTUS:765: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, "BEND:LTUS:765: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, "BEND:LTUS:765: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, "BEND:LTUS:765: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, "BEND:LTUS:765: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, "BEND:LTUS:765:TRIMTYPE") } record(stringout, "BEND:LTUS:765:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "BEND:LTUS:764:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "BEND:LTUS:765:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "BEND:LTUS:765:STATE.RVAL") field(INPB, "BEND:LTUS:765:INTLKSUMY.RVAL") field(OUT, "BEND:LTUS:765:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "BEND:LTUS:765: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, "BEND:LTUS:765:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "BEND:LTUS:765:STATE.RVAL") field(INPB, "BEND:LTUS:765:INTLKSUMY.RVAL") field(OUT, "BEND:LTUS:765:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "BEND:LTUS:765:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "BEND:LTUS:765:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "BEND:LTUS:765: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, "BEND:LTUS:765: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, "BEND:LTUS:765: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, "BEND:LTUS:765: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,"BEND:LTUS:765: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("BEND:LTUS:765:TURNEDOFF",3140,1907,0,1,"BEND:LTUS:765:TURNEDOFF") #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "BEND:LTUS:765:STATSUB") { field(DESC, "Build STATus ") field(INAM, "mgntInit") field(SNAM, "mgntSlcStat") field(INPA, "BEND:LTUS:765:BACT.STAT") field(INPB, "BEND:LTUS:765:BDES.STAT") field(INPC, "BEND:LTUS:765: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, "BEND:LTUS:765:BACT.SEVR") field(INPH, "BEND:LTUS:765:BDES.SEVR") field(INPI, "BEND:LTUS:765: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, "BEND:LTUS:765:STATE.RVAL") field(INPN, "BEND:LTUS:765:STDZOK") field(INPO, "BEND:LTUS:765:CALBOK") field(INPP, "BEND:LTUS:765:OUTOFSERVICE.RVAL") field(INPQ, "BEND:LTUS:765:CONFIG.RVAL") field(INPR, "BEND:LTUS:765:HSTA") field(INPS, "BEND:LTUS:765:CTRL.RVAL") field(INPT, "BEND:LTUS:765:DEGAUSOK") field(INPV, "BEND:LTUS:765: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, "BEND:LTUS:765:STAT") } record(longout, "BEND:LTUS:765:STAT") { field(DESC, "STAT sent to SLC") field(SCAN, "Passive") field(FLNK, "BEND:LTUS:765:STATCTRLSUB") field(DOL, "BEND:LTUS:765:STATSUB.VAL") field(OMSL, "closed_loop") } record(sSub, "BEND:LTUS:765:STATCTRLSUB") { field(DESC, "Decode SLC STAT into mbbo") field(INAM, "mgntInit") field(SNAM, "mgntStatDecode") field(INPA, "BEND:LTUS:765:STAT") field(INPB, "BEND:LTUS:765:HSTA") field(INPD, "BEND:LTUS:765:ONOFFCTRL.RVAL") field(FLNK, "BEND:LTUS:765:STATMSG") } record(mbbo, "BEND:LTUS:765: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, "BEND:LTUS:765:UNAVAILGO") field(DOL, "BEND:LTUS:765:STATCTRLSUB.W") } record(seq, "BEND:LTUS:765:UNAVAILGO") { field(DESC, "Process UNAVAIL") field(DOL1, "BEND:LTUS:765:STATSUB.U") field(LNK1, "BEND:LTUS:765:UNAVAIL PP") } record(stringout, "BEND:LTUS:765:SNLSTATMSG") { field(DTYP, "Soft Channel") } #! TextBox(TB0,820,1000,1200,1220,0,"Dialog",12,1,16777215,"BEND:LTUS:765:STATUSSUB - future\nOverall device status - takes input from action snls, record sevrs, master snl(s) and outputs final status\n\nInputs:\nA - BEND:LTUS:765:CTRLSTATUS - snl status\nB - MGNT:CTRLSTATUS - master list status\nC\nD - BEND:LTUS:765: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,"BEND:LTUS:765STATSUB\nformat control bo's into slc STAT\n\nInputs:\nA - BEND:LTUS:765:STATUS\nC - BEND:LTUS:765:ON\nD - BEND:LTUS:765:STDZOK\nE - BEND:LTUS:765:CALBOK\nF - BEND:LTUS:765:BACTDRIFT (future)\nG -\nH- BEND:LTUS:765:DACSTATUS\nI -BEND:LTUS:765:ADCSTATUS\nJ - BEND:LTUS:765:BACTSTATUS\nK - BEND:LTUS:765:BDESSTATUS\nL - BEND:LTUS:765:RIPLSTATUS\n\nOutput:\nP - BEND:LTUS:765: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, "BEND:LTUS:765: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, "BEND:LTUS:765: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, "BEND:LTUS:765: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, "BEND:LTUS:765: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, "BEND:LTUS:765:IDESTOTAL"){ field(DESC, "Calc total current") field(CALC, "A+B") field(EGU, "kG-m") field(PREC, "7") field(INPA, "BEND:LTUS:764:IDES CP NMS") field(INPB, "BTRM:LTUS:765:BDES CP NMS") field(OUT, "BEND:LTUS:765:IDES2BDES.E PP") } record(sub, "BEND:LTUS:765:IDES2BDES") { field(DESC, "Cal BDES") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "BEND:LTUS:765:IDES2BDES") field(INPB, "BEND:LTUS:765:POLYCOEF") field(INPC, "BEND:LTUS:765:POLYCOEF.A") field(INPD, "BEND:LTUS:765:POLYCOEF.B") field(INPE, "BEND:LTUS:765:IDESTOTAL MS") field(INPF, "BEND:LTUS:764:BDELTAS PP") field(INPG, "100") field(EGU, "kG-m") field(HOPR, "2.7915") field(LOPR, "-2.7628") field(HIHI, "2.7915") field(LOLO, "-2.7628") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "2.7915") field(LOW, "-2.7628") field(FLNK, "BEND:LTUS:765: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, "BEND:LTUS:765:IACTCALC"){ field(DESC, "Calc total act current") field(CALC, "A+B") field(EGU, "kG-m") field(PREC, "7") field(INPA, "BEND:LTUS:765:IACT CP NMS") field(INPB, "BTRM:LTUS:765:BACT") field(OUT, "BEND:LTUS:765: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, "BEND:LTUS:765:IMONCALC"){ field(DESC, "Calc total mon current") field(CALC, "A+B") field(EGU, "kG-m") field(PREC, "7") field(INPA, "BEND:LTUS:765:IMON CP NMS") field(INPB, "BTRM:LTUS:765:BMON") field(OUT, "BEND:LTUS:765: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, "BEND:LTUS:765:ICONTOTAL"){ field(DESC, "Calc total current") field(CALC, "A+B") field(EGU, "kG-m") field(PREC, "7") field(INPA, "BEND:LTUS:764:ICON CP NMS") field(INPB, "BTRM:LTUS:765:BCON CP NMS") field(OUT, "BEND:LTUS:765:ICON2BCON.E PP") } record(sub, "BEND:LTUS:765:ICON2BCON") { field(DESC, "Cal BCON") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "BEND:LTUS:765:ICON2BCON") field(INPB, "BEND:LTUS:765:POLYCOEF") field(INPC, "BEND:LTUS:765:POLYCOEF.A") field(INPD, "BEND:LTUS:765:POLYCOEF.B") field(INPE, "BEND:LTUS:765:ICONTOTAL MS") field(INPF, "BEND:LTUS:764:BDELTAS PP") field(INPG, "100") field(EGU, "kG-m") field(HOPR, "2.7915") field(LOPR, "-2.7628") field(HIHI, "2.7915") field(LOLO, "-2.7628") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "2.7915") field(LOW, "-2.7628") field(FLNK, "BEND:LTUS:765:BCON") } #! 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, "BEND:LTUS:766:IACT") { field(DESC, "Current") field(INP, "BEND:LTUS:764:IACT CP NMS") field(EGU, "A") field(HOPR, "17.5") field(LOPR, "-17.5") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "BEND:LTUS:766:IACTCALC") info(autosaveFields,"HYST") } record(bi, "BEND:LTUS:766:STATE") { field(DESC, "PS On/Off Status") field(DTYP, "Raw Soft Channel") field(INP, "BEND:LTUS:764:STATE CP MS") field(ZSV, "MAJOR") field(ZNAM, "OFF") field(ONAM, "ON") } record(ao, "BEND:LTUS:766:IDES") { field(DESC, "Desired Current") field(PREC, "3") field(EGU, "A") field(HOPR, "17.5") field(LOPR, "-17.5") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(MDEL, "-1") field(HIHI, "17.5") field(LOLO, "-17.5") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "BEND:LTUS:766:BDELTAS") field(DRVH, "17.5") field(DRVL, "-17.5") field(DOL, "BEND:LTUS:766: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, "BEND:LTUS:766:ICTRL PP") } # This record is processed by BEND:LTUS:766:ICON") # Note: we are not setting alarms here. record(ao, "BEND:LTUS:766:ICON") { field(DESC, "Config I") field(DTYP, "Soft Channel") field(PREC, "3") field(HOPR, "17.5") field(LOPR, "-17.5") field(DRVH, "17.5") field(DRVL, "-17.5") field(DOL, "BEND:LTUS:766:B2ICON.K") field(OMSL, "closed_loop") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:766:INOM") { field(DESC, "Nominal Current") field(DOL, "BEND:LTUS:766:BNOM.K") field(OMSL, "closed_loop") field(PREC, "3") field(EGU, "A") field(DRVH, "17.5") field(DRVL, "-17.5") field(HOPR, "17.5") field(LOPR, "-17.5") } record(ao, "BEND:LTUS:766:ICTRL") { field(DESC, "Set Current") field(PREC, "3") field(EGU, "A") field(HOPR, "17.5") field(LOPR, "-17.5") field(DRVH, "17.5") field(DRVL, "-17.5") field(MDEL, "-1") field(FLNK, "BEND:LTUS:766:ICTRLGO") field(OMSL, "supervisory") info(autosavefields,"VAL") } record(seq, "BEND:LTUS:766:ICTRLGO") { field(DESC, "Process Current Setpoint") field(PREC, "3") # Set ISETPT to supervisory field(DOL1, "0") field(LNK1, "BEND:LTUS:766:ISETPT.OMSL") field(DOL2, "BEND:LTUS:766:ICTRL") field(LNK2, "BEND:LTUS:766:ISETPT PP") # Set ISETPT to closed loop - get data from BCTRLSUB.K field(DOL3, "1") field(LNK3, "BEND:LTUS:766:ISETPT.OMSL") } record(ao, "BEND:LTUS:766:IMAX") { field(DESC, "Max I") field(DTYP, "Soft Channel") field(DRVH, "17.5") field(DRVL, "-17.5") field(EGU, "A") field(HOPR, "17.5") field(LOPR, "-17.5") field(PREC, "3") field(PINI, "YES") field(VAL, "17.5") field(FLNK, "BEND:LTUS:766:IMIN") } record(ao, "BEND:LTUS:766:IMIN") { field(DESC, "Min I") field(DTYP, "Soft Channel") field(DRVH, "17.5") field(DRVL, "-17.5") field(EGU, "A") field(HOPR, "17.5") field(LOPR, "-17.5") field(PREC, "3") field(VAL, "-17.5") field(FLNK, "BEND:LTUS:766:IRANGE") } record(sel, "BEND:LTUS:766:IACTPREVOK") { field(DESC, "Last Good Current") field(EGU, "A") field(HOPR, "17.5") field(LOPR, "-17.5") field(PREC, "3") field(NVL, "BEND:LTUS:766:BACT.SEVR") field(INPA, "BEND:LTUS:766:IACT NPP MS") field(INPB, "BEND:LTUS:766:IACTPREVOK NPP MS") field(INPC, "BEND:LTUS:766:IACTPREVOK NPP MS") field(INPD, "BEND:LTUS:766:IACTPREVOK NPP MS") } record(sub, "BEND:LTUS:766:IACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "BEND:LTUS:766:IDES") field(INPB, "BEND:LTUS:766:ISETPT.DRVH") field(INPC, "BEND:LTUS:766:ISETPT.DRVL") field(INPD, "BEND:LTUS:766:IDELTAS.I") field(INPE, "BEND:LTUS:766:IDELTAS.J") field(INPG, "BEND:LTUS:766:STATE") field(INPH, "BEND:LTUS:766:HSTA") field(EGU, "A") field(HOPR, "17.5") field(LOPR, "-17.5") field(PREC, "3") field(BRSV, "INVALID") } record(sub, "BEND:LTUS:766:IMONLIMITS") { field(DESC, "Aux Current Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "BEND:LTUS:766:IDES") field(INPB, "BEND:LTUS:766:ISETPT.DRVH") field(INPC, "BEND:LTUS:766:ISETPT.DRVL") field(INPD, "BEND:LTUS:766:IDELTAS.K") field(INPE, "BEND:LTUS:766:IDELTAS.L") field(INPG, "BEND:LTUS:766:STATE") field(INPH, "BEND:LTUS:766:HSTA") field(EGU, "A") field(HOPR, "17.5") field(LOPR, "-17.5") field(PREC, "3") field(BRSV, "INVALID") } record(seq, "BEND:LTUS:766:ILIMITS") { field(DESC, "Set ACT and MON Limits") field(PREC, "3") field(DOL1, "BEND:LTUS:766:BLIMITS") field(LNK1, "BEND:LTUS:766:IACTLIMITS.F PP") field(DOL2, "BEND:LTUS:766:IACTLIMITS.I") field(LNK2, "BEND:LTUS:766:IACT.HIGH") field(DOL3, "BEND:LTUS:766:IACTLIMITS.J") field(LNK3, "BEND:LTUS:766:IACT.LOW") field(DOL4, "BEND:LTUS:766:IACTLIMITS.K") field(LNK4, "BEND:LTUS:766:IACT.HIHI") field(DOL5, "BEND:LTUS:766:IACTLIMITS.L") field(LNK5, "BEND:LTUS:766:IACT.LOLO") field(DOL6, "BEND:LTUS:766:BLIMITS") field(LNK6, "BEND:LTUS:766:IMONLIMITS.F PP") field(DOL7, "BEND:LTUS:766:IMONLIMITS.I") field(LNK7, "BEND:LTUS:766:IMON.HIGH") field(DOL8, "BEND:LTUS:766:IMONLIMITS.J") field(LNK8, "BEND:LTUS:766:IMON.LOW") field(DOL9, "BEND:LTUS:766:IMONLIMITS.K") field(LNK9, "BEND:LTUS:766:IMON.HIHI") field(DOLA, "BEND:LTUS:766:IMONLIMITS.L") field(LNKA, "BEND:LTUS:766: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, "BEND:LTUS:766:IDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntRawDeltas") field(INPD, "BEND:LTUS:766:TRIMBTOL") field(INPE, "BEND:LTUS:766:CHCKBTOL") field(INPF, "BEND:LTUS:766:BDELTAS.K") field(INPG, "BEND:LTUS:766:BDELTAS.L") field(INPH, "BEND:LTUS:766: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, "BEND:LTUS:766:STDZITOLR") field(INPC, "BEND:LTUS:766:STDZITOL") field(FLNK, "") } # All ps controllers with on/off control will set the macro ONOF # as follows: # # ONOF = BEND:LTUS:764: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, "BEND:LTUS:766: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 = BEND:LTUS:764:RESET PP # record(bo, "BEND:LTUS:766: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, "BEND:LTUS:766:RAMPSTATE") { field(DESC, "PS Ramp Status") field(DTYP, "Soft Channel") field(DOL, "BEND:LTUS:764: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, "BEND:LTUS:766: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, "BEND:LTUS:766:TRIMRAMPRATE") field(OUT, "") field(FLNK, "BEND:LTUS:766:STDZDLY") } record(ao, "BEND:LTUS:766:ISETPT") { field(DESC, "Current Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(EGU, "A") field(HOPR, "17.5") field(LOPR, "-17.5") field(DRVH, "17.5") field(DRVL, "-17.5") field(MDEL, "-1") field(OUT, "") field(DOL, "BEND:LTUS:766: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, "BEND:LTUS:766:IMON") { field(DESC, "Aux Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(INP, "BEND:LTUS:764:IMON CP NMS") field(EGU, "A") field(HOPR, "17.5") field(LOPR, "-17.5") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "BEND:LTUS:766:IMONCALC") } record(ao, "BEND:LTUS:766:IRIPL") { field(DESC, "Ripple Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(DOL, "BEND:LTUS:764:IRIPL CP NMS") field(OMSL, "closed_loop") field(EGU, "A") field(DRVH, "1.0") field(HOPR, "1.0") field(PREC, "3") field(FLNK, "BEND:LTUS:766:IRIPLOK") } record(sub, "BEND:LTUS:766:IRIPLOK") { field(DESC, "Ripple Current Status") field(INAM, "mgntInit") field(SNAM, "mgntRiplOK") field(INPA, "BEND:LTUS:766:IRIPL.VAL") field(INPB, "BEND:LTUS:766: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, "BEND:LTUS:766:R") { field(DESC, "Resistance") field(EGU, "Ohms") field(PREC, "4") field(PINI, "YES") field(DOL, "BEND:LTUS:764: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, "BEND:LTUS:766:IGND") { field(DESC, "Ground Current") field(EGU, "A") field(PREC, "6") field(PINI, "YES") field(DOL, "BEND:LTUS:764:IGND CP MS") field(OMSL, "closed_loop") } record(bi, "BEND:LTUS:766:INTLKSUMY") { field(DESC, "Interlock Summary") field(INP, "BEND:LTUS:764:INTLKSUMY CP MS") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(ZNAM, "OK") field(ONAM, "FAULT") field(PINI, "NO") } record(mbbo, "BEND:LTUS:766: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, "BEND:LTUS:764:COOLING CP NMS") field(OMSL, "closed_loop") } # The following PV is processed by :BACTFO # which is processed by :BACT record(fanout, "BEND:LTUS:766:IACTFO") { field(DESC, "IACT processing") field(SELM, "All") field(LNK1, "BEND:LTUS:766:IACTPREVOK") field(LNK2, "BEND:LTUS:766:IDIFF") field(LNK3, "BEND:LTUS:766:IADIFF") field(LNK4, "BEND:LTUS:766:IRATIO") field(LNK5, "BEND:LTUS:766:IDIRECT") field(LNK6, "BEND:LTUS:766:IACTPOL_CHECK") } record(calc, "BEND:LTUS:766:IDIFF") { field(DESC, "IDES-IACT") field(CALC, "A-B") field(INPA, "BEND:LTUS:766:IDES") field(INPB, "BEND:LTUS:766:IACT") field(EGU, "A") field(PREC, "9") field(HOPR, "17.5") field(LOPR, "-17.5") } record(calc, "BEND:LTUS:766:IADIFF") { field(DESC, "Absolute IDES-IACT") field(CALC, "A<0?ABS(A):A") field(INPA, "BEND:LTUS:766:IDIFF") field(PREC, "9") } record(calc, "BEND:LTUS:766:IRATIO") { field(DESC, "IDES-IACT/IMAX") field(CALC, "B?A/B:0") field(INPA, "BEND:LTUS:766:IDIFF") field(INPB, "BEND:LTUS:766:IDES.DRVH") field(PREC, "9") } record(calcout, "BEND:LTUS:766:IRANGE") { field(DESC, "Current Range") field(PINI, "YES") field(CALC, "ABS(A-B)") field(INPA, "BEND:LTUS:766:IMIN") field(INPB, "BEND:LTUS:766: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, "BEND:LTUS:766: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, "BEND:LTUS:766:IACT") field(FLNK, "BEND:LTUS:766:IACTPOL") } record(bo, "BEND:LTUS:766:IACTPOL") { field(DESC, "Actual I Polarity") field(DTYP, "Raw Soft Channel") field(DOL, "BEND:LTUS:766: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,"BEND:LTUS:766:I*LIMITS:\n Calculate alarm and warning limits based on \n deltas from BEND:LTUS:766:IDELTAS and the\n BEND:LTUS:766: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,"BEND:LTUS:766:IACT: \n Get copy of BEND:LTUS:766:I. \n",null) #! TextBox(TB12,1280,3100,1760,3200,0,"Dialog",12,1,16777215,"BEND:LTUS:766: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,"BEND:LTUS:766:IDES:\n Contains raw value calculated by \nBEND:LTUS:766: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 \nBEND:LTUS:766:BDELTAS.\n",null) #! TextBox(TB10,56,1940,316,2340,0,"Dialog",12,1,16777215,"BEND:LTUS:766: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 BEND:LTUS:766: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 BEND:LTUS:766: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,"BEND:LTUS:766:ISETPT:\n Sets the hardware. When fast feedback is set on, this record is\n set to closed loop mode by BEND:LTUS:766:FBCKSTART sequence. When \n the loop is closed, this record takes input calculated by \n BFBCK only. When fast feedback is set off, BEND:LTUS:766:FBCKSTOP \n will set it back to supervisory so that the value can be set by \n BEND:LTUS:766: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, "BEND:LTUS:766:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:766:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "BEND:LTUS:766:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "BEND:LTUS:766:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "BEND:LTUS:766:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "BEND:LTUS:766:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "1") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "BEND:LTUS:766: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, "BEND:LTUS:766:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "BEND:LTUS:766:TRIMTYPE.RVAL") field(INPB, "BEND:LTUS:766:CONFIG.RVAL") field(OUT, "BEND:LTUS:766:TRIMMAXNUM PP") } record(longout, "BEND:LTUS:766: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, "BEND:LTUS:766: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, "BEND:LTUS:764:TRIMRAMPRATE CP NMS") field(OMSL, "closed_loop") field(VAL, "") field(OUT, "BEND:LTUS:766:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "BEND:LTUS:766: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, "BEND:LTUS:764:TRIMSETL CP NMS") field(OMSL, "closed_loop") field(VAL, "") } record(bo, "BEND:LTUS:766: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, "BEND:LTUS:766: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, "BEND:LTUS:766: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, "BEND:LTUS:766:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "0") } record(ao, "BEND:LTUS:766: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, "BEND:LTUS:766:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "BEND:LTUS:766: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, "BEND:LTUS:766: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, "BEND:LTUS:766:IMOVE") field(INPB, "BEND:LTUS:766:IACT") field(INPC, "BEND:LTUS:766:IRAMPRATE") field(INPD, "1.577") field(INPE, "BEND:LTUS:766:TRIMDLYPCT") field(INPF, "BEND:LTUS:766:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "BEND:LTUS:766:RAMPTIME_LEFT PP") } record(longout, "BEND:LTUS:766:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "BEND:LTUS:766:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "BEND:LTUS:766:RAMPDONE_CALC") } record(calc, "BEND:LTUS:766:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "BEND:LTUS:766:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "BEND:LTUS:766:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "BEND:LTUS:766: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, "BEND:LTUS:766:RAMPTIME_LEFT") field(OUT, "BEND:LTUS:766:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "BEND:LTUS:766:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "BEND:LTUS:766:RAMPTIME_LEFT NMS") field(OUT, "BEND:LTUS:766:RAMPDONE PP") } record(bo, "BEND:LTUS:766:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "BEND:LTUS:766:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "BEND:LTUS:766: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, "BEND:LTUS:766: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, "BEND:LTUS:766:STDZINIT") { field(DESC, "Proc. Stdz PVs on boot") field(PINI, "YES") field(DOL1, "1") field(DOL2, "1") field(DOL3, "1") field(LNK1, "BEND:LTUS:766:DEBUG.PROC PP") field(LNK2, "BEND:LTUS:766:STDZCYCLENUM.PROC PP") field(LNK3, "BEND:LTUS:766:STDZDISABLE.PROC PP") field(LNK4, "BEND:LTUS:766: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, "BEND:LTUS:766:STDZSUB") { field(DESC, "Stdz subroutine") field(INAM, "mgntStdzInit") field(SNAM, "mgntStdz") field(BRSV, "INVALID") field(INPA, "BEND:LTUS:766:STDZIMIN NPP NMS") field(INPB, "BEND:LTUS:766:STDZIMAX NPP NMS") field(INPC, "BEND:LTUS:766:STDZIFINAL NPP NMS") field(INPD, "BEND:LTUS:766:STDZCYCLENUM NPP NMS") field(INPE, "BEND:LTUS:766:STDZDIRECT.RVAL NPP NMS") field(INPF, "BEND:LTUS:766:STDZDISABLE.RVAL CPP NMS") field(INPG, "BEND:LTUS:766: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, "BEND:LTUS:766:STDZWF PP") field(OUTB, "BEND:LTUS:766: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, "BEND:LTUS:766:STDZWF") } record(mbbo, "BEND:LTUS:766: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, "BEND:LTUS:766: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, "BEND:LTUS:766:STDZMAINPS") { field(DESC, "Stdz by main or self") field(PINI, "YES") field(DTYP, "Soft Channel") field(ZNAM, "SELF") field(ONAM, "MAIN") } record(bo, "BEND:LTUS:766: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, "BEND:LTUS:766: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, "BEND:LTUS:766: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, "BEND:LTUS:766:STDZTOD") { field(DESC, "Successful Standardize Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "BEND:LTUS:766:STDZLOSTTOD") { field(DESC, "Standardize Lost Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(longout, "BEND:LTUS:766:STDZCYCLECNT") { field(DESC, "Cycle Count") field(PINI, "YES") } record(longout, "BEND:LTUS:766: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, "BEND:LTUS:766:STDZDIRECT") } # The default standardize direction is "UP" for # all LCLS Magnets.. record(bo, "BEND:LTUS:766:STDZDIRECT") { field(DESC, "Standardize Direction ") field(ZNAM, "UP") field(ONAM, "DOWN") field(VAL, "0") field(FLNK, "BEND:LTUS:766:STDZIMIN") } record(ao, "BEND:LTUS:766:STDZIMIN") { field(DESC, "Min-STDZ Current") field(PREC, "1") field(EGU, "A") field(HOPR, "17.5") field(LOPR, "-17.5") field(VAL, "-17.5") field(FLNK, "BEND:LTUS:766:STDZIMAX") } record(ao, "BEND:LTUS:766:STDZIMAX") { field(DESC, "Max. Standarize Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "17.5") field(LOPR, "-17.5") field(VAL, "17.5") field(FLNK, "BEND:LTUS:766:STDZIFINAL") } record(ao, "BEND:LTUS:766:STDZIFINAL") { field(DESC, "Final SDTZ Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "17.5") field(LOPR, "-17.5") field(VAL, "-17.5") field(FLNK, "BEND:LTUS:766: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, "BEND:LTUS:766: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, "BEND:LTUS:766:STDZITOL") { field(DESC, "Stdz min tolerance") field(PREC, "5") field(CALC, "MAX(ABS(A),ABS(B))*C") field(INPA, "BEND:LTUS:766:STDZIMIN CP NMS") field(INPB, "BEND:LTUS:766:STDZIMAX CP MMS") field(INPC, "0.05") field(INPD, "BEND:LTUS:766:STDZITOLR CP MMS") field(EGU, "A") field(FLNK, "BEND:LTUS:766:IDELTAS") field(PINI, "YES") } # D - factor (3.154/2 = 1.577) for EPSC, otherwise, set to 1.0 record(calc, "BEND:LTUS:766:STDZDLY") { field(DESC, "Ramp time for stdz cycle") field(CALC, "C>0?MAX(1,ABS((A-B)/C)*D):0") field(INPA, "BEND:LTUS:766:STDZIMIN CP NMS") field(INPB, "BEND:LTUS:766:STDZIMAX CP NMS") field(INPC, "BEND:LTUS:766:TRIMRAMPRATE CP NMS") field(INPD, "1.0") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") } record(calc, "BEND:LTUS:766:STDZRAMPDLY") { field(DESC, "Ramp delay total") field(CALC, "MAX(1,((A/100)*B+B))") field(PREC, "5") field(INPA, "BEND:LTUS:766:TRIMDLYPCT CP MS") field(INPB, "BEND:LTUS:766: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, "BEND:LTUS:766:STDZMINIDLY") { field(DESC, "Mini-stdz delay") field(CALC, "A") field(PREC, "5") field(A, "1.0") field(EGU, "sec") field(PINI, "YES") } record(ao, "BEND:LTUS:766: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, "BEND:LTUS:766:STDZMINIDELTA") { field(DESC, "Stdz mini % of IMAX") field(CALC, "(B/100)*(A-C)") field(INPA, "BEND:LTUS:766:IDES.HOPR") field(INPB, "BEND:LTUS:766:STDZMINIPCT CPP NMS") field(INPC, "BEND:LTUS:766:IDES.LOPR") field(PREC, "5") } record(calc, "BEND:LTUS:766:STDZMINISETPT") { field(DESC, "Mini Stdz delta") field(CALC, "C==0?MAX(E-D,B):MIN(E+D,A)") field(INPA, "BEND:LTUS:766:IDES.HOPR") field(INPB, "BEND:LTUS:766:IDES.LOPR") field(INPC, "BEND:LTUS:766:STDZDIRECT.RVAL") field(INPD, "BEND:LTUS:766:STDZMINIDELTA") field(INPE, "BEND:LTUS:766:IDES") field(PREC, "5") field(FLNK, "BEND:LTUS:766: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, "BEND:LTUS:766:STDZMINISETPTOOR") { field(DESC, "Mini Stdz setpoint out of range") field(CALC, "C==0?(E-DA)") field(INPA, "BEND:LTUS:766:IDES.HOPR") field(INPB, "BEND:LTUS:766:IDES.LOPR") field(INPC, "BEND:LTUS:766:STDZDIRECT.RVAL") field(INPD, "BEND:LTUS:766:STDZMINIDELTA") field(INPE, "BEND:LTUS:766: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, "BEND:LTUS:766: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, "BEND:LTUS:766:IADJUST.RVAL") field(INPB, "BEND:LTUS:766:STDZDIRECT.RVAL") field(INPC, "BEND:LTUS:766:STDZOK.RVAL") field(INPD, "BEND:LTUS:766:STDZDISABLE.RVAL") field(INPE, "BEND:LTUS:766:STATE.RVAL CPP NMS") field(INPF, "BEND:LTUS:766:ICTRL.RVAL") field(INPG, "BEND:LTUS:766:STATE.SEVR") field(INPH, "BEND:LTUS:766:BDELTAS.M") field(INPI, "BEND:LTUS:766:IACT.SEVR") field(OUT, "BEND:LTUS:766:STDZLOSTGO.SELN PP NMS") field(OOPT, "Transition To Non-zero") } record(seq, "BEND:LTUS:766:STDZLOSTGO") { field(DESC, "Process lost stdz") field(SELM, "Mask") field(DOL1, "1") field(DOL2, "0") field(LNK1, "BEND:LTUS:766:STDZLOSTTOD.PROC") field(LNK2, "BEND:LTUS:766:STDZOK PP") } # Record maximum current after standardize # Reset to IACT from sequence after trim # Disable processing during (mini-)standardize or trim record(calc, "BEND:LTUS:766:STDZIACTMAX") { field(DESC, "Max act current after stdz") field(CALC, "MAX(A, B)") field(DISV, "0") field(SDIS, "BEND:LTUS:766:CHECKPWRDIP_ENABLE") field(INPA, "BEND:LTUS:766:IACT CP") field(INPB, "BEND:LTUS:766:STDZIACTMAX") field(EGU, "A") field(FLNK, "BEND:LTUS:766:CHECKPWRDIP") } # Detect power dip if STDZOK is YES, STDZ is enabled, and IACT is valid # If IACT drops below STDZIACTMAX by more than the trim tolerance, clear STDZOK # Warning: Take the absolute value of the trim tolerance, or else quads of # negative polarity will always lose STDZ since their IDELTAS.I are negative. # Note: Large quads and bends are prone to losing STDZ even if they are # perturbed toward higher current since their current tends to overshoot # by greater than the trim tolerance before settling down. record(calcout, "BEND:LTUS:766:CHECKPWRDIP") { field(DESC, "Detect power dip") field(CALC, "(A-B>ABS(C))?3:0") field(DISV, "0") field(SDIS, "BEND:LTUS:766:CHECKPWRDIP_ENABLE") field(INPA, "BEND:LTUS:766:STDZIACTMAX") field(INPB, "BEND:LTUS:766:IACT") field(INPC, "BEND:LTUS:766:IDELTAS.I") field(OUT, "BEND:LTUS:766:STDZLOSTGO.SELN PP NMS") field(OOPT, "When Non-zero") } # Enable processing of STDZIACTMAX and CHECKPWRDIP only if # STDZOK = YES, STDZDISABLE = NO, CTRL != Trim (2), and # CTRL != Stdz (4) record(calc, "BEND:LTUS:766:CHECKPWRDIP_ENABLE") { field(CALC, "A&&!B&&(C#2)&&(C#4)") field(INPA, "BEND:LTUS:766:STDZOK.RVAL CP") field(INPB, "BEND:LTUS:766:STDZDISABLE.RVAL CP") field(INPC, "BEND:LTUS:766:CTRL.RVAL CP") } #! 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, "BEND:LTUS:766: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, "BEND:LTUS:766: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, "BEND:LTUS:766:CALBSET") { field(DESC, "Use DAC Calbration") field(SCAN, "10 second") field(CALC, "A&&(B==0)&&C?31:960") field(INPA, "BEND:LTUS:766:CALBOK") field(INPB, "BEND:LTUS:766:CALBDISABLE") field(INPC, "BEND:LTUS:766:CALBSLOPE") field(OOPT, "On Change") field(OUT, "BEND:LTUS:766: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, "BEND:LTUS:766:CALB_SEQ") { field(DESC, "Output Calib Values") field(SELM, "Mask") field(SELL, "BEND:LTUS:766: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, "BEND:LTUS:766:CALBSLOPE") field(DOL3, "BEND:LTUS:766: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, "BEND:LTUS:766:CALBTOD") { field(DESC, "Calibration Success Time") field(PINI, "YES") # field(DOL, "") field(OMSL, "supervisory") field(DTYP, "Soft Channel") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:766: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, "BEND:LTUS:766: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, "BEND:LTUS:766: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, "BEND:LTUS:766:CALBOFFSET") { field(DESC, "Calc DAC Offset") field(PREC, "6") field(EGU, "Counts") field(PINI, "YES") } record(bo, "BEND:LTUS:766: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, "BEND:LTUS:766:DACSLOPE") { field(DESC, "V to DAC slope") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "supervisory") field(PINI, "YES") field(FLNK, "BEND:LTUS:766:DACOFFSET") } # Default Offset used in conversion from Volts to DAC Counts record(ao, "BEND:LTUS:766:DACOFFSET") { field(DESC, "V to DAC offset") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "supervisory") field(PINI, "YES") field(FLNK, "BEND:LTUS:766: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, "BEND:LTUS:766: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, "BEND:LTUS:766:IACT") field(INPD, "BEND:LTUS:766:DACSLOPE") field(INPE, "BEND:LTUS:766:DACOFFSET") field(EGU, "Counts") field(PREC, "6") } record(ao, "BEND:LTUS:766:DAC") { field(DESC, "DAC Set point") field(EGU, "Counts") field(DOL, "") field(OMSL, "supervisory") field(PREC, "6") field(PINI, "YES") } record(ao, "BEND:LTUS:766:CALBIMIN") { field(DESC, "Calibration Min Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(DRVH, "17.5") field(HOPR, "17.5") field(DRVL, "-17.5") field(LOPR, "-17.5") field(PREC, "3") field(EGU, "A") field(VAL, "0.0") field(FLNK, "BEND:LTUS:766:CALBIMAX") } record(ao, "BEND:LTUS:766:CALBIMAX") { field(DESC, "Calibration Max Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(DRVH, "17.5") field(HOPR, "17.5") field(LOPR, "-17.5") field(DRVL, "-17.5") field(EGU, "A") field(VAL, "17.5") field(FLNK, "BEND:LTUS:766:CALBSTEPNUM") } record(ao, "BEND:LTUS:766:CALBIFINAL") { field(DESC, "Calibration Last Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(PREC, "3") field(EGU, "A") field(HOPR, "17.5") field(LOPR, "-17.5") field(VAL, "0") } record(longout, "BEND:LTUS:766: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, "BEND:LTUS:766:CALBIDELTA") } record(calc, "BEND:LTUS:766:CALBIDELTA") { field(DESC, "Step size for CALB") field(CALC, "C=0?0:ABS((A-B)/C)") field(INPA, "BEND:LTUS:766:CALBIMAX") field(INPB, "BEND:LTUS:766:CALBIMIN") field(INPC, "BEND:LTUS:766: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, "BEND:LTUS:766:CALBIMULT") { field(DESC, "IACT vs ISETPT mult") field(CALC, "C#0||A=0?1:ABS(B/A)") field(INPA, "BEND:LTUS:764:ISETPT.DRVH") field(INPB, "BEND:LTUS:764:IACT.HOPR") field(INPC, "BEND:LTUS:766:PSCONTROLLER.RVAL CPP") field(EGU, "A") field(PINI, "YES") } # SNL dbputs DAC values here. 6-10 steps are possible. record(waveform, "BEND:LTUS:766:CALBICTRLWF") { field(DESC, "ICTRL setpoint array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") } record(waveform, "BEND:LTUS:766:DACWF") { field(DESC, "DAC count array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "BEND:LTUS:766:DACSA") } # Used only for xygraph edm plot record(subArray, "BEND:LTUS:766:DACSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "BEND:LTUS:766: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, "BEND:LTUS:766:CALCDACWF") { field(DESC, "Calc DAC counts array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "BEND:LTUS:766:CALCDACSA") } # Used only for xygraph edm plot record(subArray, "BEND:LTUS:766:CALCDACSA") { field(DESC, "Calc DAC counts") field(DTYP, "Soft Channel") field(INP, "BEND:LTUS:766: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, "BEND:LTUS:766:CALBYWF") { field(DESC, "mx + b") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "BEND:LTUS:766:CALBYSA") } # Used only for xygraph edm plot record(subArray, "BEND:LTUS:766:CALBYSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "BEND:LTUS:766:CALBYWF") field(MALM, "10") field(NELM, "6") field(INDX, "0") field(FTVL, "DOUBLE") } record(waveform, "BEND:LTUS:766:CALBIACTWF") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "BEND:LTUS:766:CALBIACTSA") } # Used only for xygraph edm plot record(subArray, "BEND:LTUS:766:CALBIACTSA") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(MALM, "10") field(NELM, "6") field(INP, "BEND:LTUS:766:CALBIACTWF") field(INDX, "0") field(FTVL, "DOUBLE") field(FLNK, "BEND:LTUS:766:CALBLIMITS") } # Check that measured current during calibration is within # tolerance. record(aSub, "BEND:LTUS:766: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, "BEND:LTUS:766:CALBSTEPNUM") field(INPB, "BEND:LTUS:766:CALBIACTWF") field(INPC, "BEND:LTUS:766: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, "BEND:LTUS:766: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, "BEND:LTUS:766:STDZITOL") field(INPH, "BEND:LTUS:766:DACSLOPE") field(INPI, "BEND:LTUS:766: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, "BEND:LTUS:766: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, "BEND:LTUS:766:CALBSTEPNUM") field(INPB, "BEND:LTUS:766:CALBIACTWF") field(INPC, "BEND:LTUS:766:DACWF") field(INPF, "BEND:LTUS:766: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 BEND:LTUS:766CALBOK 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, "BEND:LTUS:766:DEGAUSINIT") { field(DESC, "Proc. Degauss PVs on boot") field(PINI, "YES") field(DOL, "1") field(OUTA, "BEND:LTUS:766:DEGAUSIMIN.PROC PP") field(OUTB, "BEND:LTUS:766:DEGAUSIMAX.PROC PP") field(OUTC, "BEND:LTUS:766:DEGAUSTYPE.PROC PP") field(OUTD, "BEND:LTUS:766:DEGAUSSTEP.PROC PP") field(OUTE, "BEND:LTUS:766:MADNAME.PROC PP") field(OUTF, "BEND:LTUS:766:PSTYPE.PROC PP") field(OUTG, "BEND:LTUS:766: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, "BEND:LTUS:766:DEGAUSSUB") { field(DESC, "Degauss subroutine") field(INAM, "mgntDegaussInit") field(SNAM, "mgntDegauss") field(BRSV, "INVALID") field(INPA, "BEND:LTUS:766:DEGAUSIMIN NPP NMS") field(INPB, "BEND:LTUS:766:DEGAUSIMAX NPP NMS") field(INPC, "BEND:LTUS:766:DEGAUSTYPE.RVAL NPP NMS") field(INPE, "BEND:LTUS:766:DEGAUSMETHOD.RVAL NPP NMS") field(INPF, "BEND:LTUS:766:PSTYPE NPP NMS") field(INPG, "BEND:LTUS:766:DEBUG.RVAL NPP NMS") field(INPH, "BEND:LTUS:766: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, "BEND:LTUS:766:DEGAUSWF PP") field(OUTB, "BEND:LTUS:766:DEGAUSMSG PP") field(OUTC, "BEND:LTUS:766: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, "BEND:LTUS:766:DEGAUSWF") { field(DESC, "Degauss Setpts") field(NELM, "60") field(FTVL, "DOUBLE") } record(mbbo,"BEND:LTUS:766: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, "BEND:LTUS:766: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, "BEND:LTUS:766: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, "BEND:LTUS:766: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, "BEND:LTUS:766: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, "BEND:LTUS:766:DEGAUSIMIN") { field(DESC, "Min. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "17.5") field(LOPR, "-17.5") field(DRVH, "17.5") field(DRVL, "-17.5") field(VAL, "-17.5") } record(ao, "BEND:LTUS:766:DEGAUSIMAX") { field(DESC, "Max. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "17.5") field(LOPR, "-17.5") field(DRVH, "17.5") field(DRVL, "-17.5") field(VAL, "17.5") } # 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,"BEND:LTUS:766: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, "BEND:LTUS:766: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,"BEND:LTUS:766: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, "BEND:LTUS:766: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, "BEND:LTUS:766: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, "BEND:LTUS:766: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, "BEND:LTUS:766:DEGAUSTOD") { field(DESC, "Successful Degauss Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "BEND:LTUS:766:DEGAUSLOSTTOD") { field(DESC, "Degauss Lost Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:766:DEGAUSTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "BEND:LTUS:766:DEGAUSTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "BEND:LTUS:766: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, "BEND:LTUS:766:DEGAUSGO") { field(DESC, "Set bdes of btrms to zero") field(ASG, "Internal") field(OUTA, "") field(OUTB, "") field(OUTC, "") field(OUTD, "") } # =========== CRYO ONLY =========== record(bo, "BEND:LTUS:766: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, "BEND:LTUS:766:DEGAUS_IMAX_CHECK") { field(DESC, "Check if imax shoud chg") field(CALC, "(C==4)&&(ABS(B)>ABS(A))?1:0") field(INPA, "BEND:LTUS:766:DEGAUS_IMAX") field(INPB, "BEND:LTUS:766:ISETPT") field(INPC, "BEND:LTUS:766:DEGAUSTYPE.RVAL") field(OUT, "BEND:LTUS:766:DEGAUS_IMAX_UPDATE.SELN") field(FLNK, "BEND:LTUS:766:DEGAUS_IMAX_UPDATE") } record(seq, "BEND:LTUS:766:DEGAUS_IMAX_UPDATE") { field(DESC, "Degauss IMAX Update") field(SELM, "Specified") field(DOL1, "BEND:LTUS:766:ISETPT") field(LNK1, "BEND:LTUS:766:DEGAUS_IMAX PP") } # Set the maximum current after a successful # degauss. This pv is updated by the # sequence. record(ao, "BEND:LTUS:766:DEGAUS_IMAX") { field(DESC, "Max I set afer a degauss") field(EGU, "Amps") field(PINI, "YES") field(PREC, "6") field(HOPR, "17.5") field(LOPR, "-17.5") field(DRVH, "17.5") field(DRVL, "-17.5") field(VAL, "17.5") field(FLNK, "BEND:LTUS:766:DEGAUS_IMAXPOL_CHECK") info(autosaveFields,"VAL,RVAL") } # Set the polarity if degauss_imax record(calcout, "BEND:LTUS:766:DEGAUS_IMAXPOL_CHECK") { field(DESC, "Determine polarity of imax") field(CALC, "A>=0?0:1") field(INPA, "BEND:LTUS:766:DEGAUS_IMAX") field(FLNK, "BEND:LTUS:766:DEGAUS_IMAXPOL") } record(bo, "BEND:LTUS:766:DEGAUS_IMAXPOL") { field(DESC, "Polarity of imax I") field(DTYP, "Raw Soft Channel") field(DOL, "BEND:LTUS:766:DEGAUS_IMAXPOL_CHECK") field(OMSL, "closed_loop") field(ZNAM, "Positive") field(ONAM, "Negative") field(FLNK, "BEND:LTUS:766: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, "BEND:LTUS:766:DEGAUS_ABSIMAX") { field(DESC, "Absolute Max. Degauss I") field(CALC, "ABS(A)") field(INPA, "BEND:LTUS:766:DEGAUS_IMAX") field(PREC, "6") field(EGU, "Amps") field(HOPR, "17.5") field(LOPR, "-17.5") info(autosaveFields,"VAL RVAL") } # IACT Polarity record(calcout, "BEND:LTUS:766:IACTPOL_CHECK") { field(DESC, "Determine IACT polarity") field(SCAN, "5 second") field(CALC, "ABS(A-B)>C?(A>=0?0:1):D") field(INPA, "BEND:LTUS:766:IACT") field(INPB, "BEND:LTUS:766:IACTPOL_CHECK.LA") field(INPC, "0.0001") field(INPD, "BEND:LTUS:766:IACTPOL_CHECK.PVAL") field(OOPT, "On Change") field(FLNK, "BEND:LTUS:766:IACTPOL") } record(bo, "BEND:LTUS:766: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,"BEND:LTUS:766: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, "BEND:LTUS:766:DEGAUSENABLE CP") field(INPB, "BEND:LTUS:766:DEGAUSOK") field(INPC, "BEND:LTUS:766:STATE CP") field(INPD, "BEND:LTUS:766:STATE.SEVR") field(OUT, "BEND:LTUS:766:DEGAUS_STATE_SEQ.SELN PP") field(ASG, "Internal") } record(seq, "BEND:LTUS:766:DEGAUS_STATE_SEQ") { field(DESC, "Degauss State Sequence") field(SELM, "Specified") field(SELL, "BEND:LTUS:766:DEGAUS_STATE_CHECK") field(LNK1, "BEND:LTUS:766:DEGAUS_STATE_DISABLE.PROC PP") field(LNK2, "BEND:LTUS:766:DEGAUS_STATE_LOST.PROC PP") field(LNK3, "BEND:LTUS:766:DEGAUS_STATE_GOOD.PROC PP") field(LNK4, "BEND:LTUS:766: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, "BEND:LTUS:766:DEGAUS_STATE_DISABLE") { field(DESC, "Degauss not used") field(LNK1, "BEND:LTUS:766:DEGAUSOK.ZSV") field(LNK2, "BEND:LTUS:766: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, "BEND:LTUS:766:STATMSG.FRSV") field(LNK4, "BEND:LTUS:766: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, "BEND:LTUS:766:DEGAUS_STATE_LOST") { field(DESC, "Degauss lost and ps On") field(DOL1, "1") field(LNK1, "BEND:LTUS:766:DEGAUSOK.ZSV") field(LNK2, "BEND:LTUS:766: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, "BEND:LTUS:766:STATMSG.FRSV") field(LNK4, "BEND:LTUS:766: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, "BEND:LTUS:766:DEGAUS_STATE_OFF") { field(DESC, "Degaused lost and ps Off") field(DOL1, "2") field(LNK1, "BEND:LTUS:766: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, "BEND:LTUS:766:STATMSG.FRSV") field(LNK3, "BEND:LTUS:766: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, "BEND:LTUS:766:DEGAUS_STATE_GOOD") { field(DESC, "Degauss good") field(DOL1, "1") field(LNK1, "BEND:LTUS:766: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, "BEND:LTUS:766:STATMSG.FRSV PP") field(LNK3, "BEND:LTUS:766:STATMSG.FVSV PP") field(LNK4, "") field(ASG, "Internal") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(mbbo, "BEND:LTUS:766:FUNC") { field(DESC, "BEND:LTUS:766 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, "0") field(FFVL, "0") field(OUT, "BEND:LTUS:766:CTRL CA") } # :CTRL pv is processed at boot in the # sequence mgntCtrl.st Processed in sequence # record(mbbo, "BEND:LTUS:766:CTRL") { field(DESC, "BEND:LTUS:766 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, "BEND:LTUS:766:SELECTEN.A PP") field(SDIS, "0") } # If a function has been selected set this unit to busy record(calcout, "BEND:LTUS:766:SELECTEN") { field(DESC, "Control Select Enable") field(CALC, "A>0?1:A") field(FLNK, "BEND:LTUS:766:BUSY") } # Set to FREE on IOC reboot record(bo, "BEND:LTUS:766:BUSY") { field(DESC, "BEND:LTUS:766 Ctrl Done") field(DOL, "BEND:LTUS:766:SELECTEN") field(ZNAM, "FREE") field(ONAM, "BUSY") field(PINI, "YES") field(FLNK, "BEND:LTUS:766:SELECT") } record(bo, "BEND:LTUS:766:SELECT") { field(ZNAM, "NO") field(ONAM, "YES") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") } record(bo, "BEND:LTUS:766: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, "BEND:LTUS:766:CTRLSTATE") { field(DESC, "BEND:LTUS:766 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("BEND:LTUS:766:CTRL",20,20,0,0,"BEND:LTUS:766:CTRL") #! Field("BEND:LTUS:766:CTRL.OUT",16777215,1,"BEND:LTUS:766:CTRL.OUT") #! Link("BEND:LTUS:766:CTRL.OUT","BEND:LTUS:766:SELECTEN.A") #! Field("BEND:LTUS:766:CTRL.VAL",16777215,1,"BEND:LTUS:766:CTRL.VAL") #! Record("BEND:LTUS:766:SELECTEN",321,381,0,0,"BEND:LTUS:766:SELECTEN") #! Field("BEND:LTUS:766:SELECTEN.A",16777215,0,"BEND:LTUS:766:SELECTEN.A") #! Field("BEND:LTUS:766:SELECTEN.FLNK",16777215,1,"BEND:LTUS:766:SELECTEN.FLNK") #! Link("BEND:LTUS:766:SELECTEN.FLNK","BEND:LTUS:766:BUSY") #! Field("BEND:LTUS:766:SELECTEN.VAL",16777215,1,"BEND:LTUS:766:SELECTEN.VAL") #! Record("BEND:LTUS:766:BUSY",623,274,0,0,"BEND:LTUS:766:BUSY") #! Field("BEND:LTUS:766:BUSY.DOL",16777215,0,"BEND:LTUS:766:BUSY.DOL") #! Link("BEND:LTUS:766:BUSY.DOL","BEND:LTUS:766:SELECTEN.VAL") #! Field("BEND:LTUS:766:BUSY.FLNK",16777215,1,"BEND:LTUS:766:BUSY.FLNK") #! Link("BEND:LTUS:766:BUSY.FLNK","BEND:LTUS:766:SELECT") #! Record("BEND:LTUS:766:SELECT",669,508,0,1,"BEND:LTUS:766:SELECT") #! Record("BEND:LTUS:766:FUNC",940,120,0,0,"BEND:LTUS:766:FUNC") #! Field("BEND:LTUS:766:FUNC.OUT",16777215,0,"BEND:LTUS:766:FUNC.OUT") #! Link("BEND:LTUS:766:FUNC.OUT","BEND:LTUS:766:CTRL.VAL") #! Record("BEND:LTUS:766:ABORT",193,41,0,0,"BEND:LTUS:766:ABORT") #! Record("BEND:LTUS:766:CTRLSTATE",369,34,0,0,"BEND:LTUS:766: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,"BEND:LTUS:766:SELECT is used for Multi-device selection.\nIt is enabled when associated BEND:LTUS:766:CTRL is \"0\" (DONE).\nIt is disabled when associated BEND:LTUS:766: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,"BEND:LTUS:766: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, "BEND:LTUS:766:BCTRL_INIT") { field(DESC, "Process BCTRL on boot") field(PINI, "YES") field(CALC, "A=3?1:0") field(INPA, "BEND:LTUS:766:BCTRL.SEVR") field(OUT, "BEND:LTUS:766: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, "BEND:LTUS:766:BACT") { field(DESC, "Actual B") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "BEND:LTUS:766:BACT") field(INPB, "BEND:LTUS:766:POLYCOEF") field(INPC, "BEND:LTUS:766:POLYCOEF.A") field(INPD, "BEND:LTUS:766:POLYCOEF.B") field(INPE, "BEND:LTUS:766:IACTCALC MS") field(INPF, "BEND:LTUS:766:BDELTAS PP") field(INPG, "100") field(EGU, "kG-m") field(HOPR, "2.7597") field(LOPR, "-2.7915") field(HIHI, "2.7597") field(LOLO, "-2.7915") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "2.7597") field(LOW, "-2.7915") field(FLNK, "BEND:LTUS:766: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, "BEND:LTUS:766:BDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntPhyDeltas") field(EGU, "kG-m") field(HOPR, "1") field(PREC, "7") field(BRSV, "INVALID") field(INPA, "BEND:LTUS:766:BDES") field(INPB, "BEND:LTUS:766:TRIMBTOL") field(INPC, "BEND:LTUS:766:TRIMBTOLR") field(INPD, "BEND:LTUS:766:CHCKBTOL") field(INPE, "BEND:LTUS:766:CHCKBTOLR") field(F, "2.0") field(INPG, "30") field(INPH, "BEND:LTUS:766:BACT.VAL") # # MPS absolute and relative tolerances field(INPP, "BEND:LTUS:766:MPSBTOL") field(INPQ, "BEND:LTUS:766:MPSBTOLR") field(FLNK, "BEND:LTUS:766:BCONLIMITS") info(autosaveFields,"F") } # This record is processed by BDELTAS record(aSub, "BEND:LTUS:766:BCONLIMITS") { field(DESC, "Config B-field Limits") field(INAM, "mgntInit") field(SNAM, "mgntBCONLimits") field(INPA, "BEND:LTUS:766:BDES") field(INPB, "BEND:LTUS:766:BDELTAS.I") field(INPG, "BEND:LTUS:766:DEBUG.RVAL") field(FTA, "DOUBLE") field(FTB, "DOUBLE") field(FTG, "ULONG") field(OUTA, "BEND:LTUS:766:BCON.HIGH") field(OUTB, "BEND:LTUS:766:BCON.LOW") field(OUTC, "BEND:LTUS:766:BCON.HIHI") field(OUTD, "BEND:LTUS:766:BCON.LOLO PP") field(FTVA, "DOUBLE") field(FTVB, "DOUBLE") field(FTVC, "DOUBLE") field(FTVD, "DOUBLE") field(BRSV, "INVALID") field(FLNK, "BEND:LTUS:766:IDELTAS") } # The following PV is processed by :BACT # which is processed by :BACT # record(fanout, "BEND:LTUS:766:BACTFO") { field(DESC, "BACT processing") field(SELM, "All") field(LNK1, "BEND:LTUS:766:BDIFF") field(LNK2, "BEND:LTUS:766:BADIFF") field(LNK3, "BEND:LTUS:766:BRATIO") field(LNK4, "BEND:LTUS:766:MPSLIMITS") field(LNK5, "BEND:LTUS:766:I2BSTATUS") field(LNK6, "BEND:LTUS:766:IACTFO.PROC") } record(calc, "BEND:LTUS:766:BDIFF") { field(DESC, "BDES-BACT") field(CALC, "A-B") field(INPA, "BEND:LTUS:766:BDES") field(INPB, "BEND:LTUS:766:BACT") field(EGU, "kG-m") field(PREC, "7") } record(calc, "BEND:LTUS:766:BADIFF") { field(DESC, "Absolute BDES-BACT") field(INPA, "BEND:LTUS:766:BDIFF") field(EGU, "kG-m") field(PREC, "7") field(CALC, "A<0?ABS(A):A") } record(calc, "BEND:LTUS:766:BRATIO") { field(DESC, "BACT Error") field(CALC, "B?A/B:0") field(INPA, "BEND:LTUS:766:BDIFF") field(INPB, "BEND:LTUS:766:BDES.HOPR") field(EGU, "kG-m") field(PREC, "7") } record(mbbi, "BEND:LTUS:766: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, "BEND:LTUS:766:BACT.J") } # Note: for a string slave set the MONFL # macro to the following: # MONFL=:IMONCALC MS record(sub, "BEND:LTUS:766:BMON") { field(DESC, "Second Transductor") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "BEND:LTUS:766:BMON") field(INPB, "BEND:LTUS:766:POLYCOEF") field(INPC, "BEND:LTUS:766:POLYCOEF.A") field(INPD, "BEND:LTUS:766:POLYCOEF.B") field(INPE, "BEND:LTUS:766:IMONCALC MS") field(INPF, "BEND:LTUS:766:BDELTAS.VAL") field(INPG, "100") field(EGU, "kG-m") field(HOPR, "2.7597") field(LOPR, "-2.7915") field(HIHI, "2.7597") field(LOLO, "-2.7915") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "2.7597") field(LOW, "-2.7915") } # 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=BEND:LTUS:764:BDES CP record(ao, "BEND:LTUS:766:BDES") { field(DESC, "Desired B-Field") field(PINI, "NO") field(DRVH, "2.7597") field(DRVL, "-2.7915") field(HOPR, "2.7597") field(LOPR, "-2.7915") field(PREC, "7") field(EGU, "kG-m") field(MDEL, "-1") field(OMSL, "closed_loop") field(DOL, "BEND:LTUS:766:IDES2BDES") field(OUT, "BEND:LTUS:766:B2IDES PP") info(autosaveFields,"VAL") } record(sub, "BEND:LTUS:766:B2IDES") { field(DESC, "Convert Desired B-Field to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "BEND:LTUS:766:POLYCOEF") field(INPC, "BEND:LTUS:766:POLYCOEF.A") field(INPD, "BEND:LTUS:766:POLYCOEF.B") field(PREC, "7") field(EGU, "kG-m") field(HOPR, "2.7597") field(LOPR, "-2.7915") field(MDEL, "-1") field(INPE, "BEND:LTUS:766:BDES.DRVH") field(INPF, "BEND:LTUS:766:BDES.DRVL") field(BRSV, "INVALID") field(FLNK, "BEND:LTUS:766:IDES") } record(sub, "BEND:LTUS:766:BNOM") { field(DESC, "Nominal Field") field(PINI, "YES") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "BEND:LTUS:766:POLYCOEF") field(INPC, "BEND:LTUS:766:POLYCOEF.A") field(INPD, "BEND:LTUS:766:POLYCOEF.B") field(INPE, "BEND:LTUS:766:BDES.DRVH") field(INPF, "BEND:LTUS:766:BDES.DRVL") field(EGU, "kG-m") field(HOPR, "2.7597") field(LOPR, "-2.7915") field(PREC, "7") field(VAL, "0.0") field(FLNK, "BEND:LTUS:766:INOM") } record(sub, "BEND:LTUS:766:BACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "BEND:LTUS:766:BDES.VAL") field(INPB, "BEND:LTUS:766:BDES.DRVH") field(INPC, "BEND:LTUS:766:BDES.DRVL") field(INPD, "BEND:LTUS:766:BDELTAS.I") field(INPE, "BEND:LTUS:766:BDELTAS.J") field(INPG, "BEND:LTUS:766:STATE") field(INPH, "BEND:LTUS:766:HSTA") field(EGU, "kG-m") field(HOPR, "2.7597") field(LOPR, "-2.7915") field(PREC, "7") field(BRSV, "INVALID") } record(sub, "BEND:LTUS:766:BMONLIMITS") { field(DESC, "MON Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "BEND:LTUS:766:BDES.VAL") field(INPB, "BEND:LTUS:766:BDES.DRVH") field(INPC, "BEND:LTUS:766:BDES.DRVL") field(INPD, "BEND:LTUS:766:BDELTAS.K") field(INPE, "BEND:LTUS:766:BDELTAS.L") field(INPG, "BEND:LTUS:766:STATE") field(INPH, "BEND:LTUS:766:HSTA") field(EGU, "kG-m") field(HOPR, "2.7597") field(LOPR, "-2.7915") field(PREC, "7") field(BRSV, "INVALID") } record(seq, "BEND:LTUS:766:BLIMITS") { field(DESC, "ACT Limits") field(PREC, "7") field(DOL1, "BEND:LTUS:766:BLIMITS") field(LNK1, "BEND:LTUS:766:BACTLIMITS.F PP") field(DOL2, "BEND:LTUS:766:BACTLIMITS.I") field(LNK2, "BEND:LTUS:766:BACT.HIGH") field(DOL3, "BEND:LTUS:766:BACTLIMITS.J") field(LNK3, "BEND:LTUS:766:BACT.LOW") field(DOL4, "BEND:LTUS:766:BACTLIMITS.K") field(LNK4, "BEND:LTUS:766:BACT.HIHI") field(DOL5, "BEND:LTUS:766:BACTLIMITS.L") field(LNK5, "BEND:LTUS:766:BACT.LOLO") field(DOL6, "BEND:LTUS:766:BLIMITS") field(LNK6, "BEND:LTUS:766:BMONLIMITS.F PP") field(DOL7, "BEND:LTUS:766:BMONLIMITS.I") field(LNK7, "BEND:LTUS:766:BMON.HIGH") field(DOL8, "BEND:LTUS:766:BMONLIMITS.J") field(LNK8, "BEND:LTUS:766:BMON.LOW") field(DOL9, "BEND:LTUS:766:BMONLIMITS.K") field(LNK9, "BEND:LTUS:766:BMON.HIHI") field(DOLA, "BEND:LTUS:766:BMONLIMITS.L") field(LNKA, "BEND:LTUS:766:BMON.LOLO") field(FLNK, "BEND:LTUS:766:ILIMITS") field(SCAN, "5 second") } record(ao, "BEND:LTUS:766:BCTRL") { field(DESC, "B-Perturb") field(PREC, "7") field(EGU, "kG-m") field(DRVH, "2.7597") field(DRVL, "-2.7915") field(HOPR, "2.7597") field(LOPR, "-2.7915") # 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, "BEND:LTUS:766: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, "BEND:LTUS:766:BCTRLGO") { field(DESC, "Update DES and perturb") field(PREC, "7") # Disable BACT limits field(DOL1, "1") field(LNK1, "BEND:LTUS:766:BLIMITS.VAL") # Update BDES with the BCTRL (slider) value field(DOL2, "BEND:LTUS:766:BCTRL.VAL") field(LNK2, "BEND:LTUS:766:BDES PP") field(DOL3, "1") field(LNK3, "BEND:LTUS:766:IDIRECT.PROC PP") field(DOL4, "1") field(LNK4, "BEND:LTUS:766:CHECKSTDZLOST.PROC PP") field(DOL5, "BEND:LTUS:766:BCTRL.VAL") field(LNK5, "BEND:LTUS:766:BCTRLSUB PP") # Re-enable BACT limits field(DOL6, "0") field(LNK6, "BEND:LTUS:766:BLIMITS.VAL") } # Convert B-field to Current and output to ISETPT record(sub, "BEND:LTUS:766:BCTRLSUB") { field(DESC, "Feedback") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "BEND:LTUS:766:POLYCOEF") field(INPC, "BEND:LTUS:766:POLYCOEF.A") field(INPD, "BEND:LTUS:766:POLYCOEF.B") field(INPE, "BEND:LTUS:766:BDES.DRVH") field(INPF, "BEND:LTUS:766:BDES.DRVL") field(PREC, "7") field(EGU, "kG-m") field(HOPR, "2.7597") field(LOPR, "-2.7915") field(MDEL, "-1") field(BRSV, "INVALID") field(FLNK, "BEND:LTUS:766:ISETPT") } record(ao, "BEND:LTUS:766:BDESPREVTRIM") { field(DESC, "trim bdes for undo") field(DTYP, "Soft Channel") field(DRVH, "2.7597") field(DRVL, "-2.7915") field(EGU, "kG-m") field(HOPR, "2.7597") field(LOPR, "-2.7915") field(PREC, "7") field(PINI, "YES") info(autosaveFields,"VAL") } record(stringin, "BEND:LTUS:766:MADNAME") { field(DESC, "MAD deck nomenclature") field(PINI, "YES") field(VAL, "BCXXL4") } record(ai, "BEND:LTUS:766: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, "3510.056424") } record(ao, "BEND:LTUS:766:BMAX") { field(DESC, "Max B-Field") field(DTYP, "Soft Channel") field(DRVH, "2.7597") field(DRVL, "-2.7915") field(EGU, "kG-m") field(HOPR, "2.7597") field(LOPR, "-2.7915") field(PREC, "7") field(PINI, "YES") field(VAL, "2.7597") field(FLNK, "BEND:LTUS:766:BSTEP") } record(ao, "BEND:LTUS:766:BMIN") { field(DESC, "Min B-Field") field(DTYP, "Soft Channel") field(DRVH, "2.7597") field(DRVL, "-2.7915") field(EGU, "kG-m") field(HOPR, "2.7597") field(LOPR, "-2.7915") field(PREC, "7") field(PINI, "YES") field(VAL, "-2.7915") field(FLNK, "BEND:LTUS:766:BSTEP") } record(ao, "BEND:LTUS:766:BDESSAVE") { field(DESC, "bdes for save/load") field(DTYP, "Soft Channel") field(DRVH, "2.7597") field(DRVL, "-2.7915") field(EGU, "kG-m") field(HOPR, "2.7597") field(LOPR, "-2.7915") field(PINI, "YES") field(PREC, "7") } # This record is processed by BEND:LTUS:766: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, "BEND:LTUS:766:BCON") { field(DESC, "Config B-Field ") field(DTYP, "Soft Channel") field(PREC, "7") field(EGU, "kG-m") field(HOPR, "2.7597") field(LOPR, "-2.7915") field(DRVH, "2.7597") field(DRVL, "-2.7915") # 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 , "BEND:LTUS:766:ICON2BCON") field(OMSL, "closed_loop") field(OUT, "BEND:LTUS:766:B2ICON PP") info(autosaveFields,"VAL") } record(sub, "BEND:LTUS:766:B2ICON") { field(DESC, "Convert Desired ICon to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "BEND:LTUS:766:POLYCOEF") field(INPC, "BEND:LTUS:766:POLYCOEF.A") field(INPD, "BEND:LTUS:766:POLYCOEF.B") field(PREC, "7") field(EGU, "kG-m") field(HOPR, "2.7597") field(LOPR, "-2.7915") field(MDEL, "-1") field(INPE, "BEND:LTUS:766:BCON.DRVH") field(INPF, "BEND:LTUS:766:BCON.DRVL") field(BRSV, "INVALID") field(FLNK, "BEND:LTUS:766: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, "BEND:LTUS:766:BSTEP") { field(DESC, "B-Field step size") field(CALC, "(C==3)||(D==3)?0:ABS(A-B)*0.005") field(INPA, "BEND:LTUS:766:BMAX") field(INPB, "BEND:LTUS:766:BMIN") field(INPC, "BEND:LTUS:766:BMIN.SEVR") field(INPD, "BEND:LTUS:766:BMAX.SEVR") field(EGU, "kG-m") 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,"BEND:LTUS:766:BCTRLDISABLECALC") { field(DESC, "Calc for disabling BCTRL") field(ASG, "Internal") field(CALC, "A?2:1") field(INPA, "BEND:LTUS:766:ONLINE CP") field(OUT, "BEND:LTUS:766:BCTRLDISABLEFOUT PP") } record(fanout, "BEND:LTUS:766:BCTRLDISABLEFOUT") { field(DESC, "Disable BCTRL fanout") field(SELM, "Specified") field(SELL, "BEND:LTUS:766:BCTRLDISABLECALC") field(LNK1, "BEND:LTUS:766:BCTRLDISABLE") field(LNK2, "BEND:LTUS:766:BCTRLENABLE") } record(stringout, "BEND:LTUS:766:BCTRLDISABLE") { field(DESC, "Disable BCTRL") field(DTYP, "Soft Channel") field(OUT, "BEND:LTUS:766:BCTRL.ASG") field(VAL, "NOWRITE") field(FLNK, "BEND:LTUS:766:BCTRLDISV_UPDATE") } record(stringout, "BEND:LTUS:766:BCTRLENABLE") { field(DESC, "Enable BCTRL") field(DTYP, "Soft Channel") field(OUT, "BEND:LTUS:766:BCTRL.ASG") field(VAL, "") field(FLNK, "BEND:LTUS:766:BCTRLDISV_UPDATE") } record(calcout, "BEND:LTUS:766:BCTRLDISV_UPDATE") { field(DESC, "Calc for updating BCTRL.DISV") field(ASG, "Internal") field(CALC, "A") field(INPA, "BEND:LTUS:766:ONLINE") field(OUT, "BEND:LTUS:766: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,"BEND:LTUS:766:BACT and MON\n are processed via links from \n BEND:LTUS:766:IACT (device raw value readback 1)\n and\n BEND:LTUS:766: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 BEND:LTUS:766:POLYCOEF\nC = First polynomial coefficient (offset if linear)\nD = Second polynomial coefficient (slope if linear)\nE = BEND:LTUS:766: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,"BEND:LTUS:766:BDES\n is processed when set by CA users or \n BEND:LTUS:766: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,"BEND:LTUS:766: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 BEND:LTUS:766: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 (BEND:LTUS:766: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,"BEND:LTUS:766:B*LIMITS and BEND:LTUS:766:BLIMITS:\n Calculate alarm and warning limits based on \n deltas from BEND:LTUS:766: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,"BEND:LTUS:766: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,"BEND:LTUS:766: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, "BEND:LTUS:766: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, "BEND:LTUS:766:MPSBTOL") { field(DESC, "Absolute mps tol") field(EGU, "kG-m") field(PREC, "2") field(CALC, "ABS(A)*0.02") field(INPA, "BEND:LTUS:766:BMAX") field(PINI, "YES") } # # 21-Aug-2013: K. Luchini # Set channel access security so that users # cannot easily change values. record(ao, "BEND:LTUS:766:MPSBMAX") { field(DESC, "MPS Max B-field") field(EGU, "kG-m") field(PREC, "7") field(DRVH, "2.7597") field(DRVL, "-2.7915") field(PINI, "YES") field(VAL, "2.7597") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:766:MPSBMIN") { field(DESC, "MPS Min B-field") field(EGU, "kG-m") field(PREC, "7") field(DRVH, "2.7597") field(DRVL, "-2.7915") field(PINI, "YES") field(VAL, "-2.7915") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:766:MPSBLLIM") { field(DESC, "MPS Low Limit B-field") field(EGU, "kG-m") field(PREC, "7") field(DRVH, "2.7597") field(DRVL, "-2.7915") field(PINI, "YES") field(VAL, "-2.7915") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:766:MPSBLLIM2") { field(DESC, "MPS Low Limit #2 B-field") field(EGU, "kG-m") field(PREC, "7") field(DRVH, "2.7597") field(DRVL, "-2.7915") field(PINI, "YES") field(VAL, "-2.7915") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } # Set the default to Std record(mbbo, "BEND:LTUS:766: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, "BEND:LTUS:766:MPSLIMITS.E PP") } record(aSub, "BEND:LTUS:766: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, "BEND:LTUS:766:MPS.RVAL") field(INPB, "BEND:LTUS:766:BADIFF") field(INPC, "BEND:LTUS:766:BDELTAS.N") field(INPD, "BEND:LTUS:766:BACT") field(INPE, "BEND:LTUS:766:MPSBITMASK.RVAL") field(INPF, "BEND:LTUS:766:MPSBLLIM") field(INPG, "BEND:LTUS:766:MPSBMIN") field(INPH, "BEND:LTUS:766:MPSBMAX") field(INPI, "BEND:LTUS:766: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, "BEND:LTUS:766:INTOL.RVAL PP") field(OUTB, "BEND:LTUS:766:INTOL_BMIN.RVAL PP") field(OUTC, "BEND:LTUS:766:INTOL_BRANGE.RVAL PP") field(OUTD, "BEND:LTUS:766: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, "BEND:LTUS:766:INTOL") { field(DESC, "BACT within MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "BEND:LTUS:766:MPSLIMITS.VALA") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "BEND:LTUS:766:INTOL_BMIN") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "BEND:LTUS:766:MPSLIMITS.VALB") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "BEND:LTUS:766:INTOL_BMIN2") { field(DESC, "MPS tol #2") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "BEND:LTUS:766:MPSLIMITS.VALD") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "BEND:LTUS:766:INTOL_BRANGE") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "BEND:LTUS:766: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, "BEND:LTUS:766:CHCKITOL") { field(DESC, "Absolute Check I Tolerance") field(EGU, "A") field(FLNK, "BEND:LTUS:766:TRIMITOL") field(CALC, "ABS(A*B)") field(INPA, "BEND:LTUS:766:CHCKBTOL") field(INPB, "BEND:LTUS:766:POLYCOEF.B") field(PREC, "9") } record(calc, "BEND:LTUS:766:TRIMBTOL") { field(EGU, "kG-m") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(DESC, "Absolute Trim Tolerance") field(CALC, "ABS(A)/2") field(INPA, "BEND:LTUS:766:CHCKBTOL") field(FLNK, "BEND:LTUS:766:CHCKITOL") } record(calc, "BEND:LTUS:766:CHCKBTOL") { field(DESC, "Check absolute tolerance") field(EGU, "A") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(FLNK, "BEND:LTUS:766:TRIMBTOL") field(CALC, "MAX(ABS(A),ABS(C))*(B/1000000)") field(INPA, "BEND:LTUS:766:BDES.HOPR") field(INPB, "BEND:LTUS:766:STABILITY") field(INPC, "BEND:LTUS:766:BDES.LOPR") } record(longout, "BEND:LTUS:766: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, "BEND:LTUS:766:CHCKBTOL") } record(calc, "BEND:LTUS:766:TRIMITOL") { field(DESC, "Absolute Trim I Tolerance") field(EGU, "kG-m") field(CALC, "ABS(A*B)") field(INPA, "BEND:LTUS:766:POLYCOEF.B") field(INPB, "BEND:LTUS:766:TRIMBTOL") field(PREC, "9") } record(ai, "BEND:LTUS:766:TRIMBTOLR") { field(DESC, "Relative trim tol") field(PREC, "4") field(EGU, "%") field(HOPR, "1.0") field(LOPR, "0.0") field(PINI, "YES") } record(ai, "BEND:LTUS:766: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, "BEND:LTUS:766:FBCKFCOM") { field(ZNAM, "CA") field(ONAM, "FCOM") field(DESC, "CA Mode") field(PINI, "YES") field(SDIS, "0") } record(bo, "BEND:LTUS:766:PAU") { field(ZNAM, "NotConfigured") field(ONAM, "Configured") field(DESC, "PAU Present") field(PINI, "YES") field(SDIS, "0") field(FLNK, "BEND:LTUS:766:PAUGO") } record(fanout, "BEND:LTUS:766:PAUGO") { field(DESC, "PAU control") field(LNK1, "BEND:LTUS:766:PAUSTOP") field(LNK2, "BEND:LTUS:766: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, "BEND:LTUS:766:PAUSTART") { field(DESC, "Setup for PAU On") field(SDIS, "BEND:LTUS:766: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, "BEND:LTUS:766:PAUSTOP") { field(DESC, "Setup for PAU Off") field(SDIS, "BEND:LTUS:766: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, "BEND:LTUS:766:MCORDEVNAME") { field(DESC, "PS device name") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, "BEND:LTUS:764:") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "BEND:LTUS:766: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, "BEND:LTUS:766:PSTYPE.RVAL") field(INPC, "BEND:LTUS:766:TURNEDOFF.RVAL") field(INPD, "BEND:LTUS:766:CONFIG.RVAL") field(INPE, "BEND:LTUS:766:PSCATEGORY.RVAL") field(INPF, "BEND:LTUS:766:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "BEND:LTUS:766:AUTOCTRL.RVAL") field(INPJ, "BEND:LTUS:766:OUTOFSERVICE.RVAL") field(INPL, "BEND:LTUS:766:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "BEND:LTUS:766:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "BEND:LTUS:766:PAU") field(INPP, "BEND:LTUS:766:CALBDISABLE.RVAL") field(INPQ, "BEND:LTUS:766:PTRBDISABLE.RVAL") field(INPR, "BEND:LTUS:766:TRIMDISABLE.RVAL") field(INPS, "BEND:LTUS:766:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "BEND:LTUS:766:FBCK") field(INPU, "BEND:LTUS:766:TRIMTYPE.RVAL") field(INPV, "BEND:LTUS:766:STDZDIRECT.RVAL") field(INPW, "BEND:LTUS:766:DEGAUSENABLE.RVAL") field(FLNK, "BEND:LTUS:766:HSTA") } record(longin, "BEND:LTUS:766:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "BEND:LTUS:766:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "BEND:LTUS:766: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, "BEND:LTUS:766: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, "BEND:LTUS:766: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, "BEND:LTUS:766: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, "BEND:LTUS:766: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, "BEND:LTUS:766: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 BEND:LTUS:766:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses BEND:LTUS:766:FBCK. # This PV should be replaced by BEND:LTUS:766: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, "BEND:LTUS:766: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, "BEND:LTUS:766: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, "BEND:LTUS:766: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, "BEND:LTUS:764:OUTOFSERVICE CPP NMS") field(OMSL, "closed_loop") field(FLNK, "BEND:LTUS:766:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"BEND:LTUS:766:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "BEND:LTUS:766:OUTOFSERVICE NPP NMS") field(OUT, "BEND:LTUS:766:ONLINE PP") } record(bo, "BEND:LTUS:766:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "BEND:LTUS:766: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, "BEND:LTUS:766: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, "BEND:LTUS:766: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, "BEND:LTUS:766: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, "BEND:LTUS:766: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, "BEND:LTUS:766: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, "BEND:LTUS:766: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, "BEND:LTUS:766: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, "BEND:LTUS:766: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, "BEND:LTUS:766: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, "BEND:LTUS:766: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, "BEND:LTUS:766:TRIMTYPE") } record(stringout, "BEND:LTUS:766:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "BEND:LTUS:764:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "BEND:LTUS:766:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "BEND:LTUS:766:STATE.RVAL") field(INPB, "BEND:LTUS:766:INTLKSUMY.RVAL") field(OUT, "BEND:LTUS:766:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "BEND:LTUS:766: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, "BEND:LTUS:766:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "BEND:LTUS:766:STATE.RVAL") field(INPB, "BEND:LTUS:766:INTLKSUMY.RVAL") field(OUT, "BEND:LTUS:766:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "BEND:LTUS:766:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "BEND:LTUS:766:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "BEND:LTUS:766: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, "BEND:LTUS:766: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, "BEND:LTUS:766: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, "BEND:LTUS:766: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,"BEND:LTUS:766: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("BEND:LTUS:766:TURNEDOFF",3140,1907,0,1,"BEND:LTUS:766:TURNEDOFF") #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "BEND:LTUS:766:STATSUB") { field(DESC, "Build STATus ") field(INAM, "mgntInit") field(SNAM, "mgntSlcStat") field(INPA, "BEND:LTUS:766:BACT.STAT") field(INPB, "BEND:LTUS:766:BDES.STAT") field(INPC, "BEND:LTUS:766: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, "BEND:LTUS:766:BACT.SEVR") field(INPH, "BEND:LTUS:766:BDES.SEVR") field(INPI, "BEND:LTUS:766: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, "BEND:LTUS:766:STATE.RVAL") field(INPN, "BEND:LTUS:766:STDZOK") field(INPO, "BEND:LTUS:766:CALBOK") field(INPP, "BEND:LTUS:766:OUTOFSERVICE.RVAL") field(INPQ, "BEND:LTUS:766:CONFIG.RVAL") field(INPR, "BEND:LTUS:766:HSTA") field(INPS, "BEND:LTUS:766:CTRL.RVAL") field(INPT, "BEND:LTUS:766:DEGAUSOK") field(INPV, "BEND:LTUS:766: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, "BEND:LTUS:766:STAT") } record(longout, "BEND:LTUS:766:STAT") { field(DESC, "STAT sent to SLC") field(SCAN, "Passive") field(FLNK, "BEND:LTUS:766:STATCTRLSUB") field(DOL, "BEND:LTUS:766:STATSUB.VAL") field(OMSL, "closed_loop") } record(sSub, "BEND:LTUS:766:STATCTRLSUB") { field(DESC, "Decode SLC STAT into mbbo") field(INAM, "mgntInit") field(SNAM, "mgntStatDecode") field(INPA, "BEND:LTUS:766:STAT") field(INPB, "BEND:LTUS:766:HSTA") field(INPD, "BEND:LTUS:766:ONOFFCTRL.RVAL") field(FLNK, "BEND:LTUS:766:STATMSG") } record(mbbo, "BEND:LTUS:766: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, "BEND:LTUS:766:UNAVAILGO") field(DOL, "BEND:LTUS:766:STATCTRLSUB.W") } record(seq, "BEND:LTUS:766:UNAVAILGO") { field(DESC, "Process UNAVAIL") field(DOL1, "BEND:LTUS:766:STATSUB.U") field(LNK1, "BEND:LTUS:766:UNAVAIL PP") } record(stringout, "BEND:LTUS:766:SNLSTATMSG") { field(DTYP, "Soft Channel") } #! TextBox(TB0,820,1000,1200,1220,0,"Dialog",12,1,16777215,"BEND:LTUS:766:STATUSSUB - future\nOverall device status - takes input from action snls, record sevrs, master snl(s) and outputs final status\n\nInputs:\nA - BEND:LTUS:766:CTRLSTATUS - snl status\nB - MGNT:CTRLSTATUS - master list status\nC\nD - BEND:LTUS:766: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,"BEND:LTUS:766STATSUB\nformat control bo's into slc STAT\n\nInputs:\nA - BEND:LTUS:766:STATUS\nC - BEND:LTUS:766:ON\nD - BEND:LTUS:766:STDZOK\nE - BEND:LTUS:766:CALBOK\nF - BEND:LTUS:766:BACTDRIFT (future)\nG -\nH- BEND:LTUS:766:DACSTATUS\nI -BEND:LTUS:766:ADCSTATUS\nJ - BEND:LTUS:766:BACTSTATUS\nK - BEND:LTUS:766:BDESSTATUS\nL - BEND:LTUS:766:RIPLSTATUS\n\nOutput:\nP - BEND:LTUS:766: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, "BEND:LTUS:766: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, "BEND:LTUS:766: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, "BEND:LTUS:766: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, "BEND:LTUS:766: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, "BEND:LTUS:766:IDESTOTAL"){ field(DESC, "Calc total current") field(CALC, "A+B") field(EGU, "kG-m") field(PREC, "7") field(INPA, "BEND:LTUS:764:IDES CP NMS") field(INPB, "BTRM:LTUS:766:BDES CP NMS") field(OUT, "BEND:LTUS:766:IDES2BDES.E PP") } record(sub, "BEND:LTUS:766:IDES2BDES") { field(DESC, "Cal BDES") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "BEND:LTUS:766:IDES2BDES") field(INPB, "BEND:LTUS:766:POLYCOEF") field(INPC, "BEND:LTUS:766:POLYCOEF.A") field(INPD, "BEND:LTUS:766:POLYCOEF.B") field(INPE, "BEND:LTUS:766:IDESTOTAL MS") field(INPF, "BEND:LTUS:764:BDELTAS PP") field(INPG, "100") field(EGU, "kG-m") field(HOPR, "2.7597") field(LOPR, "-2.7915") field(HIHI, "2.7597") field(LOLO, "-2.7915") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "2.7597") field(LOW, "-2.7915") field(FLNK, "BEND:LTUS:766: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, "BEND:LTUS:766:IACTCALC"){ field(DESC, "Calc total act current") field(CALC, "A+B") field(EGU, "kG-m") field(PREC, "7") field(INPA, "BEND:LTUS:766:IACT CP NMS") field(INPB, "BTRM:LTUS:766:BACT") field(OUT, "BEND:LTUS:766: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, "BEND:LTUS:766:IMONCALC"){ field(DESC, "Calc total mon current") field(CALC, "A+B") field(EGU, "kG-m") field(PREC, "7") field(INPA, "BEND:LTUS:766:IMON CP NMS") field(INPB, "BTRM:LTUS:766:BMON") field(OUT, "BEND:LTUS:766: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, "BEND:LTUS:766:ICONTOTAL"){ field(DESC, "Calc total current") field(CALC, "A+B") field(EGU, "kG-m") field(PREC, "7") field(INPA, "BEND:LTUS:764:ICON CP NMS") field(INPB, "BTRM:LTUS:766:BCON CP NMS") field(OUT, "BEND:LTUS:766:ICON2BCON.E PP") } record(sub, "BEND:LTUS:766:ICON2BCON") { field(DESC, "Cal BCON") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "BEND:LTUS:766:ICON2BCON") field(INPB, "BEND:LTUS:766:POLYCOEF") field(INPC, "BEND:LTUS:766:POLYCOEF.A") field(INPD, "BEND:LTUS:766:POLYCOEF.B") field(INPE, "BEND:LTUS:766:ICONTOTAL MS") field(INPF, "BEND:LTUS:764:BDELTAS PP") field(INPG, "100") field(EGU, "kG-m") field(HOPR, "2.7597") field(LOPR, "-2.7915") field(HIHI, "2.7597") field(LOLO, "-2.7915") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "2.7597") field(LOW, "-2.7915") field(FLNK, "BEND:LTUS:766:BCON") } #! 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, "QUAD:LTUS:270:IACT") { field(DESC, "Current") field(INP, "QUAD:LTUS:235:IACT CP NMS") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "QUAD:LTUS:270:BACT") info(autosaveFields,"HYST") } record(bi, "QUAD:LTUS:270:STATE") { field(DESC, "PS On/Off Status") field(DTYP, "Raw Soft Channel") field(INP, "QUAD:LTUS:235:STATE CP MS") field(ZSV, "MAJOR") field(ZNAM, "OFF") field(ONAM, "ON") } record(ao, "QUAD:LTUS:270:IDES") { field(DESC, "Desired Current") field(PREC, "3") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(MDEL, "-1") field(HIHI, "165.0") field(LOLO, "0.0") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "QUAD:LTUS:270:BDELTAS") field(DRVH, "165.0") field(DRVL, "0.0") field(DOL, "QUAD:LTUS:270: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, "QUAD:LTUS:270:ICTRL PP") } # This record is processed by QUAD:LTUS:270:ICON") # Note: we are not setting alarms here. record(ao, "QUAD:LTUS:270:ICON") { field(DESC, "Config I") field(DTYP, "Soft Channel") field(PREC, "3") field(HOPR, "165.0") field(LOPR, "0.0") field(DRVH, "165.0") field(DRVL, "0.0") field(DOL, "QUAD:LTUS:270:B2ICON.K") field(OMSL, "closed_loop") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:270:INOM") { field(DESC, "Nominal Current") field(DOL, "QUAD:LTUS:270:BNOM.K") field(OMSL, "closed_loop") field(PREC, "3") field(EGU, "A") field(DRVH, "165.0") field(DRVL, "0.0") field(HOPR, "165.0") field(LOPR, "0.0") } record(ao, "QUAD:LTUS:270:ICTRL") { field(DESC, "Set Current") field(PREC, "3") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(DRVH, "165.0") field(DRVL, "0.0") field(MDEL, "-1") field(FLNK, "QUAD:LTUS:270:ICTRLGO") field(OMSL, "supervisory") info(autosavefields,"VAL") } record(seq, "QUAD:LTUS:270:ICTRLGO") { field(DESC, "Process Current Setpoint") field(PREC, "3") # Set ISETPT to supervisory field(DOL1, "0") field(LNK1, "QUAD:LTUS:270:ISETPT.OMSL") field(DOL2, "QUAD:LTUS:270:ICTRL") field(LNK2, "QUAD:LTUS:270:ISETPT PP") # Set ISETPT to closed loop - get data from BCTRLSUB.K field(DOL3, "1") field(LNK3, "QUAD:LTUS:270:ISETPT.OMSL") } record(ao, "QUAD:LTUS:270:IMAX") { field(DESC, "Max I") field(DTYP, "Soft Channel") field(DRVH, "165.0") field(DRVL, "0.0") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(PREC, "3") field(PINI, "YES") field(VAL, "165.0") field(FLNK, "QUAD:LTUS:270:IMIN") } record(ao, "QUAD:LTUS:270:IMIN") { field(DESC, "Min I") field(DTYP, "Soft Channel") field(DRVH, "165.0") field(DRVL, "0.0") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(PREC, "3") field(VAL, "0.0") field(FLNK, "QUAD:LTUS:270:IRANGE") } record(sel, "QUAD:LTUS:270:IACTPREVOK") { field(DESC, "Last Good Current") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(PREC, "3") field(NVL, "QUAD:LTUS:270:BACT.SEVR") field(INPA, "QUAD:LTUS:270:IACT NPP MS") field(INPB, "QUAD:LTUS:270:IACTPREVOK NPP MS") field(INPC, "QUAD:LTUS:270:IACTPREVOK NPP MS") field(INPD, "QUAD:LTUS:270:IACTPREVOK NPP MS") } record(sub, "QUAD:LTUS:270:IACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:270:IDES") field(INPB, "QUAD:LTUS:270:ISETPT.DRVH") field(INPC, "QUAD:LTUS:270:ISETPT.DRVL") field(INPD, "QUAD:LTUS:270:IDELTAS.I") field(INPE, "QUAD:LTUS:270:IDELTAS.J") field(INPG, "QUAD:LTUS:270:STATE") field(INPH, "QUAD:LTUS:270:HSTA") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(sub, "QUAD:LTUS:270:IMONLIMITS") { field(DESC, "Aux Current Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:270:IDES") field(INPB, "QUAD:LTUS:270:ISETPT.DRVH") field(INPC, "QUAD:LTUS:270:ISETPT.DRVL") field(INPD, "QUAD:LTUS:270:IDELTAS.K") field(INPE, "QUAD:LTUS:270:IDELTAS.L") field(INPG, "QUAD:LTUS:270:STATE") field(INPH, "QUAD:LTUS:270:HSTA") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(seq, "QUAD:LTUS:270:ILIMITS") { field(DESC, "Set ACT and MON Limits") field(PREC, "3") field(DOL1, "QUAD:LTUS:270:BLIMITS") field(LNK1, "QUAD:LTUS:270:IACTLIMITS.F PP") field(DOL2, "QUAD:LTUS:270:IACTLIMITS.I") field(LNK2, "QUAD:LTUS:270:IACT.HIGH") field(DOL3, "QUAD:LTUS:270:IACTLIMITS.J") field(LNK3, "QUAD:LTUS:270:IACT.LOW") field(DOL4, "QUAD:LTUS:270:IACTLIMITS.K") field(LNK4, "QUAD:LTUS:270:IACT.HIHI") field(DOL5, "QUAD:LTUS:270:IACTLIMITS.L") field(LNK5, "QUAD:LTUS:270:IACT.LOLO") field(DOL6, "QUAD:LTUS:270:BLIMITS") field(LNK6, "QUAD:LTUS:270:IMONLIMITS.F PP") field(DOL7, "QUAD:LTUS:270:IMONLIMITS.I") field(LNK7, "QUAD:LTUS:270:IMON.HIGH") field(DOL8, "QUAD:LTUS:270:IMONLIMITS.J") field(LNK8, "QUAD:LTUS:270:IMON.LOW") field(DOL9, "QUAD:LTUS:270:IMONLIMITS.K") field(LNK9, "QUAD:LTUS:270:IMON.HIHI") field(DOLA, "QUAD:LTUS:270:IMONLIMITS.L") field(LNKA, "QUAD:LTUS:270: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, "QUAD:LTUS:270:IDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntRawDeltas") field(INPD, "QUAD:LTUS:270:TRIMBTOL") field(INPE, "QUAD:LTUS:270:CHCKBTOL") field(INPF, "QUAD:LTUS:270:BDELTAS.K") field(INPG, "QUAD:LTUS:270:BDELTAS.L") field(INPH, "QUAD:LTUS:270: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, "QUAD:LTUS:270:STDZITOLR") field(INPC, "QUAD:LTUS:270:STDZITOL") field(FLNK, "") } # All ps controllers with on/off control will set the macro ONOF # as follows: # # ONOF = QUAD:LTUS:235: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, "QUAD:LTUS:270: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 = QUAD:LTUS:235:RESET PP # record(bo, "QUAD:LTUS:270: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, "QUAD:LTUS:270:RAMPSTATE") { field(DESC, "PS Ramp Status") field(DTYP, "Soft Channel") field(DOL, "QUAD:LTUS:235: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, "QUAD:LTUS:270: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, "QUAD:LTUS:270:TRIMRAMPRATE") field(OUT, "") field(FLNK, "QUAD:LTUS:270:STDZDLY") } record(ao, "QUAD:LTUS:270:ISETPT") { field(DESC, "Current Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(DRVH, "165.0") field(DRVL, "0.0") field(MDEL, "-1") field(OUT, "") field(DOL, "QUAD:LTUS:270: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, "QUAD:LTUS:270:IMON") { field(DESC, "Aux Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(INP, "QUAD:LTUS:235:IMON CP NMS") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "QUAD:LTUS:270:BMON") } record(ao, "QUAD:LTUS:270:IRIPL") { field(DESC, "Ripple Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(DOL, "QUAD:LTUS:235:IRIPL CP NMS") field(OMSL, "closed_loop") field(EGU, "A") field(DRVH, "1.0") field(HOPR, "1.0") field(PREC, "3") field(FLNK, "QUAD:LTUS:270:IRIPLOK") } record(sub, "QUAD:LTUS:270:IRIPLOK") { field(DESC, "Ripple Current Status") field(INAM, "mgntInit") field(SNAM, "mgntRiplOK") field(INPA, "QUAD:LTUS:270:IRIPL.VAL") field(INPB, "QUAD:LTUS:270: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, "QUAD:LTUS:270:R") { field(DESC, "Resistance") field(EGU, "Ohms") field(PREC, "4") field(PINI, "YES") field(DOL, "QUAD:LTUS:235: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, "QUAD:LTUS:270:IGND") { field(DESC, "Ground Current") field(EGU, "A") field(PREC, "6") field(PINI, "YES") field(DOL, "QUAD:LTUS:235:IGND CP MS") field(OMSL, "closed_loop") } record(bi, "QUAD:LTUS:270:INTLKSUMY") { field(DESC, "Interlock Summary") field(INP, "QUAD:LTUS:235:INTLKSUMY CP MS") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(ZNAM, "OK") field(ONAM, "FAULT") field(PINI, "NO") } record(mbbo, "QUAD:LTUS:270: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, "QUAD:LTUS:235:COOLING CP NMS") field(OMSL, "closed_loop") } # The following PV is processed by :BACTFO # which is processed by :BACT record(fanout, "QUAD:LTUS:270:IACTFO") { field(DESC, "IACT processing") field(SELM, "All") field(LNK1, "QUAD:LTUS:270:IACTPREVOK") field(LNK2, "QUAD:LTUS:270:IDIFF") field(LNK3, "QUAD:LTUS:270:IADIFF") field(LNK4, "QUAD:LTUS:270:IRATIO") field(LNK5, "QUAD:LTUS:270:IDIRECT") field(LNK6, "QUAD:LTUS:270:IACTPOL_CHECK") } record(calc, "QUAD:LTUS:270:IDIFF") { field(DESC, "IDES-IACT") field(CALC, "A-B") field(INPA, "QUAD:LTUS:270:IDES") field(INPB, "QUAD:LTUS:270:IACT") field(EGU, "A") field(PREC, "9") field(HOPR, "165.0") field(LOPR, "0.0") } record(calc, "QUAD:LTUS:270:IADIFF") { field(DESC, "Absolute IDES-IACT") field(CALC, "A<0?ABS(A):A") field(INPA, "QUAD:LTUS:270:IDIFF") field(PREC, "9") } record(calc, "QUAD:LTUS:270:IRATIO") { field(DESC, "IDES-IACT/IMAX") field(CALC, "B?A/B:0") field(INPA, "QUAD:LTUS:270:IDIFF") field(INPB, "QUAD:LTUS:270:IDES.DRVH") field(PREC, "9") } record(calcout, "QUAD:LTUS:270:IRANGE") { field(DESC, "Current Range") field(PINI, "YES") field(CALC, "ABS(A-B)") field(INPA, "QUAD:LTUS:270:IMIN") field(INPB, "QUAD:LTUS:270: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, "QUAD:LTUS:270: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, "QUAD:LTUS:270:IACT") field(FLNK, "QUAD:LTUS:270:IACTPOL") } record(bo, "QUAD:LTUS:270:IACTPOL") { field(DESC, "Actual I Polarity") field(DTYP, "Raw Soft Channel") field(DOL, "QUAD:LTUS:270: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,"QUAD:LTUS:270:I*LIMITS:\n Calculate alarm and warning limits based on \n deltas from QUAD:LTUS:270:IDELTAS and the\n QUAD:LTUS:270: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,"QUAD:LTUS:270:IACT: \n Get copy of QUAD:LTUS:270:I. \n",null) #! TextBox(TB12,1280,3100,1760,3200,0,"Dialog",12,1,16777215,"QUAD:LTUS:270: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,"QUAD:LTUS:270:IDES:\n Contains raw value calculated by \nQUAD:LTUS:270: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 \nQUAD:LTUS:270:BDELTAS.\n",null) #! TextBox(TB10,56,1940,316,2340,0,"Dialog",12,1,16777215,"QUAD:LTUS:270: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 QUAD:LTUS:270: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 QUAD:LTUS:270: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,"QUAD:LTUS:270:ISETPT:\n Sets the hardware. When fast feedback is set on, this record is\n set to closed loop mode by QUAD:LTUS:270:FBCKSTART sequence. When \n the loop is closed, this record takes input calculated by \n BFBCK only. When fast feedback is set off, QUAD:LTUS:270:FBCKSTOP \n will set it back to supervisory so that the value can be set by \n QUAD:LTUS:270: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, "QUAD:LTUS:270:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:270:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "QUAD:LTUS:270:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "QUAD:LTUS:270:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "QUAD:LTUS:270:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "QUAD:LTUS:270:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "1") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "QUAD:LTUS:270: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, "QUAD:LTUS:270:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "QUAD:LTUS:270:TRIMTYPE.RVAL") field(INPB, "QUAD:LTUS:270:CONFIG.RVAL") field(OUT, "QUAD:LTUS:270:TRIMMAXNUM PP") } record(longout, "QUAD:LTUS:270: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, "QUAD:LTUS:270: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, "QUAD:LTUS:235:TRIMRAMPRATE CP NMS") field(OMSL, "closed_loop") field(VAL, "") field(OUT, "QUAD:LTUS:270:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "QUAD:LTUS:270: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, "QUAD:LTUS:235:TRIMSETL CP NMS") field(OMSL, "closed_loop") field(VAL, "") } record(bo, "QUAD:LTUS:270: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, "QUAD:LTUS:270: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, "QUAD:LTUS:270: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, "0") } record(bo, "QUAD:LTUS:270:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "0") } record(ao, "QUAD:LTUS:270: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, "QUAD:LTUS:270:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "QUAD:LTUS:270: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, "QUAD:LTUS:270: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, "QUAD:LTUS:270:IMOVE") field(INPB, "QUAD:LTUS:270:IACT") field(INPC, "QUAD:LTUS:270:IRAMPRATE") field(INPD, "1.0") field(INPE, "QUAD:LTUS:270:TRIMDLYPCT") field(INPF, "QUAD:LTUS:270:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "QUAD:LTUS:270:RAMPTIME_LEFT PP") } record(longout, "QUAD:LTUS:270:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "QUAD:LTUS:270:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "QUAD:LTUS:270:RAMPDONE_CALC") } record(calc, "QUAD:LTUS:270:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "QUAD:LTUS:270:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "QUAD:LTUS:270:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "QUAD:LTUS:270: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, "QUAD:LTUS:270:RAMPTIME_LEFT") field(OUT, "QUAD:LTUS:270:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "QUAD:LTUS:270:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "QUAD:LTUS:270:RAMPTIME_LEFT NMS") field(OUT, "QUAD:LTUS:270:RAMPDONE PP") } record(bo, "QUAD:LTUS:270:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "QUAD:LTUS:270:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "QUAD:LTUS:270: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, "QUAD:LTUS:270: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, "QUAD:LTUS:270:STDZINIT") { field(DESC, "Proc. Stdz PVs on boot") field(PINI, "YES") field(DOL1, "1") field(DOL2, "1") field(DOL3, "1") field(LNK1, "QUAD:LTUS:270:DEBUG.PROC PP") field(LNK2, "QUAD:LTUS:270:STDZCYCLENUM.PROC PP") field(LNK3, "QUAD:LTUS:270:STDZDISABLE.PROC PP") field(LNK4, "QUAD:LTUS:270: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, "QUAD:LTUS:270:STDZSUB") { field(DESC, "Stdz subroutine") field(INAM, "mgntStdzInit") field(SNAM, "mgntStdz") field(BRSV, "INVALID") field(INPA, "QUAD:LTUS:270:STDZIMIN NPP NMS") field(INPB, "QUAD:LTUS:270:STDZIMAX NPP NMS") field(INPC, "QUAD:LTUS:270:STDZIFINAL NPP NMS") field(INPD, "QUAD:LTUS:270:STDZCYCLENUM NPP NMS") field(INPE, "QUAD:LTUS:270:STDZDIRECT.RVAL NPP NMS") field(INPF, "QUAD:LTUS:270:STDZDISABLE.RVAL CPP NMS") field(INPG, "QUAD:LTUS:270: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, "QUAD:LTUS:270:STDZWF PP") field(OUTB, "QUAD:LTUS:270: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, "QUAD:LTUS:270:STDZWF") } record(mbbo, "QUAD:LTUS:270: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, "QUAD:LTUS:270: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, "QUAD:LTUS:270:STDZMAINPS") { field(DESC, "Stdz by main or self") field(PINI, "YES") field(DTYP, "Soft Channel") field(ZNAM, "SELF") field(ONAM, "MAIN") } record(bo, "QUAD:LTUS:270: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, "QUAD:LTUS:270: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, "QUAD:LTUS:270: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, "QUAD:LTUS:270:STDZTOD") { field(DESC, "Successful Standardize Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "QUAD:LTUS:270:STDZLOSTTOD") { field(DESC, "Standardize Lost Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(longout, "QUAD:LTUS:270:STDZCYCLECNT") { field(DESC, "Cycle Count") field(PINI, "YES") } record(longout, "QUAD:LTUS:270: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, "QUAD:LTUS:270:STDZDIRECT") } # The default standardize direction is "UP" for # all LCLS Magnets.. record(bo, "QUAD:LTUS:270:STDZDIRECT") { field(DESC, "Standardize Direction ") field(ZNAM, "UP") field(ONAM, "DOWN") field(VAL, "0") field(FLNK, "QUAD:LTUS:270:STDZIMIN") } record(ao, "QUAD:LTUS:270:STDZIMIN") { field(DESC, "Min-STDZ Current") field(PREC, "1") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(VAL, "0.0") field(FLNK, "QUAD:LTUS:270:STDZIMAX") } record(ao, "QUAD:LTUS:270:STDZIMAX") { field(DESC, "Max. Standarize Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(VAL, "165.0") field(FLNK, "QUAD:LTUS:270:STDZIFINAL") } record(ao, "QUAD:LTUS:270:STDZIFINAL") { field(DESC, "Final SDTZ Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(VAL, "0.0") field(FLNK, "QUAD:LTUS:270: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, "QUAD:LTUS:270: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, "QUAD:LTUS:270:STDZITOL") { field(DESC, "Stdz min tolerance") field(PREC, "5") field(CALC, "MAX(ABS(A),ABS(B))*C") field(INPA, "QUAD:LTUS:270:STDZIMIN CP NMS") field(INPB, "QUAD:LTUS:270:STDZIMAX CP MMS") field(INPC, "0.05") field(INPD, "QUAD:LTUS:270:STDZITOLR CP MMS") field(EGU, "A") field(FLNK, "QUAD:LTUS:270:IDELTAS") field(PINI, "YES") } # D - factor (3.154/2 = 1.577) for EPSC, otherwise, set to 1.0 record(calc, "QUAD:LTUS:270:STDZDLY") { field(DESC, "Ramp time for stdz cycle") field(CALC, "C>0?MAX(1,ABS((A-B)/C)*D):0") field(INPA, "QUAD:LTUS:270:STDZIMIN CP NMS") field(INPB, "QUAD:LTUS:270:STDZIMAX CP NMS") field(INPC, "QUAD:LTUS:270:TRIMRAMPRATE CP NMS") field(INPD, "1.0") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") } record(calc, "QUAD:LTUS:270:STDZRAMPDLY") { field(DESC, "Ramp delay total") field(CALC, "MAX(1,((A/100)*B+B))") field(PREC, "5") field(INPA, "QUAD:LTUS:270:TRIMDLYPCT CP MS") field(INPB, "QUAD:LTUS:270: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, "QUAD:LTUS:270:STDZMINIDLY") { field(DESC, "Mini-stdz delay") field(CALC, "A") field(PREC, "5") field(A, "1.0") field(EGU, "sec") field(PINI, "YES") } record(ao, "QUAD:LTUS:270: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, "QUAD:LTUS:270:STDZMINIDELTA") { field(DESC, "Stdz mini % of IMAX") field(CALC, "(B/100)*(A-C)") field(INPA, "QUAD:LTUS:270:IDES.HOPR") field(INPB, "QUAD:LTUS:270:STDZMINIPCT CPP NMS") field(INPC, "QUAD:LTUS:270:IDES.LOPR") field(PREC, "5") } record(calc, "QUAD:LTUS:270:STDZMINISETPT") { field(DESC, "Mini Stdz delta") field(CALC, "C==0?MAX(E-D,B):MIN(E+D,A)") field(INPA, "QUAD:LTUS:270:IDES.HOPR") field(INPB, "QUAD:LTUS:270:IDES.LOPR") field(INPC, "QUAD:LTUS:270:STDZDIRECT.RVAL") field(INPD, "QUAD:LTUS:270:STDZMINIDELTA") field(INPE, "QUAD:LTUS:270:IDES") field(PREC, "5") field(FLNK, "QUAD:LTUS:270: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, "QUAD:LTUS:270:STDZMINISETPTOOR") { field(DESC, "Mini Stdz setpoint out of range") field(CALC, "C==0?(E-DA)") field(INPA, "QUAD:LTUS:270:IDES.HOPR") field(INPB, "QUAD:LTUS:270:IDES.LOPR") field(INPC, "QUAD:LTUS:270:STDZDIRECT.RVAL") field(INPD, "QUAD:LTUS:270:STDZMINIDELTA") field(INPE, "QUAD:LTUS:270: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, "QUAD:LTUS:270: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, "QUAD:LTUS:270:IADJUST.RVAL") field(INPB, "QUAD:LTUS:270:STDZDIRECT.RVAL") field(INPC, "QUAD:LTUS:270:STDZOK.RVAL") field(INPD, "QUAD:LTUS:270:STDZDISABLE.RVAL") field(INPE, "QUAD:LTUS:270:STATE.RVAL CPP NMS") field(INPF, "QUAD:LTUS:270:ICTRL.RVAL") field(INPG, "QUAD:LTUS:270:STATE.SEVR") field(INPH, "QUAD:LTUS:270:BDELTAS.M") field(INPI, "QUAD:LTUS:270:IACT.SEVR") field(OUT, "QUAD:LTUS:270:STDZLOSTGO.SELN PP NMS") field(OOPT, "Transition To Non-zero") } record(seq, "QUAD:LTUS:270:STDZLOSTGO") { field(DESC, "Process lost stdz") field(SELM, "Mask") field(DOL1, "1") field(DOL2, "0") field(LNK1, "QUAD:LTUS:270:STDZLOSTTOD.PROC") field(LNK2, "QUAD:LTUS:270:STDZOK PP") } # Record maximum current after standardize # Reset to IACT from sequence after trim # Disable processing during (mini-)standardize or trim record(calc, "QUAD:LTUS:270:STDZIACTMAX") { field(DESC, "Max act current after stdz") field(CALC, "MAX(A, B)") field(DISV, "0") field(SDIS, "QUAD:LTUS:270:CHECKPWRDIP_ENABLE") field(INPA, "QUAD:LTUS:270:IACT CP") field(INPB, "QUAD:LTUS:270:STDZIACTMAX") field(EGU, "A") field(FLNK, "QUAD:LTUS:270:CHECKPWRDIP") } # Detect power dip if STDZOK is YES, STDZ is enabled, and IACT is valid # If IACT drops below STDZIACTMAX by more than the trim tolerance, clear STDZOK # Warning: Take the absolute value of the trim tolerance, or else quads of # negative polarity will always lose STDZ since their IDELTAS.I are negative. # Note: Large quads and bends are prone to losing STDZ even if they are # perturbed toward higher current since their current tends to overshoot # by greater than the trim tolerance before settling down. record(calcout, "QUAD:LTUS:270:CHECKPWRDIP") { field(DESC, "Detect power dip") field(CALC, "(A-B>ABS(C))?3:0") field(DISV, "0") field(SDIS, "QUAD:LTUS:270:CHECKPWRDIP_ENABLE") field(INPA, "QUAD:LTUS:270:STDZIACTMAX") field(INPB, "QUAD:LTUS:270:IACT") field(INPC, "QUAD:LTUS:270:IDELTAS.I") field(OUT, "QUAD:LTUS:270:STDZLOSTGO.SELN PP NMS") field(OOPT, "When Non-zero") } # Enable processing of STDZIACTMAX and CHECKPWRDIP only if # STDZOK = YES, STDZDISABLE = NO, CTRL != Trim (2), and # CTRL != Stdz (4) record(calc, "QUAD:LTUS:270:CHECKPWRDIP_ENABLE") { field(CALC, "A&&!B&&(C#2)&&(C#4)") field(INPA, "QUAD:LTUS:270:STDZOK.RVAL CP") field(INPB, "QUAD:LTUS:270:STDZDISABLE.RVAL CP") field(INPC, "QUAD:LTUS:270:CTRL.RVAL CP") } #! 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, "QUAD:LTUS:270: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, "QUAD:LTUS:270: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, "QUAD:LTUS:270:CALBSET") { field(DESC, "Use DAC Calbration") field(SCAN, "10 second") field(CALC, "A&&(B==0)&&C?31:960") field(INPA, "QUAD:LTUS:270:CALBOK") field(INPB, "QUAD:LTUS:270:CALBDISABLE") field(INPC, "QUAD:LTUS:270:CALBSLOPE") field(OOPT, "On Change") field(OUT, "QUAD:LTUS:270: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, "QUAD:LTUS:270:CALB_SEQ") { field(DESC, "Output Calib Values") field(SELM, "Mask") field(SELL, "QUAD:LTUS:270: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, "QUAD:LTUS:270:CALBSLOPE") field(DOL3, "QUAD:LTUS:270: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, "QUAD:LTUS:270:CALBTOD") { field(DESC, "Calibration Success Time") field(PINI, "YES") # field(DOL, "") field(OMSL, "supervisory") field(DTYP, "Soft Channel") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:270: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, "QUAD:LTUS:270: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, "QUAD:LTUS:270: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, "QUAD:LTUS:270:CALBOFFSET") { field(DESC, "Calc DAC Offset") field(PREC, "6") field(EGU, "Counts") field(PINI, "YES") } record(bo, "QUAD:LTUS:270: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, "QUAD:LTUS:270:DACSLOPE") { field(DESC, "V to DAC slope") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "supervisory") field(PINI, "YES") field(FLNK, "QUAD:LTUS:270:DACOFFSET") } # Default Offset used in conversion from Volts to DAC Counts record(ao, "QUAD:LTUS:270:DACOFFSET") { field(DESC, "V to DAC offset") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "supervisory") field(PINI, "YES") field(FLNK, "QUAD:LTUS:270: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, "QUAD:LTUS:270: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, "QUAD:LTUS:270:IACT") field(INPD, "QUAD:LTUS:270:DACSLOPE") field(INPE, "QUAD:LTUS:270:DACOFFSET") field(EGU, "Counts") field(PREC, "6") } record(ao, "QUAD:LTUS:270:DAC") { field(DESC, "DAC Set point") field(EGU, "Counts") field(DOL, "") field(OMSL, "supervisory") field(PREC, "6") field(PINI, "YES") } record(ao, "QUAD:LTUS:270:CALBIMIN") { field(DESC, "Calibration Min Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(DRVH, "165.0") field(HOPR, "165.0") field(DRVL, "0.0") field(LOPR, "0.0") field(PREC, "3") field(EGU, "A") field(VAL, "0.0") field(FLNK, "QUAD:LTUS:270:CALBIMAX") } record(ao, "QUAD:LTUS:270:CALBIMAX") { field(DESC, "Calibration Max Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(DRVH, "165.0") field(HOPR, "165.0") field(LOPR, "0.0") field(DRVL, "0.0") field(EGU, "A") field(VAL, "165.0") field(FLNK, "QUAD:LTUS:270:CALBSTEPNUM") } record(ao, "QUAD:LTUS:270:CALBIFINAL") { field(DESC, "Calibration Last Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(PREC, "3") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(VAL, "0") } record(longout, "QUAD:LTUS:270: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, "QUAD:LTUS:270:CALBIDELTA") } record(calc, "QUAD:LTUS:270:CALBIDELTA") { field(DESC, "Step size for CALB") field(CALC, "C=0?0:ABS((A-B)/C)") field(INPA, "QUAD:LTUS:270:CALBIMAX") field(INPB, "QUAD:LTUS:270:CALBIMIN") field(INPC, "QUAD:LTUS:270: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, "QUAD:LTUS:270:CALBIMULT") { field(DESC, "IACT vs ISETPT mult") field(CALC, "C#0||A=0?1:ABS(B/A)") field(INPA, "QUAD:LTUS:235:ISETPT.DRVH") field(INPB, "QUAD:LTUS:235:IACT.HOPR") field(INPC, "QUAD:LTUS:270:PSCONTROLLER.RVAL CPP") field(EGU, "A") field(PINI, "YES") } # SNL dbputs DAC values here. 6-10 steps are possible. record(waveform, "QUAD:LTUS:270:CALBICTRLWF") { field(DESC, "ICTRL setpoint array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") } record(waveform, "QUAD:LTUS:270:DACWF") { field(DESC, "DAC count array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:270:DACSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:270:DACSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "QUAD:LTUS:270: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, "QUAD:LTUS:270:CALCDACWF") { field(DESC, "Calc DAC counts array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:270:CALCDACSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:270:CALCDACSA") { field(DESC, "Calc DAC counts") field(DTYP, "Soft Channel") field(INP, "QUAD:LTUS:270: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, "QUAD:LTUS:270:CALBYWF") { field(DESC, "mx + b") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:270:CALBYSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:270:CALBYSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "QUAD:LTUS:270:CALBYWF") field(MALM, "10") field(NELM, "6") field(INDX, "0") field(FTVL, "DOUBLE") } record(waveform, "QUAD:LTUS:270:CALBIACTWF") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:270:CALBIACTSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:270:CALBIACTSA") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(MALM, "10") field(NELM, "6") field(INP, "QUAD:LTUS:270:CALBIACTWF") field(INDX, "0") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:270:CALBLIMITS") } # Check that measured current during calibration is within # tolerance. record(aSub, "QUAD:LTUS:270: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, "QUAD:LTUS:270:CALBSTEPNUM") field(INPB, "QUAD:LTUS:270:CALBIACTWF") field(INPC, "QUAD:LTUS:270: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, "QUAD:LTUS:270: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, "QUAD:LTUS:270:STDZITOL") field(INPH, "QUAD:LTUS:270:DACSLOPE") field(INPI, "QUAD:LTUS:270: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, "QUAD:LTUS:270: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, "QUAD:LTUS:270:CALBSTEPNUM") field(INPB, "QUAD:LTUS:270:CALBIACTWF") field(INPC, "QUAD:LTUS:270:DACWF") field(INPF, "QUAD:LTUS:270: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 QUAD:LTUS:270CALBOK 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, "QUAD:LTUS:270:DEGAUSINIT") { field(DESC, "Proc. Degauss PVs on boot") field(PINI, "YES") field(DOL, "1") field(OUTA, "QUAD:LTUS:270:DEGAUSIMIN.PROC PP") field(OUTB, "QUAD:LTUS:270:DEGAUSIMAX.PROC PP") field(OUTC, "QUAD:LTUS:270:DEGAUSTYPE.PROC PP") field(OUTD, "QUAD:LTUS:270:DEGAUSSTEP.PROC PP") field(OUTE, "QUAD:LTUS:270:MADNAME.PROC PP") field(OUTF, "QUAD:LTUS:270:PSTYPE.PROC PP") field(OUTG, "QUAD:LTUS:270: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, "QUAD:LTUS:270:DEGAUSSUB") { field(DESC, "Degauss subroutine") field(INAM, "mgntDegaussInit") field(SNAM, "mgntDegauss") field(BRSV, "INVALID") field(INPA, "QUAD:LTUS:270:DEGAUSIMIN NPP NMS") field(INPB, "QUAD:LTUS:270:DEGAUSIMAX NPP NMS") field(INPC, "QUAD:LTUS:270:DEGAUSTYPE.RVAL NPP NMS") field(INPE, "QUAD:LTUS:270:DEGAUSMETHOD.RVAL NPP NMS") field(INPF, "QUAD:LTUS:270:PSTYPE NPP NMS") field(INPG, "QUAD:LTUS:270:DEBUG.RVAL NPP NMS") field(INPH, "QUAD:LTUS:270: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, "QUAD:LTUS:270:DEGAUSWF PP") field(OUTB, "QUAD:LTUS:270:DEGAUSMSG PP") field(OUTC, "QUAD:LTUS:270: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, "QUAD:LTUS:270:DEGAUSWF") { field(DESC, "Degauss Setpts") field(NELM, "60") field(FTVL, "DOUBLE") } record(mbbo,"QUAD:LTUS:270: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, "QUAD:LTUS:270: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, "QUAD:LTUS:270: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, "QUAD:LTUS:270: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, "QUAD:LTUS:270: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, "QUAD:LTUS:270:DEGAUSIMIN") { field(DESC, "Min. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "165.0") field(LOPR, "-165.0") field(DRVH, "165.0") field(DRVL, "-165.0") field(VAL, "-165.0") } record(ao, "QUAD:LTUS:270:DEGAUSIMAX") { field(DESC, "Max. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "165.0") field(LOPR, "-165.0") field(DRVH, "165.0") field(DRVL, "-165.0") field(VAL, "165.0") } # 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,"QUAD:LTUS:270: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, "QUAD:LTUS:270: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,"QUAD:LTUS:270: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, "QUAD:LTUS:270: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, "QUAD:LTUS:270: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, "QUAD:LTUS:270: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, "QUAD:LTUS:270:DEGAUSTOD") { field(DESC, "Successful Degauss Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "QUAD:LTUS:270:DEGAUSLOSTTOD") { field(DESC, "Degauss Lost Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:270:DEGAUSTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "QUAD:LTUS:270:DEGAUSTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "QUAD:LTUS:270: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, "QUAD:LTUS:270:DEGAUSGO") { field(DESC, "Set bdes of btrms to zero") field(ASG, "Internal") field(OUTA, "") field(OUTB, "") field(OUTC, "") field(OUTD, "") } # =========== CRYO ONLY =========== record(bo, "QUAD:LTUS:270: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, "QUAD:LTUS:270:DEGAUS_IMAX_CHECK") { field(DESC, "Check if imax shoud chg") field(CALC, "(C==4)&&(ABS(B)>ABS(A))?1:0") field(INPA, "QUAD:LTUS:270:DEGAUS_IMAX") field(INPB, "QUAD:LTUS:270:ISETPT") field(INPC, "QUAD:LTUS:270:DEGAUSTYPE.RVAL") field(OUT, "QUAD:LTUS:270:DEGAUS_IMAX_UPDATE.SELN") field(FLNK, "QUAD:LTUS:270:DEGAUS_IMAX_UPDATE") } record(seq, "QUAD:LTUS:270:DEGAUS_IMAX_UPDATE") { field(DESC, "Degauss IMAX Update") field(SELM, "Specified") field(DOL1, "QUAD:LTUS:270:ISETPT") field(LNK1, "QUAD:LTUS:270:DEGAUS_IMAX PP") } # Set the maximum current after a successful # degauss. This pv is updated by the # sequence. record(ao, "QUAD:LTUS:270:DEGAUS_IMAX") { field(DESC, "Max I set afer a degauss") field(EGU, "Amps") field(PINI, "YES") field(PREC, "6") field(HOPR, "165.0") field(LOPR, "-165.0") field(DRVH, "165.0") field(DRVL, "-165.0") field(VAL, "165.0") field(FLNK, "QUAD:LTUS:270:DEGAUS_IMAXPOL_CHECK") info(autosaveFields,"VAL,RVAL") } # Set the polarity if degauss_imax record(calcout, "QUAD:LTUS:270:DEGAUS_IMAXPOL_CHECK") { field(DESC, "Determine polarity of imax") field(CALC, "A>=0?0:1") field(INPA, "QUAD:LTUS:270:DEGAUS_IMAX") field(FLNK, "QUAD:LTUS:270:DEGAUS_IMAXPOL") } record(bo, "QUAD:LTUS:270:DEGAUS_IMAXPOL") { field(DESC, "Polarity of imax I") field(DTYP, "Raw Soft Channel") field(DOL, "QUAD:LTUS:270:DEGAUS_IMAXPOL_CHECK") field(OMSL, "closed_loop") field(ZNAM, "Positive") field(ONAM, "Negative") field(FLNK, "QUAD:LTUS:270: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, "QUAD:LTUS:270:DEGAUS_ABSIMAX") { field(DESC, "Absolute Max. Degauss I") field(CALC, "ABS(A)") field(INPA, "QUAD:LTUS:270:DEGAUS_IMAX") field(PREC, "6") field(EGU, "Amps") field(HOPR, "165.0") field(LOPR, "-165.0") info(autosaveFields,"VAL RVAL") } # IACT Polarity record(calcout, "QUAD:LTUS:270:IACTPOL_CHECK") { field(DESC, "Determine IACT polarity") field(SCAN, "5 second") field(CALC, "ABS(A-B)>C?(A>=0?0:1):D") field(INPA, "QUAD:LTUS:270:IACT") field(INPB, "QUAD:LTUS:270:IACTPOL_CHECK.LA") field(INPC, "0.0001") field(INPD, "QUAD:LTUS:270:IACTPOL_CHECK.PVAL") field(OOPT, "On Change") field(FLNK, "QUAD:LTUS:270:IACTPOL") } record(bo, "QUAD:LTUS:270: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,"QUAD:LTUS:270: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, "QUAD:LTUS:270:DEGAUSENABLE CP") field(INPB, "QUAD:LTUS:270:DEGAUSOK") field(INPC, "QUAD:LTUS:270:STATE CP") field(INPD, "QUAD:LTUS:270:STATE.SEVR") field(OUT, "QUAD:LTUS:270:DEGAUS_STATE_SEQ.SELN PP") field(ASG, "Internal") } record(seq, "QUAD:LTUS:270:DEGAUS_STATE_SEQ") { field(DESC, "Degauss State Sequence") field(SELM, "Specified") field(SELL, "QUAD:LTUS:270:DEGAUS_STATE_CHECK") field(LNK1, "QUAD:LTUS:270:DEGAUS_STATE_DISABLE.PROC PP") field(LNK2, "QUAD:LTUS:270:DEGAUS_STATE_LOST.PROC PP") field(LNK3, "QUAD:LTUS:270:DEGAUS_STATE_GOOD.PROC PP") field(LNK4, "QUAD:LTUS:270: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, "QUAD:LTUS:270:DEGAUS_STATE_DISABLE") { field(DESC, "Degauss not used") field(LNK1, "QUAD:LTUS:270:DEGAUSOK.ZSV") field(LNK2, "QUAD:LTUS:270: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, "QUAD:LTUS:270:STATMSG.FRSV") field(LNK4, "QUAD:LTUS:270: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, "QUAD:LTUS:270:DEGAUS_STATE_LOST") { field(DESC, "Degauss lost and ps On") field(DOL1, "1") field(LNK1, "QUAD:LTUS:270:DEGAUSOK.ZSV") field(LNK2, "QUAD:LTUS:270: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, "QUAD:LTUS:270:STATMSG.FRSV") field(LNK4, "QUAD:LTUS:270: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, "QUAD:LTUS:270:DEGAUS_STATE_OFF") { field(DESC, "Degaused lost and ps Off") field(DOL1, "2") field(LNK1, "QUAD:LTUS:270: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, "QUAD:LTUS:270:STATMSG.FRSV") field(LNK3, "QUAD:LTUS:270: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, "QUAD:LTUS:270:DEGAUS_STATE_GOOD") { field(DESC, "Degauss good") field(DOL1, "1") field(LNK1, "QUAD:LTUS:270: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, "QUAD:LTUS:270:STATMSG.FRSV PP") field(LNK3, "QUAD:LTUS:270:STATMSG.FVSV PP") field(LNK4, "") field(ASG, "Internal") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(mbbo, "QUAD:LTUS:270:FUNC") { field(DESC, "QUAD:LTUS:270 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, "0") field(FFVL, "0") field(OUT, "QUAD:LTUS:270:CTRL CA") } # :CTRL pv is processed at boot in the # sequence mgntCtrl.st Processed in sequence # record(mbbo, "QUAD:LTUS:270:CTRL") { field(DESC, "QUAD:LTUS:270 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, "QUAD:LTUS:270:SELECTEN.A PP") field(SDIS, "0") } # If a function has been selected set this unit to busy record(calcout, "QUAD:LTUS:270:SELECTEN") { field(DESC, "Control Select Enable") field(CALC, "A>0?1:A") field(FLNK, "QUAD:LTUS:270:BUSY") } # Set to FREE on IOC reboot record(bo, "QUAD:LTUS:270:BUSY") { field(DESC, "QUAD:LTUS:270 Ctrl Done") field(DOL, "QUAD:LTUS:270:SELECTEN") field(ZNAM, "FREE") field(ONAM, "BUSY") field(PINI, "YES") field(FLNK, "QUAD:LTUS:270:SELECT") } record(bo, "QUAD:LTUS:270:SELECT") { field(ZNAM, "NO") field(ONAM, "YES") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") } record(bo, "QUAD:LTUS:270: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, "QUAD:LTUS:270:CTRLSTATE") { field(DESC, "QUAD:LTUS:270 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("QUAD:LTUS:270:CTRL",20,20,0,0,"QUAD:LTUS:270:CTRL") #! Field("QUAD:LTUS:270:CTRL.OUT",16777215,1,"QUAD:LTUS:270:CTRL.OUT") #! Link("QUAD:LTUS:270:CTRL.OUT","QUAD:LTUS:270:SELECTEN.A") #! Field("QUAD:LTUS:270:CTRL.VAL",16777215,1,"QUAD:LTUS:270:CTRL.VAL") #! Record("QUAD:LTUS:270:SELECTEN",321,381,0,0,"QUAD:LTUS:270:SELECTEN") #! Field("QUAD:LTUS:270:SELECTEN.A",16777215,0,"QUAD:LTUS:270:SELECTEN.A") #! Field("QUAD:LTUS:270:SELECTEN.FLNK",16777215,1,"QUAD:LTUS:270:SELECTEN.FLNK") #! Link("QUAD:LTUS:270:SELECTEN.FLNK","QUAD:LTUS:270:BUSY") #! Field("QUAD:LTUS:270:SELECTEN.VAL",16777215,1,"QUAD:LTUS:270:SELECTEN.VAL") #! Record("QUAD:LTUS:270:BUSY",623,274,0,0,"QUAD:LTUS:270:BUSY") #! Field("QUAD:LTUS:270:BUSY.DOL",16777215,0,"QUAD:LTUS:270:BUSY.DOL") #! Link("QUAD:LTUS:270:BUSY.DOL","QUAD:LTUS:270:SELECTEN.VAL") #! Field("QUAD:LTUS:270:BUSY.FLNK",16777215,1,"QUAD:LTUS:270:BUSY.FLNK") #! Link("QUAD:LTUS:270:BUSY.FLNK","QUAD:LTUS:270:SELECT") #! Record("QUAD:LTUS:270:SELECT",669,508,0,1,"QUAD:LTUS:270:SELECT") #! Record("QUAD:LTUS:270:FUNC",940,120,0,0,"QUAD:LTUS:270:FUNC") #! Field("QUAD:LTUS:270:FUNC.OUT",16777215,0,"QUAD:LTUS:270:FUNC.OUT") #! Link("QUAD:LTUS:270:FUNC.OUT","QUAD:LTUS:270:CTRL.VAL") #! Record("QUAD:LTUS:270:ABORT",193,41,0,0,"QUAD:LTUS:270:ABORT") #! Record("QUAD:LTUS:270:CTRLSTATE",369,34,0,0,"QUAD:LTUS:270: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,"QUAD:LTUS:270:SELECT is used for Multi-device selection.\nIt is enabled when associated QUAD:LTUS:270:CTRL is \"0\" (DONE).\nIt is disabled when associated QUAD:LTUS:270: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,"QUAD:LTUS:270: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, "QUAD:LTUS:270:BCTRL_INIT") { field(DESC, "Process BCTRL on boot") field(PINI, "YES") field(CALC, "A=3?1:0") field(INPA, "QUAD:LTUS:270:BCTRL.SEVR") field(OUT, "QUAD:LTUS:270: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, "QUAD:LTUS:270:BACT") { field(DESC, "Actual B") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "QUAD:LTUS:270:BACT") field(INPB, "QUAD:LTUS:270:POLYCOEF") field(INPC, "QUAD:LTUS:270:POLYCOEF.A") field(INPD, "QUAD:LTUS:270:POLYCOEF.B") field(INPE, "QUAD:LTUS:270:IACT MS") field(INPF, "QUAD:LTUS:270:BDELTAS PP") field(INPG, "100") field(EGU, "kG") field(HOPR, "-0.2441") field(LOPR, "-52.2056") field(HIHI, "-0.2441") field(LOLO, "-52.2056") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "-0.2441") field(LOW, "-52.2056") field(FLNK, "QUAD:LTUS:270: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, "QUAD:LTUS:270:BDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntPhyDeltas") field(EGU, "kG") field(HOPR, "1") field(PREC, "7") field(BRSV, "INVALID") field(INPA, "QUAD:LTUS:270:BDES") field(INPB, "QUAD:LTUS:270:TRIMBTOL") field(INPC, "QUAD:LTUS:270:TRIMBTOLR") field(INPD, "QUAD:LTUS:270:CHCKBTOL") field(INPE, "QUAD:LTUS:270:CHCKBTOLR") field(F, "2.0") field(INPG, "30") field(INPH, "QUAD:LTUS:270:BACT.VAL") # # MPS absolute and relative tolerances field(INPP, "QUAD:LTUS:270:MPSBTOL") field(INPQ, "QUAD:LTUS:270:MPSBTOLR") field(FLNK, "QUAD:LTUS:270:BCONLIMITS") info(autosaveFields,"F") } # This record is processed by BDELTAS record(aSub, "QUAD:LTUS:270:BCONLIMITS") { field(DESC, "Config B-field Limits") field(INAM, "mgntInit") field(SNAM, "mgntBCONLimits") field(INPA, "QUAD:LTUS:270:BDES") field(INPB, "QUAD:LTUS:270:BDELTAS.I") field(INPG, "QUAD:LTUS:270:DEBUG.RVAL") field(FTA, "DOUBLE") field(FTB, "DOUBLE") field(FTG, "ULONG") field(OUTA, "QUAD:LTUS:270:BCON.HIGH") field(OUTB, "QUAD:LTUS:270:BCON.LOW") field(OUTC, "QUAD:LTUS:270:BCON.HIHI") field(OUTD, "QUAD:LTUS:270:BCON.LOLO PP") field(FTVA, "DOUBLE") field(FTVB, "DOUBLE") field(FTVC, "DOUBLE") field(FTVD, "DOUBLE") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:270:IDELTAS") } # The following PV is processed by :BACT # which is processed by :BACT # record(fanout, "QUAD:LTUS:270:BACTFO") { field(DESC, "BACT processing") field(SELM, "All") field(LNK1, "QUAD:LTUS:270:BDIFF") field(LNK2, "QUAD:LTUS:270:BADIFF") field(LNK3, "QUAD:LTUS:270:BRATIO") field(LNK4, "QUAD:LTUS:270:MPSLIMITS") field(LNK5, "QUAD:LTUS:270:I2BSTATUS") field(LNK6, "QUAD:LTUS:270:IACTFO.PROC") } record(calc, "QUAD:LTUS:270:BDIFF") { field(DESC, "BDES-BACT") field(CALC, "A-B") field(INPA, "QUAD:LTUS:270:BDES") field(INPB, "QUAD:LTUS:270:BACT") field(EGU, "kG") field(PREC, "7") } record(calc, "QUAD:LTUS:270:BADIFF") { field(DESC, "Absolute BDES-BACT") field(INPA, "QUAD:LTUS:270:BDIFF") field(EGU, "kG") field(PREC, "7") field(CALC, "A<0?ABS(A):A") } record(calc, "QUAD:LTUS:270:BRATIO") { field(DESC, "BACT Error") field(CALC, "B?A/B:0") field(INPA, "QUAD:LTUS:270:BDIFF") field(INPB, "QUAD:LTUS:270:BDES.HOPR") field(EGU, "kG") field(PREC, "7") } record(mbbi, "QUAD:LTUS:270: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, "QUAD:LTUS:270:BACT.J") } # Note: for a string slave set the MONFL # macro to the following: # MONFL=:IMONCALC MS record(sub, "QUAD:LTUS:270:BMON") { field(DESC, "Second Transductor") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "QUAD:LTUS:270:BMON") field(INPB, "QUAD:LTUS:270:POLYCOEF") field(INPC, "QUAD:LTUS:270:POLYCOEF.A") field(INPD, "QUAD:LTUS:270:POLYCOEF.B") field(INPE, "QUAD:LTUS:270:IMON MS") field(INPF, "QUAD:LTUS:270:BDELTAS.VAL") field(INPG, "100") field(EGU, "kG") field(HOPR, "-0.2441") field(LOPR, "-52.2056") field(HIHI, "-0.2441") field(LOLO, "-52.2056") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "-0.2441") field(LOW, "-52.2056") } # 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=QUAD:LTUS:235:BDES CP record(ao, "QUAD:LTUS:270:BDES") { field(DESC, "Desired B-Field") field(PINI, "NO") field(DRVH, "-0.2441") field(DRVL, "-52.2056") field(HOPR, "-0.2441") field(LOPR, "-52.2056") field(PREC, "7") field(EGU, "kG") field(MDEL, "-1") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:270:IDES2BDES") field(OUT, "QUAD:LTUS:270:B2IDES PP") info(autosaveFields,"VAL") } record(sub, "QUAD:LTUS:270:B2IDES") { field(DESC, "Convert Desired B-Field to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:270:POLYCOEF") field(INPC, "QUAD:LTUS:270:POLYCOEF.A") field(INPD, "QUAD:LTUS:270:POLYCOEF.B") field(PREC, "7") field(EGU, "kG") field(HOPR, "-0.2441") field(LOPR, "-52.2056") field(MDEL, "-1") field(INPE, "QUAD:LTUS:270:BDES.DRVH") field(INPF, "QUAD:LTUS:270:BDES.DRVL") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:270:IDES") } record(sub, "QUAD:LTUS:270:BNOM") { field(DESC, "Nominal Field") field(PINI, "YES") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:270:POLYCOEF") field(INPC, "QUAD:LTUS:270:POLYCOEF.A") field(INPD, "QUAD:LTUS:270:POLYCOEF.B") field(INPE, "QUAD:LTUS:270:BDES.DRVH") field(INPF, "QUAD:LTUS:270:BDES.DRVL") field(EGU, "kG") field(HOPR, "-0.2441") field(LOPR, "-52.2056") field(PREC, "7") field(VAL, "0.0") field(FLNK, "QUAD:LTUS:270:INOM") } record(sub, "QUAD:LTUS:270:BACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:270:BDES.VAL") field(INPB, "QUAD:LTUS:270:BDES.DRVH") field(INPC, "QUAD:LTUS:270:BDES.DRVL") field(INPD, "QUAD:LTUS:270:BDELTAS.I") field(INPE, "QUAD:LTUS:270:BDELTAS.J") field(INPG, "QUAD:LTUS:270:STATE") field(INPH, "QUAD:LTUS:270:HSTA") field(EGU, "kG") field(HOPR, "-0.2441") field(LOPR, "-52.2056") field(PREC, "7") field(BRSV, "INVALID") } record(sub, "QUAD:LTUS:270:BMONLIMITS") { field(DESC, "MON Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:270:BDES.VAL") field(INPB, "QUAD:LTUS:270:BDES.DRVH") field(INPC, "QUAD:LTUS:270:BDES.DRVL") field(INPD, "QUAD:LTUS:270:BDELTAS.K") field(INPE, "QUAD:LTUS:270:BDELTAS.L") field(INPG, "QUAD:LTUS:270:STATE") field(INPH, "QUAD:LTUS:270:HSTA") field(EGU, "kG") field(HOPR, "-0.2441") field(LOPR, "-52.2056") field(PREC, "7") field(BRSV, "INVALID") } record(seq, "QUAD:LTUS:270:BLIMITS") { field(DESC, "ACT Limits") field(PREC, "7") field(DOL1, "QUAD:LTUS:270:BLIMITS") field(LNK1, "QUAD:LTUS:270:BACTLIMITS.F PP") field(DOL2, "QUAD:LTUS:270:BACTLIMITS.I") field(LNK2, "QUAD:LTUS:270:BACT.HIGH") field(DOL3, "QUAD:LTUS:270:BACTLIMITS.J") field(LNK3, "QUAD:LTUS:270:BACT.LOW") field(DOL4, "QUAD:LTUS:270:BACTLIMITS.K") field(LNK4, "QUAD:LTUS:270:BACT.HIHI") field(DOL5, "QUAD:LTUS:270:BACTLIMITS.L") field(LNK5, "QUAD:LTUS:270:BACT.LOLO") field(DOL6, "QUAD:LTUS:270:BLIMITS") field(LNK6, "QUAD:LTUS:270:BMONLIMITS.F PP") field(DOL7, "QUAD:LTUS:270:BMONLIMITS.I") field(LNK7, "QUAD:LTUS:270:BMON.HIGH") field(DOL8, "QUAD:LTUS:270:BMONLIMITS.J") field(LNK8, "QUAD:LTUS:270:BMON.LOW") field(DOL9, "QUAD:LTUS:270:BMONLIMITS.K") field(LNK9, "QUAD:LTUS:270:BMON.HIHI") field(DOLA, "QUAD:LTUS:270:BMONLIMITS.L") field(LNKA, "QUAD:LTUS:270:BMON.LOLO") field(FLNK, "QUAD:LTUS:270:ILIMITS") field(SCAN, "5 second") } record(ao, "QUAD:LTUS:270:BCTRL") { field(DESC, "B-Perturb") field(PREC, "7") field(EGU, "kG") field(DRVH, "-0.2441") field(DRVL, "-52.2056") field(HOPR, "-0.2441") field(LOPR, "-52.2056") # 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, "QUAD:LTUS:270: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, "QUAD:LTUS:270:BCTRLGO") { field(DESC, "Update DES and perturb") field(PREC, "7") # Disable BACT limits field(DOL1, "1") field(LNK1, "QUAD:LTUS:270:BLIMITS.VAL") # Update BDES with the BCTRL (slider) value field(DOL2, "QUAD:LTUS:270:BCTRL.VAL") field(LNK2, "QUAD:LTUS:270:BDES PP") field(DOL3, "1") field(LNK3, "QUAD:LTUS:270:IDIRECT.PROC PP") field(DOL4, "1") field(LNK4, "QUAD:LTUS:270:CHECKSTDZLOST.PROC PP") field(DOL5, "QUAD:LTUS:270:BCTRL.VAL") field(LNK5, "QUAD:LTUS:270:BCTRLSUB PP") # Re-enable BACT limits field(DOL6, "0") field(LNK6, "QUAD:LTUS:270:BLIMITS.VAL") } # Convert B-field to Current and output to ISETPT record(sub, "QUAD:LTUS:270:BCTRLSUB") { field(DESC, "Feedback") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:270:POLYCOEF") field(INPC, "QUAD:LTUS:270:POLYCOEF.A") field(INPD, "QUAD:LTUS:270:POLYCOEF.B") field(INPE, "QUAD:LTUS:270:BDES.DRVH") field(INPF, "QUAD:LTUS:270:BDES.DRVL") field(PREC, "7") field(EGU, "kG") field(HOPR, "-0.2441") field(LOPR, "-52.2056") field(MDEL, "-1") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:270:ISETPT") } record(ao, "QUAD:LTUS:270:BDESPREVTRIM") { field(DESC, "trim bdes for undo") field(DTYP, "Soft Channel") field(DRVH, "-0.2441") field(DRVL, "-52.2056") field(EGU, "kG") field(HOPR, "-0.2441") field(LOPR, "-52.2056") field(PREC, "7") field(PINI, "YES") info(autosaveFields,"VAL") } record(stringin, "QUAD:LTUS:270:MADNAME") { field(DESC, "MAD deck nomenclature") field(PINI, "YES") field(VAL, "QDL14") } record(ai, "QUAD:LTUS:270: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, "3278.859453") } record(ao, "QUAD:LTUS:270:BMAX") { field(DESC, "Max B-Field") field(DTYP, "Soft Channel") field(DRVH, "-0.2441") field(DRVL, "-52.2056") field(EGU, "kG") field(HOPR, "-0.2441") field(LOPR, "-52.2056") field(PREC, "7") field(PINI, "YES") field(VAL, "-0.2441") field(FLNK, "QUAD:LTUS:270:BSTEP") } record(ao, "QUAD:LTUS:270:BMIN") { field(DESC, "Min B-Field") field(DTYP, "Soft Channel") field(DRVH, "-0.2441") field(DRVL, "-52.2056") field(EGU, "kG") field(HOPR, "-0.2441") field(LOPR, "-52.2056") field(PREC, "7") field(PINI, "YES") field(VAL, "-52.2056") field(FLNK, "QUAD:LTUS:270:BSTEP") } record(ao, "QUAD:LTUS:270:BDESSAVE") { field(DESC, "bdes for save/load") field(DTYP, "Soft Channel") field(DRVH, "-0.2441") field(DRVL, "-52.2056") field(EGU, "kG") field(HOPR, "-0.2441") field(LOPR, "-52.2056") field(PINI, "YES") field(PREC, "7") } # This record is processed by QUAD:LTUS:270: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, "QUAD:LTUS:270:BCON") { field(DESC, "Config B-Field ") field(DTYP, "Soft Channel") field(PREC, "7") field(EGU, "kG") field(HOPR, "-0.2441") field(LOPR, "-52.2056") field(DRVH, "-0.2441") field(DRVL, "-52.2056") # 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 , "QUAD:LTUS:270:ICON2BCON") field(OMSL, "closed_loop") field(OUT, "QUAD:LTUS:270:B2ICON PP") info(autosaveFields,"VAL") } record(sub, "QUAD:LTUS:270:B2ICON") { field(DESC, "Convert Desired ICon to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:270:POLYCOEF") field(INPC, "QUAD:LTUS:270:POLYCOEF.A") field(INPD, "QUAD:LTUS:270:POLYCOEF.B") field(PREC, "7") field(EGU, "kG") field(HOPR, "-0.2441") field(LOPR, "-52.2056") field(MDEL, "-1") field(INPE, "QUAD:LTUS:270:BCON.DRVH") field(INPF, "QUAD:LTUS:270:BCON.DRVL") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:270: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, "QUAD:LTUS:270:BSTEP") { field(DESC, "B-Field step size") field(CALC, "(C==3)||(D==3)?0:ABS(A-B)*0.005") field(INPA, "QUAD:LTUS:270:BMAX") field(INPB, "QUAD:LTUS:270:BMIN") field(INPC, "QUAD:LTUS:270:BMIN.SEVR") field(INPD, "QUAD:LTUS:270:BMAX.SEVR") field(EGU, "kG") 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,"QUAD:LTUS:270:BCTRLDISABLECALC") { field(DESC, "Calc for disabling BCTRL") field(ASG, "Internal") field(CALC, "A?2:1") field(INPA, "QUAD:LTUS:270:ONLINE CP") field(OUT, "QUAD:LTUS:270:BCTRLDISABLEFOUT PP") } record(fanout, "QUAD:LTUS:270:BCTRLDISABLEFOUT") { field(DESC, "Disable BCTRL fanout") field(SELM, "Specified") field(SELL, "QUAD:LTUS:270:BCTRLDISABLECALC") field(LNK1, "QUAD:LTUS:270:BCTRLDISABLE") field(LNK2, "QUAD:LTUS:270:BCTRLENABLE") } record(stringout, "QUAD:LTUS:270:BCTRLDISABLE") { field(DESC, "Disable BCTRL") field(DTYP, "Soft Channel") field(OUT, "QUAD:LTUS:270:BCTRL.ASG") field(VAL, "NOWRITE") field(FLNK, "QUAD:LTUS:270:BCTRLDISV_UPDATE") } record(stringout, "QUAD:LTUS:270:BCTRLENABLE") { field(DESC, "Enable BCTRL") field(DTYP, "Soft Channel") field(OUT, "QUAD:LTUS:270:BCTRL.ASG") field(VAL, "") field(FLNK, "QUAD:LTUS:270:BCTRLDISV_UPDATE") } record(calcout, "QUAD:LTUS:270:BCTRLDISV_UPDATE") { field(DESC, "Calc for updating BCTRL.DISV") field(ASG, "Internal") field(CALC, "A") field(INPA, "QUAD:LTUS:270:ONLINE") field(OUT, "QUAD:LTUS:270: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,"QUAD:LTUS:270:BACT and MON\n are processed via links from \n QUAD:LTUS:270:IACT (device raw value readback 1)\n and\n QUAD:LTUS:270: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 QUAD:LTUS:270:POLYCOEF\nC = First polynomial coefficient (offset if linear)\nD = Second polynomial coefficient (slope if linear)\nE = QUAD:LTUS:270: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,"QUAD:LTUS:270:BDES\n is processed when set by CA users or \n QUAD:LTUS:270: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,"QUAD:LTUS:270: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 QUAD:LTUS:270: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 (QUAD:LTUS:270: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,"QUAD:LTUS:270:B*LIMITS and QUAD:LTUS:270:BLIMITS:\n Calculate alarm and warning limits based on \n deltas from QUAD:LTUS:270: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,"QUAD:LTUS:270: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,"QUAD:LTUS:270: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, "QUAD:LTUS:270: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, "QUAD:LTUS:270:MPSBTOL") { field(DESC, "Absolute mps tol") field(EGU, "kG") field(PREC, "2") field(CALC, "ABS(A)*0.02") field(INPA, "QUAD:LTUS:270:BMAX") field(PINI, "YES") } # # 21-Aug-2013: K. Luchini # Set channel access security so that users # cannot easily change values. record(ao, "QUAD:LTUS:270:MPSBMAX") { field(DESC, "MPS Max B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "-0.2441") field(DRVL, "-52.2056") field(PINI, "YES") field(VAL, "-0.2441") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:270:MPSBMIN") { field(DESC, "MPS Min B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "-0.2441") field(DRVL, "-52.2056") field(PINI, "YES") field(VAL, "-52.2056") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:270:MPSBLLIM") { field(DESC, "MPS Low Limit B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "-0.2441") field(DRVL, "-52.2056") field(PINI, "YES") field(VAL, "-52.2056") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:270:MPSBLLIM2") { field(DESC, "MPS Low Limit #2 B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "-0.2441") field(DRVL, "-52.2056") field(PINI, "YES") field(VAL, "-52.2056") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } # Set the default to Std record(mbbo, "QUAD:LTUS:270: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, "QUAD:LTUS:270:MPSLIMITS.E PP") } record(aSub, "QUAD:LTUS:270: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, "QUAD:LTUS:270:MPS.RVAL") field(INPB, "QUAD:LTUS:270:BADIFF") field(INPC, "QUAD:LTUS:270:BDELTAS.N") field(INPD, "QUAD:LTUS:270:BACT") field(INPE, "QUAD:LTUS:270:MPSBITMASK.RVAL") field(INPF, "QUAD:LTUS:270:MPSBLLIM") field(INPG, "QUAD:LTUS:270:MPSBMIN") field(INPH, "QUAD:LTUS:270:MPSBMAX") field(INPI, "QUAD:LTUS:270: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, "QUAD:LTUS:270:INTOL.RVAL PP") field(OUTB, "QUAD:LTUS:270:INTOL_BMIN.RVAL PP") field(OUTC, "QUAD:LTUS:270:INTOL_BRANGE.RVAL PP") field(OUTD, "QUAD:LTUS:270: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, "QUAD:LTUS:270:INTOL") { field(DESC, "BACT within MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:270:MPSLIMITS.VALA") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "QUAD:LTUS:270:INTOL_BMIN") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:270:MPSLIMITS.VALB") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "QUAD:LTUS:270:INTOL_BMIN2") { field(DESC, "MPS tol #2") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:270:MPSLIMITS.VALD") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "QUAD:LTUS:270:INTOL_BRANGE") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:270: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, "QUAD:LTUS:270:CHCKITOL") { field(DESC, "Absolute Check I Tolerance") field(EGU, "A") field(FLNK, "QUAD:LTUS:270:TRIMITOL") field(CALC, "ABS(A*B)") field(INPA, "QUAD:LTUS:270:CHCKBTOL") field(INPB, "QUAD:LTUS:270:POLYCOEF.B") field(PREC, "9") } record(calc, "QUAD:LTUS:270:TRIMBTOL") { field(EGU, "kG") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(DESC, "Absolute Trim Tolerance") field(CALC, "ABS(A)/2") field(INPA, "QUAD:LTUS:270:CHCKBTOL") field(FLNK, "QUAD:LTUS:270:CHCKITOL") } record(calc, "QUAD:LTUS:270:CHCKBTOL") { field(DESC, "Check absolute tolerance") field(EGU, "A") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(FLNK, "QUAD:LTUS:270:TRIMBTOL") field(CALC, "MAX(ABS(A),ABS(C))*(B/1000000)") field(INPA, "QUAD:LTUS:270:BDES.HOPR") field(INPB, "QUAD:LTUS:270:STABILITY") field(INPC, "QUAD:LTUS:270:BDES.LOPR") } record(longout, "QUAD:LTUS:270: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, "QUAD:LTUS:270:CHCKBTOL") } record(calc, "QUAD:LTUS:270:TRIMITOL") { field(DESC, "Absolute Trim I Tolerance") field(EGU, "kG") field(CALC, "ABS(A*B)") field(INPA, "QUAD:LTUS:270:POLYCOEF.B") field(INPB, "QUAD:LTUS:270:TRIMBTOL") field(PREC, "9") } record(ai, "QUAD:LTUS:270:TRIMBTOLR") { field(DESC, "Relative trim tol") field(PREC, "4") field(EGU, "%") field(HOPR, "1.0") field(LOPR, "0.0") field(PINI, "YES") } record(ai, "QUAD:LTUS:270: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, "QUAD:LTUS:270:FBCKFCOM") { field(ZNAM, "CA") field(ONAM, "FCOM") field(DESC, "CA Mode") field(PINI, "YES") field(SDIS, "0") } record(bo, "QUAD:LTUS:270:PAU") { field(ZNAM, "NotConfigured") field(ONAM, "Configured") field(DESC, "PAU Present") field(PINI, "YES") field(SDIS, "0") field(FLNK, "QUAD:LTUS:270:PAUGO") } record(fanout, "QUAD:LTUS:270:PAUGO") { field(DESC, "PAU control") field(LNK1, "QUAD:LTUS:270:PAUSTOP") field(LNK2, "QUAD:LTUS:270: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, "QUAD:LTUS:270:PAUSTART") { field(DESC, "Setup for PAU On") field(SDIS, "QUAD:LTUS:270: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, "QUAD:LTUS:270:PAUSTOP") { field(DESC, "Setup for PAU Off") field(SDIS, "QUAD:LTUS:270: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, "QUAD:LTUS:270:MCORDEVNAME") { field(DESC, "PS device name") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, "QUAD:LTUS:235:") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "QUAD:LTUS:270: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, "QUAD:LTUS:270:PSTYPE.RVAL") field(INPC, "QUAD:LTUS:270:TURNEDOFF.RVAL") field(INPD, "QUAD:LTUS:270:CONFIG.RVAL") field(INPE, "QUAD:LTUS:270:PSCATEGORY.RVAL") field(INPF, "QUAD:LTUS:270:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "QUAD:LTUS:270:AUTOCTRL.RVAL") field(INPJ, "QUAD:LTUS:270:OUTOFSERVICE.RVAL") field(INPL, "QUAD:LTUS:270:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "QUAD:LTUS:270:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "QUAD:LTUS:270:PAU") field(INPP, "QUAD:LTUS:270:CALBDISABLE.RVAL") field(INPQ, "QUAD:LTUS:270:PTRBDISABLE.RVAL") field(INPR, "QUAD:LTUS:270:TRIMDISABLE.RVAL") field(INPS, "QUAD:LTUS:270:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "QUAD:LTUS:270:FBCK") field(INPU, "QUAD:LTUS:270:TRIMTYPE.RVAL") field(INPV, "QUAD:LTUS:270:STDZDIRECT.RVAL") field(INPW, "QUAD:LTUS:270:DEGAUSENABLE.RVAL") field(FLNK, "QUAD:LTUS:270:HSTA") } record(longin, "QUAD:LTUS:270:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "QUAD:LTUS:270:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "QUAD:LTUS:270: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, "QUAD:LTUS:270: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, "QUAD:LTUS:270: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, "QUAD:LTUS:270: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, "QUAD:LTUS:270: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, "QUAD:LTUS:270: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 QUAD:LTUS:270:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses QUAD:LTUS:270:FBCK. # This PV should be replaced by QUAD:LTUS:270: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, "QUAD:LTUS:270: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, "QUAD:LTUS:270: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, "QUAD:LTUS:270: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, "QUAD:LTUS:235:OUTOFSERVICE CPP NMS") field(OMSL, "closed_loop") field(FLNK, "QUAD:LTUS:270:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"QUAD:LTUS:270:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "QUAD:LTUS:270:OUTOFSERVICE NPP NMS") field(OUT, "QUAD:LTUS:270:ONLINE PP") } record(bo, "QUAD:LTUS:270:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "QUAD:LTUS:270: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, "QUAD:LTUS:270: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, "QUAD:LTUS:270: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, "QUAD:LTUS:270: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, "QUAD:LTUS:270: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, "QUAD:LTUS:270: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, "QUAD:LTUS:270: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, "QUAD:LTUS:270: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, "QUAD:LTUS:270: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, "QUAD:LTUS:270: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, "QUAD:LTUS:270: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, "QUAD:LTUS:270:TRIMTYPE") } record(stringout, "QUAD:LTUS:270:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "QUAD:LTUS:235:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "QUAD:LTUS:270:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "QUAD:LTUS:270:STATE.RVAL") field(INPB, "QUAD:LTUS:270:INTLKSUMY.RVAL") field(OUT, "QUAD:LTUS:270:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:LTUS:270: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, "QUAD:LTUS:270:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "QUAD:LTUS:270:STATE.RVAL") field(INPB, "QUAD:LTUS:270:INTLKSUMY.RVAL") field(OUT, "QUAD:LTUS:270:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:LTUS:270:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "QUAD:LTUS:270:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "QUAD:LTUS:270: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, "QUAD:LTUS:270: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, "QUAD:LTUS:270: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, "QUAD:LTUS:270: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,"QUAD:LTUS:270: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("QUAD:LTUS:270:TURNEDOFF",3140,1907,0,1,"QUAD:LTUS:270:TURNEDOFF") #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "QUAD:LTUS:270:STATSUB") { field(DESC, "Build STATus ") field(INAM, "mgntInit") field(SNAM, "mgntSlcStat") field(INPA, "QUAD:LTUS:270:BACT.STAT") field(INPB, "QUAD:LTUS:270:BDES.STAT") field(INPC, "QUAD:LTUS:270: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, "QUAD:LTUS:270:BACT.SEVR") field(INPH, "QUAD:LTUS:270:BDES.SEVR") field(INPI, "QUAD:LTUS:270: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, "QUAD:LTUS:270:STATE.RVAL") field(INPN, "QUAD:LTUS:270:STDZOK") field(INPO, "QUAD:LTUS:270:CALBOK") field(INPP, "QUAD:LTUS:270:OUTOFSERVICE.RVAL") field(INPQ, "QUAD:LTUS:270:CONFIG.RVAL") field(INPR, "QUAD:LTUS:270:HSTA") field(INPS, "QUAD:LTUS:270:CTRL.RVAL") field(INPT, "QUAD:LTUS:270:DEGAUSOK") field(INPV, "QUAD:LTUS:270: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, "QUAD:LTUS:270:STAT") } record(longout, "QUAD:LTUS:270:STAT") { field(DESC, "STAT sent to SLC") field(SCAN, "Passive") field(FLNK, "QUAD:LTUS:270:STATCTRLSUB") field(DOL, "QUAD:LTUS:270:STATSUB.VAL") field(OMSL, "closed_loop") } record(sSub, "QUAD:LTUS:270:STATCTRLSUB") { field(DESC, "Decode SLC STAT into mbbo") field(INAM, "mgntInit") field(SNAM, "mgntStatDecode") field(INPA, "QUAD:LTUS:270:STAT") field(INPB, "QUAD:LTUS:270:HSTA") field(INPD, "QUAD:LTUS:270:ONOFFCTRL.RVAL") field(FLNK, "QUAD:LTUS:270:STATMSG") } record(mbbo, "QUAD:LTUS:270: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, "QUAD:LTUS:270:UNAVAILGO") field(DOL, "QUAD:LTUS:270:STATCTRLSUB.W") } record(seq, "QUAD:LTUS:270:UNAVAILGO") { field(DESC, "Process UNAVAIL") field(DOL1, "QUAD:LTUS:270:STATSUB.U") field(LNK1, "QUAD:LTUS:270:UNAVAIL PP") } record(stringout, "QUAD:LTUS:270:SNLSTATMSG") { field(DTYP, "Soft Channel") } #! TextBox(TB0,820,1000,1200,1220,0,"Dialog",12,1,16777215,"QUAD:LTUS:270:STATUSSUB - future\nOverall device status - takes input from action snls, record sevrs, master snl(s) and outputs final status\n\nInputs:\nA - QUAD:LTUS:270:CTRLSTATUS - snl status\nB - MGNT:CTRLSTATUS - master list status\nC\nD - QUAD:LTUS:270: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,"QUAD:LTUS:270STATSUB\nformat control bo's into slc STAT\n\nInputs:\nA - QUAD:LTUS:270:STATUS\nC - QUAD:LTUS:270:ON\nD - QUAD:LTUS:270:STDZOK\nE - QUAD:LTUS:270:CALBOK\nF - QUAD:LTUS:270:BACTDRIFT (future)\nG -\nH- QUAD:LTUS:270:DACSTATUS\nI -QUAD:LTUS:270:ADCSTATUS\nJ - QUAD:LTUS:270:BACTSTATUS\nK - QUAD:LTUS:270:BDESSTATUS\nL - QUAD:LTUS:270:RIPLSTATUS\n\nOutput:\nP - QUAD:LTUS:270: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, "QUAD:LTUS:270: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, "QUAD:LTUS:270: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, "QUAD:LTUS:270: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, "QUAD:LTUS:270: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 b-field of a slave with out a powered trim coil # equal to the main desired current and pass backwards # through the IVB poly. record(sub, "QUAD:LTUS:270:IDES2BDES") { field(DESC, "Cal BDES") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "QUAD:LTUS:270:IDES2BDES") field(INPB, "QUAD:LTUS:270:POLYCOEF") field(INPC, "QUAD:LTUS:270:POLYCOEF.A") field(INPD, "QUAD:LTUS:270:POLYCOEF.B") field(INPE, "QUAD:LTUS:235:IDES CP MS") field(INPF, "QUAD:LTUS:235:BDELTAS PP") field(INPG, "100") field(EGU, "kG") field(HOPR, "-0.2441") field(LOPR, "-52.2056") field(HIHI, "-0.2441") field(LOLO, "-52.2056") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "-0.2441") field(LOW, "-52.2056") field(FLNK, "QUAD:LTUS:270:BDES") } # Calcuate the bcon of a slave using # the main desired current and pass backwards # through the IVB poly. # the trim b-field is acutally amps. record(sub, "QUAD:LTUS:270:ICON2BCON") { field(DESC, "Cal BCON") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "QUAD:LTUS:270:ICON2BCON") field(INPB, "QUAD:LTUS:270:POLYCOEF") field(INPC, "QUAD:LTUS:270:POLYCOEF.A") field(INPD, "QUAD:LTUS:270:POLYCOEF.B") field(INPE, "QUAD:LTUS:235:ICON CP NMS") field(INPF, "QUAD:LTUS:235:BDELTAS PP") field(INPG, "100") field(EGU, "kG") field(HOPR, "-0.2441") field(LOPR, "-52.2056") field(HIHI, "-0.2441") field(LOLO, "-52.2056") field(PREC, "7") field(BRSV, "INVALID") # Set MINOR alarms for main as the default, slaves will set NO_ALARM field(HHSV, "NO_ALARM") field(HSV, "NO_ALARM") field(LSV, "NO_ALARM") field(LLSV, "NO_ALARM") field(HIGH, "-0.2441") field(LOW, "-52.2056") field(FLNK, "QUAD:LTUS:270:BCON") }#! 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, "QUAD:LTUS:300:IACT") { field(DESC, "Current") field(INP, "QUAD:LTUS:180:IACT CP NMS") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "QUAD:LTUS:300:BACT") info(autosaveFields,"HYST") } record(bi, "QUAD:LTUS:300:STATE") { field(DESC, "PS On/Off Status") field(DTYP, "Raw Soft Channel") field(INP, "QUAD:LTUS:180:STATE CP MS") field(ZSV, "MAJOR") field(ZNAM, "OFF") field(ONAM, "ON") } record(ao, "QUAD:LTUS:300:IDES") { field(DESC, "Desired Current") field(PREC, "3") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(MDEL, "-1") field(HIHI, "165.0") field(LOLO, "0.0") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "QUAD:LTUS:300:BDELTAS") field(DRVH, "165.0") field(DRVL, "0.0") field(DOL, "QUAD:LTUS:300: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, "QUAD:LTUS:300:ICTRL PP") } # This record is processed by QUAD:LTUS:300:ICON") # Note: we are not setting alarms here. record(ao, "QUAD:LTUS:300:ICON") { field(DESC, "Config I") field(DTYP, "Soft Channel") field(PREC, "3") field(HOPR, "165.0") field(LOPR, "0.0") field(DRVH, "165.0") field(DRVL, "0.0") field(DOL, "QUAD:LTUS:300:B2ICON.K") field(OMSL, "closed_loop") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:300:INOM") { field(DESC, "Nominal Current") field(DOL, "QUAD:LTUS:300:BNOM.K") field(OMSL, "closed_loop") field(PREC, "3") field(EGU, "A") field(DRVH, "165.0") field(DRVL, "0.0") field(HOPR, "165.0") field(LOPR, "0.0") } record(ao, "QUAD:LTUS:300:ICTRL") { field(DESC, "Set Current") field(PREC, "3") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(DRVH, "165.0") field(DRVL, "0.0") field(MDEL, "-1") field(FLNK, "QUAD:LTUS:300:ICTRLGO") field(OMSL, "supervisory") info(autosavefields,"VAL") } record(seq, "QUAD:LTUS:300:ICTRLGO") { field(DESC, "Process Current Setpoint") field(PREC, "3") # Set ISETPT to supervisory field(DOL1, "0") field(LNK1, "QUAD:LTUS:300:ISETPT.OMSL") field(DOL2, "QUAD:LTUS:300:ICTRL") field(LNK2, "QUAD:LTUS:300:ISETPT PP") # Set ISETPT to closed loop - get data from BCTRLSUB.K field(DOL3, "1") field(LNK3, "QUAD:LTUS:300:ISETPT.OMSL") } record(ao, "QUAD:LTUS:300:IMAX") { field(DESC, "Max I") field(DTYP, "Soft Channel") field(DRVH, "165.0") field(DRVL, "0.0") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(PREC, "3") field(PINI, "YES") field(VAL, "165.0") field(FLNK, "QUAD:LTUS:300:IMIN") } record(ao, "QUAD:LTUS:300:IMIN") { field(DESC, "Min I") field(DTYP, "Soft Channel") field(DRVH, "165.0") field(DRVL, "0.0") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(PREC, "3") field(VAL, "0.0") field(FLNK, "QUAD:LTUS:300:IRANGE") } record(sel, "QUAD:LTUS:300:IACTPREVOK") { field(DESC, "Last Good Current") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(PREC, "3") field(NVL, "QUAD:LTUS:300:BACT.SEVR") field(INPA, "QUAD:LTUS:300:IACT NPP MS") field(INPB, "QUAD:LTUS:300:IACTPREVOK NPP MS") field(INPC, "QUAD:LTUS:300:IACTPREVOK NPP MS") field(INPD, "QUAD:LTUS:300:IACTPREVOK NPP MS") } record(sub, "QUAD:LTUS:300:IACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:300:IDES") field(INPB, "QUAD:LTUS:300:ISETPT.DRVH") field(INPC, "QUAD:LTUS:300:ISETPT.DRVL") field(INPD, "QUAD:LTUS:300:IDELTAS.I") field(INPE, "QUAD:LTUS:300:IDELTAS.J") field(INPG, "QUAD:LTUS:300:STATE") field(INPH, "QUAD:LTUS:300:HSTA") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(sub, "QUAD:LTUS:300:IMONLIMITS") { field(DESC, "Aux Current Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:300:IDES") field(INPB, "QUAD:LTUS:300:ISETPT.DRVH") field(INPC, "QUAD:LTUS:300:ISETPT.DRVL") field(INPD, "QUAD:LTUS:300:IDELTAS.K") field(INPE, "QUAD:LTUS:300:IDELTAS.L") field(INPG, "QUAD:LTUS:300:STATE") field(INPH, "QUAD:LTUS:300:HSTA") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(seq, "QUAD:LTUS:300:ILIMITS") { field(DESC, "Set ACT and MON Limits") field(PREC, "3") field(DOL1, "QUAD:LTUS:300:BLIMITS") field(LNK1, "QUAD:LTUS:300:IACTLIMITS.F PP") field(DOL2, "QUAD:LTUS:300:IACTLIMITS.I") field(LNK2, "QUAD:LTUS:300:IACT.HIGH") field(DOL3, "QUAD:LTUS:300:IACTLIMITS.J") field(LNK3, "QUAD:LTUS:300:IACT.LOW") field(DOL4, "QUAD:LTUS:300:IACTLIMITS.K") field(LNK4, "QUAD:LTUS:300:IACT.HIHI") field(DOL5, "QUAD:LTUS:300:IACTLIMITS.L") field(LNK5, "QUAD:LTUS:300:IACT.LOLO") field(DOL6, "QUAD:LTUS:300:BLIMITS") field(LNK6, "QUAD:LTUS:300:IMONLIMITS.F PP") field(DOL7, "QUAD:LTUS:300:IMONLIMITS.I") field(LNK7, "QUAD:LTUS:300:IMON.HIGH") field(DOL8, "QUAD:LTUS:300:IMONLIMITS.J") field(LNK8, "QUAD:LTUS:300:IMON.LOW") field(DOL9, "QUAD:LTUS:300:IMONLIMITS.K") field(LNK9, "QUAD:LTUS:300:IMON.HIHI") field(DOLA, "QUAD:LTUS:300:IMONLIMITS.L") field(LNKA, "QUAD:LTUS:300: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, "QUAD:LTUS:300:IDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntRawDeltas") field(INPD, "QUAD:LTUS:300:TRIMBTOL") field(INPE, "QUAD:LTUS:300:CHCKBTOL") field(INPF, "QUAD:LTUS:300:BDELTAS.K") field(INPG, "QUAD:LTUS:300:BDELTAS.L") field(INPH, "QUAD:LTUS:300: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, "QUAD:LTUS:300:STDZITOLR") field(INPC, "QUAD:LTUS:300:STDZITOL") field(FLNK, "") } # All ps controllers with on/off control will set the macro ONOF # as follows: # # ONOF = QUAD:LTUS:180: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, "QUAD:LTUS:300: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 = QUAD:LTUS:180:RESET PP # record(bo, "QUAD:LTUS:300: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, "QUAD:LTUS:300:RAMPSTATE") { field(DESC, "PS Ramp Status") field(DTYP, "Soft Channel") field(DOL, "QUAD:LTUS:180: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, "QUAD:LTUS:300: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, "QUAD:LTUS:300:TRIMRAMPRATE") field(OUT, "") field(FLNK, "QUAD:LTUS:300:STDZDLY") } record(ao, "QUAD:LTUS:300:ISETPT") { field(DESC, "Current Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(DRVH, "165.0") field(DRVL, "0.0") field(MDEL, "-1") field(OUT, "") field(DOL, "QUAD:LTUS:300: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, "QUAD:LTUS:300:IMON") { field(DESC, "Aux Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(INP, "QUAD:LTUS:180:IMON CP NMS") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "QUAD:LTUS:300:BMON") } record(ao, "QUAD:LTUS:300:IRIPL") { field(DESC, "Ripple Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(DOL, "QUAD:LTUS:180:IRIPL CP NMS") field(OMSL, "closed_loop") field(EGU, "A") field(DRVH, "1.0") field(HOPR, "1.0") field(PREC, "3") field(FLNK, "QUAD:LTUS:300:IRIPLOK") } record(sub, "QUAD:LTUS:300:IRIPLOK") { field(DESC, "Ripple Current Status") field(INAM, "mgntInit") field(SNAM, "mgntRiplOK") field(INPA, "QUAD:LTUS:300:IRIPL.VAL") field(INPB, "QUAD:LTUS:300: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, "QUAD:LTUS:300:R") { field(DESC, "Resistance") field(EGU, "Ohms") field(PREC, "4") field(PINI, "YES") field(DOL, "QUAD:LTUS:180: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, "QUAD:LTUS:300:IGND") { field(DESC, "Ground Current") field(EGU, "A") field(PREC, "6") field(PINI, "YES") field(DOL, "QUAD:LTUS:180:IGND CP MS") field(OMSL, "closed_loop") } record(bi, "QUAD:LTUS:300:INTLKSUMY") { field(DESC, "Interlock Summary") field(INP, "QUAD:LTUS:180:INTLKSUMY CP MS") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(ZNAM, "OK") field(ONAM, "FAULT") field(PINI, "NO") } record(mbbo, "QUAD:LTUS:300: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, "QUAD:LTUS:180:COOLING CP NMS") field(OMSL, "closed_loop") } # The following PV is processed by :BACTFO # which is processed by :BACT record(fanout, "QUAD:LTUS:300:IACTFO") { field(DESC, "IACT processing") field(SELM, "All") field(LNK1, "QUAD:LTUS:300:IACTPREVOK") field(LNK2, "QUAD:LTUS:300:IDIFF") field(LNK3, "QUAD:LTUS:300:IADIFF") field(LNK4, "QUAD:LTUS:300:IRATIO") field(LNK5, "QUAD:LTUS:300:IDIRECT") field(LNK6, "QUAD:LTUS:300:IACTPOL_CHECK") } record(calc, "QUAD:LTUS:300:IDIFF") { field(DESC, "IDES-IACT") field(CALC, "A-B") field(INPA, "QUAD:LTUS:300:IDES") field(INPB, "QUAD:LTUS:300:IACT") field(EGU, "A") field(PREC, "9") field(HOPR, "165.0") field(LOPR, "0.0") } record(calc, "QUAD:LTUS:300:IADIFF") { field(DESC, "Absolute IDES-IACT") field(CALC, "A<0?ABS(A):A") field(INPA, "QUAD:LTUS:300:IDIFF") field(PREC, "9") } record(calc, "QUAD:LTUS:300:IRATIO") { field(DESC, "IDES-IACT/IMAX") field(CALC, "B?A/B:0") field(INPA, "QUAD:LTUS:300:IDIFF") field(INPB, "QUAD:LTUS:300:IDES.DRVH") field(PREC, "9") } record(calcout, "QUAD:LTUS:300:IRANGE") { field(DESC, "Current Range") field(PINI, "YES") field(CALC, "ABS(A-B)") field(INPA, "QUAD:LTUS:300:IMIN") field(INPB, "QUAD:LTUS:300: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, "QUAD:LTUS:300: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, "QUAD:LTUS:300:IACT") field(FLNK, "QUAD:LTUS:300:IACTPOL") } record(bo, "QUAD:LTUS:300:IACTPOL") { field(DESC, "Actual I Polarity") field(DTYP, "Raw Soft Channel") field(DOL, "QUAD:LTUS:300: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,"QUAD:LTUS:300:I*LIMITS:\n Calculate alarm and warning limits based on \n deltas from QUAD:LTUS:300:IDELTAS and the\n QUAD:LTUS:300: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,"QUAD:LTUS:300:IACT: \n Get copy of QUAD:LTUS:300:I. \n",null) #! TextBox(TB12,1280,3100,1760,3200,0,"Dialog",12,1,16777215,"QUAD:LTUS:300: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,"QUAD:LTUS:300:IDES:\n Contains raw value calculated by \nQUAD:LTUS:300: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 \nQUAD:LTUS:300:BDELTAS.\n",null) #! TextBox(TB10,56,1940,316,2340,0,"Dialog",12,1,16777215,"QUAD:LTUS:300: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 QUAD:LTUS:300: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 QUAD:LTUS:300: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,"QUAD:LTUS:300:ISETPT:\n Sets the hardware. When fast feedback is set on, this record is\n set to closed loop mode by QUAD:LTUS:300:FBCKSTART sequence. When \n the loop is closed, this record takes input calculated by \n BFBCK only. When fast feedback is set off, QUAD:LTUS:300:FBCKSTOP \n will set it back to supervisory so that the value can be set by \n QUAD:LTUS:300: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, "QUAD:LTUS:300:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:300:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "QUAD:LTUS:300:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "QUAD:LTUS:300:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "QUAD:LTUS:300:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "QUAD:LTUS:300:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "1") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "QUAD:LTUS:300: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, "QUAD:LTUS:300:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "QUAD:LTUS:300:TRIMTYPE.RVAL") field(INPB, "QUAD:LTUS:300:CONFIG.RVAL") field(OUT, "QUAD:LTUS:300:TRIMMAXNUM PP") } record(longout, "QUAD:LTUS:300: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, "QUAD:LTUS:300: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, "QUAD:LTUS:180:TRIMRAMPRATE CP NMS") field(OMSL, "closed_loop") field(VAL, "") field(OUT, "QUAD:LTUS:300:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "QUAD:LTUS:300: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, "QUAD:LTUS:180:TRIMSETL CP NMS") field(OMSL, "closed_loop") field(VAL, "") } record(bo, "QUAD:LTUS:300: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, "QUAD:LTUS:300: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, "QUAD:LTUS:300: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, "0") } record(bo, "QUAD:LTUS:300:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "0") } record(ao, "QUAD:LTUS:300: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, "QUAD:LTUS:300:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "QUAD:LTUS:300: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, "QUAD:LTUS:300: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, "QUAD:LTUS:300:IMOVE") field(INPB, "QUAD:LTUS:300:IACT") field(INPC, "QUAD:LTUS:300:IRAMPRATE") field(INPD, "1.0") field(INPE, "QUAD:LTUS:300:TRIMDLYPCT") field(INPF, "QUAD:LTUS:300:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "QUAD:LTUS:300:RAMPTIME_LEFT PP") } record(longout, "QUAD:LTUS:300:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "QUAD:LTUS:300:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "QUAD:LTUS:300:RAMPDONE_CALC") } record(calc, "QUAD:LTUS:300:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "QUAD:LTUS:300:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "QUAD:LTUS:300:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "QUAD:LTUS:300: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, "QUAD:LTUS:300:RAMPTIME_LEFT") field(OUT, "QUAD:LTUS:300:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "QUAD:LTUS:300:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "QUAD:LTUS:300:RAMPTIME_LEFT NMS") field(OUT, "QUAD:LTUS:300:RAMPDONE PP") } record(bo, "QUAD:LTUS:300:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "QUAD:LTUS:300:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "QUAD:LTUS:300: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, "QUAD:LTUS:300: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, "QUAD:LTUS:300:STDZINIT") { field(DESC, "Proc. Stdz PVs on boot") field(PINI, "YES") field(DOL1, "1") field(DOL2, "1") field(DOL3, "1") field(LNK1, "QUAD:LTUS:300:DEBUG.PROC PP") field(LNK2, "QUAD:LTUS:300:STDZCYCLENUM.PROC PP") field(LNK3, "QUAD:LTUS:300:STDZDISABLE.PROC PP") field(LNK4, "QUAD:LTUS:300: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, "QUAD:LTUS:300:STDZSUB") { field(DESC, "Stdz subroutine") field(INAM, "mgntStdzInit") field(SNAM, "mgntStdz") field(BRSV, "INVALID") field(INPA, "QUAD:LTUS:300:STDZIMIN NPP NMS") field(INPB, "QUAD:LTUS:300:STDZIMAX NPP NMS") field(INPC, "QUAD:LTUS:300:STDZIFINAL NPP NMS") field(INPD, "QUAD:LTUS:300:STDZCYCLENUM NPP NMS") field(INPE, "QUAD:LTUS:300:STDZDIRECT.RVAL NPP NMS") field(INPF, "QUAD:LTUS:300:STDZDISABLE.RVAL CPP NMS") field(INPG, "QUAD:LTUS:300: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, "QUAD:LTUS:300:STDZWF PP") field(OUTB, "QUAD:LTUS:300: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, "QUAD:LTUS:300:STDZWF") } record(mbbo, "QUAD:LTUS:300: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, "QUAD:LTUS:300: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, "QUAD:LTUS:300:STDZMAINPS") { field(DESC, "Stdz by main or self") field(PINI, "YES") field(DTYP, "Soft Channel") field(ZNAM, "SELF") field(ONAM, "MAIN") } record(bo, "QUAD:LTUS:300: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, "QUAD:LTUS:300: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, "QUAD:LTUS:300: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, "QUAD:LTUS:300:STDZTOD") { field(DESC, "Successful Standardize Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "QUAD:LTUS:300:STDZLOSTTOD") { field(DESC, "Standardize Lost Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(longout, "QUAD:LTUS:300:STDZCYCLECNT") { field(DESC, "Cycle Count") field(PINI, "YES") } record(longout, "QUAD:LTUS:300: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, "QUAD:LTUS:300:STDZDIRECT") } # The default standardize direction is "UP" for # all LCLS Magnets.. record(bo, "QUAD:LTUS:300:STDZDIRECT") { field(DESC, "Standardize Direction ") field(ZNAM, "UP") field(ONAM, "DOWN") field(VAL, "0") field(FLNK, "QUAD:LTUS:300:STDZIMIN") } record(ao, "QUAD:LTUS:300:STDZIMIN") { field(DESC, "Min-STDZ Current") field(PREC, "1") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(VAL, "0.0") field(FLNK, "QUAD:LTUS:300:STDZIMAX") } record(ao, "QUAD:LTUS:300:STDZIMAX") { field(DESC, "Max. Standarize Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(VAL, "165.0") field(FLNK, "QUAD:LTUS:300:STDZIFINAL") } record(ao, "QUAD:LTUS:300:STDZIFINAL") { field(DESC, "Final SDTZ Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(VAL, "0.0") field(FLNK, "QUAD:LTUS:300: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, "QUAD:LTUS:300: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, "QUAD:LTUS:300:STDZITOL") { field(DESC, "Stdz min tolerance") field(PREC, "5") field(CALC, "MAX(ABS(A),ABS(B))*C") field(INPA, "QUAD:LTUS:300:STDZIMIN CP NMS") field(INPB, "QUAD:LTUS:300:STDZIMAX CP MMS") field(INPC, "0.05") field(INPD, "QUAD:LTUS:300:STDZITOLR CP MMS") field(EGU, "A") field(FLNK, "QUAD:LTUS:300:IDELTAS") field(PINI, "YES") } # D - factor (3.154/2 = 1.577) for EPSC, otherwise, set to 1.0 record(calc, "QUAD:LTUS:300:STDZDLY") { field(DESC, "Ramp time for stdz cycle") field(CALC, "C>0?MAX(1,ABS((A-B)/C)*D):0") field(INPA, "QUAD:LTUS:300:STDZIMIN CP NMS") field(INPB, "QUAD:LTUS:300:STDZIMAX CP NMS") field(INPC, "QUAD:LTUS:300:TRIMRAMPRATE CP NMS") field(INPD, "1.0") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") } record(calc, "QUAD:LTUS:300:STDZRAMPDLY") { field(DESC, "Ramp delay total") field(CALC, "MAX(1,((A/100)*B+B))") field(PREC, "5") field(INPA, "QUAD:LTUS:300:TRIMDLYPCT CP MS") field(INPB, "QUAD:LTUS:300: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, "QUAD:LTUS:300:STDZMINIDLY") { field(DESC, "Mini-stdz delay") field(CALC, "A") field(PREC, "5") field(A, "1.0") field(EGU, "sec") field(PINI, "YES") } record(ao, "QUAD:LTUS:300: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, "QUAD:LTUS:300:STDZMINIDELTA") { field(DESC, "Stdz mini % of IMAX") field(CALC, "(B/100)*(A-C)") field(INPA, "QUAD:LTUS:300:IDES.HOPR") field(INPB, "QUAD:LTUS:300:STDZMINIPCT CPP NMS") field(INPC, "QUAD:LTUS:300:IDES.LOPR") field(PREC, "5") } record(calc, "QUAD:LTUS:300:STDZMINISETPT") { field(DESC, "Mini Stdz delta") field(CALC, "C==0?MAX(E-D,B):MIN(E+D,A)") field(INPA, "QUAD:LTUS:300:IDES.HOPR") field(INPB, "QUAD:LTUS:300:IDES.LOPR") field(INPC, "QUAD:LTUS:300:STDZDIRECT.RVAL") field(INPD, "QUAD:LTUS:300:STDZMINIDELTA") field(INPE, "QUAD:LTUS:300:IDES") field(PREC, "5") field(FLNK, "QUAD:LTUS:300: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, "QUAD:LTUS:300:STDZMINISETPTOOR") { field(DESC, "Mini Stdz setpoint out of range") field(CALC, "C==0?(E-DA)") field(INPA, "QUAD:LTUS:300:IDES.HOPR") field(INPB, "QUAD:LTUS:300:IDES.LOPR") field(INPC, "QUAD:LTUS:300:STDZDIRECT.RVAL") field(INPD, "QUAD:LTUS:300:STDZMINIDELTA") field(INPE, "QUAD:LTUS:300: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, "QUAD:LTUS:300: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, "QUAD:LTUS:300:IADJUST.RVAL") field(INPB, "QUAD:LTUS:300:STDZDIRECT.RVAL") field(INPC, "QUAD:LTUS:300:STDZOK.RVAL") field(INPD, "QUAD:LTUS:300:STDZDISABLE.RVAL") field(INPE, "QUAD:LTUS:300:STATE.RVAL CPP NMS") field(INPF, "QUAD:LTUS:300:ICTRL.RVAL") field(INPG, "QUAD:LTUS:300:STATE.SEVR") field(INPH, "QUAD:LTUS:300:BDELTAS.M") field(INPI, "QUAD:LTUS:300:IACT.SEVR") field(OUT, "QUAD:LTUS:300:STDZLOSTGO.SELN PP NMS") field(OOPT, "Transition To Non-zero") } record(seq, "QUAD:LTUS:300:STDZLOSTGO") { field(DESC, "Process lost stdz") field(SELM, "Mask") field(DOL1, "1") field(DOL2, "0") field(LNK1, "QUAD:LTUS:300:STDZLOSTTOD.PROC") field(LNK2, "QUAD:LTUS:300:STDZOK PP") } # Record maximum current after standardize # Reset to IACT from sequence after trim # Disable processing during (mini-)standardize or trim record(calc, "QUAD:LTUS:300:STDZIACTMAX") { field(DESC, "Max act current after stdz") field(CALC, "MAX(A, B)") field(DISV, "0") field(SDIS, "QUAD:LTUS:300:CHECKPWRDIP_ENABLE") field(INPA, "QUAD:LTUS:300:IACT CP") field(INPB, "QUAD:LTUS:300:STDZIACTMAX") field(EGU, "A") field(FLNK, "QUAD:LTUS:300:CHECKPWRDIP") } # Detect power dip if STDZOK is YES, STDZ is enabled, and IACT is valid # If IACT drops below STDZIACTMAX by more than the trim tolerance, clear STDZOK # Warning: Take the absolute value of the trim tolerance, or else quads of # negative polarity will always lose STDZ since their IDELTAS.I are negative. # Note: Large quads and bends are prone to losing STDZ even if they are # perturbed toward higher current since their current tends to overshoot # by greater than the trim tolerance before settling down. record(calcout, "QUAD:LTUS:300:CHECKPWRDIP") { field(DESC, "Detect power dip") field(CALC, "(A-B>ABS(C))?3:0") field(DISV, "0") field(SDIS, "QUAD:LTUS:300:CHECKPWRDIP_ENABLE") field(INPA, "QUAD:LTUS:300:STDZIACTMAX") field(INPB, "QUAD:LTUS:300:IACT") field(INPC, "QUAD:LTUS:300:IDELTAS.I") field(OUT, "QUAD:LTUS:300:STDZLOSTGO.SELN PP NMS") field(OOPT, "When Non-zero") } # Enable processing of STDZIACTMAX and CHECKPWRDIP only if # STDZOK = YES, STDZDISABLE = NO, CTRL != Trim (2), and # CTRL != Stdz (4) record(calc, "QUAD:LTUS:300:CHECKPWRDIP_ENABLE") { field(CALC, "A&&!B&&(C#2)&&(C#4)") field(INPA, "QUAD:LTUS:300:STDZOK.RVAL CP") field(INPB, "QUAD:LTUS:300:STDZDISABLE.RVAL CP") field(INPC, "QUAD:LTUS:300:CTRL.RVAL CP") } #! 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, "QUAD:LTUS:300: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, "QUAD:LTUS:300: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, "QUAD:LTUS:300:CALBSET") { field(DESC, "Use DAC Calbration") field(SCAN, "10 second") field(CALC, "A&&(B==0)&&C?31:960") field(INPA, "QUAD:LTUS:300:CALBOK") field(INPB, "QUAD:LTUS:300:CALBDISABLE") field(INPC, "QUAD:LTUS:300:CALBSLOPE") field(OOPT, "On Change") field(OUT, "QUAD:LTUS:300: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, "QUAD:LTUS:300:CALB_SEQ") { field(DESC, "Output Calib Values") field(SELM, "Mask") field(SELL, "QUAD:LTUS:300: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, "QUAD:LTUS:300:CALBSLOPE") field(DOL3, "QUAD:LTUS:300: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, "QUAD:LTUS:300:CALBTOD") { field(DESC, "Calibration Success Time") field(PINI, "YES") # field(DOL, "") field(OMSL, "supervisory") field(DTYP, "Soft Channel") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:300: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, "QUAD:LTUS:300: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, "QUAD:LTUS:300: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, "QUAD:LTUS:300:CALBOFFSET") { field(DESC, "Calc DAC Offset") field(PREC, "6") field(EGU, "Counts") field(PINI, "YES") } record(bo, "QUAD:LTUS:300: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, "QUAD:LTUS:300:DACSLOPE") { field(DESC, "V to DAC slope") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "supervisory") field(PINI, "YES") field(FLNK, "QUAD:LTUS:300:DACOFFSET") } # Default Offset used in conversion from Volts to DAC Counts record(ao, "QUAD:LTUS:300:DACOFFSET") { field(DESC, "V to DAC offset") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "supervisory") field(PINI, "YES") field(FLNK, "QUAD:LTUS:300: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, "QUAD:LTUS:300: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, "QUAD:LTUS:300:IACT") field(INPD, "QUAD:LTUS:300:DACSLOPE") field(INPE, "QUAD:LTUS:300:DACOFFSET") field(EGU, "Counts") field(PREC, "6") } record(ao, "QUAD:LTUS:300:DAC") { field(DESC, "DAC Set point") field(EGU, "Counts") field(DOL, "") field(OMSL, "supervisory") field(PREC, "6") field(PINI, "YES") } record(ao, "QUAD:LTUS:300:CALBIMIN") { field(DESC, "Calibration Min Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(DRVH, "165.0") field(HOPR, "165.0") field(DRVL, "0.0") field(LOPR, "0.0") field(PREC, "3") field(EGU, "A") field(VAL, "0.0") field(FLNK, "QUAD:LTUS:300:CALBIMAX") } record(ao, "QUAD:LTUS:300:CALBIMAX") { field(DESC, "Calibration Max Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(DRVH, "165.0") field(HOPR, "165.0") field(LOPR, "0.0") field(DRVL, "0.0") field(EGU, "A") field(VAL, "165.0") field(FLNK, "QUAD:LTUS:300:CALBSTEPNUM") } record(ao, "QUAD:LTUS:300:CALBIFINAL") { field(DESC, "Calibration Last Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(PREC, "3") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(VAL, "0") } record(longout, "QUAD:LTUS:300: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, "QUAD:LTUS:300:CALBIDELTA") } record(calc, "QUAD:LTUS:300:CALBIDELTA") { field(DESC, "Step size for CALB") field(CALC, "C=0?0:ABS((A-B)/C)") field(INPA, "QUAD:LTUS:300:CALBIMAX") field(INPB, "QUAD:LTUS:300:CALBIMIN") field(INPC, "QUAD:LTUS:300: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, "QUAD:LTUS:300:CALBIMULT") { field(DESC, "IACT vs ISETPT mult") field(CALC, "C#0||A=0?1:ABS(B/A)") field(INPA, "QUAD:LTUS:180:ISETPT.DRVH") field(INPB, "QUAD:LTUS:180:IACT.HOPR") field(INPC, "QUAD:LTUS:300:PSCONTROLLER.RVAL CPP") field(EGU, "A") field(PINI, "YES") } # SNL dbputs DAC values here. 6-10 steps are possible. record(waveform, "QUAD:LTUS:300:CALBICTRLWF") { field(DESC, "ICTRL setpoint array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") } record(waveform, "QUAD:LTUS:300:DACWF") { field(DESC, "DAC count array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:300:DACSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:300:DACSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "QUAD:LTUS:300: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, "QUAD:LTUS:300:CALCDACWF") { field(DESC, "Calc DAC counts array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:300:CALCDACSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:300:CALCDACSA") { field(DESC, "Calc DAC counts") field(DTYP, "Soft Channel") field(INP, "QUAD:LTUS:300: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, "QUAD:LTUS:300:CALBYWF") { field(DESC, "mx + b") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:300:CALBYSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:300:CALBYSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "QUAD:LTUS:300:CALBYWF") field(MALM, "10") field(NELM, "6") field(INDX, "0") field(FTVL, "DOUBLE") } record(waveform, "QUAD:LTUS:300:CALBIACTWF") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:300:CALBIACTSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:300:CALBIACTSA") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(MALM, "10") field(NELM, "6") field(INP, "QUAD:LTUS:300:CALBIACTWF") field(INDX, "0") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:300:CALBLIMITS") } # Check that measured current during calibration is within # tolerance. record(aSub, "QUAD:LTUS:300: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, "QUAD:LTUS:300:CALBSTEPNUM") field(INPB, "QUAD:LTUS:300:CALBIACTWF") field(INPC, "QUAD:LTUS:300: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, "QUAD:LTUS:300: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, "QUAD:LTUS:300:STDZITOL") field(INPH, "QUAD:LTUS:300:DACSLOPE") field(INPI, "QUAD:LTUS:300: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, "QUAD:LTUS:300: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, "QUAD:LTUS:300:CALBSTEPNUM") field(INPB, "QUAD:LTUS:300:CALBIACTWF") field(INPC, "QUAD:LTUS:300:DACWF") field(INPF, "QUAD:LTUS:300: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 QUAD:LTUS:300CALBOK 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, "QUAD:LTUS:300:DEGAUSINIT") { field(DESC, "Proc. Degauss PVs on boot") field(PINI, "YES") field(DOL, "1") field(OUTA, "QUAD:LTUS:300:DEGAUSIMIN.PROC PP") field(OUTB, "QUAD:LTUS:300:DEGAUSIMAX.PROC PP") field(OUTC, "QUAD:LTUS:300:DEGAUSTYPE.PROC PP") field(OUTD, "QUAD:LTUS:300:DEGAUSSTEP.PROC PP") field(OUTE, "QUAD:LTUS:300:MADNAME.PROC PP") field(OUTF, "QUAD:LTUS:300:PSTYPE.PROC PP") field(OUTG, "QUAD:LTUS:300: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, "QUAD:LTUS:300:DEGAUSSUB") { field(DESC, "Degauss subroutine") field(INAM, "mgntDegaussInit") field(SNAM, "mgntDegauss") field(BRSV, "INVALID") field(INPA, "QUAD:LTUS:300:DEGAUSIMIN NPP NMS") field(INPB, "QUAD:LTUS:300:DEGAUSIMAX NPP NMS") field(INPC, "QUAD:LTUS:300:DEGAUSTYPE.RVAL NPP NMS") field(INPE, "QUAD:LTUS:300:DEGAUSMETHOD.RVAL NPP NMS") field(INPF, "QUAD:LTUS:300:PSTYPE NPP NMS") field(INPG, "QUAD:LTUS:300:DEBUG.RVAL NPP NMS") field(INPH, "QUAD:LTUS:300: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, "QUAD:LTUS:300:DEGAUSWF PP") field(OUTB, "QUAD:LTUS:300:DEGAUSMSG PP") field(OUTC, "QUAD:LTUS:300: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, "QUAD:LTUS:300:DEGAUSWF") { field(DESC, "Degauss Setpts") field(NELM, "60") field(FTVL, "DOUBLE") } record(mbbo,"QUAD:LTUS:300: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, "QUAD:LTUS:300: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, "QUAD:LTUS:300: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, "QUAD:LTUS:300: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, "QUAD:LTUS:300: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, "QUAD:LTUS:300:DEGAUSIMIN") { field(DESC, "Min. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "165.0") field(LOPR, "-165.0") field(DRVH, "165.0") field(DRVL, "-165.0") field(VAL, "-165.0") } record(ao, "QUAD:LTUS:300:DEGAUSIMAX") { field(DESC, "Max. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "165.0") field(LOPR, "-165.0") field(DRVH, "165.0") field(DRVL, "-165.0") field(VAL, "165.0") } # 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,"QUAD:LTUS:300: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, "QUAD:LTUS:300: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,"QUAD:LTUS:300: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, "QUAD:LTUS:300: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, "QUAD:LTUS:300: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, "QUAD:LTUS:300: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, "QUAD:LTUS:300:DEGAUSTOD") { field(DESC, "Successful Degauss Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "QUAD:LTUS:300:DEGAUSLOSTTOD") { field(DESC, "Degauss Lost Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:300:DEGAUSTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "QUAD:LTUS:300:DEGAUSTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "QUAD:LTUS:300: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, "QUAD:LTUS:300:DEGAUSGO") { field(DESC, "Set bdes of btrms to zero") field(ASG, "Internal") field(OUTA, "") field(OUTB, "") field(OUTC, "") field(OUTD, "") } # =========== CRYO ONLY =========== record(bo, "QUAD:LTUS:300: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, "QUAD:LTUS:300:DEGAUS_IMAX_CHECK") { field(DESC, "Check if imax shoud chg") field(CALC, "(C==4)&&(ABS(B)>ABS(A))?1:0") field(INPA, "QUAD:LTUS:300:DEGAUS_IMAX") field(INPB, "QUAD:LTUS:300:ISETPT") field(INPC, "QUAD:LTUS:300:DEGAUSTYPE.RVAL") field(OUT, "QUAD:LTUS:300:DEGAUS_IMAX_UPDATE.SELN") field(FLNK, "QUAD:LTUS:300:DEGAUS_IMAX_UPDATE") } record(seq, "QUAD:LTUS:300:DEGAUS_IMAX_UPDATE") { field(DESC, "Degauss IMAX Update") field(SELM, "Specified") field(DOL1, "QUAD:LTUS:300:ISETPT") field(LNK1, "QUAD:LTUS:300:DEGAUS_IMAX PP") } # Set the maximum current after a successful # degauss. This pv is updated by the # sequence. record(ao, "QUAD:LTUS:300:DEGAUS_IMAX") { field(DESC, "Max I set afer a degauss") field(EGU, "Amps") field(PINI, "YES") field(PREC, "6") field(HOPR, "165.0") field(LOPR, "-165.0") field(DRVH, "165.0") field(DRVL, "-165.0") field(VAL, "165.0") field(FLNK, "QUAD:LTUS:300:DEGAUS_IMAXPOL_CHECK") info(autosaveFields,"VAL,RVAL") } # Set the polarity if degauss_imax record(calcout, "QUAD:LTUS:300:DEGAUS_IMAXPOL_CHECK") { field(DESC, "Determine polarity of imax") field(CALC, "A>=0?0:1") field(INPA, "QUAD:LTUS:300:DEGAUS_IMAX") field(FLNK, "QUAD:LTUS:300:DEGAUS_IMAXPOL") } record(bo, "QUAD:LTUS:300:DEGAUS_IMAXPOL") { field(DESC, "Polarity of imax I") field(DTYP, "Raw Soft Channel") field(DOL, "QUAD:LTUS:300:DEGAUS_IMAXPOL_CHECK") field(OMSL, "closed_loop") field(ZNAM, "Positive") field(ONAM, "Negative") field(FLNK, "QUAD:LTUS:300: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, "QUAD:LTUS:300:DEGAUS_ABSIMAX") { field(DESC, "Absolute Max. Degauss I") field(CALC, "ABS(A)") field(INPA, "QUAD:LTUS:300:DEGAUS_IMAX") field(PREC, "6") field(EGU, "Amps") field(HOPR, "165.0") field(LOPR, "-165.0") info(autosaveFields,"VAL RVAL") } # IACT Polarity record(calcout, "QUAD:LTUS:300:IACTPOL_CHECK") { field(DESC, "Determine IACT polarity") field(SCAN, "5 second") field(CALC, "ABS(A-B)>C?(A>=0?0:1):D") field(INPA, "QUAD:LTUS:300:IACT") field(INPB, "QUAD:LTUS:300:IACTPOL_CHECK.LA") field(INPC, "0.0001") field(INPD, "QUAD:LTUS:300:IACTPOL_CHECK.PVAL") field(OOPT, "On Change") field(FLNK, "QUAD:LTUS:300:IACTPOL") } record(bo, "QUAD:LTUS:300: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,"QUAD:LTUS:300: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, "QUAD:LTUS:300:DEGAUSENABLE CP") field(INPB, "QUAD:LTUS:300:DEGAUSOK") field(INPC, "QUAD:LTUS:300:STATE CP") field(INPD, "QUAD:LTUS:300:STATE.SEVR") field(OUT, "QUAD:LTUS:300:DEGAUS_STATE_SEQ.SELN PP") field(ASG, "Internal") } record(seq, "QUAD:LTUS:300:DEGAUS_STATE_SEQ") { field(DESC, "Degauss State Sequence") field(SELM, "Specified") field(SELL, "QUAD:LTUS:300:DEGAUS_STATE_CHECK") field(LNK1, "QUAD:LTUS:300:DEGAUS_STATE_DISABLE.PROC PP") field(LNK2, "QUAD:LTUS:300:DEGAUS_STATE_LOST.PROC PP") field(LNK3, "QUAD:LTUS:300:DEGAUS_STATE_GOOD.PROC PP") field(LNK4, "QUAD:LTUS:300: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, "QUAD:LTUS:300:DEGAUS_STATE_DISABLE") { field(DESC, "Degauss not used") field(LNK1, "QUAD:LTUS:300:DEGAUSOK.ZSV") field(LNK2, "QUAD:LTUS:300: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, "QUAD:LTUS:300:STATMSG.FRSV") field(LNK4, "QUAD:LTUS:300: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, "QUAD:LTUS:300:DEGAUS_STATE_LOST") { field(DESC, "Degauss lost and ps On") field(DOL1, "1") field(LNK1, "QUAD:LTUS:300:DEGAUSOK.ZSV") field(LNK2, "QUAD:LTUS:300: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, "QUAD:LTUS:300:STATMSG.FRSV") field(LNK4, "QUAD:LTUS:300: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, "QUAD:LTUS:300:DEGAUS_STATE_OFF") { field(DESC, "Degaused lost and ps Off") field(DOL1, "2") field(LNK1, "QUAD:LTUS:300: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, "QUAD:LTUS:300:STATMSG.FRSV") field(LNK3, "QUAD:LTUS:300: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, "QUAD:LTUS:300:DEGAUS_STATE_GOOD") { field(DESC, "Degauss good") field(DOL1, "1") field(LNK1, "QUAD:LTUS:300: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, "QUAD:LTUS:300:STATMSG.FRSV PP") field(LNK3, "QUAD:LTUS:300:STATMSG.FVSV PP") field(LNK4, "") field(ASG, "Internal") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(mbbo, "QUAD:LTUS:300:FUNC") { field(DESC, "QUAD:LTUS:300 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, "0") field(FFVL, "0") field(OUT, "QUAD:LTUS:300:CTRL CA") } # :CTRL pv is processed at boot in the # sequence mgntCtrl.st Processed in sequence # record(mbbo, "QUAD:LTUS:300:CTRL") { field(DESC, "QUAD:LTUS:300 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, "QUAD:LTUS:300:SELECTEN.A PP") field(SDIS, "0") } # If a function has been selected set this unit to busy record(calcout, "QUAD:LTUS:300:SELECTEN") { field(DESC, "Control Select Enable") field(CALC, "A>0?1:A") field(FLNK, "QUAD:LTUS:300:BUSY") } # Set to FREE on IOC reboot record(bo, "QUAD:LTUS:300:BUSY") { field(DESC, "QUAD:LTUS:300 Ctrl Done") field(DOL, "QUAD:LTUS:300:SELECTEN") field(ZNAM, "FREE") field(ONAM, "BUSY") field(PINI, "YES") field(FLNK, "QUAD:LTUS:300:SELECT") } record(bo, "QUAD:LTUS:300:SELECT") { field(ZNAM, "NO") field(ONAM, "YES") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") } record(bo, "QUAD:LTUS:300: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, "QUAD:LTUS:300:CTRLSTATE") { field(DESC, "QUAD:LTUS:300 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("QUAD:LTUS:300:CTRL",20,20,0,0,"QUAD:LTUS:300:CTRL") #! Field("QUAD:LTUS:300:CTRL.OUT",16777215,1,"QUAD:LTUS:300:CTRL.OUT") #! Link("QUAD:LTUS:300:CTRL.OUT","QUAD:LTUS:300:SELECTEN.A") #! Field("QUAD:LTUS:300:CTRL.VAL",16777215,1,"QUAD:LTUS:300:CTRL.VAL") #! Record("QUAD:LTUS:300:SELECTEN",321,381,0,0,"QUAD:LTUS:300:SELECTEN") #! Field("QUAD:LTUS:300:SELECTEN.A",16777215,0,"QUAD:LTUS:300:SELECTEN.A") #! Field("QUAD:LTUS:300:SELECTEN.FLNK",16777215,1,"QUAD:LTUS:300:SELECTEN.FLNK") #! Link("QUAD:LTUS:300:SELECTEN.FLNK","QUAD:LTUS:300:BUSY") #! Field("QUAD:LTUS:300:SELECTEN.VAL",16777215,1,"QUAD:LTUS:300:SELECTEN.VAL") #! Record("QUAD:LTUS:300:BUSY",623,274,0,0,"QUAD:LTUS:300:BUSY") #! Field("QUAD:LTUS:300:BUSY.DOL",16777215,0,"QUAD:LTUS:300:BUSY.DOL") #! Link("QUAD:LTUS:300:BUSY.DOL","QUAD:LTUS:300:SELECTEN.VAL") #! Field("QUAD:LTUS:300:BUSY.FLNK",16777215,1,"QUAD:LTUS:300:BUSY.FLNK") #! Link("QUAD:LTUS:300:BUSY.FLNK","QUAD:LTUS:300:SELECT") #! Record("QUAD:LTUS:300:SELECT",669,508,0,1,"QUAD:LTUS:300:SELECT") #! Record("QUAD:LTUS:300:FUNC",940,120,0,0,"QUAD:LTUS:300:FUNC") #! Field("QUAD:LTUS:300:FUNC.OUT",16777215,0,"QUAD:LTUS:300:FUNC.OUT") #! Link("QUAD:LTUS:300:FUNC.OUT","QUAD:LTUS:300:CTRL.VAL") #! Record("QUAD:LTUS:300:ABORT",193,41,0,0,"QUAD:LTUS:300:ABORT") #! Record("QUAD:LTUS:300:CTRLSTATE",369,34,0,0,"QUAD:LTUS:300: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,"QUAD:LTUS:300:SELECT is used for Multi-device selection.\nIt is enabled when associated QUAD:LTUS:300:CTRL is \"0\" (DONE).\nIt is disabled when associated QUAD:LTUS:300: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,"QUAD:LTUS:300: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, "QUAD:LTUS:300:BCTRL_INIT") { field(DESC, "Process BCTRL on boot") field(PINI, "YES") field(CALC, "A=3?1:0") field(INPA, "QUAD:LTUS:300:BCTRL.SEVR") field(OUT, "QUAD:LTUS:300: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, "QUAD:LTUS:300:BACT") { field(DESC, "Actual B") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "QUAD:LTUS:300:BACT") field(INPB, "QUAD:LTUS:300:POLYCOEF") field(INPC, "QUAD:LTUS:300:POLYCOEF.A") field(INPD, "QUAD:LTUS:300:POLYCOEF.B") field(INPE, "QUAD:LTUS:300:IACT MS") field(INPF, "QUAD:LTUS:300:BDELTAS PP") field(INPG, "100") field(EGU, "kG") field(HOPR, "51.58420") field(LOPR, "0.2728") field(HIHI, "51.58420") field(LOLO, "0.2728") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "51.58420") field(LOW, "0.2728") field(FLNK, "QUAD:LTUS:300: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, "QUAD:LTUS:300:BDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntPhyDeltas") field(EGU, "kG") field(HOPR, "1") field(PREC, "7") field(BRSV, "INVALID") field(INPA, "QUAD:LTUS:300:BDES") field(INPB, "QUAD:LTUS:300:TRIMBTOL") field(INPC, "QUAD:LTUS:300:TRIMBTOLR") field(INPD, "QUAD:LTUS:300:CHCKBTOL") field(INPE, "QUAD:LTUS:300:CHCKBTOLR") field(F, "2.0") field(INPG, "30") field(INPH, "QUAD:LTUS:300:BACT.VAL") # # MPS absolute and relative tolerances field(INPP, "QUAD:LTUS:300:MPSBTOL") field(INPQ, "QUAD:LTUS:300:MPSBTOLR") field(FLNK, "QUAD:LTUS:300:BCONLIMITS") info(autosaveFields,"F") } # This record is processed by BDELTAS record(aSub, "QUAD:LTUS:300:BCONLIMITS") { field(DESC, "Config B-field Limits") field(INAM, "mgntInit") field(SNAM, "mgntBCONLimits") field(INPA, "QUAD:LTUS:300:BDES") field(INPB, "QUAD:LTUS:300:BDELTAS.I") field(INPG, "QUAD:LTUS:300:DEBUG.RVAL") field(FTA, "DOUBLE") field(FTB, "DOUBLE") field(FTG, "ULONG") field(OUTA, "QUAD:LTUS:300:BCON.HIGH") field(OUTB, "QUAD:LTUS:300:BCON.LOW") field(OUTC, "QUAD:LTUS:300:BCON.HIHI") field(OUTD, "QUAD:LTUS:300:BCON.LOLO PP") field(FTVA, "DOUBLE") field(FTVB, "DOUBLE") field(FTVC, "DOUBLE") field(FTVD, "DOUBLE") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:300:IDELTAS") } # The following PV is processed by :BACT # which is processed by :BACT # record(fanout, "QUAD:LTUS:300:BACTFO") { field(DESC, "BACT processing") field(SELM, "All") field(LNK1, "QUAD:LTUS:300:BDIFF") field(LNK2, "QUAD:LTUS:300:BADIFF") field(LNK3, "QUAD:LTUS:300:BRATIO") field(LNK4, "QUAD:LTUS:300:MPSLIMITS") field(LNK5, "QUAD:LTUS:300:I2BSTATUS") field(LNK6, "QUAD:LTUS:300:IACTFO.PROC") } record(calc, "QUAD:LTUS:300:BDIFF") { field(DESC, "BDES-BACT") field(CALC, "A-B") field(INPA, "QUAD:LTUS:300:BDES") field(INPB, "QUAD:LTUS:300:BACT") field(EGU, "kG") field(PREC, "7") } record(calc, "QUAD:LTUS:300:BADIFF") { field(DESC, "Absolute BDES-BACT") field(INPA, "QUAD:LTUS:300:BDIFF") field(EGU, "kG") field(PREC, "7") field(CALC, "A<0?ABS(A):A") } record(calc, "QUAD:LTUS:300:BRATIO") { field(DESC, "BACT Error") field(CALC, "B?A/B:0") field(INPA, "QUAD:LTUS:300:BDIFF") field(INPB, "QUAD:LTUS:300:BDES.HOPR") field(EGU, "kG") field(PREC, "7") } record(mbbi, "QUAD:LTUS:300: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, "QUAD:LTUS:300:BACT.J") } # Note: for a string slave set the MONFL # macro to the following: # MONFL=:IMONCALC MS record(sub, "QUAD:LTUS:300:BMON") { field(DESC, "Second Transductor") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "QUAD:LTUS:300:BMON") field(INPB, "QUAD:LTUS:300:POLYCOEF") field(INPC, "QUAD:LTUS:300:POLYCOEF.A") field(INPD, "QUAD:LTUS:300:POLYCOEF.B") field(INPE, "QUAD:LTUS:300:IMON MS") field(INPF, "QUAD:LTUS:300:BDELTAS.VAL") field(INPG, "100") field(EGU, "kG") field(HOPR, "51.58420") field(LOPR, "0.2728") field(HIHI, "51.58420") field(LOLO, "0.2728") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "51.58420") field(LOW, "0.2728") } # 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=QUAD:LTUS:180:BDES CP record(ao, "QUAD:LTUS:300:BDES") { field(DESC, "Desired B-Field") field(PINI, "NO") field(DRVH, "51.58420") field(DRVL, "0.2728") field(HOPR, "51.58420") field(LOPR, "0.2728") field(PREC, "7") field(EGU, "kG") field(MDEL, "-1") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:300:IDES2BDES") field(OUT, "QUAD:LTUS:300:B2IDES PP") info(autosaveFields,"VAL") } record(sub, "QUAD:LTUS:300:B2IDES") { field(DESC, "Convert Desired B-Field to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:300:POLYCOEF") field(INPC, "QUAD:LTUS:300:POLYCOEF.A") field(INPD, "QUAD:LTUS:300:POLYCOEF.B") field(PREC, "7") field(EGU, "kG") field(HOPR, "51.58420") field(LOPR, "0.2728") field(MDEL, "-1") field(INPE, "QUAD:LTUS:300:BDES.DRVH") field(INPF, "QUAD:LTUS:300:BDES.DRVL") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:300:IDES") } record(sub, "QUAD:LTUS:300:BNOM") { field(DESC, "Nominal Field") field(PINI, "YES") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:300:POLYCOEF") field(INPC, "QUAD:LTUS:300:POLYCOEF.A") field(INPD, "QUAD:LTUS:300:POLYCOEF.B") field(INPE, "QUAD:LTUS:300:BDES.DRVH") field(INPF, "QUAD:LTUS:300:BDES.DRVL") field(EGU, "kG") field(HOPR, "51.58420") field(LOPR, "0.2728") field(PREC, "7") field(VAL, "0.0") field(FLNK, "QUAD:LTUS:300:INOM") } record(sub, "QUAD:LTUS:300:BACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:300:BDES.VAL") field(INPB, "QUAD:LTUS:300:BDES.DRVH") field(INPC, "QUAD:LTUS:300:BDES.DRVL") field(INPD, "QUAD:LTUS:300:BDELTAS.I") field(INPE, "QUAD:LTUS:300:BDELTAS.J") field(INPG, "QUAD:LTUS:300:STATE") field(INPH, "QUAD:LTUS:300:HSTA") field(EGU, "kG") field(HOPR, "51.58420") field(LOPR, "0.2728") field(PREC, "7") field(BRSV, "INVALID") } record(sub, "QUAD:LTUS:300:BMONLIMITS") { field(DESC, "MON Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:300:BDES.VAL") field(INPB, "QUAD:LTUS:300:BDES.DRVH") field(INPC, "QUAD:LTUS:300:BDES.DRVL") field(INPD, "QUAD:LTUS:300:BDELTAS.K") field(INPE, "QUAD:LTUS:300:BDELTAS.L") field(INPG, "QUAD:LTUS:300:STATE") field(INPH, "QUAD:LTUS:300:HSTA") field(EGU, "kG") field(HOPR, "51.58420") field(LOPR, "0.2728") field(PREC, "7") field(BRSV, "INVALID") } record(seq, "QUAD:LTUS:300:BLIMITS") { field(DESC, "ACT Limits") field(PREC, "7") field(DOL1, "QUAD:LTUS:300:BLIMITS") field(LNK1, "QUAD:LTUS:300:BACTLIMITS.F PP") field(DOL2, "QUAD:LTUS:300:BACTLIMITS.I") field(LNK2, "QUAD:LTUS:300:BACT.HIGH") field(DOL3, "QUAD:LTUS:300:BACTLIMITS.J") field(LNK3, "QUAD:LTUS:300:BACT.LOW") field(DOL4, "QUAD:LTUS:300:BACTLIMITS.K") field(LNK4, "QUAD:LTUS:300:BACT.HIHI") field(DOL5, "QUAD:LTUS:300:BACTLIMITS.L") field(LNK5, "QUAD:LTUS:300:BACT.LOLO") field(DOL6, "QUAD:LTUS:300:BLIMITS") field(LNK6, "QUAD:LTUS:300:BMONLIMITS.F PP") field(DOL7, "QUAD:LTUS:300:BMONLIMITS.I") field(LNK7, "QUAD:LTUS:300:BMON.HIGH") field(DOL8, "QUAD:LTUS:300:BMONLIMITS.J") field(LNK8, "QUAD:LTUS:300:BMON.LOW") field(DOL9, "QUAD:LTUS:300:BMONLIMITS.K") field(LNK9, "QUAD:LTUS:300:BMON.HIHI") field(DOLA, "QUAD:LTUS:300:BMONLIMITS.L") field(LNKA, "QUAD:LTUS:300:BMON.LOLO") field(FLNK, "QUAD:LTUS:300:ILIMITS") field(SCAN, "5 second") } record(ao, "QUAD:LTUS:300:BCTRL") { field(DESC, "B-Perturb") field(PREC, "7") field(EGU, "kG") field(DRVH, "51.58420") field(DRVL, "0.2728") field(HOPR, "51.58420") field(LOPR, "0.2728") # 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, "QUAD:LTUS:300: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, "QUAD:LTUS:300:BCTRLGO") { field(DESC, "Update DES and perturb") field(PREC, "7") # Disable BACT limits field(DOL1, "1") field(LNK1, "QUAD:LTUS:300:BLIMITS.VAL") # Update BDES with the BCTRL (slider) value field(DOL2, "QUAD:LTUS:300:BCTRL.VAL") field(LNK2, "QUAD:LTUS:300:BDES PP") field(DOL3, "1") field(LNK3, "QUAD:LTUS:300:IDIRECT.PROC PP") field(DOL4, "1") field(LNK4, "QUAD:LTUS:300:CHECKSTDZLOST.PROC PP") field(DOL5, "QUAD:LTUS:300:BCTRL.VAL") field(LNK5, "QUAD:LTUS:300:BCTRLSUB PP") # Re-enable BACT limits field(DOL6, "0") field(LNK6, "QUAD:LTUS:300:BLIMITS.VAL") } # Convert B-field to Current and output to ISETPT record(sub, "QUAD:LTUS:300:BCTRLSUB") { field(DESC, "Feedback") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:300:POLYCOEF") field(INPC, "QUAD:LTUS:300:POLYCOEF.A") field(INPD, "QUAD:LTUS:300:POLYCOEF.B") field(INPE, "QUAD:LTUS:300:BDES.DRVH") field(INPF, "QUAD:LTUS:300:BDES.DRVL") field(PREC, "7") field(EGU, "kG") field(HOPR, "51.58420") field(LOPR, "0.2728") field(MDEL, "-1") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:300:ISETPT") } record(ao, "QUAD:LTUS:300:BDESPREVTRIM") { field(DESC, "trim bdes for undo") field(DTYP, "Soft Channel") field(DRVH, "51.58420") field(DRVL, "0.2728") field(EGU, "kG") field(HOPR, "51.58420") field(LOPR, "0.2728") field(PREC, "7") field(PINI, "YES") info(autosaveFields,"VAL") } record(stringin, "QUAD:LTUS:300:MADNAME") { field(DESC, "MAD deck nomenclature") field(PINI, "YES") field(VAL, "QDL15") } record(ai, "QUAD:LTUS:300: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, "3291.60724") } record(ao, "QUAD:LTUS:300:BMAX") { field(DESC, "Max B-Field") field(DTYP, "Soft Channel") field(DRVH, "51.58420") field(DRVL, "0.2728") field(EGU, "kG") field(HOPR, "51.58420") field(LOPR, "0.2728") field(PREC, "7") field(PINI, "YES") field(VAL, "51.58420") field(FLNK, "QUAD:LTUS:300:BSTEP") } record(ao, "QUAD:LTUS:300:BMIN") { field(DESC, "Min B-Field") field(DTYP, "Soft Channel") field(DRVH, "51.58420") field(DRVL, "0.2728") field(EGU, "kG") field(HOPR, "51.58420") field(LOPR, "0.2728") field(PREC, "7") field(PINI, "YES") field(VAL, "0.2728") field(FLNK, "QUAD:LTUS:300:BSTEP") } record(ao, "QUAD:LTUS:300:BDESSAVE") { field(DESC, "bdes for save/load") field(DTYP, "Soft Channel") field(DRVH, "51.58420") field(DRVL, "0.2728") field(EGU, "kG") field(HOPR, "51.58420") field(LOPR, "0.2728") field(PINI, "YES") field(PREC, "7") } # This record is processed by QUAD:LTUS:300: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, "QUAD:LTUS:300:BCON") { field(DESC, "Config B-Field ") field(DTYP, "Soft Channel") field(PREC, "7") field(EGU, "kG") field(HOPR, "51.58420") field(LOPR, "0.2728") field(DRVH, "51.58420") field(DRVL, "0.2728") # 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 , "QUAD:LTUS:300:ICON2BCON") field(OMSL, "closed_loop") field(OUT, "QUAD:LTUS:300:B2ICON PP") info(autosaveFields,"VAL") } record(sub, "QUAD:LTUS:300:B2ICON") { field(DESC, "Convert Desired ICon to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:300:POLYCOEF") field(INPC, "QUAD:LTUS:300:POLYCOEF.A") field(INPD, "QUAD:LTUS:300:POLYCOEF.B") field(PREC, "7") field(EGU, "kG") field(HOPR, "51.58420") field(LOPR, "0.2728") field(MDEL, "-1") field(INPE, "QUAD:LTUS:300:BCON.DRVH") field(INPF, "QUAD:LTUS:300:BCON.DRVL") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:300: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, "QUAD:LTUS:300:BSTEP") { field(DESC, "B-Field step size") field(CALC, "(C==3)||(D==3)?0:ABS(A-B)*0.005") field(INPA, "QUAD:LTUS:300:BMAX") field(INPB, "QUAD:LTUS:300:BMIN") field(INPC, "QUAD:LTUS:300:BMIN.SEVR") field(INPD, "QUAD:LTUS:300:BMAX.SEVR") field(EGU, "kG") 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,"QUAD:LTUS:300:BCTRLDISABLECALC") { field(DESC, "Calc for disabling BCTRL") field(ASG, "Internal") field(CALC, "A?2:1") field(INPA, "QUAD:LTUS:300:ONLINE CP") field(OUT, "QUAD:LTUS:300:BCTRLDISABLEFOUT PP") } record(fanout, "QUAD:LTUS:300:BCTRLDISABLEFOUT") { field(DESC, "Disable BCTRL fanout") field(SELM, "Specified") field(SELL, "QUAD:LTUS:300:BCTRLDISABLECALC") field(LNK1, "QUAD:LTUS:300:BCTRLDISABLE") field(LNK2, "QUAD:LTUS:300:BCTRLENABLE") } record(stringout, "QUAD:LTUS:300:BCTRLDISABLE") { field(DESC, "Disable BCTRL") field(DTYP, "Soft Channel") field(OUT, "QUAD:LTUS:300:BCTRL.ASG") field(VAL, "NOWRITE") field(FLNK, "QUAD:LTUS:300:BCTRLDISV_UPDATE") } record(stringout, "QUAD:LTUS:300:BCTRLENABLE") { field(DESC, "Enable BCTRL") field(DTYP, "Soft Channel") field(OUT, "QUAD:LTUS:300:BCTRL.ASG") field(VAL, "") field(FLNK, "QUAD:LTUS:300:BCTRLDISV_UPDATE") } record(calcout, "QUAD:LTUS:300:BCTRLDISV_UPDATE") { field(DESC, "Calc for updating BCTRL.DISV") field(ASG, "Internal") field(CALC, "A") field(INPA, "QUAD:LTUS:300:ONLINE") field(OUT, "QUAD:LTUS:300: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,"QUAD:LTUS:300:BACT and MON\n are processed via links from \n QUAD:LTUS:300:IACT (device raw value readback 1)\n and\n QUAD:LTUS:300: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 QUAD:LTUS:300:POLYCOEF\nC = First polynomial coefficient (offset if linear)\nD = Second polynomial coefficient (slope if linear)\nE = QUAD:LTUS:300: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,"QUAD:LTUS:300:BDES\n is processed when set by CA users or \n QUAD:LTUS:300: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,"QUAD:LTUS:300: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 QUAD:LTUS:300: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 (QUAD:LTUS:300: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,"QUAD:LTUS:300:B*LIMITS and QUAD:LTUS:300:BLIMITS:\n Calculate alarm and warning limits based on \n deltas from QUAD:LTUS:300: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,"QUAD:LTUS:300: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,"QUAD:LTUS:300: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, "QUAD:LTUS:300: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, "QUAD:LTUS:300:MPSBTOL") { field(DESC, "Absolute mps tol") field(EGU, "kG") field(PREC, "2") field(CALC, "ABS(A)*0.02") field(INPA, "QUAD:LTUS:300:BMAX") field(PINI, "YES") } # # 21-Aug-2013: K. Luchini # Set channel access security so that users # cannot easily change values. record(ao, "QUAD:LTUS:300:MPSBMAX") { field(DESC, "MPS Max B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "51.58420") field(DRVL, "0.2728") field(PINI, "YES") field(VAL, "51.58420") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:300:MPSBMIN") { field(DESC, "MPS Min B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "51.58420") field(DRVL, "0.2728") field(PINI, "YES") field(VAL, "0.2728") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:300:MPSBLLIM") { field(DESC, "MPS Low Limit B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "51.58420") field(DRVL, "0.2728") field(PINI, "YES") field(VAL, "0.2728") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:300:MPSBLLIM2") { field(DESC, "MPS Low Limit #2 B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "51.58420") field(DRVL, "0.2728") field(PINI, "YES") field(VAL, "0.2728") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } # Set the default to Std record(mbbo, "QUAD:LTUS:300: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, "QUAD:LTUS:300:MPSLIMITS.E PP") } record(aSub, "QUAD:LTUS:300: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, "QUAD:LTUS:300:MPS.RVAL") field(INPB, "QUAD:LTUS:300:BADIFF") field(INPC, "QUAD:LTUS:300:BDELTAS.N") field(INPD, "QUAD:LTUS:300:BACT") field(INPE, "QUAD:LTUS:300:MPSBITMASK.RVAL") field(INPF, "QUAD:LTUS:300:MPSBLLIM") field(INPG, "QUAD:LTUS:300:MPSBMIN") field(INPH, "QUAD:LTUS:300:MPSBMAX") field(INPI, "QUAD:LTUS:300: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, "QUAD:LTUS:300:INTOL.RVAL PP") field(OUTB, "QUAD:LTUS:300:INTOL_BMIN.RVAL PP") field(OUTC, "QUAD:LTUS:300:INTOL_BRANGE.RVAL PP") field(OUTD, "QUAD:LTUS:300: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, "QUAD:LTUS:300:INTOL") { field(DESC, "BACT within MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:300:MPSLIMITS.VALA") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "QUAD:LTUS:300:INTOL_BMIN") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:300:MPSLIMITS.VALB") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "QUAD:LTUS:300:INTOL_BMIN2") { field(DESC, "MPS tol #2") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:300:MPSLIMITS.VALD") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "QUAD:LTUS:300:INTOL_BRANGE") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:300: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, "QUAD:LTUS:300:CHCKITOL") { field(DESC, "Absolute Check I Tolerance") field(EGU, "A") field(FLNK, "QUAD:LTUS:300:TRIMITOL") field(CALC, "ABS(A*B)") field(INPA, "QUAD:LTUS:300:CHCKBTOL") field(INPB, "QUAD:LTUS:300:POLYCOEF.B") field(PREC, "9") } record(calc, "QUAD:LTUS:300:TRIMBTOL") { field(EGU, "kG") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(DESC, "Absolute Trim Tolerance") field(CALC, "ABS(A)/2") field(INPA, "QUAD:LTUS:300:CHCKBTOL") field(FLNK, "QUAD:LTUS:300:CHCKITOL") } record(calc, "QUAD:LTUS:300:CHCKBTOL") { field(DESC, "Check absolute tolerance") field(EGU, "A") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(FLNK, "QUAD:LTUS:300:TRIMBTOL") field(CALC, "MAX(ABS(A),ABS(C))*(B/1000000)") field(INPA, "QUAD:LTUS:300:BDES.HOPR") field(INPB, "QUAD:LTUS:300:STABILITY") field(INPC, "QUAD:LTUS:300:BDES.LOPR") } record(longout, "QUAD:LTUS:300: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, "QUAD:LTUS:300:CHCKBTOL") } record(calc, "QUAD:LTUS:300:TRIMITOL") { field(DESC, "Absolute Trim I Tolerance") field(EGU, "kG") field(CALC, "ABS(A*B)") field(INPA, "QUAD:LTUS:300:POLYCOEF.B") field(INPB, "QUAD:LTUS:300:TRIMBTOL") field(PREC, "9") } record(ai, "QUAD:LTUS:300:TRIMBTOLR") { field(DESC, "Relative trim tol") field(PREC, "4") field(EGU, "%") field(HOPR, "1.0") field(LOPR, "0.0") field(PINI, "YES") } record(ai, "QUAD:LTUS:300: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, "QUAD:LTUS:300:FBCKFCOM") { field(ZNAM, "CA") field(ONAM, "FCOM") field(DESC, "CA Mode") field(PINI, "YES") field(SDIS, "0") } record(bo, "QUAD:LTUS:300:PAU") { field(ZNAM, "NotConfigured") field(ONAM, "Configured") field(DESC, "PAU Present") field(PINI, "YES") field(SDIS, "0") field(FLNK, "QUAD:LTUS:300:PAUGO") } record(fanout, "QUAD:LTUS:300:PAUGO") { field(DESC, "PAU control") field(LNK1, "QUAD:LTUS:300:PAUSTOP") field(LNK2, "QUAD:LTUS:300: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, "QUAD:LTUS:300:PAUSTART") { field(DESC, "Setup for PAU On") field(SDIS, "QUAD:LTUS:300: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, "QUAD:LTUS:300:PAUSTOP") { field(DESC, "Setup for PAU Off") field(SDIS, "QUAD:LTUS:300: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, "QUAD:LTUS:300:MCORDEVNAME") { field(DESC, "PS device name") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, "QUAD:LTUS:180:") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "QUAD:LTUS:300: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, "QUAD:LTUS:300:PSTYPE.RVAL") field(INPC, "QUAD:LTUS:300:TURNEDOFF.RVAL") field(INPD, "QUAD:LTUS:300:CONFIG.RVAL") field(INPE, "QUAD:LTUS:300:PSCATEGORY.RVAL") field(INPF, "QUAD:LTUS:300:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "QUAD:LTUS:300:AUTOCTRL.RVAL") field(INPJ, "QUAD:LTUS:300:OUTOFSERVICE.RVAL") field(INPL, "QUAD:LTUS:300:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "QUAD:LTUS:300:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "QUAD:LTUS:300:PAU") field(INPP, "QUAD:LTUS:300:CALBDISABLE.RVAL") field(INPQ, "QUAD:LTUS:300:PTRBDISABLE.RVAL") field(INPR, "QUAD:LTUS:300:TRIMDISABLE.RVAL") field(INPS, "QUAD:LTUS:300:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "QUAD:LTUS:300:FBCK") field(INPU, "QUAD:LTUS:300:TRIMTYPE.RVAL") field(INPV, "QUAD:LTUS:300:STDZDIRECT.RVAL") field(INPW, "QUAD:LTUS:300:DEGAUSENABLE.RVAL") field(FLNK, "QUAD:LTUS:300:HSTA") } record(longin, "QUAD:LTUS:300:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "QUAD:LTUS:300:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "QUAD:LTUS:300: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, "QUAD:LTUS:300: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, "QUAD:LTUS:300: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, "QUAD:LTUS:300: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, "QUAD:LTUS:300: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, "QUAD:LTUS:300: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 QUAD:LTUS:300:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses QUAD:LTUS:300:FBCK. # This PV should be replaced by QUAD:LTUS:300: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, "QUAD:LTUS:300: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, "QUAD:LTUS:300: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, "QUAD:LTUS:300: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, "QUAD:LTUS:180:OUTOFSERVICE CPP NMS") field(OMSL, "closed_loop") field(FLNK, "QUAD:LTUS:300:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"QUAD:LTUS:300:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "QUAD:LTUS:300:OUTOFSERVICE NPP NMS") field(OUT, "QUAD:LTUS:300:ONLINE PP") } record(bo, "QUAD:LTUS:300:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "QUAD:LTUS:300: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, "QUAD:LTUS:300: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, "QUAD:LTUS:300: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, "QUAD:LTUS:300: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, "QUAD:LTUS:300: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, "QUAD:LTUS:300: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, "QUAD:LTUS:300: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, "QUAD:LTUS:300: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, "QUAD:LTUS:300: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, "QUAD:LTUS:300: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, "QUAD:LTUS:300: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, "QUAD:LTUS:300:TRIMTYPE") } record(stringout, "QUAD:LTUS:300:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "QUAD:LTUS:180:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "QUAD:LTUS:300:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "QUAD:LTUS:300:STATE.RVAL") field(INPB, "QUAD:LTUS:300:INTLKSUMY.RVAL") field(OUT, "QUAD:LTUS:300:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:LTUS:300: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, "QUAD:LTUS:300:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "QUAD:LTUS:300:STATE.RVAL") field(INPB, "QUAD:LTUS:300:INTLKSUMY.RVAL") field(OUT, "QUAD:LTUS:300:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:LTUS:300:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "QUAD:LTUS:300:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "QUAD:LTUS:300: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, "QUAD:LTUS:300: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, "QUAD:LTUS:300: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, "QUAD:LTUS:300: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,"QUAD:LTUS:300: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("QUAD:LTUS:300:TURNEDOFF",3140,1907,0,1,"QUAD:LTUS:300:TURNEDOFF") #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "QUAD:LTUS:300:STATSUB") { field(DESC, "Build STATus ") field(INAM, "mgntInit") field(SNAM, "mgntSlcStat") field(INPA, "QUAD:LTUS:300:BACT.STAT") field(INPB, "QUAD:LTUS:300:BDES.STAT") field(INPC, "QUAD:LTUS:300: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, "QUAD:LTUS:300:BACT.SEVR") field(INPH, "QUAD:LTUS:300:BDES.SEVR") field(INPI, "QUAD:LTUS:300: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, "QUAD:LTUS:300:STATE.RVAL") field(INPN, "QUAD:LTUS:300:STDZOK") field(INPO, "QUAD:LTUS:300:CALBOK") field(INPP, "QUAD:LTUS:300:OUTOFSERVICE.RVAL") field(INPQ, "QUAD:LTUS:300:CONFIG.RVAL") field(INPR, "QUAD:LTUS:300:HSTA") field(INPS, "QUAD:LTUS:300:CTRL.RVAL") field(INPT, "QUAD:LTUS:300:DEGAUSOK") field(INPV, "QUAD:LTUS:300: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, "QUAD:LTUS:300:STAT") } record(longout, "QUAD:LTUS:300:STAT") { field(DESC, "STAT sent to SLC") field(SCAN, "Passive") field(FLNK, "QUAD:LTUS:300:STATCTRLSUB") field(DOL, "QUAD:LTUS:300:STATSUB.VAL") field(OMSL, "closed_loop") } record(sSub, "QUAD:LTUS:300:STATCTRLSUB") { field(DESC, "Decode SLC STAT into mbbo") field(INAM, "mgntInit") field(SNAM, "mgntStatDecode") field(INPA, "QUAD:LTUS:300:STAT") field(INPB, "QUAD:LTUS:300:HSTA") field(INPD, "QUAD:LTUS:300:ONOFFCTRL.RVAL") field(FLNK, "QUAD:LTUS:300:STATMSG") } record(mbbo, "QUAD:LTUS:300: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, "QUAD:LTUS:300:UNAVAILGO") field(DOL, "QUAD:LTUS:300:STATCTRLSUB.W") } record(seq, "QUAD:LTUS:300:UNAVAILGO") { field(DESC, "Process UNAVAIL") field(DOL1, "QUAD:LTUS:300:STATSUB.U") field(LNK1, "QUAD:LTUS:300:UNAVAIL PP") } record(stringout, "QUAD:LTUS:300:SNLSTATMSG") { field(DTYP, "Soft Channel") } #! TextBox(TB0,820,1000,1200,1220,0,"Dialog",12,1,16777215,"QUAD:LTUS:300:STATUSSUB - future\nOverall device status - takes input from action snls, record sevrs, master snl(s) and outputs final status\n\nInputs:\nA - QUAD:LTUS:300:CTRLSTATUS - snl status\nB - MGNT:CTRLSTATUS - master list status\nC\nD - QUAD:LTUS:300: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,"QUAD:LTUS:300STATSUB\nformat control bo's into slc STAT\n\nInputs:\nA - QUAD:LTUS:300:STATUS\nC - QUAD:LTUS:300:ON\nD - QUAD:LTUS:300:STDZOK\nE - QUAD:LTUS:300:CALBOK\nF - QUAD:LTUS:300:BACTDRIFT (future)\nG -\nH- QUAD:LTUS:300:DACSTATUS\nI -QUAD:LTUS:300:ADCSTATUS\nJ - QUAD:LTUS:300:BACTSTATUS\nK - QUAD:LTUS:300:BDESSTATUS\nL - QUAD:LTUS:300:RIPLSTATUS\n\nOutput:\nP - QUAD:LTUS:300: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, "QUAD:LTUS:300: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, "QUAD:LTUS:300: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, "QUAD:LTUS:300: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, "QUAD:LTUS:300: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 b-field of a slave with out a powered trim coil # equal to the main desired current and pass backwards # through the IVB poly. record(sub, "QUAD:LTUS:300:IDES2BDES") { field(DESC, "Cal BDES") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "QUAD:LTUS:300:IDES2BDES") field(INPB, "QUAD:LTUS:300:POLYCOEF") field(INPC, "QUAD:LTUS:300:POLYCOEF.A") field(INPD, "QUAD:LTUS:300:POLYCOEF.B") field(INPE, "QUAD:LTUS:180:IDES CP MS") field(INPF, "QUAD:LTUS:180:BDELTAS PP") field(INPG, "100") field(EGU, "kG") field(HOPR, "51.58420") field(LOPR, "0.2728") field(HIHI, "51.58420") field(LOLO, "0.2728") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "51.58420") field(LOW, "0.2728") field(FLNK, "QUAD:LTUS:300:BDES") } # Calcuate the bcon of a slave using # the main desired current and pass backwards # through the IVB poly. # the trim b-field is acutally amps. record(sub, "QUAD:LTUS:300:ICON2BCON") { field(DESC, "Cal BCON") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "QUAD:LTUS:300:ICON2BCON") field(INPB, "QUAD:LTUS:300:POLYCOEF") field(INPC, "QUAD:LTUS:300:POLYCOEF.A") field(INPD, "QUAD:LTUS:300:POLYCOEF.B") field(INPE, "QUAD:LTUS:180:ICON CP NMS") field(INPF, "QUAD:LTUS:180:BDELTAS PP") field(INPG, "100") field(EGU, "kG") field(HOPR, "51.58420") field(LOPR, "0.2728") field(HIHI, "51.58420") field(LOLO, "0.2728") field(PREC, "7") field(BRSV, "INVALID") # Set MINOR alarms for main as the default, slaves will set NO_ALARM field(HHSV, "NO_ALARM") field(HSV, "NO_ALARM") field(LSV, "NO_ALARM") field(LLSV, "NO_ALARM") field(HIGH, "51.58420") field(LOW, "0.2728") field(FLNK, "QUAD:LTUS:300:BCON") }#! 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, "QUAD:LTUS:345:IACT") { field(DESC, "Current") field(INP, "QUAD:LTUS:180:IACT CP NMS") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "QUAD:LTUS:345:BACT") info(autosaveFields,"HYST") } record(bi, "QUAD:LTUS:345:STATE") { field(DESC, "PS On/Off Status") field(DTYP, "Raw Soft Channel") field(INP, "QUAD:LTUS:180:STATE CP MS") field(ZSV, "MAJOR") field(ZNAM, "OFF") field(ONAM, "ON") } record(ao, "QUAD:LTUS:345:IDES") { field(DESC, "Desired Current") field(PREC, "3") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(MDEL, "-1") field(HIHI, "165.0") field(LOLO, "0.0") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "QUAD:LTUS:345:BDELTAS") field(DRVH, "165.0") field(DRVL, "0.0") field(DOL, "QUAD:LTUS:345: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, "QUAD:LTUS:345:ICTRL PP") } # This record is processed by QUAD:LTUS:345:ICON") # Note: we are not setting alarms here. record(ao, "QUAD:LTUS:345:ICON") { field(DESC, "Config I") field(DTYP, "Soft Channel") field(PREC, "3") field(HOPR, "165.0") field(LOPR, "0.0") field(DRVH, "165.0") field(DRVL, "0.0") field(DOL, "QUAD:LTUS:345:B2ICON.K") field(OMSL, "closed_loop") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:345:INOM") { field(DESC, "Nominal Current") field(DOL, "QUAD:LTUS:345:BNOM.K") field(OMSL, "closed_loop") field(PREC, "3") field(EGU, "A") field(DRVH, "165.0") field(DRVL, "0.0") field(HOPR, "165.0") field(LOPR, "0.0") } record(ao, "QUAD:LTUS:345:ICTRL") { field(DESC, "Set Current") field(PREC, "3") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(DRVH, "165.0") field(DRVL, "0.0") field(MDEL, "-1") field(FLNK, "QUAD:LTUS:345:ICTRLGO") field(OMSL, "supervisory") info(autosavefields,"VAL") } record(seq, "QUAD:LTUS:345:ICTRLGO") { field(DESC, "Process Current Setpoint") field(PREC, "3") # Set ISETPT to supervisory field(DOL1, "0") field(LNK1, "QUAD:LTUS:345:ISETPT.OMSL") field(DOL2, "QUAD:LTUS:345:ICTRL") field(LNK2, "QUAD:LTUS:345:ISETPT PP") # Set ISETPT to closed loop - get data from BCTRLSUB.K field(DOL3, "1") field(LNK3, "QUAD:LTUS:345:ISETPT.OMSL") } record(ao, "QUAD:LTUS:345:IMAX") { field(DESC, "Max I") field(DTYP, "Soft Channel") field(DRVH, "165.0") field(DRVL, "0.0") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(PREC, "3") field(PINI, "YES") field(VAL, "165.0") field(FLNK, "QUAD:LTUS:345:IMIN") } record(ao, "QUAD:LTUS:345:IMIN") { field(DESC, "Min I") field(DTYP, "Soft Channel") field(DRVH, "165.0") field(DRVL, "0.0") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(PREC, "3") field(VAL, "0.0") field(FLNK, "QUAD:LTUS:345:IRANGE") } record(sel, "QUAD:LTUS:345:IACTPREVOK") { field(DESC, "Last Good Current") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(PREC, "3") field(NVL, "QUAD:LTUS:345:BACT.SEVR") field(INPA, "QUAD:LTUS:345:IACT NPP MS") field(INPB, "QUAD:LTUS:345:IACTPREVOK NPP MS") field(INPC, "QUAD:LTUS:345:IACTPREVOK NPP MS") field(INPD, "QUAD:LTUS:345:IACTPREVOK NPP MS") } record(sub, "QUAD:LTUS:345:IACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:345:IDES") field(INPB, "QUAD:LTUS:345:ISETPT.DRVH") field(INPC, "QUAD:LTUS:345:ISETPT.DRVL") field(INPD, "QUAD:LTUS:345:IDELTAS.I") field(INPE, "QUAD:LTUS:345:IDELTAS.J") field(INPG, "QUAD:LTUS:345:STATE") field(INPH, "QUAD:LTUS:345:HSTA") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(sub, "QUAD:LTUS:345:IMONLIMITS") { field(DESC, "Aux Current Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:345:IDES") field(INPB, "QUAD:LTUS:345:ISETPT.DRVH") field(INPC, "QUAD:LTUS:345:ISETPT.DRVL") field(INPD, "QUAD:LTUS:345:IDELTAS.K") field(INPE, "QUAD:LTUS:345:IDELTAS.L") field(INPG, "QUAD:LTUS:345:STATE") field(INPH, "QUAD:LTUS:345:HSTA") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(seq, "QUAD:LTUS:345:ILIMITS") { field(DESC, "Set ACT and MON Limits") field(PREC, "3") field(DOL1, "QUAD:LTUS:345:BLIMITS") field(LNK1, "QUAD:LTUS:345:IACTLIMITS.F PP") field(DOL2, "QUAD:LTUS:345:IACTLIMITS.I") field(LNK2, "QUAD:LTUS:345:IACT.HIGH") field(DOL3, "QUAD:LTUS:345:IACTLIMITS.J") field(LNK3, "QUAD:LTUS:345:IACT.LOW") field(DOL4, "QUAD:LTUS:345:IACTLIMITS.K") field(LNK4, "QUAD:LTUS:345:IACT.HIHI") field(DOL5, "QUAD:LTUS:345:IACTLIMITS.L") field(LNK5, "QUAD:LTUS:345:IACT.LOLO") field(DOL6, "QUAD:LTUS:345:BLIMITS") field(LNK6, "QUAD:LTUS:345:IMONLIMITS.F PP") field(DOL7, "QUAD:LTUS:345:IMONLIMITS.I") field(LNK7, "QUAD:LTUS:345:IMON.HIGH") field(DOL8, "QUAD:LTUS:345:IMONLIMITS.J") field(LNK8, "QUAD:LTUS:345:IMON.LOW") field(DOL9, "QUAD:LTUS:345:IMONLIMITS.K") field(LNK9, "QUAD:LTUS:345:IMON.HIHI") field(DOLA, "QUAD:LTUS:345:IMONLIMITS.L") field(LNKA, "QUAD:LTUS:345: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, "QUAD:LTUS:345:IDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntRawDeltas") field(INPD, "QUAD:LTUS:345:TRIMBTOL") field(INPE, "QUAD:LTUS:345:CHCKBTOL") field(INPF, "QUAD:LTUS:345:BDELTAS.K") field(INPG, "QUAD:LTUS:345:BDELTAS.L") field(INPH, "QUAD:LTUS:345: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, "QUAD:LTUS:345:STDZITOLR") field(INPC, "QUAD:LTUS:345:STDZITOL") field(FLNK, "") } # All ps controllers with on/off control will set the macro ONOF # as follows: # # ONOF = QUAD:LTUS:180: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, "QUAD:LTUS:345: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 = QUAD:LTUS:180:RESET PP # record(bo, "QUAD:LTUS:345: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, "QUAD:LTUS:345:RAMPSTATE") { field(DESC, "PS Ramp Status") field(DTYP, "Soft Channel") field(DOL, "QUAD:LTUS:180: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, "QUAD:LTUS:345: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, "QUAD:LTUS:345:TRIMRAMPRATE") field(OUT, "") field(FLNK, "QUAD:LTUS:345:STDZDLY") } record(ao, "QUAD:LTUS:345:ISETPT") { field(DESC, "Current Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(DRVH, "165.0") field(DRVL, "0.0") field(MDEL, "-1") field(OUT, "") field(DOL, "QUAD:LTUS:345: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, "QUAD:LTUS:345:IMON") { field(DESC, "Aux Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(INP, "QUAD:LTUS:180:IMON CP NMS") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "QUAD:LTUS:345:BMON") } record(ao, "QUAD:LTUS:345:IRIPL") { field(DESC, "Ripple Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(DOL, "QUAD:LTUS:180:IRIPL CP NMS") field(OMSL, "closed_loop") field(EGU, "A") field(DRVH, "1.0") field(HOPR, "1.0") field(PREC, "3") field(FLNK, "QUAD:LTUS:345:IRIPLOK") } record(sub, "QUAD:LTUS:345:IRIPLOK") { field(DESC, "Ripple Current Status") field(INAM, "mgntInit") field(SNAM, "mgntRiplOK") field(INPA, "QUAD:LTUS:345:IRIPL.VAL") field(INPB, "QUAD:LTUS:345: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, "QUAD:LTUS:345:R") { field(DESC, "Resistance") field(EGU, "Ohms") field(PREC, "4") field(PINI, "YES") field(DOL, "QUAD:LTUS:180: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, "QUAD:LTUS:345:IGND") { field(DESC, "Ground Current") field(EGU, "A") field(PREC, "6") field(PINI, "YES") field(DOL, "QUAD:LTUS:180:IGND CP MS") field(OMSL, "closed_loop") } record(bi, "QUAD:LTUS:345:INTLKSUMY") { field(DESC, "Interlock Summary") field(INP, "QUAD:LTUS:180:INTLKSUMY CP MS") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(ZNAM, "OK") field(ONAM, "FAULT") field(PINI, "NO") } record(mbbo, "QUAD:LTUS:345: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, "QUAD:LTUS:180:COOLING CP NMS") field(OMSL, "closed_loop") } # The following PV is processed by :BACTFO # which is processed by :BACT record(fanout, "QUAD:LTUS:345:IACTFO") { field(DESC, "IACT processing") field(SELM, "All") field(LNK1, "QUAD:LTUS:345:IACTPREVOK") field(LNK2, "QUAD:LTUS:345:IDIFF") field(LNK3, "QUAD:LTUS:345:IADIFF") field(LNK4, "QUAD:LTUS:345:IRATIO") field(LNK5, "QUAD:LTUS:345:IDIRECT") field(LNK6, "QUAD:LTUS:345:IACTPOL_CHECK") } record(calc, "QUAD:LTUS:345:IDIFF") { field(DESC, "IDES-IACT") field(CALC, "A-B") field(INPA, "QUAD:LTUS:345:IDES") field(INPB, "QUAD:LTUS:345:IACT") field(EGU, "A") field(PREC, "9") field(HOPR, "165.0") field(LOPR, "0.0") } record(calc, "QUAD:LTUS:345:IADIFF") { field(DESC, "Absolute IDES-IACT") field(CALC, "A<0?ABS(A):A") field(INPA, "QUAD:LTUS:345:IDIFF") field(PREC, "9") } record(calc, "QUAD:LTUS:345:IRATIO") { field(DESC, "IDES-IACT/IMAX") field(CALC, "B?A/B:0") field(INPA, "QUAD:LTUS:345:IDIFF") field(INPB, "QUAD:LTUS:345:IDES.DRVH") field(PREC, "9") } record(calcout, "QUAD:LTUS:345:IRANGE") { field(DESC, "Current Range") field(PINI, "YES") field(CALC, "ABS(A-B)") field(INPA, "QUAD:LTUS:345:IMIN") field(INPB, "QUAD:LTUS:345: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, "QUAD:LTUS:345: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, "QUAD:LTUS:345:IACT") field(FLNK, "QUAD:LTUS:345:IACTPOL") } record(bo, "QUAD:LTUS:345:IACTPOL") { field(DESC, "Actual I Polarity") field(DTYP, "Raw Soft Channel") field(DOL, "QUAD:LTUS:345: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,"QUAD:LTUS:345:I*LIMITS:\n Calculate alarm and warning limits based on \n deltas from QUAD:LTUS:345:IDELTAS and the\n QUAD:LTUS:345: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,"QUAD:LTUS:345:IACT: \n Get copy of QUAD:LTUS:345:I. \n",null) #! TextBox(TB12,1280,3100,1760,3200,0,"Dialog",12,1,16777215,"QUAD:LTUS:345: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,"QUAD:LTUS:345:IDES:\n Contains raw value calculated by \nQUAD:LTUS:345: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 \nQUAD:LTUS:345:BDELTAS.\n",null) #! TextBox(TB10,56,1940,316,2340,0,"Dialog",12,1,16777215,"QUAD:LTUS:345: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 QUAD:LTUS:345: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 QUAD:LTUS:345: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,"QUAD:LTUS:345:ISETPT:\n Sets the hardware. When fast feedback is set on, this record is\n set to closed loop mode by QUAD:LTUS:345:FBCKSTART sequence. When \n the loop is closed, this record takes input calculated by \n BFBCK only. When fast feedback is set off, QUAD:LTUS:345:FBCKSTOP \n will set it back to supervisory so that the value can be set by \n QUAD:LTUS:345: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, "QUAD:LTUS:345:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:345:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "QUAD:LTUS:345:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "QUAD:LTUS:345:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "QUAD:LTUS:345:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "QUAD:LTUS:345:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "1") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "QUAD:LTUS:345: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, "QUAD:LTUS:345:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "QUAD:LTUS:345:TRIMTYPE.RVAL") field(INPB, "QUAD:LTUS:345:CONFIG.RVAL") field(OUT, "QUAD:LTUS:345:TRIMMAXNUM PP") } record(longout, "QUAD:LTUS:345: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, "QUAD:LTUS:345: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, "QUAD:LTUS:180:TRIMRAMPRATE CP NMS") field(OMSL, "closed_loop") field(VAL, "") field(OUT, "QUAD:LTUS:345:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "QUAD:LTUS:345: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, "QUAD:LTUS:180:TRIMSETL CP NMS") field(OMSL, "closed_loop") field(VAL, "") } record(bo, "QUAD:LTUS:345: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, "QUAD:LTUS:345: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, "QUAD:LTUS:345: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, "0") } record(bo, "QUAD:LTUS:345:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "0") } record(ao, "QUAD:LTUS:345: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, "QUAD:LTUS:345:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "QUAD:LTUS:345: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, "QUAD:LTUS:345: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, "QUAD:LTUS:345:IMOVE") field(INPB, "QUAD:LTUS:345:IACT") field(INPC, "QUAD:LTUS:345:IRAMPRATE") field(INPD, "1.0") field(INPE, "QUAD:LTUS:345:TRIMDLYPCT") field(INPF, "QUAD:LTUS:345:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "QUAD:LTUS:345:RAMPTIME_LEFT PP") } record(longout, "QUAD:LTUS:345:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "QUAD:LTUS:345:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "QUAD:LTUS:345:RAMPDONE_CALC") } record(calc, "QUAD:LTUS:345:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "QUAD:LTUS:345:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "QUAD:LTUS:345:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "QUAD:LTUS:345: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, "QUAD:LTUS:345:RAMPTIME_LEFT") field(OUT, "QUAD:LTUS:345:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "QUAD:LTUS:345:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "QUAD:LTUS:345:RAMPTIME_LEFT NMS") field(OUT, "QUAD:LTUS:345:RAMPDONE PP") } record(bo, "QUAD:LTUS:345:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "QUAD:LTUS:345:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "QUAD:LTUS:345: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, "QUAD:LTUS:345: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, "QUAD:LTUS:345:STDZINIT") { field(DESC, "Proc. Stdz PVs on boot") field(PINI, "YES") field(DOL1, "1") field(DOL2, "1") field(DOL3, "1") field(LNK1, "QUAD:LTUS:345:DEBUG.PROC PP") field(LNK2, "QUAD:LTUS:345:STDZCYCLENUM.PROC PP") field(LNK3, "QUAD:LTUS:345:STDZDISABLE.PROC PP") field(LNK4, "QUAD:LTUS:345: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, "QUAD:LTUS:345:STDZSUB") { field(DESC, "Stdz subroutine") field(INAM, "mgntStdzInit") field(SNAM, "mgntStdz") field(BRSV, "INVALID") field(INPA, "QUAD:LTUS:345:STDZIMIN NPP NMS") field(INPB, "QUAD:LTUS:345:STDZIMAX NPP NMS") field(INPC, "QUAD:LTUS:345:STDZIFINAL NPP NMS") field(INPD, "QUAD:LTUS:345:STDZCYCLENUM NPP NMS") field(INPE, "QUAD:LTUS:345:STDZDIRECT.RVAL NPP NMS") field(INPF, "QUAD:LTUS:345:STDZDISABLE.RVAL CPP NMS") field(INPG, "QUAD:LTUS:345: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, "QUAD:LTUS:345:STDZWF PP") field(OUTB, "QUAD:LTUS:345: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, "QUAD:LTUS:345:STDZWF") } record(mbbo, "QUAD:LTUS:345: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, "QUAD:LTUS:345: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, "QUAD:LTUS:345:STDZMAINPS") { field(DESC, "Stdz by main or self") field(PINI, "YES") field(DTYP, "Soft Channel") field(ZNAM, "SELF") field(ONAM, "MAIN") } record(bo, "QUAD:LTUS:345: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, "QUAD:LTUS:345: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, "QUAD:LTUS:345: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, "QUAD:LTUS:345:STDZTOD") { field(DESC, "Successful Standardize Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "QUAD:LTUS:345:STDZLOSTTOD") { field(DESC, "Standardize Lost Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(longout, "QUAD:LTUS:345:STDZCYCLECNT") { field(DESC, "Cycle Count") field(PINI, "YES") } record(longout, "QUAD:LTUS:345: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, "QUAD:LTUS:345:STDZDIRECT") } # The default standardize direction is "UP" for # all LCLS Magnets.. record(bo, "QUAD:LTUS:345:STDZDIRECT") { field(DESC, "Standardize Direction ") field(ZNAM, "UP") field(ONAM, "DOWN") field(VAL, "0") field(FLNK, "QUAD:LTUS:345:STDZIMIN") } record(ao, "QUAD:LTUS:345:STDZIMIN") { field(DESC, "Min-STDZ Current") field(PREC, "1") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(VAL, "0.0") field(FLNK, "QUAD:LTUS:345:STDZIMAX") } record(ao, "QUAD:LTUS:345:STDZIMAX") { field(DESC, "Max. Standarize Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(VAL, "165.0") field(FLNK, "QUAD:LTUS:345:STDZIFINAL") } record(ao, "QUAD:LTUS:345:STDZIFINAL") { field(DESC, "Final SDTZ Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(VAL, "0.0") field(FLNK, "QUAD:LTUS:345: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, "QUAD:LTUS:345: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, "QUAD:LTUS:345:STDZITOL") { field(DESC, "Stdz min tolerance") field(PREC, "5") field(CALC, "MAX(ABS(A),ABS(B))*C") field(INPA, "QUAD:LTUS:345:STDZIMIN CP NMS") field(INPB, "QUAD:LTUS:345:STDZIMAX CP MMS") field(INPC, "0.05") field(INPD, "QUAD:LTUS:345:STDZITOLR CP MMS") field(EGU, "A") field(FLNK, "QUAD:LTUS:345:IDELTAS") field(PINI, "YES") } # D - factor (3.154/2 = 1.577) for EPSC, otherwise, set to 1.0 record(calc, "QUAD:LTUS:345:STDZDLY") { field(DESC, "Ramp time for stdz cycle") field(CALC, "C>0?MAX(1,ABS((A-B)/C)*D):0") field(INPA, "QUAD:LTUS:345:STDZIMIN CP NMS") field(INPB, "QUAD:LTUS:345:STDZIMAX CP NMS") field(INPC, "QUAD:LTUS:345:TRIMRAMPRATE CP NMS") field(INPD, "1.0") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") } record(calc, "QUAD:LTUS:345:STDZRAMPDLY") { field(DESC, "Ramp delay total") field(CALC, "MAX(1,((A/100)*B+B))") field(PREC, "5") field(INPA, "QUAD:LTUS:345:TRIMDLYPCT CP MS") field(INPB, "QUAD:LTUS:345: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, "QUAD:LTUS:345:STDZMINIDLY") { field(DESC, "Mini-stdz delay") field(CALC, "A") field(PREC, "5") field(A, "1.0") field(EGU, "sec") field(PINI, "YES") } record(ao, "QUAD:LTUS:345: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, "QUAD:LTUS:345:STDZMINIDELTA") { field(DESC, "Stdz mini % of IMAX") field(CALC, "(B/100)*(A-C)") field(INPA, "QUAD:LTUS:345:IDES.HOPR") field(INPB, "QUAD:LTUS:345:STDZMINIPCT CPP NMS") field(INPC, "QUAD:LTUS:345:IDES.LOPR") field(PREC, "5") } record(calc, "QUAD:LTUS:345:STDZMINISETPT") { field(DESC, "Mini Stdz delta") field(CALC, "C==0?MAX(E-D,B):MIN(E+D,A)") field(INPA, "QUAD:LTUS:345:IDES.HOPR") field(INPB, "QUAD:LTUS:345:IDES.LOPR") field(INPC, "QUAD:LTUS:345:STDZDIRECT.RVAL") field(INPD, "QUAD:LTUS:345:STDZMINIDELTA") field(INPE, "QUAD:LTUS:345:IDES") field(PREC, "5") field(FLNK, "QUAD:LTUS:345: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, "QUAD:LTUS:345:STDZMINISETPTOOR") { field(DESC, "Mini Stdz setpoint out of range") field(CALC, "C==0?(E-DA)") field(INPA, "QUAD:LTUS:345:IDES.HOPR") field(INPB, "QUAD:LTUS:345:IDES.LOPR") field(INPC, "QUAD:LTUS:345:STDZDIRECT.RVAL") field(INPD, "QUAD:LTUS:345:STDZMINIDELTA") field(INPE, "QUAD:LTUS:345: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, "QUAD:LTUS:345: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, "QUAD:LTUS:345:IADJUST.RVAL") field(INPB, "QUAD:LTUS:345:STDZDIRECT.RVAL") field(INPC, "QUAD:LTUS:345:STDZOK.RVAL") field(INPD, "QUAD:LTUS:345:STDZDISABLE.RVAL") field(INPE, "QUAD:LTUS:345:STATE.RVAL CPP NMS") field(INPF, "QUAD:LTUS:345:ICTRL.RVAL") field(INPG, "QUAD:LTUS:345:STATE.SEVR") field(INPH, "QUAD:LTUS:345:BDELTAS.M") field(INPI, "QUAD:LTUS:345:IACT.SEVR") field(OUT, "QUAD:LTUS:345:STDZLOSTGO.SELN PP NMS") field(OOPT, "Transition To Non-zero") } record(seq, "QUAD:LTUS:345:STDZLOSTGO") { field(DESC, "Process lost stdz") field(SELM, "Mask") field(DOL1, "1") field(DOL2, "0") field(LNK1, "QUAD:LTUS:345:STDZLOSTTOD.PROC") field(LNK2, "QUAD:LTUS:345:STDZOK PP") } # Record maximum current after standardize # Reset to IACT from sequence after trim # Disable processing during (mini-)standardize or trim record(calc, "QUAD:LTUS:345:STDZIACTMAX") { field(DESC, "Max act current after stdz") field(CALC, "MAX(A, B)") field(DISV, "0") field(SDIS, "QUAD:LTUS:345:CHECKPWRDIP_ENABLE") field(INPA, "QUAD:LTUS:345:IACT CP") field(INPB, "QUAD:LTUS:345:STDZIACTMAX") field(EGU, "A") field(FLNK, "QUAD:LTUS:345:CHECKPWRDIP") } # Detect power dip if STDZOK is YES, STDZ is enabled, and IACT is valid # If IACT drops below STDZIACTMAX by more than the trim tolerance, clear STDZOK # Warning: Take the absolute value of the trim tolerance, or else quads of # negative polarity will always lose STDZ since their IDELTAS.I are negative. # Note: Large quads and bends are prone to losing STDZ even if they are # perturbed toward higher current since their current tends to overshoot # by greater than the trim tolerance before settling down. record(calcout, "QUAD:LTUS:345:CHECKPWRDIP") { field(DESC, "Detect power dip") field(CALC, "(A-B>ABS(C))?3:0") field(DISV, "0") field(SDIS, "QUAD:LTUS:345:CHECKPWRDIP_ENABLE") field(INPA, "QUAD:LTUS:345:STDZIACTMAX") field(INPB, "QUAD:LTUS:345:IACT") field(INPC, "QUAD:LTUS:345:IDELTAS.I") field(OUT, "QUAD:LTUS:345:STDZLOSTGO.SELN PP NMS") field(OOPT, "When Non-zero") } # Enable processing of STDZIACTMAX and CHECKPWRDIP only if # STDZOK = YES, STDZDISABLE = NO, CTRL != Trim (2), and # CTRL != Stdz (4) record(calc, "QUAD:LTUS:345:CHECKPWRDIP_ENABLE") { field(CALC, "A&&!B&&(C#2)&&(C#4)") field(INPA, "QUAD:LTUS:345:STDZOK.RVAL CP") field(INPB, "QUAD:LTUS:345:STDZDISABLE.RVAL CP") field(INPC, "QUAD:LTUS:345:CTRL.RVAL CP") } #! 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, "QUAD:LTUS:345: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, "QUAD:LTUS:345: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, "QUAD:LTUS:345:CALBSET") { field(DESC, "Use DAC Calbration") field(SCAN, "10 second") field(CALC, "A&&(B==0)&&C?31:960") field(INPA, "QUAD:LTUS:345:CALBOK") field(INPB, "QUAD:LTUS:345:CALBDISABLE") field(INPC, "QUAD:LTUS:345:CALBSLOPE") field(OOPT, "On Change") field(OUT, "QUAD:LTUS:345: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, "QUAD:LTUS:345:CALB_SEQ") { field(DESC, "Output Calib Values") field(SELM, "Mask") field(SELL, "QUAD:LTUS:345: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, "QUAD:LTUS:345:CALBSLOPE") field(DOL3, "QUAD:LTUS:345: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, "QUAD:LTUS:345:CALBTOD") { field(DESC, "Calibration Success Time") field(PINI, "YES") # field(DOL, "") field(OMSL, "supervisory") field(DTYP, "Soft Channel") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:345: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, "QUAD:LTUS:345: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, "QUAD:LTUS:345: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, "QUAD:LTUS:345:CALBOFFSET") { field(DESC, "Calc DAC Offset") field(PREC, "6") field(EGU, "Counts") field(PINI, "YES") } record(bo, "QUAD:LTUS:345: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, "QUAD:LTUS:345:DACSLOPE") { field(DESC, "V to DAC slope") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "supervisory") field(PINI, "YES") field(FLNK, "QUAD:LTUS:345:DACOFFSET") } # Default Offset used in conversion from Volts to DAC Counts record(ao, "QUAD:LTUS:345:DACOFFSET") { field(DESC, "V to DAC offset") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "supervisory") field(PINI, "YES") field(FLNK, "QUAD:LTUS:345: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, "QUAD:LTUS:345: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, "QUAD:LTUS:345:IACT") field(INPD, "QUAD:LTUS:345:DACSLOPE") field(INPE, "QUAD:LTUS:345:DACOFFSET") field(EGU, "Counts") field(PREC, "6") } record(ao, "QUAD:LTUS:345:DAC") { field(DESC, "DAC Set point") field(EGU, "Counts") field(DOL, "") field(OMSL, "supervisory") field(PREC, "6") field(PINI, "YES") } record(ao, "QUAD:LTUS:345:CALBIMIN") { field(DESC, "Calibration Min Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(DRVH, "165.0") field(HOPR, "165.0") field(DRVL, "0.0") field(LOPR, "0.0") field(PREC, "3") field(EGU, "A") field(VAL, "0.0") field(FLNK, "QUAD:LTUS:345:CALBIMAX") } record(ao, "QUAD:LTUS:345:CALBIMAX") { field(DESC, "Calibration Max Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(DRVH, "165.0") field(HOPR, "165.0") field(LOPR, "0.0") field(DRVL, "0.0") field(EGU, "A") field(VAL, "165.0") field(FLNK, "QUAD:LTUS:345:CALBSTEPNUM") } record(ao, "QUAD:LTUS:345:CALBIFINAL") { field(DESC, "Calibration Last Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(PREC, "3") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(VAL, "0") } record(longout, "QUAD:LTUS:345: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, "QUAD:LTUS:345:CALBIDELTA") } record(calc, "QUAD:LTUS:345:CALBIDELTA") { field(DESC, "Step size for CALB") field(CALC, "C=0?0:ABS((A-B)/C)") field(INPA, "QUAD:LTUS:345:CALBIMAX") field(INPB, "QUAD:LTUS:345:CALBIMIN") field(INPC, "QUAD:LTUS:345: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, "QUAD:LTUS:345:CALBIMULT") { field(DESC, "IACT vs ISETPT mult") field(CALC, "C#0||A=0?1:ABS(B/A)") field(INPA, "QUAD:LTUS:180:ISETPT.DRVH") field(INPB, "QUAD:LTUS:180:IACT.HOPR") field(INPC, "QUAD:LTUS:345:PSCONTROLLER.RVAL CPP") field(EGU, "A") field(PINI, "YES") } # SNL dbputs DAC values here. 6-10 steps are possible. record(waveform, "QUAD:LTUS:345:CALBICTRLWF") { field(DESC, "ICTRL setpoint array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") } record(waveform, "QUAD:LTUS:345:DACWF") { field(DESC, "DAC count array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:345:DACSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:345:DACSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "QUAD:LTUS:345: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, "QUAD:LTUS:345:CALCDACWF") { field(DESC, "Calc DAC counts array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:345:CALCDACSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:345:CALCDACSA") { field(DESC, "Calc DAC counts") field(DTYP, "Soft Channel") field(INP, "QUAD:LTUS:345: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, "QUAD:LTUS:345:CALBYWF") { field(DESC, "mx + b") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:345:CALBYSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:345:CALBYSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "QUAD:LTUS:345:CALBYWF") field(MALM, "10") field(NELM, "6") field(INDX, "0") field(FTVL, "DOUBLE") } record(waveform, "QUAD:LTUS:345:CALBIACTWF") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:345:CALBIACTSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:345:CALBIACTSA") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(MALM, "10") field(NELM, "6") field(INP, "QUAD:LTUS:345:CALBIACTWF") field(INDX, "0") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:345:CALBLIMITS") } # Check that measured current during calibration is within # tolerance. record(aSub, "QUAD:LTUS:345: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, "QUAD:LTUS:345:CALBSTEPNUM") field(INPB, "QUAD:LTUS:345:CALBIACTWF") field(INPC, "QUAD:LTUS:345: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, "QUAD:LTUS:345: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, "QUAD:LTUS:345:STDZITOL") field(INPH, "QUAD:LTUS:345:DACSLOPE") field(INPI, "QUAD:LTUS:345: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, "QUAD:LTUS:345: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, "QUAD:LTUS:345:CALBSTEPNUM") field(INPB, "QUAD:LTUS:345:CALBIACTWF") field(INPC, "QUAD:LTUS:345:DACWF") field(INPF, "QUAD:LTUS:345: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 QUAD:LTUS:345CALBOK 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, "QUAD:LTUS:345:DEGAUSINIT") { field(DESC, "Proc. Degauss PVs on boot") field(PINI, "YES") field(DOL, "1") field(OUTA, "QUAD:LTUS:345:DEGAUSIMIN.PROC PP") field(OUTB, "QUAD:LTUS:345:DEGAUSIMAX.PROC PP") field(OUTC, "QUAD:LTUS:345:DEGAUSTYPE.PROC PP") field(OUTD, "QUAD:LTUS:345:DEGAUSSTEP.PROC PP") field(OUTE, "QUAD:LTUS:345:MADNAME.PROC PP") field(OUTF, "QUAD:LTUS:345:PSTYPE.PROC PP") field(OUTG, "QUAD:LTUS:345: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, "QUAD:LTUS:345:DEGAUSSUB") { field(DESC, "Degauss subroutine") field(INAM, "mgntDegaussInit") field(SNAM, "mgntDegauss") field(BRSV, "INVALID") field(INPA, "QUAD:LTUS:345:DEGAUSIMIN NPP NMS") field(INPB, "QUAD:LTUS:345:DEGAUSIMAX NPP NMS") field(INPC, "QUAD:LTUS:345:DEGAUSTYPE.RVAL NPP NMS") field(INPE, "QUAD:LTUS:345:DEGAUSMETHOD.RVAL NPP NMS") field(INPF, "QUAD:LTUS:345:PSTYPE NPP NMS") field(INPG, "QUAD:LTUS:345:DEBUG.RVAL NPP NMS") field(INPH, "QUAD:LTUS:345: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, "QUAD:LTUS:345:DEGAUSWF PP") field(OUTB, "QUAD:LTUS:345:DEGAUSMSG PP") field(OUTC, "QUAD:LTUS:345: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, "QUAD:LTUS:345:DEGAUSWF") { field(DESC, "Degauss Setpts") field(NELM, "60") field(FTVL, "DOUBLE") } record(mbbo,"QUAD:LTUS:345: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, "QUAD:LTUS:345: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, "QUAD:LTUS:345: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, "QUAD:LTUS:345: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, "QUAD:LTUS:345: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, "QUAD:LTUS:345:DEGAUSIMIN") { field(DESC, "Min. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "165.0") field(LOPR, "-165.0") field(DRVH, "165.0") field(DRVL, "-165.0") field(VAL, "-165.0") } record(ao, "QUAD:LTUS:345:DEGAUSIMAX") { field(DESC, "Max. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "165.0") field(LOPR, "-165.0") field(DRVH, "165.0") field(DRVL, "-165.0") field(VAL, "165.0") } # 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,"QUAD:LTUS:345: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, "QUAD:LTUS:345: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,"QUAD:LTUS:345: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, "QUAD:LTUS:345: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, "QUAD:LTUS:345: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, "QUAD:LTUS:345: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, "QUAD:LTUS:345:DEGAUSTOD") { field(DESC, "Successful Degauss Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "QUAD:LTUS:345:DEGAUSLOSTTOD") { field(DESC, "Degauss Lost Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:345:DEGAUSTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "QUAD:LTUS:345:DEGAUSTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "QUAD:LTUS:345: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, "QUAD:LTUS:345:DEGAUSGO") { field(DESC, "Set bdes of btrms to zero") field(ASG, "Internal") field(OUTA, "") field(OUTB, "") field(OUTC, "") field(OUTD, "") } # =========== CRYO ONLY =========== record(bo, "QUAD:LTUS:345: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, "QUAD:LTUS:345:DEGAUS_IMAX_CHECK") { field(DESC, "Check if imax shoud chg") field(CALC, "(C==4)&&(ABS(B)>ABS(A))?1:0") field(INPA, "QUAD:LTUS:345:DEGAUS_IMAX") field(INPB, "QUAD:LTUS:345:ISETPT") field(INPC, "QUAD:LTUS:345:DEGAUSTYPE.RVAL") field(OUT, "QUAD:LTUS:345:DEGAUS_IMAX_UPDATE.SELN") field(FLNK, "QUAD:LTUS:345:DEGAUS_IMAX_UPDATE") } record(seq, "QUAD:LTUS:345:DEGAUS_IMAX_UPDATE") { field(DESC, "Degauss IMAX Update") field(SELM, "Specified") field(DOL1, "QUAD:LTUS:345:ISETPT") field(LNK1, "QUAD:LTUS:345:DEGAUS_IMAX PP") } # Set the maximum current after a successful # degauss. This pv is updated by the # sequence. record(ao, "QUAD:LTUS:345:DEGAUS_IMAX") { field(DESC, "Max I set afer a degauss") field(EGU, "Amps") field(PINI, "YES") field(PREC, "6") field(HOPR, "165.0") field(LOPR, "-165.0") field(DRVH, "165.0") field(DRVL, "-165.0") field(VAL, "165.0") field(FLNK, "QUAD:LTUS:345:DEGAUS_IMAXPOL_CHECK") info(autosaveFields,"VAL,RVAL") } # Set the polarity if degauss_imax record(calcout, "QUAD:LTUS:345:DEGAUS_IMAXPOL_CHECK") { field(DESC, "Determine polarity of imax") field(CALC, "A>=0?0:1") field(INPA, "QUAD:LTUS:345:DEGAUS_IMAX") field(FLNK, "QUAD:LTUS:345:DEGAUS_IMAXPOL") } record(bo, "QUAD:LTUS:345:DEGAUS_IMAXPOL") { field(DESC, "Polarity of imax I") field(DTYP, "Raw Soft Channel") field(DOL, "QUAD:LTUS:345:DEGAUS_IMAXPOL_CHECK") field(OMSL, "closed_loop") field(ZNAM, "Positive") field(ONAM, "Negative") field(FLNK, "QUAD:LTUS:345: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, "QUAD:LTUS:345:DEGAUS_ABSIMAX") { field(DESC, "Absolute Max. Degauss I") field(CALC, "ABS(A)") field(INPA, "QUAD:LTUS:345:DEGAUS_IMAX") field(PREC, "6") field(EGU, "Amps") field(HOPR, "165.0") field(LOPR, "-165.0") info(autosaveFields,"VAL RVAL") } # IACT Polarity record(calcout, "QUAD:LTUS:345:IACTPOL_CHECK") { field(DESC, "Determine IACT polarity") field(SCAN, "5 second") field(CALC, "ABS(A-B)>C?(A>=0?0:1):D") field(INPA, "QUAD:LTUS:345:IACT") field(INPB, "QUAD:LTUS:345:IACTPOL_CHECK.LA") field(INPC, "0.0001") field(INPD, "QUAD:LTUS:345:IACTPOL_CHECK.PVAL") field(OOPT, "On Change") field(FLNK, "QUAD:LTUS:345:IACTPOL") } record(bo, "QUAD:LTUS:345: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,"QUAD:LTUS:345: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, "QUAD:LTUS:345:DEGAUSENABLE CP") field(INPB, "QUAD:LTUS:345:DEGAUSOK") field(INPC, "QUAD:LTUS:345:STATE CP") field(INPD, "QUAD:LTUS:345:STATE.SEVR") field(OUT, "QUAD:LTUS:345:DEGAUS_STATE_SEQ.SELN PP") field(ASG, "Internal") } record(seq, "QUAD:LTUS:345:DEGAUS_STATE_SEQ") { field(DESC, "Degauss State Sequence") field(SELM, "Specified") field(SELL, "QUAD:LTUS:345:DEGAUS_STATE_CHECK") field(LNK1, "QUAD:LTUS:345:DEGAUS_STATE_DISABLE.PROC PP") field(LNK2, "QUAD:LTUS:345:DEGAUS_STATE_LOST.PROC PP") field(LNK3, "QUAD:LTUS:345:DEGAUS_STATE_GOOD.PROC PP") field(LNK4, "QUAD:LTUS:345: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, "QUAD:LTUS:345:DEGAUS_STATE_DISABLE") { field(DESC, "Degauss not used") field(LNK1, "QUAD:LTUS:345:DEGAUSOK.ZSV") field(LNK2, "QUAD:LTUS:345: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, "QUAD:LTUS:345:STATMSG.FRSV") field(LNK4, "QUAD:LTUS:345: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, "QUAD:LTUS:345:DEGAUS_STATE_LOST") { field(DESC, "Degauss lost and ps On") field(DOL1, "1") field(LNK1, "QUAD:LTUS:345:DEGAUSOK.ZSV") field(LNK2, "QUAD:LTUS:345: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, "QUAD:LTUS:345:STATMSG.FRSV") field(LNK4, "QUAD:LTUS:345: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, "QUAD:LTUS:345:DEGAUS_STATE_OFF") { field(DESC, "Degaused lost and ps Off") field(DOL1, "2") field(LNK1, "QUAD:LTUS:345: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, "QUAD:LTUS:345:STATMSG.FRSV") field(LNK3, "QUAD:LTUS:345: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, "QUAD:LTUS:345:DEGAUS_STATE_GOOD") { field(DESC, "Degauss good") field(DOL1, "1") field(LNK1, "QUAD:LTUS:345: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, "QUAD:LTUS:345:STATMSG.FRSV PP") field(LNK3, "QUAD:LTUS:345:STATMSG.FVSV PP") field(LNK4, "") field(ASG, "Internal") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(mbbo, "QUAD:LTUS:345:FUNC") { field(DESC, "QUAD:LTUS:345 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, "0") field(FFVL, "0") field(OUT, "QUAD:LTUS:345:CTRL CA") } # :CTRL pv is processed at boot in the # sequence mgntCtrl.st Processed in sequence # record(mbbo, "QUAD:LTUS:345:CTRL") { field(DESC, "QUAD:LTUS:345 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, "QUAD:LTUS:345:SELECTEN.A PP") field(SDIS, "0") } # If a function has been selected set this unit to busy record(calcout, "QUAD:LTUS:345:SELECTEN") { field(DESC, "Control Select Enable") field(CALC, "A>0?1:A") field(FLNK, "QUAD:LTUS:345:BUSY") } # Set to FREE on IOC reboot record(bo, "QUAD:LTUS:345:BUSY") { field(DESC, "QUAD:LTUS:345 Ctrl Done") field(DOL, "QUAD:LTUS:345:SELECTEN") field(ZNAM, "FREE") field(ONAM, "BUSY") field(PINI, "YES") field(FLNK, "QUAD:LTUS:345:SELECT") } record(bo, "QUAD:LTUS:345:SELECT") { field(ZNAM, "NO") field(ONAM, "YES") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") } record(bo, "QUAD:LTUS:345: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, "QUAD:LTUS:345:CTRLSTATE") { field(DESC, "QUAD:LTUS:345 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("QUAD:LTUS:345:CTRL",20,20,0,0,"QUAD:LTUS:345:CTRL") #! Field("QUAD:LTUS:345:CTRL.OUT",16777215,1,"QUAD:LTUS:345:CTRL.OUT") #! Link("QUAD:LTUS:345:CTRL.OUT","QUAD:LTUS:345:SELECTEN.A") #! Field("QUAD:LTUS:345:CTRL.VAL",16777215,1,"QUAD:LTUS:345:CTRL.VAL") #! Record("QUAD:LTUS:345:SELECTEN",321,381,0,0,"QUAD:LTUS:345:SELECTEN") #! Field("QUAD:LTUS:345:SELECTEN.A",16777215,0,"QUAD:LTUS:345:SELECTEN.A") #! Field("QUAD:LTUS:345:SELECTEN.FLNK",16777215,1,"QUAD:LTUS:345:SELECTEN.FLNK") #! Link("QUAD:LTUS:345:SELECTEN.FLNK","QUAD:LTUS:345:BUSY") #! Field("QUAD:LTUS:345:SELECTEN.VAL",16777215,1,"QUAD:LTUS:345:SELECTEN.VAL") #! Record("QUAD:LTUS:345:BUSY",623,274,0,0,"QUAD:LTUS:345:BUSY") #! Field("QUAD:LTUS:345:BUSY.DOL",16777215,0,"QUAD:LTUS:345:BUSY.DOL") #! Link("QUAD:LTUS:345:BUSY.DOL","QUAD:LTUS:345:SELECTEN.VAL") #! Field("QUAD:LTUS:345:BUSY.FLNK",16777215,1,"QUAD:LTUS:345:BUSY.FLNK") #! Link("QUAD:LTUS:345:BUSY.FLNK","QUAD:LTUS:345:SELECT") #! Record("QUAD:LTUS:345:SELECT",669,508,0,1,"QUAD:LTUS:345:SELECT") #! Record("QUAD:LTUS:345:FUNC",940,120,0,0,"QUAD:LTUS:345:FUNC") #! Field("QUAD:LTUS:345:FUNC.OUT",16777215,0,"QUAD:LTUS:345:FUNC.OUT") #! Link("QUAD:LTUS:345:FUNC.OUT","QUAD:LTUS:345:CTRL.VAL") #! Record("QUAD:LTUS:345:ABORT",193,41,0,0,"QUAD:LTUS:345:ABORT") #! Record("QUAD:LTUS:345:CTRLSTATE",369,34,0,0,"QUAD:LTUS:345: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,"QUAD:LTUS:345:SELECT is used for Multi-device selection.\nIt is enabled when associated QUAD:LTUS:345:CTRL is \"0\" (DONE).\nIt is disabled when associated QUAD:LTUS:345: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,"QUAD:LTUS:345: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, "QUAD:LTUS:345:BCTRL_INIT") { field(DESC, "Process BCTRL on boot") field(PINI, "YES") field(CALC, "A=3?1:0") field(INPA, "QUAD:LTUS:345:BCTRL.SEVR") field(OUT, "QUAD:LTUS:345: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, "QUAD:LTUS:345:BACT") { field(DESC, "Actual B") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "QUAD:LTUS:345:BACT") field(INPB, "QUAD:LTUS:345:POLYCOEF") field(INPC, "QUAD:LTUS:345:POLYCOEF.A") field(INPD, "QUAD:LTUS:345:POLYCOEF.B") field(INPE, "QUAD:LTUS:345:IACT MS") field(INPF, "QUAD:LTUS:345:BDELTAS PP") field(INPG, "100") field(EGU, "kG") field(HOPR, "-0.2404") field(LOPR, "-52.0232") field(HIHI, "-0.2404") field(LOLO, "-52.0232") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "-0.2404") field(LOW, "-52.0232") field(FLNK, "QUAD:LTUS:345: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, "QUAD:LTUS:345:BDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntPhyDeltas") field(EGU, "kG") field(HOPR, "1") field(PREC, "7") field(BRSV, "INVALID") field(INPA, "QUAD:LTUS:345:BDES") field(INPB, "QUAD:LTUS:345:TRIMBTOL") field(INPC, "QUAD:LTUS:345:TRIMBTOLR") field(INPD, "QUAD:LTUS:345:CHCKBTOL") field(INPE, "QUAD:LTUS:345:CHCKBTOLR") field(F, "2.0") field(INPG, "30") field(INPH, "QUAD:LTUS:345:BACT.VAL") # # MPS absolute and relative tolerances field(INPP, "QUAD:LTUS:345:MPSBTOL") field(INPQ, "QUAD:LTUS:345:MPSBTOLR") field(FLNK, "QUAD:LTUS:345:BCONLIMITS") info(autosaveFields,"F") } # This record is processed by BDELTAS record(aSub, "QUAD:LTUS:345:BCONLIMITS") { field(DESC, "Config B-field Limits") field(INAM, "mgntInit") field(SNAM, "mgntBCONLimits") field(INPA, "QUAD:LTUS:345:BDES") field(INPB, "QUAD:LTUS:345:BDELTAS.I") field(INPG, "QUAD:LTUS:345:DEBUG.RVAL") field(FTA, "DOUBLE") field(FTB, "DOUBLE") field(FTG, "ULONG") field(OUTA, "QUAD:LTUS:345:BCON.HIGH") field(OUTB, "QUAD:LTUS:345:BCON.LOW") field(OUTC, "QUAD:LTUS:345:BCON.HIHI") field(OUTD, "QUAD:LTUS:345:BCON.LOLO PP") field(FTVA, "DOUBLE") field(FTVB, "DOUBLE") field(FTVC, "DOUBLE") field(FTVD, "DOUBLE") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:345:IDELTAS") } # The following PV is processed by :BACT # which is processed by :BACT # record(fanout, "QUAD:LTUS:345:BACTFO") { field(DESC, "BACT processing") field(SELM, "All") field(LNK1, "QUAD:LTUS:345:BDIFF") field(LNK2, "QUAD:LTUS:345:BADIFF") field(LNK3, "QUAD:LTUS:345:BRATIO") field(LNK4, "QUAD:LTUS:345:MPSLIMITS") field(LNK5, "QUAD:LTUS:345:I2BSTATUS") field(LNK6, "QUAD:LTUS:345:IACTFO.PROC") } record(calc, "QUAD:LTUS:345:BDIFF") { field(DESC, "BDES-BACT") field(CALC, "A-B") field(INPA, "QUAD:LTUS:345:BDES") field(INPB, "QUAD:LTUS:345:BACT") field(EGU, "kG") field(PREC, "7") } record(calc, "QUAD:LTUS:345:BADIFF") { field(DESC, "Absolute BDES-BACT") field(INPA, "QUAD:LTUS:345:BDIFF") field(EGU, "kG") field(PREC, "7") field(CALC, "A<0?ABS(A):A") } record(calc, "QUAD:LTUS:345:BRATIO") { field(DESC, "BACT Error") field(CALC, "B?A/B:0") field(INPA, "QUAD:LTUS:345:BDIFF") field(INPB, "QUAD:LTUS:345:BDES.HOPR") field(EGU, "kG") field(PREC, "7") } record(mbbi, "QUAD:LTUS:345: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, "QUAD:LTUS:345:BACT.J") } # Note: for a string slave set the MONFL # macro to the following: # MONFL=:IMONCALC MS record(sub, "QUAD:LTUS:345:BMON") { field(DESC, "Second Transductor") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "QUAD:LTUS:345:BMON") field(INPB, "QUAD:LTUS:345:POLYCOEF") field(INPC, "QUAD:LTUS:345:POLYCOEF.A") field(INPD, "QUAD:LTUS:345:POLYCOEF.B") field(INPE, "QUAD:LTUS:345:IMON MS") field(INPF, "QUAD:LTUS:345:BDELTAS.VAL") field(INPG, "100") field(EGU, "kG") field(HOPR, "-0.2404") field(LOPR, "-52.0232") field(HIHI, "-0.2404") field(LOLO, "-52.0232") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "-0.2404") field(LOW, "-52.0232") } # 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=QUAD:LTUS:180:BDES CP record(ao, "QUAD:LTUS:345:BDES") { field(DESC, "Desired B-Field") field(PINI, "NO") field(DRVH, "-0.2404") field(DRVL, "-52.0232") field(HOPR, "-0.2404") field(LOPR, "-52.0232") field(PREC, "7") field(EGU, "kG") field(MDEL, "-1") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:345:IDES2BDES") field(OUT, "QUAD:LTUS:345:B2IDES PP") info(autosaveFields,"VAL") } record(sub, "QUAD:LTUS:345:B2IDES") { field(DESC, "Convert Desired B-Field to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:345:POLYCOEF") field(INPC, "QUAD:LTUS:345:POLYCOEF.A") field(INPD, "QUAD:LTUS:345:POLYCOEF.B") field(PREC, "7") field(EGU, "kG") field(HOPR, "-0.2404") field(LOPR, "-52.0232") field(MDEL, "-1") field(INPE, "QUAD:LTUS:345:BDES.DRVH") field(INPF, "QUAD:LTUS:345:BDES.DRVL") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:345:IDES") } record(sub, "QUAD:LTUS:345:BNOM") { field(DESC, "Nominal Field") field(PINI, "YES") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:345:POLYCOEF") field(INPC, "QUAD:LTUS:345:POLYCOEF.A") field(INPD, "QUAD:LTUS:345:POLYCOEF.B") field(INPE, "QUAD:LTUS:345:BDES.DRVH") field(INPF, "QUAD:LTUS:345:BDES.DRVL") field(EGU, "kG") field(HOPR, "-0.2404") field(LOPR, "-52.0232") field(PREC, "7") field(VAL, "0.0") field(FLNK, "QUAD:LTUS:345:INOM") } record(sub, "QUAD:LTUS:345:BACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:345:BDES.VAL") field(INPB, "QUAD:LTUS:345:BDES.DRVH") field(INPC, "QUAD:LTUS:345:BDES.DRVL") field(INPD, "QUAD:LTUS:345:BDELTAS.I") field(INPE, "QUAD:LTUS:345:BDELTAS.J") field(INPG, "QUAD:LTUS:345:STATE") field(INPH, "QUAD:LTUS:345:HSTA") field(EGU, "kG") field(HOPR, "-0.2404") field(LOPR, "-52.0232") field(PREC, "7") field(BRSV, "INVALID") } record(sub, "QUAD:LTUS:345:BMONLIMITS") { field(DESC, "MON Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:345:BDES.VAL") field(INPB, "QUAD:LTUS:345:BDES.DRVH") field(INPC, "QUAD:LTUS:345:BDES.DRVL") field(INPD, "QUAD:LTUS:345:BDELTAS.K") field(INPE, "QUAD:LTUS:345:BDELTAS.L") field(INPG, "QUAD:LTUS:345:STATE") field(INPH, "QUAD:LTUS:345:HSTA") field(EGU, "kG") field(HOPR, "-0.2404") field(LOPR, "-52.0232") field(PREC, "7") field(BRSV, "INVALID") } record(seq, "QUAD:LTUS:345:BLIMITS") { field(DESC, "ACT Limits") field(PREC, "7") field(DOL1, "QUAD:LTUS:345:BLIMITS") field(LNK1, "QUAD:LTUS:345:BACTLIMITS.F PP") field(DOL2, "QUAD:LTUS:345:BACTLIMITS.I") field(LNK2, "QUAD:LTUS:345:BACT.HIGH") field(DOL3, "QUAD:LTUS:345:BACTLIMITS.J") field(LNK3, "QUAD:LTUS:345:BACT.LOW") field(DOL4, "QUAD:LTUS:345:BACTLIMITS.K") field(LNK4, "QUAD:LTUS:345:BACT.HIHI") field(DOL5, "QUAD:LTUS:345:BACTLIMITS.L") field(LNK5, "QUAD:LTUS:345:BACT.LOLO") field(DOL6, "QUAD:LTUS:345:BLIMITS") field(LNK6, "QUAD:LTUS:345:BMONLIMITS.F PP") field(DOL7, "QUAD:LTUS:345:BMONLIMITS.I") field(LNK7, "QUAD:LTUS:345:BMON.HIGH") field(DOL8, "QUAD:LTUS:345:BMONLIMITS.J") field(LNK8, "QUAD:LTUS:345:BMON.LOW") field(DOL9, "QUAD:LTUS:345:BMONLIMITS.K") field(LNK9, "QUAD:LTUS:345:BMON.HIHI") field(DOLA, "QUAD:LTUS:345:BMONLIMITS.L") field(LNKA, "QUAD:LTUS:345:BMON.LOLO") field(FLNK, "QUAD:LTUS:345:ILIMITS") field(SCAN, "5 second") } record(ao, "QUAD:LTUS:345:BCTRL") { field(DESC, "B-Perturb") field(PREC, "7") field(EGU, "kG") field(DRVH, "-0.2404") field(DRVL, "-52.0232") field(HOPR, "-0.2404") field(LOPR, "-52.0232") # 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, "QUAD:LTUS:345: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, "QUAD:LTUS:345:BCTRLGO") { field(DESC, "Update DES and perturb") field(PREC, "7") # Disable BACT limits field(DOL1, "1") field(LNK1, "QUAD:LTUS:345:BLIMITS.VAL") # Update BDES with the BCTRL (slider) value field(DOL2, "QUAD:LTUS:345:BCTRL.VAL") field(LNK2, "QUAD:LTUS:345:BDES PP") field(DOL3, "1") field(LNK3, "QUAD:LTUS:345:IDIRECT.PROC PP") field(DOL4, "1") field(LNK4, "QUAD:LTUS:345:CHECKSTDZLOST.PROC PP") field(DOL5, "QUAD:LTUS:345:BCTRL.VAL") field(LNK5, "QUAD:LTUS:345:BCTRLSUB PP") # Re-enable BACT limits field(DOL6, "0") field(LNK6, "QUAD:LTUS:345:BLIMITS.VAL") } # Convert B-field to Current and output to ISETPT record(sub, "QUAD:LTUS:345:BCTRLSUB") { field(DESC, "Feedback") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:345:POLYCOEF") field(INPC, "QUAD:LTUS:345:POLYCOEF.A") field(INPD, "QUAD:LTUS:345:POLYCOEF.B") field(INPE, "QUAD:LTUS:345:BDES.DRVH") field(INPF, "QUAD:LTUS:345:BDES.DRVL") field(PREC, "7") field(EGU, "kG") field(HOPR, "-0.2404") field(LOPR, "-52.0232") field(MDEL, "-1") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:345:ISETPT") } record(ao, "QUAD:LTUS:345:BDESPREVTRIM") { field(DESC, "trim bdes for undo") field(DTYP, "Soft Channel") field(DRVH, "-0.2404") field(DRVL, "-52.0232") field(EGU, "kG") field(HOPR, "-0.2404") field(LOPR, "-52.0232") field(PREC, "7") field(PINI, "YES") info(autosaveFields,"VAL") } record(stringin, "QUAD:LTUS:345:MADNAME") { field(DESC, "MAD deck nomenclature") field(PINI, "YES") field(VAL, "QDL16") } record(ai, "QUAD:LTUS:345: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, "3304.355026") } record(ao, "QUAD:LTUS:345:BMAX") { field(DESC, "Max B-Field") field(DTYP, "Soft Channel") field(DRVH, "-0.2404") field(DRVL, "-52.0232") field(EGU, "kG") field(HOPR, "-0.2404") field(LOPR, "-52.0232") field(PREC, "7") field(PINI, "YES") field(VAL, "-0.2404") field(FLNK, "QUAD:LTUS:345:BSTEP") } record(ao, "QUAD:LTUS:345:BMIN") { field(DESC, "Min B-Field") field(DTYP, "Soft Channel") field(DRVH, "-0.2404") field(DRVL, "-52.0232") field(EGU, "kG") field(HOPR, "-0.2404") field(LOPR, "-52.0232") field(PREC, "7") field(PINI, "YES") field(VAL, "-52.0232") field(FLNK, "QUAD:LTUS:345:BSTEP") } record(ao, "QUAD:LTUS:345:BDESSAVE") { field(DESC, "bdes for save/load") field(DTYP, "Soft Channel") field(DRVH, "-0.2404") field(DRVL, "-52.0232") field(EGU, "kG") field(HOPR, "-0.2404") field(LOPR, "-52.0232") field(PINI, "YES") field(PREC, "7") } # This record is processed by QUAD:LTUS:345: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, "QUAD:LTUS:345:BCON") { field(DESC, "Config B-Field ") field(DTYP, "Soft Channel") field(PREC, "7") field(EGU, "kG") field(HOPR, "-0.2404") field(LOPR, "-52.0232") field(DRVH, "-0.2404") field(DRVL, "-52.0232") # 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 , "QUAD:LTUS:345:ICON2BCON") field(OMSL, "closed_loop") field(OUT, "QUAD:LTUS:345:B2ICON PP") info(autosaveFields,"VAL") } record(sub, "QUAD:LTUS:345:B2ICON") { field(DESC, "Convert Desired ICon to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:345:POLYCOEF") field(INPC, "QUAD:LTUS:345:POLYCOEF.A") field(INPD, "QUAD:LTUS:345:POLYCOEF.B") field(PREC, "7") field(EGU, "kG") field(HOPR, "-0.2404") field(LOPR, "-52.0232") field(MDEL, "-1") field(INPE, "QUAD:LTUS:345:BCON.DRVH") field(INPF, "QUAD:LTUS:345:BCON.DRVL") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:345: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, "QUAD:LTUS:345:BSTEP") { field(DESC, "B-Field step size") field(CALC, "(C==3)||(D==3)?0:ABS(A-B)*0.005") field(INPA, "QUAD:LTUS:345:BMAX") field(INPB, "QUAD:LTUS:345:BMIN") field(INPC, "QUAD:LTUS:345:BMIN.SEVR") field(INPD, "QUAD:LTUS:345:BMAX.SEVR") field(EGU, "kG") 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,"QUAD:LTUS:345:BCTRLDISABLECALC") { field(DESC, "Calc for disabling BCTRL") field(ASG, "Internal") field(CALC, "A?2:1") field(INPA, "QUAD:LTUS:345:ONLINE CP") field(OUT, "QUAD:LTUS:345:BCTRLDISABLEFOUT PP") } record(fanout, "QUAD:LTUS:345:BCTRLDISABLEFOUT") { field(DESC, "Disable BCTRL fanout") field(SELM, "Specified") field(SELL, "QUAD:LTUS:345:BCTRLDISABLECALC") field(LNK1, "QUAD:LTUS:345:BCTRLDISABLE") field(LNK2, "QUAD:LTUS:345:BCTRLENABLE") } record(stringout, "QUAD:LTUS:345:BCTRLDISABLE") { field(DESC, "Disable BCTRL") field(DTYP, "Soft Channel") field(OUT, "QUAD:LTUS:345:BCTRL.ASG") field(VAL, "NOWRITE") field(FLNK, "QUAD:LTUS:345:BCTRLDISV_UPDATE") } record(stringout, "QUAD:LTUS:345:BCTRLENABLE") { field(DESC, "Enable BCTRL") field(DTYP, "Soft Channel") field(OUT, "QUAD:LTUS:345:BCTRL.ASG") field(VAL, "") field(FLNK, "QUAD:LTUS:345:BCTRLDISV_UPDATE") } record(calcout, "QUAD:LTUS:345:BCTRLDISV_UPDATE") { field(DESC, "Calc for updating BCTRL.DISV") field(ASG, "Internal") field(CALC, "A") field(INPA, "QUAD:LTUS:345:ONLINE") field(OUT, "QUAD:LTUS:345: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,"QUAD:LTUS:345:BACT and MON\n are processed via links from \n QUAD:LTUS:345:IACT (device raw value readback 1)\n and\n QUAD:LTUS:345: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 QUAD:LTUS:345:POLYCOEF\nC = First polynomial coefficient (offset if linear)\nD = Second polynomial coefficient (slope if linear)\nE = QUAD:LTUS:345: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,"QUAD:LTUS:345:BDES\n is processed when set by CA users or \n QUAD:LTUS:345: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,"QUAD:LTUS:345: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 QUAD:LTUS:345: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 (QUAD:LTUS:345: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,"QUAD:LTUS:345:B*LIMITS and QUAD:LTUS:345:BLIMITS:\n Calculate alarm and warning limits based on \n deltas from QUAD:LTUS:345: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,"QUAD:LTUS:345: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,"QUAD:LTUS:345: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, "QUAD:LTUS:345: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, "QUAD:LTUS:345:MPSBTOL") { field(DESC, "Absolute mps tol") field(EGU, "kG") field(PREC, "2") field(CALC, "ABS(A)*0.02") field(INPA, "QUAD:LTUS:345:BMAX") field(PINI, "YES") } # # 21-Aug-2013: K. Luchini # Set channel access security so that users # cannot easily change values. record(ao, "QUAD:LTUS:345:MPSBMAX") { field(DESC, "MPS Max B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "-0.2404") field(DRVL, "-52.0232") field(PINI, "YES") field(VAL, "-0.2404") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:345:MPSBMIN") { field(DESC, "MPS Min B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "-0.2404") field(DRVL, "-52.0232") field(PINI, "YES") field(VAL, "-52.0232") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:345:MPSBLLIM") { field(DESC, "MPS Low Limit B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "-0.2404") field(DRVL, "-52.0232") field(PINI, "YES") field(VAL, "-52.0232") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:345:MPSBLLIM2") { field(DESC, "MPS Low Limit #2 B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "-0.2404") field(DRVL, "-52.0232") field(PINI, "YES") field(VAL, "-52.0232") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } # Set the default to Std record(mbbo, "QUAD:LTUS:345: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, "QUAD:LTUS:345:MPSLIMITS.E PP") } record(aSub, "QUAD:LTUS:345: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, "QUAD:LTUS:345:MPS.RVAL") field(INPB, "QUAD:LTUS:345:BADIFF") field(INPC, "QUAD:LTUS:345:BDELTAS.N") field(INPD, "QUAD:LTUS:345:BACT") field(INPE, "QUAD:LTUS:345:MPSBITMASK.RVAL") field(INPF, "QUAD:LTUS:345:MPSBLLIM") field(INPG, "QUAD:LTUS:345:MPSBMIN") field(INPH, "QUAD:LTUS:345:MPSBMAX") field(INPI, "QUAD:LTUS:345: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, "QUAD:LTUS:345:INTOL.RVAL PP") field(OUTB, "QUAD:LTUS:345:INTOL_BMIN.RVAL PP") field(OUTC, "QUAD:LTUS:345:INTOL_BRANGE.RVAL PP") field(OUTD, "QUAD:LTUS:345: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, "QUAD:LTUS:345:INTOL") { field(DESC, "BACT within MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:345:MPSLIMITS.VALA") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "QUAD:LTUS:345:INTOL_BMIN") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:345:MPSLIMITS.VALB") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "QUAD:LTUS:345:INTOL_BMIN2") { field(DESC, "MPS tol #2") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:345:MPSLIMITS.VALD") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "QUAD:LTUS:345:INTOL_BRANGE") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:345: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, "QUAD:LTUS:345:CHCKITOL") { field(DESC, "Absolute Check I Tolerance") field(EGU, "A") field(FLNK, "QUAD:LTUS:345:TRIMITOL") field(CALC, "ABS(A*B)") field(INPA, "QUAD:LTUS:345:CHCKBTOL") field(INPB, "QUAD:LTUS:345:POLYCOEF.B") field(PREC, "9") } record(calc, "QUAD:LTUS:345:TRIMBTOL") { field(EGU, "kG") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(DESC, "Absolute Trim Tolerance") field(CALC, "ABS(A)/2") field(INPA, "QUAD:LTUS:345:CHCKBTOL") field(FLNK, "QUAD:LTUS:345:CHCKITOL") } record(calc, "QUAD:LTUS:345:CHCKBTOL") { field(DESC, "Check absolute tolerance") field(EGU, "A") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(FLNK, "QUAD:LTUS:345:TRIMBTOL") field(CALC, "MAX(ABS(A),ABS(C))*(B/1000000)") field(INPA, "QUAD:LTUS:345:BDES.HOPR") field(INPB, "QUAD:LTUS:345:STABILITY") field(INPC, "QUAD:LTUS:345:BDES.LOPR") } record(longout, "QUAD:LTUS:345: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, "QUAD:LTUS:345:CHCKBTOL") } record(calc, "QUAD:LTUS:345:TRIMITOL") { field(DESC, "Absolute Trim I Tolerance") field(EGU, "kG") field(CALC, "ABS(A*B)") field(INPA, "QUAD:LTUS:345:POLYCOEF.B") field(INPB, "QUAD:LTUS:345:TRIMBTOL") field(PREC, "9") } record(ai, "QUAD:LTUS:345:TRIMBTOLR") { field(DESC, "Relative trim tol") field(PREC, "4") field(EGU, "%") field(HOPR, "1.0") field(LOPR, "0.0") field(PINI, "YES") } record(ai, "QUAD:LTUS:345: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, "QUAD:LTUS:345:FBCKFCOM") { field(ZNAM, "CA") field(ONAM, "FCOM") field(DESC, "CA Mode") field(PINI, "YES") field(SDIS, "0") } record(bo, "QUAD:LTUS:345:PAU") { field(ZNAM, "NotConfigured") field(ONAM, "Configured") field(DESC, "PAU Present") field(PINI, "YES") field(SDIS, "0") field(FLNK, "QUAD:LTUS:345:PAUGO") } record(fanout, "QUAD:LTUS:345:PAUGO") { field(DESC, "PAU control") field(LNK1, "QUAD:LTUS:345:PAUSTOP") field(LNK2, "QUAD:LTUS:345: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, "QUAD:LTUS:345:PAUSTART") { field(DESC, "Setup for PAU On") field(SDIS, "QUAD:LTUS:345: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, "QUAD:LTUS:345:PAUSTOP") { field(DESC, "Setup for PAU Off") field(SDIS, "QUAD:LTUS:345: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, "QUAD:LTUS:345:MCORDEVNAME") { field(DESC, "PS device name") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, "QUAD:LTUS:180:") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "QUAD:LTUS:345: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, "QUAD:LTUS:345:PSTYPE.RVAL") field(INPC, "QUAD:LTUS:345:TURNEDOFF.RVAL") field(INPD, "QUAD:LTUS:345:CONFIG.RVAL") field(INPE, "QUAD:LTUS:345:PSCATEGORY.RVAL") field(INPF, "QUAD:LTUS:345:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "QUAD:LTUS:345:AUTOCTRL.RVAL") field(INPJ, "QUAD:LTUS:345:OUTOFSERVICE.RVAL") field(INPL, "QUAD:LTUS:345:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "QUAD:LTUS:345:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "QUAD:LTUS:345:PAU") field(INPP, "QUAD:LTUS:345:CALBDISABLE.RVAL") field(INPQ, "QUAD:LTUS:345:PTRBDISABLE.RVAL") field(INPR, "QUAD:LTUS:345:TRIMDISABLE.RVAL") field(INPS, "QUAD:LTUS:345:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "QUAD:LTUS:345:FBCK") field(INPU, "QUAD:LTUS:345:TRIMTYPE.RVAL") field(INPV, "QUAD:LTUS:345:STDZDIRECT.RVAL") field(INPW, "QUAD:LTUS:345:DEGAUSENABLE.RVAL") field(FLNK, "QUAD:LTUS:345:HSTA") } record(longin, "QUAD:LTUS:345:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "QUAD:LTUS:345:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "QUAD:LTUS:345: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, "QUAD:LTUS:345: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, "QUAD:LTUS:345: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, "QUAD:LTUS:345: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, "QUAD:LTUS:345: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, "QUAD:LTUS:345: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 QUAD:LTUS:345:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses QUAD:LTUS:345:FBCK. # This PV should be replaced by QUAD:LTUS:345: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, "QUAD:LTUS:345: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, "QUAD:LTUS:345: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, "QUAD:LTUS:345: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, "QUAD:LTUS:180:OUTOFSERVICE CPP NMS") field(OMSL, "closed_loop") field(FLNK, "QUAD:LTUS:345:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"QUAD:LTUS:345:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "QUAD:LTUS:345:OUTOFSERVICE NPP NMS") field(OUT, "QUAD:LTUS:345:ONLINE PP") } record(bo, "QUAD:LTUS:345:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "QUAD:LTUS:345: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, "QUAD:LTUS:345: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, "QUAD:LTUS:345: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, "QUAD:LTUS:345: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, "QUAD:LTUS:345: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, "QUAD:LTUS:345: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, "QUAD:LTUS:345: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, "QUAD:LTUS:345: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, "QUAD:LTUS:345: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, "QUAD:LTUS:345: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, "QUAD:LTUS:345: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, "QUAD:LTUS:345:TRIMTYPE") } record(stringout, "QUAD:LTUS:345:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "QUAD:LTUS:180:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "QUAD:LTUS:345:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "QUAD:LTUS:345:STATE.RVAL") field(INPB, "QUAD:LTUS:345:INTLKSUMY.RVAL") field(OUT, "QUAD:LTUS:345:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:LTUS:345: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, "QUAD:LTUS:345:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "QUAD:LTUS:345:STATE.RVAL") field(INPB, "QUAD:LTUS:345:INTLKSUMY.RVAL") field(OUT, "QUAD:LTUS:345:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:LTUS:345:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "QUAD:LTUS:345:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "QUAD:LTUS:345: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, "QUAD:LTUS:345: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, "QUAD:LTUS:345: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, "QUAD:LTUS:345: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,"QUAD:LTUS:345: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("QUAD:LTUS:345:TURNEDOFF",3140,1907,0,1,"QUAD:LTUS:345:TURNEDOFF") #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "QUAD:LTUS:345:STATSUB") { field(DESC, "Build STATus ") field(INAM, "mgntInit") field(SNAM, "mgntSlcStat") field(INPA, "QUAD:LTUS:345:BACT.STAT") field(INPB, "QUAD:LTUS:345:BDES.STAT") field(INPC, "QUAD:LTUS:345: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, "QUAD:LTUS:345:BACT.SEVR") field(INPH, "QUAD:LTUS:345:BDES.SEVR") field(INPI, "QUAD:LTUS:345: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, "QUAD:LTUS:345:STATE.RVAL") field(INPN, "QUAD:LTUS:345:STDZOK") field(INPO, "QUAD:LTUS:345:CALBOK") field(INPP, "QUAD:LTUS:345:OUTOFSERVICE.RVAL") field(INPQ, "QUAD:LTUS:345:CONFIG.RVAL") field(INPR, "QUAD:LTUS:345:HSTA") field(INPS, "QUAD:LTUS:345:CTRL.RVAL") field(INPT, "QUAD:LTUS:345:DEGAUSOK") field(INPV, "QUAD:LTUS:345: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, "QUAD:LTUS:345:STAT") } record(longout, "QUAD:LTUS:345:STAT") { field(DESC, "STAT sent to SLC") field(SCAN, "Passive") field(FLNK, "QUAD:LTUS:345:STATCTRLSUB") field(DOL, "QUAD:LTUS:345:STATSUB.VAL") field(OMSL, "closed_loop") } record(sSub, "QUAD:LTUS:345:STATCTRLSUB") { field(DESC, "Decode SLC STAT into mbbo") field(INAM, "mgntInit") field(SNAM, "mgntStatDecode") field(INPA, "QUAD:LTUS:345:STAT") field(INPB, "QUAD:LTUS:345:HSTA") field(INPD, "QUAD:LTUS:345:ONOFFCTRL.RVAL") field(FLNK, "QUAD:LTUS:345:STATMSG") } record(mbbo, "QUAD:LTUS:345: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, "QUAD:LTUS:345:UNAVAILGO") field(DOL, "QUAD:LTUS:345:STATCTRLSUB.W") } record(seq, "QUAD:LTUS:345:UNAVAILGO") { field(DESC, "Process UNAVAIL") field(DOL1, "QUAD:LTUS:345:STATSUB.U") field(LNK1, "QUAD:LTUS:345:UNAVAIL PP") } record(stringout, "QUAD:LTUS:345:SNLSTATMSG") { field(DTYP, "Soft Channel") } #! TextBox(TB0,820,1000,1200,1220,0,"Dialog",12,1,16777215,"QUAD:LTUS:345:STATUSSUB - future\nOverall device status - takes input from action snls, record sevrs, master snl(s) and outputs final status\n\nInputs:\nA - QUAD:LTUS:345:CTRLSTATUS - snl status\nB - MGNT:CTRLSTATUS - master list status\nC\nD - QUAD:LTUS:345: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,"QUAD:LTUS:345STATSUB\nformat control bo's into slc STAT\n\nInputs:\nA - QUAD:LTUS:345:STATUS\nC - QUAD:LTUS:345:ON\nD - QUAD:LTUS:345:STDZOK\nE - QUAD:LTUS:345:CALBOK\nF - QUAD:LTUS:345:BACTDRIFT (future)\nG -\nH- QUAD:LTUS:345:DACSTATUS\nI -QUAD:LTUS:345:ADCSTATUS\nJ - QUAD:LTUS:345:BACTSTATUS\nK - QUAD:LTUS:345:BDESSTATUS\nL - QUAD:LTUS:345:RIPLSTATUS\n\nOutput:\nP - QUAD:LTUS:345: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, "QUAD:LTUS:345: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, "QUAD:LTUS:345: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, "QUAD:LTUS:345: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, "QUAD:LTUS:345: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 b-field of a slave with out a powered trim coil # equal to the main desired current and pass backwards # through the IVB poly. record(sub, "QUAD:LTUS:345:IDES2BDES") { field(DESC, "Cal BDES") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "QUAD:LTUS:345:IDES2BDES") field(INPB, "QUAD:LTUS:345:POLYCOEF") field(INPC, "QUAD:LTUS:345:POLYCOEF.A") field(INPD, "QUAD:LTUS:345:POLYCOEF.B") field(INPE, "QUAD:LTUS:180:IDES CP MS") field(INPF, "QUAD:LTUS:180:BDELTAS PP") field(INPG, "100") field(EGU, "kG") field(HOPR, "-0.2404") field(LOPR, "-52.0232") field(HIHI, "-0.2404") field(LOLO, "-52.0232") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "-0.2404") field(LOW, "-52.0232") field(FLNK, "QUAD:LTUS:345:BDES") } # Calcuate the bcon of a slave using # the main desired current and pass backwards # through the IVB poly. # the trim b-field is acutally amps. record(sub, "QUAD:LTUS:345:ICON2BCON") { field(DESC, "Cal BCON") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "QUAD:LTUS:345:ICON2BCON") field(INPB, "QUAD:LTUS:345:POLYCOEF") field(INPC, "QUAD:LTUS:345:POLYCOEF.A") field(INPD, "QUAD:LTUS:345:POLYCOEF.B") field(INPE, "QUAD:LTUS:180:ICON CP NMS") field(INPF, "QUAD:LTUS:180:BDELTAS PP") field(INPG, "100") field(EGU, "kG") field(HOPR, "-0.2404") field(LOPR, "-52.0232") field(HIHI, "-0.2404") field(LOLO, "-52.0232") field(PREC, "7") field(BRSV, "INVALID") # Set MINOR alarms for main as the default, slaves will set NO_ALARM field(HHSV, "NO_ALARM") field(HSV, "NO_ALARM") field(LSV, "NO_ALARM") field(LLSV, "NO_ALARM") field(HIGH, "-0.2404") field(LOW, "-52.0232") field(FLNK, "QUAD:LTUS:345:BCON") }#! 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, "QUAD:LTUS:370:IACT") { field(DESC, "Current") field(INP, "QUAD:LTUS:235:IACT CP NMS") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "QUAD:LTUS:370:BACT") info(autosaveFields,"HYST") } record(bi, "QUAD:LTUS:370:STATE") { field(DESC, "PS On/Off Status") field(DTYP, "Raw Soft Channel") field(INP, "QUAD:LTUS:235:STATE CP MS") field(ZSV, "MAJOR") field(ZNAM, "OFF") field(ONAM, "ON") } record(ao, "QUAD:LTUS:370:IDES") { field(DESC, "Desired Current") field(PREC, "3") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(MDEL, "-1") field(HIHI, "165.0") field(LOLO, "0.0") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "QUAD:LTUS:370:BDELTAS") field(DRVH, "165.0") field(DRVL, "0.0") field(DOL, "QUAD:LTUS:370: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, "QUAD:LTUS:370:ICTRL PP") } # This record is processed by QUAD:LTUS:370:ICON") # Note: we are not setting alarms here. record(ao, "QUAD:LTUS:370:ICON") { field(DESC, "Config I") field(DTYP, "Soft Channel") field(PREC, "3") field(HOPR, "165.0") field(LOPR, "0.0") field(DRVH, "165.0") field(DRVL, "0.0") field(DOL, "QUAD:LTUS:370:B2ICON.K") field(OMSL, "closed_loop") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:370:INOM") { field(DESC, "Nominal Current") field(DOL, "QUAD:LTUS:370:BNOM.K") field(OMSL, "closed_loop") field(PREC, "3") field(EGU, "A") field(DRVH, "165.0") field(DRVL, "0.0") field(HOPR, "165.0") field(LOPR, "0.0") } record(ao, "QUAD:LTUS:370:ICTRL") { field(DESC, "Set Current") field(PREC, "3") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(DRVH, "165.0") field(DRVL, "0.0") field(MDEL, "-1") field(FLNK, "QUAD:LTUS:370:ICTRLGO") field(OMSL, "supervisory") info(autosavefields,"VAL") } record(seq, "QUAD:LTUS:370:ICTRLGO") { field(DESC, "Process Current Setpoint") field(PREC, "3") # Set ISETPT to supervisory field(DOL1, "0") field(LNK1, "QUAD:LTUS:370:ISETPT.OMSL") field(DOL2, "QUAD:LTUS:370:ICTRL") field(LNK2, "QUAD:LTUS:370:ISETPT PP") # Set ISETPT to closed loop - get data from BCTRLSUB.K field(DOL3, "1") field(LNK3, "QUAD:LTUS:370:ISETPT.OMSL") } record(ao, "QUAD:LTUS:370:IMAX") { field(DESC, "Max I") field(DTYP, "Soft Channel") field(DRVH, "165.0") field(DRVL, "0.0") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(PREC, "3") field(PINI, "YES") field(VAL, "165.0") field(FLNK, "QUAD:LTUS:370:IMIN") } record(ao, "QUAD:LTUS:370:IMIN") { field(DESC, "Min I") field(DTYP, "Soft Channel") field(DRVH, "165.0") field(DRVL, "0.0") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(PREC, "3") field(VAL, "0.0") field(FLNK, "QUAD:LTUS:370:IRANGE") } record(sel, "QUAD:LTUS:370:IACTPREVOK") { field(DESC, "Last Good Current") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(PREC, "3") field(NVL, "QUAD:LTUS:370:BACT.SEVR") field(INPA, "QUAD:LTUS:370:IACT NPP MS") field(INPB, "QUAD:LTUS:370:IACTPREVOK NPP MS") field(INPC, "QUAD:LTUS:370:IACTPREVOK NPP MS") field(INPD, "QUAD:LTUS:370:IACTPREVOK NPP MS") } record(sub, "QUAD:LTUS:370:IACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:370:IDES") field(INPB, "QUAD:LTUS:370:ISETPT.DRVH") field(INPC, "QUAD:LTUS:370:ISETPT.DRVL") field(INPD, "QUAD:LTUS:370:IDELTAS.I") field(INPE, "QUAD:LTUS:370:IDELTAS.J") field(INPG, "QUAD:LTUS:370:STATE") field(INPH, "QUAD:LTUS:370:HSTA") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(sub, "QUAD:LTUS:370:IMONLIMITS") { field(DESC, "Aux Current Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:370:IDES") field(INPB, "QUAD:LTUS:370:ISETPT.DRVH") field(INPC, "QUAD:LTUS:370:ISETPT.DRVL") field(INPD, "QUAD:LTUS:370:IDELTAS.K") field(INPE, "QUAD:LTUS:370:IDELTAS.L") field(INPG, "QUAD:LTUS:370:STATE") field(INPH, "QUAD:LTUS:370:HSTA") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(seq, "QUAD:LTUS:370:ILIMITS") { field(DESC, "Set ACT and MON Limits") field(PREC, "3") field(DOL1, "QUAD:LTUS:370:BLIMITS") field(LNK1, "QUAD:LTUS:370:IACTLIMITS.F PP") field(DOL2, "QUAD:LTUS:370:IACTLIMITS.I") field(LNK2, "QUAD:LTUS:370:IACT.HIGH") field(DOL3, "QUAD:LTUS:370:IACTLIMITS.J") field(LNK3, "QUAD:LTUS:370:IACT.LOW") field(DOL4, "QUAD:LTUS:370:IACTLIMITS.K") field(LNK4, "QUAD:LTUS:370:IACT.HIHI") field(DOL5, "QUAD:LTUS:370:IACTLIMITS.L") field(LNK5, "QUAD:LTUS:370:IACT.LOLO") field(DOL6, "QUAD:LTUS:370:BLIMITS") field(LNK6, "QUAD:LTUS:370:IMONLIMITS.F PP") field(DOL7, "QUAD:LTUS:370:IMONLIMITS.I") field(LNK7, "QUAD:LTUS:370:IMON.HIGH") field(DOL8, "QUAD:LTUS:370:IMONLIMITS.J") field(LNK8, "QUAD:LTUS:370:IMON.LOW") field(DOL9, "QUAD:LTUS:370:IMONLIMITS.K") field(LNK9, "QUAD:LTUS:370:IMON.HIHI") field(DOLA, "QUAD:LTUS:370:IMONLIMITS.L") field(LNKA, "QUAD:LTUS:370: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, "QUAD:LTUS:370:IDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntRawDeltas") field(INPD, "QUAD:LTUS:370:TRIMBTOL") field(INPE, "QUAD:LTUS:370:CHCKBTOL") field(INPF, "QUAD:LTUS:370:BDELTAS.K") field(INPG, "QUAD:LTUS:370:BDELTAS.L") field(INPH, "QUAD:LTUS:370: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, "QUAD:LTUS:370:STDZITOLR") field(INPC, "QUAD:LTUS:370:STDZITOL") field(FLNK, "") } # All ps controllers with on/off control will set the macro ONOF # as follows: # # ONOF = QUAD:LTUS:235: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, "QUAD:LTUS:370: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 = QUAD:LTUS:235:RESET PP # record(bo, "QUAD:LTUS:370: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, "QUAD:LTUS:370:RAMPSTATE") { field(DESC, "PS Ramp Status") field(DTYP, "Soft Channel") field(DOL, "QUAD:LTUS:235: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, "QUAD:LTUS:370: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, "QUAD:LTUS:370:TRIMRAMPRATE") field(OUT, "") field(FLNK, "QUAD:LTUS:370:STDZDLY") } record(ao, "QUAD:LTUS:370:ISETPT") { field(DESC, "Current Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(DRVH, "165.0") field(DRVL, "0.0") field(MDEL, "-1") field(OUT, "") field(DOL, "QUAD:LTUS:370: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, "QUAD:LTUS:370:IMON") { field(DESC, "Aux Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(INP, "QUAD:LTUS:235:IMON CP NMS") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "QUAD:LTUS:370:BMON") } record(ao, "QUAD:LTUS:370:IRIPL") { field(DESC, "Ripple Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(DOL, "QUAD:LTUS:235:IRIPL CP NMS") field(OMSL, "closed_loop") field(EGU, "A") field(DRVH, "1.0") field(HOPR, "1.0") field(PREC, "3") field(FLNK, "QUAD:LTUS:370:IRIPLOK") } record(sub, "QUAD:LTUS:370:IRIPLOK") { field(DESC, "Ripple Current Status") field(INAM, "mgntInit") field(SNAM, "mgntRiplOK") field(INPA, "QUAD:LTUS:370:IRIPL.VAL") field(INPB, "QUAD:LTUS:370: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, "QUAD:LTUS:370:R") { field(DESC, "Resistance") field(EGU, "Ohms") field(PREC, "4") field(PINI, "YES") field(DOL, "QUAD:LTUS:235: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, "QUAD:LTUS:370:IGND") { field(DESC, "Ground Current") field(EGU, "A") field(PREC, "6") field(PINI, "YES") field(DOL, "QUAD:LTUS:235:IGND CP MS") field(OMSL, "closed_loop") } record(bi, "QUAD:LTUS:370:INTLKSUMY") { field(DESC, "Interlock Summary") field(INP, "QUAD:LTUS:235:INTLKSUMY CP MS") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(ZNAM, "OK") field(ONAM, "FAULT") field(PINI, "NO") } record(mbbo, "QUAD:LTUS:370: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, "QUAD:LTUS:235:COOLING CP NMS") field(OMSL, "closed_loop") } # The following PV is processed by :BACTFO # which is processed by :BACT record(fanout, "QUAD:LTUS:370:IACTFO") { field(DESC, "IACT processing") field(SELM, "All") field(LNK1, "QUAD:LTUS:370:IACTPREVOK") field(LNK2, "QUAD:LTUS:370:IDIFF") field(LNK3, "QUAD:LTUS:370:IADIFF") field(LNK4, "QUAD:LTUS:370:IRATIO") field(LNK5, "QUAD:LTUS:370:IDIRECT") field(LNK6, "QUAD:LTUS:370:IACTPOL_CHECK") } record(calc, "QUAD:LTUS:370:IDIFF") { field(DESC, "IDES-IACT") field(CALC, "A-B") field(INPA, "QUAD:LTUS:370:IDES") field(INPB, "QUAD:LTUS:370:IACT") field(EGU, "A") field(PREC, "9") field(HOPR, "165.0") field(LOPR, "0.0") } record(calc, "QUAD:LTUS:370:IADIFF") { field(DESC, "Absolute IDES-IACT") field(CALC, "A<0?ABS(A):A") field(INPA, "QUAD:LTUS:370:IDIFF") field(PREC, "9") } record(calc, "QUAD:LTUS:370:IRATIO") { field(DESC, "IDES-IACT/IMAX") field(CALC, "B?A/B:0") field(INPA, "QUAD:LTUS:370:IDIFF") field(INPB, "QUAD:LTUS:370:IDES.DRVH") field(PREC, "9") } record(calcout, "QUAD:LTUS:370:IRANGE") { field(DESC, "Current Range") field(PINI, "YES") field(CALC, "ABS(A-B)") field(INPA, "QUAD:LTUS:370:IMIN") field(INPB, "QUAD:LTUS:370: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, "QUAD:LTUS:370: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, "QUAD:LTUS:370:IACT") field(FLNK, "QUAD:LTUS:370:IACTPOL") } record(bo, "QUAD:LTUS:370:IACTPOL") { field(DESC, "Actual I Polarity") field(DTYP, "Raw Soft Channel") field(DOL, "QUAD:LTUS:370: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,"QUAD:LTUS:370:I*LIMITS:\n Calculate alarm and warning limits based on \n deltas from QUAD:LTUS:370:IDELTAS and the\n QUAD:LTUS:370: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,"QUAD:LTUS:370:IACT: \n Get copy of QUAD:LTUS:370:I. \n",null) #! TextBox(TB12,1280,3100,1760,3200,0,"Dialog",12,1,16777215,"QUAD:LTUS:370: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,"QUAD:LTUS:370:IDES:\n Contains raw value calculated by \nQUAD:LTUS:370: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 \nQUAD:LTUS:370:BDELTAS.\n",null) #! TextBox(TB10,56,1940,316,2340,0,"Dialog",12,1,16777215,"QUAD:LTUS:370: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 QUAD:LTUS:370: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 QUAD:LTUS:370: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,"QUAD:LTUS:370:ISETPT:\n Sets the hardware. When fast feedback is set on, this record is\n set to closed loop mode by QUAD:LTUS:370:FBCKSTART sequence. When \n the loop is closed, this record takes input calculated by \n BFBCK only. When fast feedback is set off, QUAD:LTUS:370:FBCKSTOP \n will set it back to supervisory so that the value can be set by \n QUAD:LTUS:370: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, "QUAD:LTUS:370:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:370:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "QUAD:LTUS:370:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "QUAD:LTUS:370:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "QUAD:LTUS:370:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "QUAD:LTUS:370:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "1") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "QUAD:LTUS:370: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, "QUAD:LTUS:370:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "QUAD:LTUS:370:TRIMTYPE.RVAL") field(INPB, "QUAD:LTUS:370:CONFIG.RVAL") field(OUT, "QUAD:LTUS:370:TRIMMAXNUM PP") } record(longout, "QUAD:LTUS:370: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, "QUAD:LTUS:370: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, "QUAD:LTUS:235:TRIMRAMPRATE CP NMS") field(OMSL, "closed_loop") field(VAL, "") field(OUT, "QUAD:LTUS:370:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "QUAD:LTUS:370: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, "QUAD:LTUS:235:TRIMSETL CP NMS") field(OMSL, "closed_loop") field(VAL, "") } record(bo, "QUAD:LTUS:370: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, "QUAD:LTUS:370: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, "QUAD:LTUS:370: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, "0") } record(bo, "QUAD:LTUS:370:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "0") } record(ao, "QUAD:LTUS:370: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, "QUAD:LTUS:370:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "QUAD:LTUS:370: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, "QUAD:LTUS:370: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, "QUAD:LTUS:370:IMOVE") field(INPB, "QUAD:LTUS:370:IACT") field(INPC, "QUAD:LTUS:370:IRAMPRATE") field(INPD, "1.0") field(INPE, "QUAD:LTUS:370:TRIMDLYPCT") field(INPF, "QUAD:LTUS:370:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "QUAD:LTUS:370:RAMPTIME_LEFT PP") } record(longout, "QUAD:LTUS:370:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "QUAD:LTUS:370:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "QUAD:LTUS:370:RAMPDONE_CALC") } record(calc, "QUAD:LTUS:370:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "QUAD:LTUS:370:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "QUAD:LTUS:370:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "QUAD:LTUS:370: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, "QUAD:LTUS:370:RAMPTIME_LEFT") field(OUT, "QUAD:LTUS:370:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "QUAD:LTUS:370:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "QUAD:LTUS:370:RAMPTIME_LEFT NMS") field(OUT, "QUAD:LTUS:370:RAMPDONE PP") } record(bo, "QUAD:LTUS:370:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "QUAD:LTUS:370:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "QUAD:LTUS:370: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, "QUAD:LTUS:370: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, "QUAD:LTUS:370:STDZINIT") { field(DESC, "Proc. Stdz PVs on boot") field(PINI, "YES") field(DOL1, "1") field(DOL2, "1") field(DOL3, "1") field(LNK1, "QUAD:LTUS:370:DEBUG.PROC PP") field(LNK2, "QUAD:LTUS:370:STDZCYCLENUM.PROC PP") field(LNK3, "QUAD:LTUS:370:STDZDISABLE.PROC PP") field(LNK4, "QUAD:LTUS:370: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, "QUAD:LTUS:370:STDZSUB") { field(DESC, "Stdz subroutine") field(INAM, "mgntStdzInit") field(SNAM, "mgntStdz") field(BRSV, "INVALID") field(INPA, "QUAD:LTUS:370:STDZIMIN NPP NMS") field(INPB, "QUAD:LTUS:370:STDZIMAX NPP NMS") field(INPC, "QUAD:LTUS:370:STDZIFINAL NPP NMS") field(INPD, "QUAD:LTUS:370:STDZCYCLENUM NPP NMS") field(INPE, "QUAD:LTUS:370:STDZDIRECT.RVAL NPP NMS") field(INPF, "QUAD:LTUS:370:STDZDISABLE.RVAL CPP NMS") field(INPG, "QUAD:LTUS:370: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, "QUAD:LTUS:370:STDZWF PP") field(OUTB, "QUAD:LTUS:370: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, "QUAD:LTUS:370:STDZWF") } record(mbbo, "QUAD:LTUS:370: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, "QUAD:LTUS:370: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, "QUAD:LTUS:370:STDZMAINPS") { field(DESC, "Stdz by main or self") field(PINI, "YES") field(DTYP, "Soft Channel") field(ZNAM, "SELF") field(ONAM, "MAIN") } record(bo, "QUAD:LTUS:370: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, "QUAD:LTUS:370: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, "QUAD:LTUS:370: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, "QUAD:LTUS:370:STDZTOD") { field(DESC, "Successful Standardize Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "QUAD:LTUS:370:STDZLOSTTOD") { field(DESC, "Standardize Lost Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(longout, "QUAD:LTUS:370:STDZCYCLECNT") { field(DESC, "Cycle Count") field(PINI, "YES") } record(longout, "QUAD:LTUS:370: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, "QUAD:LTUS:370:STDZDIRECT") } # The default standardize direction is "UP" for # all LCLS Magnets.. record(bo, "QUAD:LTUS:370:STDZDIRECT") { field(DESC, "Standardize Direction ") field(ZNAM, "UP") field(ONAM, "DOWN") field(VAL, "0") field(FLNK, "QUAD:LTUS:370:STDZIMIN") } record(ao, "QUAD:LTUS:370:STDZIMIN") { field(DESC, "Min-STDZ Current") field(PREC, "1") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(VAL, "0.0") field(FLNK, "QUAD:LTUS:370:STDZIMAX") } record(ao, "QUAD:LTUS:370:STDZIMAX") { field(DESC, "Max. Standarize Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(VAL, "165.0") field(FLNK, "QUAD:LTUS:370:STDZIFINAL") } record(ao, "QUAD:LTUS:370:STDZIFINAL") { field(DESC, "Final SDTZ Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(VAL, "0.0") field(FLNK, "QUAD:LTUS:370: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, "QUAD:LTUS:370: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, "QUAD:LTUS:370:STDZITOL") { field(DESC, "Stdz min tolerance") field(PREC, "5") field(CALC, "MAX(ABS(A),ABS(B))*C") field(INPA, "QUAD:LTUS:370:STDZIMIN CP NMS") field(INPB, "QUAD:LTUS:370:STDZIMAX CP MMS") field(INPC, "0.05") field(INPD, "QUAD:LTUS:370:STDZITOLR CP MMS") field(EGU, "A") field(FLNK, "QUAD:LTUS:370:IDELTAS") field(PINI, "YES") } # D - factor (3.154/2 = 1.577) for EPSC, otherwise, set to 1.0 record(calc, "QUAD:LTUS:370:STDZDLY") { field(DESC, "Ramp time for stdz cycle") field(CALC, "C>0?MAX(1,ABS((A-B)/C)*D):0") field(INPA, "QUAD:LTUS:370:STDZIMIN CP NMS") field(INPB, "QUAD:LTUS:370:STDZIMAX CP NMS") field(INPC, "QUAD:LTUS:370:TRIMRAMPRATE CP NMS") field(INPD, "1.0") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") } record(calc, "QUAD:LTUS:370:STDZRAMPDLY") { field(DESC, "Ramp delay total") field(CALC, "MAX(1,((A/100)*B+B))") field(PREC, "5") field(INPA, "QUAD:LTUS:370:TRIMDLYPCT CP MS") field(INPB, "QUAD:LTUS:370: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, "QUAD:LTUS:370:STDZMINIDLY") { field(DESC, "Mini-stdz delay") field(CALC, "A") field(PREC, "5") field(A, "1.0") field(EGU, "sec") field(PINI, "YES") } record(ao, "QUAD:LTUS:370: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, "QUAD:LTUS:370:STDZMINIDELTA") { field(DESC, "Stdz mini % of IMAX") field(CALC, "(B/100)*(A-C)") field(INPA, "QUAD:LTUS:370:IDES.HOPR") field(INPB, "QUAD:LTUS:370:STDZMINIPCT CPP NMS") field(INPC, "QUAD:LTUS:370:IDES.LOPR") field(PREC, "5") } record(calc, "QUAD:LTUS:370:STDZMINISETPT") { field(DESC, "Mini Stdz delta") field(CALC, "C==0?MAX(E-D,B):MIN(E+D,A)") field(INPA, "QUAD:LTUS:370:IDES.HOPR") field(INPB, "QUAD:LTUS:370:IDES.LOPR") field(INPC, "QUAD:LTUS:370:STDZDIRECT.RVAL") field(INPD, "QUAD:LTUS:370:STDZMINIDELTA") field(INPE, "QUAD:LTUS:370:IDES") field(PREC, "5") field(FLNK, "QUAD:LTUS:370: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, "QUAD:LTUS:370:STDZMINISETPTOOR") { field(DESC, "Mini Stdz setpoint out of range") field(CALC, "C==0?(E-DA)") field(INPA, "QUAD:LTUS:370:IDES.HOPR") field(INPB, "QUAD:LTUS:370:IDES.LOPR") field(INPC, "QUAD:LTUS:370:STDZDIRECT.RVAL") field(INPD, "QUAD:LTUS:370:STDZMINIDELTA") field(INPE, "QUAD:LTUS:370: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, "QUAD:LTUS:370: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, "QUAD:LTUS:370:IADJUST.RVAL") field(INPB, "QUAD:LTUS:370:STDZDIRECT.RVAL") field(INPC, "QUAD:LTUS:370:STDZOK.RVAL") field(INPD, "QUAD:LTUS:370:STDZDISABLE.RVAL") field(INPE, "QUAD:LTUS:370:STATE.RVAL CPP NMS") field(INPF, "QUAD:LTUS:370:ICTRL.RVAL") field(INPG, "QUAD:LTUS:370:STATE.SEVR") field(INPH, "QUAD:LTUS:370:BDELTAS.M") field(INPI, "QUAD:LTUS:370:IACT.SEVR") field(OUT, "QUAD:LTUS:370:STDZLOSTGO.SELN PP NMS") field(OOPT, "Transition To Non-zero") } record(seq, "QUAD:LTUS:370:STDZLOSTGO") { field(DESC, "Process lost stdz") field(SELM, "Mask") field(DOL1, "1") field(DOL2, "0") field(LNK1, "QUAD:LTUS:370:STDZLOSTTOD.PROC") field(LNK2, "QUAD:LTUS:370:STDZOK PP") } # Record maximum current after standardize # Reset to IACT from sequence after trim # Disable processing during (mini-)standardize or trim record(calc, "QUAD:LTUS:370:STDZIACTMAX") { field(DESC, "Max act current after stdz") field(CALC, "MAX(A, B)") field(DISV, "0") field(SDIS, "QUAD:LTUS:370:CHECKPWRDIP_ENABLE") field(INPA, "QUAD:LTUS:370:IACT CP") field(INPB, "QUAD:LTUS:370:STDZIACTMAX") field(EGU, "A") field(FLNK, "QUAD:LTUS:370:CHECKPWRDIP") } # Detect power dip if STDZOK is YES, STDZ is enabled, and IACT is valid # If IACT drops below STDZIACTMAX by more than the trim tolerance, clear STDZOK # Warning: Take the absolute value of the trim tolerance, or else quads of # negative polarity will always lose STDZ since their IDELTAS.I are negative. # Note: Large quads and bends are prone to losing STDZ even if they are # perturbed toward higher current since their current tends to overshoot # by greater than the trim tolerance before settling down. record(calcout, "QUAD:LTUS:370:CHECKPWRDIP") { field(DESC, "Detect power dip") field(CALC, "(A-B>ABS(C))?3:0") field(DISV, "0") field(SDIS, "QUAD:LTUS:370:CHECKPWRDIP_ENABLE") field(INPA, "QUAD:LTUS:370:STDZIACTMAX") field(INPB, "QUAD:LTUS:370:IACT") field(INPC, "QUAD:LTUS:370:IDELTAS.I") field(OUT, "QUAD:LTUS:370:STDZLOSTGO.SELN PP NMS") field(OOPT, "When Non-zero") } # Enable processing of STDZIACTMAX and CHECKPWRDIP only if # STDZOK = YES, STDZDISABLE = NO, CTRL != Trim (2), and # CTRL != Stdz (4) record(calc, "QUAD:LTUS:370:CHECKPWRDIP_ENABLE") { field(CALC, "A&&!B&&(C#2)&&(C#4)") field(INPA, "QUAD:LTUS:370:STDZOK.RVAL CP") field(INPB, "QUAD:LTUS:370:STDZDISABLE.RVAL CP") field(INPC, "QUAD:LTUS:370:CTRL.RVAL CP") } #! 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, "QUAD:LTUS:370: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, "QUAD:LTUS:370: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, "QUAD:LTUS:370:CALBSET") { field(DESC, "Use DAC Calbration") field(SCAN, "10 second") field(CALC, "A&&(B==0)&&C?31:960") field(INPA, "QUAD:LTUS:370:CALBOK") field(INPB, "QUAD:LTUS:370:CALBDISABLE") field(INPC, "QUAD:LTUS:370:CALBSLOPE") field(OOPT, "On Change") field(OUT, "QUAD:LTUS:370: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, "QUAD:LTUS:370:CALB_SEQ") { field(DESC, "Output Calib Values") field(SELM, "Mask") field(SELL, "QUAD:LTUS:370: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, "QUAD:LTUS:370:CALBSLOPE") field(DOL3, "QUAD:LTUS:370: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, "QUAD:LTUS:370:CALBTOD") { field(DESC, "Calibration Success Time") field(PINI, "YES") # field(DOL, "") field(OMSL, "supervisory") field(DTYP, "Soft Channel") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:370: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, "QUAD:LTUS:370: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, "QUAD:LTUS:370: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, "QUAD:LTUS:370:CALBOFFSET") { field(DESC, "Calc DAC Offset") field(PREC, "6") field(EGU, "Counts") field(PINI, "YES") } record(bo, "QUAD:LTUS:370: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, "QUAD:LTUS:370:DACSLOPE") { field(DESC, "V to DAC slope") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "supervisory") field(PINI, "YES") field(FLNK, "QUAD:LTUS:370:DACOFFSET") } # Default Offset used in conversion from Volts to DAC Counts record(ao, "QUAD:LTUS:370:DACOFFSET") { field(DESC, "V to DAC offset") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "supervisory") field(PINI, "YES") field(FLNK, "QUAD:LTUS:370: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, "QUAD:LTUS:370: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, "QUAD:LTUS:370:IACT") field(INPD, "QUAD:LTUS:370:DACSLOPE") field(INPE, "QUAD:LTUS:370:DACOFFSET") field(EGU, "Counts") field(PREC, "6") } record(ao, "QUAD:LTUS:370:DAC") { field(DESC, "DAC Set point") field(EGU, "Counts") field(DOL, "") field(OMSL, "supervisory") field(PREC, "6") field(PINI, "YES") } record(ao, "QUAD:LTUS:370:CALBIMIN") { field(DESC, "Calibration Min Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(DRVH, "165.0") field(HOPR, "165.0") field(DRVL, "0.0") field(LOPR, "0.0") field(PREC, "3") field(EGU, "A") field(VAL, "0.0") field(FLNK, "QUAD:LTUS:370:CALBIMAX") } record(ao, "QUAD:LTUS:370:CALBIMAX") { field(DESC, "Calibration Max Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(DRVH, "165.0") field(HOPR, "165.0") field(LOPR, "0.0") field(DRVL, "0.0") field(EGU, "A") field(VAL, "165.0") field(FLNK, "QUAD:LTUS:370:CALBSTEPNUM") } record(ao, "QUAD:LTUS:370:CALBIFINAL") { field(DESC, "Calibration Last Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(PREC, "3") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(VAL, "0") } record(longout, "QUAD:LTUS:370: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, "QUAD:LTUS:370:CALBIDELTA") } record(calc, "QUAD:LTUS:370:CALBIDELTA") { field(DESC, "Step size for CALB") field(CALC, "C=0?0:ABS((A-B)/C)") field(INPA, "QUAD:LTUS:370:CALBIMAX") field(INPB, "QUAD:LTUS:370:CALBIMIN") field(INPC, "QUAD:LTUS:370: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, "QUAD:LTUS:370:CALBIMULT") { field(DESC, "IACT vs ISETPT mult") field(CALC, "C#0||A=0?1:ABS(B/A)") field(INPA, "QUAD:LTUS:235:ISETPT.DRVH") field(INPB, "QUAD:LTUS:235:IACT.HOPR") field(INPC, "QUAD:LTUS:370:PSCONTROLLER.RVAL CPP") field(EGU, "A") field(PINI, "YES") } # SNL dbputs DAC values here. 6-10 steps are possible. record(waveform, "QUAD:LTUS:370:CALBICTRLWF") { field(DESC, "ICTRL setpoint array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") } record(waveform, "QUAD:LTUS:370:DACWF") { field(DESC, "DAC count array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:370:DACSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:370:DACSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "QUAD:LTUS:370: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, "QUAD:LTUS:370:CALCDACWF") { field(DESC, "Calc DAC counts array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:370:CALCDACSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:370:CALCDACSA") { field(DESC, "Calc DAC counts") field(DTYP, "Soft Channel") field(INP, "QUAD:LTUS:370: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, "QUAD:LTUS:370:CALBYWF") { field(DESC, "mx + b") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:370:CALBYSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:370:CALBYSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "QUAD:LTUS:370:CALBYWF") field(MALM, "10") field(NELM, "6") field(INDX, "0") field(FTVL, "DOUBLE") } record(waveform, "QUAD:LTUS:370:CALBIACTWF") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:370:CALBIACTSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:370:CALBIACTSA") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(MALM, "10") field(NELM, "6") field(INP, "QUAD:LTUS:370:CALBIACTWF") field(INDX, "0") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:370:CALBLIMITS") } # Check that measured current during calibration is within # tolerance. record(aSub, "QUAD:LTUS:370: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, "QUAD:LTUS:370:CALBSTEPNUM") field(INPB, "QUAD:LTUS:370:CALBIACTWF") field(INPC, "QUAD:LTUS:370: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, "QUAD:LTUS:370: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, "QUAD:LTUS:370:STDZITOL") field(INPH, "QUAD:LTUS:370:DACSLOPE") field(INPI, "QUAD:LTUS:370: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, "QUAD:LTUS:370: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, "QUAD:LTUS:370:CALBSTEPNUM") field(INPB, "QUAD:LTUS:370:CALBIACTWF") field(INPC, "QUAD:LTUS:370:DACWF") field(INPF, "QUAD:LTUS:370: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 QUAD:LTUS:370CALBOK 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, "QUAD:LTUS:370:DEGAUSINIT") { field(DESC, "Proc. Degauss PVs on boot") field(PINI, "YES") field(DOL, "1") field(OUTA, "QUAD:LTUS:370:DEGAUSIMIN.PROC PP") field(OUTB, "QUAD:LTUS:370:DEGAUSIMAX.PROC PP") field(OUTC, "QUAD:LTUS:370:DEGAUSTYPE.PROC PP") field(OUTD, "QUAD:LTUS:370:DEGAUSSTEP.PROC PP") field(OUTE, "QUAD:LTUS:370:MADNAME.PROC PP") field(OUTF, "QUAD:LTUS:370:PSTYPE.PROC PP") field(OUTG, "QUAD:LTUS:370: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, "QUAD:LTUS:370:DEGAUSSUB") { field(DESC, "Degauss subroutine") field(INAM, "mgntDegaussInit") field(SNAM, "mgntDegauss") field(BRSV, "INVALID") field(INPA, "QUAD:LTUS:370:DEGAUSIMIN NPP NMS") field(INPB, "QUAD:LTUS:370:DEGAUSIMAX NPP NMS") field(INPC, "QUAD:LTUS:370:DEGAUSTYPE.RVAL NPP NMS") field(INPE, "QUAD:LTUS:370:DEGAUSMETHOD.RVAL NPP NMS") field(INPF, "QUAD:LTUS:370:PSTYPE NPP NMS") field(INPG, "QUAD:LTUS:370:DEBUG.RVAL NPP NMS") field(INPH, "QUAD:LTUS:370: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, "QUAD:LTUS:370:DEGAUSWF PP") field(OUTB, "QUAD:LTUS:370:DEGAUSMSG PP") field(OUTC, "QUAD:LTUS:370: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, "QUAD:LTUS:370:DEGAUSWF") { field(DESC, "Degauss Setpts") field(NELM, "60") field(FTVL, "DOUBLE") } record(mbbo,"QUAD:LTUS:370: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, "QUAD:LTUS:370: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, "QUAD:LTUS:370: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, "QUAD:LTUS:370: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, "QUAD:LTUS:370: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, "QUAD:LTUS:370:DEGAUSIMIN") { field(DESC, "Min. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "165.0") field(LOPR, "-165.0") field(DRVH, "165.0") field(DRVL, "-165.0") field(VAL, "-165.0") } record(ao, "QUAD:LTUS:370:DEGAUSIMAX") { field(DESC, "Max. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "165.0") field(LOPR, "-165.0") field(DRVH, "165.0") field(DRVL, "-165.0") field(VAL, "165.0") } # 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,"QUAD:LTUS:370: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, "QUAD:LTUS:370: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,"QUAD:LTUS:370: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, "QUAD:LTUS:370: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, "QUAD:LTUS:370: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, "QUAD:LTUS:370: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, "QUAD:LTUS:370:DEGAUSTOD") { field(DESC, "Successful Degauss Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "QUAD:LTUS:370:DEGAUSLOSTTOD") { field(DESC, "Degauss Lost Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:370:DEGAUSTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "QUAD:LTUS:370:DEGAUSTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "QUAD:LTUS:370: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, "QUAD:LTUS:370:DEGAUSGO") { field(DESC, "Set bdes of btrms to zero") field(ASG, "Internal") field(OUTA, "") field(OUTB, "") field(OUTC, "") field(OUTD, "") } # =========== CRYO ONLY =========== record(bo, "QUAD:LTUS:370: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, "QUAD:LTUS:370:DEGAUS_IMAX_CHECK") { field(DESC, "Check if imax shoud chg") field(CALC, "(C==4)&&(ABS(B)>ABS(A))?1:0") field(INPA, "QUAD:LTUS:370:DEGAUS_IMAX") field(INPB, "QUAD:LTUS:370:ISETPT") field(INPC, "QUAD:LTUS:370:DEGAUSTYPE.RVAL") field(OUT, "QUAD:LTUS:370:DEGAUS_IMAX_UPDATE.SELN") field(FLNK, "QUAD:LTUS:370:DEGAUS_IMAX_UPDATE") } record(seq, "QUAD:LTUS:370:DEGAUS_IMAX_UPDATE") { field(DESC, "Degauss IMAX Update") field(SELM, "Specified") field(DOL1, "QUAD:LTUS:370:ISETPT") field(LNK1, "QUAD:LTUS:370:DEGAUS_IMAX PP") } # Set the maximum current after a successful # degauss. This pv is updated by the # sequence. record(ao, "QUAD:LTUS:370:DEGAUS_IMAX") { field(DESC, "Max I set afer a degauss") field(EGU, "Amps") field(PINI, "YES") field(PREC, "6") field(HOPR, "165.0") field(LOPR, "-165.0") field(DRVH, "165.0") field(DRVL, "-165.0") field(VAL, "165.0") field(FLNK, "QUAD:LTUS:370:DEGAUS_IMAXPOL_CHECK") info(autosaveFields,"VAL,RVAL") } # Set the polarity if degauss_imax record(calcout, "QUAD:LTUS:370:DEGAUS_IMAXPOL_CHECK") { field(DESC, "Determine polarity of imax") field(CALC, "A>=0?0:1") field(INPA, "QUAD:LTUS:370:DEGAUS_IMAX") field(FLNK, "QUAD:LTUS:370:DEGAUS_IMAXPOL") } record(bo, "QUAD:LTUS:370:DEGAUS_IMAXPOL") { field(DESC, "Polarity of imax I") field(DTYP, "Raw Soft Channel") field(DOL, "QUAD:LTUS:370:DEGAUS_IMAXPOL_CHECK") field(OMSL, "closed_loop") field(ZNAM, "Positive") field(ONAM, "Negative") field(FLNK, "QUAD:LTUS:370: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, "QUAD:LTUS:370:DEGAUS_ABSIMAX") { field(DESC, "Absolute Max. Degauss I") field(CALC, "ABS(A)") field(INPA, "QUAD:LTUS:370:DEGAUS_IMAX") field(PREC, "6") field(EGU, "Amps") field(HOPR, "165.0") field(LOPR, "-165.0") info(autosaveFields,"VAL RVAL") } # IACT Polarity record(calcout, "QUAD:LTUS:370:IACTPOL_CHECK") { field(DESC, "Determine IACT polarity") field(SCAN, "5 second") field(CALC, "ABS(A-B)>C?(A>=0?0:1):D") field(INPA, "QUAD:LTUS:370:IACT") field(INPB, "QUAD:LTUS:370:IACTPOL_CHECK.LA") field(INPC, "0.0001") field(INPD, "QUAD:LTUS:370:IACTPOL_CHECK.PVAL") field(OOPT, "On Change") field(FLNK, "QUAD:LTUS:370:IACTPOL") } record(bo, "QUAD:LTUS:370: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,"QUAD:LTUS:370: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, "QUAD:LTUS:370:DEGAUSENABLE CP") field(INPB, "QUAD:LTUS:370:DEGAUSOK") field(INPC, "QUAD:LTUS:370:STATE CP") field(INPD, "QUAD:LTUS:370:STATE.SEVR") field(OUT, "QUAD:LTUS:370:DEGAUS_STATE_SEQ.SELN PP") field(ASG, "Internal") } record(seq, "QUAD:LTUS:370:DEGAUS_STATE_SEQ") { field(DESC, "Degauss State Sequence") field(SELM, "Specified") field(SELL, "QUAD:LTUS:370:DEGAUS_STATE_CHECK") field(LNK1, "QUAD:LTUS:370:DEGAUS_STATE_DISABLE.PROC PP") field(LNK2, "QUAD:LTUS:370:DEGAUS_STATE_LOST.PROC PP") field(LNK3, "QUAD:LTUS:370:DEGAUS_STATE_GOOD.PROC PP") field(LNK4, "QUAD:LTUS:370: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, "QUAD:LTUS:370:DEGAUS_STATE_DISABLE") { field(DESC, "Degauss not used") field(LNK1, "QUAD:LTUS:370:DEGAUSOK.ZSV") field(LNK2, "QUAD:LTUS:370: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, "QUAD:LTUS:370:STATMSG.FRSV") field(LNK4, "QUAD:LTUS:370: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, "QUAD:LTUS:370:DEGAUS_STATE_LOST") { field(DESC, "Degauss lost and ps On") field(DOL1, "1") field(LNK1, "QUAD:LTUS:370:DEGAUSOK.ZSV") field(LNK2, "QUAD:LTUS:370: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, "QUAD:LTUS:370:STATMSG.FRSV") field(LNK4, "QUAD:LTUS:370: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, "QUAD:LTUS:370:DEGAUS_STATE_OFF") { field(DESC, "Degaused lost and ps Off") field(DOL1, "2") field(LNK1, "QUAD:LTUS:370: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, "QUAD:LTUS:370:STATMSG.FRSV") field(LNK3, "QUAD:LTUS:370: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, "QUAD:LTUS:370:DEGAUS_STATE_GOOD") { field(DESC, "Degauss good") field(DOL1, "1") field(LNK1, "QUAD:LTUS:370: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, "QUAD:LTUS:370:STATMSG.FRSV PP") field(LNK3, "QUAD:LTUS:370:STATMSG.FVSV PP") field(LNK4, "") field(ASG, "Internal") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(mbbo, "QUAD:LTUS:370:FUNC") { field(DESC, "QUAD:LTUS:370 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, "0") field(FFVL, "0") field(OUT, "QUAD:LTUS:370:CTRL CA") } # :CTRL pv is processed at boot in the # sequence mgntCtrl.st Processed in sequence # record(mbbo, "QUAD:LTUS:370:CTRL") { field(DESC, "QUAD:LTUS:370 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, "QUAD:LTUS:370:SELECTEN.A PP") field(SDIS, "0") } # If a function has been selected set this unit to busy record(calcout, "QUAD:LTUS:370:SELECTEN") { field(DESC, "Control Select Enable") field(CALC, "A>0?1:A") field(FLNK, "QUAD:LTUS:370:BUSY") } # Set to FREE on IOC reboot record(bo, "QUAD:LTUS:370:BUSY") { field(DESC, "QUAD:LTUS:370 Ctrl Done") field(DOL, "QUAD:LTUS:370:SELECTEN") field(ZNAM, "FREE") field(ONAM, "BUSY") field(PINI, "YES") field(FLNK, "QUAD:LTUS:370:SELECT") } record(bo, "QUAD:LTUS:370:SELECT") { field(ZNAM, "NO") field(ONAM, "YES") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") } record(bo, "QUAD:LTUS:370: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, "QUAD:LTUS:370:CTRLSTATE") { field(DESC, "QUAD:LTUS:370 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("QUAD:LTUS:370:CTRL",20,20,0,0,"QUAD:LTUS:370:CTRL") #! Field("QUAD:LTUS:370:CTRL.OUT",16777215,1,"QUAD:LTUS:370:CTRL.OUT") #! Link("QUAD:LTUS:370:CTRL.OUT","QUAD:LTUS:370:SELECTEN.A") #! Field("QUAD:LTUS:370:CTRL.VAL",16777215,1,"QUAD:LTUS:370:CTRL.VAL") #! Record("QUAD:LTUS:370:SELECTEN",321,381,0,0,"QUAD:LTUS:370:SELECTEN") #! Field("QUAD:LTUS:370:SELECTEN.A",16777215,0,"QUAD:LTUS:370:SELECTEN.A") #! Field("QUAD:LTUS:370:SELECTEN.FLNK",16777215,1,"QUAD:LTUS:370:SELECTEN.FLNK") #! Link("QUAD:LTUS:370:SELECTEN.FLNK","QUAD:LTUS:370:BUSY") #! Field("QUAD:LTUS:370:SELECTEN.VAL",16777215,1,"QUAD:LTUS:370:SELECTEN.VAL") #! Record("QUAD:LTUS:370:BUSY",623,274,0,0,"QUAD:LTUS:370:BUSY") #! Field("QUAD:LTUS:370:BUSY.DOL",16777215,0,"QUAD:LTUS:370:BUSY.DOL") #! Link("QUAD:LTUS:370:BUSY.DOL","QUAD:LTUS:370:SELECTEN.VAL") #! Field("QUAD:LTUS:370:BUSY.FLNK",16777215,1,"QUAD:LTUS:370:BUSY.FLNK") #! Link("QUAD:LTUS:370:BUSY.FLNK","QUAD:LTUS:370:SELECT") #! Record("QUAD:LTUS:370:SELECT",669,508,0,1,"QUAD:LTUS:370:SELECT") #! Record("QUAD:LTUS:370:FUNC",940,120,0,0,"QUAD:LTUS:370:FUNC") #! Field("QUAD:LTUS:370:FUNC.OUT",16777215,0,"QUAD:LTUS:370:FUNC.OUT") #! Link("QUAD:LTUS:370:FUNC.OUT","QUAD:LTUS:370:CTRL.VAL") #! Record("QUAD:LTUS:370:ABORT",193,41,0,0,"QUAD:LTUS:370:ABORT") #! Record("QUAD:LTUS:370:CTRLSTATE",369,34,0,0,"QUAD:LTUS:370: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,"QUAD:LTUS:370:SELECT is used for Multi-device selection.\nIt is enabled when associated QUAD:LTUS:370:CTRL is \"0\" (DONE).\nIt is disabled when associated QUAD:LTUS:370: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,"QUAD:LTUS:370: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, "QUAD:LTUS:370:BCTRL_INIT") { field(DESC, "Process BCTRL on boot") field(PINI, "YES") field(CALC, "A=3?1:0") field(INPA, "QUAD:LTUS:370:BCTRL.SEVR") field(OUT, "QUAD:LTUS:370: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, "QUAD:LTUS:370:BACT") { field(DESC, "Actual B") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "QUAD:LTUS:370:BACT") field(INPB, "QUAD:LTUS:370:POLYCOEF") field(INPC, "QUAD:LTUS:370:POLYCOEF.A") field(INPD, "QUAD:LTUS:370:POLYCOEF.B") field(INPE, "QUAD:LTUS:370:IACT MS") field(INPF, "QUAD:LTUS:370:BDELTAS PP") field(INPG, "100") field(EGU, "kG") field(HOPR, "51.7380") field(LOPR, "0.2525") field(HIHI, "51.7380") field(LOLO, "0.2525") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "51.7380") field(LOW, "0.2525") field(FLNK, "QUAD:LTUS:370: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, "QUAD:LTUS:370:BDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntPhyDeltas") field(EGU, "kG") field(HOPR, "1") field(PREC, "7") field(BRSV, "INVALID") field(INPA, "QUAD:LTUS:370:BDES") field(INPB, "QUAD:LTUS:370:TRIMBTOL") field(INPC, "QUAD:LTUS:370:TRIMBTOLR") field(INPD, "QUAD:LTUS:370:CHCKBTOL") field(INPE, "QUAD:LTUS:370:CHCKBTOLR") field(F, "2.0") field(INPG, "30") field(INPH, "QUAD:LTUS:370:BACT.VAL") # # MPS absolute and relative tolerances field(INPP, "QUAD:LTUS:370:MPSBTOL") field(INPQ, "QUAD:LTUS:370:MPSBTOLR") field(FLNK, "QUAD:LTUS:370:BCONLIMITS") info(autosaveFields,"F") } # This record is processed by BDELTAS record(aSub, "QUAD:LTUS:370:BCONLIMITS") { field(DESC, "Config B-field Limits") field(INAM, "mgntInit") field(SNAM, "mgntBCONLimits") field(INPA, "QUAD:LTUS:370:BDES") field(INPB, "QUAD:LTUS:370:BDELTAS.I") field(INPG, "QUAD:LTUS:370:DEBUG.RVAL") field(FTA, "DOUBLE") field(FTB, "DOUBLE") field(FTG, "ULONG") field(OUTA, "QUAD:LTUS:370:BCON.HIGH") field(OUTB, "QUAD:LTUS:370:BCON.LOW") field(OUTC, "QUAD:LTUS:370:BCON.HIHI") field(OUTD, "QUAD:LTUS:370:BCON.LOLO PP") field(FTVA, "DOUBLE") field(FTVB, "DOUBLE") field(FTVC, "DOUBLE") field(FTVD, "DOUBLE") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:370:IDELTAS") } # The following PV is processed by :BACT # which is processed by :BACT # record(fanout, "QUAD:LTUS:370:BACTFO") { field(DESC, "BACT processing") field(SELM, "All") field(LNK1, "QUAD:LTUS:370:BDIFF") field(LNK2, "QUAD:LTUS:370:BADIFF") field(LNK3, "QUAD:LTUS:370:BRATIO") field(LNK4, "QUAD:LTUS:370:MPSLIMITS") field(LNK5, "QUAD:LTUS:370:I2BSTATUS") field(LNK6, "QUAD:LTUS:370:IACTFO.PROC") } record(calc, "QUAD:LTUS:370:BDIFF") { field(DESC, "BDES-BACT") field(CALC, "A-B") field(INPA, "QUAD:LTUS:370:BDES") field(INPB, "QUAD:LTUS:370:BACT") field(EGU, "kG") field(PREC, "7") } record(calc, "QUAD:LTUS:370:BADIFF") { field(DESC, "Absolute BDES-BACT") field(INPA, "QUAD:LTUS:370:BDIFF") field(EGU, "kG") field(PREC, "7") field(CALC, "A<0?ABS(A):A") } record(calc, "QUAD:LTUS:370:BRATIO") { field(DESC, "BACT Error") field(CALC, "B?A/B:0") field(INPA, "QUAD:LTUS:370:BDIFF") field(INPB, "QUAD:LTUS:370:BDES.HOPR") field(EGU, "kG") field(PREC, "7") } record(mbbi, "QUAD:LTUS:370: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, "QUAD:LTUS:370:BACT.J") } # Note: for a string slave set the MONFL # macro to the following: # MONFL=:IMONCALC MS record(sub, "QUAD:LTUS:370:BMON") { field(DESC, "Second Transductor") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "QUAD:LTUS:370:BMON") field(INPB, "QUAD:LTUS:370:POLYCOEF") field(INPC, "QUAD:LTUS:370:POLYCOEF.A") field(INPD, "QUAD:LTUS:370:POLYCOEF.B") field(INPE, "QUAD:LTUS:370:IMON MS") field(INPF, "QUAD:LTUS:370:BDELTAS.VAL") field(INPG, "100") field(EGU, "kG") field(HOPR, "51.7380") field(LOPR, "0.2525") field(HIHI, "51.7380") field(LOLO, "0.2525") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "51.7380") field(LOW, "0.2525") } # 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=QUAD:LTUS:235:BDES CP record(ao, "QUAD:LTUS:370:BDES") { field(DESC, "Desired B-Field") field(PINI, "NO") field(DRVH, "51.7380") field(DRVL, "0.2525") field(HOPR, "51.7380") field(LOPR, "0.2525") field(PREC, "7") field(EGU, "kG") field(MDEL, "-1") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:370:IDES2BDES") field(OUT, "QUAD:LTUS:370:B2IDES PP") info(autosaveFields,"VAL") } record(sub, "QUAD:LTUS:370:B2IDES") { field(DESC, "Convert Desired B-Field to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:370:POLYCOEF") field(INPC, "QUAD:LTUS:370:POLYCOEF.A") field(INPD, "QUAD:LTUS:370:POLYCOEF.B") field(PREC, "7") field(EGU, "kG") field(HOPR, "51.7380") field(LOPR, "0.2525") field(MDEL, "-1") field(INPE, "QUAD:LTUS:370:BDES.DRVH") field(INPF, "QUAD:LTUS:370:BDES.DRVL") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:370:IDES") } record(sub, "QUAD:LTUS:370:BNOM") { field(DESC, "Nominal Field") field(PINI, "YES") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:370:POLYCOEF") field(INPC, "QUAD:LTUS:370:POLYCOEF.A") field(INPD, "QUAD:LTUS:370:POLYCOEF.B") field(INPE, "QUAD:LTUS:370:BDES.DRVH") field(INPF, "QUAD:LTUS:370:BDES.DRVL") field(EGU, "kG") field(HOPR, "51.7380") field(LOPR, "0.2525") field(PREC, "7") field(VAL, "0.0") field(FLNK, "QUAD:LTUS:370:INOM") } record(sub, "QUAD:LTUS:370:BACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:370:BDES.VAL") field(INPB, "QUAD:LTUS:370:BDES.DRVH") field(INPC, "QUAD:LTUS:370:BDES.DRVL") field(INPD, "QUAD:LTUS:370:BDELTAS.I") field(INPE, "QUAD:LTUS:370:BDELTAS.J") field(INPG, "QUAD:LTUS:370:STATE") field(INPH, "QUAD:LTUS:370:HSTA") field(EGU, "kG") field(HOPR, "51.7380") field(LOPR, "0.2525") field(PREC, "7") field(BRSV, "INVALID") } record(sub, "QUAD:LTUS:370:BMONLIMITS") { field(DESC, "MON Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:370:BDES.VAL") field(INPB, "QUAD:LTUS:370:BDES.DRVH") field(INPC, "QUAD:LTUS:370:BDES.DRVL") field(INPD, "QUAD:LTUS:370:BDELTAS.K") field(INPE, "QUAD:LTUS:370:BDELTAS.L") field(INPG, "QUAD:LTUS:370:STATE") field(INPH, "QUAD:LTUS:370:HSTA") field(EGU, "kG") field(HOPR, "51.7380") field(LOPR, "0.2525") field(PREC, "7") field(BRSV, "INVALID") } record(seq, "QUAD:LTUS:370:BLIMITS") { field(DESC, "ACT Limits") field(PREC, "7") field(DOL1, "QUAD:LTUS:370:BLIMITS") field(LNK1, "QUAD:LTUS:370:BACTLIMITS.F PP") field(DOL2, "QUAD:LTUS:370:BACTLIMITS.I") field(LNK2, "QUAD:LTUS:370:BACT.HIGH") field(DOL3, "QUAD:LTUS:370:BACTLIMITS.J") field(LNK3, "QUAD:LTUS:370:BACT.LOW") field(DOL4, "QUAD:LTUS:370:BACTLIMITS.K") field(LNK4, "QUAD:LTUS:370:BACT.HIHI") field(DOL5, "QUAD:LTUS:370:BACTLIMITS.L") field(LNK5, "QUAD:LTUS:370:BACT.LOLO") field(DOL6, "QUAD:LTUS:370:BLIMITS") field(LNK6, "QUAD:LTUS:370:BMONLIMITS.F PP") field(DOL7, "QUAD:LTUS:370:BMONLIMITS.I") field(LNK7, "QUAD:LTUS:370:BMON.HIGH") field(DOL8, "QUAD:LTUS:370:BMONLIMITS.J") field(LNK8, "QUAD:LTUS:370:BMON.LOW") field(DOL9, "QUAD:LTUS:370:BMONLIMITS.K") field(LNK9, "QUAD:LTUS:370:BMON.HIHI") field(DOLA, "QUAD:LTUS:370:BMONLIMITS.L") field(LNKA, "QUAD:LTUS:370:BMON.LOLO") field(FLNK, "QUAD:LTUS:370:ILIMITS") field(SCAN, "5 second") } record(ao, "QUAD:LTUS:370:BCTRL") { field(DESC, "B-Perturb") field(PREC, "7") field(EGU, "kG") field(DRVH, "51.7380") field(DRVL, "0.2525") field(HOPR, "51.7380") field(LOPR, "0.2525") # 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, "QUAD:LTUS:370: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, "QUAD:LTUS:370:BCTRLGO") { field(DESC, "Update DES and perturb") field(PREC, "7") # Disable BACT limits field(DOL1, "1") field(LNK1, "QUAD:LTUS:370:BLIMITS.VAL") # Update BDES with the BCTRL (slider) value field(DOL2, "QUAD:LTUS:370:BCTRL.VAL") field(LNK2, "QUAD:LTUS:370:BDES PP") field(DOL3, "1") field(LNK3, "QUAD:LTUS:370:IDIRECT.PROC PP") field(DOL4, "1") field(LNK4, "QUAD:LTUS:370:CHECKSTDZLOST.PROC PP") field(DOL5, "QUAD:LTUS:370:BCTRL.VAL") field(LNK5, "QUAD:LTUS:370:BCTRLSUB PP") # Re-enable BACT limits field(DOL6, "0") field(LNK6, "QUAD:LTUS:370:BLIMITS.VAL") } # Convert B-field to Current and output to ISETPT record(sub, "QUAD:LTUS:370:BCTRLSUB") { field(DESC, "Feedback") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:370:POLYCOEF") field(INPC, "QUAD:LTUS:370:POLYCOEF.A") field(INPD, "QUAD:LTUS:370:POLYCOEF.B") field(INPE, "QUAD:LTUS:370:BDES.DRVH") field(INPF, "QUAD:LTUS:370:BDES.DRVL") field(PREC, "7") field(EGU, "kG") field(HOPR, "51.7380") field(LOPR, "0.2525") field(MDEL, "-1") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:370:ISETPT") } record(ao, "QUAD:LTUS:370:BDESPREVTRIM") { field(DESC, "trim bdes for undo") field(DTYP, "Soft Channel") field(DRVH, "51.7380") field(DRVL, "0.2525") field(EGU, "kG") field(HOPR, "51.7380") field(LOPR, "0.2525") field(PREC, "7") field(PINI, "YES") info(autosaveFields,"VAL") } record(stringin, "QUAD:LTUS:370:MADNAME") { field(DESC, "MAD deck nomenclature") field(PINI, "YES") field(VAL, "QDL17") } record(ai, "QUAD:LTUS:370: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, "3317.102813") } record(ao, "QUAD:LTUS:370:BMAX") { field(DESC, "Max B-Field") field(DTYP, "Soft Channel") field(DRVH, "51.7380") field(DRVL, "0.2525") field(EGU, "kG") field(HOPR, "51.7380") field(LOPR, "0.2525") field(PREC, "7") field(PINI, "YES") field(VAL, "51.7380") field(FLNK, "QUAD:LTUS:370:BSTEP") } record(ao, "QUAD:LTUS:370:BMIN") { field(DESC, "Min B-Field") field(DTYP, "Soft Channel") field(DRVH, "51.7380") field(DRVL, "0.2525") field(EGU, "kG") field(HOPR, "51.7380") field(LOPR, "0.2525") field(PREC, "7") field(PINI, "YES") field(VAL, "0.2525") field(FLNK, "QUAD:LTUS:370:BSTEP") } record(ao, "QUAD:LTUS:370:BDESSAVE") { field(DESC, "bdes for save/load") field(DTYP, "Soft Channel") field(DRVH, "51.7380") field(DRVL, "0.2525") field(EGU, "kG") field(HOPR, "51.7380") field(LOPR, "0.2525") field(PINI, "YES") field(PREC, "7") } # This record is processed by QUAD:LTUS:370: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, "QUAD:LTUS:370:BCON") { field(DESC, "Config B-Field ") field(DTYP, "Soft Channel") field(PREC, "7") field(EGU, "kG") field(HOPR, "51.7380") field(LOPR, "0.2525") field(DRVH, "51.7380") field(DRVL, "0.2525") # 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 , "QUAD:LTUS:370:ICON2BCON") field(OMSL, "closed_loop") field(OUT, "QUAD:LTUS:370:B2ICON PP") info(autosaveFields,"VAL") } record(sub, "QUAD:LTUS:370:B2ICON") { field(DESC, "Convert Desired ICon to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:370:POLYCOEF") field(INPC, "QUAD:LTUS:370:POLYCOEF.A") field(INPD, "QUAD:LTUS:370:POLYCOEF.B") field(PREC, "7") field(EGU, "kG") field(HOPR, "51.7380") field(LOPR, "0.2525") field(MDEL, "-1") field(INPE, "QUAD:LTUS:370:BCON.DRVH") field(INPF, "QUAD:LTUS:370:BCON.DRVL") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:370: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, "QUAD:LTUS:370:BSTEP") { field(DESC, "B-Field step size") field(CALC, "(C==3)||(D==3)?0:ABS(A-B)*0.005") field(INPA, "QUAD:LTUS:370:BMAX") field(INPB, "QUAD:LTUS:370:BMIN") field(INPC, "QUAD:LTUS:370:BMIN.SEVR") field(INPD, "QUAD:LTUS:370:BMAX.SEVR") field(EGU, "kG") 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,"QUAD:LTUS:370:BCTRLDISABLECALC") { field(DESC, "Calc for disabling BCTRL") field(ASG, "Internal") field(CALC, "A?2:1") field(INPA, "QUAD:LTUS:370:ONLINE CP") field(OUT, "QUAD:LTUS:370:BCTRLDISABLEFOUT PP") } record(fanout, "QUAD:LTUS:370:BCTRLDISABLEFOUT") { field(DESC, "Disable BCTRL fanout") field(SELM, "Specified") field(SELL, "QUAD:LTUS:370:BCTRLDISABLECALC") field(LNK1, "QUAD:LTUS:370:BCTRLDISABLE") field(LNK2, "QUAD:LTUS:370:BCTRLENABLE") } record(stringout, "QUAD:LTUS:370:BCTRLDISABLE") { field(DESC, "Disable BCTRL") field(DTYP, "Soft Channel") field(OUT, "QUAD:LTUS:370:BCTRL.ASG") field(VAL, "NOWRITE") field(FLNK, "QUAD:LTUS:370:BCTRLDISV_UPDATE") } record(stringout, "QUAD:LTUS:370:BCTRLENABLE") { field(DESC, "Enable BCTRL") field(DTYP, "Soft Channel") field(OUT, "QUAD:LTUS:370:BCTRL.ASG") field(VAL, "") field(FLNK, "QUAD:LTUS:370:BCTRLDISV_UPDATE") } record(calcout, "QUAD:LTUS:370:BCTRLDISV_UPDATE") { field(DESC, "Calc for updating BCTRL.DISV") field(ASG, "Internal") field(CALC, "A") field(INPA, "QUAD:LTUS:370:ONLINE") field(OUT, "QUAD:LTUS:370: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,"QUAD:LTUS:370:BACT and MON\n are processed via links from \n QUAD:LTUS:370:IACT (device raw value readback 1)\n and\n QUAD:LTUS:370: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 QUAD:LTUS:370:POLYCOEF\nC = First polynomial coefficient (offset if linear)\nD = Second polynomial coefficient (slope if linear)\nE = QUAD:LTUS:370: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,"QUAD:LTUS:370:BDES\n is processed when set by CA users or \n QUAD:LTUS:370: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,"QUAD:LTUS:370: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 QUAD:LTUS:370: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 (QUAD:LTUS:370: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,"QUAD:LTUS:370:B*LIMITS and QUAD:LTUS:370:BLIMITS:\n Calculate alarm and warning limits based on \n deltas from QUAD:LTUS:370: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,"QUAD:LTUS:370: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,"QUAD:LTUS:370: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, "QUAD:LTUS:370: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, "QUAD:LTUS:370:MPSBTOL") { field(DESC, "Absolute mps tol") field(EGU, "kG") field(PREC, "2") field(CALC, "ABS(A)*0.02") field(INPA, "QUAD:LTUS:370:BMAX") field(PINI, "YES") } # # 21-Aug-2013: K. Luchini # Set channel access security so that users # cannot easily change values. record(ao, "QUAD:LTUS:370:MPSBMAX") { field(DESC, "MPS Max B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "51.7380") field(DRVL, "0.2525") field(PINI, "YES") field(VAL, "51.7380") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:370:MPSBMIN") { field(DESC, "MPS Min B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "51.7380") field(DRVL, "0.2525") field(PINI, "YES") field(VAL, "0.2525") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:370:MPSBLLIM") { field(DESC, "MPS Low Limit B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "51.7380") field(DRVL, "0.2525") field(PINI, "YES") field(VAL, "0.2525") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:370:MPSBLLIM2") { field(DESC, "MPS Low Limit #2 B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "51.7380") field(DRVL, "0.2525") field(PINI, "YES") field(VAL, "0.2525") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } # Set the default to Std record(mbbo, "QUAD:LTUS:370: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, "QUAD:LTUS:370:MPSLIMITS.E PP") } record(aSub, "QUAD:LTUS:370: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, "QUAD:LTUS:370:MPS.RVAL") field(INPB, "QUAD:LTUS:370:BADIFF") field(INPC, "QUAD:LTUS:370:BDELTAS.N") field(INPD, "QUAD:LTUS:370:BACT") field(INPE, "QUAD:LTUS:370:MPSBITMASK.RVAL") field(INPF, "QUAD:LTUS:370:MPSBLLIM") field(INPG, "QUAD:LTUS:370:MPSBMIN") field(INPH, "QUAD:LTUS:370:MPSBMAX") field(INPI, "QUAD:LTUS:370: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, "QUAD:LTUS:370:INTOL.RVAL PP") field(OUTB, "QUAD:LTUS:370:INTOL_BMIN.RVAL PP") field(OUTC, "QUAD:LTUS:370:INTOL_BRANGE.RVAL PP") field(OUTD, "QUAD:LTUS:370: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, "QUAD:LTUS:370:INTOL") { field(DESC, "BACT within MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:370:MPSLIMITS.VALA") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "QUAD:LTUS:370:INTOL_BMIN") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:370:MPSLIMITS.VALB") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "QUAD:LTUS:370:INTOL_BMIN2") { field(DESC, "MPS tol #2") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:370:MPSLIMITS.VALD") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "QUAD:LTUS:370:INTOL_BRANGE") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:370: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, "QUAD:LTUS:370:CHCKITOL") { field(DESC, "Absolute Check I Tolerance") field(EGU, "A") field(FLNK, "QUAD:LTUS:370:TRIMITOL") field(CALC, "ABS(A*B)") field(INPA, "QUAD:LTUS:370:CHCKBTOL") field(INPB, "QUAD:LTUS:370:POLYCOEF.B") field(PREC, "9") } record(calc, "QUAD:LTUS:370:TRIMBTOL") { field(EGU, "kG") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(DESC, "Absolute Trim Tolerance") field(CALC, "ABS(A)/2") field(INPA, "QUAD:LTUS:370:CHCKBTOL") field(FLNK, "QUAD:LTUS:370:CHCKITOL") } record(calc, "QUAD:LTUS:370:CHCKBTOL") { field(DESC, "Check absolute tolerance") field(EGU, "A") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(FLNK, "QUAD:LTUS:370:TRIMBTOL") field(CALC, "MAX(ABS(A),ABS(C))*(B/1000000)") field(INPA, "QUAD:LTUS:370:BDES.HOPR") field(INPB, "QUAD:LTUS:370:STABILITY") field(INPC, "QUAD:LTUS:370:BDES.LOPR") } record(longout, "QUAD:LTUS:370: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, "QUAD:LTUS:370:CHCKBTOL") } record(calc, "QUAD:LTUS:370:TRIMITOL") { field(DESC, "Absolute Trim I Tolerance") field(EGU, "kG") field(CALC, "ABS(A*B)") field(INPA, "QUAD:LTUS:370:POLYCOEF.B") field(INPB, "QUAD:LTUS:370:TRIMBTOL") field(PREC, "9") } record(ai, "QUAD:LTUS:370:TRIMBTOLR") { field(DESC, "Relative trim tol") field(PREC, "4") field(EGU, "%") field(HOPR, "1.0") field(LOPR, "0.0") field(PINI, "YES") } record(ai, "QUAD:LTUS:370: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, "QUAD:LTUS:370:FBCKFCOM") { field(ZNAM, "CA") field(ONAM, "FCOM") field(DESC, "CA Mode") field(PINI, "YES") field(SDIS, "0") } record(bo, "QUAD:LTUS:370:PAU") { field(ZNAM, "NotConfigured") field(ONAM, "Configured") field(DESC, "PAU Present") field(PINI, "YES") field(SDIS, "0") field(FLNK, "QUAD:LTUS:370:PAUGO") } record(fanout, "QUAD:LTUS:370:PAUGO") { field(DESC, "PAU control") field(LNK1, "QUAD:LTUS:370:PAUSTOP") field(LNK2, "QUAD:LTUS:370: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, "QUAD:LTUS:370:PAUSTART") { field(DESC, "Setup for PAU On") field(SDIS, "QUAD:LTUS:370: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, "QUAD:LTUS:370:PAUSTOP") { field(DESC, "Setup for PAU Off") field(SDIS, "QUAD:LTUS:370: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, "QUAD:LTUS:370:MCORDEVNAME") { field(DESC, "PS device name") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, "QUAD:LTUS:235:") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "QUAD:LTUS:370: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, "QUAD:LTUS:370:PSTYPE.RVAL") field(INPC, "QUAD:LTUS:370:TURNEDOFF.RVAL") field(INPD, "QUAD:LTUS:370:CONFIG.RVAL") field(INPE, "QUAD:LTUS:370:PSCATEGORY.RVAL") field(INPF, "QUAD:LTUS:370:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "QUAD:LTUS:370:AUTOCTRL.RVAL") field(INPJ, "QUAD:LTUS:370:OUTOFSERVICE.RVAL") field(INPL, "QUAD:LTUS:370:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "QUAD:LTUS:370:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "QUAD:LTUS:370:PAU") field(INPP, "QUAD:LTUS:370:CALBDISABLE.RVAL") field(INPQ, "QUAD:LTUS:370:PTRBDISABLE.RVAL") field(INPR, "QUAD:LTUS:370:TRIMDISABLE.RVAL") field(INPS, "QUAD:LTUS:370:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "QUAD:LTUS:370:FBCK") field(INPU, "QUAD:LTUS:370:TRIMTYPE.RVAL") field(INPV, "QUAD:LTUS:370:STDZDIRECT.RVAL") field(INPW, "QUAD:LTUS:370:DEGAUSENABLE.RVAL") field(FLNK, "QUAD:LTUS:370:HSTA") } record(longin, "QUAD:LTUS:370:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "QUAD:LTUS:370:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "QUAD:LTUS:370: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, "QUAD:LTUS:370: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, "QUAD:LTUS:370: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, "QUAD:LTUS:370: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, "QUAD:LTUS:370: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, "QUAD:LTUS:370: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 QUAD:LTUS:370:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses QUAD:LTUS:370:FBCK. # This PV should be replaced by QUAD:LTUS:370: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, "QUAD:LTUS:370: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, "QUAD:LTUS:370: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, "QUAD:LTUS:370: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, "QUAD:LTUS:235:OUTOFSERVICE CPP NMS") field(OMSL, "closed_loop") field(FLNK, "QUAD:LTUS:370:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"QUAD:LTUS:370:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "QUAD:LTUS:370:OUTOFSERVICE NPP NMS") field(OUT, "QUAD:LTUS:370:ONLINE PP") } record(bo, "QUAD:LTUS:370:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "QUAD:LTUS:370: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, "QUAD:LTUS:370: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, "QUAD:LTUS:370: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, "QUAD:LTUS:370: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, "QUAD:LTUS:370: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, "QUAD:LTUS:370: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, "QUAD:LTUS:370: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, "QUAD:LTUS:370: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, "QUAD:LTUS:370: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, "QUAD:LTUS:370: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, "QUAD:LTUS:370: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, "QUAD:LTUS:370:TRIMTYPE") } record(stringout, "QUAD:LTUS:370:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "QUAD:LTUS:235:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "QUAD:LTUS:370:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "QUAD:LTUS:370:STATE.RVAL") field(INPB, "QUAD:LTUS:370:INTLKSUMY.RVAL") field(OUT, "QUAD:LTUS:370:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:LTUS:370: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, "QUAD:LTUS:370:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "QUAD:LTUS:370:STATE.RVAL") field(INPB, "QUAD:LTUS:370:INTLKSUMY.RVAL") field(OUT, "QUAD:LTUS:370:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:LTUS:370:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "QUAD:LTUS:370:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "QUAD:LTUS:370: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, "QUAD:LTUS:370: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, "QUAD:LTUS:370: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, "QUAD:LTUS:370: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,"QUAD:LTUS:370: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("QUAD:LTUS:370:TURNEDOFF",3140,1907,0,1,"QUAD:LTUS:370:TURNEDOFF") #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "QUAD:LTUS:370:STATSUB") { field(DESC, "Build STATus ") field(INAM, "mgntInit") field(SNAM, "mgntSlcStat") field(INPA, "QUAD:LTUS:370:BACT.STAT") field(INPB, "QUAD:LTUS:370:BDES.STAT") field(INPC, "QUAD:LTUS:370: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, "QUAD:LTUS:370:BACT.SEVR") field(INPH, "QUAD:LTUS:370:BDES.SEVR") field(INPI, "QUAD:LTUS:370: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, "QUAD:LTUS:370:STATE.RVAL") field(INPN, "QUAD:LTUS:370:STDZOK") field(INPO, "QUAD:LTUS:370:CALBOK") field(INPP, "QUAD:LTUS:370:OUTOFSERVICE.RVAL") field(INPQ, "QUAD:LTUS:370:CONFIG.RVAL") field(INPR, "QUAD:LTUS:370:HSTA") field(INPS, "QUAD:LTUS:370:CTRL.RVAL") field(INPT, "QUAD:LTUS:370:DEGAUSOK") field(INPV, "QUAD:LTUS:370: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, "QUAD:LTUS:370:STAT") } record(longout, "QUAD:LTUS:370:STAT") { field(DESC, "STAT sent to SLC") field(SCAN, "Passive") field(FLNK, "QUAD:LTUS:370:STATCTRLSUB") field(DOL, "QUAD:LTUS:370:STATSUB.VAL") field(OMSL, "closed_loop") } record(sSub, "QUAD:LTUS:370:STATCTRLSUB") { field(DESC, "Decode SLC STAT into mbbo") field(INAM, "mgntInit") field(SNAM, "mgntStatDecode") field(INPA, "QUAD:LTUS:370:STAT") field(INPB, "QUAD:LTUS:370:HSTA") field(INPD, "QUAD:LTUS:370:ONOFFCTRL.RVAL") field(FLNK, "QUAD:LTUS:370:STATMSG") } record(mbbo, "QUAD:LTUS:370: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, "QUAD:LTUS:370:UNAVAILGO") field(DOL, "QUAD:LTUS:370:STATCTRLSUB.W") } record(seq, "QUAD:LTUS:370:UNAVAILGO") { field(DESC, "Process UNAVAIL") field(DOL1, "QUAD:LTUS:370:STATSUB.U") field(LNK1, "QUAD:LTUS:370:UNAVAIL PP") } record(stringout, "QUAD:LTUS:370:SNLSTATMSG") { field(DTYP, "Soft Channel") } #! TextBox(TB0,820,1000,1200,1220,0,"Dialog",12,1,16777215,"QUAD:LTUS:370:STATUSSUB - future\nOverall device status - takes input from action snls, record sevrs, master snl(s) and outputs final status\n\nInputs:\nA - QUAD:LTUS:370:CTRLSTATUS - snl status\nB - MGNT:CTRLSTATUS - master list status\nC\nD - QUAD:LTUS:370: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,"QUAD:LTUS:370STATSUB\nformat control bo's into slc STAT\n\nInputs:\nA - QUAD:LTUS:370:STATUS\nC - QUAD:LTUS:370:ON\nD - QUAD:LTUS:370:STDZOK\nE - QUAD:LTUS:370:CALBOK\nF - QUAD:LTUS:370:BACTDRIFT (future)\nG -\nH- QUAD:LTUS:370:DACSTATUS\nI -QUAD:LTUS:370:ADCSTATUS\nJ - QUAD:LTUS:370:BACTSTATUS\nK - QUAD:LTUS:370:BDESSTATUS\nL - QUAD:LTUS:370:RIPLSTATUS\n\nOutput:\nP - QUAD:LTUS:370: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, "QUAD:LTUS:370: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, "QUAD:LTUS:370: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, "QUAD:LTUS:370: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, "QUAD:LTUS:370: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 b-field of a slave with out a powered trim coil # equal to the main desired current and pass backwards # through the IVB poly. record(sub, "QUAD:LTUS:370:IDES2BDES") { field(DESC, "Cal BDES") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "QUAD:LTUS:370:IDES2BDES") field(INPB, "QUAD:LTUS:370:POLYCOEF") field(INPC, "QUAD:LTUS:370:POLYCOEF.A") field(INPD, "QUAD:LTUS:370:POLYCOEF.B") field(INPE, "QUAD:LTUS:235:IDES CP MS") field(INPF, "QUAD:LTUS:235:BDELTAS PP") field(INPG, "100") field(EGU, "kG") field(HOPR, "51.7380") field(LOPR, "0.2525") field(HIHI, "51.7380") field(LOLO, "0.2525") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "51.7380") field(LOW, "0.2525") field(FLNK, "QUAD:LTUS:370:BDES") } # Calcuate the bcon of a slave using # the main desired current and pass backwards # through the IVB poly. # the trim b-field is acutally amps. record(sub, "QUAD:LTUS:370:ICON2BCON") { field(DESC, "Cal BCON") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "QUAD:LTUS:370:ICON2BCON") field(INPB, "QUAD:LTUS:370:POLYCOEF") field(INPC, "QUAD:LTUS:370:POLYCOEF.A") field(INPD, "QUAD:LTUS:370:POLYCOEF.B") field(INPE, "QUAD:LTUS:235:ICON CP NMS") field(INPF, "QUAD:LTUS:235:BDELTAS PP") field(INPG, "100") field(EGU, "kG") field(HOPR, "51.7380") field(LOPR, "0.2525") field(HIHI, "51.7380") field(LOLO, "0.2525") field(PREC, "7") field(BRSV, "INVALID") # Set MINOR alarms for main as the default, slaves will set NO_ALARM field(HHSV, "NO_ALARM") field(HSV, "NO_ALARM") field(LSV, "NO_ALARM") field(LLSV, "NO_ALARM") field(HIGH, "51.7380") field(LOW, "0.2525") field(FLNK, "QUAD:LTUS:370:BCON") }#! 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, "QUAD:LTUS:430:IACT") { field(DESC, "Current") field(INP, "QUAD:LTUS:235:IACT CP NMS") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "QUAD:LTUS:430:BACT") info(autosaveFields,"HYST") } record(bi, "QUAD:LTUS:430:STATE") { field(DESC, "PS On/Off Status") field(DTYP, "Raw Soft Channel") field(INP, "QUAD:LTUS:235:STATE CP MS") field(ZSV, "MAJOR") field(ZNAM, "OFF") field(ONAM, "ON") } record(ao, "QUAD:LTUS:430:IDES") { field(DESC, "Desired Current") field(PREC, "3") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(MDEL, "-1") field(HIHI, "165.0") field(LOLO, "0.0") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "QUAD:LTUS:430:BDELTAS") field(DRVH, "165.0") field(DRVL, "0.0") field(DOL, "QUAD:LTUS:430: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, "QUAD:LTUS:430:ICTRL PP") } # This record is processed by QUAD:LTUS:430:ICON") # Note: we are not setting alarms here. record(ao, "QUAD:LTUS:430:ICON") { field(DESC, "Config I") field(DTYP, "Soft Channel") field(PREC, "3") field(HOPR, "165.0") field(LOPR, "0.0") field(DRVH, "165.0") field(DRVL, "0.0") field(DOL, "QUAD:LTUS:430:B2ICON.K") field(OMSL, "closed_loop") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:430:INOM") { field(DESC, "Nominal Current") field(DOL, "QUAD:LTUS:430:BNOM.K") field(OMSL, "closed_loop") field(PREC, "3") field(EGU, "A") field(DRVH, "165.0") field(DRVL, "0.0") field(HOPR, "165.0") field(LOPR, "0.0") } record(ao, "QUAD:LTUS:430:ICTRL") { field(DESC, "Set Current") field(PREC, "3") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(DRVH, "165.0") field(DRVL, "0.0") field(MDEL, "-1") field(FLNK, "QUAD:LTUS:430:ICTRLGO") field(OMSL, "supervisory") info(autosavefields,"VAL") } record(seq, "QUAD:LTUS:430:ICTRLGO") { field(DESC, "Process Current Setpoint") field(PREC, "3") # Set ISETPT to supervisory field(DOL1, "0") field(LNK1, "QUAD:LTUS:430:ISETPT.OMSL") field(DOL2, "QUAD:LTUS:430:ICTRL") field(LNK2, "QUAD:LTUS:430:ISETPT PP") # Set ISETPT to closed loop - get data from BCTRLSUB.K field(DOL3, "1") field(LNK3, "QUAD:LTUS:430:ISETPT.OMSL") } record(ao, "QUAD:LTUS:430:IMAX") { field(DESC, "Max I") field(DTYP, "Soft Channel") field(DRVH, "165.0") field(DRVL, "0.0") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(PREC, "3") field(PINI, "YES") field(VAL, "165.0") field(FLNK, "QUAD:LTUS:430:IMIN") } record(ao, "QUAD:LTUS:430:IMIN") { field(DESC, "Min I") field(DTYP, "Soft Channel") field(DRVH, "165.0") field(DRVL, "0.0") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(PREC, "3") field(VAL, "0.0") field(FLNK, "QUAD:LTUS:430:IRANGE") } record(sel, "QUAD:LTUS:430:IACTPREVOK") { field(DESC, "Last Good Current") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(PREC, "3") field(NVL, "QUAD:LTUS:430:BACT.SEVR") field(INPA, "QUAD:LTUS:430:IACT NPP MS") field(INPB, "QUAD:LTUS:430:IACTPREVOK NPP MS") field(INPC, "QUAD:LTUS:430:IACTPREVOK NPP MS") field(INPD, "QUAD:LTUS:430:IACTPREVOK NPP MS") } record(sub, "QUAD:LTUS:430:IACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:430:IDES") field(INPB, "QUAD:LTUS:430:ISETPT.DRVH") field(INPC, "QUAD:LTUS:430:ISETPT.DRVL") field(INPD, "QUAD:LTUS:430:IDELTAS.I") field(INPE, "QUAD:LTUS:430:IDELTAS.J") field(INPG, "QUAD:LTUS:430:STATE") field(INPH, "QUAD:LTUS:430:HSTA") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(sub, "QUAD:LTUS:430:IMONLIMITS") { field(DESC, "Aux Current Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:430:IDES") field(INPB, "QUAD:LTUS:430:ISETPT.DRVH") field(INPC, "QUAD:LTUS:430:ISETPT.DRVL") field(INPD, "QUAD:LTUS:430:IDELTAS.K") field(INPE, "QUAD:LTUS:430:IDELTAS.L") field(INPG, "QUAD:LTUS:430:STATE") field(INPH, "QUAD:LTUS:430:HSTA") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(seq, "QUAD:LTUS:430:ILIMITS") { field(DESC, "Set ACT and MON Limits") field(PREC, "3") field(DOL1, "QUAD:LTUS:430:BLIMITS") field(LNK1, "QUAD:LTUS:430:IACTLIMITS.F PP") field(DOL2, "QUAD:LTUS:430:IACTLIMITS.I") field(LNK2, "QUAD:LTUS:430:IACT.HIGH") field(DOL3, "QUAD:LTUS:430:IACTLIMITS.J") field(LNK3, "QUAD:LTUS:430:IACT.LOW") field(DOL4, "QUAD:LTUS:430:IACTLIMITS.K") field(LNK4, "QUAD:LTUS:430:IACT.HIHI") field(DOL5, "QUAD:LTUS:430:IACTLIMITS.L") field(LNK5, "QUAD:LTUS:430:IACT.LOLO") field(DOL6, "QUAD:LTUS:430:BLIMITS") field(LNK6, "QUAD:LTUS:430:IMONLIMITS.F PP") field(DOL7, "QUAD:LTUS:430:IMONLIMITS.I") field(LNK7, "QUAD:LTUS:430:IMON.HIGH") field(DOL8, "QUAD:LTUS:430:IMONLIMITS.J") field(LNK8, "QUAD:LTUS:430:IMON.LOW") field(DOL9, "QUAD:LTUS:430:IMONLIMITS.K") field(LNK9, "QUAD:LTUS:430:IMON.HIHI") field(DOLA, "QUAD:LTUS:430:IMONLIMITS.L") field(LNKA, "QUAD:LTUS:430: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, "QUAD:LTUS:430:IDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntRawDeltas") field(INPD, "QUAD:LTUS:430:TRIMBTOL") field(INPE, "QUAD:LTUS:430:CHCKBTOL") field(INPF, "QUAD:LTUS:430:BDELTAS.K") field(INPG, "QUAD:LTUS:430:BDELTAS.L") field(INPH, "QUAD:LTUS:430: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, "QUAD:LTUS:430:STDZITOLR") field(INPC, "QUAD:LTUS:430:STDZITOL") field(FLNK, "") } # All ps controllers with on/off control will set the macro ONOF # as follows: # # ONOF = QUAD:LTUS:235: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, "QUAD:LTUS:430: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 = QUAD:LTUS:235:RESET PP # record(bo, "QUAD:LTUS:430: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, "QUAD:LTUS:430:RAMPSTATE") { field(DESC, "PS Ramp Status") field(DTYP, "Soft Channel") field(DOL, "QUAD:LTUS:235: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, "QUAD:LTUS:430: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, "QUAD:LTUS:430:TRIMRAMPRATE") field(OUT, "") field(FLNK, "QUAD:LTUS:430:STDZDLY") } record(ao, "QUAD:LTUS:430:ISETPT") { field(DESC, "Current Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(DRVH, "165.0") field(DRVL, "0.0") field(MDEL, "-1") field(OUT, "") field(DOL, "QUAD:LTUS:430: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, "QUAD:LTUS:430:IMON") { field(DESC, "Aux Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(INP, "QUAD:LTUS:235:IMON CP NMS") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "QUAD:LTUS:430:BMON") } record(ao, "QUAD:LTUS:430:IRIPL") { field(DESC, "Ripple Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(DOL, "QUAD:LTUS:235:IRIPL CP NMS") field(OMSL, "closed_loop") field(EGU, "A") field(DRVH, "1.0") field(HOPR, "1.0") field(PREC, "3") field(FLNK, "QUAD:LTUS:430:IRIPLOK") } record(sub, "QUAD:LTUS:430:IRIPLOK") { field(DESC, "Ripple Current Status") field(INAM, "mgntInit") field(SNAM, "mgntRiplOK") field(INPA, "QUAD:LTUS:430:IRIPL.VAL") field(INPB, "QUAD:LTUS:430: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, "QUAD:LTUS:430:R") { field(DESC, "Resistance") field(EGU, "Ohms") field(PREC, "4") field(PINI, "YES") field(DOL, "QUAD:LTUS:235: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, "QUAD:LTUS:430:IGND") { field(DESC, "Ground Current") field(EGU, "A") field(PREC, "6") field(PINI, "YES") field(DOL, "QUAD:LTUS:235:IGND CP MS") field(OMSL, "closed_loop") } record(bi, "QUAD:LTUS:430:INTLKSUMY") { field(DESC, "Interlock Summary") field(INP, "QUAD:LTUS:235:INTLKSUMY CP MS") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(ZNAM, "OK") field(ONAM, "FAULT") field(PINI, "NO") } record(mbbo, "QUAD:LTUS:430: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, "QUAD:LTUS:235:COOLING CP NMS") field(OMSL, "closed_loop") } # The following PV is processed by :BACTFO # which is processed by :BACT record(fanout, "QUAD:LTUS:430:IACTFO") { field(DESC, "IACT processing") field(SELM, "All") field(LNK1, "QUAD:LTUS:430:IACTPREVOK") field(LNK2, "QUAD:LTUS:430:IDIFF") field(LNK3, "QUAD:LTUS:430:IADIFF") field(LNK4, "QUAD:LTUS:430:IRATIO") field(LNK5, "QUAD:LTUS:430:IDIRECT") field(LNK6, "QUAD:LTUS:430:IACTPOL_CHECK") } record(calc, "QUAD:LTUS:430:IDIFF") { field(DESC, "IDES-IACT") field(CALC, "A-B") field(INPA, "QUAD:LTUS:430:IDES") field(INPB, "QUAD:LTUS:430:IACT") field(EGU, "A") field(PREC, "9") field(HOPR, "165.0") field(LOPR, "0.0") } record(calc, "QUAD:LTUS:430:IADIFF") { field(DESC, "Absolute IDES-IACT") field(CALC, "A<0?ABS(A):A") field(INPA, "QUAD:LTUS:430:IDIFF") field(PREC, "9") } record(calc, "QUAD:LTUS:430:IRATIO") { field(DESC, "IDES-IACT/IMAX") field(CALC, "B?A/B:0") field(INPA, "QUAD:LTUS:430:IDIFF") field(INPB, "QUAD:LTUS:430:IDES.DRVH") field(PREC, "9") } record(calcout, "QUAD:LTUS:430:IRANGE") { field(DESC, "Current Range") field(PINI, "YES") field(CALC, "ABS(A-B)") field(INPA, "QUAD:LTUS:430:IMIN") field(INPB, "QUAD:LTUS:430: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, "QUAD:LTUS:430: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, "QUAD:LTUS:430:IACT") field(FLNK, "QUAD:LTUS:430:IACTPOL") } record(bo, "QUAD:LTUS:430:IACTPOL") { field(DESC, "Actual I Polarity") field(DTYP, "Raw Soft Channel") field(DOL, "QUAD:LTUS:430: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,"QUAD:LTUS:430:I*LIMITS:\n Calculate alarm and warning limits based on \n deltas from QUAD:LTUS:430:IDELTAS and the\n QUAD:LTUS:430: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,"QUAD:LTUS:430:IACT: \n Get copy of QUAD:LTUS:430:I. \n",null) #! TextBox(TB12,1280,3100,1760,3200,0,"Dialog",12,1,16777215,"QUAD:LTUS:430: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,"QUAD:LTUS:430:IDES:\n Contains raw value calculated by \nQUAD:LTUS:430: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 \nQUAD:LTUS:430:BDELTAS.\n",null) #! TextBox(TB10,56,1940,316,2340,0,"Dialog",12,1,16777215,"QUAD:LTUS:430: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 QUAD:LTUS:430: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 QUAD:LTUS:430: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,"QUAD:LTUS:430:ISETPT:\n Sets the hardware. When fast feedback is set on, this record is\n set to closed loop mode by QUAD:LTUS:430:FBCKSTART sequence. When \n the loop is closed, this record takes input calculated by \n BFBCK only. When fast feedback is set off, QUAD:LTUS:430:FBCKSTOP \n will set it back to supervisory so that the value can be set by \n QUAD:LTUS:430: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, "QUAD:LTUS:430:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:430:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "QUAD:LTUS:430:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "QUAD:LTUS:430:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "QUAD:LTUS:430:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "QUAD:LTUS:430:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "1") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "QUAD:LTUS:430: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, "QUAD:LTUS:430:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "QUAD:LTUS:430:TRIMTYPE.RVAL") field(INPB, "QUAD:LTUS:430:CONFIG.RVAL") field(OUT, "QUAD:LTUS:430:TRIMMAXNUM PP") } record(longout, "QUAD:LTUS:430: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, "QUAD:LTUS:430: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, "QUAD:LTUS:235:TRIMRAMPRATE CP NMS") field(OMSL, "closed_loop") field(VAL, "") field(OUT, "QUAD:LTUS:430:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "QUAD:LTUS:430: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, "QUAD:LTUS:235:TRIMSETL CP NMS") field(OMSL, "closed_loop") field(VAL, "") } record(bo, "QUAD:LTUS:430: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, "QUAD:LTUS:430: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, "QUAD:LTUS:430: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, "0") } record(bo, "QUAD:LTUS:430:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "0") } record(ao, "QUAD:LTUS:430: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, "QUAD:LTUS:430:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "QUAD:LTUS:430: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, "QUAD:LTUS:430: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, "QUAD:LTUS:430:IMOVE") field(INPB, "QUAD:LTUS:430:IACT") field(INPC, "QUAD:LTUS:430:IRAMPRATE") field(INPD, "1.0") field(INPE, "QUAD:LTUS:430:TRIMDLYPCT") field(INPF, "QUAD:LTUS:430:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "QUAD:LTUS:430:RAMPTIME_LEFT PP") } record(longout, "QUAD:LTUS:430:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "QUAD:LTUS:430:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "QUAD:LTUS:430:RAMPDONE_CALC") } record(calc, "QUAD:LTUS:430:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "QUAD:LTUS:430:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "QUAD:LTUS:430:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "QUAD:LTUS:430: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, "QUAD:LTUS:430:RAMPTIME_LEFT") field(OUT, "QUAD:LTUS:430:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "QUAD:LTUS:430:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "QUAD:LTUS:430:RAMPTIME_LEFT NMS") field(OUT, "QUAD:LTUS:430:RAMPDONE PP") } record(bo, "QUAD:LTUS:430:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "QUAD:LTUS:430:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "QUAD:LTUS:430: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, "QUAD:LTUS:430: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, "QUAD:LTUS:430:STDZINIT") { field(DESC, "Proc. Stdz PVs on boot") field(PINI, "YES") field(DOL1, "1") field(DOL2, "1") field(DOL3, "1") field(LNK1, "QUAD:LTUS:430:DEBUG.PROC PP") field(LNK2, "QUAD:LTUS:430:STDZCYCLENUM.PROC PP") field(LNK3, "QUAD:LTUS:430:STDZDISABLE.PROC PP") field(LNK4, "QUAD:LTUS:430: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, "QUAD:LTUS:430:STDZSUB") { field(DESC, "Stdz subroutine") field(INAM, "mgntStdzInit") field(SNAM, "mgntStdz") field(BRSV, "INVALID") field(INPA, "QUAD:LTUS:430:STDZIMIN NPP NMS") field(INPB, "QUAD:LTUS:430:STDZIMAX NPP NMS") field(INPC, "QUAD:LTUS:430:STDZIFINAL NPP NMS") field(INPD, "QUAD:LTUS:430:STDZCYCLENUM NPP NMS") field(INPE, "QUAD:LTUS:430:STDZDIRECT.RVAL NPP NMS") field(INPF, "QUAD:LTUS:430:STDZDISABLE.RVAL CPP NMS") field(INPG, "QUAD:LTUS:430: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, "QUAD:LTUS:430:STDZWF PP") field(OUTB, "QUAD:LTUS:430: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, "QUAD:LTUS:430:STDZWF") } record(mbbo, "QUAD:LTUS:430: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, "QUAD:LTUS:430: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, "QUAD:LTUS:430:STDZMAINPS") { field(DESC, "Stdz by main or self") field(PINI, "YES") field(DTYP, "Soft Channel") field(ZNAM, "SELF") field(ONAM, "MAIN") } record(bo, "QUAD:LTUS:430: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, "QUAD:LTUS:430: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, "QUAD:LTUS:430: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, "QUAD:LTUS:430:STDZTOD") { field(DESC, "Successful Standardize Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "QUAD:LTUS:430:STDZLOSTTOD") { field(DESC, "Standardize Lost Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(longout, "QUAD:LTUS:430:STDZCYCLECNT") { field(DESC, "Cycle Count") field(PINI, "YES") } record(longout, "QUAD:LTUS:430: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, "QUAD:LTUS:430:STDZDIRECT") } # The default standardize direction is "UP" for # all LCLS Magnets.. record(bo, "QUAD:LTUS:430:STDZDIRECT") { field(DESC, "Standardize Direction ") field(ZNAM, "UP") field(ONAM, "DOWN") field(VAL, "0") field(FLNK, "QUAD:LTUS:430:STDZIMIN") } record(ao, "QUAD:LTUS:430:STDZIMIN") { field(DESC, "Min-STDZ Current") field(PREC, "1") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(VAL, "0.0") field(FLNK, "QUAD:LTUS:430:STDZIMAX") } record(ao, "QUAD:LTUS:430:STDZIMAX") { field(DESC, "Max. Standarize Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(VAL, "165.0") field(FLNK, "QUAD:LTUS:430:STDZIFINAL") } record(ao, "QUAD:LTUS:430:STDZIFINAL") { field(DESC, "Final SDTZ Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(VAL, "0.0") field(FLNK, "QUAD:LTUS:430: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, "QUAD:LTUS:430: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, "QUAD:LTUS:430:STDZITOL") { field(DESC, "Stdz min tolerance") field(PREC, "5") field(CALC, "MAX(ABS(A),ABS(B))*C") field(INPA, "QUAD:LTUS:430:STDZIMIN CP NMS") field(INPB, "QUAD:LTUS:430:STDZIMAX CP MMS") field(INPC, "0.05") field(INPD, "QUAD:LTUS:430:STDZITOLR CP MMS") field(EGU, "A") field(FLNK, "QUAD:LTUS:430:IDELTAS") field(PINI, "YES") } # D - factor (3.154/2 = 1.577) for EPSC, otherwise, set to 1.0 record(calc, "QUAD:LTUS:430:STDZDLY") { field(DESC, "Ramp time for stdz cycle") field(CALC, "C>0?MAX(1,ABS((A-B)/C)*D):0") field(INPA, "QUAD:LTUS:430:STDZIMIN CP NMS") field(INPB, "QUAD:LTUS:430:STDZIMAX CP NMS") field(INPC, "QUAD:LTUS:430:TRIMRAMPRATE CP NMS") field(INPD, "1.0") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") } record(calc, "QUAD:LTUS:430:STDZRAMPDLY") { field(DESC, "Ramp delay total") field(CALC, "MAX(1,((A/100)*B+B))") field(PREC, "5") field(INPA, "QUAD:LTUS:430:TRIMDLYPCT CP MS") field(INPB, "QUAD:LTUS:430: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, "QUAD:LTUS:430:STDZMINIDLY") { field(DESC, "Mini-stdz delay") field(CALC, "A") field(PREC, "5") field(A, "1.0") field(EGU, "sec") field(PINI, "YES") } record(ao, "QUAD:LTUS:430: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, "QUAD:LTUS:430:STDZMINIDELTA") { field(DESC, "Stdz mini % of IMAX") field(CALC, "(B/100)*(A-C)") field(INPA, "QUAD:LTUS:430:IDES.HOPR") field(INPB, "QUAD:LTUS:430:STDZMINIPCT CPP NMS") field(INPC, "QUAD:LTUS:430:IDES.LOPR") field(PREC, "5") } record(calc, "QUAD:LTUS:430:STDZMINISETPT") { field(DESC, "Mini Stdz delta") field(CALC, "C==0?MAX(E-D,B):MIN(E+D,A)") field(INPA, "QUAD:LTUS:430:IDES.HOPR") field(INPB, "QUAD:LTUS:430:IDES.LOPR") field(INPC, "QUAD:LTUS:430:STDZDIRECT.RVAL") field(INPD, "QUAD:LTUS:430:STDZMINIDELTA") field(INPE, "QUAD:LTUS:430:IDES") field(PREC, "5") field(FLNK, "QUAD:LTUS:430: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, "QUAD:LTUS:430:STDZMINISETPTOOR") { field(DESC, "Mini Stdz setpoint out of range") field(CALC, "C==0?(E-DA)") field(INPA, "QUAD:LTUS:430:IDES.HOPR") field(INPB, "QUAD:LTUS:430:IDES.LOPR") field(INPC, "QUAD:LTUS:430:STDZDIRECT.RVAL") field(INPD, "QUAD:LTUS:430:STDZMINIDELTA") field(INPE, "QUAD:LTUS:430: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, "QUAD:LTUS:430: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, "QUAD:LTUS:430:IADJUST.RVAL") field(INPB, "QUAD:LTUS:430:STDZDIRECT.RVAL") field(INPC, "QUAD:LTUS:430:STDZOK.RVAL") field(INPD, "QUAD:LTUS:430:STDZDISABLE.RVAL") field(INPE, "QUAD:LTUS:430:STATE.RVAL CPP NMS") field(INPF, "QUAD:LTUS:430:ICTRL.RVAL") field(INPG, "QUAD:LTUS:430:STATE.SEVR") field(INPH, "QUAD:LTUS:430:BDELTAS.M") field(INPI, "QUAD:LTUS:430:IACT.SEVR") field(OUT, "QUAD:LTUS:430:STDZLOSTGO.SELN PP NMS") field(OOPT, "Transition To Non-zero") } record(seq, "QUAD:LTUS:430:STDZLOSTGO") { field(DESC, "Process lost stdz") field(SELM, "Mask") field(DOL1, "1") field(DOL2, "0") field(LNK1, "QUAD:LTUS:430:STDZLOSTTOD.PROC") field(LNK2, "QUAD:LTUS:430:STDZOK PP") } # Record maximum current after standardize # Reset to IACT from sequence after trim # Disable processing during (mini-)standardize or trim record(calc, "QUAD:LTUS:430:STDZIACTMAX") { field(DESC, "Max act current after stdz") field(CALC, "MAX(A, B)") field(DISV, "0") field(SDIS, "QUAD:LTUS:430:CHECKPWRDIP_ENABLE") field(INPA, "QUAD:LTUS:430:IACT CP") field(INPB, "QUAD:LTUS:430:STDZIACTMAX") field(EGU, "A") field(FLNK, "QUAD:LTUS:430:CHECKPWRDIP") } # Detect power dip if STDZOK is YES, STDZ is enabled, and IACT is valid # If IACT drops below STDZIACTMAX by more than the trim tolerance, clear STDZOK # Warning: Take the absolute value of the trim tolerance, or else quads of # negative polarity will always lose STDZ since their IDELTAS.I are negative. # Note: Large quads and bends are prone to losing STDZ even if they are # perturbed toward higher current since their current tends to overshoot # by greater than the trim tolerance before settling down. record(calcout, "QUAD:LTUS:430:CHECKPWRDIP") { field(DESC, "Detect power dip") field(CALC, "(A-B>ABS(C))?3:0") field(DISV, "0") field(SDIS, "QUAD:LTUS:430:CHECKPWRDIP_ENABLE") field(INPA, "QUAD:LTUS:430:STDZIACTMAX") field(INPB, "QUAD:LTUS:430:IACT") field(INPC, "QUAD:LTUS:430:IDELTAS.I") field(OUT, "QUAD:LTUS:430:STDZLOSTGO.SELN PP NMS") field(OOPT, "When Non-zero") } # Enable processing of STDZIACTMAX and CHECKPWRDIP only if # STDZOK = YES, STDZDISABLE = NO, CTRL != Trim (2), and # CTRL != Stdz (4) record(calc, "QUAD:LTUS:430:CHECKPWRDIP_ENABLE") { field(CALC, "A&&!B&&(C#2)&&(C#4)") field(INPA, "QUAD:LTUS:430:STDZOK.RVAL CP") field(INPB, "QUAD:LTUS:430:STDZDISABLE.RVAL CP") field(INPC, "QUAD:LTUS:430:CTRL.RVAL CP") } #! 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, "QUAD:LTUS:430: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, "QUAD:LTUS:430: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, "QUAD:LTUS:430:CALBSET") { field(DESC, "Use DAC Calbration") field(SCAN, "10 second") field(CALC, "A&&(B==0)&&C?31:960") field(INPA, "QUAD:LTUS:430:CALBOK") field(INPB, "QUAD:LTUS:430:CALBDISABLE") field(INPC, "QUAD:LTUS:430:CALBSLOPE") field(OOPT, "On Change") field(OUT, "QUAD:LTUS:430: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, "QUAD:LTUS:430:CALB_SEQ") { field(DESC, "Output Calib Values") field(SELM, "Mask") field(SELL, "QUAD:LTUS:430: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, "QUAD:LTUS:430:CALBSLOPE") field(DOL3, "QUAD:LTUS:430: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, "QUAD:LTUS:430:CALBTOD") { field(DESC, "Calibration Success Time") field(PINI, "YES") # field(DOL, "") field(OMSL, "supervisory") field(DTYP, "Soft Channel") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:430: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, "QUAD:LTUS:430: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, "QUAD:LTUS:430: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, "QUAD:LTUS:430:CALBOFFSET") { field(DESC, "Calc DAC Offset") field(PREC, "6") field(EGU, "Counts") field(PINI, "YES") } record(bo, "QUAD:LTUS:430: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, "QUAD:LTUS:430:DACSLOPE") { field(DESC, "V to DAC slope") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "supervisory") field(PINI, "YES") field(FLNK, "QUAD:LTUS:430:DACOFFSET") } # Default Offset used in conversion from Volts to DAC Counts record(ao, "QUAD:LTUS:430:DACOFFSET") { field(DESC, "V to DAC offset") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "supervisory") field(PINI, "YES") field(FLNK, "QUAD:LTUS:430: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, "QUAD:LTUS:430: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, "QUAD:LTUS:430:IACT") field(INPD, "QUAD:LTUS:430:DACSLOPE") field(INPE, "QUAD:LTUS:430:DACOFFSET") field(EGU, "Counts") field(PREC, "6") } record(ao, "QUAD:LTUS:430:DAC") { field(DESC, "DAC Set point") field(EGU, "Counts") field(DOL, "") field(OMSL, "supervisory") field(PREC, "6") field(PINI, "YES") } record(ao, "QUAD:LTUS:430:CALBIMIN") { field(DESC, "Calibration Min Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(DRVH, "165.0") field(HOPR, "165.0") field(DRVL, "0.0") field(LOPR, "0.0") field(PREC, "3") field(EGU, "A") field(VAL, "0.0") field(FLNK, "QUAD:LTUS:430:CALBIMAX") } record(ao, "QUAD:LTUS:430:CALBIMAX") { field(DESC, "Calibration Max Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(DRVH, "165.0") field(HOPR, "165.0") field(LOPR, "0.0") field(DRVL, "0.0") field(EGU, "A") field(VAL, "165.0") field(FLNK, "QUAD:LTUS:430:CALBSTEPNUM") } record(ao, "QUAD:LTUS:430:CALBIFINAL") { field(DESC, "Calibration Last Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(PREC, "3") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(VAL, "0") } record(longout, "QUAD:LTUS:430: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, "QUAD:LTUS:430:CALBIDELTA") } record(calc, "QUAD:LTUS:430:CALBIDELTA") { field(DESC, "Step size for CALB") field(CALC, "C=0?0:ABS((A-B)/C)") field(INPA, "QUAD:LTUS:430:CALBIMAX") field(INPB, "QUAD:LTUS:430:CALBIMIN") field(INPC, "QUAD:LTUS:430: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, "QUAD:LTUS:430:CALBIMULT") { field(DESC, "IACT vs ISETPT mult") field(CALC, "C#0||A=0?1:ABS(B/A)") field(INPA, "QUAD:LTUS:235:ISETPT.DRVH") field(INPB, "QUAD:LTUS:235:IACT.HOPR") field(INPC, "QUAD:LTUS:430:PSCONTROLLER.RVAL CPP") field(EGU, "A") field(PINI, "YES") } # SNL dbputs DAC values here. 6-10 steps are possible. record(waveform, "QUAD:LTUS:430:CALBICTRLWF") { field(DESC, "ICTRL setpoint array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") } record(waveform, "QUAD:LTUS:430:DACWF") { field(DESC, "DAC count array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:430:DACSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:430:DACSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "QUAD:LTUS:430: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, "QUAD:LTUS:430:CALCDACWF") { field(DESC, "Calc DAC counts array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:430:CALCDACSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:430:CALCDACSA") { field(DESC, "Calc DAC counts") field(DTYP, "Soft Channel") field(INP, "QUAD:LTUS:430: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, "QUAD:LTUS:430:CALBYWF") { field(DESC, "mx + b") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:430:CALBYSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:430:CALBYSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "QUAD:LTUS:430:CALBYWF") field(MALM, "10") field(NELM, "6") field(INDX, "0") field(FTVL, "DOUBLE") } record(waveform, "QUAD:LTUS:430:CALBIACTWF") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:430:CALBIACTSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:430:CALBIACTSA") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(MALM, "10") field(NELM, "6") field(INP, "QUAD:LTUS:430:CALBIACTWF") field(INDX, "0") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:430:CALBLIMITS") } # Check that measured current during calibration is within # tolerance. record(aSub, "QUAD:LTUS:430: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, "QUAD:LTUS:430:CALBSTEPNUM") field(INPB, "QUAD:LTUS:430:CALBIACTWF") field(INPC, "QUAD:LTUS:430: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, "QUAD:LTUS:430: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, "QUAD:LTUS:430:STDZITOL") field(INPH, "QUAD:LTUS:430:DACSLOPE") field(INPI, "QUAD:LTUS:430: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, "QUAD:LTUS:430: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, "QUAD:LTUS:430:CALBSTEPNUM") field(INPB, "QUAD:LTUS:430:CALBIACTWF") field(INPC, "QUAD:LTUS:430:DACWF") field(INPF, "QUAD:LTUS:430: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 QUAD:LTUS:430CALBOK 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, "QUAD:LTUS:430:DEGAUSINIT") { field(DESC, "Proc. Degauss PVs on boot") field(PINI, "YES") field(DOL, "1") field(OUTA, "QUAD:LTUS:430:DEGAUSIMIN.PROC PP") field(OUTB, "QUAD:LTUS:430:DEGAUSIMAX.PROC PP") field(OUTC, "QUAD:LTUS:430:DEGAUSTYPE.PROC PP") field(OUTD, "QUAD:LTUS:430:DEGAUSSTEP.PROC PP") field(OUTE, "QUAD:LTUS:430:MADNAME.PROC PP") field(OUTF, "QUAD:LTUS:430:PSTYPE.PROC PP") field(OUTG, "QUAD:LTUS:430: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, "QUAD:LTUS:430:DEGAUSSUB") { field(DESC, "Degauss subroutine") field(INAM, "mgntDegaussInit") field(SNAM, "mgntDegauss") field(BRSV, "INVALID") field(INPA, "QUAD:LTUS:430:DEGAUSIMIN NPP NMS") field(INPB, "QUAD:LTUS:430:DEGAUSIMAX NPP NMS") field(INPC, "QUAD:LTUS:430:DEGAUSTYPE.RVAL NPP NMS") field(INPE, "QUAD:LTUS:430:DEGAUSMETHOD.RVAL NPP NMS") field(INPF, "QUAD:LTUS:430:PSTYPE NPP NMS") field(INPG, "QUAD:LTUS:430:DEBUG.RVAL NPP NMS") field(INPH, "QUAD:LTUS:430: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, "QUAD:LTUS:430:DEGAUSWF PP") field(OUTB, "QUAD:LTUS:430:DEGAUSMSG PP") field(OUTC, "QUAD:LTUS:430: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, "QUAD:LTUS:430:DEGAUSWF") { field(DESC, "Degauss Setpts") field(NELM, "60") field(FTVL, "DOUBLE") } record(mbbo,"QUAD:LTUS:430: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, "QUAD:LTUS:430: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, "QUAD:LTUS:430: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, "QUAD:LTUS:430: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, "QUAD:LTUS:430: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, "QUAD:LTUS:430:DEGAUSIMIN") { field(DESC, "Min. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "165.0") field(LOPR, "-165.0") field(DRVH, "165.0") field(DRVL, "-165.0") field(VAL, "-165.0") } record(ao, "QUAD:LTUS:430:DEGAUSIMAX") { field(DESC, "Max. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "165.0") field(LOPR, "-165.0") field(DRVH, "165.0") field(DRVL, "-165.0") field(VAL, "165.0") } # 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,"QUAD:LTUS:430: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, "QUAD:LTUS:430: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,"QUAD:LTUS:430: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, "QUAD:LTUS:430: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, "QUAD:LTUS:430: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, "QUAD:LTUS:430: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, "QUAD:LTUS:430:DEGAUSTOD") { field(DESC, "Successful Degauss Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "QUAD:LTUS:430:DEGAUSLOSTTOD") { field(DESC, "Degauss Lost Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:430:DEGAUSTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "QUAD:LTUS:430:DEGAUSTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "QUAD:LTUS:430: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, "QUAD:LTUS:430:DEGAUSGO") { field(DESC, "Set bdes of btrms to zero") field(ASG, "Internal") field(OUTA, "") field(OUTB, "") field(OUTC, "") field(OUTD, "") } # =========== CRYO ONLY =========== record(bo, "QUAD:LTUS:430: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, "QUAD:LTUS:430:DEGAUS_IMAX_CHECK") { field(DESC, "Check if imax shoud chg") field(CALC, "(C==4)&&(ABS(B)>ABS(A))?1:0") field(INPA, "QUAD:LTUS:430:DEGAUS_IMAX") field(INPB, "QUAD:LTUS:430:ISETPT") field(INPC, "QUAD:LTUS:430:DEGAUSTYPE.RVAL") field(OUT, "QUAD:LTUS:430:DEGAUS_IMAX_UPDATE.SELN") field(FLNK, "QUAD:LTUS:430:DEGAUS_IMAX_UPDATE") } record(seq, "QUAD:LTUS:430:DEGAUS_IMAX_UPDATE") { field(DESC, "Degauss IMAX Update") field(SELM, "Specified") field(DOL1, "QUAD:LTUS:430:ISETPT") field(LNK1, "QUAD:LTUS:430:DEGAUS_IMAX PP") } # Set the maximum current after a successful # degauss. This pv is updated by the # sequence. record(ao, "QUAD:LTUS:430:DEGAUS_IMAX") { field(DESC, "Max I set afer a degauss") field(EGU, "Amps") field(PINI, "YES") field(PREC, "6") field(HOPR, "165.0") field(LOPR, "-165.0") field(DRVH, "165.0") field(DRVL, "-165.0") field(VAL, "165.0") field(FLNK, "QUAD:LTUS:430:DEGAUS_IMAXPOL_CHECK") info(autosaveFields,"VAL,RVAL") } # Set the polarity if degauss_imax record(calcout, "QUAD:LTUS:430:DEGAUS_IMAXPOL_CHECK") { field(DESC, "Determine polarity of imax") field(CALC, "A>=0?0:1") field(INPA, "QUAD:LTUS:430:DEGAUS_IMAX") field(FLNK, "QUAD:LTUS:430:DEGAUS_IMAXPOL") } record(bo, "QUAD:LTUS:430:DEGAUS_IMAXPOL") { field(DESC, "Polarity of imax I") field(DTYP, "Raw Soft Channel") field(DOL, "QUAD:LTUS:430:DEGAUS_IMAXPOL_CHECK") field(OMSL, "closed_loop") field(ZNAM, "Positive") field(ONAM, "Negative") field(FLNK, "QUAD:LTUS:430: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, "QUAD:LTUS:430:DEGAUS_ABSIMAX") { field(DESC, "Absolute Max. Degauss I") field(CALC, "ABS(A)") field(INPA, "QUAD:LTUS:430:DEGAUS_IMAX") field(PREC, "6") field(EGU, "Amps") field(HOPR, "165.0") field(LOPR, "-165.0") info(autosaveFields,"VAL RVAL") } # IACT Polarity record(calcout, "QUAD:LTUS:430:IACTPOL_CHECK") { field(DESC, "Determine IACT polarity") field(SCAN, "5 second") field(CALC, "ABS(A-B)>C?(A>=0?0:1):D") field(INPA, "QUAD:LTUS:430:IACT") field(INPB, "QUAD:LTUS:430:IACTPOL_CHECK.LA") field(INPC, "0.0001") field(INPD, "QUAD:LTUS:430:IACTPOL_CHECK.PVAL") field(OOPT, "On Change") field(FLNK, "QUAD:LTUS:430:IACTPOL") } record(bo, "QUAD:LTUS:430: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,"QUAD:LTUS:430: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, "QUAD:LTUS:430:DEGAUSENABLE CP") field(INPB, "QUAD:LTUS:430:DEGAUSOK") field(INPC, "QUAD:LTUS:430:STATE CP") field(INPD, "QUAD:LTUS:430:STATE.SEVR") field(OUT, "QUAD:LTUS:430:DEGAUS_STATE_SEQ.SELN PP") field(ASG, "Internal") } record(seq, "QUAD:LTUS:430:DEGAUS_STATE_SEQ") { field(DESC, "Degauss State Sequence") field(SELM, "Specified") field(SELL, "QUAD:LTUS:430:DEGAUS_STATE_CHECK") field(LNK1, "QUAD:LTUS:430:DEGAUS_STATE_DISABLE.PROC PP") field(LNK2, "QUAD:LTUS:430:DEGAUS_STATE_LOST.PROC PP") field(LNK3, "QUAD:LTUS:430:DEGAUS_STATE_GOOD.PROC PP") field(LNK4, "QUAD:LTUS:430: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, "QUAD:LTUS:430:DEGAUS_STATE_DISABLE") { field(DESC, "Degauss not used") field(LNK1, "QUAD:LTUS:430:DEGAUSOK.ZSV") field(LNK2, "QUAD:LTUS:430: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, "QUAD:LTUS:430:STATMSG.FRSV") field(LNK4, "QUAD:LTUS:430: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, "QUAD:LTUS:430:DEGAUS_STATE_LOST") { field(DESC, "Degauss lost and ps On") field(DOL1, "1") field(LNK1, "QUAD:LTUS:430:DEGAUSOK.ZSV") field(LNK2, "QUAD:LTUS:430: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, "QUAD:LTUS:430:STATMSG.FRSV") field(LNK4, "QUAD:LTUS:430: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, "QUAD:LTUS:430:DEGAUS_STATE_OFF") { field(DESC, "Degaused lost and ps Off") field(DOL1, "2") field(LNK1, "QUAD:LTUS:430: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, "QUAD:LTUS:430:STATMSG.FRSV") field(LNK3, "QUAD:LTUS:430: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, "QUAD:LTUS:430:DEGAUS_STATE_GOOD") { field(DESC, "Degauss good") field(DOL1, "1") field(LNK1, "QUAD:LTUS:430: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, "QUAD:LTUS:430:STATMSG.FRSV PP") field(LNK3, "QUAD:LTUS:430:STATMSG.FVSV PP") field(LNK4, "") field(ASG, "Internal") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(mbbo, "QUAD:LTUS:430:FUNC") { field(DESC, "QUAD:LTUS:430 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, "0") field(FFVL, "0") field(OUT, "QUAD:LTUS:430:CTRL CA") } # :CTRL pv is processed at boot in the # sequence mgntCtrl.st Processed in sequence # record(mbbo, "QUAD:LTUS:430:CTRL") { field(DESC, "QUAD:LTUS:430 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, "QUAD:LTUS:430:SELECTEN.A PP") field(SDIS, "0") } # If a function has been selected set this unit to busy record(calcout, "QUAD:LTUS:430:SELECTEN") { field(DESC, "Control Select Enable") field(CALC, "A>0?1:A") field(FLNK, "QUAD:LTUS:430:BUSY") } # Set to FREE on IOC reboot record(bo, "QUAD:LTUS:430:BUSY") { field(DESC, "QUAD:LTUS:430 Ctrl Done") field(DOL, "QUAD:LTUS:430:SELECTEN") field(ZNAM, "FREE") field(ONAM, "BUSY") field(PINI, "YES") field(FLNK, "QUAD:LTUS:430:SELECT") } record(bo, "QUAD:LTUS:430:SELECT") { field(ZNAM, "NO") field(ONAM, "YES") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") } record(bo, "QUAD:LTUS:430: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, "QUAD:LTUS:430:CTRLSTATE") { field(DESC, "QUAD:LTUS:430 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("QUAD:LTUS:430:CTRL",20,20,0,0,"QUAD:LTUS:430:CTRL") #! Field("QUAD:LTUS:430:CTRL.OUT",16777215,1,"QUAD:LTUS:430:CTRL.OUT") #! Link("QUAD:LTUS:430:CTRL.OUT","QUAD:LTUS:430:SELECTEN.A") #! Field("QUAD:LTUS:430:CTRL.VAL",16777215,1,"QUAD:LTUS:430:CTRL.VAL") #! Record("QUAD:LTUS:430:SELECTEN",321,381,0,0,"QUAD:LTUS:430:SELECTEN") #! Field("QUAD:LTUS:430:SELECTEN.A",16777215,0,"QUAD:LTUS:430:SELECTEN.A") #! Field("QUAD:LTUS:430:SELECTEN.FLNK",16777215,1,"QUAD:LTUS:430:SELECTEN.FLNK") #! Link("QUAD:LTUS:430:SELECTEN.FLNK","QUAD:LTUS:430:BUSY") #! Field("QUAD:LTUS:430:SELECTEN.VAL",16777215,1,"QUAD:LTUS:430:SELECTEN.VAL") #! Record("QUAD:LTUS:430:BUSY",623,274,0,0,"QUAD:LTUS:430:BUSY") #! Field("QUAD:LTUS:430:BUSY.DOL",16777215,0,"QUAD:LTUS:430:BUSY.DOL") #! Link("QUAD:LTUS:430:BUSY.DOL","QUAD:LTUS:430:SELECTEN.VAL") #! Field("QUAD:LTUS:430:BUSY.FLNK",16777215,1,"QUAD:LTUS:430:BUSY.FLNK") #! Link("QUAD:LTUS:430:BUSY.FLNK","QUAD:LTUS:430:SELECT") #! Record("QUAD:LTUS:430:SELECT",669,508,0,1,"QUAD:LTUS:430:SELECT") #! Record("QUAD:LTUS:430:FUNC",940,120,0,0,"QUAD:LTUS:430:FUNC") #! Field("QUAD:LTUS:430:FUNC.OUT",16777215,0,"QUAD:LTUS:430:FUNC.OUT") #! Link("QUAD:LTUS:430:FUNC.OUT","QUAD:LTUS:430:CTRL.VAL") #! Record("QUAD:LTUS:430:ABORT",193,41,0,0,"QUAD:LTUS:430:ABORT") #! Record("QUAD:LTUS:430:CTRLSTATE",369,34,0,0,"QUAD:LTUS:430: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,"QUAD:LTUS:430:SELECT is used for Multi-device selection.\nIt is enabled when associated QUAD:LTUS:430:CTRL is \"0\" (DONE).\nIt is disabled when associated QUAD:LTUS:430: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,"QUAD:LTUS:430: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, "QUAD:LTUS:430:BCTRL_INIT") { field(DESC, "Process BCTRL on boot") field(PINI, "YES") field(CALC, "A=3?1:0") field(INPA, "QUAD:LTUS:430:BCTRL.SEVR") field(OUT, "QUAD:LTUS:430: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, "QUAD:LTUS:430:BACT") { field(DESC, "Actual B") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "QUAD:LTUS:430:BACT") field(INPB, "QUAD:LTUS:430:POLYCOEF") field(INPC, "QUAD:LTUS:430:POLYCOEF.A") field(INPD, "QUAD:LTUS:430:POLYCOEF.B") field(INPE, "QUAD:LTUS:430:IACT MS") field(INPF, "QUAD:LTUS:430:BDELTAS PP") field(INPG, "100") field(EGU, "kG") field(HOPR, "-0.2914") field(LOPR, "-51.6681") field(HIHI, "-0.2914") field(LOLO, "-51.6681") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "-0.2914") field(LOW, "-51.6681") field(FLNK, "QUAD:LTUS:430: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, "QUAD:LTUS:430:BDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntPhyDeltas") field(EGU, "kG") field(HOPR, "1") field(PREC, "7") field(BRSV, "INVALID") field(INPA, "QUAD:LTUS:430:BDES") field(INPB, "QUAD:LTUS:430:TRIMBTOL") field(INPC, "QUAD:LTUS:430:TRIMBTOLR") field(INPD, "QUAD:LTUS:430:CHCKBTOL") field(INPE, "QUAD:LTUS:430:CHCKBTOLR") field(F, "2.0") field(INPG, "30") field(INPH, "QUAD:LTUS:430:BACT.VAL") # # MPS absolute and relative tolerances field(INPP, "QUAD:LTUS:430:MPSBTOL") field(INPQ, "QUAD:LTUS:430:MPSBTOLR") field(FLNK, "QUAD:LTUS:430:BCONLIMITS") info(autosaveFields,"F") } # This record is processed by BDELTAS record(aSub, "QUAD:LTUS:430:BCONLIMITS") { field(DESC, "Config B-field Limits") field(INAM, "mgntInit") field(SNAM, "mgntBCONLimits") field(INPA, "QUAD:LTUS:430:BDES") field(INPB, "QUAD:LTUS:430:BDELTAS.I") field(INPG, "QUAD:LTUS:430:DEBUG.RVAL") field(FTA, "DOUBLE") field(FTB, "DOUBLE") field(FTG, "ULONG") field(OUTA, "QUAD:LTUS:430:BCON.HIGH") field(OUTB, "QUAD:LTUS:430:BCON.LOW") field(OUTC, "QUAD:LTUS:430:BCON.HIHI") field(OUTD, "QUAD:LTUS:430:BCON.LOLO PP") field(FTVA, "DOUBLE") field(FTVB, "DOUBLE") field(FTVC, "DOUBLE") field(FTVD, "DOUBLE") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:430:IDELTAS") } # The following PV is processed by :BACT # which is processed by :BACT # record(fanout, "QUAD:LTUS:430:BACTFO") { field(DESC, "BACT processing") field(SELM, "All") field(LNK1, "QUAD:LTUS:430:BDIFF") field(LNK2, "QUAD:LTUS:430:BADIFF") field(LNK3, "QUAD:LTUS:430:BRATIO") field(LNK4, "QUAD:LTUS:430:MPSLIMITS") field(LNK5, "QUAD:LTUS:430:I2BSTATUS") field(LNK6, "QUAD:LTUS:430:IACTFO.PROC") } record(calc, "QUAD:LTUS:430:BDIFF") { field(DESC, "BDES-BACT") field(CALC, "A-B") field(INPA, "QUAD:LTUS:430:BDES") field(INPB, "QUAD:LTUS:430:BACT") field(EGU, "kG") field(PREC, "7") } record(calc, "QUAD:LTUS:430:BADIFF") { field(DESC, "Absolute BDES-BACT") field(INPA, "QUAD:LTUS:430:BDIFF") field(EGU, "kG") field(PREC, "7") field(CALC, "A<0?ABS(A):A") } record(calc, "QUAD:LTUS:430:BRATIO") { field(DESC, "BACT Error") field(CALC, "B?A/B:0") field(INPA, "QUAD:LTUS:430:BDIFF") field(INPB, "QUAD:LTUS:430:BDES.HOPR") field(EGU, "kG") field(PREC, "7") } record(mbbi, "QUAD:LTUS:430: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, "QUAD:LTUS:430:BACT.J") } # Note: for a string slave set the MONFL # macro to the following: # MONFL=:IMONCALC MS record(sub, "QUAD:LTUS:430:BMON") { field(DESC, "Second Transductor") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "QUAD:LTUS:430:BMON") field(INPB, "QUAD:LTUS:430:POLYCOEF") field(INPC, "QUAD:LTUS:430:POLYCOEF.A") field(INPD, "QUAD:LTUS:430:POLYCOEF.B") field(INPE, "QUAD:LTUS:430:IMON MS") field(INPF, "QUAD:LTUS:430:BDELTAS.VAL") field(INPG, "100") field(EGU, "kG") field(HOPR, "-0.2914") field(LOPR, "-51.6681") field(HIHI, "-0.2914") field(LOLO, "-51.6681") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "-0.2914") field(LOW, "-51.6681") } # 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=QUAD:LTUS:235:BDES CP record(ao, "QUAD:LTUS:430:BDES") { field(DESC, "Desired B-Field") field(PINI, "NO") field(DRVH, "-0.2914") field(DRVL, "-51.6681") field(HOPR, "-0.2914") field(LOPR, "-51.6681") field(PREC, "7") field(EGU, "kG") field(MDEL, "-1") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:430:IDES2BDES") field(OUT, "QUAD:LTUS:430:B2IDES PP") info(autosaveFields,"VAL") } record(sub, "QUAD:LTUS:430:B2IDES") { field(DESC, "Convert Desired B-Field to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:430:POLYCOEF") field(INPC, "QUAD:LTUS:430:POLYCOEF.A") field(INPD, "QUAD:LTUS:430:POLYCOEF.B") field(PREC, "7") field(EGU, "kG") field(HOPR, "-0.2914") field(LOPR, "-51.6681") field(MDEL, "-1") field(INPE, "QUAD:LTUS:430:BDES.DRVH") field(INPF, "QUAD:LTUS:430:BDES.DRVL") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:430:IDES") } record(sub, "QUAD:LTUS:430:BNOM") { field(DESC, "Nominal Field") field(PINI, "YES") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:430:POLYCOEF") field(INPC, "QUAD:LTUS:430:POLYCOEF.A") field(INPD, "QUAD:LTUS:430:POLYCOEF.B") field(INPE, "QUAD:LTUS:430:BDES.DRVH") field(INPF, "QUAD:LTUS:430:BDES.DRVL") field(EGU, "kG") field(HOPR, "-0.2914") field(LOPR, "-51.6681") field(PREC, "7") field(VAL, "0.0") field(FLNK, "QUAD:LTUS:430:INOM") } record(sub, "QUAD:LTUS:430:BACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:430:BDES.VAL") field(INPB, "QUAD:LTUS:430:BDES.DRVH") field(INPC, "QUAD:LTUS:430:BDES.DRVL") field(INPD, "QUAD:LTUS:430:BDELTAS.I") field(INPE, "QUAD:LTUS:430:BDELTAS.J") field(INPG, "QUAD:LTUS:430:STATE") field(INPH, "QUAD:LTUS:430:HSTA") field(EGU, "kG") field(HOPR, "-0.2914") field(LOPR, "-51.6681") field(PREC, "7") field(BRSV, "INVALID") } record(sub, "QUAD:LTUS:430:BMONLIMITS") { field(DESC, "MON Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:430:BDES.VAL") field(INPB, "QUAD:LTUS:430:BDES.DRVH") field(INPC, "QUAD:LTUS:430:BDES.DRVL") field(INPD, "QUAD:LTUS:430:BDELTAS.K") field(INPE, "QUAD:LTUS:430:BDELTAS.L") field(INPG, "QUAD:LTUS:430:STATE") field(INPH, "QUAD:LTUS:430:HSTA") field(EGU, "kG") field(HOPR, "-0.2914") field(LOPR, "-51.6681") field(PREC, "7") field(BRSV, "INVALID") } record(seq, "QUAD:LTUS:430:BLIMITS") { field(DESC, "ACT Limits") field(PREC, "7") field(DOL1, "QUAD:LTUS:430:BLIMITS") field(LNK1, "QUAD:LTUS:430:BACTLIMITS.F PP") field(DOL2, "QUAD:LTUS:430:BACTLIMITS.I") field(LNK2, "QUAD:LTUS:430:BACT.HIGH") field(DOL3, "QUAD:LTUS:430:BACTLIMITS.J") field(LNK3, "QUAD:LTUS:430:BACT.LOW") field(DOL4, "QUAD:LTUS:430:BACTLIMITS.K") field(LNK4, "QUAD:LTUS:430:BACT.HIHI") field(DOL5, "QUAD:LTUS:430:BACTLIMITS.L") field(LNK5, "QUAD:LTUS:430:BACT.LOLO") field(DOL6, "QUAD:LTUS:430:BLIMITS") field(LNK6, "QUAD:LTUS:430:BMONLIMITS.F PP") field(DOL7, "QUAD:LTUS:430:BMONLIMITS.I") field(LNK7, "QUAD:LTUS:430:BMON.HIGH") field(DOL8, "QUAD:LTUS:430:BMONLIMITS.J") field(LNK8, "QUAD:LTUS:430:BMON.LOW") field(DOL9, "QUAD:LTUS:430:BMONLIMITS.K") field(LNK9, "QUAD:LTUS:430:BMON.HIHI") field(DOLA, "QUAD:LTUS:430:BMONLIMITS.L") field(LNKA, "QUAD:LTUS:430:BMON.LOLO") field(FLNK, "QUAD:LTUS:430:ILIMITS") field(SCAN, "5 second") } record(ao, "QUAD:LTUS:430:BCTRL") { field(DESC, "B-Perturb") field(PREC, "7") field(EGU, "kG") field(DRVH, "-0.2914") field(DRVL, "-51.6681") field(HOPR, "-0.2914") field(LOPR, "-51.6681") # 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, "QUAD:LTUS:430: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, "QUAD:LTUS:430:BCTRLGO") { field(DESC, "Update DES and perturb") field(PREC, "7") # Disable BACT limits field(DOL1, "1") field(LNK1, "QUAD:LTUS:430:BLIMITS.VAL") # Update BDES with the BCTRL (slider) value field(DOL2, "QUAD:LTUS:430:BCTRL.VAL") field(LNK2, "QUAD:LTUS:430:BDES PP") field(DOL3, "1") field(LNK3, "QUAD:LTUS:430:IDIRECT.PROC PP") field(DOL4, "1") field(LNK4, "QUAD:LTUS:430:CHECKSTDZLOST.PROC PP") field(DOL5, "QUAD:LTUS:430:BCTRL.VAL") field(LNK5, "QUAD:LTUS:430:BCTRLSUB PP") # Re-enable BACT limits field(DOL6, "0") field(LNK6, "QUAD:LTUS:430:BLIMITS.VAL") } # Convert B-field to Current and output to ISETPT record(sub, "QUAD:LTUS:430:BCTRLSUB") { field(DESC, "Feedback") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:430:POLYCOEF") field(INPC, "QUAD:LTUS:430:POLYCOEF.A") field(INPD, "QUAD:LTUS:430:POLYCOEF.B") field(INPE, "QUAD:LTUS:430:BDES.DRVH") field(INPF, "QUAD:LTUS:430:BDES.DRVL") field(PREC, "7") field(EGU, "kG") field(HOPR, "-0.2914") field(LOPR, "-51.6681") field(MDEL, "-1") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:430:ISETPT") } record(ao, "QUAD:LTUS:430:BDESPREVTRIM") { field(DESC, "trim bdes for undo") field(DTYP, "Soft Channel") field(DRVH, "-0.2914") field(DRVL, "-51.6681") field(EGU, "kG") field(HOPR, "-0.2914") field(LOPR, "-51.6681") field(PREC, "7") field(PINI, "YES") info(autosaveFields,"VAL") } record(stringin, "QUAD:LTUS:430:MADNAME") { field(DESC, "MAD deck nomenclature") field(PINI, "YES") field(VAL, "QDL18") } record(ai, "QUAD:LTUS:430: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, "3329.8506") } record(ao, "QUAD:LTUS:430:BMAX") { field(DESC, "Max B-Field") field(DTYP, "Soft Channel") field(DRVH, "-0.2914") field(DRVL, "-51.6681") field(EGU, "kG") field(HOPR, "-0.2914") field(LOPR, "-51.6681") field(PREC, "7") field(PINI, "YES") field(VAL, "-0.2914") field(FLNK, "QUAD:LTUS:430:BSTEP") } record(ao, "QUAD:LTUS:430:BMIN") { field(DESC, "Min B-Field") field(DTYP, "Soft Channel") field(DRVH, "-0.2914") field(DRVL, "-51.6681") field(EGU, "kG") field(HOPR, "-0.2914") field(LOPR, "-51.6681") field(PREC, "7") field(PINI, "YES") field(VAL, "-51.6681") field(FLNK, "QUAD:LTUS:430:BSTEP") } record(ao, "QUAD:LTUS:430:BDESSAVE") { field(DESC, "bdes for save/load") field(DTYP, "Soft Channel") field(DRVH, "-0.2914") field(DRVL, "-51.6681") field(EGU, "kG") field(HOPR, "-0.2914") field(LOPR, "-51.6681") field(PINI, "YES") field(PREC, "7") } # This record is processed by QUAD:LTUS:430: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, "QUAD:LTUS:430:BCON") { field(DESC, "Config B-Field ") field(DTYP, "Soft Channel") field(PREC, "7") field(EGU, "kG") field(HOPR, "-0.2914") field(LOPR, "-51.6681") field(DRVH, "-0.2914") field(DRVL, "-51.6681") # 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 , "QUAD:LTUS:430:ICON2BCON") field(OMSL, "closed_loop") field(OUT, "QUAD:LTUS:430:B2ICON PP") info(autosaveFields,"VAL") } record(sub, "QUAD:LTUS:430:B2ICON") { field(DESC, "Convert Desired ICon to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:430:POLYCOEF") field(INPC, "QUAD:LTUS:430:POLYCOEF.A") field(INPD, "QUAD:LTUS:430:POLYCOEF.B") field(PREC, "7") field(EGU, "kG") field(HOPR, "-0.2914") field(LOPR, "-51.6681") field(MDEL, "-1") field(INPE, "QUAD:LTUS:430:BCON.DRVH") field(INPF, "QUAD:LTUS:430:BCON.DRVL") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:430: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, "QUAD:LTUS:430:BSTEP") { field(DESC, "B-Field step size") field(CALC, "(C==3)||(D==3)?0:ABS(A-B)*0.005") field(INPA, "QUAD:LTUS:430:BMAX") field(INPB, "QUAD:LTUS:430:BMIN") field(INPC, "QUAD:LTUS:430:BMIN.SEVR") field(INPD, "QUAD:LTUS:430:BMAX.SEVR") field(EGU, "kG") 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,"QUAD:LTUS:430:BCTRLDISABLECALC") { field(DESC, "Calc for disabling BCTRL") field(ASG, "Internal") field(CALC, "A?2:1") field(INPA, "QUAD:LTUS:430:ONLINE CP") field(OUT, "QUAD:LTUS:430:BCTRLDISABLEFOUT PP") } record(fanout, "QUAD:LTUS:430:BCTRLDISABLEFOUT") { field(DESC, "Disable BCTRL fanout") field(SELM, "Specified") field(SELL, "QUAD:LTUS:430:BCTRLDISABLECALC") field(LNK1, "QUAD:LTUS:430:BCTRLDISABLE") field(LNK2, "QUAD:LTUS:430:BCTRLENABLE") } record(stringout, "QUAD:LTUS:430:BCTRLDISABLE") { field(DESC, "Disable BCTRL") field(DTYP, "Soft Channel") field(OUT, "QUAD:LTUS:430:BCTRL.ASG") field(VAL, "NOWRITE") field(FLNK, "QUAD:LTUS:430:BCTRLDISV_UPDATE") } record(stringout, "QUAD:LTUS:430:BCTRLENABLE") { field(DESC, "Enable BCTRL") field(DTYP, "Soft Channel") field(OUT, "QUAD:LTUS:430:BCTRL.ASG") field(VAL, "") field(FLNK, "QUAD:LTUS:430:BCTRLDISV_UPDATE") } record(calcout, "QUAD:LTUS:430:BCTRLDISV_UPDATE") { field(DESC, "Calc for updating BCTRL.DISV") field(ASG, "Internal") field(CALC, "A") field(INPA, "QUAD:LTUS:430:ONLINE") field(OUT, "QUAD:LTUS:430: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,"QUAD:LTUS:430:BACT and MON\n are processed via links from \n QUAD:LTUS:430:IACT (device raw value readback 1)\n and\n QUAD:LTUS:430: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 QUAD:LTUS:430:POLYCOEF\nC = First polynomial coefficient (offset if linear)\nD = Second polynomial coefficient (slope if linear)\nE = QUAD:LTUS:430: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,"QUAD:LTUS:430:BDES\n is processed when set by CA users or \n QUAD:LTUS:430: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,"QUAD:LTUS:430: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 QUAD:LTUS:430: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 (QUAD:LTUS:430: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,"QUAD:LTUS:430:B*LIMITS and QUAD:LTUS:430:BLIMITS:\n Calculate alarm and warning limits based on \n deltas from QUAD:LTUS:430: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,"QUAD:LTUS:430: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,"QUAD:LTUS:430: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, "QUAD:LTUS:430: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, "QUAD:LTUS:430:MPSBTOL") { field(DESC, "Absolute mps tol") field(EGU, "kG") field(PREC, "2") field(CALC, "ABS(A)*0.02") field(INPA, "QUAD:LTUS:430:BMAX") field(PINI, "YES") } # # 21-Aug-2013: K. Luchini # Set channel access security so that users # cannot easily change values. record(ao, "QUAD:LTUS:430:MPSBMAX") { field(DESC, "MPS Max B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "-0.2914") field(DRVL, "-51.6681") field(PINI, "YES") field(VAL, "-0.2914") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:430:MPSBMIN") { field(DESC, "MPS Min B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "-0.2914") field(DRVL, "-51.6681") field(PINI, "YES") field(VAL, "-51.6681") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:430:MPSBLLIM") { field(DESC, "MPS Low Limit B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "-0.2914") field(DRVL, "-51.6681") field(PINI, "YES") field(VAL, "-51.6681") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:430:MPSBLLIM2") { field(DESC, "MPS Low Limit #2 B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "-0.2914") field(DRVL, "-51.6681") field(PINI, "YES") field(VAL, "-51.6681") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } # Set the default to Std record(mbbo, "QUAD:LTUS:430: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, "QUAD:LTUS:430:MPSLIMITS.E PP") } record(aSub, "QUAD:LTUS:430: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, "QUAD:LTUS:430:MPS.RVAL") field(INPB, "QUAD:LTUS:430:BADIFF") field(INPC, "QUAD:LTUS:430:BDELTAS.N") field(INPD, "QUAD:LTUS:430:BACT") field(INPE, "QUAD:LTUS:430:MPSBITMASK.RVAL") field(INPF, "QUAD:LTUS:430:MPSBLLIM") field(INPG, "QUAD:LTUS:430:MPSBMIN") field(INPH, "QUAD:LTUS:430:MPSBMAX") field(INPI, "QUAD:LTUS:430: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, "QUAD:LTUS:430:INTOL.RVAL PP") field(OUTB, "QUAD:LTUS:430:INTOL_BMIN.RVAL PP") field(OUTC, "QUAD:LTUS:430:INTOL_BRANGE.RVAL PP") field(OUTD, "QUAD:LTUS:430: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, "QUAD:LTUS:430:INTOL") { field(DESC, "BACT within MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:430:MPSLIMITS.VALA") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "QUAD:LTUS:430:INTOL_BMIN") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:430:MPSLIMITS.VALB") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "QUAD:LTUS:430:INTOL_BMIN2") { field(DESC, "MPS tol #2") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:430:MPSLIMITS.VALD") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "QUAD:LTUS:430:INTOL_BRANGE") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:430: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, "QUAD:LTUS:430:CHCKITOL") { field(DESC, "Absolute Check I Tolerance") field(EGU, "A") field(FLNK, "QUAD:LTUS:430:TRIMITOL") field(CALC, "ABS(A*B)") field(INPA, "QUAD:LTUS:430:CHCKBTOL") field(INPB, "QUAD:LTUS:430:POLYCOEF.B") field(PREC, "9") } record(calc, "QUAD:LTUS:430:TRIMBTOL") { field(EGU, "kG") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(DESC, "Absolute Trim Tolerance") field(CALC, "ABS(A)/2") field(INPA, "QUAD:LTUS:430:CHCKBTOL") field(FLNK, "QUAD:LTUS:430:CHCKITOL") } record(calc, "QUAD:LTUS:430:CHCKBTOL") { field(DESC, "Check absolute tolerance") field(EGU, "A") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(FLNK, "QUAD:LTUS:430:TRIMBTOL") field(CALC, "MAX(ABS(A),ABS(C))*(B/1000000)") field(INPA, "QUAD:LTUS:430:BDES.HOPR") field(INPB, "QUAD:LTUS:430:STABILITY") field(INPC, "QUAD:LTUS:430:BDES.LOPR") } record(longout, "QUAD:LTUS:430: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, "QUAD:LTUS:430:CHCKBTOL") } record(calc, "QUAD:LTUS:430:TRIMITOL") { field(DESC, "Absolute Trim I Tolerance") field(EGU, "kG") field(CALC, "ABS(A*B)") field(INPA, "QUAD:LTUS:430:POLYCOEF.B") field(INPB, "QUAD:LTUS:430:TRIMBTOL") field(PREC, "9") } record(ai, "QUAD:LTUS:430:TRIMBTOLR") { field(DESC, "Relative trim tol") field(PREC, "4") field(EGU, "%") field(HOPR, "1.0") field(LOPR, "0.0") field(PINI, "YES") } record(ai, "QUAD:LTUS:430: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, "QUAD:LTUS:430:FBCKFCOM") { field(ZNAM, "CA") field(ONAM, "FCOM") field(DESC, "CA Mode") field(PINI, "YES") field(SDIS, "0") } record(bo, "QUAD:LTUS:430:PAU") { field(ZNAM, "NotConfigured") field(ONAM, "Configured") field(DESC, "PAU Present") field(PINI, "YES") field(SDIS, "0") field(FLNK, "QUAD:LTUS:430:PAUGO") } record(fanout, "QUAD:LTUS:430:PAUGO") { field(DESC, "PAU control") field(LNK1, "QUAD:LTUS:430:PAUSTOP") field(LNK2, "QUAD:LTUS:430: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, "QUAD:LTUS:430:PAUSTART") { field(DESC, "Setup for PAU On") field(SDIS, "QUAD:LTUS:430: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, "QUAD:LTUS:430:PAUSTOP") { field(DESC, "Setup for PAU Off") field(SDIS, "QUAD:LTUS:430: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, "QUAD:LTUS:430:MCORDEVNAME") { field(DESC, "PS device name") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, "QUAD:LTUS:235:") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "QUAD:LTUS:430: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, "QUAD:LTUS:430:PSTYPE.RVAL") field(INPC, "QUAD:LTUS:430:TURNEDOFF.RVAL") field(INPD, "QUAD:LTUS:430:CONFIG.RVAL") field(INPE, "QUAD:LTUS:430:PSCATEGORY.RVAL") field(INPF, "QUAD:LTUS:430:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "QUAD:LTUS:430:AUTOCTRL.RVAL") field(INPJ, "QUAD:LTUS:430:OUTOFSERVICE.RVAL") field(INPL, "QUAD:LTUS:430:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "QUAD:LTUS:430:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "QUAD:LTUS:430:PAU") field(INPP, "QUAD:LTUS:430:CALBDISABLE.RVAL") field(INPQ, "QUAD:LTUS:430:PTRBDISABLE.RVAL") field(INPR, "QUAD:LTUS:430:TRIMDISABLE.RVAL") field(INPS, "QUAD:LTUS:430:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "QUAD:LTUS:430:FBCK") field(INPU, "QUAD:LTUS:430:TRIMTYPE.RVAL") field(INPV, "QUAD:LTUS:430:STDZDIRECT.RVAL") field(INPW, "QUAD:LTUS:430:DEGAUSENABLE.RVAL") field(FLNK, "QUAD:LTUS:430:HSTA") } record(longin, "QUAD:LTUS:430:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "QUAD:LTUS:430:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "QUAD:LTUS:430: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, "QUAD:LTUS:430: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, "QUAD:LTUS:430: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, "QUAD:LTUS:430: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, "QUAD:LTUS:430: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, "QUAD:LTUS:430: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 QUAD:LTUS:430:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses QUAD:LTUS:430:FBCK. # This PV should be replaced by QUAD:LTUS:430: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, "QUAD:LTUS:430: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, "QUAD:LTUS:430: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, "QUAD:LTUS:430: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, "QUAD:LTUS:235:OUTOFSERVICE CPP NMS") field(OMSL, "closed_loop") field(FLNK, "QUAD:LTUS:430:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"QUAD:LTUS:430:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "QUAD:LTUS:430:OUTOFSERVICE NPP NMS") field(OUT, "QUAD:LTUS:430:ONLINE PP") } record(bo, "QUAD:LTUS:430:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "QUAD:LTUS:430: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, "QUAD:LTUS:430: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, "QUAD:LTUS:430: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, "QUAD:LTUS:430: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, "QUAD:LTUS:430: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, "QUAD:LTUS:430: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, "QUAD:LTUS:430: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, "QUAD:LTUS:430: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, "QUAD:LTUS:430: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, "QUAD:LTUS:430: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, "QUAD:LTUS:430: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, "QUAD:LTUS:430:TRIMTYPE") } record(stringout, "QUAD:LTUS:430:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "QUAD:LTUS:235:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "QUAD:LTUS:430:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "QUAD:LTUS:430:STATE.RVAL") field(INPB, "QUAD:LTUS:430:INTLKSUMY.RVAL") field(OUT, "QUAD:LTUS:430:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:LTUS:430: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, "QUAD:LTUS:430:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "QUAD:LTUS:430:STATE.RVAL") field(INPB, "QUAD:LTUS:430:INTLKSUMY.RVAL") field(OUT, "QUAD:LTUS:430:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:LTUS:430:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "QUAD:LTUS:430:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "QUAD:LTUS:430: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, "QUAD:LTUS:430: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, "QUAD:LTUS:430: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, "QUAD:LTUS:430: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,"QUAD:LTUS:430: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("QUAD:LTUS:430:TURNEDOFF",3140,1907,0,1,"QUAD:LTUS:430:TURNEDOFF") #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "QUAD:LTUS:430:STATSUB") { field(DESC, "Build STATus ") field(INAM, "mgntInit") field(SNAM, "mgntSlcStat") field(INPA, "QUAD:LTUS:430:BACT.STAT") field(INPB, "QUAD:LTUS:430:BDES.STAT") field(INPC, "QUAD:LTUS:430: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, "QUAD:LTUS:430:BACT.SEVR") field(INPH, "QUAD:LTUS:430:BDES.SEVR") field(INPI, "QUAD:LTUS:430: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, "QUAD:LTUS:430:STATE.RVAL") field(INPN, "QUAD:LTUS:430:STDZOK") field(INPO, "QUAD:LTUS:430:CALBOK") field(INPP, "QUAD:LTUS:430:OUTOFSERVICE.RVAL") field(INPQ, "QUAD:LTUS:430:CONFIG.RVAL") field(INPR, "QUAD:LTUS:430:HSTA") field(INPS, "QUAD:LTUS:430:CTRL.RVAL") field(INPT, "QUAD:LTUS:430:DEGAUSOK") field(INPV, "QUAD:LTUS:430: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, "QUAD:LTUS:430:STAT") } record(longout, "QUAD:LTUS:430:STAT") { field(DESC, "STAT sent to SLC") field(SCAN, "Passive") field(FLNK, "QUAD:LTUS:430:STATCTRLSUB") field(DOL, "QUAD:LTUS:430:STATSUB.VAL") field(OMSL, "closed_loop") } record(sSub, "QUAD:LTUS:430:STATCTRLSUB") { field(DESC, "Decode SLC STAT into mbbo") field(INAM, "mgntInit") field(SNAM, "mgntStatDecode") field(INPA, "QUAD:LTUS:430:STAT") field(INPB, "QUAD:LTUS:430:HSTA") field(INPD, "QUAD:LTUS:430:ONOFFCTRL.RVAL") field(FLNK, "QUAD:LTUS:430:STATMSG") } record(mbbo, "QUAD:LTUS:430: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, "QUAD:LTUS:430:UNAVAILGO") field(DOL, "QUAD:LTUS:430:STATCTRLSUB.W") } record(seq, "QUAD:LTUS:430:UNAVAILGO") { field(DESC, "Process UNAVAIL") field(DOL1, "QUAD:LTUS:430:STATSUB.U") field(LNK1, "QUAD:LTUS:430:UNAVAIL PP") } record(stringout, "QUAD:LTUS:430:SNLSTATMSG") { field(DTYP, "Soft Channel") } #! TextBox(TB0,820,1000,1200,1220,0,"Dialog",12,1,16777215,"QUAD:LTUS:430:STATUSSUB - future\nOverall device status - takes input from action snls, record sevrs, master snl(s) and outputs final status\n\nInputs:\nA - QUAD:LTUS:430:CTRLSTATUS - snl status\nB - MGNT:CTRLSTATUS - master list status\nC\nD - QUAD:LTUS:430: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,"QUAD:LTUS:430STATSUB\nformat control bo's into slc STAT\n\nInputs:\nA - QUAD:LTUS:430:STATUS\nC - QUAD:LTUS:430:ON\nD - QUAD:LTUS:430:STDZOK\nE - QUAD:LTUS:430:CALBOK\nF - QUAD:LTUS:430:BACTDRIFT (future)\nG -\nH- QUAD:LTUS:430:DACSTATUS\nI -QUAD:LTUS:430:ADCSTATUS\nJ - QUAD:LTUS:430:BACTSTATUS\nK - QUAD:LTUS:430:BDESSTATUS\nL - QUAD:LTUS:430:RIPLSTATUS\n\nOutput:\nP - QUAD:LTUS:430: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, "QUAD:LTUS:430: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, "QUAD:LTUS:430: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, "QUAD:LTUS:430: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, "QUAD:LTUS:430: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 b-field of a slave with out a powered trim coil # equal to the main desired current and pass backwards # through the IVB poly. record(sub, "QUAD:LTUS:430:IDES2BDES") { field(DESC, "Cal BDES") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "QUAD:LTUS:430:IDES2BDES") field(INPB, "QUAD:LTUS:430:POLYCOEF") field(INPC, "QUAD:LTUS:430:POLYCOEF.A") field(INPD, "QUAD:LTUS:430:POLYCOEF.B") field(INPE, "QUAD:LTUS:235:IDES CP MS") field(INPF, "QUAD:LTUS:235:BDELTAS PP") field(INPG, "100") field(EGU, "kG") field(HOPR, "-0.2914") field(LOPR, "-51.6681") field(HIHI, "-0.2914") field(LOLO, "-51.6681") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "-0.2914") field(LOW, "-51.6681") field(FLNK, "QUAD:LTUS:430:BDES") } # Calcuate the bcon of a slave using # the main desired current and pass backwards # through the IVB poly. # the trim b-field is acutally amps. record(sub, "QUAD:LTUS:430:ICON2BCON") { field(DESC, "Cal BCON") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "QUAD:LTUS:430:ICON2BCON") field(INPB, "QUAD:LTUS:430:POLYCOEF") field(INPC, "QUAD:LTUS:430:POLYCOEF.A") field(INPD, "QUAD:LTUS:430:POLYCOEF.B") field(INPE, "QUAD:LTUS:235:ICON CP NMS") field(INPF, "QUAD:LTUS:235:BDELTAS PP") field(INPG, "100") field(EGU, "kG") field(HOPR, "-0.2914") field(LOPR, "-51.6681") field(HIHI, "-0.2914") field(LOLO, "-51.6681") field(PREC, "7") field(BRSV, "INVALID") # Set MINOR alarms for main as the default, slaves will set NO_ALARM field(HHSV, "NO_ALARM") field(HSV, "NO_ALARM") field(LSV, "NO_ALARM") field(LLSV, "NO_ALARM") field(HIGH, "-0.2914") field(LOW, "-51.6681") field(FLNK, "QUAD:LTUS:430:BCON") }#! 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, "QUAD:LTUS:450:IACT") { field(DESC, "Current") field(INP, "QUAD:LTUS:180:IACT CP NMS") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "QUAD:LTUS:450:BACT") info(autosaveFields,"HYST") } record(bi, "QUAD:LTUS:450:STATE") { field(DESC, "PS On/Off Status") field(DTYP, "Raw Soft Channel") field(INP, "QUAD:LTUS:180:STATE CP MS") field(ZSV, "MAJOR") field(ZNAM, "OFF") field(ONAM, "ON") } record(ao, "QUAD:LTUS:450:IDES") { field(DESC, "Desired Current") field(PREC, "3") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(MDEL, "-1") field(HIHI, "165.0") field(LOLO, "0.0") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "QUAD:LTUS:450:BDELTAS") field(DRVH, "165.0") field(DRVL, "0.0") field(DOL, "QUAD:LTUS:450: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, "QUAD:LTUS:450:ICTRL PP") } # This record is processed by QUAD:LTUS:450:ICON") # Note: we are not setting alarms here. record(ao, "QUAD:LTUS:450:ICON") { field(DESC, "Config I") field(DTYP, "Soft Channel") field(PREC, "3") field(HOPR, "165.0") field(LOPR, "0.0") field(DRVH, "165.0") field(DRVL, "0.0") field(DOL, "QUAD:LTUS:450:B2ICON.K") field(OMSL, "closed_loop") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:450:INOM") { field(DESC, "Nominal Current") field(DOL, "QUAD:LTUS:450:BNOM.K") field(OMSL, "closed_loop") field(PREC, "3") field(EGU, "A") field(DRVH, "165.0") field(DRVL, "0.0") field(HOPR, "165.0") field(LOPR, "0.0") } record(ao, "QUAD:LTUS:450:ICTRL") { field(DESC, "Set Current") field(PREC, "3") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(DRVH, "165.0") field(DRVL, "0.0") field(MDEL, "-1") field(FLNK, "QUAD:LTUS:450:ICTRLGO") field(OMSL, "supervisory") info(autosavefields,"VAL") } record(seq, "QUAD:LTUS:450:ICTRLGO") { field(DESC, "Process Current Setpoint") field(PREC, "3") # Set ISETPT to supervisory field(DOL1, "0") field(LNK1, "QUAD:LTUS:450:ISETPT.OMSL") field(DOL2, "QUAD:LTUS:450:ICTRL") field(LNK2, "QUAD:LTUS:450:ISETPT PP") # Set ISETPT to closed loop - get data from BCTRLSUB.K field(DOL3, "1") field(LNK3, "QUAD:LTUS:450:ISETPT.OMSL") } record(ao, "QUAD:LTUS:450:IMAX") { field(DESC, "Max I") field(DTYP, "Soft Channel") field(DRVH, "165.0") field(DRVL, "0.0") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(PREC, "3") field(PINI, "YES") field(VAL, "165.0") field(FLNK, "QUAD:LTUS:450:IMIN") } record(ao, "QUAD:LTUS:450:IMIN") { field(DESC, "Min I") field(DTYP, "Soft Channel") field(DRVH, "165.0") field(DRVL, "0.0") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(PREC, "3") field(VAL, "0.0") field(FLNK, "QUAD:LTUS:450:IRANGE") } record(sel, "QUAD:LTUS:450:IACTPREVOK") { field(DESC, "Last Good Current") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(PREC, "3") field(NVL, "QUAD:LTUS:450:BACT.SEVR") field(INPA, "QUAD:LTUS:450:IACT NPP MS") field(INPB, "QUAD:LTUS:450:IACTPREVOK NPP MS") field(INPC, "QUAD:LTUS:450:IACTPREVOK NPP MS") field(INPD, "QUAD:LTUS:450:IACTPREVOK NPP MS") } record(sub, "QUAD:LTUS:450:IACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:450:IDES") field(INPB, "QUAD:LTUS:450:ISETPT.DRVH") field(INPC, "QUAD:LTUS:450:ISETPT.DRVL") field(INPD, "QUAD:LTUS:450:IDELTAS.I") field(INPE, "QUAD:LTUS:450:IDELTAS.J") field(INPG, "QUAD:LTUS:450:STATE") field(INPH, "QUAD:LTUS:450:HSTA") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(sub, "QUAD:LTUS:450:IMONLIMITS") { field(DESC, "Aux Current Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:450:IDES") field(INPB, "QUAD:LTUS:450:ISETPT.DRVH") field(INPC, "QUAD:LTUS:450:ISETPT.DRVL") field(INPD, "QUAD:LTUS:450:IDELTAS.K") field(INPE, "QUAD:LTUS:450:IDELTAS.L") field(INPG, "QUAD:LTUS:450:STATE") field(INPH, "QUAD:LTUS:450:HSTA") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(seq, "QUAD:LTUS:450:ILIMITS") { field(DESC, "Set ACT and MON Limits") field(PREC, "3") field(DOL1, "QUAD:LTUS:450:BLIMITS") field(LNK1, "QUAD:LTUS:450:IACTLIMITS.F PP") field(DOL2, "QUAD:LTUS:450:IACTLIMITS.I") field(LNK2, "QUAD:LTUS:450:IACT.HIGH") field(DOL3, "QUAD:LTUS:450:IACTLIMITS.J") field(LNK3, "QUAD:LTUS:450:IACT.LOW") field(DOL4, "QUAD:LTUS:450:IACTLIMITS.K") field(LNK4, "QUAD:LTUS:450:IACT.HIHI") field(DOL5, "QUAD:LTUS:450:IACTLIMITS.L") field(LNK5, "QUAD:LTUS:450:IACT.LOLO") field(DOL6, "QUAD:LTUS:450:BLIMITS") field(LNK6, "QUAD:LTUS:450:IMONLIMITS.F PP") field(DOL7, "QUAD:LTUS:450:IMONLIMITS.I") field(LNK7, "QUAD:LTUS:450:IMON.HIGH") field(DOL8, "QUAD:LTUS:450:IMONLIMITS.J") field(LNK8, "QUAD:LTUS:450:IMON.LOW") field(DOL9, "QUAD:LTUS:450:IMONLIMITS.K") field(LNK9, "QUAD:LTUS:450:IMON.HIHI") field(DOLA, "QUAD:LTUS:450:IMONLIMITS.L") field(LNKA, "QUAD:LTUS:450: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, "QUAD:LTUS:450:IDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntRawDeltas") field(INPD, "QUAD:LTUS:450:TRIMBTOL") field(INPE, "QUAD:LTUS:450:CHCKBTOL") field(INPF, "QUAD:LTUS:450:BDELTAS.K") field(INPG, "QUAD:LTUS:450:BDELTAS.L") field(INPH, "QUAD:LTUS:450: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, "QUAD:LTUS:450:STDZITOLR") field(INPC, "QUAD:LTUS:450:STDZITOL") field(FLNK, "") } # All ps controllers with on/off control will set the macro ONOF # as follows: # # ONOF = QUAD:LTUS:180: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, "QUAD:LTUS:450: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 = QUAD:LTUS:180:RESET PP # record(bo, "QUAD:LTUS:450: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, "QUAD:LTUS:450:RAMPSTATE") { field(DESC, "PS Ramp Status") field(DTYP, "Soft Channel") field(DOL, "QUAD:LTUS:180: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, "QUAD:LTUS:450: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, "QUAD:LTUS:450:TRIMRAMPRATE") field(OUT, "") field(FLNK, "QUAD:LTUS:450:STDZDLY") } record(ao, "QUAD:LTUS:450:ISETPT") { field(DESC, "Current Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(DRVH, "165.0") field(DRVL, "0.0") field(MDEL, "-1") field(OUT, "") field(DOL, "QUAD:LTUS:450: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, "QUAD:LTUS:450:IMON") { field(DESC, "Aux Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(INP, "QUAD:LTUS:180:IMON CP NMS") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "QUAD:LTUS:450:BMON") } record(ao, "QUAD:LTUS:450:IRIPL") { field(DESC, "Ripple Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(DOL, "QUAD:LTUS:180:IRIPL CP NMS") field(OMSL, "closed_loop") field(EGU, "A") field(DRVH, "1.0") field(HOPR, "1.0") field(PREC, "3") field(FLNK, "QUAD:LTUS:450:IRIPLOK") } record(sub, "QUAD:LTUS:450:IRIPLOK") { field(DESC, "Ripple Current Status") field(INAM, "mgntInit") field(SNAM, "mgntRiplOK") field(INPA, "QUAD:LTUS:450:IRIPL.VAL") field(INPB, "QUAD:LTUS:450: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, "QUAD:LTUS:450:R") { field(DESC, "Resistance") field(EGU, "Ohms") field(PREC, "4") field(PINI, "YES") field(DOL, "QUAD:LTUS:180: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, "QUAD:LTUS:450:IGND") { field(DESC, "Ground Current") field(EGU, "A") field(PREC, "6") field(PINI, "YES") field(DOL, "QUAD:LTUS:180:IGND CP MS") field(OMSL, "closed_loop") } record(bi, "QUAD:LTUS:450:INTLKSUMY") { field(DESC, "Interlock Summary") field(INP, "QUAD:LTUS:180:INTLKSUMY CP MS") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(ZNAM, "OK") field(ONAM, "FAULT") field(PINI, "NO") } record(mbbo, "QUAD:LTUS:450: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, "QUAD:LTUS:180:COOLING CP NMS") field(OMSL, "closed_loop") } # The following PV is processed by :BACTFO # which is processed by :BACT record(fanout, "QUAD:LTUS:450:IACTFO") { field(DESC, "IACT processing") field(SELM, "All") field(LNK1, "QUAD:LTUS:450:IACTPREVOK") field(LNK2, "QUAD:LTUS:450:IDIFF") field(LNK3, "QUAD:LTUS:450:IADIFF") field(LNK4, "QUAD:LTUS:450:IRATIO") field(LNK5, "QUAD:LTUS:450:IDIRECT") field(LNK6, "QUAD:LTUS:450:IACTPOL_CHECK") } record(calc, "QUAD:LTUS:450:IDIFF") { field(DESC, "IDES-IACT") field(CALC, "A-B") field(INPA, "QUAD:LTUS:450:IDES") field(INPB, "QUAD:LTUS:450:IACT") field(EGU, "A") field(PREC, "9") field(HOPR, "165.0") field(LOPR, "0.0") } record(calc, "QUAD:LTUS:450:IADIFF") { field(DESC, "Absolute IDES-IACT") field(CALC, "A<0?ABS(A):A") field(INPA, "QUAD:LTUS:450:IDIFF") field(PREC, "9") } record(calc, "QUAD:LTUS:450:IRATIO") { field(DESC, "IDES-IACT/IMAX") field(CALC, "B?A/B:0") field(INPA, "QUAD:LTUS:450:IDIFF") field(INPB, "QUAD:LTUS:450:IDES.DRVH") field(PREC, "9") } record(calcout, "QUAD:LTUS:450:IRANGE") { field(DESC, "Current Range") field(PINI, "YES") field(CALC, "ABS(A-B)") field(INPA, "QUAD:LTUS:450:IMIN") field(INPB, "QUAD:LTUS:450: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, "QUAD:LTUS:450: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, "QUAD:LTUS:450:IACT") field(FLNK, "QUAD:LTUS:450:IACTPOL") } record(bo, "QUAD:LTUS:450:IACTPOL") { field(DESC, "Actual I Polarity") field(DTYP, "Raw Soft Channel") field(DOL, "QUAD:LTUS:450: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,"QUAD:LTUS:450:I*LIMITS:\n Calculate alarm and warning limits based on \n deltas from QUAD:LTUS:450:IDELTAS and the\n QUAD:LTUS:450: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,"QUAD:LTUS:450:IACT: \n Get copy of QUAD:LTUS:450:I. \n",null) #! TextBox(TB12,1280,3100,1760,3200,0,"Dialog",12,1,16777215,"QUAD:LTUS:450: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,"QUAD:LTUS:450:IDES:\n Contains raw value calculated by \nQUAD:LTUS:450: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 \nQUAD:LTUS:450:BDELTAS.\n",null) #! TextBox(TB10,56,1940,316,2340,0,"Dialog",12,1,16777215,"QUAD:LTUS:450: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 QUAD:LTUS:450: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 QUAD:LTUS:450: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,"QUAD:LTUS:450:ISETPT:\n Sets the hardware. When fast feedback is set on, this record is\n set to closed loop mode by QUAD:LTUS:450:FBCKSTART sequence. When \n the loop is closed, this record takes input calculated by \n BFBCK only. When fast feedback is set off, QUAD:LTUS:450:FBCKSTOP \n will set it back to supervisory so that the value can be set by \n QUAD:LTUS:450: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, "QUAD:LTUS:450:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:450:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "QUAD:LTUS:450:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "QUAD:LTUS:450:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "QUAD:LTUS:450:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "QUAD:LTUS:450:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "1") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "QUAD:LTUS:450: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, "QUAD:LTUS:450:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "QUAD:LTUS:450:TRIMTYPE.RVAL") field(INPB, "QUAD:LTUS:450:CONFIG.RVAL") field(OUT, "QUAD:LTUS:450:TRIMMAXNUM PP") } record(longout, "QUAD:LTUS:450: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, "QUAD:LTUS:450: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, "QUAD:LTUS:180:TRIMRAMPRATE CP NMS") field(OMSL, "closed_loop") field(VAL, "") field(OUT, "QUAD:LTUS:450:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "QUAD:LTUS:450: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, "QUAD:LTUS:180:TRIMSETL CP NMS") field(OMSL, "closed_loop") field(VAL, "") } record(bo, "QUAD:LTUS:450: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, "QUAD:LTUS:450: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, "QUAD:LTUS:450: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, "0") } record(bo, "QUAD:LTUS:450:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "0") } record(ao, "QUAD:LTUS:450: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, "QUAD:LTUS:450:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "QUAD:LTUS:450: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, "QUAD:LTUS:450: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, "QUAD:LTUS:450:IMOVE") field(INPB, "QUAD:LTUS:450:IACT") field(INPC, "QUAD:LTUS:450:IRAMPRATE") field(INPD, "1.0") field(INPE, "QUAD:LTUS:450:TRIMDLYPCT") field(INPF, "QUAD:LTUS:450:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "QUAD:LTUS:450:RAMPTIME_LEFT PP") } record(longout, "QUAD:LTUS:450:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "QUAD:LTUS:450:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "QUAD:LTUS:450:RAMPDONE_CALC") } record(calc, "QUAD:LTUS:450:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "QUAD:LTUS:450:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "QUAD:LTUS:450:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "QUAD:LTUS:450: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, "QUAD:LTUS:450:RAMPTIME_LEFT") field(OUT, "QUAD:LTUS:450:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "QUAD:LTUS:450:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "QUAD:LTUS:450:RAMPTIME_LEFT NMS") field(OUT, "QUAD:LTUS:450:RAMPDONE PP") } record(bo, "QUAD:LTUS:450:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "QUAD:LTUS:450:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "QUAD:LTUS:450: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, "QUAD:LTUS:450: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, "QUAD:LTUS:450:STDZINIT") { field(DESC, "Proc. Stdz PVs on boot") field(PINI, "YES") field(DOL1, "1") field(DOL2, "1") field(DOL3, "1") field(LNK1, "QUAD:LTUS:450:DEBUG.PROC PP") field(LNK2, "QUAD:LTUS:450:STDZCYCLENUM.PROC PP") field(LNK3, "QUAD:LTUS:450:STDZDISABLE.PROC PP") field(LNK4, "QUAD:LTUS:450: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, "QUAD:LTUS:450:STDZSUB") { field(DESC, "Stdz subroutine") field(INAM, "mgntStdzInit") field(SNAM, "mgntStdz") field(BRSV, "INVALID") field(INPA, "QUAD:LTUS:450:STDZIMIN NPP NMS") field(INPB, "QUAD:LTUS:450:STDZIMAX NPP NMS") field(INPC, "QUAD:LTUS:450:STDZIFINAL NPP NMS") field(INPD, "QUAD:LTUS:450:STDZCYCLENUM NPP NMS") field(INPE, "QUAD:LTUS:450:STDZDIRECT.RVAL NPP NMS") field(INPF, "QUAD:LTUS:450:STDZDISABLE.RVAL CPP NMS") field(INPG, "QUAD:LTUS:450: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, "QUAD:LTUS:450:STDZWF PP") field(OUTB, "QUAD:LTUS:450: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, "QUAD:LTUS:450:STDZWF") } record(mbbo, "QUAD:LTUS:450: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, "QUAD:LTUS:450: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, "QUAD:LTUS:450:STDZMAINPS") { field(DESC, "Stdz by main or self") field(PINI, "YES") field(DTYP, "Soft Channel") field(ZNAM, "SELF") field(ONAM, "MAIN") } record(bo, "QUAD:LTUS:450: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, "QUAD:LTUS:450: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, "QUAD:LTUS:450: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, "QUAD:LTUS:450:STDZTOD") { field(DESC, "Successful Standardize Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "QUAD:LTUS:450:STDZLOSTTOD") { field(DESC, "Standardize Lost Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(longout, "QUAD:LTUS:450:STDZCYCLECNT") { field(DESC, "Cycle Count") field(PINI, "YES") } record(longout, "QUAD:LTUS:450: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, "QUAD:LTUS:450:STDZDIRECT") } # The default standardize direction is "UP" for # all LCLS Magnets.. record(bo, "QUAD:LTUS:450:STDZDIRECT") { field(DESC, "Standardize Direction ") field(ZNAM, "UP") field(ONAM, "DOWN") field(VAL, "0") field(FLNK, "QUAD:LTUS:450:STDZIMIN") } record(ao, "QUAD:LTUS:450:STDZIMIN") { field(DESC, "Min-STDZ Current") field(PREC, "1") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(VAL, "0.0") field(FLNK, "QUAD:LTUS:450:STDZIMAX") } record(ao, "QUAD:LTUS:450:STDZIMAX") { field(DESC, "Max. Standarize Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(VAL, "165.0") field(FLNK, "QUAD:LTUS:450:STDZIFINAL") } record(ao, "QUAD:LTUS:450:STDZIFINAL") { field(DESC, "Final SDTZ Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(VAL, "0.0") field(FLNK, "QUAD:LTUS:450: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, "QUAD:LTUS:450: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, "QUAD:LTUS:450:STDZITOL") { field(DESC, "Stdz min tolerance") field(PREC, "5") field(CALC, "MAX(ABS(A),ABS(B))*C") field(INPA, "QUAD:LTUS:450:STDZIMIN CP NMS") field(INPB, "QUAD:LTUS:450:STDZIMAX CP MMS") field(INPC, "0.05") field(INPD, "QUAD:LTUS:450:STDZITOLR CP MMS") field(EGU, "A") field(FLNK, "QUAD:LTUS:450:IDELTAS") field(PINI, "YES") } # D - factor (3.154/2 = 1.577) for EPSC, otherwise, set to 1.0 record(calc, "QUAD:LTUS:450:STDZDLY") { field(DESC, "Ramp time for stdz cycle") field(CALC, "C>0?MAX(1,ABS((A-B)/C)*D):0") field(INPA, "QUAD:LTUS:450:STDZIMIN CP NMS") field(INPB, "QUAD:LTUS:450:STDZIMAX CP NMS") field(INPC, "QUAD:LTUS:450:TRIMRAMPRATE CP NMS") field(INPD, "1.0") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") } record(calc, "QUAD:LTUS:450:STDZRAMPDLY") { field(DESC, "Ramp delay total") field(CALC, "MAX(1,((A/100)*B+B))") field(PREC, "5") field(INPA, "QUAD:LTUS:450:TRIMDLYPCT CP MS") field(INPB, "QUAD:LTUS:450: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, "QUAD:LTUS:450:STDZMINIDLY") { field(DESC, "Mini-stdz delay") field(CALC, "A") field(PREC, "5") field(A, "1.0") field(EGU, "sec") field(PINI, "YES") } record(ao, "QUAD:LTUS:450: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, "QUAD:LTUS:450:STDZMINIDELTA") { field(DESC, "Stdz mini % of IMAX") field(CALC, "(B/100)*(A-C)") field(INPA, "QUAD:LTUS:450:IDES.HOPR") field(INPB, "QUAD:LTUS:450:STDZMINIPCT CPP NMS") field(INPC, "QUAD:LTUS:450:IDES.LOPR") field(PREC, "5") } record(calc, "QUAD:LTUS:450:STDZMINISETPT") { field(DESC, "Mini Stdz delta") field(CALC, "C==0?MAX(E-D,B):MIN(E+D,A)") field(INPA, "QUAD:LTUS:450:IDES.HOPR") field(INPB, "QUAD:LTUS:450:IDES.LOPR") field(INPC, "QUAD:LTUS:450:STDZDIRECT.RVAL") field(INPD, "QUAD:LTUS:450:STDZMINIDELTA") field(INPE, "QUAD:LTUS:450:IDES") field(PREC, "5") field(FLNK, "QUAD:LTUS:450: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, "QUAD:LTUS:450:STDZMINISETPTOOR") { field(DESC, "Mini Stdz setpoint out of range") field(CALC, "C==0?(E-DA)") field(INPA, "QUAD:LTUS:450:IDES.HOPR") field(INPB, "QUAD:LTUS:450:IDES.LOPR") field(INPC, "QUAD:LTUS:450:STDZDIRECT.RVAL") field(INPD, "QUAD:LTUS:450:STDZMINIDELTA") field(INPE, "QUAD:LTUS:450: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, "QUAD:LTUS:450: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, "QUAD:LTUS:450:IADJUST.RVAL") field(INPB, "QUAD:LTUS:450:STDZDIRECT.RVAL") field(INPC, "QUAD:LTUS:450:STDZOK.RVAL") field(INPD, "QUAD:LTUS:450:STDZDISABLE.RVAL") field(INPE, "QUAD:LTUS:450:STATE.RVAL CPP NMS") field(INPF, "QUAD:LTUS:450:ICTRL.RVAL") field(INPG, "QUAD:LTUS:450:STATE.SEVR") field(INPH, "QUAD:LTUS:450:BDELTAS.M") field(INPI, "QUAD:LTUS:450:IACT.SEVR") field(OUT, "QUAD:LTUS:450:STDZLOSTGO.SELN PP NMS") field(OOPT, "Transition To Non-zero") } record(seq, "QUAD:LTUS:450:STDZLOSTGO") { field(DESC, "Process lost stdz") field(SELM, "Mask") field(DOL1, "1") field(DOL2, "0") field(LNK1, "QUAD:LTUS:450:STDZLOSTTOD.PROC") field(LNK2, "QUAD:LTUS:450:STDZOK PP") } # Record maximum current after standardize # Reset to IACT from sequence after trim # Disable processing during (mini-)standardize or trim record(calc, "QUAD:LTUS:450:STDZIACTMAX") { field(DESC, "Max act current after stdz") field(CALC, "MAX(A, B)") field(DISV, "0") field(SDIS, "QUAD:LTUS:450:CHECKPWRDIP_ENABLE") field(INPA, "QUAD:LTUS:450:IACT CP") field(INPB, "QUAD:LTUS:450:STDZIACTMAX") field(EGU, "A") field(FLNK, "QUAD:LTUS:450:CHECKPWRDIP") } # Detect power dip if STDZOK is YES, STDZ is enabled, and IACT is valid # If IACT drops below STDZIACTMAX by more than the trim tolerance, clear STDZOK # Warning: Take the absolute value of the trim tolerance, or else quads of # negative polarity will always lose STDZ since their IDELTAS.I are negative. # Note: Large quads and bends are prone to losing STDZ even if they are # perturbed toward higher current since their current tends to overshoot # by greater than the trim tolerance before settling down. record(calcout, "QUAD:LTUS:450:CHECKPWRDIP") { field(DESC, "Detect power dip") field(CALC, "(A-B>ABS(C))?3:0") field(DISV, "0") field(SDIS, "QUAD:LTUS:450:CHECKPWRDIP_ENABLE") field(INPA, "QUAD:LTUS:450:STDZIACTMAX") field(INPB, "QUAD:LTUS:450:IACT") field(INPC, "QUAD:LTUS:450:IDELTAS.I") field(OUT, "QUAD:LTUS:450:STDZLOSTGO.SELN PP NMS") field(OOPT, "When Non-zero") } # Enable processing of STDZIACTMAX and CHECKPWRDIP only if # STDZOK = YES, STDZDISABLE = NO, CTRL != Trim (2), and # CTRL != Stdz (4) record(calc, "QUAD:LTUS:450:CHECKPWRDIP_ENABLE") { field(CALC, "A&&!B&&(C#2)&&(C#4)") field(INPA, "QUAD:LTUS:450:STDZOK.RVAL CP") field(INPB, "QUAD:LTUS:450:STDZDISABLE.RVAL CP") field(INPC, "QUAD:LTUS:450:CTRL.RVAL CP") } #! 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, "QUAD:LTUS:450: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, "QUAD:LTUS:450: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, "QUAD:LTUS:450:CALBSET") { field(DESC, "Use DAC Calbration") field(SCAN, "10 second") field(CALC, "A&&(B==0)&&C?31:960") field(INPA, "QUAD:LTUS:450:CALBOK") field(INPB, "QUAD:LTUS:450:CALBDISABLE") field(INPC, "QUAD:LTUS:450:CALBSLOPE") field(OOPT, "On Change") field(OUT, "QUAD:LTUS:450: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, "QUAD:LTUS:450:CALB_SEQ") { field(DESC, "Output Calib Values") field(SELM, "Mask") field(SELL, "QUAD:LTUS:450: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, "QUAD:LTUS:450:CALBSLOPE") field(DOL3, "QUAD:LTUS:450: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, "QUAD:LTUS:450:CALBTOD") { field(DESC, "Calibration Success Time") field(PINI, "YES") # field(DOL, "") field(OMSL, "supervisory") field(DTYP, "Soft Channel") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:450: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, "QUAD:LTUS:450: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, "QUAD:LTUS:450: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, "QUAD:LTUS:450:CALBOFFSET") { field(DESC, "Calc DAC Offset") field(PREC, "6") field(EGU, "Counts") field(PINI, "YES") } record(bo, "QUAD:LTUS:450: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, "QUAD:LTUS:450:DACSLOPE") { field(DESC, "V to DAC slope") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "supervisory") field(PINI, "YES") field(FLNK, "QUAD:LTUS:450:DACOFFSET") } # Default Offset used in conversion from Volts to DAC Counts record(ao, "QUAD:LTUS:450:DACOFFSET") { field(DESC, "V to DAC offset") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "supervisory") field(PINI, "YES") field(FLNK, "QUAD:LTUS:450: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, "QUAD:LTUS:450: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, "QUAD:LTUS:450:IACT") field(INPD, "QUAD:LTUS:450:DACSLOPE") field(INPE, "QUAD:LTUS:450:DACOFFSET") field(EGU, "Counts") field(PREC, "6") } record(ao, "QUAD:LTUS:450:DAC") { field(DESC, "DAC Set point") field(EGU, "Counts") field(DOL, "") field(OMSL, "supervisory") field(PREC, "6") field(PINI, "YES") } record(ao, "QUAD:LTUS:450:CALBIMIN") { field(DESC, "Calibration Min Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(DRVH, "165.0") field(HOPR, "165.0") field(DRVL, "0.0") field(LOPR, "0.0") field(PREC, "3") field(EGU, "A") field(VAL, "0.0") field(FLNK, "QUAD:LTUS:450:CALBIMAX") } record(ao, "QUAD:LTUS:450:CALBIMAX") { field(DESC, "Calibration Max Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(DRVH, "165.0") field(HOPR, "165.0") field(LOPR, "0.0") field(DRVL, "0.0") field(EGU, "A") field(VAL, "165.0") field(FLNK, "QUAD:LTUS:450:CALBSTEPNUM") } record(ao, "QUAD:LTUS:450:CALBIFINAL") { field(DESC, "Calibration Last Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(PREC, "3") field(EGU, "A") field(HOPR, "165.0") field(LOPR, "0.0") field(VAL, "0") } record(longout, "QUAD:LTUS:450: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, "QUAD:LTUS:450:CALBIDELTA") } record(calc, "QUAD:LTUS:450:CALBIDELTA") { field(DESC, "Step size for CALB") field(CALC, "C=0?0:ABS((A-B)/C)") field(INPA, "QUAD:LTUS:450:CALBIMAX") field(INPB, "QUAD:LTUS:450:CALBIMIN") field(INPC, "QUAD:LTUS:450: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, "QUAD:LTUS:450:CALBIMULT") { field(DESC, "IACT vs ISETPT mult") field(CALC, "C#0||A=0?1:ABS(B/A)") field(INPA, "QUAD:LTUS:180:ISETPT.DRVH") field(INPB, "QUAD:LTUS:180:IACT.HOPR") field(INPC, "QUAD:LTUS:450:PSCONTROLLER.RVAL CPP") field(EGU, "A") field(PINI, "YES") } # SNL dbputs DAC values here. 6-10 steps are possible. record(waveform, "QUAD:LTUS:450:CALBICTRLWF") { field(DESC, "ICTRL setpoint array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") } record(waveform, "QUAD:LTUS:450:DACWF") { field(DESC, "DAC count array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:450:DACSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:450:DACSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "QUAD:LTUS:450: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, "QUAD:LTUS:450:CALCDACWF") { field(DESC, "Calc DAC counts array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:450:CALCDACSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:450:CALCDACSA") { field(DESC, "Calc DAC counts") field(DTYP, "Soft Channel") field(INP, "QUAD:LTUS:450: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, "QUAD:LTUS:450:CALBYWF") { field(DESC, "mx + b") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:450:CALBYSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:450:CALBYSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "QUAD:LTUS:450:CALBYWF") field(MALM, "10") field(NELM, "6") field(INDX, "0") field(FTVL, "DOUBLE") } record(waveform, "QUAD:LTUS:450:CALBIACTWF") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:450:CALBIACTSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:450:CALBIACTSA") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(MALM, "10") field(NELM, "6") field(INP, "QUAD:LTUS:450:CALBIACTWF") field(INDX, "0") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:450:CALBLIMITS") } # Check that measured current during calibration is within # tolerance. record(aSub, "QUAD:LTUS:450: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, "QUAD:LTUS:450:CALBSTEPNUM") field(INPB, "QUAD:LTUS:450:CALBIACTWF") field(INPC, "QUAD:LTUS:450: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, "QUAD:LTUS:450: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, "QUAD:LTUS:450:STDZITOL") field(INPH, "QUAD:LTUS:450:DACSLOPE") field(INPI, "QUAD:LTUS:450: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, "QUAD:LTUS:450: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, "QUAD:LTUS:450:CALBSTEPNUM") field(INPB, "QUAD:LTUS:450:CALBIACTWF") field(INPC, "QUAD:LTUS:450:DACWF") field(INPF, "QUAD:LTUS:450: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 QUAD:LTUS:450CALBOK 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, "QUAD:LTUS:450:DEGAUSINIT") { field(DESC, "Proc. Degauss PVs on boot") field(PINI, "YES") field(DOL, "1") field(OUTA, "QUAD:LTUS:450:DEGAUSIMIN.PROC PP") field(OUTB, "QUAD:LTUS:450:DEGAUSIMAX.PROC PP") field(OUTC, "QUAD:LTUS:450:DEGAUSTYPE.PROC PP") field(OUTD, "QUAD:LTUS:450:DEGAUSSTEP.PROC PP") field(OUTE, "QUAD:LTUS:450:MADNAME.PROC PP") field(OUTF, "QUAD:LTUS:450:PSTYPE.PROC PP") field(OUTG, "QUAD:LTUS:450: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, "QUAD:LTUS:450:DEGAUSSUB") { field(DESC, "Degauss subroutine") field(INAM, "mgntDegaussInit") field(SNAM, "mgntDegauss") field(BRSV, "INVALID") field(INPA, "QUAD:LTUS:450:DEGAUSIMIN NPP NMS") field(INPB, "QUAD:LTUS:450:DEGAUSIMAX NPP NMS") field(INPC, "QUAD:LTUS:450:DEGAUSTYPE.RVAL NPP NMS") field(INPE, "QUAD:LTUS:450:DEGAUSMETHOD.RVAL NPP NMS") field(INPF, "QUAD:LTUS:450:PSTYPE NPP NMS") field(INPG, "QUAD:LTUS:450:DEBUG.RVAL NPP NMS") field(INPH, "QUAD:LTUS:450: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, "QUAD:LTUS:450:DEGAUSWF PP") field(OUTB, "QUAD:LTUS:450:DEGAUSMSG PP") field(OUTC, "QUAD:LTUS:450: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, "QUAD:LTUS:450:DEGAUSWF") { field(DESC, "Degauss Setpts") field(NELM, "60") field(FTVL, "DOUBLE") } record(mbbo,"QUAD:LTUS:450: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, "QUAD:LTUS:450: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, "QUAD:LTUS:450: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, "QUAD:LTUS:450: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, "QUAD:LTUS:450: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, "QUAD:LTUS:450:DEGAUSIMIN") { field(DESC, "Min. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "165.0") field(LOPR, "-165.0") field(DRVH, "165.0") field(DRVL, "-165.0") field(VAL, "-165.0") } record(ao, "QUAD:LTUS:450:DEGAUSIMAX") { field(DESC, "Max. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "165.0") field(LOPR, "-165.0") field(DRVH, "165.0") field(DRVL, "-165.0") field(VAL, "165.0") } # 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,"QUAD:LTUS:450: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, "QUAD:LTUS:450: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,"QUAD:LTUS:450: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, "QUAD:LTUS:450: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, "QUAD:LTUS:450: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, "QUAD:LTUS:450: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, "QUAD:LTUS:450:DEGAUSTOD") { field(DESC, "Successful Degauss Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "QUAD:LTUS:450:DEGAUSLOSTTOD") { field(DESC, "Degauss Lost Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:450:DEGAUSTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "QUAD:LTUS:450:DEGAUSTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "QUAD:LTUS:450: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, "QUAD:LTUS:450:DEGAUSGO") { field(DESC, "Set bdes of btrms to zero") field(ASG, "Internal") field(OUTA, "") field(OUTB, "") field(OUTC, "") field(OUTD, "") } # =========== CRYO ONLY =========== record(bo, "QUAD:LTUS:450: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, "QUAD:LTUS:450:DEGAUS_IMAX_CHECK") { field(DESC, "Check if imax shoud chg") field(CALC, "(C==4)&&(ABS(B)>ABS(A))?1:0") field(INPA, "QUAD:LTUS:450:DEGAUS_IMAX") field(INPB, "QUAD:LTUS:450:ISETPT") field(INPC, "QUAD:LTUS:450:DEGAUSTYPE.RVAL") field(OUT, "QUAD:LTUS:450:DEGAUS_IMAX_UPDATE.SELN") field(FLNK, "QUAD:LTUS:450:DEGAUS_IMAX_UPDATE") } record(seq, "QUAD:LTUS:450:DEGAUS_IMAX_UPDATE") { field(DESC, "Degauss IMAX Update") field(SELM, "Specified") field(DOL1, "QUAD:LTUS:450:ISETPT") field(LNK1, "QUAD:LTUS:450:DEGAUS_IMAX PP") } # Set the maximum current after a successful # degauss. This pv is updated by the # sequence. record(ao, "QUAD:LTUS:450:DEGAUS_IMAX") { field(DESC, "Max I set afer a degauss") field(EGU, "Amps") field(PINI, "YES") field(PREC, "6") field(HOPR, "165.0") field(LOPR, "-165.0") field(DRVH, "165.0") field(DRVL, "-165.0") field(VAL, "165.0") field(FLNK, "QUAD:LTUS:450:DEGAUS_IMAXPOL_CHECK") info(autosaveFields,"VAL,RVAL") } # Set the polarity if degauss_imax record(calcout, "QUAD:LTUS:450:DEGAUS_IMAXPOL_CHECK") { field(DESC, "Determine polarity of imax") field(CALC, "A>=0?0:1") field(INPA, "QUAD:LTUS:450:DEGAUS_IMAX") field(FLNK, "QUAD:LTUS:450:DEGAUS_IMAXPOL") } record(bo, "QUAD:LTUS:450:DEGAUS_IMAXPOL") { field(DESC, "Polarity of imax I") field(DTYP, "Raw Soft Channel") field(DOL, "QUAD:LTUS:450:DEGAUS_IMAXPOL_CHECK") field(OMSL, "closed_loop") field(ZNAM, "Positive") field(ONAM, "Negative") field(FLNK, "QUAD:LTUS:450: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, "QUAD:LTUS:450:DEGAUS_ABSIMAX") { field(DESC, "Absolute Max. Degauss I") field(CALC, "ABS(A)") field(INPA, "QUAD:LTUS:450:DEGAUS_IMAX") field(PREC, "6") field(EGU, "Amps") field(HOPR, "165.0") field(LOPR, "-165.0") info(autosaveFields,"VAL RVAL") } # IACT Polarity record(calcout, "QUAD:LTUS:450:IACTPOL_CHECK") { field(DESC, "Determine IACT polarity") field(SCAN, "5 second") field(CALC, "ABS(A-B)>C?(A>=0?0:1):D") field(INPA, "QUAD:LTUS:450:IACT") field(INPB, "QUAD:LTUS:450:IACTPOL_CHECK.LA") field(INPC, "0.0001") field(INPD, "QUAD:LTUS:450:IACTPOL_CHECK.PVAL") field(OOPT, "On Change") field(FLNK, "QUAD:LTUS:450:IACTPOL") } record(bo, "QUAD:LTUS:450: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,"QUAD:LTUS:450: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, "QUAD:LTUS:450:DEGAUSENABLE CP") field(INPB, "QUAD:LTUS:450:DEGAUSOK") field(INPC, "QUAD:LTUS:450:STATE CP") field(INPD, "QUAD:LTUS:450:STATE.SEVR") field(OUT, "QUAD:LTUS:450:DEGAUS_STATE_SEQ.SELN PP") field(ASG, "Internal") } record(seq, "QUAD:LTUS:450:DEGAUS_STATE_SEQ") { field(DESC, "Degauss State Sequence") field(SELM, "Specified") field(SELL, "QUAD:LTUS:450:DEGAUS_STATE_CHECK") field(LNK1, "QUAD:LTUS:450:DEGAUS_STATE_DISABLE.PROC PP") field(LNK2, "QUAD:LTUS:450:DEGAUS_STATE_LOST.PROC PP") field(LNK3, "QUAD:LTUS:450:DEGAUS_STATE_GOOD.PROC PP") field(LNK4, "QUAD:LTUS:450: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, "QUAD:LTUS:450:DEGAUS_STATE_DISABLE") { field(DESC, "Degauss not used") field(LNK1, "QUAD:LTUS:450:DEGAUSOK.ZSV") field(LNK2, "QUAD:LTUS:450: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, "QUAD:LTUS:450:STATMSG.FRSV") field(LNK4, "QUAD:LTUS:450: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, "QUAD:LTUS:450:DEGAUS_STATE_LOST") { field(DESC, "Degauss lost and ps On") field(DOL1, "1") field(LNK1, "QUAD:LTUS:450:DEGAUSOK.ZSV") field(LNK2, "QUAD:LTUS:450: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, "QUAD:LTUS:450:STATMSG.FRSV") field(LNK4, "QUAD:LTUS:450: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, "QUAD:LTUS:450:DEGAUS_STATE_OFF") { field(DESC, "Degaused lost and ps Off") field(DOL1, "2") field(LNK1, "QUAD:LTUS:450: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, "QUAD:LTUS:450:STATMSG.FRSV") field(LNK3, "QUAD:LTUS:450: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, "QUAD:LTUS:450:DEGAUS_STATE_GOOD") { field(DESC, "Degauss good") field(DOL1, "1") field(LNK1, "QUAD:LTUS:450: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, "QUAD:LTUS:450:STATMSG.FRSV PP") field(LNK3, "QUAD:LTUS:450:STATMSG.FVSV PP") field(LNK4, "") field(ASG, "Internal") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(mbbo, "QUAD:LTUS:450:FUNC") { field(DESC, "QUAD:LTUS:450 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, "0") field(FFVL, "0") field(OUT, "QUAD:LTUS:450:CTRL CA") } # :CTRL pv is processed at boot in the # sequence mgntCtrl.st Processed in sequence # record(mbbo, "QUAD:LTUS:450:CTRL") { field(DESC, "QUAD:LTUS:450 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, "QUAD:LTUS:450:SELECTEN.A PP") field(SDIS, "0") } # If a function has been selected set this unit to busy record(calcout, "QUAD:LTUS:450:SELECTEN") { field(DESC, "Control Select Enable") field(CALC, "A>0?1:A") field(FLNK, "QUAD:LTUS:450:BUSY") } # Set to FREE on IOC reboot record(bo, "QUAD:LTUS:450:BUSY") { field(DESC, "QUAD:LTUS:450 Ctrl Done") field(DOL, "QUAD:LTUS:450:SELECTEN") field(ZNAM, "FREE") field(ONAM, "BUSY") field(PINI, "YES") field(FLNK, "QUAD:LTUS:450:SELECT") } record(bo, "QUAD:LTUS:450:SELECT") { field(ZNAM, "NO") field(ONAM, "YES") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") } record(bo, "QUAD:LTUS:450: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, "QUAD:LTUS:450:CTRLSTATE") { field(DESC, "QUAD:LTUS:450 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("QUAD:LTUS:450:CTRL",20,20,0,0,"QUAD:LTUS:450:CTRL") #! Field("QUAD:LTUS:450:CTRL.OUT",16777215,1,"QUAD:LTUS:450:CTRL.OUT") #! Link("QUAD:LTUS:450:CTRL.OUT","QUAD:LTUS:450:SELECTEN.A") #! Field("QUAD:LTUS:450:CTRL.VAL",16777215,1,"QUAD:LTUS:450:CTRL.VAL") #! Record("QUAD:LTUS:450:SELECTEN",321,381,0,0,"QUAD:LTUS:450:SELECTEN") #! Field("QUAD:LTUS:450:SELECTEN.A",16777215,0,"QUAD:LTUS:450:SELECTEN.A") #! Field("QUAD:LTUS:450:SELECTEN.FLNK",16777215,1,"QUAD:LTUS:450:SELECTEN.FLNK") #! Link("QUAD:LTUS:450:SELECTEN.FLNK","QUAD:LTUS:450:BUSY") #! Field("QUAD:LTUS:450:SELECTEN.VAL",16777215,1,"QUAD:LTUS:450:SELECTEN.VAL") #! Record("QUAD:LTUS:450:BUSY",623,274,0,0,"QUAD:LTUS:450:BUSY") #! Field("QUAD:LTUS:450:BUSY.DOL",16777215,0,"QUAD:LTUS:450:BUSY.DOL") #! Link("QUAD:LTUS:450:BUSY.DOL","QUAD:LTUS:450:SELECTEN.VAL") #! Field("QUAD:LTUS:450:BUSY.FLNK",16777215,1,"QUAD:LTUS:450:BUSY.FLNK") #! Link("QUAD:LTUS:450:BUSY.FLNK","QUAD:LTUS:450:SELECT") #! Record("QUAD:LTUS:450:SELECT",669,508,0,1,"QUAD:LTUS:450:SELECT") #! Record("QUAD:LTUS:450:FUNC",940,120,0,0,"QUAD:LTUS:450:FUNC") #! Field("QUAD:LTUS:450:FUNC.OUT",16777215,0,"QUAD:LTUS:450:FUNC.OUT") #! Link("QUAD:LTUS:450:FUNC.OUT","QUAD:LTUS:450:CTRL.VAL") #! Record("QUAD:LTUS:450:ABORT",193,41,0,0,"QUAD:LTUS:450:ABORT") #! Record("QUAD:LTUS:450:CTRLSTATE",369,34,0,0,"QUAD:LTUS:450: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,"QUAD:LTUS:450:SELECT is used for Multi-device selection.\nIt is enabled when associated QUAD:LTUS:450:CTRL is \"0\" (DONE).\nIt is disabled when associated QUAD:LTUS:450: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,"QUAD:LTUS:450: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, "QUAD:LTUS:450:BCTRL_INIT") { field(DESC, "Process BCTRL on boot") field(PINI, "YES") field(CALC, "A=3?1:0") field(INPA, "QUAD:LTUS:450:BCTRL.SEVR") field(OUT, "QUAD:LTUS:450: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, "QUAD:LTUS:450:BACT") { field(DESC, "Actual B") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "QUAD:LTUS:450:BACT") field(INPB, "QUAD:LTUS:450:POLYCOEF") field(INPC, "QUAD:LTUS:450:POLYCOEF.A") field(INPD, "QUAD:LTUS:450:POLYCOEF.B") field(INPE, "QUAD:LTUS:450:IACT MS") field(INPF, "QUAD:LTUS:450:BDELTAS PP") field(INPG, "100") field(EGU, "kG") field(HOPR, "52.0972") field(LOPR, "0.2564") field(HIHI, "52.0972") field(LOLO, "0.2564") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "52.0972") field(LOW, "0.2564") field(FLNK, "QUAD:LTUS:450: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, "QUAD:LTUS:450:BDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntPhyDeltas") field(EGU, "kG") field(HOPR, "1") field(PREC, "7") field(BRSV, "INVALID") field(INPA, "QUAD:LTUS:450:BDES") field(INPB, "QUAD:LTUS:450:TRIMBTOL") field(INPC, "QUAD:LTUS:450:TRIMBTOLR") field(INPD, "QUAD:LTUS:450:CHCKBTOL") field(INPE, "QUAD:LTUS:450:CHCKBTOLR") field(F, "2.0") field(INPG, "30") field(INPH, "QUAD:LTUS:450:BACT.VAL") # # MPS absolute and relative tolerances field(INPP, "QUAD:LTUS:450:MPSBTOL") field(INPQ, "QUAD:LTUS:450:MPSBTOLR") field(FLNK, "QUAD:LTUS:450:BCONLIMITS") info(autosaveFields,"F") } # This record is processed by BDELTAS record(aSub, "QUAD:LTUS:450:BCONLIMITS") { field(DESC, "Config B-field Limits") field(INAM, "mgntInit") field(SNAM, "mgntBCONLimits") field(INPA, "QUAD:LTUS:450:BDES") field(INPB, "QUAD:LTUS:450:BDELTAS.I") field(INPG, "QUAD:LTUS:450:DEBUG.RVAL") field(FTA, "DOUBLE") field(FTB, "DOUBLE") field(FTG, "ULONG") field(OUTA, "QUAD:LTUS:450:BCON.HIGH") field(OUTB, "QUAD:LTUS:450:BCON.LOW") field(OUTC, "QUAD:LTUS:450:BCON.HIHI") field(OUTD, "QUAD:LTUS:450:BCON.LOLO PP") field(FTVA, "DOUBLE") field(FTVB, "DOUBLE") field(FTVC, "DOUBLE") field(FTVD, "DOUBLE") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:450:IDELTAS") } # The following PV is processed by :BACT # which is processed by :BACT # record(fanout, "QUAD:LTUS:450:BACTFO") { field(DESC, "BACT processing") field(SELM, "All") field(LNK1, "QUAD:LTUS:450:BDIFF") field(LNK2, "QUAD:LTUS:450:BADIFF") field(LNK3, "QUAD:LTUS:450:BRATIO") field(LNK4, "QUAD:LTUS:450:MPSLIMITS") field(LNK5, "QUAD:LTUS:450:I2BSTATUS") field(LNK6, "QUAD:LTUS:450:IACTFO.PROC") } record(calc, "QUAD:LTUS:450:BDIFF") { field(DESC, "BDES-BACT") field(CALC, "A-B") field(INPA, "QUAD:LTUS:450:BDES") field(INPB, "QUAD:LTUS:450:BACT") field(EGU, "kG") field(PREC, "7") } record(calc, "QUAD:LTUS:450:BADIFF") { field(DESC, "Absolute BDES-BACT") field(INPA, "QUAD:LTUS:450:BDIFF") field(EGU, "kG") field(PREC, "7") field(CALC, "A<0?ABS(A):A") } record(calc, "QUAD:LTUS:450:BRATIO") { field(DESC, "BACT Error") field(CALC, "B?A/B:0") field(INPA, "QUAD:LTUS:450:BDIFF") field(INPB, "QUAD:LTUS:450:BDES.HOPR") field(EGU, "kG") field(PREC, "7") } record(mbbi, "QUAD:LTUS:450: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, "QUAD:LTUS:450:BACT.J") } # Note: for a string slave set the MONFL # macro to the following: # MONFL=:IMONCALC MS record(sub, "QUAD:LTUS:450:BMON") { field(DESC, "Second Transductor") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "QUAD:LTUS:450:BMON") field(INPB, "QUAD:LTUS:450:POLYCOEF") field(INPC, "QUAD:LTUS:450:POLYCOEF.A") field(INPD, "QUAD:LTUS:450:POLYCOEF.B") field(INPE, "QUAD:LTUS:450:IMON MS") field(INPF, "QUAD:LTUS:450:BDELTAS.VAL") field(INPG, "100") field(EGU, "kG") field(HOPR, "52.0972") field(LOPR, "0.2564") field(HIHI, "52.0972") field(LOLO, "0.2564") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "52.0972") field(LOW, "0.2564") } # 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=QUAD:LTUS:180:BDES CP record(ao, "QUAD:LTUS:450:BDES") { field(DESC, "Desired B-Field") field(PINI, "NO") field(DRVH, "52.0972") field(DRVL, "0.2564") field(HOPR, "52.0972") field(LOPR, "0.2564") field(PREC, "7") field(EGU, "kG") field(MDEL, "-1") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:450:IDES2BDES") field(OUT, "QUAD:LTUS:450:B2IDES PP") info(autosaveFields,"VAL") } record(sub, "QUAD:LTUS:450:B2IDES") { field(DESC, "Convert Desired B-Field to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:450:POLYCOEF") field(INPC, "QUAD:LTUS:450:POLYCOEF.A") field(INPD, "QUAD:LTUS:450:POLYCOEF.B") field(PREC, "7") field(EGU, "kG") field(HOPR, "52.0972") field(LOPR, "0.2564") field(MDEL, "-1") field(INPE, "QUAD:LTUS:450:BDES.DRVH") field(INPF, "QUAD:LTUS:450:BDES.DRVL") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:450:IDES") } record(sub, "QUAD:LTUS:450:BNOM") { field(DESC, "Nominal Field") field(PINI, "YES") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:450:POLYCOEF") field(INPC, "QUAD:LTUS:450:POLYCOEF.A") field(INPD, "QUAD:LTUS:450:POLYCOEF.B") field(INPE, "QUAD:LTUS:450:BDES.DRVH") field(INPF, "QUAD:LTUS:450:BDES.DRVL") field(EGU, "kG") field(HOPR, "52.0972") field(LOPR, "0.2564") field(PREC, "7") field(VAL, "0.0") field(FLNK, "QUAD:LTUS:450:INOM") } record(sub, "QUAD:LTUS:450:BACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:450:BDES.VAL") field(INPB, "QUAD:LTUS:450:BDES.DRVH") field(INPC, "QUAD:LTUS:450:BDES.DRVL") field(INPD, "QUAD:LTUS:450:BDELTAS.I") field(INPE, "QUAD:LTUS:450:BDELTAS.J") field(INPG, "QUAD:LTUS:450:STATE") field(INPH, "QUAD:LTUS:450:HSTA") field(EGU, "kG") field(HOPR, "52.0972") field(LOPR, "0.2564") field(PREC, "7") field(BRSV, "INVALID") } record(sub, "QUAD:LTUS:450:BMONLIMITS") { field(DESC, "MON Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:450:BDES.VAL") field(INPB, "QUAD:LTUS:450:BDES.DRVH") field(INPC, "QUAD:LTUS:450:BDES.DRVL") field(INPD, "QUAD:LTUS:450:BDELTAS.K") field(INPE, "QUAD:LTUS:450:BDELTAS.L") field(INPG, "QUAD:LTUS:450:STATE") field(INPH, "QUAD:LTUS:450:HSTA") field(EGU, "kG") field(HOPR, "52.0972") field(LOPR, "0.2564") field(PREC, "7") field(BRSV, "INVALID") } record(seq, "QUAD:LTUS:450:BLIMITS") { field(DESC, "ACT Limits") field(PREC, "7") field(DOL1, "QUAD:LTUS:450:BLIMITS") field(LNK1, "QUAD:LTUS:450:BACTLIMITS.F PP") field(DOL2, "QUAD:LTUS:450:BACTLIMITS.I") field(LNK2, "QUAD:LTUS:450:BACT.HIGH") field(DOL3, "QUAD:LTUS:450:BACTLIMITS.J") field(LNK3, "QUAD:LTUS:450:BACT.LOW") field(DOL4, "QUAD:LTUS:450:BACTLIMITS.K") field(LNK4, "QUAD:LTUS:450:BACT.HIHI") field(DOL5, "QUAD:LTUS:450:BACTLIMITS.L") field(LNK5, "QUAD:LTUS:450:BACT.LOLO") field(DOL6, "QUAD:LTUS:450:BLIMITS") field(LNK6, "QUAD:LTUS:450:BMONLIMITS.F PP") field(DOL7, "QUAD:LTUS:450:BMONLIMITS.I") field(LNK7, "QUAD:LTUS:450:BMON.HIGH") field(DOL8, "QUAD:LTUS:450:BMONLIMITS.J") field(LNK8, "QUAD:LTUS:450:BMON.LOW") field(DOL9, "QUAD:LTUS:450:BMONLIMITS.K") field(LNK9, "QUAD:LTUS:450:BMON.HIHI") field(DOLA, "QUAD:LTUS:450:BMONLIMITS.L") field(LNKA, "QUAD:LTUS:450:BMON.LOLO") field(FLNK, "QUAD:LTUS:450:ILIMITS") field(SCAN, "5 second") } record(ao, "QUAD:LTUS:450:BCTRL") { field(DESC, "B-Perturb") field(PREC, "7") field(EGU, "kG") field(DRVH, "52.0972") field(DRVL, "0.2564") field(HOPR, "52.0972") field(LOPR, "0.2564") # 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, "QUAD:LTUS:450: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, "QUAD:LTUS:450:BCTRLGO") { field(DESC, "Update DES and perturb") field(PREC, "7") # Disable BACT limits field(DOL1, "1") field(LNK1, "QUAD:LTUS:450:BLIMITS.VAL") # Update BDES with the BCTRL (slider) value field(DOL2, "QUAD:LTUS:450:BCTRL.VAL") field(LNK2, "QUAD:LTUS:450:BDES PP") field(DOL3, "1") field(LNK3, "QUAD:LTUS:450:IDIRECT.PROC PP") field(DOL4, "1") field(LNK4, "QUAD:LTUS:450:CHECKSTDZLOST.PROC PP") field(DOL5, "QUAD:LTUS:450:BCTRL.VAL") field(LNK5, "QUAD:LTUS:450:BCTRLSUB PP") # Re-enable BACT limits field(DOL6, "0") field(LNK6, "QUAD:LTUS:450:BLIMITS.VAL") } # Convert B-field to Current and output to ISETPT record(sub, "QUAD:LTUS:450:BCTRLSUB") { field(DESC, "Feedback") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:450:POLYCOEF") field(INPC, "QUAD:LTUS:450:POLYCOEF.A") field(INPD, "QUAD:LTUS:450:POLYCOEF.B") field(INPE, "QUAD:LTUS:450:BDES.DRVH") field(INPF, "QUAD:LTUS:450:BDES.DRVL") field(PREC, "7") field(EGU, "kG") field(HOPR, "52.0972") field(LOPR, "0.2564") field(MDEL, "-1") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:450:ISETPT") } record(ao, "QUAD:LTUS:450:BDESPREVTRIM") { field(DESC, "trim bdes for undo") field(DTYP, "Soft Channel") field(DRVH, "52.0972") field(DRVL, "0.2564") field(EGU, "kG") field(HOPR, "52.0972") field(LOPR, "0.2564") field(PREC, "7") field(PINI, "YES") info(autosaveFields,"VAL") } record(stringin, "QUAD:LTUS:450:MADNAME") { field(DESC, "MAD deck nomenclature") field(PINI, "YES") field(VAL, "QDL19") } record(ai, "QUAD:LTUS:450: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, "3342.598386") } record(ao, "QUAD:LTUS:450:BMAX") { field(DESC, "Max B-Field") field(DTYP, "Soft Channel") field(DRVH, "52.0972") field(DRVL, "0.2564") field(EGU, "kG") field(HOPR, "52.0972") field(LOPR, "0.2564") field(PREC, "7") field(PINI, "YES") field(VAL, "52.0972") field(FLNK, "QUAD:LTUS:450:BSTEP") } record(ao, "QUAD:LTUS:450:BMIN") { field(DESC, "Min B-Field") field(DTYP, "Soft Channel") field(DRVH, "52.0972") field(DRVL, "0.2564") field(EGU, "kG") field(HOPR, "52.0972") field(LOPR, "0.2564") field(PREC, "7") field(PINI, "YES") field(VAL, "0.2564") field(FLNK, "QUAD:LTUS:450:BSTEP") } record(ao, "QUAD:LTUS:450:BDESSAVE") { field(DESC, "bdes for save/load") field(DTYP, "Soft Channel") field(DRVH, "52.0972") field(DRVL, "0.2564") field(EGU, "kG") field(HOPR, "52.0972") field(LOPR, "0.2564") field(PINI, "YES") field(PREC, "7") } # This record is processed by QUAD:LTUS:450: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, "QUAD:LTUS:450:BCON") { field(DESC, "Config B-Field ") field(DTYP, "Soft Channel") field(PREC, "7") field(EGU, "kG") field(HOPR, "52.0972") field(LOPR, "0.2564") field(DRVH, "52.0972") field(DRVL, "0.2564") # 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 , "QUAD:LTUS:450:ICON2BCON") field(OMSL, "closed_loop") field(OUT, "QUAD:LTUS:450:B2ICON PP") info(autosaveFields,"VAL") } record(sub, "QUAD:LTUS:450:B2ICON") { field(DESC, "Convert Desired ICon to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:450:POLYCOEF") field(INPC, "QUAD:LTUS:450:POLYCOEF.A") field(INPD, "QUAD:LTUS:450:POLYCOEF.B") field(PREC, "7") field(EGU, "kG") field(HOPR, "52.0972") field(LOPR, "0.2564") field(MDEL, "-1") field(INPE, "QUAD:LTUS:450:BCON.DRVH") field(INPF, "QUAD:LTUS:450:BCON.DRVL") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:450: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, "QUAD:LTUS:450:BSTEP") { field(DESC, "B-Field step size") field(CALC, "(C==3)||(D==3)?0:ABS(A-B)*0.005") field(INPA, "QUAD:LTUS:450:BMAX") field(INPB, "QUAD:LTUS:450:BMIN") field(INPC, "QUAD:LTUS:450:BMIN.SEVR") field(INPD, "QUAD:LTUS:450:BMAX.SEVR") field(EGU, "kG") 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,"QUAD:LTUS:450:BCTRLDISABLECALC") { field(DESC, "Calc for disabling BCTRL") field(ASG, "Internal") field(CALC, "A?2:1") field(INPA, "QUAD:LTUS:450:ONLINE CP") field(OUT, "QUAD:LTUS:450:BCTRLDISABLEFOUT PP") } record(fanout, "QUAD:LTUS:450:BCTRLDISABLEFOUT") { field(DESC, "Disable BCTRL fanout") field(SELM, "Specified") field(SELL, "QUAD:LTUS:450:BCTRLDISABLECALC") field(LNK1, "QUAD:LTUS:450:BCTRLDISABLE") field(LNK2, "QUAD:LTUS:450:BCTRLENABLE") } record(stringout, "QUAD:LTUS:450:BCTRLDISABLE") { field(DESC, "Disable BCTRL") field(DTYP, "Soft Channel") field(OUT, "QUAD:LTUS:450:BCTRL.ASG") field(VAL, "NOWRITE") field(FLNK, "QUAD:LTUS:450:BCTRLDISV_UPDATE") } record(stringout, "QUAD:LTUS:450:BCTRLENABLE") { field(DESC, "Enable BCTRL") field(DTYP, "Soft Channel") field(OUT, "QUAD:LTUS:450:BCTRL.ASG") field(VAL, "") field(FLNK, "QUAD:LTUS:450:BCTRLDISV_UPDATE") } record(calcout, "QUAD:LTUS:450:BCTRLDISV_UPDATE") { field(DESC, "Calc for updating BCTRL.DISV") field(ASG, "Internal") field(CALC, "A") field(INPA, "QUAD:LTUS:450:ONLINE") field(OUT, "QUAD:LTUS:450: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,"QUAD:LTUS:450:BACT and MON\n are processed via links from \n QUAD:LTUS:450:IACT (device raw value readback 1)\n and\n QUAD:LTUS:450: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 QUAD:LTUS:450:POLYCOEF\nC = First polynomial coefficient (offset if linear)\nD = Second polynomial coefficient (slope if linear)\nE = QUAD:LTUS:450: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,"QUAD:LTUS:450:BDES\n is processed when set by CA users or \n QUAD:LTUS:450: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,"QUAD:LTUS:450: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 QUAD:LTUS:450: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 (QUAD:LTUS:450: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,"QUAD:LTUS:450:B*LIMITS and QUAD:LTUS:450:BLIMITS:\n Calculate alarm and warning limits based on \n deltas from QUAD:LTUS:450: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,"QUAD:LTUS:450: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,"QUAD:LTUS:450: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, "QUAD:LTUS:450: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, "QUAD:LTUS:450:MPSBTOL") { field(DESC, "Absolute mps tol") field(EGU, "kG") field(PREC, "2") field(CALC, "ABS(A)*0.02") field(INPA, "QUAD:LTUS:450:BMAX") field(PINI, "YES") } # # 21-Aug-2013: K. Luchini # Set channel access security so that users # cannot easily change values. record(ao, "QUAD:LTUS:450:MPSBMAX") { field(DESC, "MPS Max B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "52.0972") field(DRVL, "0.2564") field(PINI, "YES") field(VAL, "52.0972") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:450:MPSBMIN") { field(DESC, "MPS Min B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "52.0972") field(DRVL, "0.2564") field(PINI, "YES") field(VAL, "0.2564") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:450:MPSBLLIM") { field(DESC, "MPS Low Limit B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "52.0972") field(DRVL, "0.2564") field(PINI, "YES") field(VAL, "0.2564") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:450:MPSBLLIM2") { field(DESC, "MPS Low Limit #2 B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "52.0972") field(DRVL, "0.2564") field(PINI, "YES") field(VAL, "0.2564") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } # Set the default to Std record(mbbo, "QUAD:LTUS:450: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, "QUAD:LTUS:450:MPSLIMITS.E PP") } record(aSub, "QUAD:LTUS:450: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, "QUAD:LTUS:450:MPS.RVAL") field(INPB, "QUAD:LTUS:450:BADIFF") field(INPC, "QUAD:LTUS:450:BDELTAS.N") field(INPD, "QUAD:LTUS:450:BACT") field(INPE, "QUAD:LTUS:450:MPSBITMASK.RVAL") field(INPF, "QUAD:LTUS:450:MPSBLLIM") field(INPG, "QUAD:LTUS:450:MPSBMIN") field(INPH, "QUAD:LTUS:450:MPSBMAX") field(INPI, "QUAD:LTUS:450: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, "QUAD:LTUS:450:INTOL.RVAL PP") field(OUTB, "QUAD:LTUS:450:INTOL_BMIN.RVAL PP") field(OUTC, "QUAD:LTUS:450:INTOL_BRANGE.RVAL PP") field(OUTD, "QUAD:LTUS:450: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, "QUAD:LTUS:450:INTOL") { field(DESC, "BACT within MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:450:MPSLIMITS.VALA") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "QUAD:LTUS:450:INTOL_BMIN") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:450:MPSLIMITS.VALB") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "QUAD:LTUS:450:INTOL_BMIN2") { field(DESC, "MPS tol #2") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:450:MPSLIMITS.VALD") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "QUAD:LTUS:450:INTOL_BRANGE") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:450: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, "QUAD:LTUS:450:CHCKITOL") { field(DESC, "Absolute Check I Tolerance") field(EGU, "A") field(FLNK, "QUAD:LTUS:450:TRIMITOL") field(CALC, "ABS(A*B)") field(INPA, "QUAD:LTUS:450:CHCKBTOL") field(INPB, "QUAD:LTUS:450:POLYCOEF.B") field(PREC, "9") } record(calc, "QUAD:LTUS:450:TRIMBTOL") { field(EGU, "kG") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(DESC, "Absolute Trim Tolerance") field(CALC, "ABS(A)/2") field(INPA, "QUAD:LTUS:450:CHCKBTOL") field(FLNK, "QUAD:LTUS:450:CHCKITOL") } record(calc, "QUAD:LTUS:450:CHCKBTOL") { field(DESC, "Check absolute tolerance") field(EGU, "A") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(FLNK, "QUAD:LTUS:450:TRIMBTOL") field(CALC, "MAX(ABS(A),ABS(C))*(B/1000000)") field(INPA, "QUAD:LTUS:450:BDES.HOPR") field(INPB, "QUAD:LTUS:450:STABILITY") field(INPC, "QUAD:LTUS:450:BDES.LOPR") } record(longout, "QUAD:LTUS:450: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, "QUAD:LTUS:450:CHCKBTOL") } record(calc, "QUAD:LTUS:450:TRIMITOL") { field(DESC, "Absolute Trim I Tolerance") field(EGU, "kG") field(CALC, "ABS(A*B)") field(INPA, "QUAD:LTUS:450:POLYCOEF.B") field(INPB, "QUAD:LTUS:450:TRIMBTOL") field(PREC, "9") } record(ai, "QUAD:LTUS:450:TRIMBTOLR") { field(DESC, "Relative trim tol") field(PREC, "4") field(EGU, "%") field(HOPR, "1.0") field(LOPR, "0.0") field(PINI, "YES") } record(ai, "QUAD:LTUS:450: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, "QUAD:LTUS:450:FBCKFCOM") { field(ZNAM, "CA") field(ONAM, "FCOM") field(DESC, "CA Mode") field(PINI, "YES") field(SDIS, "0") } record(bo, "QUAD:LTUS:450:PAU") { field(ZNAM, "NotConfigured") field(ONAM, "Configured") field(DESC, "PAU Present") field(PINI, "YES") field(SDIS, "0") field(FLNK, "QUAD:LTUS:450:PAUGO") } record(fanout, "QUAD:LTUS:450:PAUGO") { field(DESC, "PAU control") field(LNK1, "QUAD:LTUS:450:PAUSTOP") field(LNK2, "QUAD:LTUS:450: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, "QUAD:LTUS:450:PAUSTART") { field(DESC, "Setup for PAU On") field(SDIS, "QUAD:LTUS:450: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, "QUAD:LTUS:450:PAUSTOP") { field(DESC, "Setup for PAU Off") field(SDIS, "QUAD:LTUS:450: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, "QUAD:LTUS:450:MCORDEVNAME") { field(DESC, "PS device name") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, "QUAD:LTUS:180:") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "QUAD:LTUS:450: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, "QUAD:LTUS:450:PSTYPE.RVAL") field(INPC, "QUAD:LTUS:450:TURNEDOFF.RVAL") field(INPD, "QUAD:LTUS:450:CONFIG.RVAL") field(INPE, "QUAD:LTUS:450:PSCATEGORY.RVAL") field(INPF, "QUAD:LTUS:450:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "QUAD:LTUS:450:AUTOCTRL.RVAL") field(INPJ, "QUAD:LTUS:450:OUTOFSERVICE.RVAL") field(INPL, "QUAD:LTUS:450:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "QUAD:LTUS:450:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "QUAD:LTUS:450:PAU") field(INPP, "QUAD:LTUS:450:CALBDISABLE.RVAL") field(INPQ, "QUAD:LTUS:450:PTRBDISABLE.RVAL") field(INPR, "QUAD:LTUS:450:TRIMDISABLE.RVAL") field(INPS, "QUAD:LTUS:450:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "QUAD:LTUS:450:FBCK") field(INPU, "QUAD:LTUS:450:TRIMTYPE.RVAL") field(INPV, "QUAD:LTUS:450:STDZDIRECT.RVAL") field(INPW, "QUAD:LTUS:450:DEGAUSENABLE.RVAL") field(FLNK, "QUAD:LTUS:450:HSTA") } record(longin, "QUAD:LTUS:450:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "QUAD:LTUS:450:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "QUAD:LTUS:450: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, "QUAD:LTUS:450: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, "QUAD:LTUS:450: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, "QUAD:LTUS:450: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, "QUAD:LTUS:450: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, "QUAD:LTUS:450: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 QUAD:LTUS:450:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses QUAD:LTUS:450:FBCK. # This PV should be replaced by QUAD:LTUS:450: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, "QUAD:LTUS:450: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, "QUAD:LTUS:450: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, "QUAD:LTUS:450: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, "QUAD:LTUS:180:OUTOFSERVICE CPP NMS") field(OMSL, "closed_loop") field(FLNK, "QUAD:LTUS:450:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"QUAD:LTUS:450:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "QUAD:LTUS:450:OUTOFSERVICE NPP NMS") field(OUT, "QUAD:LTUS:450:ONLINE PP") } record(bo, "QUAD:LTUS:450:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "QUAD:LTUS:450: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, "QUAD:LTUS:450: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, "QUAD:LTUS:450: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, "QUAD:LTUS:450: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, "QUAD:LTUS:450: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, "QUAD:LTUS:450: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, "QUAD:LTUS:450: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, "QUAD:LTUS:450: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, "QUAD:LTUS:450: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, "QUAD:LTUS:450: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, "QUAD:LTUS:450: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, "QUAD:LTUS:450:TRIMTYPE") } record(stringout, "QUAD:LTUS:450:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "QUAD:LTUS:180:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "QUAD:LTUS:450:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "QUAD:LTUS:450:STATE.RVAL") field(INPB, "QUAD:LTUS:450:INTLKSUMY.RVAL") field(OUT, "QUAD:LTUS:450:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:LTUS:450: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, "QUAD:LTUS:450:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "QUAD:LTUS:450:STATE.RVAL") field(INPB, "QUAD:LTUS:450:INTLKSUMY.RVAL") field(OUT, "QUAD:LTUS:450:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:LTUS:450:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "QUAD:LTUS:450:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "QUAD:LTUS:450: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, "QUAD:LTUS:450: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, "QUAD:LTUS:450: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, "QUAD:LTUS:450: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,"QUAD:LTUS:450: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("QUAD:LTUS:450:TURNEDOFF",3140,1907,0,1,"QUAD:LTUS:450:TURNEDOFF") #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "QUAD:LTUS:450:STATSUB") { field(DESC, "Build STATus ") field(INAM, "mgntInit") field(SNAM, "mgntSlcStat") field(INPA, "QUAD:LTUS:450:BACT.STAT") field(INPB, "QUAD:LTUS:450:BDES.STAT") field(INPC, "QUAD:LTUS:450: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, "QUAD:LTUS:450:BACT.SEVR") field(INPH, "QUAD:LTUS:450:BDES.SEVR") field(INPI, "QUAD:LTUS:450: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, "QUAD:LTUS:450:STATE.RVAL") field(INPN, "QUAD:LTUS:450:STDZOK") field(INPO, "QUAD:LTUS:450:CALBOK") field(INPP, "QUAD:LTUS:450:OUTOFSERVICE.RVAL") field(INPQ, "QUAD:LTUS:450:CONFIG.RVAL") field(INPR, "QUAD:LTUS:450:HSTA") field(INPS, "QUAD:LTUS:450:CTRL.RVAL") field(INPT, "QUAD:LTUS:450:DEGAUSOK") field(INPV, "QUAD:LTUS:450: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, "QUAD:LTUS:450:STAT") } record(longout, "QUAD:LTUS:450:STAT") { field(DESC, "STAT sent to SLC") field(SCAN, "Passive") field(FLNK, "QUAD:LTUS:450:STATCTRLSUB") field(DOL, "QUAD:LTUS:450:STATSUB.VAL") field(OMSL, "closed_loop") } record(sSub, "QUAD:LTUS:450:STATCTRLSUB") { field(DESC, "Decode SLC STAT into mbbo") field(INAM, "mgntInit") field(SNAM, "mgntStatDecode") field(INPA, "QUAD:LTUS:450:STAT") field(INPB, "QUAD:LTUS:450:HSTA") field(INPD, "QUAD:LTUS:450:ONOFFCTRL.RVAL") field(FLNK, "QUAD:LTUS:450:STATMSG") } record(mbbo, "QUAD:LTUS:450: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, "QUAD:LTUS:450:UNAVAILGO") field(DOL, "QUAD:LTUS:450:STATCTRLSUB.W") } record(seq, "QUAD:LTUS:450:UNAVAILGO") { field(DESC, "Process UNAVAIL") field(DOL1, "QUAD:LTUS:450:STATSUB.U") field(LNK1, "QUAD:LTUS:450:UNAVAIL PP") } record(stringout, "QUAD:LTUS:450:SNLSTATMSG") { field(DTYP, "Soft Channel") } #! TextBox(TB0,820,1000,1200,1220,0,"Dialog",12,1,16777215,"QUAD:LTUS:450:STATUSSUB - future\nOverall device status - takes input from action snls, record sevrs, master snl(s) and outputs final status\n\nInputs:\nA - QUAD:LTUS:450:CTRLSTATUS - snl status\nB - MGNT:CTRLSTATUS - master list status\nC\nD - QUAD:LTUS:450: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,"QUAD:LTUS:450STATSUB\nformat control bo's into slc STAT\n\nInputs:\nA - QUAD:LTUS:450:STATUS\nC - QUAD:LTUS:450:ON\nD - QUAD:LTUS:450:STDZOK\nE - QUAD:LTUS:450:CALBOK\nF - QUAD:LTUS:450:BACTDRIFT (future)\nG -\nH- QUAD:LTUS:450:DACSTATUS\nI -QUAD:LTUS:450:ADCSTATUS\nJ - QUAD:LTUS:450:BACTSTATUS\nK - QUAD:LTUS:450:BDESSTATUS\nL - QUAD:LTUS:450:RIPLSTATUS\n\nOutput:\nP - QUAD:LTUS:450: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, "QUAD:LTUS:450: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, "QUAD:LTUS:450: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, "QUAD:LTUS:450: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, "QUAD:LTUS:450: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 b-field of a slave with out a powered trim coil # equal to the main desired current and pass backwards # through the IVB poly. record(sub, "QUAD:LTUS:450:IDES2BDES") { field(DESC, "Cal BDES") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "QUAD:LTUS:450:IDES2BDES") field(INPB, "QUAD:LTUS:450:POLYCOEF") field(INPC, "QUAD:LTUS:450:POLYCOEF.A") field(INPD, "QUAD:LTUS:450:POLYCOEF.B") field(INPE, "QUAD:LTUS:180:IDES CP MS") field(INPF, "QUAD:LTUS:180:BDELTAS PP") field(INPG, "100") field(EGU, "kG") field(HOPR, "52.0972") field(LOPR, "0.2564") field(HIHI, "52.0972") field(LOLO, "0.2564") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "52.0972") field(LOW, "0.2564") field(FLNK, "QUAD:LTUS:450:BDES") } # Calcuate the bcon of a slave using # the main desired current and pass backwards # through the IVB poly. # the trim b-field is acutally amps. record(sub, "QUAD:LTUS:450:ICON2BCON") { field(DESC, "Cal BCON") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "QUAD:LTUS:450:ICON2BCON") field(INPB, "QUAD:LTUS:450:POLYCOEF") field(INPC, "QUAD:LTUS:450:POLYCOEF.A") field(INPD, "QUAD:LTUS:450:POLYCOEF.B") field(INPE, "QUAD:LTUS:180:ICON CP NMS") field(INPF, "QUAD:LTUS:180:BDELTAS PP") field(INPG, "100") field(EGU, "kG") field(HOPR, "52.0972") field(LOPR, "0.2564") field(HIHI, "52.0972") field(LOLO, "0.2564") field(PREC, "7") field(BRSV, "INVALID") # Set MINOR alarms for main as the default, slaves will set NO_ALARM field(HHSV, "NO_ALARM") field(HSV, "NO_ALARM") field(LSV, "NO_ALARM") field(LLSV, "NO_ALARM") field(HIGH, "52.0972") field(LOW, "0.2564") field(FLNK, "QUAD:LTUS:450:BCON") }#! 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, "QUAD:LTUS:550:IACT") { field(DESC, "Current") field(INP, "QUAD:LTUS:540:IACT CP NMS") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "QUAD:LTUS:550:BACT") info(autosaveFields,"HYST") } record(bi, "QUAD:LTUS:550:STATE") { field(DESC, "PS On/Off Status") field(DTYP, "Raw Soft Channel") field(INP, "QUAD:LTUS:540:STATE CP MS") field(ZSV, "MAJOR") field(ZNAM, "OFF") field(ONAM, "ON") } record(ao, "QUAD:LTUS:550:IDES") { field(DESC, "Desired Current") field(PREC, "3") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(MDEL, "-1") field(HIHI, "200.0") field(LOLO, "0.0") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "QUAD:LTUS:550:BDELTAS") field(DRVH, "200.0") field(DRVL, "0.0") field(DOL, "QUAD:LTUS:550: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, "QUAD:LTUS:550:ICTRL PP") } # This record is processed by QUAD:LTUS:550:ICON") # Note: we are not setting alarms here. record(ao, "QUAD:LTUS:550:ICON") { field(DESC, "Config I") field(DTYP, "Soft Channel") field(PREC, "3") field(HOPR, "200.0") field(LOPR, "0.0") field(DRVH, "200.0") field(DRVL, "0.0") field(DOL, "QUAD:LTUS:550:B2ICON.K") field(OMSL, "closed_loop") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:550:INOM") { field(DESC, "Nominal Current") field(DOL, "QUAD:LTUS:550:BNOM.K") field(OMSL, "closed_loop") field(PREC, "3") field(EGU, "A") field(DRVH, "200.0") field(DRVL, "0.0") field(HOPR, "200.0") field(LOPR, "0.0") } record(ao, "QUAD:LTUS:550:ICTRL") { field(DESC, "Set Current") field(PREC, "3") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(DRVH, "200.0") field(DRVL, "0.0") field(MDEL, "-1") field(FLNK, "QUAD:LTUS:550:ICTRLGO") field(OMSL, "supervisory") info(autosavefields,"VAL") } record(seq, "QUAD:LTUS:550:ICTRLGO") { field(DESC, "Process Current Setpoint") field(PREC, "3") # Set ISETPT to supervisory field(DOL1, "0") field(LNK1, "QUAD:LTUS:550:ISETPT.OMSL") field(DOL2, "QUAD:LTUS:550:ICTRL") field(LNK2, "QUAD:LTUS:550:ISETPT PP") # Set ISETPT to closed loop - get data from BCTRLSUB.K field(DOL3, "1") field(LNK3, "QUAD:LTUS:550:ISETPT.OMSL") } record(ao, "QUAD:LTUS:550:IMAX") { field(DESC, "Max I") field(DTYP, "Soft Channel") field(DRVH, "200.0") field(DRVL, "0.0") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(PREC, "3") field(PINI, "YES") field(VAL, "200.0") field(FLNK, "QUAD:LTUS:550:IMIN") } record(ao, "QUAD:LTUS:550:IMIN") { field(DESC, "Min I") field(DTYP, "Soft Channel") field(DRVH, "200.0") field(DRVL, "0.0") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(PREC, "3") field(VAL, "0.0") field(FLNK, "QUAD:LTUS:550:IRANGE") } record(sel, "QUAD:LTUS:550:IACTPREVOK") { field(DESC, "Last Good Current") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(PREC, "3") field(NVL, "QUAD:LTUS:550:BACT.SEVR") field(INPA, "QUAD:LTUS:550:IACT NPP MS") field(INPB, "QUAD:LTUS:550:IACTPREVOK NPP MS") field(INPC, "QUAD:LTUS:550:IACTPREVOK NPP MS") field(INPD, "QUAD:LTUS:550:IACTPREVOK NPP MS") } record(sub, "QUAD:LTUS:550:IACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:550:IDES") field(INPB, "QUAD:LTUS:550:ISETPT.DRVH") field(INPC, "QUAD:LTUS:550:ISETPT.DRVL") field(INPD, "QUAD:LTUS:550:IDELTAS.I") field(INPE, "QUAD:LTUS:550:IDELTAS.J") field(INPG, "QUAD:LTUS:550:STATE") field(INPH, "QUAD:LTUS:550:HSTA") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(sub, "QUAD:LTUS:550:IMONLIMITS") { field(DESC, "Aux Current Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:550:IDES") field(INPB, "QUAD:LTUS:550:ISETPT.DRVH") field(INPC, "QUAD:LTUS:550:ISETPT.DRVL") field(INPD, "QUAD:LTUS:550:IDELTAS.K") field(INPE, "QUAD:LTUS:550:IDELTAS.L") field(INPG, "QUAD:LTUS:550:STATE") field(INPH, "QUAD:LTUS:550:HSTA") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(seq, "QUAD:LTUS:550:ILIMITS") { field(DESC, "Set ACT and MON Limits") field(PREC, "3") field(DOL1, "QUAD:LTUS:550:BLIMITS") field(LNK1, "QUAD:LTUS:550:IACTLIMITS.F PP") field(DOL2, "QUAD:LTUS:550:IACTLIMITS.I") field(LNK2, "QUAD:LTUS:550:IACT.HIGH") field(DOL3, "QUAD:LTUS:550:IACTLIMITS.J") field(LNK3, "QUAD:LTUS:550:IACT.LOW") field(DOL4, "QUAD:LTUS:550:IACTLIMITS.K") field(LNK4, "QUAD:LTUS:550:IACT.HIHI") field(DOL5, "QUAD:LTUS:550:IACTLIMITS.L") field(LNK5, "QUAD:LTUS:550:IACT.LOLO") field(DOL6, "QUAD:LTUS:550:BLIMITS") field(LNK6, "QUAD:LTUS:550:IMONLIMITS.F PP") field(DOL7, "QUAD:LTUS:550:IMONLIMITS.I") field(LNK7, "QUAD:LTUS:550:IMON.HIGH") field(DOL8, "QUAD:LTUS:550:IMONLIMITS.J") field(LNK8, "QUAD:LTUS:550:IMON.LOW") field(DOL9, "QUAD:LTUS:550:IMONLIMITS.K") field(LNK9, "QUAD:LTUS:550:IMON.HIHI") field(DOLA, "QUAD:LTUS:550:IMONLIMITS.L") field(LNKA, "QUAD:LTUS:550: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, "QUAD:LTUS:550:IDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntRawDeltas") field(INPD, "QUAD:LTUS:550:TRIMBTOL") field(INPE, "QUAD:LTUS:550:CHCKBTOL") field(INPF, "QUAD:LTUS:550:BDELTAS.K") field(INPG, "QUAD:LTUS:550:BDELTAS.L") field(INPH, "QUAD:LTUS:550: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, "QUAD:LTUS:550:STDZITOLR") field(INPC, "QUAD:LTUS:550:STDZITOL") field(FLNK, "") } # All ps controllers with on/off control will set the macro ONOF # as follows: # # ONOF = QUAD:LTUS:540: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, "QUAD:LTUS:550: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 = QUAD:LTUS:540:RESET PP # record(bo, "QUAD:LTUS:550: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, "QUAD:LTUS:550:RAMPSTATE") { field(DESC, "PS Ramp Status") field(DTYP, "Soft Channel") field(DOL, "QUAD:LTUS:540: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, "QUAD:LTUS:550: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, "QUAD:LTUS:550:TRIMRAMPRATE") field(OUT, "") field(FLNK, "QUAD:LTUS:550:STDZDLY") } record(ao, "QUAD:LTUS:550:ISETPT") { field(DESC, "Current Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(DRVH, "200.0") field(DRVL, "0.0") field(MDEL, "-1") field(OUT, "") field(DOL, "QUAD:LTUS:550: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, "QUAD:LTUS:550:IMON") { field(DESC, "Aux Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(INP, "QUAD:LTUS:540:IMON CP NMS") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "QUAD:LTUS:550:BMON") } record(ao, "QUAD:LTUS:550:IRIPL") { field(DESC, "Ripple Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(DOL, "QUAD:LTUS:540:IRIPL CP NMS") field(OMSL, "closed_loop") field(EGU, "A") field(DRVH, "1.0") field(HOPR, "1.0") field(PREC, "3") field(FLNK, "QUAD:LTUS:550:IRIPLOK") } record(sub, "QUAD:LTUS:550:IRIPLOK") { field(DESC, "Ripple Current Status") field(INAM, "mgntInit") field(SNAM, "mgntRiplOK") field(INPA, "QUAD:LTUS:550:IRIPL.VAL") field(INPB, "QUAD:LTUS:550: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, "QUAD:LTUS:550:R") { field(DESC, "Resistance") field(EGU, "Ohms") field(PREC, "4") field(PINI, "YES") field(DOL, "QUAD:LTUS:540: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, "QUAD:LTUS:550:IGND") { field(DESC, "Ground Current") field(EGU, "A") field(PREC, "6") field(PINI, "YES") field(DOL, "QUAD:LTUS:540:IGND CP MS") field(OMSL, "closed_loop") } record(bi, "QUAD:LTUS:550:INTLKSUMY") { field(DESC, "Interlock Summary") field(INP, "QUAD:LTUS:540:INTLKSUMY CP MS") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(ZNAM, "OK") field(ONAM, "FAULT") field(PINI, "NO") } record(mbbo, "QUAD:LTUS:550: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, "QUAD:LTUS:540:COOLING CP NMS") field(OMSL, "closed_loop") } # The following PV is processed by :BACTFO # which is processed by :BACT record(fanout, "QUAD:LTUS:550:IACTFO") { field(DESC, "IACT processing") field(SELM, "All") field(LNK1, "QUAD:LTUS:550:IACTPREVOK") field(LNK2, "QUAD:LTUS:550:IDIFF") field(LNK3, "QUAD:LTUS:550:IADIFF") field(LNK4, "QUAD:LTUS:550:IRATIO") field(LNK5, "QUAD:LTUS:550:IDIRECT") field(LNK6, "QUAD:LTUS:550:IACTPOL_CHECK") } record(calc, "QUAD:LTUS:550:IDIFF") { field(DESC, "IDES-IACT") field(CALC, "A-B") field(INPA, "QUAD:LTUS:550:IDES") field(INPB, "QUAD:LTUS:550:IACT") field(EGU, "A") field(PREC, "9") field(HOPR, "200.0") field(LOPR, "0.0") } record(calc, "QUAD:LTUS:550:IADIFF") { field(DESC, "Absolute IDES-IACT") field(CALC, "A<0?ABS(A):A") field(INPA, "QUAD:LTUS:550:IDIFF") field(PREC, "9") } record(calc, "QUAD:LTUS:550:IRATIO") { field(DESC, "IDES-IACT/IMAX") field(CALC, "B?A/B:0") field(INPA, "QUAD:LTUS:550:IDIFF") field(INPB, "QUAD:LTUS:550:IDES.DRVH") field(PREC, "9") } record(calcout, "QUAD:LTUS:550:IRANGE") { field(DESC, "Current Range") field(PINI, "YES") field(CALC, "ABS(A-B)") field(INPA, "QUAD:LTUS:550:IMIN") field(INPB, "QUAD:LTUS:550: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, "QUAD:LTUS:550: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, "QUAD:LTUS:550:IACT") field(FLNK, "QUAD:LTUS:550:IACTPOL") } record(bo, "QUAD:LTUS:550:IACTPOL") { field(DESC, "Actual I Polarity") field(DTYP, "Raw Soft Channel") field(DOL, "QUAD:LTUS:550: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,"QUAD:LTUS:550:I*LIMITS:\n Calculate alarm and warning limits based on \n deltas from QUAD:LTUS:550:IDELTAS and the\n QUAD:LTUS:550: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,"QUAD:LTUS:550:IACT: \n Get copy of QUAD:LTUS:550:I. \n",null) #! TextBox(TB12,1280,3100,1760,3200,0,"Dialog",12,1,16777215,"QUAD:LTUS:550: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,"QUAD:LTUS:550:IDES:\n Contains raw value calculated by \nQUAD:LTUS:550: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 \nQUAD:LTUS:550:BDELTAS.\n",null) #! TextBox(TB10,56,1940,316,2340,0,"Dialog",12,1,16777215,"QUAD:LTUS:550: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 QUAD:LTUS:550: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 QUAD:LTUS:550: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,"QUAD:LTUS:550:ISETPT:\n Sets the hardware. When fast feedback is set on, this record is\n set to closed loop mode by QUAD:LTUS:550:FBCKSTART sequence. When \n the loop is closed, this record takes input calculated by \n BFBCK only. When fast feedback is set off, QUAD:LTUS:550:FBCKSTOP \n will set it back to supervisory so that the value can be set by \n QUAD:LTUS:550: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, "QUAD:LTUS:550:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:550:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "QUAD:LTUS:550:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "QUAD:LTUS:550:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "QUAD:LTUS:550:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "QUAD:LTUS:550:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "1") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "QUAD:LTUS:550: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, "QUAD:LTUS:550:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "QUAD:LTUS:550:TRIMTYPE.RVAL") field(INPB, "QUAD:LTUS:550:CONFIG.RVAL") field(OUT, "QUAD:LTUS:550:TRIMMAXNUM PP") } record(longout, "QUAD:LTUS:550: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, "QUAD:LTUS:550: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, "QUAD:LTUS:540:TRIMRAMPRATE CP NMS") field(OMSL, "closed_loop") field(VAL, "") field(OUT, "QUAD:LTUS:550:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "QUAD:LTUS:550: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, "QUAD:LTUS:540:TRIMSETL CP NMS") field(OMSL, "closed_loop") field(VAL, "") } record(bo, "QUAD:LTUS:550: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, "QUAD:LTUS:550: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, "QUAD:LTUS:550: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, "0") } record(bo, "QUAD:LTUS:550:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "0") } record(ao, "QUAD:LTUS:550: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, "QUAD:LTUS:550:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "QUAD:LTUS:550: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, "QUAD:LTUS:550: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, "QUAD:LTUS:550:IMOVE") field(INPB, "QUAD:LTUS:550:IACT") field(INPC, "QUAD:LTUS:550:IRAMPRATE") field(INPD, "1.0") field(INPE, "QUAD:LTUS:550:TRIMDLYPCT") field(INPF, "QUAD:LTUS:550:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "QUAD:LTUS:550:RAMPTIME_LEFT PP") } record(longout, "QUAD:LTUS:550:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "QUAD:LTUS:550:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "QUAD:LTUS:550:RAMPDONE_CALC") } record(calc, "QUAD:LTUS:550:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "QUAD:LTUS:550:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "QUAD:LTUS:550:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "QUAD:LTUS:550: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, "QUAD:LTUS:550:RAMPTIME_LEFT") field(OUT, "QUAD:LTUS:550:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "QUAD:LTUS:550:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "QUAD:LTUS:550:RAMPTIME_LEFT NMS") field(OUT, "QUAD:LTUS:550:RAMPDONE PP") } record(bo, "QUAD:LTUS:550:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "QUAD:LTUS:550:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "QUAD:LTUS:550: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, "QUAD:LTUS:550: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, "QUAD:LTUS:550:STDZINIT") { field(DESC, "Proc. Stdz PVs on boot") field(PINI, "YES") field(DOL1, "1") field(DOL2, "1") field(DOL3, "1") field(LNK1, "QUAD:LTUS:550:DEBUG.PROC PP") field(LNK2, "QUAD:LTUS:550:STDZCYCLENUM.PROC PP") field(LNK3, "QUAD:LTUS:550:STDZDISABLE.PROC PP") field(LNK4, "QUAD:LTUS:550: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, "QUAD:LTUS:550:STDZSUB") { field(DESC, "Stdz subroutine") field(INAM, "mgntStdzInit") field(SNAM, "mgntStdz") field(BRSV, "INVALID") field(INPA, "QUAD:LTUS:550:STDZIMIN NPP NMS") field(INPB, "QUAD:LTUS:550:STDZIMAX NPP NMS") field(INPC, "QUAD:LTUS:550:STDZIFINAL NPP NMS") field(INPD, "QUAD:LTUS:550:STDZCYCLENUM NPP NMS") field(INPE, "QUAD:LTUS:550:STDZDIRECT.RVAL NPP NMS") field(INPF, "QUAD:LTUS:550:STDZDISABLE.RVAL CPP NMS") field(INPG, "QUAD:LTUS:550: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, "QUAD:LTUS:550:STDZWF PP") field(OUTB, "QUAD:LTUS:550: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, "QUAD:LTUS:550:STDZWF") } record(mbbo, "QUAD:LTUS:550: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, "QUAD:LTUS:550: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, "QUAD:LTUS:550:STDZMAINPS") { field(DESC, "Stdz by main or self") field(PINI, "YES") field(DTYP, "Soft Channel") field(ZNAM, "SELF") field(ONAM, "MAIN") } record(bo, "QUAD:LTUS:550: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, "QUAD:LTUS:550: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, "QUAD:LTUS:550: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, "QUAD:LTUS:550:STDZTOD") { field(DESC, "Successful Standardize Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "QUAD:LTUS:550:STDZLOSTTOD") { field(DESC, "Standardize Lost Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(longout, "QUAD:LTUS:550:STDZCYCLECNT") { field(DESC, "Cycle Count") field(PINI, "YES") } record(longout, "QUAD:LTUS:550: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, "QUAD:LTUS:550:STDZDIRECT") } # The default standardize direction is "UP" for # all LCLS Magnets.. record(bo, "QUAD:LTUS:550:STDZDIRECT") { field(DESC, "Standardize Direction ") field(ZNAM, "UP") field(ONAM, "DOWN") field(VAL, "0") field(FLNK, "QUAD:LTUS:550:STDZIMIN") } record(ao, "QUAD:LTUS:550:STDZIMIN") { field(DESC, "Min-STDZ Current") field(PREC, "1") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(VAL, "0.0") field(FLNK, "QUAD:LTUS:550:STDZIMAX") } record(ao, "QUAD:LTUS:550:STDZIMAX") { field(DESC, "Max. Standarize Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(VAL, "200.0") field(FLNK, "QUAD:LTUS:550:STDZIFINAL") } record(ao, "QUAD:LTUS:550:STDZIFINAL") { field(DESC, "Final SDTZ Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(VAL, "0.0") field(FLNK, "QUAD:LTUS:550: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, "QUAD:LTUS:550: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, "QUAD:LTUS:550:STDZITOL") { field(DESC, "Stdz min tolerance") field(PREC, "5") field(CALC, "MAX(ABS(A),ABS(B))*C") field(INPA, "QUAD:LTUS:550:STDZIMIN CP NMS") field(INPB, "QUAD:LTUS:550:STDZIMAX CP MMS") field(INPC, "0.05") field(INPD, "QUAD:LTUS:550:STDZITOLR CP MMS") field(EGU, "A") field(FLNK, "QUAD:LTUS:550:IDELTAS") field(PINI, "YES") } # D - factor (3.154/2 = 1.577) for EPSC, otherwise, set to 1.0 record(calc, "QUAD:LTUS:550:STDZDLY") { field(DESC, "Ramp time for stdz cycle") field(CALC, "C>0?MAX(1,ABS((A-B)/C)*D):0") field(INPA, "QUAD:LTUS:550:STDZIMIN CP NMS") field(INPB, "QUAD:LTUS:550:STDZIMAX CP NMS") field(INPC, "QUAD:LTUS:550:TRIMRAMPRATE CP NMS") field(INPD, "1.0") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") } record(calc, "QUAD:LTUS:550:STDZRAMPDLY") { field(DESC, "Ramp delay total") field(CALC, "MAX(1,((A/100)*B+B))") field(PREC, "5") field(INPA, "QUAD:LTUS:550:TRIMDLYPCT CP MS") field(INPB, "QUAD:LTUS:550: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, "QUAD:LTUS:550:STDZMINIDLY") { field(DESC, "Mini-stdz delay") field(CALC, "A") field(PREC, "5") field(A, "1.0") field(EGU, "sec") field(PINI, "YES") } record(ao, "QUAD:LTUS:550: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, "QUAD:LTUS:550:STDZMINIDELTA") { field(DESC, "Stdz mini % of IMAX") field(CALC, "(B/100)*(A-C)") field(INPA, "QUAD:LTUS:550:IDES.HOPR") field(INPB, "QUAD:LTUS:550:STDZMINIPCT CPP NMS") field(INPC, "QUAD:LTUS:550:IDES.LOPR") field(PREC, "5") } record(calc, "QUAD:LTUS:550:STDZMINISETPT") { field(DESC, "Mini Stdz delta") field(CALC, "C==0?MAX(E-D,B):MIN(E+D,A)") field(INPA, "QUAD:LTUS:550:IDES.HOPR") field(INPB, "QUAD:LTUS:550:IDES.LOPR") field(INPC, "QUAD:LTUS:550:STDZDIRECT.RVAL") field(INPD, "QUAD:LTUS:550:STDZMINIDELTA") field(INPE, "QUAD:LTUS:550:IDES") field(PREC, "5") field(FLNK, "QUAD:LTUS:550: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, "QUAD:LTUS:550:STDZMINISETPTOOR") { field(DESC, "Mini Stdz setpoint out of range") field(CALC, "C==0?(E-DA)") field(INPA, "QUAD:LTUS:550:IDES.HOPR") field(INPB, "QUAD:LTUS:550:IDES.LOPR") field(INPC, "QUAD:LTUS:550:STDZDIRECT.RVAL") field(INPD, "QUAD:LTUS:550:STDZMINIDELTA") field(INPE, "QUAD:LTUS:550: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, "QUAD:LTUS:550: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, "QUAD:LTUS:550:IADJUST.RVAL") field(INPB, "QUAD:LTUS:550:STDZDIRECT.RVAL") field(INPC, "QUAD:LTUS:550:STDZOK.RVAL") field(INPD, "QUAD:LTUS:550:STDZDISABLE.RVAL") field(INPE, "QUAD:LTUS:550:STATE.RVAL CPP NMS") field(INPF, "QUAD:LTUS:550:ICTRL.RVAL") field(INPG, "QUAD:LTUS:550:STATE.SEVR") field(INPH, "QUAD:LTUS:550:BDELTAS.M") field(INPI, "QUAD:LTUS:550:IACT.SEVR") field(OUT, "QUAD:LTUS:550:STDZLOSTGO.SELN PP NMS") field(OOPT, "Transition To Non-zero") } record(seq, "QUAD:LTUS:550:STDZLOSTGO") { field(DESC, "Process lost stdz") field(SELM, "Mask") field(DOL1, "1") field(DOL2, "0") field(LNK1, "QUAD:LTUS:550:STDZLOSTTOD.PROC") field(LNK2, "QUAD:LTUS:550:STDZOK PP") } # Record maximum current after standardize # Reset to IACT from sequence after trim # Disable processing during (mini-)standardize or trim record(calc, "QUAD:LTUS:550:STDZIACTMAX") { field(DESC, "Max act current after stdz") field(CALC, "MAX(A, B)") field(DISV, "0") field(SDIS, "QUAD:LTUS:550:CHECKPWRDIP_ENABLE") field(INPA, "QUAD:LTUS:550:IACT CP") field(INPB, "QUAD:LTUS:550:STDZIACTMAX") field(EGU, "A") field(FLNK, "QUAD:LTUS:550:CHECKPWRDIP") } # Detect power dip if STDZOK is YES, STDZ is enabled, and IACT is valid # If IACT drops below STDZIACTMAX by more than the trim tolerance, clear STDZOK # Warning: Take the absolute value of the trim tolerance, or else quads of # negative polarity will always lose STDZ since their IDELTAS.I are negative. # Note: Large quads and bends are prone to losing STDZ even if they are # perturbed toward higher current since their current tends to overshoot # by greater than the trim tolerance before settling down. record(calcout, "QUAD:LTUS:550:CHECKPWRDIP") { field(DESC, "Detect power dip") field(CALC, "(A-B>ABS(C))?3:0") field(DISV, "0") field(SDIS, "QUAD:LTUS:550:CHECKPWRDIP_ENABLE") field(INPA, "QUAD:LTUS:550:STDZIACTMAX") field(INPB, "QUAD:LTUS:550:IACT") field(INPC, "QUAD:LTUS:550:IDELTAS.I") field(OUT, "QUAD:LTUS:550:STDZLOSTGO.SELN PP NMS") field(OOPT, "When Non-zero") } # Enable processing of STDZIACTMAX and CHECKPWRDIP only if # STDZOK = YES, STDZDISABLE = NO, CTRL != Trim (2), and # CTRL != Stdz (4) record(calc, "QUAD:LTUS:550:CHECKPWRDIP_ENABLE") { field(CALC, "A&&!B&&(C#2)&&(C#4)") field(INPA, "QUAD:LTUS:550:STDZOK.RVAL CP") field(INPB, "QUAD:LTUS:550:STDZDISABLE.RVAL CP") field(INPC, "QUAD:LTUS:550:CTRL.RVAL CP") } #! 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, "QUAD:LTUS:550: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, "QUAD:LTUS:550: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, "QUAD:LTUS:550:CALBSET") { field(DESC, "Use DAC Calbration") field(SCAN, "10 second") field(CALC, "A&&(B==0)&&C?31:960") field(INPA, "QUAD:LTUS:550:CALBOK") field(INPB, "QUAD:LTUS:550:CALBDISABLE") field(INPC, "QUAD:LTUS:550:CALBSLOPE") field(OOPT, "On Change") field(OUT, "QUAD:LTUS:550: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, "QUAD:LTUS:550:CALB_SEQ") { field(DESC, "Output Calib Values") field(SELM, "Mask") field(SELL, "QUAD:LTUS:550: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, "QUAD:LTUS:550:CALBSLOPE") field(DOL3, "QUAD:LTUS:550: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, "QUAD:LTUS:550:CALBTOD") { field(DESC, "Calibration Success Time") field(PINI, "YES") # field(DOL, "") field(OMSL, "supervisory") field(DTYP, "Soft Channel") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:550: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, "QUAD:LTUS:550: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, "QUAD:LTUS:550: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, "QUAD:LTUS:550:CALBOFFSET") { field(DESC, "Calc DAC Offset") field(PREC, "6") field(EGU, "Counts") field(PINI, "YES") } record(bo, "QUAD:LTUS:550: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, "QUAD:LTUS:550:DACSLOPE") { field(DESC, "V to DAC slope") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "supervisory") field(PINI, "YES") field(FLNK, "QUAD:LTUS:550:DACOFFSET") } # Default Offset used in conversion from Volts to DAC Counts record(ao, "QUAD:LTUS:550:DACOFFSET") { field(DESC, "V to DAC offset") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "supervisory") field(PINI, "YES") field(FLNK, "QUAD:LTUS:550: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, "QUAD:LTUS:550: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, "QUAD:LTUS:550:IACT") field(INPD, "QUAD:LTUS:550:DACSLOPE") field(INPE, "QUAD:LTUS:550:DACOFFSET") field(EGU, "Counts") field(PREC, "6") } record(ao, "QUAD:LTUS:550:DAC") { field(DESC, "DAC Set point") field(EGU, "Counts") field(DOL, "") field(OMSL, "supervisory") field(PREC, "6") field(PINI, "YES") } record(ao, "QUAD:LTUS:550:CALBIMIN") { field(DESC, "Calibration Min Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(DRVH, "200.0") field(HOPR, "200.0") field(DRVL, "0.0") field(LOPR, "0.0") field(PREC, "3") field(EGU, "A") field(VAL, "0.0") field(FLNK, "QUAD:LTUS:550:CALBIMAX") } record(ao, "QUAD:LTUS:550:CALBIMAX") { field(DESC, "Calibration Max Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(DRVH, "200.0") field(HOPR, "200.0") field(LOPR, "0.0") field(DRVL, "0.0") field(EGU, "A") field(VAL, "200.0") field(FLNK, "QUAD:LTUS:550:CALBSTEPNUM") } record(ao, "QUAD:LTUS:550:CALBIFINAL") { field(DESC, "Calibration Last Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(PREC, "3") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(VAL, "0") } record(longout, "QUAD:LTUS:550: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, "QUAD:LTUS:550:CALBIDELTA") } record(calc, "QUAD:LTUS:550:CALBIDELTA") { field(DESC, "Step size for CALB") field(CALC, "C=0?0:ABS((A-B)/C)") field(INPA, "QUAD:LTUS:550:CALBIMAX") field(INPB, "QUAD:LTUS:550:CALBIMIN") field(INPC, "QUAD:LTUS:550: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, "QUAD:LTUS:550:CALBIMULT") { field(DESC, "IACT vs ISETPT mult") field(CALC, "C#0||A=0?1:ABS(B/A)") field(INPA, "QUAD:LTUS:540:ISETPT.DRVH") field(INPB, "QUAD:LTUS:540:IACT.HOPR") field(INPC, "QUAD:LTUS:550:PSCONTROLLER.RVAL CPP") field(EGU, "A") field(PINI, "YES") } # SNL dbputs DAC values here. 6-10 steps are possible. record(waveform, "QUAD:LTUS:550:CALBICTRLWF") { field(DESC, "ICTRL setpoint array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") } record(waveform, "QUAD:LTUS:550:DACWF") { field(DESC, "DAC count array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:550:DACSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:550:DACSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "QUAD:LTUS:550: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, "QUAD:LTUS:550:CALCDACWF") { field(DESC, "Calc DAC counts array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:550:CALCDACSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:550:CALCDACSA") { field(DESC, "Calc DAC counts") field(DTYP, "Soft Channel") field(INP, "QUAD:LTUS:550: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, "QUAD:LTUS:550:CALBYWF") { field(DESC, "mx + b") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:550:CALBYSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:550:CALBYSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "QUAD:LTUS:550:CALBYWF") field(MALM, "10") field(NELM, "6") field(INDX, "0") field(FTVL, "DOUBLE") } record(waveform, "QUAD:LTUS:550:CALBIACTWF") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:550:CALBIACTSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:550:CALBIACTSA") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(MALM, "10") field(NELM, "6") field(INP, "QUAD:LTUS:550:CALBIACTWF") field(INDX, "0") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:550:CALBLIMITS") } # Check that measured current during calibration is within # tolerance. record(aSub, "QUAD:LTUS:550: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, "QUAD:LTUS:550:CALBSTEPNUM") field(INPB, "QUAD:LTUS:550:CALBIACTWF") field(INPC, "QUAD:LTUS:550: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, "QUAD:LTUS:550: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, "QUAD:LTUS:550:STDZITOL") field(INPH, "QUAD:LTUS:550:DACSLOPE") field(INPI, "QUAD:LTUS:550: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, "QUAD:LTUS:550: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, "QUAD:LTUS:550:CALBSTEPNUM") field(INPB, "QUAD:LTUS:550:CALBIACTWF") field(INPC, "QUAD:LTUS:550:DACWF") field(INPF, "QUAD:LTUS:550: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 QUAD:LTUS:550CALBOK 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, "QUAD:LTUS:550:DEGAUSINIT") { field(DESC, "Proc. Degauss PVs on boot") field(PINI, "YES") field(DOL, "1") field(OUTA, "QUAD:LTUS:550:DEGAUSIMIN.PROC PP") field(OUTB, "QUAD:LTUS:550:DEGAUSIMAX.PROC PP") field(OUTC, "QUAD:LTUS:550:DEGAUSTYPE.PROC PP") field(OUTD, "QUAD:LTUS:550:DEGAUSSTEP.PROC PP") field(OUTE, "QUAD:LTUS:550:MADNAME.PROC PP") field(OUTF, "QUAD:LTUS:550:PSTYPE.PROC PP") field(OUTG, "QUAD:LTUS:550: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, "QUAD:LTUS:550:DEGAUSSUB") { field(DESC, "Degauss subroutine") field(INAM, "mgntDegaussInit") field(SNAM, "mgntDegauss") field(BRSV, "INVALID") field(INPA, "QUAD:LTUS:550:DEGAUSIMIN NPP NMS") field(INPB, "QUAD:LTUS:550:DEGAUSIMAX NPP NMS") field(INPC, "QUAD:LTUS:550:DEGAUSTYPE.RVAL NPP NMS") field(INPE, "QUAD:LTUS:550:DEGAUSMETHOD.RVAL NPP NMS") field(INPF, "QUAD:LTUS:550:PSTYPE NPP NMS") field(INPG, "QUAD:LTUS:550:DEBUG.RVAL NPP NMS") field(INPH, "QUAD:LTUS:550: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, "QUAD:LTUS:550:DEGAUSWF PP") field(OUTB, "QUAD:LTUS:550:DEGAUSMSG PP") field(OUTC, "QUAD:LTUS:550: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, "QUAD:LTUS:550:DEGAUSWF") { field(DESC, "Degauss Setpts") field(NELM, "60") field(FTVL, "DOUBLE") } record(mbbo,"QUAD:LTUS:550: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, "QUAD:LTUS:550: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, "QUAD:LTUS:550: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, "QUAD:LTUS:550: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, "QUAD:LTUS:550: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, "QUAD:LTUS:550:DEGAUSIMIN") { field(DESC, "Min. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "200.0") field(LOPR, "-200.0") field(DRVH, "200.0") field(DRVL, "-200.0") field(VAL, "-200.0") } record(ao, "QUAD:LTUS:550:DEGAUSIMAX") { field(DESC, "Max. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "200.0") field(LOPR, "-200.0") field(DRVH, "200.0") field(DRVL, "-200.0") field(VAL, "200.0") } # 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,"QUAD:LTUS:550: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, "QUAD:LTUS:550: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,"QUAD:LTUS:550: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, "QUAD:LTUS:550: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, "QUAD:LTUS:550: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, "QUAD:LTUS:550: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, "QUAD:LTUS:550:DEGAUSTOD") { field(DESC, "Successful Degauss Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "QUAD:LTUS:550:DEGAUSLOSTTOD") { field(DESC, "Degauss Lost Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:550:DEGAUSTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "QUAD:LTUS:550:DEGAUSTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "QUAD:LTUS:550: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, "QUAD:LTUS:550:DEGAUSGO") { field(DESC, "Set bdes of btrms to zero") field(ASG, "Internal") field(OUTA, "") field(OUTB, "") field(OUTC, "") field(OUTD, "") } # =========== CRYO ONLY =========== record(bo, "QUAD:LTUS:550: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, "QUAD:LTUS:550:DEGAUS_IMAX_CHECK") { field(DESC, "Check if imax shoud chg") field(CALC, "(C==4)&&(ABS(B)>ABS(A))?1:0") field(INPA, "QUAD:LTUS:550:DEGAUS_IMAX") field(INPB, "QUAD:LTUS:550:ISETPT") field(INPC, "QUAD:LTUS:550:DEGAUSTYPE.RVAL") field(OUT, "QUAD:LTUS:550:DEGAUS_IMAX_UPDATE.SELN") field(FLNK, "QUAD:LTUS:550:DEGAUS_IMAX_UPDATE") } record(seq, "QUAD:LTUS:550:DEGAUS_IMAX_UPDATE") { field(DESC, "Degauss IMAX Update") field(SELM, "Specified") field(DOL1, "QUAD:LTUS:550:ISETPT") field(LNK1, "QUAD:LTUS:550:DEGAUS_IMAX PP") } # Set the maximum current after a successful # degauss. This pv is updated by the # sequence. record(ao, "QUAD:LTUS:550:DEGAUS_IMAX") { field(DESC, "Max I set afer a degauss") field(EGU, "Amps") field(PINI, "YES") field(PREC, "6") field(HOPR, "200.0") field(LOPR, "-200.0") field(DRVH, "200.0") field(DRVL, "-200.0") field(VAL, "200.0") field(FLNK, "QUAD:LTUS:550:DEGAUS_IMAXPOL_CHECK") info(autosaveFields,"VAL,RVAL") } # Set the polarity if degauss_imax record(calcout, "QUAD:LTUS:550:DEGAUS_IMAXPOL_CHECK") { field(DESC, "Determine polarity of imax") field(CALC, "A>=0?0:1") field(INPA, "QUAD:LTUS:550:DEGAUS_IMAX") field(FLNK, "QUAD:LTUS:550:DEGAUS_IMAXPOL") } record(bo, "QUAD:LTUS:550:DEGAUS_IMAXPOL") { field(DESC, "Polarity of imax I") field(DTYP, "Raw Soft Channel") field(DOL, "QUAD:LTUS:550:DEGAUS_IMAXPOL_CHECK") field(OMSL, "closed_loop") field(ZNAM, "Positive") field(ONAM, "Negative") field(FLNK, "QUAD:LTUS:550: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, "QUAD:LTUS:550:DEGAUS_ABSIMAX") { field(DESC, "Absolute Max. Degauss I") field(CALC, "ABS(A)") field(INPA, "QUAD:LTUS:550:DEGAUS_IMAX") field(PREC, "6") field(EGU, "Amps") field(HOPR, "200.0") field(LOPR, "-200.0") info(autosaveFields,"VAL RVAL") } # IACT Polarity record(calcout, "QUAD:LTUS:550:IACTPOL_CHECK") { field(DESC, "Determine IACT polarity") field(SCAN, "5 second") field(CALC, "ABS(A-B)>C?(A>=0?0:1):D") field(INPA, "QUAD:LTUS:550:IACT") field(INPB, "QUAD:LTUS:550:IACTPOL_CHECK.LA") field(INPC, "0.0001") field(INPD, "QUAD:LTUS:550:IACTPOL_CHECK.PVAL") field(OOPT, "On Change") field(FLNK, "QUAD:LTUS:550:IACTPOL") } record(bo, "QUAD:LTUS:550: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,"QUAD:LTUS:550: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, "QUAD:LTUS:550:DEGAUSENABLE CP") field(INPB, "QUAD:LTUS:550:DEGAUSOK") field(INPC, "QUAD:LTUS:550:STATE CP") field(INPD, "QUAD:LTUS:550:STATE.SEVR") field(OUT, "QUAD:LTUS:550:DEGAUS_STATE_SEQ.SELN PP") field(ASG, "Internal") } record(seq, "QUAD:LTUS:550:DEGAUS_STATE_SEQ") { field(DESC, "Degauss State Sequence") field(SELM, "Specified") field(SELL, "QUAD:LTUS:550:DEGAUS_STATE_CHECK") field(LNK1, "QUAD:LTUS:550:DEGAUS_STATE_DISABLE.PROC PP") field(LNK2, "QUAD:LTUS:550:DEGAUS_STATE_LOST.PROC PP") field(LNK3, "QUAD:LTUS:550:DEGAUS_STATE_GOOD.PROC PP") field(LNK4, "QUAD:LTUS:550: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, "QUAD:LTUS:550:DEGAUS_STATE_DISABLE") { field(DESC, "Degauss not used") field(LNK1, "QUAD:LTUS:550:DEGAUSOK.ZSV") field(LNK2, "QUAD:LTUS:550: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, "QUAD:LTUS:550:STATMSG.FRSV") field(LNK4, "QUAD:LTUS:550: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, "QUAD:LTUS:550:DEGAUS_STATE_LOST") { field(DESC, "Degauss lost and ps On") field(DOL1, "1") field(LNK1, "QUAD:LTUS:550:DEGAUSOK.ZSV") field(LNK2, "QUAD:LTUS:550: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, "QUAD:LTUS:550:STATMSG.FRSV") field(LNK4, "QUAD:LTUS:550: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, "QUAD:LTUS:550:DEGAUS_STATE_OFF") { field(DESC, "Degaused lost and ps Off") field(DOL1, "2") field(LNK1, "QUAD:LTUS:550: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, "QUAD:LTUS:550:STATMSG.FRSV") field(LNK3, "QUAD:LTUS:550: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, "QUAD:LTUS:550:DEGAUS_STATE_GOOD") { field(DESC, "Degauss good") field(DOL1, "1") field(LNK1, "QUAD:LTUS:550: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, "QUAD:LTUS:550:STATMSG.FRSV PP") field(LNK3, "QUAD:LTUS:550:STATMSG.FVSV PP") field(LNK4, "") field(ASG, "Internal") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(mbbo, "QUAD:LTUS:550:FUNC") { field(DESC, "QUAD:LTUS:550 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, "0") field(FFVL, "0") field(OUT, "QUAD:LTUS:550:CTRL CA") } # :CTRL pv is processed at boot in the # sequence mgntCtrl.st Processed in sequence # record(mbbo, "QUAD:LTUS:550:CTRL") { field(DESC, "QUAD:LTUS:550 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, "QUAD:LTUS:550:SELECTEN.A PP") field(SDIS, "0") } # If a function has been selected set this unit to busy record(calcout, "QUAD:LTUS:550:SELECTEN") { field(DESC, "Control Select Enable") field(CALC, "A>0?1:A") field(FLNK, "QUAD:LTUS:550:BUSY") } # Set to FREE on IOC reboot record(bo, "QUAD:LTUS:550:BUSY") { field(DESC, "QUAD:LTUS:550 Ctrl Done") field(DOL, "QUAD:LTUS:550:SELECTEN") field(ZNAM, "FREE") field(ONAM, "BUSY") field(PINI, "YES") field(FLNK, "QUAD:LTUS:550:SELECT") } record(bo, "QUAD:LTUS:550:SELECT") { field(ZNAM, "NO") field(ONAM, "YES") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") } record(bo, "QUAD:LTUS:550: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, "QUAD:LTUS:550:CTRLSTATE") { field(DESC, "QUAD:LTUS:550 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("QUAD:LTUS:550:CTRL",20,20,0,0,"QUAD:LTUS:550:CTRL") #! Field("QUAD:LTUS:550:CTRL.OUT",16777215,1,"QUAD:LTUS:550:CTRL.OUT") #! Link("QUAD:LTUS:550:CTRL.OUT","QUAD:LTUS:550:SELECTEN.A") #! Field("QUAD:LTUS:550:CTRL.VAL",16777215,1,"QUAD:LTUS:550:CTRL.VAL") #! Record("QUAD:LTUS:550:SELECTEN",321,381,0,0,"QUAD:LTUS:550:SELECTEN") #! Field("QUAD:LTUS:550:SELECTEN.A",16777215,0,"QUAD:LTUS:550:SELECTEN.A") #! Field("QUAD:LTUS:550:SELECTEN.FLNK",16777215,1,"QUAD:LTUS:550:SELECTEN.FLNK") #! Link("QUAD:LTUS:550:SELECTEN.FLNK","QUAD:LTUS:550:BUSY") #! Field("QUAD:LTUS:550:SELECTEN.VAL",16777215,1,"QUAD:LTUS:550:SELECTEN.VAL") #! Record("QUAD:LTUS:550:BUSY",623,274,0,0,"QUAD:LTUS:550:BUSY") #! Field("QUAD:LTUS:550:BUSY.DOL",16777215,0,"QUAD:LTUS:550:BUSY.DOL") #! Link("QUAD:LTUS:550:BUSY.DOL","QUAD:LTUS:550:SELECTEN.VAL") #! Field("QUAD:LTUS:550:BUSY.FLNK",16777215,1,"QUAD:LTUS:550:BUSY.FLNK") #! Link("QUAD:LTUS:550:BUSY.FLNK","QUAD:LTUS:550:SELECT") #! Record("QUAD:LTUS:550:SELECT",669,508,0,1,"QUAD:LTUS:550:SELECT") #! Record("QUAD:LTUS:550:FUNC",940,120,0,0,"QUAD:LTUS:550:FUNC") #! Field("QUAD:LTUS:550:FUNC.OUT",16777215,0,"QUAD:LTUS:550:FUNC.OUT") #! Link("QUAD:LTUS:550:FUNC.OUT","QUAD:LTUS:550:CTRL.VAL") #! Record("QUAD:LTUS:550:ABORT",193,41,0,0,"QUAD:LTUS:550:ABORT") #! Record("QUAD:LTUS:550:CTRLSTATE",369,34,0,0,"QUAD:LTUS:550: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,"QUAD:LTUS:550:SELECT is used for Multi-device selection.\nIt is enabled when associated QUAD:LTUS:550:CTRL is \"0\" (DONE).\nIt is disabled when associated QUAD:LTUS:550: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,"QUAD:LTUS:550: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, "QUAD:LTUS:550:BCTRL_INIT") { field(DESC, "Process BCTRL on boot") field(PINI, "YES") field(CALC, "A=3?1:0") field(INPA, "QUAD:LTUS:550:BCTRL.SEVR") field(OUT, "QUAD:LTUS:550: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, "QUAD:LTUS:550:BACT") { field(DESC, "Actual B") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "QUAD:LTUS:550:BACT") field(INPB, "QUAD:LTUS:550:POLYCOEF") field(INPC, "QUAD:LTUS:550:POLYCOEF.A") field(INPD, "QUAD:LTUS:550:POLYCOEF.B") field(INPE, "QUAD:LTUS:550:IACT MS") field(INPF, "QUAD:LTUS:550:BDELTAS PP") field(INPG, "100") field(EGU, "kG") field(HOPR, "102.3265") field(LOPR, "0.2562") field(HIHI, "102.3265") field(LOLO, "0.2562") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "102.3265") field(LOW, "0.2562") field(FLNK, "QUAD:LTUS:550: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, "QUAD:LTUS:550:BDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntPhyDeltas") field(EGU, "kG") field(HOPR, "1") field(PREC, "7") field(BRSV, "INVALID") field(INPA, "QUAD:LTUS:550:BDES") field(INPB, "QUAD:LTUS:550:TRIMBTOL") field(INPC, "QUAD:LTUS:550:TRIMBTOLR") field(INPD, "QUAD:LTUS:550:CHCKBTOL") field(INPE, "QUAD:LTUS:550:CHCKBTOLR") field(F, "2.0") field(INPG, "30") field(INPH, "QUAD:LTUS:550:BACT.VAL") # # MPS absolute and relative tolerances field(INPP, "QUAD:LTUS:550:MPSBTOL") field(INPQ, "QUAD:LTUS:550:MPSBTOLR") field(FLNK, "QUAD:LTUS:550:BCONLIMITS") info(autosaveFields,"F") } # This record is processed by BDELTAS record(aSub, "QUAD:LTUS:550:BCONLIMITS") { field(DESC, "Config B-field Limits") field(INAM, "mgntInit") field(SNAM, "mgntBCONLimits") field(INPA, "QUAD:LTUS:550:BDES") field(INPB, "QUAD:LTUS:550:BDELTAS.I") field(INPG, "QUAD:LTUS:550:DEBUG.RVAL") field(FTA, "DOUBLE") field(FTB, "DOUBLE") field(FTG, "ULONG") field(OUTA, "QUAD:LTUS:550:BCON.HIGH") field(OUTB, "QUAD:LTUS:550:BCON.LOW") field(OUTC, "QUAD:LTUS:550:BCON.HIHI") field(OUTD, "QUAD:LTUS:550:BCON.LOLO PP") field(FTVA, "DOUBLE") field(FTVB, "DOUBLE") field(FTVC, "DOUBLE") field(FTVD, "DOUBLE") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:550:IDELTAS") } # The following PV is processed by :BACT # which is processed by :BACT # record(fanout, "QUAD:LTUS:550:BACTFO") { field(DESC, "BACT processing") field(SELM, "All") field(LNK1, "QUAD:LTUS:550:BDIFF") field(LNK2, "QUAD:LTUS:550:BADIFF") field(LNK3, "QUAD:LTUS:550:BRATIO") field(LNK4, "QUAD:LTUS:550:MPSLIMITS") field(LNK5, "QUAD:LTUS:550:I2BSTATUS") field(LNK6, "QUAD:LTUS:550:IACTFO.PROC") } record(calc, "QUAD:LTUS:550:BDIFF") { field(DESC, "BDES-BACT") field(CALC, "A-B") field(INPA, "QUAD:LTUS:550:BDES") field(INPB, "QUAD:LTUS:550:BACT") field(EGU, "kG") field(PREC, "7") } record(calc, "QUAD:LTUS:550:BADIFF") { field(DESC, "Absolute BDES-BACT") field(INPA, "QUAD:LTUS:550:BDIFF") field(EGU, "kG") field(PREC, "7") field(CALC, "A<0?ABS(A):A") } record(calc, "QUAD:LTUS:550:BRATIO") { field(DESC, "BACT Error") field(CALC, "B?A/B:0") field(INPA, "QUAD:LTUS:550:BDIFF") field(INPB, "QUAD:LTUS:550:BDES.HOPR") field(EGU, "kG") field(PREC, "7") } record(mbbi, "QUAD:LTUS:550: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, "QUAD:LTUS:550:BACT.J") } # Note: for a string slave set the MONFL # macro to the following: # MONFL=:IMONCALC MS record(sub, "QUAD:LTUS:550:BMON") { field(DESC, "Second Transductor") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "QUAD:LTUS:550:BMON") field(INPB, "QUAD:LTUS:550:POLYCOEF") field(INPC, "QUAD:LTUS:550:POLYCOEF.A") field(INPD, "QUAD:LTUS:550:POLYCOEF.B") field(INPE, "QUAD:LTUS:550:IMON MS") field(INPF, "QUAD:LTUS:550:BDELTAS.VAL") field(INPG, "100") field(EGU, "kG") field(HOPR, "102.3265") field(LOPR, "0.2562") field(HIHI, "102.3265") field(LOLO, "0.2562") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "102.3265") field(LOW, "0.2562") } # 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=QUAD:LTUS:540:BDES CP record(ao, "QUAD:LTUS:550:BDES") { field(DESC, "Desired B-Field") field(PINI, "NO") field(DRVH, "102.3265") field(DRVL, "0.2562") field(HOPR, "102.3265") field(LOPR, "0.2562") field(PREC, "7") field(EGU, "kG") field(MDEL, "-1") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:550:IDES2BDES") field(OUT, "QUAD:LTUS:550:B2IDES PP") info(autosaveFields,"VAL") } record(sub, "QUAD:LTUS:550:B2IDES") { field(DESC, "Convert Desired B-Field to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:550:POLYCOEF") field(INPC, "QUAD:LTUS:550:POLYCOEF.A") field(INPD, "QUAD:LTUS:550:POLYCOEF.B") field(PREC, "7") field(EGU, "kG") field(HOPR, "102.3265") field(LOPR, "0.2562") field(MDEL, "-1") field(INPE, "QUAD:LTUS:550:BDES.DRVH") field(INPF, "QUAD:LTUS:550:BDES.DRVL") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:550:IDES") } record(sub, "QUAD:LTUS:550:BNOM") { field(DESC, "Nominal Field") field(PINI, "YES") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:550:POLYCOEF") field(INPC, "QUAD:LTUS:550:POLYCOEF.A") field(INPD, "QUAD:LTUS:550:POLYCOEF.B") field(INPE, "QUAD:LTUS:550:BDES.DRVH") field(INPF, "QUAD:LTUS:550:BDES.DRVL") field(EGU, "kG") field(HOPR, "102.3265") field(LOPR, "0.2562") field(PREC, "7") field(VAL, "0.0") field(FLNK, "QUAD:LTUS:550:INOM") } record(sub, "QUAD:LTUS:550:BACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:550:BDES.VAL") field(INPB, "QUAD:LTUS:550:BDES.DRVH") field(INPC, "QUAD:LTUS:550:BDES.DRVL") field(INPD, "QUAD:LTUS:550:BDELTAS.I") field(INPE, "QUAD:LTUS:550:BDELTAS.J") field(INPG, "QUAD:LTUS:550:STATE") field(INPH, "QUAD:LTUS:550:HSTA") field(EGU, "kG") field(HOPR, "102.3265") field(LOPR, "0.2562") field(PREC, "7") field(BRSV, "INVALID") } record(sub, "QUAD:LTUS:550:BMONLIMITS") { field(DESC, "MON Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:550:BDES.VAL") field(INPB, "QUAD:LTUS:550:BDES.DRVH") field(INPC, "QUAD:LTUS:550:BDES.DRVL") field(INPD, "QUAD:LTUS:550:BDELTAS.K") field(INPE, "QUAD:LTUS:550:BDELTAS.L") field(INPG, "QUAD:LTUS:550:STATE") field(INPH, "QUAD:LTUS:550:HSTA") field(EGU, "kG") field(HOPR, "102.3265") field(LOPR, "0.2562") field(PREC, "7") field(BRSV, "INVALID") } record(seq, "QUAD:LTUS:550:BLIMITS") { field(DESC, "ACT Limits") field(PREC, "7") field(DOL1, "QUAD:LTUS:550:BLIMITS") field(LNK1, "QUAD:LTUS:550:BACTLIMITS.F PP") field(DOL2, "QUAD:LTUS:550:BACTLIMITS.I") field(LNK2, "QUAD:LTUS:550:BACT.HIGH") field(DOL3, "QUAD:LTUS:550:BACTLIMITS.J") field(LNK3, "QUAD:LTUS:550:BACT.LOW") field(DOL4, "QUAD:LTUS:550:BACTLIMITS.K") field(LNK4, "QUAD:LTUS:550:BACT.HIHI") field(DOL5, "QUAD:LTUS:550:BACTLIMITS.L") field(LNK5, "QUAD:LTUS:550:BACT.LOLO") field(DOL6, "QUAD:LTUS:550:BLIMITS") field(LNK6, "QUAD:LTUS:550:BMONLIMITS.F PP") field(DOL7, "QUAD:LTUS:550:BMONLIMITS.I") field(LNK7, "QUAD:LTUS:550:BMON.HIGH") field(DOL8, "QUAD:LTUS:550:BMONLIMITS.J") field(LNK8, "QUAD:LTUS:550:BMON.LOW") field(DOL9, "QUAD:LTUS:550:BMONLIMITS.K") field(LNK9, "QUAD:LTUS:550:BMON.HIHI") field(DOLA, "QUAD:LTUS:550:BMONLIMITS.L") field(LNKA, "QUAD:LTUS:550:BMON.LOLO") field(FLNK, "QUAD:LTUS:550:ILIMITS") field(SCAN, "5 second") } record(ao, "QUAD:LTUS:550:BCTRL") { field(DESC, "B-Perturb") field(PREC, "7") field(EGU, "kG") field(DRVH, "102.3265") field(DRVL, "0.2562") field(HOPR, "102.3265") field(LOPR, "0.2562") # 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, "QUAD:LTUS:550: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, "QUAD:LTUS:550:BCTRLGO") { field(DESC, "Update DES and perturb") field(PREC, "7") # Disable BACT limits field(DOL1, "1") field(LNK1, "QUAD:LTUS:550:BLIMITS.VAL") # Update BDES with the BCTRL (slider) value field(DOL2, "QUAD:LTUS:550:BCTRL.VAL") field(LNK2, "QUAD:LTUS:550:BDES PP") field(DOL3, "1") field(LNK3, "QUAD:LTUS:550:IDIRECT.PROC PP") field(DOL4, "1") field(LNK4, "QUAD:LTUS:550:CHECKSTDZLOST.PROC PP") field(DOL5, "QUAD:LTUS:550:BCTRL.VAL") field(LNK5, "QUAD:LTUS:550:BCTRLSUB PP") # Re-enable BACT limits field(DOL6, "0") field(LNK6, "QUAD:LTUS:550:BLIMITS.VAL") } # Convert B-field to Current and output to ISETPT record(sub, "QUAD:LTUS:550:BCTRLSUB") { field(DESC, "Feedback") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:550:POLYCOEF") field(INPC, "QUAD:LTUS:550:POLYCOEF.A") field(INPD, "QUAD:LTUS:550:POLYCOEF.B") field(INPE, "QUAD:LTUS:550:BDES.DRVH") field(INPF, "QUAD:LTUS:550:BDES.DRVL") field(PREC, "7") field(EGU, "kG") field(HOPR, "102.3265") field(LOPR, "0.2562") field(MDEL, "-1") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:550:ISETPT") } record(ao, "QUAD:LTUS:550:BDESPREVTRIM") { field(DESC, "trim bdes for undo") field(DTYP, "Soft Channel") field(DRVH, "102.3265") field(DRVL, "0.2562") field(EGU, "kG") field(HOPR, "102.3265") field(LOPR, "0.2562") field(PREC, "7") field(PINI, "YES") info(autosaveFields,"VAL") } record(stringin, "QUAD:LTUS:550:MADNAME") { field(DESC, "MAD deck nomenclature") field(PINI, "YES") field(VAL, "QVB2B") } record(ai, "QUAD:LTUS:550: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, "3378.893398") } record(ao, "QUAD:LTUS:550:BMAX") { field(DESC, "Max B-Field") field(DTYP, "Soft Channel") field(DRVH, "102.3265") field(DRVL, "0.2562") field(EGU, "kG") field(HOPR, "102.3265") field(LOPR, "0.2562") field(PREC, "7") field(PINI, "YES") field(VAL, "102.3265") field(FLNK, "QUAD:LTUS:550:BSTEP") } record(ao, "QUAD:LTUS:550:BMIN") { field(DESC, "Min B-Field") field(DTYP, "Soft Channel") field(DRVH, "102.3265") field(DRVL, "0.2562") field(EGU, "kG") field(HOPR, "102.3265") field(LOPR, "0.2562") field(PREC, "7") field(PINI, "YES") field(VAL, "0.2562") field(FLNK, "QUAD:LTUS:550:BSTEP") } record(ao, "QUAD:LTUS:550:BDESSAVE") { field(DESC, "bdes for save/load") field(DTYP, "Soft Channel") field(DRVH, "102.3265") field(DRVL, "0.2562") field(EGU, "kG") field(HOPR, "102.3265") field(LOPR, "0.2562") field(PINI, "YES") field(PREC, "7") } # This record is processed by QUAD:LTUS:550: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, "QUAD:LTUS:550:BCON") { field(DESC, "Config B-Field ") field(DTYP, "Soft Channel") field(PREC, "7") field(EGU, "kG") field(HOPR, "102.3265") field(LOPR, "0.2562") field(DRVH, "102.3265") field(DRVL, "0.2562") # 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 , "QUAD:LTUS:550:ICON2BCON") field(OMSL, "closed_loop") field(OUT, "QUAD:LTUS:550:B2ICON PP") info(autosaveFields,"VAL") } record(sub, "QUAD:LTUS:550:B2ICON") { field(DESC, "Convert Desired ICon to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:550:POLYCOEF") field(INPC, "QUAD:LTUS:550:POLYCOEF.A") field(INPD, "QUAD:LTUS:550:POLYCOEF.B") field(PREC, "7") field(EGU, "kG") field(HOPR, "102.3265") field(LOPR, "0.2562") field(MDEL, "-1") field(INPE, "QUAD:LTUS:550:BCON.DRVH") field(INPF, "QUAD:LTUS:550:BCON.DRVL") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:550: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, "QUAD:LTUS:550:BSTEP") { field(DESC, "B-Field step size") field(CALC, "(C==3)||(D==3)?0:ABS(A-B)*0.005") field(INPA, "QUAD:LTUS:550:BMAX") field(INPB, "QUAD:LTUS:550:BMIN") field(INPC, "QUAD:LTUS:550:BMIN.SEVR") field(INPD, "QUAD:LTUS:550:BMAX.SEVR") field(EGU, "kG") 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,"QUAD:LTUS:550:BCTRLDISABLECALC") { field(DESC, "Calc for disabling BCTRL") field(ASG, "Internal") field(CALC, "A?2:1") field(INPA, "QUAD:LTUS:550:ONLINE CP") field(OUT, "QUAD:LTUS:550:BCTRLDISABLEFOUT PP") } record(fanout, "QUAD:LTUS:550:BCTRLDISABLEFOUT") { field(DESC, "Disable BCTRL fanout") field(SELM, "Specified") field(SELL, "QUAD:LTUS:550:BCTRLDISABLECALC") field(LNK1, "QUAD:LTUS:550:BCTRLDISABLE") field(LNK2, "QUAD:LTUS:550:BCTRLENABLE") } record(stringout, "QUAD:LTUS:550:BCTRLDISABLE") { field(DESC, "Disable BCTRL") field(DTYP, "Soft Channel") field(OUT, "QUAD:LTUS:550:BCTRL.ASG") field(VAL, "NOWRITE") field(FLNK, "QUAD:LTUS:550:BCTRLDISV_UPDATE") } record(stringout, "QUAD:LTUS:550:BCTRLENABLE") { field(DESC, "Enable BCTRL") field(DTYP, "Soft Channel") field(OUT, "QUAD:LTUS:550:BCTRL.ASG") field(VAL, "") field(FLNK, "QUAD:LTUS:550:BCTRLDISV_UPDATE") } record(calcout, "QUAD:LTUS:550:BCTRLDISV_UPDATE") { field(DESC, "Calc for updating BCTRL.DISV") field(ASG, "Internal") field(CALC, "A") field(INPA, "QUAD:LTUS:550:ONLINE") field(OUT, "QUAD:LTUS:550: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,"QUAD:LTUS:550:BACT and MON\n are processed via links from \n QUAD:LTUS:550:IACT (device raw value readback 1)\n and\n QUAD:LTUS:550: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 QUAD:LTUS:550:POLYCOEF\nC = First polynomial coefficient (offset if linear)\nD = Second polynomial coefficient (slope if linear)\nE = QUAD:LTUS:550: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,"QUAD:LTUS:550:BDES\n is processed when set by CA users or \n QUAD:LTUS:550: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,"QUAD:LTUS:550: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 QUAD:LTUS:550: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 (QUAD:LTUS:550: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,"QUAD:LTUS:550:B*LIMITS and QUAD:LTUS:550:BLIMITS:\n Calculate alarm and warning limits based on \n deltas from QUAD:LTUS:550: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,"QUAD:LTUS:550: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,"QUAD:LTUS:550: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, "QUAD:LTUS:550: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, "QUAD:LTUS:550:MPSBTOL") { field(DESC, "Absolute mps tol") field(EGU, "kG") field(PREC, "2") field(CALC, "ABS(A)*0.02") field(INPA, "QUAD:LTUS:550:BMAX") field(PINI, "YES") } # # 21-Aug-2013: K. Luchini # Set channel access security so that users # cannot easily change values. record(ao, "QUAD:LTUS:550:MPSBMAX") { field(DESC, "MPS Max B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "102.3265") field(DRVL, "0.2562") field(PINI, "YES") field(VAL, "102.3265") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:550:MPSBMIN") { field(DESC, "MPS Min B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "102.3265") field(DRVL, "0.2562") field(PINI, "YES") field(VAL, "0.2562") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:550:MPSBLLIM") { field(DESC, "MPS Low Limit B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "102.3265") field(DRVL, "0.2562") field(PINI, "YES") field(VAL, "0.2562") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:550:MPSBLLIM2") { field(DESC, "MPS Low Limit #2 B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "102.3265") field(DRVL, "0.2562") field(PINI, "YES") field(VAL, "0.2562") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } # Set the default to Std record(mbbo, "QUAD:LTUS:550: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, "QUAD:LTUS:550:MPSLIMITS.E PP") } record(aSub, "QUAD:LTUS:550: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, "QUAD:LTUS:550:MPS.RVAL") field(INPB, "QUAD:LTUS:550:BADIFF") field(INPC, "QUAD:LTUS:550:BDELTAS.N") field(INPD, "QUAD:LTUS:550:BACT") field(INPE, "QUAD:LTUS:550:MPSBITMASK.RVAL") field(INPF, "QUAD:LTUS:550:MPSBLLIM") field(INPG, "QUAD:LTUS:550:MPSBMIN") field(INPH, "QUAD:LTUS:550:MPSBMAX") field(INPI, "QUAD:LTUS:550: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, "QUAD:LTUS:550:INTOL.RVAL PP") field(OUTB, "QUAD:LTUS:550:INTOL_BMIN.RVAL PP") field(OUTC, "QUAD:LTUS:550:INTOL_BRANGE.RVAL PP") field(OUTD, "QUAD:LTUS:550: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, "QUAD:LTUS:550:INTOL") { field(DESC, "BACT within MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:550:MPSLIMITS.VALA") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "QUAD:LTUS:550:INTOL_BMIN") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:550:MPSLIMITS.VALB") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "QUAD:LTUS:550:INTOL_BMIN2") { field(DESC, "MPS tol #2") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:550:MPSLIMITS.VALD") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "QUAD:LTUS:550:INTOL_BRANGE") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:550: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, "QUAD:LTUS:550:CHCKITOL") { field(DESC, "Absolute Check I Tolerance") field(EGU, "A") field(FLNK, "QUAD:LTUS:550:TRIMITOL") field(CALC, "ABS(A*B)") field(INPA, "QUAD:LTUS:550:CHCKBTOL") field(INPB, "QUAD:LTUS:550:POLYCOEF.B") field(PREC, "9") } record(calc, "QUAD:LTUS:550:TRIMBTOL") { field(EGU, "kG") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(DESC, "Absolute Trim Tolerance") field(CALC, "ABS(A)/2") field(INPA, "QUAD:LTUS:550:CHCKBTOL") field(FLNK, "QUAD:LTUS:550:CHCKITOL") } record(calc, "QUAD:LTUS:550:CHCKBTOL") { field(DESC, "Check absolute tolerance") field(EGU, "A") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(FLNK, "QUAD:LTUS:550:TRIMBTOL") field(CALC, "MAX(ABS(A),ABS(C))*(B/1000000)") field(INPA, "QUAD:LTUS:550:BDES.HOPR") field(INPB, "QUAD:LTUS:550:STABILITY") field(INPC, "QUAD:LTUS:550:BDES.LOPR") } record(longout, "QUAD:LTUS:550: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, "QUAD:LTUS:550:CHCKBTOL") } record(calc, "QUAD:LTUS:550:TRIMITOL") { field(DESC, "Absolute Trim I Tolerance") field(EGU, "kG") field(CALC, "ABS(A*B)") field(INPA, "QUAD:LTUS:550:POLYCOEF.B") field(INPB, "QUAD:LTUS:550:TRIMBTOL") field(PREC, "9") } record(ai, "QUAD:LTUS:550:TRIMBTOLR") { field(DESC, "Relative trim tol") field(PREC, "4") field(EGU, "%") field(HOPR, "1.0") field(LOPR, "0.0") field(PINI, "YES") } record(ai, "QUAD:LTUS:550: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, "QUAD:LTUS:550:FBCKFCOM") { field(ZNAM, "CA") field(ONAM, "FCOM") field(DESC, "CA Mode") field(PINI, "YES") field(SDIS, "0") } record(bo, "QUAD:LTUS:550:PAU") { field(ZNAM, "NotConfigured") field(ONAM, "Configured") field(DESC, "PAU Present") field(PINI, "YES") field(SDIS, "0") field(FLNK, "QUAD:LTUS:550:PAUGO") } record(fanout, "QUAD:LTUS:550:PAUGO") { field(DESC, "PAU control") field(LNK1, "QUAD:LTUS:550:PAUSTOP") field(LNK2, "QUAD:LTUS:550: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, "QUAD:LTUS:550:PAUSTART") { field(DESC, "Setup for PAU On") field(SDIS, "QUAD:LTUS:550: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, "QUAD:LTUS:550:PAUSTOP") { field(DESC, "Setup for PAU Off") field(SDIS, "QUAD:LTUS:550: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, "QUAD:LTUS:550:MCORDEVNAME") { field(DESC, "PS device name") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, "QUAD:LTUS:540:") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "QUAD:LTUS:550: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, "QUAD:LTUS:550:PSTYPE.RVAL") field(INPC, "QUAD:LTUS:550:TURNEDOFF.RVAL") field(INPD, "QUAD:LTUS:550:CONFIG.RVAL") field(INPE, "QUAD:LTUS:550:PSCATEGORY.RVAL") field(INPF, "QUAD:LTUS:550:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "QUAD:LTUS:550:AUTOCTRL.RVAL") field(INPJ, "QUAD:LTUS:550:OUTOFSERVICE.RVAL") field(INPL, "QUAD:LTUS:550:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "QUAD:LTUS:550:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "QUAD:LTUS:550:PAU") field(INPP, "QUAD:LTUS:550:CALBDISABLE.RVAL") field(INPQ, "QUAD:LTUS:550:PTRBDISABLE.RVAL") field(INPR, "QUAD:LTUS:550:TRIMDISABLE.RVAL") field(INPS, "QUAD:LTUS:550:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "QUAD:LTUS:550:FBCK") field(INPU, "QUAD:LTUS:550:TRIMTYPE.RVAL") field(INPV, "QUAD:LTUS:550:STDZDIRECT.RVAL") field(INPW, "QUAD:LTUS:550:DEGAUSENABLE.RVAL") field(FLNK, "QUAD:LTUS:550:HSTA") } record(longin, "QUAD:LTUS:550:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "QUAD:LTUS:550:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "QUAD:LTUS:550: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, "QUAD:LTUS:550: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, "QUAD:LTUS:550: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, "QUAD:LTUS:550: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, "QUAD:LTUS:550: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, "QUAD:LTUS:550: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 QUAD:LTUS:550:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses QUAD:LTUS:550:FBCK. # This PV should be replaced by QUAD:LTUS:550: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, "QUAD:LTUS:550: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, "QUAD:LTUS:550: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, "QUAD:LTUS:550: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, "QUAD:LTUS:540:OUTOFSERVICE CPP NMS") field(OMSL, "closed_loop") field(FLNK, "QUAD:LTUS:550:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"QUAD:LTUS:550:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "QUAD:LTUS:550:OUTOFSERVICE NPP NMS") field(OUT, "QUAD:LTUS:550:ONLINE PP") } record(bo, "QUAD:LTUS:550:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "QUAD:LTUS:550: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, "QUAD:LTUS:550: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, "QUAD:LTUS:550: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, "QUAD:LTUS:550: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, "QUAD:LTUS:550: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, "QUAD:LTUS:550: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, "QUAD:LTUS:550: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, "QUAD:LTUS:550: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, "QUAD:LTUS:550: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, "QUAD:LTUS:550: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, "QUAD:LTUS:550: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, "QUAD:LTUS:550:TRIMTYPE") } record(stringout, "QUAD:LTUS:550:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "QUAD:LTUS:540:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "QUAD:LTUS:550:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "QUAD:LTUS:550:STATE.RVAL") field(INPB, "QUAD:LTUS:550:INTLKSUMY.RVAL") field(OUT, "QUAD:LTUS:550:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:LTUS:550: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, "QUAD:LTUS:550:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "QUAD:LTUS:550:STATE.RVAL") field(INPB, "QUAD:LTUS:550:INTLKSUMY.RVAL") field(OUT, "QUAD:LTUS:550:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:LTUS:550:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "QUAD:LTUS:550:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "QUAD:LTUS:550: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, "QUAD:LTUS:550: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, "QUAD:LTUS:550: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, "QUAD:LTUS:550: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,"QUAD:LTUS:550: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("QUAD:LTUS:550:TURNEDOFF",3140,1907,0,1,"QUAD:LTUS:550:TURNEDOFF") #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "QUAD:LTUS:550:STATSUB") { field(DESC, "Build STATus ") field(INAM, "mgntInit") field(SNAM, "mgntSlcStat") field(INPA, "QUAD:LTUS:550:BACT.STAT") field(INPB, "QUAD:LTUS:550:BDES.STAT") field(INPC, "QUAD:LTUS:550: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, "QUAD:LTUS:550:BACT.SEVR") field(INPH, "QUAD:LTUS:550:BDES.SEVR") field(INPI, "QUAD:LTUS:550: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, "QUAD:LTUS:550:STATE.RVAL") field(INPN, "QUAD:LTUS:550:STDZOK") field(INPO, "QUAD:LTUS:550:CALBOK") field(INPP, "QUAD:LTUS:550:OUTOFSERVICE.RVAL") field(INPQ, "QUAD:LTUS:550:CONFIG.RVAL") field(INPR, "QUAD:LTUS:550:HSTA") field(INPS, "QUAD:LTUS:550:CTRL.RVAL") field(INPT, "QUAD:LTUS:550:DEGAUSOK") field(INPV, "QUAD:LTUS:550: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, "QUAD:LTUS:550:STAT") } record(longout, "QUAD:LTUS:550:STAT") { field(DESC, "STAT sent to SLC") field(SCAN, "Passive") field(FLNK, "QUAD:LTUS:550:STATCTRLSUB") field(DOL, "QUAD:LTUS:550:STATSUB.VAL") field(OMSL, "closed_loop") } record(sSub, "QUAD:LTUS:550:STATCTRLSUB") { field(DESC, "Decode SLC STAT into mbbo") field(INAM, "mgntInit") field(SNAM, "mgntStatDecode") field(INPA, "QUAD:LTUS:550:STAT") field(INPB, "QUAD:LTUS:550:HSTA") field(INPD, "QUAD:LTUS:550:ONOFFCTRL.RVAL") field(FLNK, "QUAD:LTUS:550:STATMSG") } record(mbbo, "QUAD:LTUS:550: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, "QUAD:LTUS:550:UNAVAILGO") field(DOL, "QUAD:LTUS:550:STATCTRLSUB.W") } record(seq, "QUAD:LTUS:550:UNAVAILGO") { field(DESC, "Process UNAVAIL") field(DOL1, "QUAD:LTUS:550:STATSUB.U") field(LNK1, "QUAD:LTUS:550:UNAVAIL PP") } record(stringout, "QUAD:LTUS:550:SNLSTATMSG") { field(DTYP, "Soft Channel") } #! TextBox(TB0,820,1000,1200,1220,0,"Dialog",12,1,16777215,"QUAD:LTUS:550:STATUSSUB - future\nOverall device status - takes input from action snls, record sevrs, master snl(s) and outputs final status\n\nInputs:\nA - QUAD:LTUS:550:CTRLSTATUS - snl status\nB - MGNT:CTRLSTATUS - master list status\nC\nD - QUAD:LTUS:550: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,"QUAD:LTUS:550STATSUB\nformat control bo's into slc STAT\n\nInputs:\nA - QUAD:LTUS:550:STATUS\nC - QUAD:LTUS:550:ON\nD - QUAD:LTUS:550:STDZOK\nE - QUAD:LTUS:550:CALBOK\nF - QUAD:LTUS:550:BACTDRIFT (future)\nG -\nH- QUAD:LTUS:550:DACSTATUS\nI -QUAD:LTUS:550:ADCSTATUS\nJ - QUAD:LTUS:550:BACTSTATUS\nK - QUAD:LTUS:550:BDESSTATUS\nL - QUAD:LTUS:550:RIPLSTATUS\n\nOutput:\nP - QUAD:LTUS:550: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, "QUAD:LTUS:550: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, "QUAD:LTUS:550: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, "QUAD:LTUS:550: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, "QUAD:LTUS:550: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 b-field of a slave with out a powered trim coil # equal to the main desired current and pass backwards # through the IVB poly. record(sub, "QUAD:LTUS:550:IDES2BDES") { field(DESC, "Cal BDES") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "QUAD:LTUS:550:IDES2BDES") field(INPB, "QUAD:LTUS:550:POLYCOEF") field(INPC, "QUAD:LTUS:550:POLYCOEF.A") field(INPD, "QUAD:LTUS:550:POLYCOEF.B") field(INPE, "QUAD:LTUS:540:IDES CP MS") field(INPF, "QUAD:LTUS:540:BDELTAS PP") field(INPG, "100") field(EGU, "kG") field(HOPR, "102.3265") field(LOPR, "0.2562") field(HIHI, "102.3265") field(LOLO, "0.2562") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "102.3265") field(LOW, "0.2562") field(FLNK, "QUAD:LTUS:550:BDES") } # Calcuate the bcon of a slave using # the main desired current and pass backwards # through the IVB poly. # the trim b-field is acutally amps. record(sub, "QUAD:LTUS:550:ICON2BCON") { field(DESC, "Cal BCON") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "QUAD:LTUS:550:ICON2BCON") field(INPB, "QUAD:LTUS:550:POLYCOEF") field(INPC, "QUAD:LTUS:550:POLYCOEF.A") field(INPD, "QUAD:LTUS:550:POLYCOEF.B") field(INPE, "QUAD:LTUS:540:ICON CP NMS") field(INPF, "QUAD:LTUS:540:BDELTAS PP") field(INPG, "100") field(EGU, "kG") field(HOPR, "102.3265") field(LOPR, "0.2562") field(HIHI, "102.3265") field(LOLO, "0.2562") field(PREC, "7") field(BRSV, "INVALID") # Set MINOR alarms for main as the default, slaves will set NO_ALARM field(HHSV, "NO_ALARM") field(HSV, "NO_ALARM") field(LSV, "NO_ALARM") field(LLSV, "NO_ALARM") field(HIGH, "102.3265") field(LOW, "0.2562") field(FLNK, "QUAD:LTUS:550:BCON") }#! 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, "QUAD:LTUS:560:IACT") { field(DESC, "Current") field(INP, "QUAD:LTUS:540:IACT CP NMS") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "QUAD:LTUS:560:BACT") info(autosaveFields,"HYST") } record(bi, "QUAD:LTUS:560:STATE") { field(DESC, "PS On/Off Status") field(DTYP, "Raw Soft Channel") field(INP, "QUAD:LTUS:540:STATE CP MS") field(ZSV, "MAJOR") field(ZNAM, "OFF") field(ONAM, "ON") } record(ao, "QUAD:LTUS:560:IDES") { field(DESC, "Desired Current") field(PREC, "3") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(MDEL, "-1") field(HIHI, "200.0") field(LOLO, "0.0") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "QUAD:LTUS:560:BDELTAS") field(DRVH, "200.0") field(DRVL, "0.0") field(DOL, "QUAD:LTUS:560: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, "QUAD:LTUS:560:ICTRL PP") } # This record is processed by QUAD:LTUS:560:ICON") # Note: we are not setting alarms here. record(ao, "QUAD:LTUS:560:ICON") { field(DESC, "Config I") field(DTYP, "Soft Channel") field(PREC, "3") field(HOPR, "200.0") field(LOPR, "0.0") field(DRVH, "200.0") field(DRVL, "0.0") field(DOL, "QUAD:LTUS:560:B2ICON.K") field(OMSL, "closed_loop") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:560:INOM") { field(DESC, "Nominal Current") field(DOL, "QUAD:LTUS:560:BNOM.K") field(OMSL, "closed_loop") field(PREC, "3") field(EGU, "A") field(DRVH, "200.0") field(DRVL, "0.0") field(HOPR, "200.0") field(LOPR, "0.0") } record(ao, "QUAD:LTUS:560:ICTRL") { field(DESC, "Set Current") field(PREC, "3") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(DRVH, "200.0") field(DRVL, "0.0") field(MDEL, "-1") field(FLNK, "QUAD:LTUS:560:ICTRLGO") field(OMSL, "supervisory") info(autosavefields,"VAL") } record(seq, "QUAD:LTUS:560:ICTRLGO") { field(DESC, "Process Current Setpoint") field(PREC, "3") # Set ISETPT to supervisory field(DOL1, "0") field(LNK1, "QUAD:LTUS:560:ISETPT.OMSL") field(DOL2, "QUAD:LTUS:560:ICTRL") field(LNK2, "QUAD:LTUS:560:ISETPT PP") # Set ISETPT to closed loop - get data from BCTRLSUB.K field(DOL3, "1") field(LNK3, "QUAD:LTUS:560:ISETPT.OMSL") } record(ao, "QUAD:LTUS:560:IMAX") { field(DESC, "Max I") field(DTYP, "Soft Channel") field(DRVH, "200.0") field(DRVL, "0.0") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(PREC, "3") field(PINI, "YES") field(VAL, "200.0") field(FLNK, "QUAD:LTUS:560:IMIN") } record(ao, "QUAD:LTUS:560:IMIN") { field(DESC, "Min I") field(DTYP, "Soft Channel") field(DRVH, "200.0") field(DRVL, "0.0") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(PREC, "3") field(VAL, "0.0") field(FLNK, "QUAD:LTUS:560:IRANGE") } record(sel, "QUAD:LTUS:560:IACTPREVOK") { field(DESC, "Last Good Current") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(PREC, "3") field(NVL, "QUAD:LTUS:560:BACT.SEVR") field(INPA, "QUAD:LTUS:560:IACT NPP MS") field(INPB, "QUAD:LTUS:560:IACTPREVOK NPP MS") field(INPC, "QUAD:LTUS:560:IACTPREVOK NPP MS") field(INPD, "QUAD:LTUS:560:IACTPREVOK NPP MS") } record(sub, "QUAD:LTUS:560:IACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:560:IDES") field(INPB, "QUAD:LTUS:560:ISETPT.DRVH") field(INPC, "QUAD:LTUS:560:ISETPT.DRVL") field(INPD, "QUAD:LTUS:560:IDELTAS.I") field(INPE, "QUAD:LTUS:560:IDELTAS.J") field(INPG, "QUAD:LTUS:560:STATE") field(INPH, "QUAD:LTUS:560:HSTA") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(sub, "QUAD:LTUS:560:IMONLIMITS") { field(DESC, "Aux Current Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:560:IDES") field(INPB, "QUAD:LTUS:560:ISETPT.DRVH") field(INPC, "QUAD:LTUS:560:ISETPT.DRVL") field(INPD, "QUAD:LTUS:560:IDELTAS.K") field(INPE, "QUAD:LTUS:560:IDELTAS.L") field(INPG, "QUAD:LTUS:560:STATE") field(INPH, "QUAD:LTUS:560:HSTA") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(seq, "QUAD:LTUS:560:ILIMITS") { field(DESC, "Set ACT and MON Limits") field(PREC, "3") field(DOL1, "QUAD:LTUS:560:BLIMITS") field(LNK1, "QUAD:LTUS:560:IACTLIMITS.F PP") field(DOL2, "QUAD:LTUS:560:IACTLIMITS.I") field(LNK2, "QUAD:LTUS:560:IACT.HIGH") field(DOL3, "QUAD:LTUS:560:IACTLIMITS.J") field(LNK3, "QUAD:LTUS:560:IACT.LOW") field(DOL4, "QUAD:LTUS:560:IACTLIMITS.K") field(LNK4, "QUAD:LTUS:560:IACT.HIHI") field(DOL5, "QUAD:LTUS:560:IACTLIMITS.L") field(LNK5, "QUAD:LTUS:560:IACT.LOLO") field(DOL6, "QUAD:LTUS:560:BLIMITS") field(LNK6, "QUAD:LTUS:560:IMONLIMITS.F PP") field(DOL7, "QUAD:LTUS:560:IMONLIMITS.I") field(LNK7, "QUAD:LTUS:560:IMON.HIGH") field(DOL8, "QUAD:LTUS:560:IMONLIMITS.J") field(LNK8, "QUAD:LTUS:560:IMON.LOW") field(DOL9, "QUAD:LTUS:560:IMONLIMITS.K") field(LNK9, "QUAD:LTUS:560:IMON.HIHI") field(DOLA, "QUAD:LTUS:560:IMONLIMITS.L") field(LNKA, "QUAD:LTUS:560: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, "QUAD:LTUS:560:IDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntRawDeltas") field(INPD, "QUAD:LTUS:560:TRIMBTOL") field(INPE, "QUAD:LTUS:560:CHCKBTOL") field(INPF, "QUAD:LTUS:560:BDELTAS.K") field(INPG, "QUAD:LTUS:560:BDELTAS.L") field(INPH, "QUAD:LTUS:560: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, "QUAD:LTUS:560:STDZITOLR") field(INPC, "QUAD:LTUS:560:STDZITOL") field(FLNK, "") } # All ps controllers with on/off control will set the macro ONOF # as follows: # # ONOF = QUAD:LTUS:540: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, "QUAD:LTUS:560: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 = QUAD:LTUS:540:RESET PP # record(bo, "QUAD:LTUS:560: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, "QUAD:LTUS:560:RAMPSTATE") { field(DESC, "PS Ramp Status") field(DTYP, "Soft Channel") field(DOL, "QUAD:LTUS:540: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, "QUAD:LTUS:560: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, "QUAD:LTUS:560:TRIMRAMPRATE") field(OUT, "") field(FLNK, "QUAD:LTUS:560:STDZDLY") } record(ao, "QUAD:LTUS:560:ISETPT") { field(DESC, "Current Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(DRVH, "200.0") field(DRVL, "0.0") field(MDEL, "-1") field(OUT, "") field(DOL, "QUAD:LTUS:560: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, "QUAD:LTUS:560:IMON") { field(DESC, "Aux Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(INP, "QUAD:LTUS:540:IMON CP NMS") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "QUAD:LTUS:560:BMON") } record(ao, "QUAD:LTUS:560:IRIPL") { field(DESC, "Ripple Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(DOL, "QUAD:LTUS:540:IRIPL CP NMS") field(OMSL, "closed_loop") field(EGU, "A") field(DRVH, "1.0") field(HOPR, "1.0") field(PREC, "3") field(FLNK, "QUAD:LTUS:560:IRIPLOK") } record(sub, "QUAD:LTUS:560:IRIPLOK") { field(DESC, "Ripple Current Status") field(INAM, "mgntInit") field(SNAM, "mgntRiplOK") field(INPA, "QUAD:LTUS:560:IRIPL.VAL") field(INPB, "QUAD:LTUS:560: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, "QUAD:LTUS:560:R") { field(DESC, "Resistance") field(EGU, "Ohms") field(PREC, "4") field(PINI, "YES") field(DOL, "QUAD:LTUS:540: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, "QUAD:LTUS:560:IGND") { field(DESC, "Ground Current") field(EGU, "A") field(PREC, "6") field(PINI, "YES") field(DOL, "QUAD:LTUS:540:IGND CP MS") field(OMSL, "closed_loop") } record(bi, "QUAD:LTUS:560:INTLKSUMY") { field(DESC, "Interlock Summary") field(INP, "QUAD:LTUS:540:INTLKSUMY CP MS") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(ZNAM, "OK") field(ONAM, "FAULT") field(PINI, "NO") } record(mbbo, "QUAD:LTUS:560: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, "QUAD:LTUS:540:COOLING CP NMS") field(OMSL, "closed_loop") } # The following PV is processed by :BACTFO # which is processed by :BACT record(fanout, "QUAD:LTUS:560:IACTFO") { field(DESC, "IACT processing") field(SELM, "All") field(LNK1, "QUAD:LTUS:560:IACTPREVOK") field(LNK2, "QUAD:LTUS:560:IDIFF") field(LNK3, "QUAD:LTUS:560:IADIFF") field(LNK4, "QUAD:LTUS:560:IRATIO") field(LNK5, "QUAD:LTUS:560:IDIRECT") field(LNK6, "QUAD:LTUS:560:IACTPOL_CHECK") } record(calc, "QUAD:LTUS:560:IDIFF") { field(DESC, "IDES-IACT") field(CALC, "A-B") field(INPA, "QUAD:LTUS:560:IDES") field(INPB, "QUAD:LTUS:560:IACT") field(EGU, "A") field(PREC, "9") field(HOPR, "200.0") field(LOPR, "0.0") } record(calc, "QUAD:LTUS:560:IADIFF") { field(DESC, "Absolute IDES-IACT") field(CALC, "A<0?ABS(A):A") field(INPA, "QUAD:LTUS:560:IDIFF") field(PREC, "9") } record(calc, "QUAD:LTUS:560:IRATIO") { field(DESC, "IDES-IACT/IMAX") field(CALC, "B?A/B:0") field(INPA, "QUAD:LTUS:560:IDIFF") field(INPB, "QUAD:LTUS:560:IDES.DRVH") field(PREC, "9") } record(calcout, "QUAD:LTUS:560:IRANGE") { field(DESC, "Current Range") field(PINI, "YES") field(CALC, "ABS(A-B)") field(INPA, "QUAD:LTUS:560:IMIN") field(INPB, "QUAD:LTUS:560: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, "QUAD:LTUS:560: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, "QUAD:LTUS:560:IACT") field(FLNK, "QUAD:LTUS:560:IACTPOL") } record(bo, "QUAD:LTUS:560:IACTPOL") { field(DESC, "Actual I Polarity") field(DTYP, "Raw Soft Channel") field(DOL, "QUAD:LTUS:560: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,"QUAD:LTUS:560:I*LIMITS:\n Calculate alarm and warning limits based on \n deltas from QUAD:LTUS:560:IDELTAS and the\n QUAD:LTUS:560: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,"QUAD:LTUS:560:IACT: \n Get copy of QUAD:LTUS:560:I. \n",null) #! TextBox(TB12,1280,3100,1760,3200,0,"Dialog",12,1,16777215,"QUAD:LTUS:560: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,"QUAD:LTUS:560:IDES:\n Contains raw value calculated by \nQUAD:LTUS:560: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 \nQUAD:LTUS:560:BDELTAS.\n",null) #! TextBox(TB10,56,1940,316,2340,0,"Dialog",12,1,16777215,"QUAD:LTUS:560: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 QUAD:LTUS:560: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 QUAD:LTUS:560: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,"QUAD:LTUS:560:ISETPT:\n Sets the hardware. When fast feedback is set on, this record is\n set to closed loop mode by QUAD:LTUS:560:FBCKSTART sequence. When \n the loop is closed, this record takes input calculated by \n BFBCK only. When fast feedback is set off, QUAD:LTUS:560:FBCKSTOP \n will set it back to supervisory so that the value can be set by \n QUAD:LTUS:560: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, "QUAD:LTUS:560:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:560:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "QUAD:LTUS:560:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "QUAD:LTUS:560:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "QUAD:LTUS:560:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "QUAD:LTUS:560:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "1") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "QUAD:LTUS:560: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, "QUAD:LTUS:560:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "QUAD:LTUS:560:TRIMTYPE.RVAL") field(INPB, "QUAD:LTUS:560:CONFIG.RVAL") field(OUT, "QUAD:LTUS:560:TRIMMAXNUM PP") } record(longout, "QUAD:LTUS:560: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, "QUAD:LTUS:560: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, "QUAD:LTUS:540:TRIMRAMPRATE CP NMS") field(OMSL, "closed_loop") field(VAL, "") field(OUT, "QUAD:LTUS:560:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "QUAD:LTUS:560: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, "QUAD:LTUS:540:TRIMSETL CP NMS") field(OMSL, "closed_loop") field(VAL, "") } record(bo, "QUAD:LTUS:560: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, "QUAD:LTUS:560: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, "QUAD:LTUS:560: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, "0") } record(bo, "QUAD:LTUS:560:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "0") } record(ao, "QUAD:LTUS:560: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, "QUAD:LTUS:560:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "QUAD:LTUS:560: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, "QUAD:LTUS:560: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, "QUAD:LTUS:560:IMOVE") field(INPB, "QUAD:LTUS:560:IACT") field(INPC, "QUAD:LTUS:560:IRAMPRATE") field(INPD, "1.0") field(INPE, "QUAD:LTUS:560:TRIMDLYPCT") field(INPF, "QUAD:LTUS:560:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "QUAD:LTUS:560:RAMPTIME_LEFT PP") } record(longout, "QUAD:LTUS:560:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "QUAD:LTUS:560:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "QUAD:LTUS:560:RAMPDONE_CALC") } record(calc, "QUAD:LTUS:560:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "QUAD:LTUS:560:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "QUAD:LTUS:560:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "QUAD:LTUS:560: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, "QUAD:LTUS:560:RAMPTIME_LEFT") field(OUT, "QUAD:LTUS:560:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "QUAD:LTUS:560:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "QUAD:LTUS:560:RAMPTIME_LEFT NMS") field(OUT, "QUAD:LTUS:560:RAMPDONE PP") } record(bo, "QUAD:LTUS:560:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "QUAD:LTUS:560:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "QUAD:LTUS:560: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, "QUAD:LTUS:560: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, "QUAD:LTUS:560:STDZINIT") { field(DESC, "Proc. Stdz PVs on boot") field(PINI, "YES") field(DOL1, "1") field(DOL2, "1") field(DOL3, "1") field(LNK1, "QUAD:LTUS:560:DEBUG.PROC PP") field(LNK2, "QUAD:LTUS:560:STDZCYCLENUM.PROC PP") field(LNK3, "QUAD:LTUS:560:STDZDISABLE.PROC PP") field(LNK4, "QUAD:LTUS:560: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, "QUAD:LTUS:560:STDZSUB") { field(DESC, "Stdz subroutine") field(INAM, "mgntStdzInit") field(SNAM, "mgntStdz") field(BRSV, "INVALID") field(INPA, "QUAD:LTUS:560:STDZIMIN NPP NMS") field(INPB, "QUAD:LTUS:560:STDZIMAX NPP NMS") field(INPC, "QUAD:LTUS:560:STDZIFINAL NPP NMS") field(INPD, "QUAD:LTUS:560:STDZCYCLENUM NPP NMS") field(INPE, "QUAD:LTUS:560:STDZDIRECT.RVAL NPP NMS") field(INPF, "QUAD:LTUS:560:STDZDISABLE.RVAL CPP NMS") field(INPG, "QUAD:LTUS:560: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, "QUAD:LTUS:560:STDZWF PP") field(OUTB, "QUAD:LTUS:560: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, "QUAD:LTUS:560:STDZWF") } record(mbbo, "QUAD:LTUS:560: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, "QUAD:LTUS:560: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, "QUAD:LTUS:560:STDZMAINPS") { field(DESC, "Stdz by main or self") field(PINI, "YES") field(DTYP, "Soft Channel") field(ZNAM, "SELF") field(ONAM, "MAIN") } record(bo, "QUAD:LTUS:560: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, "QUAD:LTUS:560: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, "QUAD:LTUS:560: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, "QUAD:LTUS:560:STDZTOD") { field(DESC, "Successful Standardize Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "QUAD:LTUS:560:STDZLOSTTOD") { field(DESC, "Standardize Lost Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(longout, "QUAD:LTUS:560:STDZCYCLECNT") { field(DESC, "Cycle Count") field(PINI, "YES") } record(longout, "QUAD:LTUS:560: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, "QUAD:LTUS:560:STDZDIRECT") } # The default standardize direction is "UP" for # all LCLS Magnets.. record(bo, "QUAD:LTUS:560:STDZDIRECT") { field(DESC, "Standardize Direction ") field(ZNAM, "UP") field(ONAM, "DOWN") field(VAL, "0") field(FLNK, "QUAD:LTUS:560:STDZIMIN") } record(ao, "QUAD:LTUS:560:STDZIMIN") { field(DESC, "Min-STDZ Current") field(PREC, "1") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(VAL, "0.0") field(FLNK, "QUAD:LTUS:560:STDZIMAX") } record(ao, "QUAD:LTUS:560:STDZIMAX") { field(DESC, "Max. Standarize Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(VAL, "200.0") field(FLNK, "QUAD:LTUS:560:STDZIFINAL") } record(ao, "QUAD:LTUS:560:STDZIFINAL") { field(DESC, "Final SDTZ Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(VAL, "0.0") field(FLNK, "QUAD:LTUS:560: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, "QUAD:LTUS:560: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, "QUAD:LTUS:560:STDZITOL") { field(DESC, "Stdz min tolerance") field(PREC, "5") field(CALC, "MAX(ABS(A),ABS(B))*C") field(INPA, "QUAD:LTUS:560:STDZIMIN CP NMS") field(INPB, "QUAD:LTUS:560:STDZIMAX CP MMS") field(INPC, "0.05") field(INPD, "QUAD:LTUS:560:STDZITOLR CP MMS") field(EGU, "A") field(FLNK, "QUAD:LTUS:560:IDELTAS") field(PINI, "YES") } # D - factor (3.154/2 = 1.577) for EPSC, otherwise, set to 1.0 record(calc, "QUAD:LTUS:560:STDZDLY") { field(DESC, "Ramp time for stdz cycle") field(CALC, "C>0?MAX(1,ABS((A-B)/C)*D):0") field(INPA, "QUAD:LTUS:560:STDZIMIN CP NMS") field(INPB, "QUAD:LTUS:560:STDZIMAX CP NMS") field(INPC, "QUAD:LTUS:560:TRIMRAMPRATE CP NMS") field(INPD, "1.0") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") } record(calc, "QUAD:LTUS:560:STDZRAMPDLY") { field(DESC, "Ramp delay total") field(CALC, "MAX(1,((A/100)*B+B))") field(PREC, "5") field(INPA, "QUAD:LTUS:560:TRIMDLYPCT CP MS") field(INPB, "QUAD:LTUS:560: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, "QUAD:LTUS:560:STDZMINIDLY") { field(DESC, "Mini-stdz delay") field(CALC, "A") field(PREC, "5") field(A, "1.0") field(EGU, "sec") field(PINI, "YES") } record(ao, "QUAD:LTUS:560: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, "QUAD:LTUS:560:STDZMINIDELTA") { field(DESC, "Stdz mini % of IMAX") field(CALC, "(B/100)*(A-C)") field(INPA, "QUAD:LTUS:560:IDES.HOPR") field(INPB, "QUAD:LTUS:560:STDZMINIPCT CPP NMS") field(INPC, "QUAD:LTUS:560:IDES.LOPR") field(PREC, "5") } record(calc, "QUAD:LTUS:560:STDZMINISETPT") { field(DESC, "Mini Stdz delta") field(CALC, "C==0?MAX(E-D,B):MIN(E+D,A)") field(INPA, "QUAD:LTUS:560:IDES.HOPR") field(INPB, "QUAD:LTUS:560:IDES.LOPR") field(INPC, "QUAD:LTUS:560:STDZDIRECT.RVAL") field(INPD, "QUAD:LTUS:560:STDZMINIDELTA") field(INPE, "QUAD:LTUS:560:IDES") field(PREC, "5") field(FLNK, "QUAD:LTUS:560: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, "QUAD:LTUS:560:STDZMINISETPTOOR") { field(DESC, "Mini Stdz setpoint out of range") field(CALC, "C==0?(E-DA)") field(INPA, "QUAD:LTUS:560:IDES.HOPR") field(INPB, "QUAD:LTUS:560:IDES.LOPR") field(INPC, "QUAD:LTUS:560:STDZDIRECT.RVAL") field(INPD, "QUAD:LTUS:560:STDZMINIDELTA") field(INPE, "QUAD:LTUS:560: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, "QUAD:LTUS:560: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, "QUAD:LTUS:560:IADJUST.RVAL") field(INPB, "QUAD:LTUS:560:STDZDIRECT.RVAL") field(INPC, "QUAD:LTUS:560:STDZOK.RVAL") field(INPD, "QUAD:LTUS:560:STDZDISABLE.RVAL") field(INPE, "QUAD:LTUS:560:STATE.RVAL CPP NMS") field(INPF, "QUAD:LTUS:560:ICTRL.RVAL") field(INPG, "QUAD:LTUS:560:STATE.SEVR") field(INPH, "QUAD:LTUS:560:BDELTAS.M") field(INPI, "QUAD:LTUS:560:IACT.SEVR") field(OUT, "QUAD:LTUS:560:STDZLOSTGO.SELN PP NMS") field(OOPT, "Transition To Non-zero") } record(seq, "QUAD:LTUS:560:STDZLOSTGO") { field(DESC, "Process lost stdz") field(SELM, "Mask") field(DOL1, "1") field(DOL2, "0") field(LNK1, "QUAD:LTUS:560:STDZLOSTTOD.PROC") field(LNK2, "QUAD:LTUS:560:STDZOK PP") } # Record maximum current after standardize # Reset to IACT from sequence after trim # Disable processing during (mini-)standardize or trim record(calc, "QUAD:LTUS:560:STDZIACTMAX") { field(DESC, "Max act current after stdz") field(CALC, "MAX(A, B)") field(DISV, "0") field(SDIS, "QUAD:LTUS:560:CHECKPWRDIP_ENABLE") field(INPA, "QUAD:LTUS:560:IACT CP") field(INPB, "QUAD:LTUS:560:STDZIACTMAX") field(EGU, "A") field(FLNK, "QUAD:LTUS:560:CHECKPWRDIP") } # Detect power dip if STDZOK is YES, STDZ is enabled, and IACT is valid # If IACT drops below STDZIACTMAX by more than the trim tolerance, clear STDZOK # Warning: Take the absolute value of the trim tolerance, or else quads of # negative polarity will always lose STDZ since their IDELTAS.I are negative. # Note: Large quads and bends are prone to losing STDZ even if they are # perturbed toward higher current since their current tends to overshoot # by greater than the trim tolerance before settling down. record(calcout, "QUAD:LTUS:560:CHECKPWRDIP") { field(DESC, "Detect power dip") field(CALC, "(A-B>ABS(C))?3:0") field(DISV, "0") field(SDIS, "QUAD:LTUS:560:CHECKPWRDIP_ENABLE") field(INPA, "QUAD:LTUS:560:STDZIACTMAX") field(INPB, "QUAD:LTUS:560:IACT") field(INPC, "QUAD:LTUS:560:IDELTAS.I") field(OUT, "QUAD:LTUS:560:STDZLOSTGO.SELN PP NMS") field(OOPT, "When Non-zero") } # Enable processing of STDZIACTMAX and CHECKPWRDIP only if # STDZOK = YES, STDZDISABLE = NO, CTRL != Trim (2), and # CTRL != Stdz (4) record(calc, "QUAD:LTUS:560:CHECKPWRDIP_ENABLE") { field(CALC, "A&&!B&&(C#2)&&(C#4)") field(INPA, "QUAD:LTUS:560:STDZOK.RVAL CP") field(INPB, "QUAD:LTUS:560:STDZDISABLE.RVAL CP") field(INPC, "QUAD:LTUS:560:CTRL.RVAL CP") } #! 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, "QUAD:LTUS:560: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, "QUAD:LTUS:560: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, "QUAD:LTUS:560:CALBSET") { field(DESC, "Use DAC Calbration") field(SCAN, "10 second") field(CALC, "A&&(B==0)&&C?31:960") field(INPA, "QUAD:LTUS:560:CALBOK") field(INPB, "QUAD:LTUS:560:CALBDISABLE") field(INPC, "QUAD:LTUS:560:CALBSLOPE") field(OOPT, "On Change") field(OUT, "QUAD:LTUS:560: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, "QUAD:LTUS:560:CALB_SEQ") { field(DESC, "Output Calib Values") field(SELM, "Mask") field(SELL, "QUAD:LTUS:560: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, "QUAD:LTUS:560:CALBSLOPE") field(DOL3, "QUAD:LTUS:560: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, "QUAD:LTUS:560:CALBTOD") { field(DESC, "Calibration Success Time") field(PINI, "YES") # field(DOL, "") field(OMSL, "supervisory") field(DTYP, "Soft Channel") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:560: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, "QUAD:LTUS:560: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, "QUAD:LTUS:560: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, "QUAD:LTUS:560:CALBOFFSET") { field(DESC, "Calc DAC Offset") field(PREC, "6") field(EGU, "Counts") field(PINI, "YES") } record(bo, "QUAD:LTUS:560: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, "QUAD:LTUS:560:DACSLOPE") { field(DESC, "V to DAC slope") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "supervisory") field(PINI, "YES") field(FLNK, "QUAD:LTUS:560:DACOFFSET") } # Default Offset used in conversion from Volts to DAC Counts record(ao, "QUAD:LTUS:560:DACOFFSET") { field(DESC, "V to DAC offset") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "supervisory") field(PINI, "YES") field(FLNK, "QUAD:LTUS:560: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, "QUAD:LTUS:560: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, "QUAD:LTUS:560:IACT") field(INPD, "QUAD:LTUS:560:DACSLOPE") field(INPE, "QUAD:LTUS:560:DACOFFSET") field(EGU, "Counts") field(PREC, "6") } record(ao, "QUAD:LTUS:560:DAC") { field(DESC, "DAC Set point") field(EGU, "Counts") field(DOL, "") field(OMSL, "supervisory") field(PREC, "6") field(PINI, "YES") } record(ao, "QUAD:LTUS:560:CALBIMIN") { field(DESC, "Calibration Min Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(DRVH, "200.0") field(HOPR, "200.0") field(DRVL, "0.0") field(LOPR, "0.0") field(PREC, "3") field(EGU, "A") field(VAL, "0.0") field(FLNK, "QUAD:LTUS:560:CALBIMAX") } record(ao, "QUAD:LTUS:560:CALBIMAX") { field(DESC, "Calibration Max Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(DRVH, "200.0") field(HOPR, "200.0") field(LOPR, "0.0") field(DRVL, "0.0") field(EGU, "A") field(VAL, "200.0") field(FLNK, "QUAD:LTUS:560:CALBSTEPNUM") } record(ao, "QUAD:LTUS:560:CALBIFINAL") { field(DESC, "Calibration Last Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(PREC, "3") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(VAL, "0") } record(longout, "QUAD:LTUS:560: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, "QUAD:LTUS:560:CALBIDELTA") } record(calc, "QUAD:LTUS:560:CALBIDELTA") { field(DESC, "Step size for CALB") field(CALC, "C=0?0:ABS((A-B)/C)") field(INPA, "QUAD:LTUS:560:CALBIMAX") field(INPB, "QUAD:LTUS:560:CALBIMIN") field(INPC, "QUAD:LTUS:560: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, "QUAD:LTUS:560:CALBIMULT") { field(DESC, "IACT vs ISETPT mult") field(CALC, "C#0||A=0?1:ABS(B/A)") field(INPA, "QUAD:LTUS:540:ISETPT.DRVH") field(INPB, "QUAD:LTUS:540:IACT.HOPR") field(INPC, "QUAD:LTUS:560:PSCONTROLLER.RVAL CPP") field(EGU, "A") field(PINI, "YES") } # SNL dbputs DAC values here. 6-10 steps are possible. record(waveform, "QUAD:LTUS:560:CALBICTRLWF") { field(DESC, "ICTRL setpoint array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") } record(waveform, "QUAD:LTUS:560:DACWF") { field(DESC, "DAC count array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:560:DACSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:560:DACSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "QUAD:LTUS:560: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, "QUAD:LTUS:560:CALCDACWF") { field(DESC, "Calc DAC counts array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:560:CALCDACSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:560:CALCDACSA") { field(DESC, "Calc DAC counts") field(DTYP, "Soft Channel") field(INP, "QUAD:LTUS:560: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, "QUAD:LTUS:560:CALBYWF") { field(DESC, "mx + b") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:560:CALBYSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:560:CALBYSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "QUAD:LTUS:560:CALBYWF") field(MALM, "10") field(NELM, "6") field(INDX, "0") field(FTVL, "DOUBLE") } record(waveform, "QUAD:LTUS:560:CALBIACTWF") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:560:CALBIACTSA") } # Used only for xygraph edm plot record(subArray, "QUAD:LTUS:560:CALBIACTSA") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(MALM, "10") field(NELM, "6") field(INP, "QUAD:LTUS:560:CALBIACTWF") field(INDX, "0") field(FTVL, "DOUBLE") field(FLNK, "QUAD:LTUS:560:CALBLIMITS") } # Check that measured current during calibration is within # tolerance. record(aSub, "QUAD:LTUS:560: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, "QUAD:LTUS:560:CALBSTEPNUM") field(INPB, "QUAD:LTUS:560:CALBIACTWF") field(INPC, "QUAD:LTUS:560: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, "QUAD:LTUS:560: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, "QUAD:LTUS:560:STDZITOL") field(INPH, "QUAD:LTUS:560:DACSLOPE") field(INPI, "QUAD:LTUS:560: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, "QUAD:LTUS:560: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, "QUAD:LTUS:560:CALBSTEPNUM") field(INPB, "QUAD:LTUS:560:CALBIACTWF") field(INPC, "QUAD:LTUS:560:DACWF") field(INPF, "QUAD:LTUS:560: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 QUAD:LTUS:560CALBOK 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, "QUAD:LTUS:560:DEGAUSINIT") { field(DESC, "Proc. Degauss PVs on boot") field(PINI, "YES") field(DOL, "1") field(OUTA, "QUAD:LTUS:560:DEGAUSIMIN.PROC PP") field(OUTB, "QUAD:LTUS:560:DEGAUSIMAX.PROC PP") field(OUTC, "QUAD:LTUS:560:DEGAUSTYPE.PROC PP") field(OUTD, "QUAD:LTUS:560:DEGAUSSTEP.PROC PP") field(OUTE, "QUAD:LTUS:560:MADNAME.PROC PP") field(OUTF, "QUAD:LTUS:560:PSTYPE.PROC PP") field(OUTG, "QUAD:LTUS:560: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, "QUAD:LTUS:560:DEGAUSSUB") { field(DESC, "Degauss subroutine") field(INAM, "mgntDegaussInit") field(SNAM, "mgntDegauss") field(BRSV, "INVALID") field(INPA, "QUAD:LTUS:560:DEGAUSIMIN NPP NMS") field(INPB, "QUAD:LTUS:560:DEGAUSIMAX NPP NMS") field(INPC, "QUAD:LTUS:560:DEGAUSTYPE.RVAL NPP NMS") field(INPE, "QUAD:LTUS:560:DEGAUSMETHOD.RVAL NPP NMS") field(INPF, "QUAD:LTUS:560:PSTYPE NPP NMS") field(INPG, "QUAD:LTUS:560:DEBUG.RVAL NPP NMS") field(INPH, "QUAD:LTUS:560: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, "QUAD:LTUS:560:DEGAUSWF PP") field(OUTB, "QUAD:LTUS:560:DEGAUSMSG PP") field(OUTC, "QUAD:LTUS:560: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, "QUAD:LTUS:560:DEGAUSWF") { field(DESC, "Degauss Setpts") field(NELM, "60") field(FTVL, "DOUBLE") } record(mbbo,"QUAD:LTUS:560: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, "QUAD:LTUS:560: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, "QUAD:LTUS:560: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, "QUAD:LTUS:560: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, "QUAD:LTUS:560: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, "QUAD:LTUS:560:DEGAUSIMIN") { field(DESC, "Min. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "200.0") field(LOPR, "-200.0") field(DRVH, "200.0") field(DRVL, "-200.0") field(VAL, "-200.0") } record(ao, "QUAD:LTUS:560:DEGAUSIMAX") { field(DESC, "Max. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "200.0") field(LOPR, "-200.0") field(DRVH, "200.0") field(DRVL, "-200.0") field(VAL, "200.0") } # 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,"QUAD:LTUS:560: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, "QUAD:LTUS:560: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,"QUAD:LTUS:560: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, "QUAD:LTUS:560: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, "QUAD:LTUS:560: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, "QUAD:LTUS:560: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, "QUAD:LTUS:560:DEGAUSTOD") { field(DESC, "Successful Degauss Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "QUAD:LTUS:560:DEGAUSLOSTTOD") { field(DESC, "Degauss Lost Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:560:DEGAUSTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "QUAD:LTUS:560:DEGAUSTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "QUAD:LTUS:560: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, "QUAD:LTUS:560:DEGAUSGO") { field(DESC, "Set bdes of btrms to zero") field(ASG, "Internal") field(OUTA, "") field(OUTB, "") field(OUTC, "") field(OUTD, "") } # =========== CRYO ONLY =========== record(bo, "QUAD:LTUS:560: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, "QUAD:LTUS:560:DEGAUS_IMAX_CHECK") { field(DESC, "Check if imax shoud chg") field(CALC, "(C==4)&&(ABS(B)>ABS(A))?1:0") field(INPA, "QUAD:LTUS:560:DEGAUS_IMAX") field(INPB, "QUAD:LTUS:560:ISETPT") field(INPC, "QUAD:LTUS:560:DEGAUSTYPE.RVAL") field(OUT, "QUAD:LTUS:560:DEGAUS_IMAX_UPDATE.SELN") field(FLNK, "QUAD:LTUS:560:DEGAUS_IMAX_UPDATE") } record(seq, "QUAD:LTUS:560:DEGAUS_IMAX_UPDATE") { field(DESC, "Degauss IMAX Update") field(SELM, "Specified") field(DOL1, "QUAD:LTUS:560:ISETPT") field(LNK1, "QUAD:LTUS:560:DEGAUS_IMAX PP") } # Set the maximum current after a successful # degauss. This pv is updated by the # sequence. record(ao, "QUAD:LTUS:560:DEGAUS_IMAX") { field(DESC, "Max I set afer a degauss") field(EGU, "Amps") field(PINI, "YES") field(PREC, "6") field(HOPR, "200.0") field(LOPR, "-200.0") field(DRVH, "200.0") field(DRVL, "-200.0") field(VAL, "200.0") field(FLNK, "QUAD:LTUS:560:DEGAUS_IMAXPOL_CHECK") info(autosaveFields,"VAL,RVAL") } # Set the polarity if degauss_imax record(calcout, "QUAD:LTUS:560:DEGAUS_IMAXPOL_CHECK") { field(DESC, "Determine polarity of imax") field(CALC, "A>=0?0:1") field(INPA, "QUAD:LTUS:560:DEGAUS_IMAX") field(FLNK, "QUAD:LTUS:560:DEGAUS_IMAXPOL") } record(bo, "QUAD:LTUS:560:DEGAUS_IMAXPOL") { field(DESC, "Polarity of imax I") field(DTYP, "Raw Soft Channel") field(DOL, "QUAD:LTUS:560:DEGAUS_IMAXPOL_CHECK") field(OMSL, "closed_loop") field(ZNAM, "Positive") field(ONAM, "Negative") field(FLNK, "QUAD:LTUS:560: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, "QUAD:LTUS:560:DEGAUS_ABSIMAX") { field(DESC, "Absolute Max. Degauss I") field(CALC, "ABS(A)") field(INPA, "QUAD:LTUS:560:DEGAUS_IMAX") field(PREC, "6") field(EGU, "Amps") field(HOPR, "200.0") field(LOPR, "-200.0") info(autosaveFields,"VAL RVAL") } # IACT Polarity record(calcout, "QUAD:LTUS:560:IACTPOL_CHECK") { field(DESC, "Determine IACT polarity") field(SCAN, "5 second") field(CALC, "ABS(A-B)>C?(A>=0?0:1):D") field(INPA, "QUAD:LTUS:560:IACT") field(INPB, "QUAD:LTUS:560:IACTPOL_CHECK.LA") field(INPC, "0.0001") field(INPD, "QUAD:LTUS:560:IACTPOL_CHECK.PVAL") field(OOPT, "On Change") field(FLNK, "QUAD:LTUS:560:IACTPOL") } record(bo, "QUAD:LTUS:560: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,"QUAD:LTUS:560: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, "QUAD:LTUS:560:DEGAUSENABLE CP") field(INPB, "QUAD:LTUS:560:DEGAUSOK") field(INPC, "QUAD:LTUS:560:STATE CP") field(INPD, "QUAD:LTUS:560:STATE.SEVR") field(OUT, "QUAD:LTUS:560:DEGAUS_STATE_SEQ.SELN PP") field(ASG, "Internal") } record(seq, "QUAD:LTUS:560:DEGAUS_STATE_SEQ") { field(DESC, "Degauss State Sequence") field(SELM, "Specified") field(SELL, "QUAD:LTUS:560:DEGAUS_STATE_CHECK") field(LNK1, "QUAD:LTUS:560:DEGAUS_STATE_DISABLE.PROC PP") field(LNK2, "QUAD:LTUS:560:DEGAUS_STATE_LOST.PROC PP") field(LNK3, "QUAD:LTUS:560:DEGAUS_STATE_GOOD.PROC PP") field(LNK4, "QUAD:LTUS:560: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, "QUAD:LTUS:560:DEGAUS_STATE_DISABLE") { field(DESC, "Degauss not used") field(LNK1, "QUAD:LTUS:560:DEGAUSOK.ZSV") field(LNK2, "QUAD:LTUS:560: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, "QUAD:LTUS:560:STATMSG.FRSV") field(LNK4, "QUAD:LTUS:560: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, "QUAD:LTUS:560:DEGAUS_STATE_LOST") { field(DESC, "Degauss lost and ps On") field(DOL1, "1") field(LNK1, "QUAD:LTUS:560:DEGAUSOK.ZSV") field(LNK2, "QUAD:LTUS:560: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, "QUAD:LTUS:560:STATMSG.FRSV") field(LNK4, "QUAD:LTUS:560: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, "QUAD:LTUS:560:DEGAUS_STATE_OFF") { field(DESC, "Degaused lost and ps Off") field(DOL1, "2") field(LNK1, "QUAD:LTUS:560: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, "QUAD:LTUS:560:STATMSG.FRSV") field(LNK3, "QUAD:LTUS:560: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, "QUAD:LTUS:560:DEGAUS_STATE_GOOD") { field(DESC, "Degauss good") field(DOL1, "1") field(LNK1, "QUAD:LTUS:560: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, "QUAD:LTUS:560:STATMSG.FRSV PP") field(LNK3, "QUAD:LTUS:560:STATMSG.FVSV PP") field(LNK4, "") field(ASG, "Internal") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(mbbo, "QUAD:LTUS:560:FUNC") { field(DESC, "QUAD:LTUS:560 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, "0") field(FFVL, "0") field(OUT, "QUAD:LTUS:560:CTRL CA") } # :CTRL pv is processed at boot in the # sequence mgntCtrl.st Processed in sequence # record(mbbo, "QUAD:LTUS:560:CTRL") { field(DESC, "QUAD:LTUS:560 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, "QUAD:LTUS:560:SELECTEN.A PP") field(SDIS, "0") } # If a function has been selected set this unit to busy record(calcout, "QUAD:LTUS:560:SELECTEN") { field(DESC, "Control Select Enable") field(CALC, "A>0?1:A") field(FLNK, "QUAD:LTUS:560:BUSY") } # Set to FREE on IOC reboot record(bo, "QUAD:LTUS:560:BUSY") { field(DESC, "QUAD:LTUS:560 Ctrl Done") field(DOL, "QUAD:LTUS:560:SELECTEN") field(ZNAM, "FREE") field(ONAM, "BUSY") field(PINI, "YES") field(FLNK, "QUAD:LTUS:560:SELECT") } record(bo, "QUAD:LTUS:560:SELECT") { field(ZNAM, "NO") field(ONAM, "YES") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") } record(bo, "QUAD:LTUS:560: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, "QUAD:LTUS:560:CTRLSTATE") { field(DESC, "QUAD:LTUS:560 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("QUAD:LTUS:560:CTRL",20,20,0,0,"QUAD:LTUS:560:CTRL") #! Field("QUAD:LTUS:560:CTRL.OUT",16777215,1,"QUAD:LTUS:560:CTRL.OUT") #! Link("QUAD:LTUS:560:CTRL.OUT","QUAD:LTUS:560:SELECTEN.A") #! Field("QUAD:LTUS:560:CTRL.VAL",16777215,1,"QUAD:LTUS:560:CTRL.VAL") #! Record("QUAD:LTUS:560:SELECTEN",321,381,0,0,"QUAD:LTUS:560:SELECTEN") #! Field("QUAD:LTUS:560:SELECTEN.A",16777215,0,"QUAD:LTUS:560:SELECTEN.A") #! Field("QUAD:LTUS:560:SELECTEN.FLNK",16777215,1,"QUAD:LTUS:560:SELECTEN.FLNK") #! Link("QUAD:LTUS:560:SELECTEN.FLNK","QUAD:LTUS:560:BUSY") #! Field("QUAD:LTUS:560:SELECTEN.VAL",16777215,1,"QUAD:LTUS:560:SELECTEN.VAL") #! Record("QUAD:LTUS:560:BUSY",623,274,0,0,"QUAD:LTUS:560:BUSY") #! Field("QUAD:LTUS:560:BUSY.DOL",16777215,0,"QUAD:LTUS:560:BUSY.DOL") #! Link("QUAD:LTUS:560:BUSY.DOL","QUAD:LTUS:560:SELECTEN.VAL") #! Field("QUAD:LTUS:560:BUSY.FLNK",16777215,1,"QUAD:LTUS:560:BUSY.FLNK") #! Link("QUAD:LTUS:560:BUSY.FLNK","QUAD:LTUS:560:SELECT") #! Record("QUAD:LTUS:560:SELECT",669,508,0,1,"QUAD:LTUS:560:SELECT") #! Record("QUAD:LTUS:560:FUNC",940,120,0,0,"QUAD:LTUS:560:FUNC") #! Field("QUAD:LTUS:560:FUNC.OUT",16777215,0,"QUAD:LTUS:560:FUNC.OUT") #! Link("QUAD:LTUS:560:FUNC.OUT","QUAD:LTUS:560:CTRL.VAL") #! Record("QUAD:LTUS:560:ABORT",193,41,0,0,"QUAD:LTUS:560:ABORT") #! Record("QUAD:LTUS:560:CTRLSTATE",369,34,0,0,"QUAD:LTUS:560: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,"QUAD:LTUS:560:SELECT is used for Multi-device selection.\nIt is enabled when associated QUAD:LTUS:560:CTRL is \"0\" (DONE).\nIt is disabled when associated QUAD:LTUS:560: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,"QUAD:LTUS:560: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, "QUAD:LTUS:560:BCTRL_INIT") { field(DESC, "Process BCTRL on boot") field(PINI, "YES") field(CALC, "A=3?1:0") field(INPA, "QUAD:LTUS:560:BCTRL.SEVR") field(OUT, "QUAD:LTUS:560: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, "QUAD:LTUS:560:BACT") { field(DESC, "Actual B") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "QUAD:LTUS:560:BACT") field(INPB, "QUAD:LTUS:560:POLYCOEF") field(INPC, "QUAD:LTUS:560:POLYCOEF.A") field(INPD, "QUAD:LTUS:560:POLYCOEF.B") field(INPE, "QUAD:LTUS:560:IACT MS") field(INPF, "QUAD:LTUS:560:BDELTAS PP") field(INPG, "100") field(EGU, "kG") field(HOPR, "-0.2545") field(LOPR, "-101.3749") field(HIHI, "-0.2545") field(LOLO, "-101.3749") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "-0.2545") field(LOW, "-101.3749") field(FLNK, "QUAD:LTUS:560: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, "QUAD:LTUS:560:BDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntPhyDeltas") field(EGU, "kG") field(HOPR, "1") field(PREC, "7") field(BRSV, "INVALID") field(INPA, "QUAD:LTUS:560:BDES") field(INPB, "QUAD:LTUS:560:TRIMBTOL") field(INPC, "QUAD:LTUS:560:TRIMBTOLR") field(INPD, "QUAD:LTUS:560:CHCKBTOL") field(INPE, "QUAD:LTUS:560:CHCKBTOLR") field(F, "2.0") field(INPG, "30") field(INPH, "QUAD:LTUS:560:BACT.VAL") # # MPS absolute and relative tolerances field(INPP, "QUAD:LTUS:560:MPSBTOL") field(INPQ, "QUAD:LTUS:560:MPSBTOLR") field(FLNK, "QUAD:LTUS:560:BCONLIMITS") info(autosaveFields,"F") } # This record is processed by BDELTAS record(aSub, "QUAD:LTUS:560:BCONLIMITS") { field(DESC, "Config B-field Limits") field(INAM, "mgntInit") field(SNAM, "mgntBCONLimits") field(INPA, "QUAD:LTUS:560:BDES") field(INPB, "QUAD:LTUS:560:BDELTAS.I") field(INPG, "QUAD:LTUS:560:DEBUG.RVAL") field(FTA, "DOUBLE") field(FTB, "DOUBLE") field(FTG, "ULONG") field(OUTA, "QUAD:LTUS:560:BCON.HIGH") field(OUTB, "QUAD:LTUS:560:BCON.LOW") field(OUTC, "QUAD:LTUS:560:BCON.HIHI") field(OUTD, "QUAD:LTUS:560:BCON.LOLO PP") field(FTVA, "DOUBLE") field(FTVB, "DOUBLE") field(FTVC, "DOUBLE") field(FTVD, "DOUBLE") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:560:IDELTAS") } # The following PV is processed by :BACT # which is processed by :BACT # record(fanout, "QUAD:LTUS:560:BACTFO") { field(DESC, "BACT processing") field(SELM, "All") field(LNK1, "QUAD:LTUS:560:BDIFF") field(LNK2, "QUAD:LTUS:560:BADIFF") field(LNK3, "QUAD:LTUS:560:BRATIO") field(LNK4, "QUAD:LTUS:560:MPSLIMITS") field(LNK5, "QUAD:LTUS:560:I2BSTATUS") field(LNK6, "QUAD:LTUS:560:IACTFO.PROC") } record(calc, "QUAD:LTUS:560:BDIFF") { field(DESC, "BDES-BACT") field(CALC, "A-B") field(INPA, "QUAD:LTUS:560:BDES") field(INPB, "QUAD:LTUS:560:BACT") field(EGU, "kG") field(PREC, "7") } record(calc, "QUAD:LTUS:560:BADIFF") { field(DESC, "Absolute BDES-BACT") field(INPA, "QUAD:LTUS:560:BDIFF") field(EGU, "kG") field(PREC, "7") field(CALC, "A<0?ABS(A):A") } record(calc, "QUAD:LTUS:560:BRATIO") { field(DESC, "BACT Error") field(CALC, "B?A/B:0") field(INPA, "QUAD:LTUS:560:BDIFF") field(INPB, "QUAD:LTUS:560:BDES.HOPR") field(EGU, "kG") field(PREC, "7") } record(mbbi, "QUAD:LTUS:560: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, "QUAD:LTUS:560:BACT.J") } # Note: for a string slave set the MONFL # macro to the following: # MONFL=:IMONCALC MS record(sub, "QUAD:LTUS:560:BMON") { field(DESC, "Second Transductor") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "QUAD:LTUS:560:BMON") field(INPB, "QUAD:LTUS:560:POLYCOEF") field(INPC, "QUAD:LTUS:560:POLYCOEF.A") field(INPD, "QUAD:LTUS:560:POLYCOEF.B") field(INPE, "QUAD:LTUS:560:IMON MS") field(INPF, "QUAD:LTUS:560:BDELTAS.VAL") field(INPG, "100") field(EGU, "kG") field(HOPR, "-0.2545") field(LOPR, "-101.3749") field(HIHI, "-0.2545") field(LOLO, "-101.3749") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "-0.2545") field(LOW, "-101.3749") } # 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=QUAD:LTUS:540:BDES CP record(ao, "QUAD:LTUS:560:BDES") { field(DESC, "Desired B-Field") field(PINI, "NO") field(DRVH, "-0.2545") field(DRVL, "-101.3749") field(HOPR, "-0.2545") field(LOPR, "-101.3749") field(PREC, "7") field(EGU, "kG") field(MDEL, "-1") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:560:IDES2BDES") field(OUT, "QUAD:LTUS:560:B2IDES PP") info(autosaveFields,"VAL") } record(sub, "QUAD:LTUS:560:B2IDES") { field(DESC, "Convert Desired B-Field to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:560:POLYCOEF") field(INPC, "QUAD:LTUS:560:POLYCOEF.A") field(INPD, "QUAD:LTUS:560:POLYCOEF.B") field(PREC, "7") field(EGU, "kG") field(HOPR, "-0.2545") field(LOPR, "-101.3749") field(MDEL, "-1") field(INPE, "QUAD:LTUS:560:BDES.DRVH") field(INPF, "QUAD:LTUS:560:BDES.DRVL") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:560:IDES") } record(sub, "QUAD:LTUS:560:BNOM") { field(DESC, "Nominal Field") field(PINI, "YES") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:560:POLYCOEF") field(INPC, "QUAD:LTUS:560:POLYCOEF.A") field(INPD, "QUAD:LTUS:560:POLYCOEF.B") field(INPE, "QUAD:LTUS:560:BDES.DRVH") field(INPF, "QUAD:LTUS:560:BDES.DRVL") field(EGU, "kG") field(HOPR, "-0.2545") field(LOPR, "-101.3749") field(PREC, "7") field(VAL, "0.0") field(FLNK, "QUAD:LTUS:560:INOM") } record(sub, "QUAD:LTUS:560:BACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:560:BDES.VAL") field(INPB, "QUAD:LTUS:560:BDES.DRVH") field(INPC, "QUAD:LTUS:560:BDES.DRVL") field(INPD, "QUAD:LTUS:560:BDELTAS.I") field(INPE, "QUAD:LTUS:560:BDELTAS.J") field(INPG, "QUAD:LTUS:560:STATE") field(INPH, "QUAD:LTUS:560:HSTA") field(EGU, "kG") field(HOPR, "-0.2545") field(LOPR, "-101.3749") field(PREC, "7") field(BRSV, "INVALID") } record(sub, "QUAD:LTUS:560:BMONLIMITS") { field(DESC, "MON Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:LTUS:560:BDES.VAL") field(INPB, "QUAD:LTUS:560:BDES.DRVH") field(INPC, "QUAD:LTUS:560:BDES.DRVL") field(INPD, "QUAD:LTUS:560:BDELTAS.K") field(INPE, "QUAD:LTUS:560:BDELTAS.L") field(INPG, "QUAD:LTUS:560:STATE") field(INPH, "QUAD:LTUS:560:HSTA") field(EGU, "kG") field(HOPR, "-0.2545") field(LOPR, "-101.3749") field(PREC, "7") field(BRSV, "INVALID") } record(seq, "QUAD:LTUS:560:BLIMITS") { field(DESC, "ACT Limits") field(PREC, "7") field(DOL1, "QUAD:LTUS:560:BLIMITS") field(LNK1, "QUAD:LTUS:560:BACTLIMITS.F PP") field(DOL2, "QUAD:LTUS:560:BACTLIMITS.I") field(LNK2, "QUAD:LTUS:560:BACT.HIGH") field(DOL3, "QUAD:LTUS:560:BACTLIMITS.J") field(LNK3, "QUAD:LTUS:560:BACT.LOW") field(DOL4, "QUAD:LTUS:560:BACTLIMITS.K") field(LNK4, "QUAD:LTUS:560:BACT.HIHI") field(DOL5, "QUAD:LTUS:560:BACTLIMITS.L") field(LNK5, "QUAD:LTUS:560:BACT.LOLO") field(DOL6, "QUAD:LTUS:560:BLIMITS") field(LNK6, "QUAD:LTUS:560:BMONLIMITS.F PP") field(DOL7, "QUAD:LTUS:560:BMONLIMITS.I") field(LNK7, "QUAD:LTUS:560:BMON.HIGH") field(DOL8, "QUAD:LTUS:560:BMONLIMITS.J") field(LNK8, "QUAD:LTUS:560:BMON.LOW") field(DOL9, "QUAD:LTUS:560:BMONLIMITS.K") field(LNK9, "QUAD:LTUS:560:BMON.HIHI") field(DOLA, "QUAD:LTUS:560:BMONLIMITS.L") field(LNKA, "QUAD:LTUS:560:BMON.LOLO") field(FLNK, "QUAD:LTUS:560:ILIMITS") field(SCAN, "5 second") } record(ao, "QUAD:LTUS:560:BCTRL") { field(DESC, "B-Perturb") field(PREC, "7") field(EGU, "kG") field(DRVH, "-0.2545") field(DRVL, "-101.3749") field(HOPR, "-0.2545") field(LOPR, "-101.3749") # 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, "QUAD:LTUS:560: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, "QUAD:LTUS:560:BCTRLGO") { field(DESC, "Update DES and perturb") field(PREC, "7") # Disable BACT limits field(DOL1, "1") field(LNK1, "QUAD:LTUS:560:BLIMITS.VAL") # Update BDES with the BCTRL (slider) value field(DOL2, "QUAD:LTUS:560:BCTRL.VAL") field(LNK2, "QUAD:LTUS:560:BDES PP") field(DOL3, "1") field(LNK3, "QUAD:LTUS:560:IDIRECT.PROC PP") field(DOL4, "1") field(LNK4, "QUAD:LTUS:560:CHECKSTDZLOST.PROC PP") field(DOL5, "QUAD:LTUS:560:BCTRL.VAL") field(LNK5, "QUAD:LTUS:560:BCTRLSUB PP") # Re-enable BACT limits field(DOL6, "0") field(LNK6, "QUAD:LTUS:560:BLIMITS.VAL") } # Convert B-field to Current and output to ISETPT record(sub, "QUAD:LTUS:560:BCTRLSUB") { field(DESC, "Feedback") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:560:POLYCOEF") field(INPC, "QUAD:LTUS:560:POLYCOEF.A") field(INPD, "QUAD:LTUS:560:POLYCOEF.B") field(INPE, "QUAD:LTUS:560:BDES.DRVH") field(INPF, "QUAD:LTUS:560:BDES.DRVL") field(PREC, "7") field(EGU, "kG") field(HOPR, "-0.2545") field(LOPR, "-101.3749") field(MDEL, "-1") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:560:ISETPT") } record(ao, "QUAD:LTUS:560:BDESPREVTRIM") { field(DESC, "trim bdes for undo") field(DTYP, "Soft Channel") field(DRVH, "-0.2545") field(DRVL, "-101.3749") field(EGU, "kG") field(HOPR, "-0.2545") field(LOPR, "-101.3749") field(PREC, "7") field(PINI, "YES") info(autosaveFields,"VAL") } record(stringin, "QUAD:LTUS:560:MADNAME") { field(DESC, "MAD deck nomenclature") field(PINI, "YES") field(VAL, "QVB3B") } record(ai, "QUAD:LTUS:560: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, "3381.296822") } record(ao, "QUAD:LTUS:560:BMAX") { field(DESC, "Max B-Field") field(DTYP, "Soft Channel") field(DRVH, "-0.2545") field(DRVL, "-101.3749") field(EGU, "kG") field(HOPR, "-0.2545") field(LOPR, "-101.3749") field(PREC, "7") field(PINI, "YES") field(VAL, "-0.2545") field(FLNK, "QUAD:LTUS:560:BSTEP") } record(ao, "QUAD:LTUS:560:BMIN") { field(DESC, "Min B-Field") field(DTYP, "Soft Channel") field(DRVH, "-0.2545") field(DRVL, "-101.3749") field(EGU, "kG") field(HOPR, "-0.2545") field(LOPR, "-101.3749") field(PREC, "7") field(PINI, "YES") field(VAL, "-101.3749") field(FLNK, "QUAD:LTUS:560:BSTEP") } record(ao, "QUAD:LTUS:560:BDESSAVE") { field(DESC, "bdes for save/load") field(DTYP, "Soft Channel") field(DRVH, "-0.2545") field(DRVL, "-101.3749") field(EGU, "kG") field(HOPR, "-0.2545") field(LOPR, "-101.3749") field(PINI, "YES") field(PREC, "7") } # This record is processed by QUAD:LTUS:560: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, "QUAD:LTUS:560:BCON") { field(DESC, "Config B-Field ") field(DTYP, "Soft Channel") field(PREC, "7") field(EGU, "kG") field(HOPR, "-0.2545") field(LOPR, "-101.3749") field(DRVH, "-0.2545") field(DRVL, "-101.3749") # 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 , "QUAD:LTUS:560:ICON2BCON") field(OMSL, "closed_loop") field(OUT, "QUAD:LTUS:560:B2ICON PP") info(autosaveFields,"VAL") } record(sub, "QUAD:LTUS:560:B2ICON") { field(DESC, "Convert Desired ICon to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:LTUS:560:POLYCOEF") field(INPC, "QUAD:LTUS:560:POLYCOEF.A") field(INPD, "QUAD:LTUS:560:POLYCOEF.B") field(PREC, "7") field(EGU, "kG") field(HOPR, "-0.2545") field(LOPR, "-101.3749") field(MDEL, "-1") field(INPE, "QUAD:LTUS:560:BCON.DRVH") field(INPF, "QUAD:LTUS:560:BCON.DRVL") field(BRSV, "INVALID") field(FLNK, "QUAD:LTUS:560: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, "QUAD:LTUS:560:BSTEP") { field(DESC, "B-Field step size") field(CALC, "(C==3)||(D==3)?0:ABS(A-B)*0.005") field(INPA, "QUAD:LTUS:560:BMAX") field(INPB, "QUAD:LTUS:560:BMIN") field(INPC, "QUAD:LTUS:560:BMIN.SEVR") field(INPD, "QUAD:LTUS:560:BMAX.SEVR") field(EGU, "kG") 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,"QUAD:LTUS:560:BCTRLDISABLECALC") { field(DESC, "Calc for disabling BCTRL") field(ASG, "Internal") field(CALC, "A?2:1") field(INPA, "QUAD:LTUS:560:ONLINE CP") field(OUT, "QUAD:LTUS:560:BCTRLDISABLEFOUT PP") } record(fanout, "QUAD:LTUS:560:BCTRLDISABLEFOUT") { field(DESC, "Disable BCTRL fanout") field(SELM, "Specified") field(SELL, "QUAD:LTUS:560:BCTRLDISABLECALC") field(LNK1, "QUAD:LTUS:560:BCTRLDISABLE") field(LNK2, "QUAD:LTUS:560:BCTRLENABLE") } record(stringout, "QUAD:LTUS:560:BCTRLDISABLE") { field(DESC, "Disable BCTRL") field(DTYP, "Soft Channel") field(OUT, "QUAD:LTUS:560:BCTRL.ASG") field(VAL, "NOWRITE") field(FLNK, "QUAD:LTUS:560:BCTRLDISV_UPDATE") } record(stringout, "QUAD:LTUS:560:BCTRLENABLE") { field(DESC, "Enable BCTRL") field(DTYP, "Soft Channel") field(OUT, "QUAD:LTUS:560:BCTRL.ASG") field(VAL, "") field(FLNK, "QUAD:LTUS:560:BCTRLDISV_UPDATE") } record(calcout, "QUAD:LTUS:560:BCTRLDISV_UPDATE") { field(DESC, "Calc for updating BCTRL.DISV") field(ASG, "Internal") field(CALC, "A") field(INPA, "QUAD:LTUS:560:ONLINE") field(OUT, "QUAD:LTUS:560: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,"QUAD:LTUS:560:BACT and MON\n are processed via links from \n QUAD:LTUS:560:IACT (device raw value readback 1)\n and\n QUAD:LTUS:560: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 QUAD:LTUS:560:POLYCOEF\nC = First polynomial coefficient (offset if linear)\nD = Second polynomial coefficient (slope if linear)\nE = QUAD:LTUS:560: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,"QUAD:LTUS:560:BDES\n is processed when set by CA users or \n QUAD:LTUS:560: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,"QUAD:LTUS:560: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 QUAD:LTUS:560: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 (QUAD:LTUS:560: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,"QUAD:LTUS:560:B*LIMITS and QUAD:LTUS:560:BLIMITS:\n Calculate alarm and warning limits based on \n deltas from QUAD:LTUS:560: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,"QUAD:LTUS:560: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,"QUAD:LTUS:560: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, "QUAD:LTUS:560: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, "QUAD:LTUS:560:MPSBTOL") { field(DESC, "Absolute mps tol") field(EGU, "kG") field(PREC, "2") field(CALC, "ABS(A)*0.02") field(INPA, "QUAD:LTUS:560:BMAX") field(PINI, "YES") } # # 21-Aug-2013: K. Luchini # Set channel access security so that users # cannot easily change values. record(ao, "QUAD:LTUS:560:MPSBMAX") { field(DESC, "MPS Max B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "-0.2545") field(DRVL, "-101.3749") field(PINI, "YES") field(VAL, "-0.2545") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:560:MPSBMIN") { field(DESC, "MPS Min B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "-0.2545") field(DRVL, "-101.3749") field(PINI, "YES") field(VAL, "-101.3749") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:560:MPSBLLIM") { field(DESC, "MPS Low Limit B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "-0.2545") field(DRVL, "-101.3749") field(PINI, "YES") field(VAL, "-101.3749") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "QUAD:LTUS:560:MPSBLLIM2") { field(DESC, "MPS Low Limit #2 B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "-0.2545") field(DRVL, "-101.3749") field(PINI, "YES") field(VAL, "-101.3749") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } # Set the default to Std record(mbbo, "QUAD:LTUS:560: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, "QUAD:LTUS:560:MPSLIMITS.E PP") } record(aSub, "QUAD:LTUS:560: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, "QUAD:LTUS:560:MPS.RVAL") field(INPB, "QUAD:LTUS:560:BADIFF") field(INPC, "QUAD:LTUS:560:BDELTAS.N") field(INPD, "QUAD:LTUS:560:BACT") field(INPE, "QUAD:LTUS:560:MPSBITMASK.RVAL") field(INPF, "QUAD:LTUS:560:MPSBLLIM") field(INPG, "QUAD:LTUS:560:MPSBMIN") field(INPH, "QUAD:LTUS:560:MPSBMAX") field(INPI, "QUAD:LTUS:560: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, "QUAD:LTUS:560:INTOL.RVAL PP") field(OUTB, "QUAD:LTUS:560:INTOL_BMIN.RVAL PP") field(OUTC, "QUAD:LTUS:560:INTOL_BRANGE.RVAL PP") field(OUTD, "QUAD:LTUS:560: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, "QUAD:LTUS:560:INTOL") { field(DESC, "BACT within MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:560:MPSLIMITS.VALA") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "QUAD:LTUS:560:INTOL_BMIN") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:560:MPSLIMITS.VALB") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "QUAD:LTUS:560:INTOL_BMIN2") { field(DESC, "MPS tol #2") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:560:MPSLIMITS.VALD") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "QUAD:LTUS:560:INTOL_BRANGE") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:LTUS:560: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, "QUAD:LTUS:560:CHCKITOL") { field(DESC, "Absolute Check I Tolerance") field(EGU, "A") field(FLNK, "QUAD:LTUS:560:TRIMITOL") field(CALC, "ABS(A*B)") field(INPA, "QUAD:LTUS:560:CHCKBTOL") field(INPB, "QUAD:LTUS:560:POLYCOEF.B") field(PREC, "9") } record(calc, "QUAD:LTUS:560:TRIMBTOL") { field(EGU, "kG") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(DESC, "Absolute Trim Tolerance") field(CALC, "ABS(A)/2") field(INPA, "QUAD:LTUS:560:CHCKBTOL") field(FLNK, "QUAD:LTUS:560:CHCKITOL") } record(calc, "QUAD:LTUS:560:CHCKBTOL") { field(DESC, "Check absolute tolerance") field(EGU, "A") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(FLNK, "QUAD:LTUS:560:TRIMBTOL") field(CALC, "MAX(ABS(A),ABS(C))*(B/1000000)") field(INPA, "QUAD:LTUS:560:BDES.HOPR") field(INPB, "QUAD:LTUS:560:STABILITY") field(INPC, "QUAD:LTUS:560:BDES.LOPR") } record(longout, "QUAD:LTUS:560: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, "QUAD:LTUS:560:CHCKBTOL") } record(calc, "QUAD:LTUS:560:TRIMITOL") { field(DESC, "Absolute Trim I Tolerance") field(EGU, "kG") field(CALC, "ABS(A*B)") field(INPA, "QUAD:LTUS:560:POLYCOEF.B") field(INPB, "QUAD:LTUS:560:TRIMBTOL") field(PREC, "9") } record(ai, "QUAD:LTUS:560:TRIMBTOLR") { field(DESC, "Relative trim tol") field(PREC, "4") field(EGU, "%") field(HOPR, "1.0") field(LOPR, "0.0") field(PINI, "YES") } record(ai, "QUAD:LTUS:560: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, "QUAD:LTUS:560:FBCKFCOM") { field(ZNAM, "CA") field(ONAM, "FCOM") field(DESC, "CA Mode") field(PINI, "YES") field(SDIS, "0") } record(bo, "QUAD:LTUS:560:PAU") { field(ZNAM, "NotConfigured") field(ONAM, "Configured") field(DESC, "PAU Present") field(PINI, "YES") field(SDIS, "0") field(FLNK, "QUAD:LTUS:560:PAUGO") } record(fanout, "QUAD:LTUS:560:PAUGO") { field(DESC, "PAU control") field(LNK1, "QUAD:LTUS:560:PAUSTOP") field(LNK2, "QUAD:LTUS:560: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, "QUAD:LTUS:560:PAUSTART") { field(DESC, "Setup for PAU On") field(SDIS, "QUAD:LTUS:560: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, "QUAD:LTUS:560:PAUSTOP") { field(DESC, "Setup for PAU Off") field(SDIS, "QUAD:LTUS:560: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, "QUAD:LTUS:560:MCORDEVNAME") { field(DESC, "PS device name") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, "QUAD:LTUS:540:") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "QUAD:LTUS:560: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, "QUAD:LTUS:560:PSTYPE.RVAL") field(INPC, "QUAD:LTUS:560:TURNEDOFF.RVAL") field(INPD, "QUAD:LTUS:560:CONFIG.RVAL") field(INPE, "QUAD:LTUS:560:PSCATEGORY.RVAL") field(INPF, "QUAD:LTUS:560:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "QUAD:LTUS:560:AUTOCTRL.RVAL") field(INPJ, "QUAD:LTUS:560:OUTOFSERVICE.RVAL") field(INPL, "QUAD:LTUS:560:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "QUAD:LTUS:560:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "QUAD:LTUS:560:PAU") field(INPP, "QUAD:LTUS:560:CALBDISABLE.RVAL") field(INPQ, "QUAD:LTUS:560:PTRBDISABLE.RVAL") field(INPR, "QUAD:LTUS:560:TRIMDISABLE.RVAL") field(INPS, "QUAD:LTUS:560:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "QUAD:LTUS:560:FBCK") field(INPU, "QUAD:LTUS:560:TRIMTYPE.RVAL") field(INPV, "QUAD:LTUS:560:STDZDIRECT.RVAL") field(INPW, "QUAD:LTUS:560:DEGAUSENABLE.RVAL") field(FLNK, "QUAD:LTUS:560:HSTA") } record(longin, "QUAD:LTUS:560:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "QUAD:LTUS:560:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "QUAD:LTUS:560: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, "QUAD:LTUS:560: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, "QUAD:LTUS:560: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, "QUAD:LTUS:560: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, "QUAD:LTUS:560: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, "QUAD:LTUS:560: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 QUAD:LTUS:560:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses QUAD:LTUS:560:FBCK. # This PV should be replaced by QUAD:LTUS:560: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, "QUAD:LTUS:560: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, "QUAD:LTUS:560: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, "QUAD:LTUS:560: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, "QUAD:LTUS:540:OUTOFSERVICE CPP NMS") field(OMSL, "closed_loop") field(FLNK, "QUAD:LTUS:560:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"QUAD:LTUS:560:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "QUAD:LTUS:560:OUTOFSERVICE NPP NMS") field(OUT, "QUAD:LTUS:560:ONLINE PP") } record(bo, "QUAD:LTUS:560:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "QUAD:LTUS:560: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, "QUAD:LTUS:560: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, "QUAD:LTUS:560: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, "QUAD:LTUS:560: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, "QUAD:LTUS:560: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, "QUAD:LTUS:560: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, "QUAD:LTUS:560: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, "QUAD:LTUS:560: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, "QUAD:LTUS:560: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, "QUAD:LTUS:560: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, "QUAD:LTUS:560: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, "QUAD:LTUS:560:TRIMTYPE") } record(stringout, "QUAD:LTUS:560:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "QUAD:LTUS:540:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "QUAD:LTUS:560:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "QUAD:LTUS:560:STATE.RVAL") field(INPB, "QUAD:LTUS:560:INTLKSUMY.RVAL") field(OUT, "QUAD:LTUS:560:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:LTUS:560: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, "QUAD:LTUS:560:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "QUAD:LTUS:560:STATE.RVAL") field(INPB, "QUAD:LTUS:560:INTLKSUMY.RVAL") field(OUT, "QUAD:LTUS:560:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:LTUS:560:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "QUAD:LTUS:560:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "QUAD:LTUS:560: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, "QUAD:LTUS:560: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, "QUAD:LTUS:560: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, "QUAD:LTUS:560: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,"QUAD:LTUS:560: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("QUAD:LTUS:560:TURNEDOFF",3140,1907,0,1,"QUAD:LTUS:560:TURNEDOFF") #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "QUAD:LTUS:560:STATSUB") { field(DESC, "Build STATus ") field(INAM, "mgntInit") field(SNAM, "mgntSlcStat") field(INPA, "QUAD:LTUS:560:BACT.STAT") field(INPB, "QUAD:LTUS:560:BDES.STAT") field(INPC, "QUAD:LTUS:560: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, "QUAD:LTUS:560:BACT.SEVR") field(INPH, "QUAD:LTUS:560:BDES.SEVR") field(INPI, "QUAD:LTUS:560: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, "QUAD:LTUS:560:STATE.RVAL") field(INPN, "QUAD:LTUS:560:STDZOK") field(INPO, "QUAD:LTUS:560:CALBOK") field(INPP, "QUAD:LTUS:560:OUTOFSERVICE.RVAL") field(INPQ, "QUAD:LTUS:560:CONFIG.RVAL") field(INPR, "QUAD:LTUS:560:HSTA") field(INPS, "QUAD:LTUS:560:CTRL.RVAL") field(INPT, "QUAD:LTUS:560:DEGAUSOK") field(INPV, "QUAD:LTUS:560: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, "QUAD:LTUS:560:STAT") } record(longout, "QUAD:LTUS:560:STAT") { field(DESC, "STAT sent to SLC") field(SCAN, "Passive") field(FLNK, "QUAD:LTUS:560:STATCTRLSUB") field(DOL, "QUAD:LTUS:560:STATSUB.VAL") field(OMSL, "closed_loop") } record(sSub, "QUAD:LTUS:560:STATCTRLSUB") { field(DESC, "Decode SLC STAT into mbbo") field(INAM, "mgntInit") field(SNAM, "mgntStatDecode") field(INPA, "QUAD:LTUS:560:STAT") field(INPB, "QUAD:LTUS:560:HSTA") field(INPD, "QUAD:LTUS:560:ONOFFCTRL.RVAL") field(FLNK, "QUAD:LTUS:560:STATMSG") } record(mbbo, "QUAD:LTUS:560: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, "QUAD:LTUS:560:UNAVAILGO") field(DOL, "QUAD:LTUS:560:STATCTRLSUB.W") } record(seq, "QUAD:LTUS:560:UNAVAILGO") { field(DESC, "Process UNAVAIL") field(DOL1, "QUAD:LTUS:560:STATSUB.U") field(LNK1, "QUAD:LTUS:560:UNAVAIL PP") } record(stringout, "QUAD:LTUS:560:SNLSTATMSG") { field(DTYP, "Soft Channel") } #! TextBox(TB0,820,1000,1200,1220,0,"Dialog",12,1,16777215,"QUAD:LTUS:560:STATUSSUB - future\nOverall device status - takes input from action snls, record sevrs, master snl(s) and outputs final status\n\nInputs:\nA - QUAD:LTUS:560:CTRLSTATUS - snl status\nB - MGNT:CTRLSTATUS - master list status\nC\nD - QUAD:LTUS:560: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,"QUAD:LTUS:560STATSUB\nformat control bo's into slc STAT\n\nInputs:\nA - QUAD:LTUS:560:STATUS\nC - QUAD:LTUS:560:ON\nD - QUAD:LTUS:560:STDZOK\nE - QUAD:LTUS:560:CALBOK\nF - QUAD:LTUS:560:BACTDRIFT (future)\nG -\nH- QUAD:LTUS:560:DACSTATUS\nI -QUAD:LTUS:560:ADCSTATUS\nJ - QUAD:LTUS:560:BACTSTATUS\nK - QUAD:LTUS:560:BDESSTATUS\nL - QUAD:LTUS:560:RIPLSTATUS\n\nOutput:\nP - QUAD:LTUS:560: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, "QUAD:LTUS:560: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, "QUAD:LTUS:560: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, "QUAD:LTUS:560: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, "QUAD:LTUS:560: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 b-field of a slave with out a powered trim coil # equal to the main desired current and pass backwards # through the IVB poly. record(sub, "QUAD:LTUS:560:IDES2BDES") { field(DESC, "Cal BDES") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "QUAD:LTUS:560:IDES2BDES") field(INPB, "QUAD:LTUS:560:POLYCOEF") field(INPC, "QUAD:LTUS:560:POLYCOEF.A") field(INPD, "QUAD:LTUS:560:POLYCOEF.B") field(INPE, "QUAD:LTUS:540:IDES CP MS") field(INPF, "QUAD:LTUS:540:BDELTAS PP") field(INPG, "100") field(EGU, "kG") field(HOPR, "-0.2545") field(LOPR, "-101.3749") field(HIHI, "-0.2545") field(LOLO, "-101.3749") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "-0.2545") field(LOW, "-101.3749") field(FLNK, "QUAD:LTUS:560:BDES") } # Calcuate the bcon of a slave using # the main desired current and pass backwards # through the IVB poly. # the trim b-field is acutally amps. record(sub, "QUAD:LTUS:560:ICON2BCON") { field(DESC, "Cal BCON") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "QUAD:LTUS:560:ICON2BCON") field(INPB, "QUAD:LTUS:560:POLYCOEF") field(INPC, "QUAD:LTUS:560:POLYCOEF.A") field(INPD, "QUAD:LTUS:560:POLYCOEF.B") field(INPE, "QUAD:LTUS:540:ICON CP NMS") field(INPF, "QUAD:LTUS:540:BDELTAS PP") field(INPG, "100") field(EGU, "kG") field(HOPR, "-0.2545") field(LOPR, "-101.3749") field(HIHI, "-0.2545") field(LOLO, "-101.3749") field(PREC, "7") field(BRSV, "INVALID") # Set MINOR alarms for main as the default, slaves will set NO_ALARM field(HHSV, "NO_ALARM") field(HSV, "NO_ALARM") field(LSV, "NO_ALARM") field(LLSV, "NO_ALARM") field(HIGH, "-0.2545") field(LOW, "-101.3749") field(FLNK, "QUAD:LTUS:560:BCON") }#! 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, "BEND:LTUS:565:IACT") { field(DESC, "Current") field(INP, "BEND:LTUS:525:IACT CP NMS") field(EGU, "A") field(HOPR, "10.0") field(LOPR, "0.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "BEND:LTUS:565:BACT") info(autosaveFields,"HYST") } record(bi, "BEND:LTUS:565:STATE") { field(DESC, "PS On/Off Status") field(DTYP, "Raw Soft Channel") field(INP, "BEND:LTUS:525:STATE CP MS") field(ZSV, "MAJOR") field(ZNAM, "OFF") field(ONAM, "ON") } record(ao, "BEND:LTUS:565:IDES") { field(DESC, "Desired Current") field(PREC, "3") field(EGU, "A") field(HOPR, "10.0") field(LOPR, "0.0") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(MDEL, "-1") field(HIHI, "10.0") field(LOLO, "0.0") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "BEND:LTUS:565:BDELTAS") field(DRVH, "10.0") field(DRVL, "0.0") field(DOL, "BEND:LTUS:565: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, "BEND:LTUS:565:ICTRL PP") } # This record is processed by BEND:LTUS:565:ICON") # Note: we are not setting alarms here. record(ao, "BEND:LTUS:565:ICON") { field(DESC, "Config I") field(DTYP, "Soft Channel") field(PREC, "3") field(HOPR, "10.0") field(LOPR, "0.0") field(DRVH, "10.0") field(DRVL, "0.0") field(DOL, "BEND:LTUS:565:B2ICON.K") field(OMSL, "closed_loop") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:565:INOM") { field(DESC, "Nominal Current") field(DOL, "BEND:LTUS:565:BNOM.K") field(OMSL, "closed_loop") field(PREC, "3") field(EGU, "A") field(DRVH, "10.0") field(DRVL, "0.0") field(HOPR, "10.0") field(LOPR, "0.0") } record(ao, "BEND:LTUS:565:ICTRL") { field(DESC, "Set Current") field(PREC, "3") field(EGU, "A") field(HOPR, "10.0") field(LOPR, "0.0") field(DRVH, "10.0") field(DRVL, "0.0") field(MDEL, "-1") field(FLNK, "BEND:LTUS:565:ICTRLGO") field(OMSL, "supervisory") info(autosavefields,"VAL") } record(seq, "BEND:LTUS:565:ICTRLGO") { field(DESC, "Process Current Setpoint") field(PREC, "3") # Set ISETPT to supervisory field(DOL1, "0") field(LNK1, "BEND:LTUS:565:ISETPT.OMSL") field(DOL2, "BEND:LTUS:565:ICTRL") field(LNK2, "BEND:LTUS:565:ISETPT PP") # Set ISETPT to closed loop - get data from BCTRLSUB.K field(DOL3, "1") field(LNK3, "BEND:LTUS:565:ISETPT.OMSL") } record(ao, "BEND:LTUS:565:IMAX") { field(DESC, "Max I") field(DTYP, "Soft Channel") field(DRVH, "10.0") field(DRVL, "0.0") field(EGU, "A") field(HOPR, "10.0") field(LOPR, "0.0") field(PREC, "3") field(PINI, "YES") field(VAL, "10.0") field(FLNK, "BEND:LTUS:565:IMIN") } record(ao, "BEND:LTUS:565:IMIN") { field(DESC, "Min I") field(DTYP, "Soft Channel") field(DRVH, "10.0") field(DRVL, "0.0") field(EGU, "A") field(HOPR, "10.0") field(LOPR, "0.0") field(PREC, "3") field(VAL, "0.0") field(FLNK, "BEND:LTUS:565:IRANGE") } record(sel, "BEND:LTUS:565:IACTPREVOK") { field(DESC, "Last Good Current") field(EGU, "A") field(HOPR, "10.0") field(LOPR, "0.0") field(PREC, "3") field(NVL, "BEND:LTUS:565:BACT.SEVR") field(INPA, "BEND:LTUS:565:IACT NPP MS") field(INPB, "BEND:LTUS:565:IACTPREVOK NPP MS") field(INPC, "BEND:LTUS:565:IACTPREVOK NPP MS") field(INPD, "BEND:LTUS:565:IACTPREVOK NPP MS") } record(sub, "BEND:LTUS:565:IACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "BEND:LTUS:565:IDES") field(INPB, "BEND:LTUS:565:ISETPT.DRVH") field(INPC, "BEND:LTUS:565:ISETPT.DRVL") field(INPD, "BEND:LTUS:565:IDELTAS.I") field(INPE, "BEND:LTUS:565:IDELTAS.J") field(INPG, "BEND:LTUS:565:STATE") field(INPH, "BEND:LTUS:565:HSTA") field(EGU, "A") field(HOPR, "10.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(sub, "BEND:LTUS:565:IMONLIMITS") { field(DESC, "Aux Current Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "BEND:LTUS:565:IDES") field(INPB, "BEND:LTUS:565:ISETPT.DRVH") field(INPC, "BEND:LTUS:565:ISETPT.DRVL") field(INPD, "BEND:LTUS:565:IDELTAS.K") field(INPE, "BEND:LTUS:565:IDELTAS.L") field(INPG, "BEND:LTUS:565:STATE") field(INPH, "BEND:LTUS:565:HSTA") field(EGU, "A") field(HOPR, "10.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(seq, "BEND:LTUS:565:ILIMITS") { field(DESC, "Set ACT and MON Limits") field(PREC, "3") field(DOL1, "BEND:LTUS:565:BLIMITS") field(LNK1, "BEND:LTUS:565:IACTLIMITS.F PP") field(DOL2, "BEND:LTUS:565:IACTLIMITS.I") field(LNK2, "BEND:LTUS:565:IACT.HIGH") field(DOL3, "BEND:LTUS:565:IACTLIMITS.J") field(LNK3, "BEND:LTUS:565:IACT.LOW") field(DOL4, "BEND:LTUS:565:IACTLIMITS.K") field(LNK4, "BEND:LTUS:565:IACT.HIHI") field(DOL5, "BEND:LTUS:565:IACTLIMITS.L") field(LNK5, "BEND:LTUS:565:IACT.LOLO") field(DOL6, "BEND:LTUS:565:BLIMITS") field(LNK6, "BEND:LTUS:565:IMONLIMITS.F PP") field(DOL7, "BEND:LTUS:565:IMONLIMITS.I") field(LNK7, "BEND:LTUS:565:IMON.HIGH") field(DOL8, "BEND:LTUS:565:IMONLIMITS.J") field(LNK8, "BEND:LTUS:565:IMON.LOW") field(DOL9, "BEND:LTUS:565:IMONLIMITS.K") field(LNK9, "BEND:LTUS:565:IMON.HIHI") field(DOLA, "BEND:LTUS:565:IMONLIMITS.L") field(LNKA, "BEND:LTUS:565: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, "BEND:LTUS:565:IDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntRawDeltas") field(INPD, "BEND:LTUS:565:TRIMBTOL") field(INPE, "BEND:LTUS:565:CHCKBTOL") field(INPF, "BEND:LTUS:565:BDELTAS.K") field(INPG, "BEND:LTUS:565:BDELTAS.L") field(INPH, "BEND:LTUS:565: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, "BEND:LTUS:565:STDZITOLR") field(INPC, "BEND:LTUS:565:STDZITOL") field(FLNK, "") } # All ps controllers with on/off control will set the macro ONOF # as follows: # # ONOF = BEND:LTUS:525: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, "BEND:LTUS:565: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 = BEND:LTUS:525:RESET PP # record(bo, "BEND:LTUS:565: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, "BEND:LTUS:565:RAMPSTATE") { field(DESC, "PS Ramp Status") field(DTYP, "Soft Channel") field(DOL, "BEND:LTUS:525: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, "BEND:LTUS:565: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, "BEND:LTUS:565:TRIMRAMPRATE") field(OUT, "") field(FLNK, "BEND:LTUS:565:STDZDLY") } record(ao, "BEND:LTUS:565:ISETPT") { field(DESC, "Current Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(EGU, "A") field(HOPR, "10.0") field(LOPR, "0.0") field(DRVH, "10.0") field(DRVL, "0.0") field(MDEL, "-1") field(OUT, "") field(DOL, "BEND:LTUS:565: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, "BEND:LTUS:565:IMON") { field(DESC, "Aux Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(INP, "BEND:LTUS:525:IMON CP NMS") field(EGU, "A") field(HOPR, "10.0") field(LOPR, "0.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "BEND:LTUS:565:BMON") } record(ao, "BEND:LTUS:565:IRIPL") { field(DESC, "Ripple Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(DOL, "BEND:LTUS:525:IRIPL CP NMS") field(OMSL, "closed_loop") field(EGU, "A") field(DRVH, "1.0") field(HOPR, "1.0") field(PREC, "3") field(FLNK, "BEND:LTUS:565:IRIPLOK") } record(sub, "BEND:LTUS:565:IRIPLOK") { field(DESC, "Ripple Current Status") field(INAM, "mgntInit") field(SNAM, "mgntRiplOK") field(INPA, "BEND:LTUS:565:IRIPL.VAL") field(INPB, "BEND:LTUS:565: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, "BEND:LTUS:565:R") { field(DESC, "Resistance") field(EGU, "Ohms") field(PREC, "4") field(PINI, "YES") field(DOL, "BEND:LTUS:525: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, "BEND:LTUS:565:IGND") { field(DESC, "Ground Current") field(EGU, "A") field(PREC, "6") field(PINI, "YES") field(DOL, "BEND:LTUS:525:IGND CP MS") field(OMSL, "closed_loop") } record(bi, "BEND:LTUS:565:INTLKSUMY") { field(DESC, "Interlock Summary") field(INP, "BEND:LTUS:525:INTLKSUMY CP MS") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(ZNAM, "OK") field(ONAM, "FAULT") field(PINI, "NO") } record(mbbo, "BEND:LTUS:565: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, "BEND:LTUS:525:COOLING CP NMS") field(OMSL, "closed_loop") } # The following PV is processed by :BACTFO # which is processed by :BACT record(fanout, "BEND:LTUS:565:IACTFO") { field(DESC, "IACT processing") field(SELM, "All") field(LNK1, "BEND:LTUS:565:IACTPREVOK") field(LNK2, "BEND:LTUS:565:IDIFF") field(LNK3, "BEND:LTUS:565:IADIFF") field(LNK4, "BEND:LTUS:565:IRATIO") field(LNK5, "BEND:LTUS:565:IDIRECT") field(LNK6, "BEND:LTUS:565:IACTPOL_CHECK") } record(calc, "BEND:LTUS:565:IDIFF") { field(DESC, "IDES-IACT") field(CALC, "A-B") field(INPA, "BEND:LTUS:565:IDES") field(INPB, "BEND:LTUS:565:IACT") field(EGU, "A") field(PREC, "9") field(HOPR, "10.0") field(LOPR, "0.0") } record(calc, "BEND:LTUS:565:IADIFF") { field(DESC, "Absolute IDES-IACT") field(CALC, "A<0?ABS(A):A") field(INPA, "BEND:LTUS:565:IDIFF") field(PREC, "9") } record(calc, "BEND:LTUS:565:IRATIO") { field(DESC, "IDES-IACT/IMAX") field(CALC, "B?A/B:0") field(INPA, "BEND:LTUS:565:IDIFF") field(INPB, "BEND:LTUS:565:IDES.DRVH") field(PREC, "9") } record(calcout, "BEND:LTUS:565:IRANGE") { field(DESC, "Current Range") field(PINI, "YES") field(CALC, "ABS(A-B)") field(INPA, "BEND:LTUS:565:IMIN") field(INPB, "BEND:LTUS:565: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, "BEND:LTUS:565: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, "BEND:LTUS:565:IACT") field(FLNK, "BEND:LTUS:565:IACTPOL") } record(bo, "BEND:LTUS:565:IACTPOL") { field(DESC, "Actual I Polarity") field(DTYP, "Raw Soft Channel") field(DOL, "BEND:LTUS:565: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,"BEND:LTUS:565:I*LIMITS:\n Calculate alarm and warning limits based on \n deltas from BEND:LTUS:565:IDELTAS and the\n BEND:LTUS:565: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,"BEND:LTUS:565:IACT: \n Get copy of BEND:LTUS:565:I. \n",null) #! TextBox(TB12,1280,3100,1760,3200,0,"Dialog",12,1,16777215,"BEND:LTUS:565: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,"BEND:LTUS:565:IDES:\n Contains raw value calculated by \nBEND:LTUS:565: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 \nBEND:LTUS:565:BDELTAS.\n",null) #! TextBox(TB10,56,1940,316,2340,0,"Dialog",12,1,16777215,"BEND:LTUS:565: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 BEND:LTUS:565: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 BEND:LTUS:565: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,"BEND:LTUS:565:ISETPT:\n Sets the hardware. When fast feedback is set on, this record is\n set to closed loop mode by BEND:LTUS:565:FBCKSTART sequence. When \n the loop is closed, this record takes input calculated by \n BFBCK only. When fast feedback is set off, BEND:LTUS:565:FBCKSTOP \n will set it back to supervisory so that the value can be set by \n BEND:LTUS:565: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, "BEND:LTUS:565:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:565:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "BEND:LTUS:565:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "BEND:LTUS:565:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "BEND:LTUS:565:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "BEND:LTUS:565:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "1") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "BEND:LTUS:565: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, "BEND:LTUS:565:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "BEND:LTUS:565:TRIMTYPE.RVAL") field(INPB, "BEND:LTUS:565:CONFIG.RVAL") field(OUT, "BEND:LTUS:565:TRIMMAXNUM PP") } record(longout, "BEND:LTUS:565: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, "BEND:LTUS:565: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, "BEND:LTUS:525:TRIMRAMPRATE CP NMS") field(OMSL, "closed_loop") field(VAL, "") field(OUT, "BEND:LTUS:565:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "BEND:LTUS:565: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, "BEND:LTUS:525:TRIMSETL CP NMS") field(OMSL, "closed_loop") field(VAL, "") } record(bo, "BEND:LTUS:565: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, "BEND:LTUS:565: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, "BEND:LTUS:565: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, "0") } record(bo, "BEND:LTUS:565:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "0") } record(ao, "BEND:LTUS:565: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, "BEND:LTUS:565:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "BEND:LTUS:565: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, "BEND:LTUS:565: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, "BEND:LTUS:565:IMOVE") field(INPB, "BEND:LTUS:565:IACT") field(INPC, "BEND:LTUS:565:IRAMPRATE") field(INPD, "1.0") field(INPE, "BEND:LTUS:565:TRIMDLYPCT") field(INPF, "BEND:LTUS:565:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "BEND:LTUS:565:RAMPTIME_LEFT PP") } record(longout, "BEND:LTUS:565:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "BEND:LTUS:565:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "BEND:LTUS:565:RAMPDONE_CALC") } record(calc, "BEND:LTUS:565:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "BEND:LTUS:565:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "BEND:LTUS:565:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "BEND:LTUS:565: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, "BEND:LTUS:565:RAMPTIME_LEFT") field(OUT, "BEND:LTUS:565:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "BEND:LTUS:565:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "BEND:LTUS:565:RAMPTIME_LEFT NMS") field(OUT, "BEND:LTUS:565:RAMPDONE PP") } record(bo, "BEND:LTUS:565:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "BEND:LTUS:565:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "BEND:LTUS:565: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, "BEND:LTUS:565: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, "BEND:LTUS:565:STDZINIT") { field(DESC, "Proc. Stdz PVs on boot") field(PINI, "YES") field(DOL1, "1") field(DOL2, "1") field(DOL3, "1") field(LNK1, "BEND:LTUS:565:DEBUG.PROC PP") field(LNK2, "BEND:LTUS:565:STDZCYCLENUM.PROC PP") field(LNK3, "BEND:LTUS:565:STDZDISABLE.PROC PP") field(LNK4, "BEND:LTUS:565: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, "BEND:LTUS:565:STDZSUB") { field(DESC, "Stdz subroutine") field(INAM, "mgntStdzInit") field(SNAM, "mgntStdz") field(BRSV, "INVALID") field(INPA, "BEND:LTUS:565:STDZIMIN NPP NMS") field(INPB, "BEND:LTUS:565:STDZIMAX NPP NMS") field(INPC, "BEND:LTUS:565:STDZIFINAL NPP NMS") field(INPD, "BEND:LTUS:565:STDZCYCLENUM NPP NMS") field(INPE, "BEND:LTUS:565:STDZDIRECT.RVAL NPP NMS") field(INPF, "BEND:LTUS:565:STDZDISABLE.RVAL CPP NMS") field(INPG, "BEND:LTUS:565: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, "BEND:LTUS:565:STDZWF PP") field(OUTB, "BEND:LTUS:565: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, "BEND:LTUS:565:STDZWF") } record(mbbo, "BEND:LTUS:565: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, "BEND:LTUS:565: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, "BEND:LTUS:565:STDZMAINPS") { field(DESC, "Stdz by main or self") field(PINI, "YES") field(DTYP, "Soft Channel") field(ZNAM, "SELF") field(ONAM, "MAIN") } record(bo, "BEND:LTUS:565: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, "BEND:LTUS:565: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, "BEND:LTUS:565: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, "BEND:LTUS:565:STDZTOD") { field(DESC, "Successful Standardize Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "BEND:LTUS:565:STDZLOSTTOD") { field(DESC, "Standardize Lost Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(longout, "BEND:LTUS:565:STDZCYCLECNT") { field(DESC, "Cycle Count") field(PINI, "YES") } record(longout, "BEND:LTUS:565: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, "BEND:LTUS:565:STDZDIRECT") } # The default standardize direction is "UP" for # all LCLS Magnets.. record(bo, "BEND:LTUS:565:STDZDIRECT") { field(DESC, "Standardize Direction ") field(ZNAM, "UP") field(ONAM, "DOWN") field(VAL, "0") field(FLNK, "BEND:LTUS:565:STDZIMIN") } record(ao, "BEND:LTUS:565:STDZIMIN") { field(DESC, "Min-STDZ Current") field(PREC, "1") field(EGU, "A") field(HOPR, "10.0") field(LOPR, "0.0") field(VAL, "0.0") field(FLNK, "BEND:LTUS:565:STDZIMAX") } record(ao, "BEND:LTUS:565:STDZIMAX") { field(DESC, "Max. Standarize Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "10.0") field(LOPR, "0.0") field(VAL, "10.0") field(FLNK, "BEND:LTUS:565:STDZIFINAL") } record(ao, "BEND:LTUS:565:STDZIFINAL") { field(DESC, "Final SDTZ Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "10.0") field(LOPR, "0.0") field(VAL, "0.0") field(FLNK, "BEND:LTUS:565: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, "BEND:LTUS:565: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, "BEND:LTUS:565:STDZITOL") { field(DESC, "Stdz min tolerance") field(PREC, "5") field(CALC, "MAX(ABS(A),ABS(B))*C") field(INPA, "BEND:LTUS:565:STDZIMIN CP NMS") field(INPB, "BEND:LTUS:565:STDZIMAX CP MMS") field(INPC, "0.05") field(INPD, "BEND:LTUS:565:STDZITOLR CP MMS") field(EGU, "A") field(FLNK, "BEND:LTUS:565:IDELTAS") field(PINI, "YES") } # D - factor (3.154/2 = 1.577) for EPSC, otherwise, set to 1.0 record(calc, "BEND:LTUS:565:STDZDLY") { field(DESC, "Ramp time for stdz cycle") field(CALC, "C>0?MAX(1,ABS((A-B)/C)*D):0") field(INPA, "BEND:LTUS:565:STDZIMIN CP NMS") field(INPB, "BEND:LTUS:565:STDZIMAX CP NMS") field(INPC, "BEND:LTUS:565:TRIMRAMPRATE CP NMS") field(INPD, "1.0") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") } record(calc, "BEND:LTUS:565:STDZRAMPDLY") { field(DESC, "Ramp delay total") field(CALC, "MAX(1,((A/100)*B+B))") field(PREC, "5") field(INPA, "BEND:LTUS:565:TRIMDLYPCT CP MS") field(INPB, "BEND:LTUS:565: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, "BEND:LTUS:565:STDZMINIDLY") { field(DESC, "Mini-stdz delay") field(CALC, "A") field(PREC, "5") field(A, "1.0") field(EGU, "sec") field(PINI, "YES") } record(ao, "BEND:LTUS:565: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, "BEND:LTUS:565:STDZMINIDELTA") { field(DESC, "Stdz mini % of IMAX") field(CALC, "(B/100)*(A-C)") field(INPA, "BEND:LTUS:565:IDES.HOPR") field(INPB, "BEND:LTUS:565:STDZMINIPCT CPP NMS") field(INPC, "BEND:LTUS:565:IDES.LOPR") field(PREC, "5") } record(calc, "BEND:LTUS:565:STDZMINISETPT") { field(DESC, "Mini Stdz delta") field(CALC, "C==0?MAX(E-D,B):MIN(E+D,A)") field(INPA, "BEND:LTUS:565:IDES.HOPR") field(INPB, "BEND:LTUS:565:IDES.LOPR") field(INPC, "BEND:LTUS:565:STDZDIRECT.RVAL") field(INPD, "BEND:LTUS:565:STDZMINIDELTA") field(INPE, "BEND:LTUS:565:IDES") field(PREC, "5") field(FLNK, "BEND:LTUS:565: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, "BEND:LTUS:565:STDZMINISETPTOOR") { field(DESC, "Mini Stdz setpoint out of range") field(CALC, "C==0?(E-DA)") field(INPA, "BEND:LTUS:565:IDES.HOPR") field(INPB, "BEND:LTUS:565:IDES.LOPR") field(INPC, "BEND:LTUS:565:STDZDIRECT.RVAL") field(INPD, "BEND:LTUS:565:STDZMINIDELTA") field(INPE, "BEND:LTUS:565: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, "BEND:LTUS:565: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, "BEND:LTUS:565:IADJUST.RVAL") field(INPB, "BEND:LTUS:565:STDZDIRECT.RVAL") field(INPC, "BEND:LTUS:565:STDZOK.RVAL") field(INPD, "BEND:LTUS:565:STDZDISABLE.RVAL") field(INPE, "BEND:LTUS:565:STATE.RVAL CPP NMS") field(INPF, "BEND:LTUS:565:ICTRL.RVAL") field(INPG, "BEND:LTUS:565:STATE.SEVR") field(INPH, "BEND:LTUS:565:BDELTAS.M") field(INPI, "BEND:LTUS:565:IACT.SEVR") field(OUT, "BEND:LTUS:565:STDZLOSTGO.SELN PP NMS") field(OOPT, "Transition To Non-zero") } record(seq, "BEND:LTUS:565:STDZLOSTGO") { field(DESC, "Process lost stdz") field(SELM, "Mask") field(DOL1, "1") field(DOL2, "0") field(LNK1, "BEND:LTUS:565:STDZLOSTTOD.PROC") field(LNK2, "BEND:LTUS:565:STDZOK PP") } # Record maximum current after standardize # Reset to IACT from sequence after trim # Disable processing during (mini-)standardize or trim record(calc, "BEND:LTUS:565:STDZIACTMAX") { field(DESC, "Max act current after stdz") field(CALC, "MAX(A, B)") field(DISV, "0") field(SDIS, "BEND:LTUS:565:CHECKPWRDIP_ENABLE") field(INPA, "BEND:LTUS:565:IACT CP") field(INPB, "BEND:LTUS:565:STDZIACTMAX") field(EGU, "A") field(FLNK, "BEND:LTUS:565:CHECKPWRDIP") } # Detect power dip if STDZOK is YES, STDZ is enabled, and IACT is valid # If IACT drops below STDZIACTMAX by more than the trim tolerance, clear STDZOK # Warning: Take the absolute value of the trim tolerance, or else quads of # negative polarity will always lose STDZ since their IDELTAS.I are negative. # Note: Large quads and bends are prone to losing STDZ even if they are # perturbed toward higher current since their current tends to overshoot # by greater than the trim tolerance before settling down. record(calcout, "BEND:LTUS:565:CHECKPWRDIP") { field(DESC, "Detect power dip") field(CALC, "(A-B>ABS(C))?3:0") field(DISV, "0") field(SDIS, "BEND:LTUS:565:CHECKPWRDIP_ENABLE") field(INPA, "BEND:LTUS:565:STDZIACTMAX") field(INPB, "BEND:LTUS:565:IACT") field(INPC, "BEND:LTUS:565:IDELTAS.I") field(OUT, "BEND:LTUS:565:STDZLOSTGO.SELN PP NMS") field(OOPT, "When Non-zero") } # Enable processing of STDZIACTMAX and CHECKPWRDIP only if # STDZOK = YES, STDZDISABLE = NO, CTRL != Trim (2), and # CTRL != Stdz (4) record(calc, "BEND:LTUS:565:CHECKPWRDIP_ENABLE") { field(CALC, "A&&!B&&(C#2)&&(C#4)") field(INPA, "BEND:LTUS:565:STDZOK.RVAL CP") field(INPB, "BEND:LTUS:565:STDZDISABLE.RVAL CP") field(INPC, "BEND:LTUS:565:CTRL.RVAL CP") } #! 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, "BEND:LTUS:565: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, "BEND:LTUS:565: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, "BEND:LTUS:565:CALBSET") { field(DESC, "Use DAC Calbration") field(SCAN, "10 second") field(CALC, "A&&(B==0)&&C?31:960") field(INPA, "BEND:LTUS:565:CALBOK") field(INPB, "BEND:LTUS:565:CALBDISABLE") field(INPC, "BEND:LTUS:565:CALBSLOPE") field(OOPT, "On Change") field(OUT, "BEND:LTUS:565: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, "BEND:LTUS:565:CALB_SEQ") { field(DESC, "Output Calib Values") field(SELM, "Mask") field(SELL, "BEND:LTUS:565: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, "BEND:LTUS:565:CALBSLOPE") field(DOL3, "BEND:LTUS:565: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, "BEND:LTUS:565:CALBTOD") { field(DESC, "Calibration Success Time") field(PINI, "YES") # field(DOL, "") field(OMSL, "supervisory") field(DTYP, "Soft Channel") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:565: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, "BEND:LTUS:565: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, "BEND:LTUS:565: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, "BEND:LTUS:565:CALBOFFSET") { field(DESC, "Calc DAC Offset") field(PREC, "6") field(EGU, "Counts") field(PINI, "YES") } record(bo, "BEND:LTUS:565: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, "BEND:LTUS:565:DACSLOPE") { field(DESC, "V to DAC slope") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "supervisory") field(PINI, "YES") field(FLNK, "BEND:LTUS:565:DACOFFSET") } # Default Offset used in conversion from Volts to DAC Counts record(ao, "BEND:LTUS:565:DACOFFSET") { field(DESC, "V to DAC offset") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "supervisory") field(PINI, "YES") field(FLNK, "BEND:LTUS:565: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, "BEND:LTUS:565: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, "BEND:LTUS:565:IACT") field(INPD, "BEND:LTUS:565:DACSLOPE") field(INPE, "BEND:LTUS:565:DACOFFSET") field(EGU, "Counts") field(PREC, "6") } record(ao, "BEND:LTUS:565:DAC") { field(DESC, "DAC Set point") field(EGU, "Counts") field(DOL, "") field(OMSL, "supervisory") field(PREC, "6") field(PINI, "YES") } record(ao, "BEND:LTUS:565:CALBIMIN") { field(DESC, "Calibration Min Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(DRVH, "10.0") field(HOPR, "10.0") field(DRVL, "0.0") field(LOPR, "0.0") field(PREC, "3") field(EGU, "A") field(VAL, "0.0") field(FLNK, "BEND:LTUS:565:CALBIMAX") } record(ao, "BEND:LTUS:565:CALBIMAX") { field(DESC, "Calibration Max Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(DRVH, "10.0") field(HOPR, "10.0") field(LOPR, "0.0") field(DRVL, "0.0") field(EGU, "A") field(VAL, "10.0") field(FLNK, "BEND:LTUS:565:CALBSTEPNUM") } record(ao, "BEND:LTUS:565:CALBIFINAL") { field(DESC, "Calibration Last Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(PREC, "3") field(EGU, "A") field(HOPR, "10.0") field(LOPR, "0.0") field(VAL, "0") } record(longout, "BEND:LTUS:565: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, "BEND:LTUS:565:CALBIDELTA") } record(calc, "BEND:LTUS:565:CALBIDELTA") { field(DESC, "Step size for CALB") field(CALC, "C=0?0:ABS((A-B)/C)") field(INPA, "BEND:LTUS:565:CALBIMAX") field(INPB, "BEND:LTUS:565:CALBIMIN") field(INPC, "BEND:LTUS:565: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, "BEND:LTUS:565:CALBIMULT") { field(DESC, "IACT vs ISETPT mult") field(CALC, "C#0||A=0?1:ABS(B/A)") field(INPA, "BEND:LTUS:525:ISETPT.DRVH") field(INPB, "BEND:LTUS:525:IACT.HOPR") field(INPC, "BEND:LTUS:565:PSCONTROLLER.RVAL CPP") field(EGU, "A") field(PINI, "YES") } # SNL dbputs DAC values here. 6-10 steps are possible. record(waveform, "BEND:LTUS:565:CALBICTRLWF") { field(DESC, "ICTRL setpoint array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") } record(waveform, "BEND:LTUS:565:DACWF") { field(DESC, "DAC count array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "BEND:LTUS:565:DACSA") } # Used only for xygraph edm plot record(subArray, "BEND:LTUS:565:DACSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "BEND:LTUS:565: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, "BEND:LTUS:565:CALCDACWF") { field(DESC, "Calc DAC counts array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "BEND:LTUS:565:CALCDACSA") } # Used only for xygraph edm plot record(subArray, "BEND:LTUS:565:CALCDACSA") { field(DESC, "Calc DAC counts") field(DTYP, "Soft Channel") field(INP, "BEND:LTUS:565: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, "BEND:LTUS:565:CALBYWF") { field(DESC, "mx + b") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "BEND:LTUS:565:CALBYSA") } # Used only for xygraph edm plot record(subArray, "BEND:LTUS:565:CALBYSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "BEND:LTUS:565:CALBYWF") field(MALM, "10") field(NELM, "6") field(INDX, "0") field(FTVL, "DOUBLE") } record(waveform, "BEND:LTUS:565:CALBIACTWF") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "BEND:LTUS:565:CALBIACTSA") } # Used only for xygraph edm plot record(subArray, "BEND:LTUS:565:CALBIACTSA") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(MALM, "10") field(NELM, "6") field(INP, "BEND:LTUS:565:CALBIACTWF") field(INDX, "0") field(FTVL, "DOUBLE") field(FLNK, "BEND:LTUS:565:CALBLIMITS") } # Check that measured current during calibration is within # tolerance. record(aSub, "BEND:LTUS:565: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, "BEND:LTUS:565:CALBSTEPNUM") field(INPB, "BEND:LTUS:565:CALBIACTWF") field(INPC, "BEND:LTUS:565: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, "BEND:LTUS:565: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, "BEND:LTUS:565:STDZITOL") field(INPH, "BEND:LTUS:565:DACSLOPE") field(INPI, "BEND:LTUS:565: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, "BEND:LTUS:565: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, "BEND:LTUS:565:CALBSTEPNUM") field(INPB, "BEND:LTUS:565:CALBIACTWF") field(INPC, "BEND:LTUS:565:DACWF") field(INPF, "BEND:LTUS:565: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 BEND:LTUS:565CALBOK 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, "BEND:LTUS:565:DEGAUSINIT") { field(DESC, "Proc. Degauss PVs on boot") field(PINI, "YES") field(DOL, "1") field(OUTA, "BEND:LTUS:565:DEGAUSIMIN.PROC PP") field(OUTB, "BEND:LTUS:565:DEGAUSIMAX.PROC PP") field(OUTC, "BEND:LTUS:565:DEGAUSTYPE.PROC PP") field(OUTD, "BEND:LTUS:565:DEGAUSSTEP.PROC PP") field(OUTE, "BEND:LTUS:565:MADNAME.PROC PP") field(OUTF, "BEND:LTUS:565:PSTYPE.PROC PP") field(OUTG, "BEND:LTUS:565: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, "BEND:LTUS:565:DEGAUSSUB") { field(DESC, "Degauss subroutine") field(INAM, "mgntDegaussInit") field(SNAM, "mgntDegauss") field(BRSV, "INVALID") field(INPA, "BEND:LTUS:565:DEGAUSIMIN NPP NMS") field(INPB, "BEND:LTUS:565:DEGAUSIMAX NPP NMS") field(INPC, "BEND:LTUS:565:DEGAUSTYPE.RVAL NPP NMS") field(INPE, "BEND:LTUS:565:DEGAUSMETHOD.RVAL NPP NMS") field(INPF, "BEND:LTUS:565:PSTYPE NPP NMS") field(INPG, "BEND:LTUS:565:DEBUG.RVAL NPP NMS") field(INPH, "BEND:LTUS:565: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, "BEND:LTUS:565:DEGAUSWF PP") field(OUTB, "BEND:LTUS:565:DEGAUSMSG PP") field(OUTC, "BEND:LTUS:565: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, "BEND:LTUS:565:DEGAUSWF") { field(DESC, "Degauss Setpts") field(NELM, "60") field(FTVL, "DOUBLE") } record(mbbo,"BEND:LTUS:565: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, "BEND:LTUS:565: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, "BEND:LTUS:565: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, "BEND:LTUS:565: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, "BEND:LTUS:565: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, "BEND:LTUS:565:DEGAUSIMIN") { field(DESC, "Min. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "10.0") field(LOPR, "-10.0") field(DRVH, "10.0") field(DRVL, "-10.0") field(VAL, "-10.0") } record(ao, "BEND:LTUS:565:DEGAUSIMAX") { field(DESC, "Max. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "10.0") field(LOPR, "-10.0") field(DRVH, "10.0") field(DRVL, "-10.0") field(VAL, "10.0") } # 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,"BEND:LTUS:565: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, "BEND:LTUS:565: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,"BEND:LTUS:565: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, "BEND:LTUS:565: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, "BEND:LTUS:565: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, "BEND:LTUS:565: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, "BEND:LTUS:565:DEGAUSTOD") { field(DESC, "Successful Degauss Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "BEND:LTUS:565:DEGAUSLOSTTOD") { field(DESC, "Degauss Lost Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:565:DEGAUSTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "BEND:LTUS:565:DEGAUSTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "BEND:LTUS:565: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, "BEND:LTUS:565:DEGAUSGO") { field(DESC, "Set bdes of btrms to zero") field(ASG, "Internal") field(OUTA, "") field(OUTB, "") field(OUTC, "") field(OUTD, "") } # =========== CRYO ONLY =========== record(bo, "BEND:LTUS:565: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, "BEND:LTUS:565:DEGAUS_IMAX_CHECK") { field(DESC, "Check if imax shoud chg") field(CALC, "(C==4)&&(ABS(B)>ABS(A))?1:0") field(INPA, "BEND:LTUS:565:DEGAUS_IMAX") field(INPB, "BEND:LTUS:565:ISETPT") field(INPC, "BEND:LTUS:565:DEGAUSTYPE.RVAL") field(OUT, "BEND:LTUS:565:DEGAUS_IMAX_UPDATE.SELN") field(FLNK, "BEND:LTUS:565:DEGAUS_IMAX_UPDATE") } record(seq, "BEND:LTUS:565:DEGAUS_IMAX_UPDATE") { field(DESC, "Degauss IMAX Update") field(SELM, "Specified") field(DOL1, "BEND:LTUS:565:ISETPT") field(LNK1, "BEND:LTUS:565:DEGAUS_IMAX PP") } # Set the maximum current after a successful # degauss. This pv is updated by the # sequence. record(ao, "BEND:LTUS:565:DEGAUS_IMAX") { field(DESC, "Max I set afer a degauss") field(EGU, "Amps") field(PINI, "YES") field(PREC, "6") field(HOPR, "10.0") field(LOPR, "-10.0") field(DRVH, "10.0") field(DRVL, "-10.0") field(VAL, "10.0") field(FLNK, "BEND:LTUS:565:DEGAUS_IMAXPOL_CHECK") info(autosaveFields,"VAL,RVAL") } # Set the polarity if degauss_imax record(calcout, "BEND:LTUS:565:DEGAUS_IMAXPOL_CHECK") { field(DESC, "Determine polarity of imax") field(CALC, "A>=0?0:1") field(INPA, "BEND:LTUS:565:DEGAUS_IMAX") field(FLNK, "BEND:LTUS:565:DEGAUS_IMAXPOL") } record(bo, "BEND:LTUS:565:DEGAUS_IMAXPOL") { field(DESC, "Polarity of imax I") field(DTYP, "Raw Soft Channel") field(DOL, "BEND:LTUS:565:DEGAUS_IMAXPOL_CHECK") field(OMSL, "closed_loop") field(ZNAM, "Positive") field(ONAM, "Negative") field(FLNK, "BEND:LTUS:565: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, "BEND:LTUS:565:DEGAUS_ABSIMAX") { field(DESC, "Absolute Max. Degauss I") field(CALC, "ABS(A)") field(INPA, "BEND:LTUS:565:DEGAUS_IMAX") field(PREC, "6") field(EGU, "Amps") field(HOPR, "10.0") field(LOPR, "-10.0") info(autosaveFields,"VAL RVAL") } # IACT Polarity record(calcout, "BEND:LTUS:565:IACTPOL_CHECK") { field(DESC, "Determine IACT polarity") field(SCAN, "5 second") field(CALC, "ABS(A-B)>C?(A>=0?0:1):D") field(INPA, "BEND:LTUS:565:IACT") field(INPB, "BEND:LTUS:565:IACTPOL_CHECK.LA") field(INPC, "0.0001") field(INPD, "BEND:LTUS:565:IACTPOL_CHECK.PVAL") field(OOPT, "On Change") field(FLNK, "BEND:LTUS:565:IACTPOL") } record(bo, "BEND:LTUS:565: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,"BEND:LTUS:565: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, "BEND:LTUS:565:DEGAUSENABLE CP") field(INPB, "BEND:LTUS:565:DEGAUSOK") field(INPC, "BEND:LTUS:565:STATE CP") field(INPD, "BEND:LTUS:565:STATE.SEVR") field(OUT, "BEND:LTUS:565:DEGAUS_STATE_SEQ.SELN PP") field(ASG, "Internal") } record(seq, "BEND:LTUS:565:DEGAUS_STATE_SEQ") { field(DESC, "Degauss State Sequence") field(SELM, "Specified") field(SELL, "BEND:LTUS:565:DEGAUS_STATE_CHECK") field(LNK1, "BEND:LTUS:565:DEGAUS_STATE_DISABLE.PROC PP") field(LNK2, "BEND:LTUS:565:DEGAUS_STATE_LOST.PROC PP") field(LNK3, "BEND:LTUS:565:DEGAUS_STATE_GOOD.PROC PP") field(LNK4, "BEND:LTUS:565: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, "BEND:LTUS:565:DEGAUS_STATE_DISABLE") { field(DESC, "Degauss not used") field(LNK1, "BEND:LTUS:565:DEGAUSOK.ZSV") field(LNK2, "BEND:LTUS:565: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, "BEND:LTUS:565:STATMSG.FRSV") field(LNK4, "BEND:LTUS:565: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, "BEND:LTUS:565:DEGAUS_STATE_LOST") { field(DESC, "Degauss lost and ps On") field(DOL1, "1") field(LNK1, "BEND:LTUS:565:DEGAUSOK.ZSV") field(LNK2, "BEND:LTUS:565: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, "BEND:LTUS:565:STATMSG.FRSV") field(LNK4, "BEND:LTUS:565: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, "BEND:LTUS:565:DEGAUS_STATE_OFF") { field(DESC, "Degaused lost and ps Off") field(DOL1, "2") field(LNK1, "BEND:LTUS:565: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, "BEND:LTUS:565:STATMSG.FRSV") field(LNK3, "BEND:LTUS:565: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, "BEND:LTUS:565:DEGAUS_STATE_GOOD") { field(DESC, "Degauss good") field(DOL1, "1") field(LNK1, "BEND:LTUS:565: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, "BEND:LTUS:565:STATMSG.FRSV PP") field(LNK3, "BEND:LTUS:565:STATMSG.FVSV PP") field(LNK4, "") field(ASG, "Internal") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(mbbo, "BEND:LTUS:565:FUNC") { field(DESC, "BEND:LTUS:565 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, "0") field(FFVL, "0") field(OUT, "BEND:LTUS:565:CTRL CA") } # :CTRL pv is processed at boot in the # sequence mgntCtrl.st Processed in sequence # record(mbbo, "BEND:LTUS:565:CTRL") { field(DESC, "BEND:LTUS:565 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, "BEND:LTUS:565:SELECTEN.A PP") field(SDIS, "0") } # If a function has been selected set this unit to busy record(calcout, "BEND:LTUS:565:SELECTEN") { field(DESC, "Control Select Enable") field(CALC, "A>0?1:A") field(FLNK, "BEND:LTUS:565:BUSY") } # Set to FREE on IOC reboot record(bo, "BEND:LTUS:565:BUSY") { field(DESC, "BEND:LTUS:565 Ctrl Done") field(DOL, "BEND:LTUS:565:SELECTEN") field(ZNAM, "FREE") field(ONAM, "BUSY") field(PINI, "YES") field(FLNK, "BEND:LTUS:565:SELECT") } record(bo, "BEND:LTUS:565:SELECT") { field(ZNAM, "NO") field(ONAM, "YES") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") } record(bo, "BEND:LTUS:565: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, "BEND:LTUS:565:CTRLSTATE") { field(DESC, "BEND:LTUS:565 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("BEND:LTUS:565:CTRL",20,20,0,0,"BEND:LTUS:565:CTRL") #! Field("BEND:LTUS:565:CTRL.OUT",16777215,1,"BEND:LTUS:565:CTRL.OUT") #! Link("BEND:LTUS:565:CTRL.OUT","BEND:LTUS:565:SELECTEN.A") #! Field("BEND:LTUS:565:CTRL.VAL",16777215,1,"BEND:LTUS:565:CTRL.VAL") #! Record("BEND:LTUS:565:SELECTEN",321,381,0,0,"BEND:LTUS:565:SELECTEN") #! Field("BEND:LTUS:565:SELECTEN.A",16777215,0,"BEND:LTUS:565:SELECTEN.A") #! Field("BEND:LTUS:565:SELECTEN.FLNK",16777215,1,"BEND:LTUS:565:SELECTEN.FLNK") #! Link("BEND:LTUS:565:SELECTEN.FLNK","BEND:LTUS:565:BUSY") #! Field("BEND:LTUS:565:SELECTEN.VAL",16777215,1,"BEND:LTUS:565:SELECTEN.VAL") #! Record("BEND:LTUS:565:BUSY",623,274,0,0,"BEND:LTUS:565:BUSY") #! Field("BEND:LTUS:565:BUSY.DOL",16777215,0,"BEND:LTUS:565:BUSY.DOL") #! Link("BEND:LTUS:565:BUSY.DOL","BEND:LTUS:565:SELECTEN.VAL") #! Field("BEND:LTUS:565:BUSY.FLNK",16777215,1,"BEND:LTUS:565:BUSY.FLNK") #! Link("BEND:LTUS:565:BUSY.FLNK","BEND:LTUS:565:SELECT") #! Record("BEND:LTUS:565:SELECT",669,508,0,1,"BEND:LTUS:565:SELECT") #! Record("BEND:LTUS:565:FUNC",940,120,0,0,"BEND:LTUS:565:FUNC") #! Field("BEND:LTUS:565:FUNC.OUT",16777215,0,"BEND:LTUS:565:FUNC.OUT") #! Link("BEND:LTUS:565:FUNC.OUT","BEND:LTUS:565:CTRL.VAL") #! Record("BEND:LTUS:565:ABORT",193,41,0,0,"BEND:LTUS:565:ABORT") #! Record("BEND:LTUS:565:CTRLSTATE",369,34,0,0,"BEND:LTUS:565: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,"BEND:LTUS:565:SELECT is used for Multi-device selection.\nIt is enabled when associated BEND:LTUS:565:CTRL is \"0\" (DONE).\nIt is disabled when associated BEND:LTUS:565: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,"BEND:LTUS:565: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, "BEND:LTUS:565:BCTRL_INIT") { field(DESC, "Process BCTRL on boot") field(PINI, "YES") field(CALC, "A=3?1:0") field(INPA, "BEND:LTUS:565:BCTRL.SEVR") field(OUT, "BEND:LTUS:565: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, "BEND:LTUS:565:BACT") { field(DESC, "Actual B") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "BEND:LTUS:565:BACT") field(INPB, "BEND:LTUS:565:POLYCOEF") field(INPC, "BEND:LTUS:565:POLYCOEF.A") field(INPD, "BEND:LTUS:565:POLYCOEF.B") field(INPE, "BEND:LTUS:565:IACT MS") field(INPF, "BEND:LTUS:565:BDELTAS PP") field(INPG, "100") field(EGU, "GeV/c") field(HOPR, "19.7137") field(LOPR, "0.1221") field(HIHI, "19.7137") field(LOLO, "0.1221") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "19.7137") field(LOW, "0.1221") field(FLNK, "BEND:LTUS:565: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, "BEND:LTUS:565:BDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntPhyDeltas") field(EGU, "GeV/c") field(HOPR, "1") field(PREC, "7") field(BRSV, "INVALID") field(INPA, "BEND:LTUS:565:BDES") field(INPB, "BEND:LTUS:565:TRIMBTOL") field(INPC, "BEND:LTUS:565:TRIMBTOLR") field(INPD, "BEND:LTUS:565:CHCKBTOL") field(INPE, "BEND:LTUS:565:CHCKBTOLR") field(F, "2.0") field(INPG, "30") field(INPH, "BEND:LTUS:565:BACT.VAL") # # MPS absolute and relative tolerances field(INPP, "BEND:LTUS:565:MPSBTOL") field(INPQ, "BEND:LTUS:565:MPSBTOLR") field(FLNK, "BEND:LTUS:565:BCONLIMITS") info(autosaveFields,"F") } # This record is processed by BDELTAS record(aSub, "BEND:LTUS:565:BCONLIMITS") { field(DESC, "Config B-field Limits") field(INAM, "mgntInit") field(SNAM, "mgntBCONLimits") field(INPA, "BEND:LTUS:565:BDES") field(INPB, "BEND:LTUS:565:BDELTAS.I") field(INPG, "BEND:LTUS:565:DEBUG.RVAL") field(FTA, "DOUBLE") field(FTB, "DOUBLE") field(FTG, "ULONG") field(OUTA, "BEND:LTUS:565:BCON.HIGH") field(OUTB, "BEND:LTUS:565:BCON.LOW") field(OUTC, "BEND:LTUS:565:BCON.HIHI") field(OUTD, "BEND:LTUS:565:BCON.LOLO PP") field(FTVA, "DOUBLE") field(FTVB, "DOUBLE") field(FTVC, "DOUBLE") field(FTVD, "DOUBLE") field(BRSV, "INVALID") field(FLNK, "BEND:LTUS:565:IDELTAS") } # The following PV is processed by :BACT # which is processed by :BACT # record(fanout, "BEND:LTUS:565:BACTFO") { field(DESC, "BACT processing") field(SELM, "All") field(LNK1, "BEND:LTUS:565:BDIFF") field(LNK2, "BEND:LTUS:565:BADIFF") field(LNK3, "BEND:LTUS:565:BRATIO") field(LNK4, "BEND:LTUS:565:MPSLIMITS") field(LNK5, "BEND:LTUS:565:I2BSTATUS") field(LNK6, "BEND:LTUS:565:IACTFO.PROC") } record(calc, "BEND:LTUS:565:BDIFF") { field(DESC, "BDES-BACT") field(CALC, "A-B") field(INPA, "BEND:LTUS:565:BDES") field(INPB, "BEND:LTUS:565:BACT") field(EGU, "GeV/c") field(PREC, "7") } record(calc, "BEND:LTUS:565:BADIFF") { field(DESC, "Absolute BDES-BACT") field(INPA, "BEND:LTUS:565:BDIFF") field(EGU, "GeV/c") field(PREC, "7") field(CALC, "A<0?ABS(A):A") } record(calc, "BEND:LTUS:565:BRATIO") { field(DESC, "BACT Error") field(CALC, "B?A/B:0") field(INPA, "BEND:LTUS:565:BDIFF") field(INPB, "BEND:LTUS:565:BDES.HOPR") field(EGU, "GeV/c") field(PREC, "7") } record(mbbi, "BEND:LTUS:565: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, "BEND:LTUS:565:BACT.J") } # Note: for a string slave set the MONFL # macro to the following: # MONFL=:IMONCALC MS record(sub, "BEND:LTUS:565:BMON") { field(DESC, "Second Transductor") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "BEND:LTUS:565:BMON") field(INPB, "BEND:LTUS:565:POLYCOEF") field(INPC, "BEND:LTUS:565:POLYCOEF.A") field(INPD, "BEND:LTUS:565:POLYCOEF.B") field(INPE, "BEND:LTUS:565:IMON MS") field(INPF, "BEND:LTUS:565:BDELTAS.VAL") field(INPG, "100") field(EGU, "GeV/c") field(HOPR, "19.7137") field(LOPR, "0.1221") field(HIHI, "19.7137") field(LOLO, "0.1221") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "19.7137") field(LOW, "0.1221") } # 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=BEND:LTUS:525:BDES CP record(ao, "BEND:LTUS:565:BDES") { field(DESC, "Desired B-Field") field(PINI, "NO") field(DRVH, "19.7137") field(DRVL, "0.1221") field(HOPR, "19.7137") field(LOPR, "0.1221") field(PREC, "7") field(EGU, "GeV/c") field(MDEL, "-1") field(OMSL, "closed_loop") field(DOL, "BEND:LTUS:565:IDES2BDES") field(OUT, "BEND:LTUS:565:B2IDES PP") info(autosaveFields,"VAL") } record(sub, "BEND:LTUS:565:B2IDES") { field(DESC, "Convert Desired B-Field to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "BEND:LTUS:565:POLYCOEF") field(INPC, "BEND:LTUS:565:POLYCOEF.A") field(INPD, "BEND:LTUS:565:POLYCOEF.B") field(PREC, "7") field(EGU, "GeV/c") field(HOPR, "19.7137") field(LOPR, "0.1221") field(MDEL, "-1") field(INPE, "BEND:LTUS:565:BDES.DRVH") field(INPF, "BEND:LTUS:565:BDES.DRVL") field(BRSV, "INVALID") field(FLNK, "BEND:LTUS:565:IDES") } record(sub, "BEND:LTUS:565:BNOM") { field(DESC, "Nominal Field") field(PINI, "YES") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "BEND:LTUS:565:POLYCOEF") field(INPC, "BEND:LTUS:565:POLYCOEF.A") field(INPD, "BEND:LTUS:565:POLYCOEF.B") field(INPE, "BEND:LTUS:565:BDES.DRVH") field(INPF, "BEND:LTUS:565:BDES.DRVL") field(EGU, "GeV/c") field(HOPR, "19.7137") field(LOPR, "0.1221") field(PREC, "7") field(VAL, "0.0") field(FLNK, "BEND:LTUS:565:INOM") } record(sub, "BEND:LTUS:565:BACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "BEND:LTUS:565:BDES.VAL") field(INPB, "BEND:LTUS:565:BDES.DRVH") field(INPC, "BEND:LTUS:565:BDES.DRVL") field(INPD, "BEND:LTUS:565:BDELTAS.I") field(INPE, "BEND:LTUS:565:BDELTAS.J") field(INPG, "BEND:LTUS:565:STATE") field(INPH, "BEND:LTUS:565:HSTA") field(EGU, "GeV/c") field(HOPR, "19.7137") field(LOPR, "0.1221") field(PREC, "7") field(BRSV, "INVALID") } record(sub, "BEND:LTUS:565:BMONLIMITS") { field(DESC, "MON Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "BEND:LTUS:565:BDES.VAL") field(INPB, "BEND:LTUS:565:BDES.DRVH") field(INPC, "BEND:LTUS:565:BDES.DRVL") field(INPD, "BEND:LTUS:565:BDELTAS.K") field(INPE, "BEND:LTUS:565:BDELTAS.L") field(INPG, "BEND:LTUS:565:STATE") field(INPH, "BEND:LTUS:565:HSTA") field(EGU, "GeV/c") field(HOPR, "19.7137") field(LOPR, "0.1221") field(PREC, "7") field(BRSV, "INVALID") } record(seq, "BEND:LTUS:565:BLIMITS") { field(DESC, "ACT Limits") field(PREC, "7") field(DOL1, "BEND:LTUS:565:BLIMITS") field(LNK1, "BEND:LTUS:565:BACTLIMITS.F PP") field(DOL2, "BEND:LTUS:565:BACTLIMITS.I") field(LNK2, "BEND:LTUS:565:BACT.HIGH") field(DOL3, "BEND:LTUS:565:BACTLIMITS.J") field(LNK3, "BEND:LTUS:565:BACT.LOW") field(DOL4, "BEND:LTUS:565:BACTLIMITS.K") field(LNK4, "BEND:LTUS:565:BACT.HIHI") field(DOL5, "BEND:LTUS:565:BACTLIMITS.L") field(LNK5, "BEND:LTUS:565:BACT.LOLO") field(DOL6, "BEND:LTUS:565:BLIMITS") field(LNK6, "BEND:LTUS:565:BMONLIMITS.F PP") field(DOL7, "BEND:LTUS:565:BMONLIMITS.I") field(LNK7, "BEND:LTUS:565:BMON.HIGH") field(DOL8, "BEND:LTUS:565:BMONLIMITS.J") field(LNK8, "BEND:LTUS:565:BMON.LOW") field(DOL9, "BEND:LTUS:565:BMONLIMITS.K") field(LNK9, "BEND:LTUS:565:BMON.HIHI") field(DOLA, "BEND:LTUS:565:BMONLIMITS.L") field(LNKA, "BEND:LTUS:565:BMON.LOLO") field(FLNK, "BEND:LTUS:565:ILIMITS") field(SCAN, "5 second") } record(ao, "BEND:LTUS:565:BCTRL") { field(DESC, "B-Perturb") field(PREC, "7") field(EGU, "GeV/c") field(DRVH, "19.7137") field(DRVL, "0.1221") field(HOPR, "19.7137") field(LOPR, "0.1221") # 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, "BEND:LTUS:565: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, "BEND:LTUS:565:BCTRLGO") { field(DESC, "Update DES and perturb") field(PREC, "7") # Disable BACT limits field(DOL1, "1") field(LNK1, "BEND:LTUS:565:BLIMITS.VAL") # Update BDES with the BCTRL (slider) value field(DOL2, "BEND:LTUS:565:BCTRL.VAL") field(LNK2, "BEND:LTUS:565:BDES PP") field(DOL3, "1") field(LNK3, "BEND:LTUS:565:IDIRECT.PROC PP") field(DOL4, "1") field(LNK4, "BEND:LTUS:565:CHECKSTDZLOST.PROC PP") field(DOL5, "BEND:LTUS:565:BCTRL.VAL") field(LNK5, "BEND:LTUS:565:BCTRLSUB PP") # Re-enable BACT limits field(DOL6, "0") field(LNK6, "BEND:LTUS:565:BLIMITS.VAL") } # Convert B-field to Current and output to ISETPT record(sub, "BEND:LTUS:565:BCTRLSUB") { field(DESC, "Feedback") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "BEND:LTUS:565:POLYCOEF") field(INPC, "BEND:LTUS:565:POLYCOEF.A") field(INPD, "BEND:LTUS:565:POLYCOEF.B") field(INPE, "BEND:LTUS:565:BDES.DRVH") field(INPF, "BEND:LTUS:565:BDES.DRVL") field(PREC, "7") field(EGU, "GeV/c") field(HOPR, "19.7137") field(LOPR, "0.1221") field(MDEL, "-1") field(BRSV, "INVALID") field(FLNK, "BEND:LTUS:565:ISETPT") } record(ao, "BEND:LTUS:565:BDESPREVTRIM") { field(DESC, "trim bdes for undo") field(DTYP, "Soft Channel") field(DRVH, "19.7137") field(DRVL, "0.1221") field(EGU, "GeV/c") field(HOPR, "19.7137") field(LOPR, "0.1221") field(PREC, "7") field(PINI, "YES") info(autosaveFields,"VAL") } record(stringin, "BEND:LTUS:565:MADNAME") { field(DESC, "MAD deck nomenclature") field(PINI, "YES") field(VAL, "BY2B") } record(ai, "BEND:LTUS:565: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, "3387.357275") } record(ao, "BEND:LTUS:565:BMAX") { field(DESC, "Max B-Field") field(DTYP, "Soft Channel") field(DRVH, "19.7137") field(DRVL, "0.1221") field(EGU, "GeV/c") field(HOPR, "19.7137") field(LOPR, "0.1221") field(PREC, "7") field(PINI, "YES") field(VAL, "19.7137") field(FLNK, "BEND:LTUS:565:BSTEP") } record(ao, "BEND:LTUS:565:BMIN") { field(DESC, "Min B-Field") field(DTYP, "Soft Channel") field(DRVH, "19.7137") field(DRVL, "0.1221") field(EGU, "GeV/c") field(HOPR, "19.7137") field(LOPR, "0.1221") field(PREC, "7") field(PINI, "YES") field(VAL, "0.1221") field(FLNK, "BEND:LTUS:565:BSTEP") } record(ao, "BEND:LTUS:565:BDESSAVE") { field(DESC, "bdes for save/load") field(DTYP, "Soft Channel") field(DRVH, "19.7137") field(DRVL, "0.1221") field(EGU, "GeV/c") field(HOPR, "19.7137") field(LOPR, "0.1221") field(PINI, "YES") field(PREC, "7") } # This record is processed by BEND:LTUS:565: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, "BEND:LTUS:565:BCON") { field(DESC, "Config B-Field ") field(DTYP, "Soft Channel") field(PREC, "7") field(EGU, "GeV/c") field(HOPR, "19.7137") field(LOPR, "0.1221") field(DRVH, "19.7137") field(DRVL, "0.1221") # 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 , "BEND:LTUS:565:ICON2BCON") field(OMSL, "closed_loop") field(OUT, "BEND:LTUS:565:B2ICON PP") info(autosaveFields,"VAL") } record(sub, "BEND:LTUS:565:B2ICON") { field(DESC, "Convert Desired ICon to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "BEND:LTUS:565:POLYCOEF") field(INPC, "BEND:LTUS:565:POLYCOEF.A") field(INPD, "BEND:LTUS:565:POLYCOEF.B") field(PREC, "7") field(EGU, "GeV/c") field(HOPR, "19.7137") field(LOPR, "0.1221") field(MDEL, "-1") field(INPE, "BEND:LTUS:565:BCON.DRVH") field(INPF, "BEND:LTUS:565:BCON.DRVL") field(BRSV, "INVALID") field(FLNK, "BEND:LTUS:565: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, "BEND:LTUS:565:BSTEP") { field(DESC, "B-Field step size") field(CALC, "(C==3)||(D==3)?0:ABS(A-B)*0.005") field(INPA, "BEND:LTUS:565:BMAX") field(INPB, "BEND:LTUS:565:BMIN") field(INPC, "BEND:LTUS:565:BMIN.SEVR") field(INPD, "BEND:LTUS:565:BMAX.SEVR") field(EGU, "GeV/c") 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,"BEND:LTUS:565:BCTRLDISABLECALC") { field(DESC, "Calc for disabling BCTRL") field(ASG, "Internal") field(CALC, "A?2:1") field(INPA, "BEND:LTUS:565:ONLINE CP") field(OUT, "BEND:LTUS:565:BCTRLDISABLEFOUT PP") } record(fanout, "BEND:LTUS:565:BCTRLDISABLEFOUT") { field(DESC, "Disable BCTRL fanout") field(SELM, "Specified") field(SELL, "BEND:LTUS:565:BCTRLDISABLECALC") field(LNK1, "BEND:LTUS:565:BCTRLDISABLE") field(LNK2, "BEND:LTUS:565:BCTRLENABLE") } record(stringout, "BEND:LTUS:565:BCTRLDISABLE") { field(DESC, "Disable BCTRL") field(DTYP, "Soft Channel") field(OUT, "BEND:LTUS:565:BCTRL.ASG") field(VAL, "NOWRITE") field(FLNK, "BEND:LTUS:565:BCTRLDISV_UPDATE") } record(stringout, "BEND:LTUS:565:BCTRLENABLE") { field(DESC, "Enable BCTRL") field(DTYP, "Soft Channel") field(OUT, "BEND:LTUS:565:BCTRL.ASG") field(VAL, "") field(FLNK, "BEND:LTUS:565:BCTRLDISV_UPDATE") } record(calcout, "BEND:LTUS:565:BCTRLDISV_UPDATE") { field(DESC, "Calc for updating BCTRL.DISV") field(ASG, "Internal") field(CALC, "A") field(INPA, "BEND:LTUS:565:ONLINE") field(OUT, "BEND:LTUS:565: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,"BEND:LTUS:565:BACT and MON\n are processed via links from \n BEND:LTUS:565:IACT (device raw value readback 1)\n and\n BEND:LTUS:565: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 BEND:LTUS:565:POLYCOEF\nC = First polynomial coefficient (offset if linear)\nD = Second polynomial coefficient (slope if linear)\nE = BEND:LTUS:565: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,"BEND:LTUS:565:BDES\n is processed when set by CA users or \n BEND:LTUS:565: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,"BEND:LTUS:565: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 BEND:LTUS:565: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 (BEND:LTUS:565: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,"BEND:LTUS:565:B*LIMITS and BEND:LTUS:565:BLIMITS:\n Calculate alarm and warning limits based on \n deltas from BEND:LTUS:565: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,"BEND:LTUS:565: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,"BEND:LTUS:565: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, "BEND:LTUS:565: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, "BEND:LTUS:565:MPSBTOL") { field(DESC, "Absolute mps tol") field(EGU, "GeV/c") field(PREC, "2") field(CALC, "ABS(A)*0.02") field(INPA, "BEND:LTUS:565:BMAX") field(PINI, "YES") } # # 21-Aug-2013: K. Luchini # Set channel access security so that users # cannot easily change values. record(ao, "BEND:LTUS:565:MPSBMAX") { field(DESC, "MPS Max B-field") field(EGU, "GeV/c") field(PREC, "7") field(DRVH, "19.7137") field(DRVL, "0.1221") field(PINI, "YES") field(VAL, "19.7137") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:565:MPSBMIN") { field(DESC, "MPS Min B-field") field(EGU, "GeV/c") field(PREC, "7") field(DRVH, "19.7137") field(DRVL, "0.1221") field(PINI, "YES") field(VAL, "0.1221") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:565:MPSBLLIM") { field(DESC, "MPS Low Limit B-field") field(EGU, "GeV/c") field(PREC, "7") field(DRVH, "19.7137") field(DRVL, "0.1221") field(PINI, "YES") field(VAL, "0.1221") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:565:MPSBLLIM2") { field(DESC, "MPS Low Limit #2 B-field") field(EGU, "GeV/c") field(PREC, "7") field(DRVH, "19.7137") field(DRVL, "0.1221") field(PINI, "YES") field(VAL, "0.1221") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } # Set the default to Std record(mbbo, "BEND:LTUS:565: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, "BEND:LTUS:565:MPSLIMITS.E PP") } record(aSub, "BEND:LTUS:565: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, "BEND:LTUS:565:MPS.RVAL") field(INPB, "BEND:LTUS:565:BADIFF") field(INPC, "BEND:LTUS:565:BDELTAS.N") field(INPD, "BEND:LTUS:565:BACT") field(INPE, "BEND:LTUS:565:MPSBITMASK.RVAL") field(INPF, "BEND:LTUS:565:MPSBLLIM") field(INPG, "BEND:LTUS:565:MPSBMIN") field(INPH, "BEND:LTUS:565:MPSBMAX") field(INPI, "BEND:LTUS:565: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, "BEND:LTUS:565:INTOL.RVAL PP") field(OUTB, "BEND:LTUS:565:INTOL_BMIN.RVAL PP") field(OUTC, "BEND:LTUS:565:INTOL_BRANGE.RVAL PP") field(OUTD, "BEND:LTUS:565: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, "BEND:LTUS:565:INTOL") { field(DESC, "BACT within MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "BEND:LTUS:565:MPSLIMITS.VALA") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "BEND:LTUS:565:INTOL_BMIN") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "BEND:LTUS:565:MPSLIMITS.VALB") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "BEND:LTUS:565:INTOL_BMIN2") { field(DESC, "MPS tol #2") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "BEND:LTUS:565:MPSLIMITS.VALD") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "BEND:LTUS:565:INTOL_BRANGE") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "BEND:LTUS:565: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, "BEND:LTUS:565:CHCKITOL") { field(DESC, "Absolute Check I Tolerance") field(EGU, "A") field(FLNK, "BEND:LTUS:565:TRIMITOL") field(CALC, "ABS(A*B)") field(INPA, "BEND:LTUS:565:CHCKBTOL") field(INPB, "BEND:LTUS:565:POLYCOEF.B") field(PREC, "9") } record(calc, "BEND:LTUS:565:TRIMBTOL") { field(EGU, "GeV/c") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(DESC, "Absolute Trim Tolerance") field(CALC, "ABS(A)/2") field(INPA, "BEND:LTUS:565:CHCKBTOL") field(FLNK, "BEND:LTUS:565:CHCKITOL") } record(calc, "BEND:LTUS:565:CHCKBTOL") { field(DESC, "Check absolute tolerance") field(EGU, "A") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(FLNK, "BEND:LTUS:565:TRIMBTOL") field(CALC, "MAX(ABS(A),ABS(C))*(B/1000000)") field(INPA, "BEND:LTUS:565:BDES.HOPR") field(INPB, "BEND:LTUS:565:STABILITY") field(INPC, "BEND:LTUS:565:BDES.LOPR") } record(longout, "BEND:LTUS:565: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, "BEND:LTUS:565:CHCKBTOL") } record(calc, "BEND:LTUS:565:TRIMITOL") { field(DESC, "Absolute Trim I Tolerance") field(EGU, "GeV/c") field(CALC, "ABS(A*B)") field(INPA, "BEND:LTUS:565:POLYCOEF.B") field(INPB, "BEND:LTUS:565:TRIMBTOL") field(PREC, "9") } record(ai, "BEND:LTUS:565:TRIMBTOLR") { field(DESC, "Relative trim tol") field(PREC, "4") field(EGU, "%") field(HOPR, "1.0") field(LOPR, "0.0") field(PINI, "YES") } record(ai, "BEND:LTUS:565: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, "BEND:LTUS:565:FBCKFCOM") { field(ZNAM, "CA") field(ONAM, "FCOM") field(DESC, "CA Mode") field(PINI, "YES") field(SDIS, "0") } record(bo, "BEND:LTUS:565:PAU") { field(ZNAM, "NotConfigured") field(ONAM, "Configured") field(DESC, "PAU Present") field(PINI, "YES") field(SDIS, "0") field(FLNK, "BEND:LTUS:565:PAUGO") } record(fanout, "BEND:LTUS:565:PAUGO") { field(DESC, "PAU control") field(LNK1, "BEND:LTUS:565:PAUSTOP") field(LNK2, "BEND:LTUS:565: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, "BEND:LTUS:565:PAUSTART") { field(DESC, "Setup for PAU On") field(SDIS, "BEND:LTUS:565: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, "BEND:LTUS:565:PAUSTOP") { field(DESC, "Setup for PAU Off") field(SDIS, "BEND:LTUS:565: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, "BEND:LTUS:565:MCORDEVNAME") { field(DESC, "PS device name") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, "BEND:LTUS:525:") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "BEND:LTUS:565: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, "BEND:LTUS:565:PSTYPE.RVAL") field(INPC, "BEND:LTUS:565:TURNEDOFF.RVAL") field(INPD, "BEND:LTUS:565:CONFIG.RVAL") field(INPE, "BEND:LTUS:565:PSCATEGORY.RVAL") field(INPF, "BEND:LTUS:565:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "BEND:LTUS:565:AUTOCTRL.RVAL") field(INPJ, "BEND:LTUS:565:OUTOFSERVICE.RVAL") field(INPL, "BEND:LTUS:565:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "BEND:LTUS:565:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "BEND:LTUS:565:PAU") field(INPP, "BEND:LTUS:565:CALBDISABLE.RVAL") field(INPQ, "BEND:LTUS:565:PTRBDISABLE.RVAL") field(INPR, "BEND:LTUS:565:TRIMDISABLE.RVAL") field(INPS, "BEND:LTUS:565:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "BEND:LTUS:565:FBCK") field(INPU, "BEND:LTUS:565:TRIMTYPE.RVAL") field(INPV, "BEND:LTUS:565:STDZDIRECT.RVAL") field(INPW, "BEND:LTUS:565:DEGAUSENABLE.RVAL") field(FLNK, "BEND:LTUS:565:HSTA") } record(longin, "BEND:LTUS:565:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "BEND:LTUS:565:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "BEND:LTUS:565: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, "BEND:LTUS:565: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, "BEND:LTUS:565: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, "BEND:LTUS:565: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, "BEND:LTUS:565: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, "BEND:LTUS:565: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 BEND:LTUS:565:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses BEND:LTUS:565:FBCK. # This PV should be replaced by BEND:LTUS:565: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, "BEND:LTUS:565: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, "BEND:LTUS:565: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, "BEND:LTUS:565: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, "BEND:LTUS:525:OUTOFSERVICE CPP NMS") field(OMSL, "closed_loop") field(FLNK, "BEND:LTUS:565:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"BEND:LTUS:565:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "BEND:LTUS:565:OUTOFSERVICE NPP NMS") field(OUT, "BEND:LTUS:565:ONLINE PP") } record(bo, "BEND:LTUS:565:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "BEND:LTUS:565: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, "BEND:LTUS:565: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, "BEND:LTUS:565: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, "BEND:LTUS:565: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, "BEND:LTUS:565: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, "BEND:LTUS:565: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, "BEND:LTUS:565: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, "BEND:LTUS:565: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, "BEND:LTUS:565: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, "BEND:LTUS:565: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, "BEND:LTUS:565: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, "BEND:LTUS:565:TRIMTYPE") } record(stringout, "BEND:LTUS:565:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "BEND:LTUS:525:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "BEND:LTUS:565:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "BEND:LTUS:565:STATE.RVAL") field(INPB, "BEND:LTUS:565:INTLKSUMY.RVAL") field(OUT, "BEND:LTUS:565:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "BEND:LTUS:565: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, "BEND:LTUS:565:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "BEND:LTUS:565:STATE.RVAL") field(INPB, "BEND:LTUS:565:INTLKSUMY.RVAL") field(OUT, "BEND:LTUS:565:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "BEND:LTUS:565:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "BEND:LTUS:565:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "BEND:LTUS:565: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, "BEND:LTUS:565: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, "BEND:LTUS:565: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, "BEND:LTUS:565: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,"BEND:LTUS:565: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("BEND:LTUS:565:TURNEDOFF",3140,1907,0,1,"BEND:LTUS:565:TURNEDOFF") #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "BEND:LTUS:565:STATSUB") { field(DESC, "Build STATus ") field(INAM, "mgntInit") field(SNAM, "mgntSlcStat") field(INPA, "BEND:LTUS:565:BACT.STAT") field(INPB, "BEND:LTUS:565:BDES.STAT") field(INPC, "BEND:LTUS:565: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, "BEND:LTUS:565:BACT.SEVR") field(INPH, "BEND:LTUS:565:BDES.SEVR") field(INPI, "BEND:LTUS:565: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, "BEND:LTUS:565:STATE.RVAL") field(INPN, "BEND:LTUS:565:STDZOK") field(INPO, "BEND:LTUS:565:CALBOK") field(INPP, "BEND:LTUS:565:OUTOFSERVICE.RVAL") field(INPQ, "BEND:LTUS:565:CONFIG.RVAL") field(INPR, "BEND:LTUS:565:HSTA") field(INPS, "BEND:LTUS:565:CTRL.RVAL") field(INPT, "BEND:LTUS:565:DEGAUSOK") field(INPV, "BEND:LTUS:565: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, "BEND:LTUS:565:STAT") } record(longout, "BEND:LTUS:565:STAT") { field(DESC, "STAT sent to SLC") field(SCAN, "Passive") field(FLNK, "BEND:LTUS:565:STATCTRLSUB") field(DOL, "BEND:LTUS:565:STATSUB.VAL") field(OMSL, "closed_loop") } record(sSub, "BEND:LTUS:565:STATCTRLSUB") { field(DESC, "Decode SLC STAT into mbbo") field(INAM, "mgntInit") field(SNAM, "mgntStatDecode") field(INPA, "BEND:LTUS:565:STAT") field(INPB, "BEND:LTUS:565:HSTA") field(INPD, "BEND:LTUS:565:ONOFFCTRL.RVAL") field(FLNK, "BEND:LTUS:565:STATMSG") } record(mbbo, "BEND:LTUS:565: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, "BEND:LTUS:565:UNAVAILGO") field(DOL, "BEND:LTUS:565:STATCTRLSUB.W") } record(seq, "BEND:LTUS:565:UNAVAILGO") { field(DESC, "Process UNAVAIL") field(DOL1, "BEND:LTUS:565:STATSUB.U") field(LNK1, "BEND:LTUS:565:UNAVAIL PP") } record(stringout, "BEND:LTUS:565:SNLSTATMSG") { field(DTYP, "Soft Channel") } #! TextBox(TB0,820,1000,1200,1220,0,"Dialog",12,1,16777215,"BEND:LTUS:565:STATUSSUB - future\nOverall device status - takes input from action snls, record sevrs, master snl(s) and outputs final status\n\nInputs:\nA - BEND:LTUS:565:CTRLSTATUS - snl status\nB - MGNT:CTRLSTATUS - master list status\nC\nD - BEND:LTUS:565: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,"BEND:LTUS:565STATSUB\nformat control bo's into slc STAT\n\nInputs:\nA - BEND:LTUS:565:STATUS\nC - BEND:LTUS:565:ON\nD - BEND:LTUS:565:STDZOK\nE - BEND:LTUS:565:CALBOK\nF - BEND:LTUS:565:BACTDRIFT (future)\nG -\nH- BEND:LTUS:565:DACSTATUS\nI -BEND:LTUS:565:ADCSTATUS\nJ - BEND:LTUS:565:BACTSTATUS\nK - BEND:LTUS:565:BDESSTATUS\nL - BEND:LTUS:565:RIPLSTATUS\n\nOutput:\nP - BEND:LTUS:565: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, "BEND:LTUS:565: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, "BEND:LTUS:565: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, "BEND:LTUS:565: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, "BEND:LTUS:565: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 b-field of a slave with out a powered trim coil # equal to the main desired current and pass backwards # through the IVB poly. record(sub, "BEND:LTUS:565:IDES2BDES") { field(DESC, "Cal BDES") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "BEND:LTUS:565:IDES2BDES") field(INPB, "BEND:LTUS:565:POLYCOEF") field(INPC, "BEND:LTUS:565:POLYCOEF.A") field(INPD, "BEND:LTUS:565:POLYCOEF.B") field(INPE, "BEND:LTUS:525:IDES CP MS") field(INPF, "BEND:LTUS:525:BDELTAS PP") field(INPG, "100") field(EGU, "GeV/c") field(HOPR, "19.7137") field(LOPR, "0.1221") field(HIHI, "19.7137") field(LOLO, "0.1221") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "19.7137") field(LOW, "0.1221") field(FLNK, "BEND:LTUS:565:BDES") } # Calcuate the bcon of a slave using # the main desired current and pass backwards # through the IVB poly. # the trim b-field is acutally amps. record(sub, "BEND:LTUS:565:ICON2BCON") { field(DESC, "Cal BCON") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "BEND:LTUS:565:ICON2BCON") field(INPB, "BEND:LTUS:565:POLYCOEF") field(INPC, "BEND:LTUS:565:POLYCOEF.A") field(INPD, "BEND:LTUS:565:POLYCOEF.B") field(INPE, "BEND:LTUS:525:ICON CP NMS") field(INPF, "BEND:LTUS:525:BDELTAS PP") field(INPG, "100") field(EGU, "GeV/c") field(HOPR, "19.7137") field(LOPR, "0.1221") field(HIHI, "19.7137") field(LOLO, "0.1221") field(PREC, "7") field(BRSV, "INVALID") # Set MINOR alarms for main as the default, slaves will set NO_ALARM field(HHSV, "NO_ALARM") field(HSV, "NO_ALARM") field(LSV, "NO_ALARM") field(LLSV, "NO_ALARM") field(HIGH, "19.7137") field(LOW, "0.1221") field(FLNK, "BEND:LTUS:565:BCON") }#! 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, "BEND:DMPS:410:IACT") { field(DESC, "Current") field(INP, "BEND:DMPS:400:IACT CP NMS") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "BEND:DMPS:410:BACT") info(autosaveFields,"HYST") } record(bi, "BEND:DMPS:410:STATE") { field(DESC, "PS On/Off Status") field(DTYP, "Raw Soft Channel") field(INP, "BEND:DMPS:400:STATE CP MS") field(ZSV, "MAJOR") field(ZNAM, "OFF") field(ONAM, "ON") } record(ao, "BEND:DMPS:410:IDES") { field(DESC, "Desired Current") field(PREC, "3") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(MDEL, "-1") field(HIHI, "200.0") field(LOLO, "0.0") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "BEND:DMPS:410:BDELTAS") field(DRVH, "200.0") field(DRVL, "0.0") field(DOL, "BEND:DMPS:410: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, "BEND:DMPS:410:ICTRL PP") } # This record is processed by BEND:DMPS:410:ICON") # Note: we are not setting alarms here. record(ao, "BEND:DMPS:410:ICON") { field(DESC, "Config I") field(DTYP, "Soft Channel") field(PREC, "3") field(HOPR, "200.0") field(LOPR, "0.0") field(DRVH, "200.0") field(DRVL, "0.0") field(DOL, "BEND:DMPS:410:B2ICON.K") field(OMSL, "closed_loop") info(autosaveFields,"VAL") } record(ao, "BEND:DMPS:410:INOM") { field(DESC, "Nominal Current") field(DOL, "BEND:DMPS:410:BNOM.K") field(OMSL, "closed_loop") field(PREC, "3") field(EGU, "A") field(DRVH, "200.0") field(DRVL, "0.0") field(HOPR, "200.0") field(LOPR, "0.0") } record(ao, "BEND:DMPS:410:ICTRL") { field(DESC, "Set Current") field(PREC, "3") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(DRVH, "200.0") field(DRVL, "0.0") field(MDEL, "-1") field(FLNK, "BEND:DMPS:410:ICTRLGO") field(OMSL, "supervisory") info(autosavefields,"VAL") } record(seq, "BEND:DMPS:410:ICTRLGO") { field(DESC, "Process Current Setpoint") field(PREC, "3") # Set ISETPT to supervisory field(DOL1, "0") field(LNK1, "BEND:DMPS:410:ISETPT.OMSL") field(DOL2, "BEND:DMPS:410:ICTRL") field(LNK2, "BEND:DMPS:410:ISETPT PP") # Set ISETPT to closed loop - get data from BCTRLSUB.K field(DOL3, "1") field(LNK3, "BEND:DMPS:410:ISETPT.OMSL") } record(ao, "BEND:DMPS:410:IMAX") { field(DESC, "Max I") field(DTYP, "Soft Channel") field(DRVH, "200.0") field(DRVL, "0.0") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(PREC, "3") field(PINI, "YES") field(VAL, "200.0") field(FLNK, "BEND:DMPS:410:IMIN") } record(ao, "BEND:DMPS:410:IMIN") { field(DESC, "Min I") field(DTYP, "Soft Channel") field(DRVH, "200.0") field(DRVL, "0.0") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(PREC, "3") field(VAL, "0.0") field(FLNK, "BEND:DMPS:410:IRANGE") } record(sel, "BEND:DMPS:410:IACTPREVOK") { field(DESC, "Last Good Current") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(PREC, "3") field(NVL, "BEND:DMPS:410:BACT.SEVR") field(INPA, "BEND:DMPS:410:IACT NPP MS") field(INPB, "BEND:DMPS:410:IACTPREVOK NPP MS") field(INPC, "BEND:DMPS:410:IACTPREVOK NPP MS") field(INPD, "BEND:DMPS:410:IACTPREVOK NPP MS") } record(sub, "BEND:DMPS:410:IACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "BEND:DMPS:410:IDES") field(INPB, "BEND:DMPS:410:ISETPT.DRVH") field(INPC, "BEND:DMPS:410:ISETPT.DRVL") field(INPD, "BEND:DMPS:410:IDELTAS.I") field(INPE, "BEND:DMPS:410:IDELTAS.J") field(INPG, "BEND:DMPS:410:STATE") field(INPH, "BEND:DMPS:410:HSTA") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(sub, "BEND:DMPS:410:IMONLIMITS") { field(DESC, "Aux Current Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "BEND:DMPS:410:IDES") field(INPB, "BEND:DMPS:410:ISETPT.DRVH") field(INPC, "BEND:DMPS:410:ISETPT.DRVL") field(INPD, "BEND:DMPS:410:IDELTAS.K") field(INPE, "BEND:DMPS:410:IDELTAS.L") field(INPG, "BEND:DMPS:410:STATE") field(INPH, "BEND:DMPS:410:HSTA") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(seq, "BEND:DMPS:410:ILIMITS") { field(DESC, "Set ACT and MON Limits") field(PREC, "3") field(DOL1, "BEND:DMPS:410:BLIMITS") field(LNK1, "BEND:DMPS:410:IACTLIMITS.F PP") field(DOL2, "BEND:DMPS:410:IACTLIMITS.I") field(LNK2, "BEND:DMPS:410:IACT.HIGH") field(DOL3, "BEND:DMPS:410:IACTLIMITS.J") field(LNK3, "BEND:DMPS:410:IACT.LOW") field(DOL4, "BEND:DMPS:410:IACTLIMITS.K") field(LNK4, "BEND:DMPS:410:IACT.HIHI") field(DOL5, "BEND:DMPS:410:IACTLIMITS.L") field(LNK5, "BEND:DMPS:410:IACT.LOLO") field(DOL6, "BEND:DMPS:410:BLIMITS") field(LNK6, "BEND:DMPS:410:IMONLIMITS.F PP") field(DOL7, "BEND:DMPS:410:IMONLIMITS.I") field(LNK7, "BEND:DMPS:410:IMON.HIGH") field(DOL8, "BEND:DMPS:410:IMONLIMITS.J") field(LNK8, "BEND:DMPS:410:IMON.LOW") field(DOL9, "BEND:DMPS:410:IMONLIMITS.K") field(LNK9, "BEND:DMPS:410:IMON.HIHI") field(DOLA, "BEND:DMPS:410:IMONLIMITS.L") field(LNKA, "BEND:DMPS:410: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, "BEND:DMPS:410:IDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntRawDeltas") field(INPD, "BEND:DMPS:410:TRIMBTOL") field(INPE, "BEND:DMPS:410:CHCKBTOL") field(INPF, "BEND:DMPS:410:BDELTAS.K") field(INPG, "BEND:DMPS:410:BDELTAS.L") field(INPH, "BEND:DMPS:410: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, "BEND:DMPS:410:STDZITOLR") field(INPC, "BEND:DMPS:410:STDZITOL") field(FLNK, "") } # All ps controllers with on/off control will set the macro ONOF # as follows: # # ONOF = BEND:DMPS:400: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, "BEND:DMPS:410: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 = BEND:DMPS:400:RESET PP # record(bo, "BEND:DMPS:410: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, "BEND:DMPS:410:RAMPSTATE") { field(DESC, "PS Ramp Status") field(DTYP, "Soft Channel") field(DOL, "BEND:DMPS:400: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, "BEND:DMPS:410: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, "BEND:DMPS:410:TRIMRAMPRATE") field(OUT, "") field(FLNK, "BEND:DMPS:410:STDZDLY") } record(ao, "BEND:DMPS:410:ISETPT") { field(DESC, "Current Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(DRVH, "200.0") field(DRVL, "0.0") field(MDEL, "-1") field(OUT, "") field(DOL, "BEND:DMPS:410: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, "BEND:DMPS:410:IMON") { field(DESC, "Aux Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(INP, "BEND:DMPS:400:IMON CP NMS") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "BEND:DMPS:410:BMON") } record(ao, "BEND:DMPS:410:IRIPL") { field(DESC, "Ripple Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(DOL, "BEND:DMPS:400:IRIPL CP NMS") field(OMSL, "closed_loop") field(EGU, "A") field(DRVH, "1.0") field(HOPR, "1.0") field(PREC, "3") field(FLNK, "BEND:DMPS:410:IRIPLOK") } record(sub, "BEND:DMPS:410:IRIPLOK") { field(DESC, "Ripple Current Status") field(INAM, "mgntInit") field(SNAM, "mgntRiplOK") field(INPA, "BEND:DMPS:410:IRIPL.VAL") field(INPB, "BEND:DMPS:410: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, "BEND:DMPS:410:R") { field(DESC, "Resistance") field(EGU, "Ohms") field(PREC, "4") field(PINI, "YES") field(DOL, "BEND:DMPS:400: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, "BEND:DMPS:410:IGND") { field(DESC, "Ground Current") field(EGU, "A") field(PREC, "6") field(PINI, "YES") field(DOL, "BEND:DMPS:400:IGND CP MS") field(OMSL, "closed_loop") } record(bi, "BEND:DMPS:410:INTLKSUMY") { field(DESC, "Interlock Summary") field(INP, "BEND:DMPS:400:INTLKSUMY CP MS") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(ZNAM, "OK") field(ONAM, "FAULT") field(PINI, "NO") } record(mbbo, "BEND:DMPS:410: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, "BEND:DMPS:400:COOLING CP NMS") field(OMSL, "closed_loop") } # The following PV is processed by :BACTFO # which is processed by :BACT record(fanout, "BEND:DMPS:410:IACTFO") { field(DESC, "IACT processing") field(SELM, "All") field(LNK1, "BEND:DMPS:410:IACTPREVOK") field(LNK2, "BEND:DMPS:410:IDIFF") field(LNK3, "BEND:DMPS:410:IADIFF") field(LNK4, "BEND:DMPS:410:IRATIO") field(LNK5, "BEND:DMPS:410:IDIRECT") field(LNK6, "BEND:DMPS:410:IACTPOL_CHECK") } record(calc, "BEND:DMPS:410:IDIFF") { field(DESC, "IDES-IACT") field(CALC, "A-B") field(INPA, "BEND:DMPS:410:IDES") field(INPB, "BEND:DMPS:410:IACT") field(EGU, "A") field(PREC, "9") field(HOPR, "200.0") field(LOPR, "0.0") } record(calc, "BEND:DMPS:410:IADIFF") { field(DESC, "Absolute IDES-IACT") field(CALC, "A<0?ABS(A):A") field(INPA, "BEND:DMPS:410:IDIFF") field(PREC, "9") } record(calc, "BEND:DMPS:410:IRATIO") { field(DESC, "IDES-IACT/IMAX") field(CALC, "B?A/B:0") field(INPA, "BEND:DMPS:410:IDIFF") field(INPB, "BEND:DMPS:410:IDES.DRVH") field(PREC, "9") } record(calcout, "BEND:DMPS:410:IRANGE") { field(DESC, "Current Range") field(PINI, "YES") field(CALC, "ABS(A-B)") field(INPA, "BEND:DMPS:410:IMIN") field(INPB, "BEND:DMPS:410: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, "BEND:DMPS:410: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, "BEND:DMPS:410:IACT") field(FLNK, "BEND:DMPS:410:IACTPOL") } record(bo, "BEND:DMPS:410:IACTPOL") { field(DESC, "Actual I Polarity") field(DTYP, "Raw Soft Channel") field(DOL, "BEND:DMPS:410: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,"BEND:DMPS:410:I*LIMITS:\n Calculate alarm and warning limits based on \n deltas from BEND:DMPS:410:IDELTAS and the\n BEND:DMPS:410: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,"BEND:DMPS:410:IACT: \n Get copy of BEND:DMPS:410:I. \n",null) #! TextBox(TB12,1280,3100,1760,3200,0,"Dialog",12,1,16777215,"BEND:DMPS:410: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,"BEND:DMPS:410:IDES:\n Contains raw value calculated by \nBEND:DMPS:410: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 \nBEND:DMPS:410:BDELTAS.\n",null) #! TextBox(TB10,56,1940,316,2340,0,"Dialog",12,1,16777215,"BEND:DMPS:410: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 BEND:DMPS:410: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 BEND:DMPS:410: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,"BEND:DMPS:410:ISETPT:\n Sets the hardware. When fast feedback is set on, this record is\n set to closed loop mode by BEND:DMPS:410:FBCKSTART sequence. When \n the loop is closed, this record takes input calculated by \n BFBCK only. When fast feedback is set off, BEND:DMPS:410:FBCKSTOP \n will set it back to supervisory so that the value can be set by \n BEND:DMPS:410: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, "BEND:DMPS:410:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "BEND:DMPS:410:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "BEND:DMPS:410:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "BEND:DMPS:410:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "BEND:DMPS:410:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "BEND:DMPS:410:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "1") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "BEND:DMPS:410: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, "BEND:DMPS:410:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "BEND:DMPS:410:TRIMTYPE.RVAL") field(INPB, "BEND:DMPS:410:CONFIG.RVAL") field(OUT, "BEND:DMPS:410:TRIMMAXNUM PP") } record(longout, "BEND:DMPS:410: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, "BEND:DMPS:410: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, "BEND:DMPS:400:TRIMRAMPRATE CP NMS") field(OMSL, "closed_loop") field(VAL, "") field(OUT, "BEND:DMPS:410:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "BEND:DMPS:410: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, "BEND:DMPS:400:TRIMSETL CP NMS") field(OMSL, "closed_loop") field(VAL, "") } record(bo, "BEND:DMPS:410: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, "BEND:DMPS:410: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, "BEND:DMPS:410: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, "0") } record(bo, "BEND:DMPS:410:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "0") } record(ao, "BEND:DMPS:410: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, "BEND:DMPS:410:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "BEND:DMPS:410: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, "BEND:DMPS:410: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, "BEND:DMPS:410:IMOVE") field(INPB, "BEND:DMPS:410:IACT") field(INPC, "BEND:DMPS:410:IRAMPRATE") field(INPD, "1.0") field(INPE, "BEND:DMPS:410:TRIMDLYPCT") field(INPF, "BEND:DMPS:410:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "BEND:DMPS:410:RAMPTIME_LEFT PP") } record(longout, "BEND:DMPS:410:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "BEND:DMPS:410:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "BEND:DMPS:410:RAMPDONE_CALC") } record(calc, "BEND:DMPS:410:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "BEND:DMPS:410:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "BEND:DMPS:410:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "BEND:DMPS:410: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, "BEND:DMPS:410:RAMPTIME_LEFT") field(OUT, "BEND:DMPS:410:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "BEND:DMPS:410:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "BEND:DMPS:410:RAMPTIME_LEFT NMS") field(OUT, "BEND:DMPS:410:RAMPDONE PP") } record(bo, "BEND:DMPS:410:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "BEND:DMPS:410:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "BEND:DMPS:410: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, "BEND:DMPS:410: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, "BEND:DMPS:410:STDZINIT") { field(DESC, "Proc. Stdz PVs on boot") field(PINI, "YES") field(DOL1, "1") field(DOL2, "1") field(DOL3, "1") field(LNK1, "BEND:DMPS:410:DEBUG.PROC PP") field(LNK2, "BEND:DMPS:410:STDZCYCLENUM.PROC PP") field(LNK3, "BEND:DMPS:410:STDZDISABLE.PROC PP") field(LNK4, "BEND:DMPS:410: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, "BEND:DMPS:410:STDZSUB") { field(DESC, "Stdz subroutine") field(INAM, "mgntStdzInit") field(SNAM, "mgntStdz") field(BRSV, "INVALID") field(INPA, "BEND:DMPS:410:STDZIMIN NPP NMS") field(INPB, "BEND:DMPS:410:STDZIMAX NPP NMS") field(INPC, "BEND:DMPS:410:STDZIFINAL NPP NMS") field(INPD, "BEND:DMPS:410:STDZCYCLENUM NPP NMS") field(INPE, "BEND:DMPS:410:STDZDIRECT.RVAL NPP NMS") field(INPF, "BEND:DMPS:410:STDZDISABLE.RVAL CPP NMS") field(INPG, "BEND:DMPS:410: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, "BEND:DMPS:410:STDZWF PP") field(OUTB, "BEND:DMPS:410: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, "BEND:DMPS:410:STDZWF") } record(mbbo, "BEND:DMPS:410: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, "BEND:DMPS:410: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, "BEND:DMPS:410:STDZMAINPS") { field(DESC, "Stdz by main or self") field(PINI, "YES") field(DTYP, "Soft Channel") field(ZNAM, "SELF") field(ONAM, "MAIN") } record(bo, "BEND:DMPS:410: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, "BEND:DMPS:410: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, "BEND:DMPS:410: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, "BEND:DMPS:410:STDZTOD") { field(DESC, "Successful Standardize Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "BEND:DMPS:410:STDZLOSTTOD") { field(DESC, "Standardize Lost Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(longout, "BEND:DMPS:410:STDZCYCLECNT") { field(DESC, "Cycle Count") field(PINI, "YES") } record(longout, "BEND:DMPS:410: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, "BEND:DMPS:410:STDZDIRECT") } # The default standardize direction is "UP" for # all LCLS Magnets.. record(bo, "BEND:DMPS:410:STDZDIRECT") { field(DESC, "Standardize Direction ") field(ZNAM, "UP") field(ONAM, "DOWN") field(VAL, "0") field(FLNK, "BEND:DMPS:410:STDZIMIN") } record(ao, "BEND:DMPS:410:STDZIMIN") { field(DESC, "Min-STDZ Current") field(PREC, "1") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(VAL, "0.0") field(FLNK, "BEND:DMPS:410:STDZIMAX") } record(ao, "BEND:DMPS:410:STDZIMAX") { field(DESC, "Max. Standarize Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(VAL, "200.0") field(FLNK, "BEND:DMPS:410:STDZIFINAL") } record(ao, "BEND:DMPS:410:STDZIFINAL") { field(DESC, "Final SDTZ Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(VAL, "0.0") field(FLNK, "BEND:DMPS:410: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, "BEND:DMPS:410: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, "BEND:DMPS:410:STDZITOL") { field(DESC, "Stdz min tolerance") field(PREC, "5") field(CALC, "MAX(ABS(A),ABS(B))*C") field(INPA, "BEND:DMPS:410:STDZIMIN CP NMS") field(INPB, "BEND:DMPS:410:STDZIMAX CP MMS") field(INPC, "0.05") field(INPD, "BEND:DMPS:410:STDZITOLR CP MMS") field(EGU, "A") field(FLNK, "BEND:DMPS:410:IDELTAS") field(PINI, "YES") } # D - factor (3.154/2 = 1.577) for EPSC, otherwise, set to 1.0 record(calc, "BEND:DMPS:410:STDZDLY") { field(DESC, "Ramp time for stdz cycle") field(CALC, "C>0?MAX(1,ABS((A-B)/C)*D):0") field(INPA, "BEND:DMPS:410:STDZIMIN CP NMS") field(INPB, "BEND:DMPS:410:STDZIMAX CP NMS") field(INPC, "BEND:DMPS:410:TRIMRAMPRATE CP NMS") field(INPD, "1.0") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") } record(calc, "BEND:DMPS:410:STDZRAMPDLY") { field(DESC, "Ramp delay total") field(CALC, "MAX(1,((A/100)*B+B))") field(PREC, "5") field(INPA, "BEND:DMPS:410:TRIMDLYPCT CP MS") field(INPB, "BEND:DMPS:410: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, "BEND:DMPS:410:STDZMINIDLY") { field(DESC, "Mini-stdz delay") field(CALC, "A") field(PREC, "5") field(A, "1.0") field(EGU, "sec") field(PINI, "YES") } record(ao, "BEND:DMPS:410: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, "BEND:DMPS:410:STDZMINIDELTA") { field(DESC, "Stdz mini % of IMAX") field(CALC, "(B/100)*(A-C)") field(INPA, "BEND:DMPS:410:IDES.HOPR") field(INPB, "BEND:DMPS:410:STDZMINIPCT CPP NMS") field(INPC, "BEND:DMPS:410:IDES.LOPR") field(PREC, "5") } record(calc, "BEND:DMPS:410:STDZMINISETPT") { field(DESC, "Mini Stdz delta") field(CALC, "C==0?MAX(E-D,B):MIN(E+D,A)") field(INPA, "BEND:DMPS:410:IDES.HOPR") field(INPB, "BEND:DMPS:410:IDES.LOPR") field(INPC, "BEND:DMPS:410:STDZDIRECT.RVAL") field(INPD, "BEND:DMPS:410:STDZMINIDELTA") field(INPE, "BEND:DMPS:410:IDES") field(PREC, "5") field(FLNK, "BEND:DMPS:410: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, "BEND:DMPS:410:STDZMINISETPTOOR") { field(DESC, "Mini Stdz setpoint out of range") field(CALC, "C==0?(E-DA)") field(INPA, "BEND:DMPS:410:IDES.HOPR") field(INPB, "BEND:DMPS:410:IDES.LOPR") field(INPC, "BEND:DMPS:410:STDZDIRECT.RVAL") field(INPD, "BEND:DMPS:410:STDZMINIDELTA") field(INPE, "BEND:DMPS:410: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, "BEND:DMPS:410: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, "BEND:DMPS:410:IADJUST.RVAL") field(INPB, "BEND:DMPS:410:STDZDIRECT.RVAL") field(INPC, "BEND:DMPS:410:STDZOK.RVAL") field(INPD, "BEND:DMPS:410:STDZDISABLE.RVAL") field(INPE, "BEND:DMPS:410:STATE.RVAL CPP NMS") field(INPF, "BEND:DMPS:410:ICTRL.RVAL") field(INPG, "BEND:DMPS:410:STATE.SEVR") field(INPH, "BEND:DMPS:410:BDELTAS.M") field(INPI, "BEND:DMPS:410:IACT.SEVR") field(OUT, "BEND:DMPS:410:STDZLOSTGO.SELN PP NMS") field(OOPT, "Transition To Non-zero") } record(seq, "BEND:DMPS:410:STDZLOSTGO") { field(DESC, "Process lost stdz") field(SELM, "Mask") field(DOL1, "1") field(DOL2, "0") field(LNK1, "BEND:DMPS:410:STDZLOSTTOD.PROC") field(LNK2, "BEND:DMPS:410:STDZOK PP") } # Record maximum current after standardize # Reset to IACT from sequence after trim # Disable processing during (mini-)standardize or trim record(calc, "BEND:DMPS:410:STDZIACTMAX") { field(DESC, "Max act current after stdz") field(CALC, "MAX(A, B)") field(DISV, "0") field(SDIS, "BEND:DMPS:410:CHECKPWRDIP_ENABLE") field(INPA, "BEND:DMPS:410:IACT CP") field(INPB, "BEND:DMPS:410:STDZIACTMAX") field(EGU, "A") field(FLNK, "BEND:DMPS:410:CHECKPWRDIP") } # Detect power dip if STDZOK is YES, STDZ is enabled, and IACT is valid # If IACT drops below STDZIACTMAX by more than the trim tolerance, clear STDZOK # Warning: Take the absolute value of the trim tolerance, or else quads of # negative polarity will always lose STDZ since their IDELTAS.I are negative. # Note: Large quads and bends are prone to losing STDZ even if they are # perturbed toward higher current since their current tends to overshoot # by greater than the trim tolerance before settling down. record(calcout, "BEND:DMPS:410:CHECKPWRDIP") { field(DESC, "Detect power dip") field(CALC, "(A-B>ABS(C))?3:0") field(DISV, "0") field(SDIS, "BEND:DMPS:410:CHECKPWRDIP_ENABLE") field(INPA, "BEND:DMPS:410:STDZIACTMAX") field(INPB, "BEND:DMPS:410:IACT") field(INPC, "BEND:DMPS:410:IDELTAS.I") field(OUT, "BEND:DMPS:410:STDZLOSTGO.SELN PP NMS") field(OOPT, "When Non-zero") } # Enable processing of STDZIACTMAX and CHECKPWRDIP only if # STDZOK = YES, STDZDISABLE = NO, CTRL != Trim (2), and # CTRL != Stdz (4) record(calc, "BEND:DMPS:410:CHECKPWRDIP_ENABLE") { field(CALC, "A&&!B&&(C#2)&&(C#4)") field(INPA, "BEND:DMPS:410:STDZOK.RVAL CP") field(INPB, "BEND:DMPS:410:STDZDISABLE.RVAL CP") field(INPC, "BEND:DMPS:410:CTRL.RVAL CP") } #! 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, "BEND:DMPS:410: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, "BEND:DMPS:410: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, "BEND:DMPS:410:CALBSET") { field(DESC, "Use DAC Calbration") field(SCAN, "10 second") field(CALC, "A&&(B==0)&&C?31:960") field(INPA, "BEND:DMPS:410:CALBOK") field(INPB, "BEND:DMPS:410:CALBDISABLE") field(INPC, "BEND:DMPS:410:CALBSLOPE") field(OOPT, "On Change") field(OUT, "BEND:DMPS:410: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, "BEND:DMPS:410:CALB_SEQ") { field(DESC, "Output Calib Values") field(SELM, "Mask") field(SELL, "BEND:DMPS:410: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, "BEND:DMPS:410:CALBSLOPE") field(DOL3, "BEND:DMPS:410: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, "BEND:DMPS:410:CALBTOD") { field(DESC, "Calibration Success Time") field(PINI, "YES") # field(DOL, "") field(OMSL, "supervisory") field(DTYP, "Soft Channel") info(autosaveFields,"VAL") } record(ao, "BEND:DMPS:410: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, "BEND:DMPS:410: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, "BEND:DMPS:410: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, "BEND:DMPS:410:CALBOFFSET") { field(DESC, "Calc DAC Offset") field(PREC, "6") field(EGU, "Counts") field(PINI, "YES") } record(bo, "BEND:DMPS:410: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, "BEND:DMPS:410:DACSLOPE") { field(DESC, "V to DAC slope") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "supervisory") field(PINI, "YES") field(FLNK, "BEND:DMPS:410:DACOFFSET") } # Default Offset used in conversion from Volts to DAC Counts record(ao, "BEND:DMPS:410:DACOFFSET") { field(DESC, "V to DAC offset") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "supervisory") field(PINI, "YES") field(FLNK, "BEND:DMPS:410: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, "BEND:DMPS:410: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, "BEND:DMPS:410:IACT") field(INPD, "BEND:DMPS:410:DACSLOPE") field(INPE, "BEND:DMPS:410:DACOFFSET") field(EGU, "Counts") field(PREC, "6") } record(ao, "BEND:DMPS:410:DAC") { field(DESC, "DAC Set point") field(EGU, "Counts") field(DOL, "") field(OMSL, "supervisory") field(PREC, "6") field(PINI, "YES") } record(ao, "BEND:DMPS:410:CALBIMIN") { field(DESC, "Calibration Min Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(DRVH, "200.0") field(HOPR, "200.0") field(DRVL, "0.0") field(LOPR, "0.0") field(PREC, "3") field(EGU, "A") field(VAL, "0.0") field(FLNK, "BEND:DMPS:410:CALBIMAX") } record(ao, "BEND:DMPS:410:CALBIMAX") { field(DESC, "Calibration Max Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(DRVH, "200.0") field(HOPR, "200.0") field(LOPR, "0.0") field(DRVL, "0.0") field(EGU, "A") field(VAL, "200.0") field(FLNK, "BEND:DMPS:410:CALBSTEPNUM") } record(ao, "BEND:DMPS:410:CALBIFINAL") { field(DESC, "Calibration Last Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(PREC, "3") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(VAL, "0") } record(longout, "BEND:DMPS:410: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, "BEND:DMPS:410:CALBIDELTA") } record(calc, "BEND:DMPS:410:CALBIDELTA") { field(DESC, "Step size for CALB") field(CALC, "C=0?0:ABS((A-B)/C)") field(INPA, "BEND:DMPS:410:CALBIMAX") field(INPB, "BEND:DMPS:410:CALBIMIN") field(INPC, "BEND:DMPS:410: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, "BEND:DMPS:410:CALBIMULT") { field(DESC, "IACT vs ISETPT mult") field(CALC, "C#0||A=0?1:ABS(B/A)") field(INPA, "BEND:DMPS:400:ISETPT.DRVH") field(INPB, "BEND:DMPS:400:IACT.HOPR") field(INPC, "BEND:DMPS:410:PSCONTROLLER.RVAL CPP") field(EGU, "A") field(PINI, "YES") } # SNL dbputs DAC values here. 6-10 steps are possible. record(waveform, "BEND:DMPS:410:CALBICTRLWF") { field(DESC, "ICTRL setpoint array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") } record(waveform, "BEND:DMPS:410:DACWF") { field(DESC, "DAC count array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "BEND:DMPS:410:DACSA") } # Used only for xygraph edm plot record(subArray, "BEND:DMPS:410:DACSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "BEND:DMPS:410: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, "BEND:DMPS:410:CALCDACWF") { field(DESC, "Calc DAC counts array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "BEND:DMPS:410:CALCDACSA") } # Used only for xygraph edm plot record(subArray, "BEND:DMPS:410:CALCDACSA") { field(DESC, "Calc DAC counts") field(DTYP, "Soft Channel") field(INP, "BEND:DMPS:410: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, "BEND:DMPS:410:CALBYWF") { field(DESC, "mx + b") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "BEND:DMPS:410:CALBYSA") } # Used only for xygraph edm plot record(subArray, "BEND:DMPS:410:CALBYSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "BEND:DMPS:410:CALBYWF") field(MALM, "10") field(NELM, "6") field(INDX, "0") field(FTVL, "DOUBLE") } record(waveform, "BEND:DMPS:410:CALBIACTWF") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "BEND:DMPS:410:CALBIACTSA") } # Used only for xygraph edm plot record(subArray, "BEND:DMPS:410:CALBIACTSA") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(MALM, "10") field(NELM, "6") field(INP, "BEND:DMPS:410:CALBIACTWF") field(INDX, "0") field(FTVL, "DOUBLE") field(FLNK, "BEND:DMPS:410:CALBLIMITS") } # Check that measured current during calibration is within # tolerance. record(aSub, "BEND:DMPS:410: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, "BEND:DMPS:410:CALBSTEPNUM") field(INPB, "BEND:DMPS:410:CALBIACTWF") field(INPC, "BEND:DMPS:410: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, "BEND:DMPS:410: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, "BEND:DMPS:410:STDZITOL") field(INPH, "BEND:DMPS:410:DACSLOPE") field(INPI, "BEND:DMPS:410: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, "BEND:DMPS:410: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, "BEND:DMPS:410:CALBSTEPNUM") field(INPB, "BEND:DMPS:410:CALBIACTWF") field(INPC, "BEND:DMPS:410:DACWF") field(INPF, "BEND:DMPS:410: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 BEND:DMPS:410CALBOK 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, "BEND:DMPS:410:DEGAUSINIT") { field(DESC, "Proc. Degauss PVs on boot") field(PINI, "YES") field(DOL, "1") field(OUTA, "BEND:DMPS:410:DEGAUSIMIN.PROC PP") field(OUTB, "BEND:DMPS:410:DEGAUSIMAX.PROC PP") field(OUTC, "BEND:DMPS:410:DEGAUSTYPE.PROC PP") field(OUTD, "BEND:DMPS:410:DEGAUSSTEP.PROC PP") field(OUTE, "BEND:DMPS:410:MADNAME.PROC PP") field(OUTF, "BEND:DMPS:410:PSTYPE.PROC PP") field(OUTG, "BEND:DMPS:410: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, "BEND:DMPS:410:DEGAUSSUB") { field(DESC, "Degauss subroutine") field(INAM, "mgntDegaussInit") field(SNAM, "mgntDegauss") field(BRSV, "INVALID") field(INPA, "BEND:DMPS:410:DEGAUSIMIN NPP NMS") field(INPB, "BEND:DMPS:410:DEGAUSIMAX NPP NMS") field(INPC, "BEND:DMPS:410:DEGAUSTYPE.RVAL NPP NMS") field(INPE, "BEND:DMPS:410:DEGAUSMETHOD.RVAL NPP NMS") field(INPF, "BEND:DMPS:410:PSTYPE NPP NMS") field(INPG, "BEND:DMPS:410:DEBUG.RVAL NPP NMS") field(INPH, "BEND:DMPS:410: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, "BEND:DMPS:410:DEGAUSWF PP") field(OUTB, "BEND:DMPS:410:DEGAUSMSG PP") field(OUTC, "BEND:DMPS:410: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, "BEND:DMPS:410:DEGAUSWF") { field(DESC, "Degauss Setpts") field(NELM, "60") field(FTVL, "DOUBLE") } record(mbbo,"BEND:DMPS:410: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, "BEND:DMPS:410: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, "BEND:DMPS:410: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, "BEND:DMPS:410: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, "BEND:DMPS:410: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, "BEND:DMPS:410:DEGAUSIMIN") { field(DESC, "Min. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "200.0") field(LOPR, "-200.0") field(DRVH, "200.0") field(DRVL, "-200.0") field(VAL, "-200.0") } record(ao, "BEND:DMPS:410:DEGAUSIMAX") { field(DESC, "Max. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "200.0") field(LOPR, "-200.0") field(DRVH, "200.0") field(DRVL, "-200.0") field(VAL, "200.0") } # 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,"BEND:DMPS:410: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, "BEND:DMPS:410: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,"BEND:DMPS:410: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, "BEND:DMPS:410: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, "BEND:DMPS:410: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, "BEND:DMPS:410: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, "BEND:DMPS:410:DEGAUSTOD") { field(DESC, "Successful Degauss Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "BEND:DMPS:410:DEGAUSLOSTTOD") { field(DESC, "Degauss Lost Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "BEND:DMPS:410:DEGAUSTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "BEND:DMPS:410:DEGAUSTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "BEND:DMPS:410: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, "BEND:DMPS:410:DEGAUSGO") { field(DESC, "Set bdes of btrms to zero") field(ASG, "Internal") field(OUTA, "") field(OUTB, "") field(OUTC, "") field(OUTD, "") } # =========== CRYO ONLY =========== record(bo, "BEND:DMPS:410: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, "BEND:DMPS:410:DEGAUS_IMAX_CHECK") { field(DESC, "Check if imax shoud chg") field(CALC, "(C==4)&&(ABS(B)>ABS(A))?1:0") field(INPA, "BEND:DMPS:410:DEGAUS_IMAX") field(INPB, "BEND:DMPS:410:ISETPT") field(INPC, "BEND:DMPS:410:DEGAUSTYPE.RVAL") field(OUT, "BEND:DMPS:410:DEGAUS_IMAX_UPDATE.SELN") field(FLNK, "BEND:DMPS:410:DEGAUS_IMAX_UPDATE") } record(seq, "BEND:DMPS:410:DEGAUS_IMAX_UPDATE") { field(DESC, "Degauss IMAX Update") field(SELM, "Specified") field(DOL1, "BEND:DMPS:410:ISETPT") field(LNK1, "BEND:DMPS:410:DEGAUS_IMAX PP") } # Set the maximum current after a successful # degauss. This pv is updated by the # sequence. record(ao, "BEND:DMPS:410:DEGAUS_IMAX") { field(DESC, "Max I set afer a degauss") field(EGU, "Amps") field(PINI, "YES") field(PREC, "6") field(HOPR, "200.0") field(LOPR, "-200.0") field(DRVH, "200.0") field(DRVL, "-200.0") field(VAL, "200.0") field(FLNK, "BEND:DMPS:410:DEGAUS_IMAXPOL_CHECK") info(autosaveFields,"VAL,RVAL") } # Set the polarity if degauss_imax record(calcout, "BEND:DMPS:410:DEGAUS_IMAXPOL_CHECK") { field(DESC, "Determine polarity of imax") field(CALC, "A>=0?0:1") field(INPA, "BEND:DMPS:410:DEGAUS_IMAX") field(FLNK, "BEND:DMPS:410:DEGAUS_IMAXPOL") } record(bo, "BEND:DMPS:410:DEGAUS_IMAXPOL") { field(DESC, "Polarity of imax I") field(DTYP, "Raw Soft Channel") field(DOL, "BEND:DMPS:410:DEGAUS_IMAXPOL_CHECK") field(OMSL, "closed_loop") field(ZNAM, "Positive") field(ONAM, "Negative") field(FLNK, "BEND:DMPS:410: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, "BEND:DMPS:410:DEGAUS_ABSIMAX") { field(DESC, "Absolute Max. Degauss I") field(CALC, "ABS(A)") field(INPA, "BEND:DMPS:410:DEGAUS_IMAX") field(PREC, "6") field(EGU, "Amps") field(HOPR, "200.0") field(LOPR, "-200.0") info(autosaveFields,"VAL RVAL") } # IACT Polarity record(calcout, "BEND:DMPS:410:IACTPOL_CHECK") { field(DESC, "Determine IACT polarity") field(SCAN, "5 second") field(CALC, "ABS(A-B)>C?(A>=0?0:1):D") field(INPA, "BEND:DMPS:410:IACT") field(INPB, "BEND:DMPS:410:IACTPOL_CHECK.LA") field(INPC, "0.0001") field(INPD, "BEND:DMPS:410:IACTPOL_CHECK.PVAL") field(OOPT, "On Change") field(FLNK, "BEND:DMPS:410:IACTPOL") } record(bo, "BEND:DMPS:410: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,"BEND:DMPS:410: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, "BEND:DMPS:410:DEGAUSENABLE CP") field(INPB, "BEND:DMPS:410:DEGAUSOK") field(INPC, "BEND:DMPS:410:STATE CP") field(INPD, "BEND:DMPS:410:STATE.SEVR") field(OUT, "BEND:DMPS:410:DEGAUS_STATE_SEQ.SELN PP") field(ASG, "Internal") } record(seq, "BEND:DMPS:410:DEGAUS_STATE_SEQ") { field(DESC, "Degauss State Sequence") field(SELM, "Specified") field(SELL, "BEND:DMPS:410:DEGAUS_STATE_CHECK") field(LNK1, "BEND:DMPS:410:DEGAUS_STATE_DISABLE.PROC PP") field(LNK2, "BEND:DMPS:410:DEGAUS_STATE_LOST.PROC PP") field(LNK3, "BEND:DMPS:410:DEGAUS_STATE_GOOD.PROC PP") field(LNK4, "BEND:DMPS:410: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, "BEND:DMPS:410:DEGAUS_STATE_DISABLE") { field(DESC, "Degauss not used") field(LNK1, "BEND:DMPS:410:DEGAUSOK.ZSV") field(LNK2, "BEND:DMPS:410: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, "BEND:DMPS:410:STATMSG.FRSV") field(LNK4, "BEND:DMPS:410: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, "BEND:DMPS:410:DEGAUS_STATE_LOST") { field(DESC, "Degauss lost and ps On") field(DOL1, "1") field(LNK1, "BEND:DMPS:410:DEGAUSOK.ZSV") field(LNK2, "BEND:DMPS:410: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, "BEND:DMPS:410:STATMSG.FRSV") field(LNK4, "BEND:DMPS:410: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, "BEND:DMPS:410:DEGAUS_STATE_OFF") { field(DESC, "Degaused lost and ps Off") field(DOL1, "2") field(LNK1, "BEND:DMPS:410: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, "BEND:DMPS:410:STATMSG.FRSV") field(LNK3, "BEND:DMPS:410: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, "BEND:DMPS:410:DEGAUS_STATE_GOOD") { field(DESC, "Degauss good") field(DOL1, "1") field(LNK1, "BEND:DMPS:410: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, "BEND:DMPS:410:STATMSG.FRSV PP") field(LNK3, "BEND:DMPS:410:STATMSG.FVSV PP") field(LNK4, "") field(ASG, "Internal") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(mbbo, "BEND:DMPS:410:FUNC") { field(DESC, "BEND:DMPS:410 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, "0") field(FFVL, "0") field(OUT, "BEND:DMPS:410:CTRL CA") } # :CTRL pv is processed at boot in the # sequence mgntCtrl.st Processed in sequence # record(mbbo, "BEND:DMPS:410:CTRL") { field(DESC, "BEND:DMPS:410 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, "BEND:DMPS:410:SELECTEN.A PP") field(SDIS, "0") } # If a function has been selected set this unit to busy record(calcout, "BEND:DMPS:410:SELECTEN") { field(DESC, "Control Select Enable") field(CALC, "A>0?1:A") field(FLNK, "BEND:DMPS:410:BUSY") } # Set to FREE on IOC reboot record(bo, "BEND:DMPS:410:BUSY") { field(DESC, "BEND:DMPS:410 Ctrl Done") field(DOL, "BEND:DMPS:410:SELECTEN") field(ZNAM, "FREE") field(ONAM, "BUSY") field(PINI, "YES") field(FLNK, "BEND:DMPS:410:SELECT") } record(bo, "BEND:DMPS:410:SELECT") { field(ZNAM, "NO") field(ONAM, "YES") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") } record(bo, "BEND:DMPS:410: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, "BEND:DMPS:410:CTRLSTATE") { field(DESC, "BEND:DMPS:410 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("BEND:DMPS:410:CTRL",20,20,0,0,"BEND:DMPS:410:CTRL") #! Field("BEND:DMPS:410:CTRL.OUT",16777215,1,"BEND:DMPS:410:CTRL.OUT") #! Link("BEND:DMPS:410:CTRL.OUT","BEND:DMPS:410:SELECTEN.A") #! Field("BEND:DMPS:410:CTRL.VAL",16777215,1,"BEND:DMPS:410:CTRL.VAL") #! Record("BEND:DMPS:410:SELECTEN",321,381,0,0,"BEND:DMPS:410:SELECTEN") #! Field("BEND:DMPS:410:SELECTEN.A",16777215,0,"BEND:DMPS:410:SELECTEN.A") #! Field("BEND:DMPS:410:SELECTEN.FLNK",16777215,1,"BEND:DMPS:410:SELECTEN.FLNK") #! Link("BEND:DMPS:410:SELECTEN.FLNK","BEND:DMPS:410:BUSY") #! Field("BEND:DMPS:410:SELECTEN.VAL",16777215,1,"BEND:DMPS:410:SELECTEN.VAL") #! Record("BEND:DMPS:410:BUSY",623,274,0,0,"BEND:DMPS:410:BUSY") #! Field("BEND:DMPS:410:BUSY.DOL",16777215,0,"BEND:DMPS:410:BUSY.DOL") #! Link("BEND:DMPS:410:BUSY.DOL","BEND:DMPS:410:SELECTEN.VAL") #! Field("BEND:DMPS:410:BUSY.FLNK",16777215,1,"BEND:DMPS:410:BUSY.FLNK") #! Link("BEND:DMPS:410:BUSY.FLNK","BEND:DMPS:410:SELECT") #! Record("BEND:DMPS:410:SELECT",669,508,0,1,"BEND:DMPS:410:SELECT") #! Record("BEND:DMPS:410:FUNC",940,120,0,0,"BEND:DMPS:410:FUNC") #! Field("BEND:DMPS:410:FUNC.OUT",16777215,0,"BEND:DMPS:410:FUNC.OUT") #! Link("BEND:DMPS:410:FUNC.OUT","BEND:DMPS:410:CTRL.VAL") #! Record("BEND:DMPS:410:ABORT",193,41,0,0,"BEND:DMPS:410:ABORT") #! Record("BEND:DMPS:410:CTRLSTATE",369,34,0,0,"BEND:DMPS:410: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,"BEND:DMPS:410:SELECT is used for Multi-device selection.\nIt is enabled when associated BEND:DMPS:410:CTRL is \"0\" (DONE).\nIt is disabled when associated BEND:DMPS:410: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,"BEND:DMPS:410: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, "BEND:DMPS:410:BCTRL_INIT") { field(DESC, "Process BCTRL on boot") field(PINI, "YES") field(CALC, "A=3?1:0") field(INPA, "BEND:DMPS:410:BCTRL.SEVR") field(OUT, "BEND:DMPS:410: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, "BEND:DMPS:410:BACT") { field(DESC, "Actual B") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "BEND:DMPS:410:BACT") field(INPB, "BEND:DMPS:410:POLYCOEF") field(INPC, "BEND:DMPS:410:POLYCOEF.A") field(INPD, "BEND:DMPS:410:POLYCOEF.B") field(INPE, "BEND:DMPS:410:IACT MS") field(INPF, "BEND:DMPS:410:BDELTAS PP") field(INPG, "100") field(EGU, "GeV/c") field(HOPR, "15.7564") field(LOPR, "0.027") field(HIHI, "15.7564") field(LOLO, "0.027") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "15.7564") field(LOW, "0.027") field(FLNK, "BEND:DMPS:410: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, "BEND:DMPS:410:BDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntPhyDeltas") field(EGU, "GeV/c") field(HOPR, "1") field(PREC, "7") field(BRSV, "INVALID") field(INPA, "BEND:DMPS:410:BDES") field(INPB, "BEND:DMPS:410:TRIMBTOL") field(INPC, "BEND:DMPS:410:TRIMBTOLR") field(INPD, "BEND:DMPS:410:CHCKBTOL") field(INPE, "BEND:DMPS:410:CHCKBTOLR") field(F, "2.0") field(INPG, "30") field(INPH, "BEND:DMPS:410:BACT.VAL") # # MPS absolute and relative tolerances field(INPP, "BEND:DMPS:410:MPSBTOL") field(INPQ, "BEND:DMPS:410:MPSBTOLR") field(FLNK, "BEND:DMPS:410:BCONLIMITS") info(autosaveFields,"F") } # This record is processed by BDELTAS record(aSub, "BEND:DMPS:410:BCONLIMITS") { field(DESC, "Config B-field Limits") field(INAM, "mgntInit") field(SNAM, "mgntBCONLimits") field(INPA, "BEND:DMPS:410:BDES") field(INPB, "BEND:DMPS:410:BDELTAS.I") field(INPG, "BEND:DMPS:410:DEBUG.RVAL") field(FTA, "DOUBLE") field(FTB, "DOUBLE") field(FTG, "ULONG") field(OUTA, "BEND:DMPS:410:BCON.HIGH") field(OUTB, "BEND:DMPS:410:BCON.LOW") field(OUTC, "BEND:DMPS:410:BCON.HIHI") field(OUTD, "BEND:DMPS:410:BCON.LOLO PP") field(FTVA, "DOUBLE") field(FTVB, "DOUBLE") field(FTVC, "DOUBLE") field(FTVD, "DOUBLE") field(BRSV, "INVALID") field(FLNK, "BEND:DMPS:410:IDELTAS") } # The following PV is processed by :BACT # which is processed by :BACT # record(fanout, "BEND:DMPS:410:BACTFO") { field(DESC, "BACT processing") field(SELM, "All") field(LNK1, "BEND:DMPS:410:BDIFF") field(LNK2, "BEND:DMPS:410:BADIFF") field(LNK3, "BEND:DMPS:410:BRATIO") field(LNK4, "BEND:DMPS:410:MPSLIMITS") field(LNK5, "BEND:DMPS:410:I2BSTATUS") field(LNK6, "BEND:DMPS:410:IACTFO.PROC") } record(calc, "BEND:DMPS:410:BDIFF") { field(DESC, "BDES-BACT") field(CALC, "A-B") field(INPA, "BEND:DMPS:410:BDES") field(INPB, "BEND:DMPS:410:BACT") field(EGU, "GeV/c") field(PREC, "7") } record(calc, "BEND:DMPS:410:BADIFF") { field(DESC, "Absolute BDES-BACT") field(INPA, "BEND:DMPS:410:BDIFF") field(EGU, "GeV/c") field(PREC, "7") field(CALC, "A<0?ABS(A):A") } record(calc, "BEND:DMPS:410:BRATIO") { field(DESC, "BACT Error") field(CALC, "B?A/B:0") field(INPA, "BEND:DMPS:410:BDIFF") field(INPB, "BEND:DMPS:410:BDES.HOPR") field(EGU, "GeV/c") field(PREC, "7") } record(mbbi, "BEND:DMPS:410: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, "BEND:DMPS:410:BACT.J") } # Note: for a string slave set the MONFL # macro to the following: # MONFL=:IMONCALC MS record(sub, "BEND:DMPS:410:BMON") { field(DESC, "Second Transductor") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "BEND:DMPS:410:BMON") field(INPB, "BEND:DMPS:410:POLYCOEF") field(INPC, "BEND:DMPS:410:POLYCOEF.A") field(INPD, "BEND:DMPS:410:POLYCOEF.B") field(INPE, "BEND:DMPS:410:IMON MS") field(INPF, "BEND:DMPS:410:BDELTAS.VAL") field(INPG, "100") field(EGU, "GeV/c") field(HOPR, "15.7564") field(LOPR, "0.027") field(HIHI, "15.7564") field(LOLO, "0.027") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "15.7564") field(LOW, "0.027") } # 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=BEND:DMPS:400:BDES CP record(ao, "BEND:DMPS:410:BDES") { field(DESC, "Desired B-Field") field(PINI, "NO") field(DRVH, "15.7564") field(DRVL, "0.027") field(HOPR, "15.7564") field(LOPR, "0.027") field(PREC, "7") field(EGU, "GeV/c") field(MDEL, "-1") field(OMSL, "closed_loop") field(DOL, "BEND:DMPS:410:IDES2BDES") field(OUT, "BEND:DMPS:410:B2IDES PP") info(autosaveFields,"VAL") } record(sub, "BEND:DMPS:410:B2IDES") { field(DESC, "Convert Desired B-Field to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "BEND:DMPS:410:POLYCOEF") field(INPC, "BEND:DMPS:410:POLYCOEF.A") field(INPD, "BEND:DMPS:410:POLYCOEF.B") field(PREC, "7") field(EGU, "GeV/c") field(HOPR, "15.7564") field(LOPR, "0.027") field(MDEL, "-1") field(INPE, "BEND:DMPS:410:BDES.DRVH") field(INPF, "BEND:DMPS:410:BDES.DRVL") field(BRSV, "INVALID") field(FLNK, "BEND:DMPS:410:IDES") } record(sub, "BEND:DMPS:410:BNOM") { field(DESC, "Nominal Field") field(PINI, "YES") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "BEND:DMPS:410:POLYCOEF") field(INPC, "BEND:DMPS:410:POLYCOEF.A") field(INPD, "BEND:DMPS:410:POLYCOEF.B") field(INPE, "BEND:DMPS:410:BDES.DRVH") field(INPF, "BEND:DMPS:410:BDES.DRVL") field(EGU, "GeV/c") field(HOPR, "15.7564") field(LOPR, "0.027") field(PREC, "7") field(VAL, "0.0") field(FLNK, "BEND:DMPS:410:INOM") } record(sub, "BEND:DMPS:410:BACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "BEND:DMPS:410:BDES.VAL") field(INPB, "BEND:DMPS:410:BDES.DRVH") field(INPC, "BEND:DMPS:410:BDES.DRVL") field(INPD, "BEND:DMPS:410:BDELTAS.I") field(INPE, "BEND:DMPS:410:BDELTAS.J") field(INPG, "BEND:DMPS:410:STATE") field(INPH, "BEND:DMPS:410:HSTA") field(EGU, "GeV/c") field(HOPR, "15.7564") field(LOPR, "0.027") field(PREC, "7") field(BRSV, "INVALID") } record(sub, "BEND:DMPS:410:BMONLIMITS") { field(DESC, "MON Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "BEND:DMPS:410:BDES.VAL") field(INPB, "BEND:DMPS:410:BDES.DRVH") field(INPC, "BEND:DMPS:410:BDES.DRVL") field(INPD, "BEND:DMPS:410:BDELTAS.K") field(INPE, "BEND:DMPS:410:BDELTAS.L") field(INPG, "BEND:DMPS:410:STATE") field(INPH, "BEND:DMPS:410:HSTA") field(EGU, "GeV/c") field(HOPR, "15.7564") field(LOPR, "0.027") field(PREC, "7") field(BRSV, "INVALID") } record(seq, "BEND:DMPS:410:BLIMITS") { field(DESC, "ACT Limits") field(PREC, "7") field(DOL1, "BEND:DMPS:410:BLIMITS") field(LNK1, "BEND:DMPS:410:BACTLIMITS.F PP") field(DOL2, "BEND:DMPS:410:BACTLIMITS.I") field(LNK2, "BEND:DMPS:410:BACT.HIGH") field(DOL3, "BEND:DMPS:410:BACTLIMITS.J") field(LNK3, "BEND:DMPS:410:BACT.LOW") field(DOL4, "BEND:DMPS:410:BACTLIMITS.K") field(LNK4, "BEND:DMPS:410:BACT.HIHI") field(DOL5, "BEND:DMPS:410:BACTLIMITS.L") field(LNK5, "BEND:DMPS:410:BACT.LOLO") field(DOL6, "BEND:DMPS:410:BLIMITS") field(LNK6, "BEND:DMPS:410:BMONLIMITS.F PP") field(DOL7, "BEND:DMPS:410:BMONLIMITS.I") field(LNK7, "BEND:DMPS:410:BMON.HIGH") field(DOL8, "BEND:DMPS:410:BMONLIMITS.J") field(LNK8, "BEND:DMPS:410:BMON.LOW") field(DOL9, "BEND:DMPS:410:BMONLIMITS.K") field(LNK9, "BEND:DMPS:410:BMON.HIHI") field(DOLA, "BEND:DMPS:410:BMONLIMITS.L") field(LNKA, "BEND:DMPS:410:BMON.LOLO") field(FLNK, "BEND:DMPS:410:ILIMITS") field(SCAN, "5 second") } record(ao, "BEND:DMPS:410:BCTRL") { field(DESC, "B-Perturb") field(PREC, "7") field(EGU, "GeV/c") field(DRVH, "15.7564") field(DRVL, "0.027") field(HOPR, "15.7564") field(LOPR, "0.027") # 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, "BEND:DMPS:410: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, "BEND:DMPS:410:BCTRLGO") { field(DESC, "Update DES and perturb") field(PREC, "7") # Disable BACT limits field(DOL1, "1") field(LNK1, "BEND:DMPS:410:BLIMITS.VAL") # Update BDES with the BCTRL (slider) value field(DOL2, "BEND:DMPS:410:BCTRL.VAL") field(LNK2, "BEND:DMPS:410:BDES PP") field(DOL3, "1") field(LNK3, "BEND:DMPS:410:IDIRECT.PROC PP") field(DOL4, "1") field(LNK4, "BEND:DMPS:410:CHECKSTDZLOST.PROC PP") field(DOL5, "BEND:DMPS:410:BCTRL.VAL") field(LNK5, "BEND:DMPS:410:BCTRLSUB PP") # Re-enable BACT limits field(DOL6, "0") field(LNK6, "BEND:DMPS:410:BLIMITS.VAL") } # Convert B-field to Current and output to ISETPT record(sub, "BEND:DMPS:410:BCTRLSUB") { field(DESC, "Feedback") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "BEND:DMPS:410:POLYCOEF") field(INPC, "BEND:DMPS:410:POLYCOEF.A") field(INPD, "BEND:DMPS:410:POLYCOEF.B") field(INPE, "BEND:DMPS:410:BDES.DRVH") field(INPF, "BEND:DMPS:410:BDES.DRVL") field(PREC, "7") field(EGU, "GeV/c") field(HOPR, "15.7564") field(LOPR, "0.027") field(MDEL, "-1") field(BRSV, "INVALID") field(FLNK, "BEND:DMPS:410:ISETPT") } record(ao, "BEND:DMPS:410:BDESPREVTRIM") { field(DESC, "trim bdes for undo") field(DTYP, "Soft Channel") field(DRVH, "15.7564") field(DRVL, "0.027") field(EGU, "GeV/c") field(HOPR, "15.7564") field(LOPR, "0.027") field(PREC, "7") field(PINI, "YES") info(autosaveFields,"VAL") } record(stringin, "BEND:DMPS:410:MADNAME") { field(DESC, "MAD deck nomenclature") field(PINI, "YES") field(VAL, "BYD2B") } record(ai, "BEND:DMPS:410: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, "3737.648566") } record(ao, "BEND:DMPS:410:BMAX") { field(DESC, "Max B-Field") field(DTYP, "Soft Channel") field(DRVH, "15.7564") field(DRVL, "0.027") field(EGU, "GeV/c") field(HOPR, "15.7564") field(LOPR, "0.027") field(PREC, "7") field(PINI, "YES") field(VAL, "15.7564") field(FLNK, "BEND:DMPS:410:BSTEP") } record(ao, "BEND:DMPS:410:BMIN") { field(DESC, "Min B-Field") field(DTYP, "Soft Channel") field(DRVH, "15.7564") field(DRVL, "0.027") field(EGU, "GeV/c") field(HOPR, "15.7564") field(LOPR, "0.027") field(PREC, "7") field(PINI, "YES") field(VAL, "0.027") field(FLNK, "BEND:DMPS:410:BSTEP") } record(ao, "BEND:DMPS:410:BDESSAVE") { field(DESC, "bdes for save/load") field(DTYP, "Soft Channel") field(DRVH, "15.7564") field(DRVL, "0.027") field(EGU, "GeV/c") field(HOPR, "15.7564") field(LOPR, "0.027") field(PINI, "YES") field(PREC, "7") } # This record is processed by BEND:DMPS:410: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, "BEND:DMPS:410:BCON") { field(DESC, "Config B-Field ") field(DTYP, "Soft Channel") field(PREC, "7") field(EGU, "GeV/c") field(HOPR, "15.7564") field(LOPR, "0.027") field(DRVH, "15.7564") field(DRVL, "0.027") # 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 , "BEND:DMPS:410:ICON2BCON") field(OMSL, "closed_loop") field(OUT, "BEND:DMPS:410:B2ICON PP") info(autosaveFields,"VAL") } record(sub, "BEND:DMPS:410:B2ICON") { field(DESC, "Convert Desired ICon to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "BEND:DMPS:410:POLYCOEF") field(INPC, "BEND:DMPS:410:POLYCOEF.A") field(INPD, "BEND:DMPS:410:POLYCOEF.B") field(PREC, "7") field(EGU, "GeV/c") field(HOPR, "15.7564") field(LOPR, "0.027") field(MDEL, "-1") field(INPE, "BEND:DMPS:410:BCON.DRVH") field(INPF, "BEND:DMPS:410:BCON.DRVL") field(BRSV, "INVALID") field(FLNK, "BEND:DMPS:410: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, "BEND:DMPS:410:BSTEP") { field(DESC, "B-Field step size") field(CALC, "(C==3)||(D==3)?0:ABS(A-B)*0.005") field(INPA, "BEND:DMPS:410:BMAX") field(INPB, "BEND:DMPS:410:BMIN") field(INPC, "BEND:DMPS:410:BMIN.SEVR") field(INPD, "BEND:DMPS:410:BMAX.SEVR") field(EGU, "GeV/c") 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,"BEND:DMPS:410:BCTRLDISABLECALC") { field(DESC, "Calc for disabling BCTRL") field(ASG, "Internal") field(CALC, "A?2:1") field(INPA, "BEND:DMPS:410:ONLINE CP") field(OUT, "BEND:DMPS:410:BCTRLDISABLEFOUT PP") } record(fanout, "BEND:DMPS:410:BCTRLDISABLEFOUT") { field(DESC, "Disable BCTRL fanout") field(SELM, "Specified") field(SELL, "BEND:DMPS:410:BCTRLDISABLECALC") field(LNK1, "BEND:DMPS:410:BCTRLDISABLE") field(LNK2, "BEND:DMPS:410:BCTRLENABLE") } record(stringout, "BEND:DMPS:410:BCTRLDISABLE") { field(DESC, "Disable BCTRL") field(DTYP, "Soft Channel") field(OUT, "BEND:DMPS:410:BCTRL.ASG") field(VAL, "NOWRITE") field(FLNK, "BEND:DMPS:410:BCTRLDISV_UPDATE") } record(stringout, "BEND:DMPS:410:BCTRLENABLE") { field(DESC, "Enable BCTRL") field(DTYP, "Soft Channel") field(OUT, "BEND:DMPS:410:BCTRL.ASG") field(VAL, "") field(FLNK, "BEND:DMPS:410:BCTRLDISV_UPDATE") } record(calcout, "BEND:DMPS:410:BCTRLDISV_UPDATE") { field(DESC, "Calc for updating BCTRL.DISV") field(ASG, "Internal") field(CALC, "A") field(INPA, "BEND:DMPS:410:ONLINE") field(OUT, "BEND:DMPS:410: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,"BEND:DMPS:410:BACT and MON\n are processed via links from \n BEND:DMPS:410:IACT (device raw value readback 1)\n and\n BEND:DMPS:410: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 BEND:DMPS:410:POLYCOEF\nC = First polynomial coefficient (offset if linear)\nD = Second polynomial coefficient (slope if linear)\nE = BEND:DMPS:410: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,"BEND:DMPS:410:BDES\n is processed when set by CA users or \n BEND:DMPS:410: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,"BEND:DMPS:410: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 BEND:DMPS:410: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 (BEND:DMPS:410: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,"BEND:DMPS:410:B*LIMITS and BEND:DMPS:410:BLIMITS:\n Calculate alarm and warning limits based on \n deltas from BEND:DMPS:410: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,"BEND:DMPS:410: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,"BEND:DMPS:410: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, "BEND:DMPS:410: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, "BEND:DMPS:410:MPSBTOL") { field(DESC, "Absolute mps tol") field(EGU, "GeV/c") field(PREC, "2") field(CALC, "ABS(A)*0.02") field(INPA, "BEND:DMPS:410:BMAX") field(PINI, "YES") } # # 21-Aug-2013: K. Luchini # Set channel access security so that users # cannot easily change values. record(ao, "BEND:DMPS:410:MPSBMAX") { field(DESC, "MPS Max B-field") field(EGU, "GeV/c") field(PREC, "7") field(DRVH, "15.7564") field(DRVL, "0.027") field(PINI, "YES") field(VAL, "15.7564") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "BEND:DMPS:410:MPSBMIN") { field(DESC, "MPS Min B-field") field(EGU, "GeV/c") field(PREC, "7") field(DRVH, "15.7564") field(DRVL, "0.027") field(PINI, "YES") field(VAL, "0.027") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "BEND:DMPS:410:MPSBLLIM") { field(DESC, "MPS Low Limit B-field") field(EGU, "GeV/c") field(PREC, "7") field(DRVH, "15.7564") field(DRVL, "0.027") field(PINI, "YES") field(VAL, "0.027") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "BEND:DMPS:410:MPSBLLIM2") { field(DESC, "MPS Low Limit #2 B-field") field(EGU, "GeV/c") field(PREC, "7") field(DRVH, "15.7564") field(DRVL, "0.027") field(PINI, "YES") field(VAL, "0.027") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } # Set the default to Std record(mbbo, "BEND:DMPS:410: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, "BEND:DMPS:410:MPSLIMITS.E PP") } record(aSub, "BEND:DMPS:410: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, "BEND:DMPS:410:MPS.RVAL") field(INPB, "BEND:DMPS:410:BADIFF") field(INPC, "BEND:DMPS:410:BDELTAS.N") field(INPD, "BEND:DMPS:410:BACT") field(INPE, "BEND:DMPS:410:MPSBITMASK.RVAL") field(INPF, "BEND:DMPS:410:MPSBLLIM") field(INPG, "BEND:DMPS:410:MPSBMIN") field(INPH, "BEND:DMPS:410:MPSBMAX") field(INPI, "BEND:DMPS:410: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, "BEND:DMPS:410:INTOL.RVAL PP") field(OUTB, "BEND:DMPS:410:INTOL_BMIN.RVAL PP") field(OUTC, "BEND:DMPS:410:INTOL_BRANGE.RVAL PP") field(OUTD, "BEND:DMPS:410: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, "BEND:DMPS:410:INTOL") { field(DESC, "BACT within MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "BEND:DMPS:410:MPSLIMITS.VALA") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "BEND:DMPS:410:INTOL_BMIN") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "BEND:DMPS:410:MPSLIMITS.VALB") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "BEND:DMPS:410:INTOL_BMIN2") { field(DESC, "MPS tol #2") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "BEND:DMPS:410:MPSLIMITS.VALD") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "BEND:DMPS:410:INTOL_BRANGE") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "BEND:DMPS:410: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, "BEND:DMPS:410:CHCKITOL") { field(DESC, "Absolute Check I Tolerance") field(EGU, "A") field(FLNK, "BEND:DMPS:410:TRIMITOL") field(CALC, "ABS(A*B)") field(INPA, "BEND:DMPS:410:CHCKBTOL") field(INPB, "BEND:DMPS:410:POLYCOEF.B") field(PREC, "9") } record(calc, "BEND:DMPS:410:TRIMBTOL") { field(EGU, "GeV/c") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(DESC, "Absolute Trim Tolerance") field(CALC, "ABS(A)/2") field(INPA, "BEND:DMPS:410:CHCKBTOL") field(FLNK, "BEND:DMPS:410:CHCKITOL") } record(calc, "BEND:DMPS:410:CHCKBTOL") { field(DESC, "Check absolute tolerance") field(EGU, "A") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(FLNK, "BEND:DMPS:410:TRIMBTOL") field(CALC, "MAX(ABS(A),ABS(C))*(B/1000000)") field(INPA, "BEND:DMPS:410:BDES.HOPR") field(INPB, "BEND:DMPS:410:STABILITY") field(INPC, "BEND:DMPS:410:BDES.LOPR") } record(longout, "BEND:DMPS:410: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, "BEND:DMPS:410:CHCKBTOL") } record(calc, "BEND:DMPS:410:TRIMITOL") { field(DESC, "Absolute Trim I Tolerance") field(EGU, "GeV/c") field(CALC, "ABS(A*B)") field(INPA, "BEND:DMPS:410:POLYCOEF.B") field(INPB, "BEND:DMPS:410:TRIMBTOL") field(PREC, "9") } record(ai, "BEND:DMPS:410:TRIMBTOLR") { field(DESC, "Relative trim tol") field(PREC, "4") field(EGU, "%") field(HOPR, "1.0") field(LOPR, "0.0") field(PINI, "YES") } record(ai, "BEND:DMPS:410: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, "BEND:DMPS:410:FBCKFCOM") { field(ZNAM, "CA") field(ONAM, "FCOM") field(DESC, "CA Mode") field(PINI, "YES") field(SDIS, "0") } record(bo, "BEND:DMPS:410:PAU") { field(ZNAM, "NotConfigured") field(ONAM, "Configured") field(DESC, "PAU Present") field(PINI, "YES") field(SDIS, "0") field(FLNK, "BEND:DMPS:410:PAUGO") } record(fanout, "BEND:DMPS:410:PAUGO") { field(DESC, "PAU control") field(LNK1, "BEND:DMPS:410:PAUSTOP") field(LNK2, "BEND:DMPS:410: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, "BEND:DMPS:410:PAUSTART") { field(DESC, "Setup for PAU On") field(SDIS, "BEND:DMPS:410: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, "BEND:DMPS:410:PAUSTOP") { field(DESC, "Setup for PAU Off") field(SDIS, "BEND:DMPS:410: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, "BEND:DMPS:410:MCORDEVNAME") { field(DESC, "PS device name") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, "BEND:DMPS:400:") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "BEND:DMPS:410: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, "BEND:DMPS:410:PSTYPE.RVAL") field(INPC, "BEND:DMPS:410:TURNEDOFF.RVAL") field(INPD, "BEND:DMPS:410:CONFIG.RVAL") field(INPE, "BEND:DMPS:410:PSCATEGORY.RVAL") field(INPF, "BEND:DMPS:410:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "BEND:DMPS:410:AUTOCTRL.RVAL") field(INPJ, "BEND:DMPS:410:OUTOFSERVICE.RVAL") field(INPL, "BEND:DMPS:410:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "BEND:DMPS:410:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "BEND:DMPS:410:PAU") field(INPP, "BEND:DMPS:410:CALBDISABLE.RVAL") field(INPQ, "BEND:DMPS:410:PTRBDISABLE.RVAL") field(INPR, "BEND:DMPS:410:TRIMDISABLE.RVAL") field(INPS, "BEND:DMPS:410:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "BEND:DMPS:410:FBCK") field(INPU, "BEND:DMPS:410:TRIMTYPE.RVAL") field(INPV, "BEND:DMPS:410:STDZDIRECT.RVAL") field(INPW, "BEND:DMPS:410:DEGAUSENABLE.RVAL") field(FLNK, "BEND:DMPS:410:HSTA") } record(longin, "BEND:DMPS:410:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "BEND:DMPS:410:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "BEND:DMPS:410: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, "BEND:DMPS:410: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, "BEND:DMPS:410: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, "BEND:DMPS:410: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, "BEND:DMPS:410: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, "BEND:DMPS:410: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 BEND:DMPS:410:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses BEND:DMPS:410:FBCK. # This PV should be replaced by BEND:DMPS:410: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, "BEND:DMPS:410: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, "BEND:DMPS:410: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, "BEND:DMPS:410: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, "BEND:DMPS:400:OUTOFSERVICE CPP NMS") field(OMSL, "closed_loop") field(FLNK, "BEND:DMPS:410:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"BEND:DMPS:410:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "BEND:DMPS:410:OUTOFSERVICE NPP NMS") field(OUT, "BEND:DMPS:410:ONLINE PP") } record(bo, "BEND:DMPS:410:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "BEND:DMPS:410: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, "BEND:DMPS:410: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, "BEND:DMPS:410: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, "BEND:DMPS:410: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, "BEND:DMPS:410: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, "BEND:DMPS:410: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, "BEND:DMPS:410: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, "BEND:DMPS:410: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, "BEND:DMPS:410: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, "BEND:DMPS:410: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, "BEND:DMPS:410: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, "BEND:DMPS:410:TRIMTYPE") } record(stringout, "BEND:DMPS:410:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "BEND:DMPS:400:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "BEND:DMPS:410:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "BEND:DMPS:410:STATE.RVAL") field(INPB, "BEND:DMPS:410:INTLKSUMY.RVAL") field(OUT, "BEND:DMPS:410:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "BEND:DMPS:410: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, "BEND:DMPS:410:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "BEND:DMPS:410:STATE.RVAL") field(INPB, "BEND:DMPS:410:INTLKSUMY.RVAL") field(OUT, "BEND:DMPS:410:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "BEND:DMPS:410:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "BEND:DMPS:410:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "BEND:DMPS:410: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, "BEND:DMPS:410: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, "BEND:DMPS:410: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, "BEND:DMPS:410: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,"BEND:DMPS:410: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("BEND:DMPS:410:TURNEDOFF",3140,1907,0,1,"BEND:DMPS:410:TURNEDOFF") #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "BEND:DMPS:410:STATSUB") { field(DESC, "Build STATus ") field(INAM, "mgntInit") field(SNAM, "mgntSlcStat") field(INPA, "BEND:DMPS:410:BACT.STAT") field(INPB, "BEND:DMPS:410:BDES.STAT") field(INPC, "BEND:DMPS:410: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, "BEND:DMPS:410:BACT.SEVR") field(INPH, "BEND:DMPS:410:BDES.SEVR") field(INPI, "BEND:DMPS:410: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, "BEND:DMPS:410:STATE.RVAL") field(INPN, "BEND:DMPS:410:STDZOK") field(INPO, "BEND:DMPS:410:CALBOK") field(INPP, "BEND:DMPS:410:OUTOFSERVICE.RVAL") field(INPQ, "BEND:DMPS:410:CONFIG.RVAL") field(INPR, "BEND:DMPS:410:HSTA") field(INPS, "BEND:DMPS:410:CTRL.RVAL") field(INPT, "BEND:DMPS:410:DEGAUSOK") field(INPV, "BEND:DMPS:410: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, "BEND:DMPS:410:STAT") } record(longout, "BEND:DMPS:410:STAT") { field(DESC, "STAT sent to SLC") field(SCAN, "Passive") field(FLNK, "BEND:DMPS:410:STATCTRLSUB") field(DOL, "BEND:DMPS:410:STATSUB.VAL") field(OMSL, "closed_loop") } record(sSub, "BEND:DMPS:410:STATCTRLSUB") { field(DESC, "Decode SLC STAT into mbbo") field(INAM, "mgntInit") field(SNAM, "mgntStatDecode") field(INPA, "BEND:DMPS:410:STAT") field(INPB, "BEND:DMPS:410:HSTA") field(INPD, "BEND:DMPS:410:ONOFFCTRL.RVAL") field(FLNK, "BEND:DMPS:410:STATMSG") } record(mbbo, "BEND:DMPS:410: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, "BEND:DMPS:410:UNAVAILGO") field(DOL, "BEND:DMPS:410:STATCTRLSUB.W") } record(seq, "BEND:DMPS:410:UNAVAILGO") { field(DESC, "Process UNAVAIL") field(DOL1, "BEND:DMPS:410:STATSUB.U") field(LNK1, "BEND:DMPS:410:UNAVAIL PP") } record(stringout, "BEND:DMPS:410:SNLSTATMSG") { field(DTYP, "Soft Channel") } #! TextBox(TB0,820,1000,1200,1220,0,"Dialog",12,1,16777215,"BEND:DMPS:410:STATUSSUB - future\nOverall device status - takes input from action snls, record sevrs, master snl(s) and outputs final status\n\nInputs:\nA - BEND:DMPS:410:CTRLSTATUS - snl status\nB - MGNT:CTRLSTATUS - master list status\nC\nD - BEND:DMPS:410: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,"BEND:DMPS:410STATSUB\nformat control bo's into slc STAT\n\nInputs:\nA - BEND:DMPS:410:STATUS\nC - BEND:DMPS:410:ON\nD - BEND:DMPS:410:STDZOK\nE - BEND:DMPS:410:CALBOK\nF - BEND:DMPS:410:BACTDRIFT (future)\nG -\nH- BEND:DMPS:410:DACSTATUS\nI -BEND:DMPS:410:ADCSTATUS\nJ - BEND:DMPS:410:BACTSTATUS\nK - BEND:DMPS:410:BDESSTATUS\nL - BEND:DMPS:410:RIPLSTATUS\n\nOutput:\nP - BEND:DMPS:410: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, "BEND:DMPS:410: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, "BEND:DMPS:410: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, "BEND:DMPS:410: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, "BEND:DMPS:410: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 b-field of a slave with out a powered trim coil # equal to the main desired current and pass backwards # through the IVB poly. record(sub, "BEND:DMPS:410:IDES2BDES") { field(DESC, "Cal BDES") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "BEND:DMPS:410:IDES2BDES") field(INPB, "BEND:DMPS:410:POLYCOEF") field(INPC, "BEND:DMPS:410:POLYCOEF.A") field(INPD, "BEND:DMPS:410:POLYCOEF.B") field(INPE, "BEND:DMPS:400:IDES CP MS") field(INPF, "BEND:DMPS:400:BDELTAS PP") field(INPG, "100") field(EGU, "GeV/c") field(HOPR, "15.7564") field(LOPR, "0.027") field(HIHI, "15.7564") field(LOLO, "0.027") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "15.7564") field(LOW, "0.027") field(FLNK, "BEND:DMPS:410:BDES") } # Calcuate the bcon of a slave using # the main desired current and pass backwards # through the IVB poly. # the trim b-field is acutally amps. record(sub, "BEND:DMPS:410:ICON2BCON") { field(DESC, "Cal BCON") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "BEND:DMPS:410:ICON2BCON") field(INPB, "BEND:DMPS:410:POLYCOEF") field(INPC, "BEND:DMPS:410:POLYCOEF.A") field(INPD, "BEND:DMPS:410:POLYCOEF.B") field(INPE, "BEND:DMPS:400:ICON CP NMS") field(INPF, "BEND:DMPS:400:BDELTAS PP") field(INPG, "100") field(EGU, "GeV/c") field(HOPR, "15.7564") field(LOPR, "0.027") field(HIHI, "15.7564") field(LOLO, "0.027") field(PREC, "7") field(BRSV, "INVALID") # Set MINOR alarms for main as the default, slaves will set NO_ALARM field(HHSV, "NO_ALARM") field(HSV, "NO_ALARM") field(LSV, "NO_ALARM") field(LLSV, "NO_ALARM") field(HIGH, "15.7564") field(LOW, "0.027") field(FLNK, "BEND:DMPS:410:BCON") }#! 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, "BEND:DMPS:420:IACT") { field(DESC, "Current") field(INP, "BEND:DMPS:400:IACT CP NMS") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "BEND:DMPS:420:BACT") info(autosaveFields,"HYST") } record(bi, "BEND:DMPS:420:STATE") { field(DESC, "PS On/Off Status") field(DTYP, "Raw Soft Channel") field(INP, "BEND:DMPS:400:STATE CP MS") field(ZSV, "MAJOR") field(ZNAM, "OFF") field(ONAM, "ON") } record(ao, "BEND:DMPS:420:IDES") { field(DESC, "Desired Current") field(PREC, "3") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(MDEL, "-1") field(HIHI, "200.0") field(LOLO, "0.0") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "BEND:DMPS:420:BDELTAS") field(DRVH, "200.0") field(DRVL, "0.0") field(DOL, "BEND:DMPS:420: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, "BEND:DMPS:420:ICTRL PP") } # This record is processed by BEND:DMPS:420:ICON") # Note: we are not setting alarms here. record(ao, "BEND:DMPS:420:ICON") { field(DESC, "Config I") field(DTYP, "Soft Channel") field(PREC, "3") field(HOPR, "200.0") field(LOPR, "0.0") field(DRVH, "200.0") field(DRVL, "0.0") field(DOL, "BEND:DMPS:420:B2ICON.K") field(OMSL, "closed_loop") info(autosaveFields,"VAL") } record(ao, "BEND:DMPS:420:INOM") { field(DESC, "Nominal Current") field(DOL, "BEND:DMPS:420:BNOM.K") field(OMSL, "closed_loop") field(PREC, "3") field(EGU, "A") field(DRVH, "200.0") field(DRVL, "0.0") field(HOPR, "200.0") field(LOPR, "0.0") } record(ao, "BEND:DMPS:420:ICTRL") { field(DESC, "Set Current") field(PREC, "3") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(DRVH, "200.0") field(DRVL, "0.0") field(MDEL, "-1") field(FLNK, "BEND:DMPS:420:ICTRLGO") field(OMSL, "supervisory") info(autosavefields,"VAL") } record(seq, "BEND:DMPS:420:ICTRLGO") { field(DESC, "Process Current Setpoint") field(PREC, "3") # Set ISETPT to supervisory field(DOL1, "0") field(LNK1, "BEND:DMPS:420:ISETPT.OMSL") field(DOL2, "BEND:DMPS:420:ICTRL") field(LNK2, "BEND:DMPS:420:ISETPT PP") # Set ISETPT to closed loop - get data from BCTRLSUB.K field(DOL3, "1") field(LNK3, "BEND:DMPS:420:ISETPT.OMSL") } record(ao, "BEND:DMPS:420:IMAX") { field(DESC, "Max I") field(DTYP, "Soft Channel") field(DRVH, "200.0") field(DRVL, "0.0") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(PREC, "3") field(PINI, "YES") field(VAL, "200.0") field(FLNK, "BEND:DMPS:420:IMIN") } record(ao, "BEND:DMPS:420:IMIN") { field(DESC, "Min I") field(DTYP, "Soft Channel") field(DRVH, "200.0") field(DRVL, "0.0") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(PREC, "3") field(VAL, "0.0") field(FLNK, "BEND:DMPS:420:IRANGE") } record(sel, "BEND:DMPS:420:IACTPREVOK") { field(DESC, "Last Good Current") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(PREC, "3") field(NVL, "BEND:DMPS:420:BACT.SEVR") field(INPA, "BEND:DMPS:420:IACT NPP MS") field(INPB, "BEND:DMPS:420:IACTPREVOK NPP MS") field(INPC, "BEND:DMPS:420:IACTPREVOK NPP MS") field(INPD, "BEND:DMPS:420:IACTPREVOK NPP MS") } record(sub, "BEND:DMPS:420:IACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "BEND:DMPS:420:IDES") field(INPB, "BEND:DMPS:420:ISETPT.DRVH") field(INPC, "BEND:DMPS:420:ISETPT.DRVL") field(INPD, "BEND:DMPS:420:IDELTAS.I") field(INPE, "BEND:DMPS:420:IDELTAS.J") field(INPG, "BEND:DMPS:420:STATE") field(INPH, "BEND:DMPS:420:HSTA") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(sub, "BEND:DMPS:420:IMONLIMITS") { field(DESC, "Aux Current Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "BEND:DMPS:420:IDES") field(INPB, "BEND:DMPS:420:ISETPT.DRVH") field(INPC, "BEND:DMPS:420:ISETPT.DRVL") field(INPD, "BEND:DMPS:420:IDELTAS.K") field(INPE, "BEND:DMPS:420:IDELTAS.L") field(INPG, "BEND:DMPS:420:STATE") field(INPH, "BEND:DMPS:420:HSTA") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(seq, "BEND:DMPS:420:ILIMITS") { field(DESC, "Set ACT and MON Limits") field(PREC, "3") field(DOL1, "BEND:DMPS:420:BLIMITS") field(LNK1, "BEND:DMPS:420:IACTLIMITS.F PP") field(DOL2, "BEND:DMPS:420:IACTLIMITS.I") field(LNK2, "BEND:DMPS:420:IACT.HIGH") field(DOL3, "BEND:DMPS:420:IACTLIMITS.J") field(LNK3, "BEND:DMPS:420:IACT.LOW") field(DOL4, "BEND:DMPS:420:IACTLIMITS.K") field(LNK4, "BEND:DMPS:420:IACT.HIHI") field(DOL5, "BEND:DMPS:420:IACTLIMITS.L") field(LNK5, "BEND:DMPS:420:IACT.LOLO") field(DOL6, "BEND:DMPS:420:BLIMITS") field(LNK6, "BEND:DMPS:420:IMONLIMITS.F PP") field(DOL7, "BEND:DMPS:420:IMONLIMITS.I") field(LNK7, "BEND:DMPS:420:IMON.HIGH") field(DOL8, "BEND:DMPS:420:IMONLIMITS.J") field(LNK8, "BEND:DMPS:420:IMON.LOW") field(DOL9, "BEND:DMPS:420:IMONLIMITS.K") field(LNK9, "BEND:DMPS:420:IMON.HIHI") field(DOLA, "BEND:DMPS:420:IMONLIMITS.L") field(LNKA, "BEND:DMPS:420: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, "BEND:DMPS:420:IDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntRawDeltas") field(INPD, "BEND:DMPS:420:TRIMBTOL") field(INPE, "BEND:DMPS:420:CHCKBTOL") field(INPF, "BEND:DMPS:420:BDELTAS.K") field(INPG, "BEND:DMPS:420:BDELTAS.L") field(INPH, "BEND:DMPS:420: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, "BEND:DMPS:420:STDZITOLR") field(INPC, "BEND:DMPS:420:STDZITOL") field(FLNK, "") } # All ps controllers with on/off control will set the macro ONOF # as follows: # # ONOF = BEND:DMPS:400: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, "BEND:DMPS:420: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 = BEND:DMPS:400:RESET PP # record(bo, "BEND:DMPS:420: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, "BEND:DMPS:420:RAMPSTATE") { field(DESC, "PS Ramp Status") field(DTYP, "Soft Channel") field(DOL, "BEND:DMPS:400: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, "BEND:DMPS:420: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, "BEND:DMPS:420:TRIMRAMPRATE") field(OUT, "") field(FLNK, "BEND:DMPS:420:STDZDLY") } record(ao, "BEND:DMPS:420:ISETPT") { field(DESC, "Current Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(DRVH, "200.0") field(DRVL, "0.0") field(MDEL, "-1") field(OUT, "") field(DOL, "BEND:DMPS:420: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, "BEND:DMPS:420:IMON") { field(DESC, "Aux Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(INP, "BEND:DMPS:400:IMON CP NMS") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "BEND:DMPS:420:BMON") } record(ao, "BEND:DMPS:420:IRIPL") { field(DESC, "Ripple Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(DOL, "BEND:DMPS:400:IRIPL CP NMS") field(OMSL, "closed_loop") field(EGU, "A") field(DRVH, "1.0") field(HOPR, "1.0") field(PREC, "3") field(FLNK, "BEND:DMPS:420:IRIPLOK") } record(sub, "BEND:DMPS:420:IRIPLOK") { field(DESC, "Ripple Current Status") field(INAM, "mgntInit") field(SNAM, "mgntRiplOK") field(INPA, "BEND:DMPS:420:IRIPL.VAL") field(INPB, "BEND:DMPS:420: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, "BEND:DMPS:420:R") { field(DESC, "Resistance") field(EGU, "Ohms") field(PREC, "4") field(PINI, "YES") field(DOL, "BEND:DMPS:400: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, "BEND:DMPS:420:IGND") { field(DESC, "Ground Current") field(EGU, "A") field(PREC, "6") field(PINI, "YES") field(DOL, "BEND:DMPS:400:IGND CP MS") field(OMSL, "closed_loop") } record(bi, "BEND:DMPS:420:INTLKSUMY") { field(DESC, "Interlock Summary") field(INP, "BEND:DMPS:400:INTLKSUMY CP MS") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(ZNAM, "OK") field(ONAM, "FAULT") field(PINI, "NO") } record(mbbo, "BEND:DMPS:420: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, "BEND:DMPS:400:COOLING CP NMS") field(OMSL, "closed_loop") } # The following PV is processed by :BACTFO # which is processed by :BACT record(fanout, "BEND:DMPS:420:IACTFO") { field(DESC, "IACT processing") field(SELM, "All") field(LNK1, "BEND:DMPS:420:IACTPREVOK") field(LNK2, "BEND:DMPS:420:IDIFF") field(LNK3, "BEND:DMPS:420:IADIFF") field(LNK4, "BEND:DMPS:420:IRATIO") field(LNK5, "BEND:DMPS:420:IDIRECT") field(LNK6, "BEND:DMPS:420:IACTPOL_CHECK") } record(calc, "BEND:DMPS:420:IDIFF") { field(DESC, "IDES-IACT") field(CALC, "A-B") field(INPA, "BEND:DMPS:420:IDES") field(INPB, "BEND:DMPS:420:IACT") field(EGU, "A") field(PREC, "9") field(HOPR, "200.0") field(LOPR, "0.0") } record(calc, "BEND:DMPS:420:IADIFF") { field(DESC, "Absolute IDES-IACT") field(CALC, "A<0?ABS(A):A") field(INPA, "BEND:DMPS:420:IDIFF") field(PREC, "9") } record(calc, "BEND:DMPS:420:IRATIO") { field(DESC, "IDES-IACT/IMAX") field(CALC, "B?A/B:0") field(INPA, "BEND:DMPS:420:IDIFF") field(INPB, "BEND:DMPS:420:IDES.DRVH") field(PREC, "9") } record(calcout, "BEND:DMPS:420:IRANGE") { field(DESC, "Current Range") field(PINI, "YES") field(CALC, "ABS(A-B)") field(INPA, "BEND:DMPS:420:IMIN") field(INPB, "BEND:DMPS:420: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, "BEND:DMPS:420: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, "BEND:DMPS:420:IACT") field(FLNK, "BEND:DMPS:420:IACTPOL") } record(bo, "BEND:DMPS:420:IACTPOL") { field(DESC, "Actual I Polarity") field(DTYP, "Raw Soft Channel") field(DOL, "BEND:DMPS:420: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,"BEND:DMPS:420:I*LIMITS:\n Calculate alarm and warning limits based on \n deltas from BEND:DMPS:420:IDELTAS and the\n BEND:DMPS:420: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,"BEND:DMPS:420:IACT: \n Get copy of BEND:DMPS:420:I. \n",null) #! TextBox(TB12,1280,3100,1760,3200,0,"Dialog",12,1,16777215,"BEND:DMPS:420: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,"BEND:DMPS:420:IDES:\n Contains raw value calculated by \nBEND:DMPS:420: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 \nBEND:DMPS:420:BDELTAS.\n",null) #! TextBox(TB10,56,1940,316,2340,0,"Dialog",12,1,16777215,"BEND:DMPS:420: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 BEND:DMPS:420: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 BEND:DMPS:420: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,"BEND:DMPS:420:ISETPT:\n Sets the hardware. When fast feedback is set on, this record is\n set to closed loop mode by BEND:DMPS:420:FBCKSTART sequence. When \n the loop is closed, this record takes input calculated by \n BFBCK only. When fast feedback is set off, BEND:DMPS:420:FBCKSTOP \n will set it back to supervisory so that the value can be set by \n BEND:DMPS:420: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, "BEND:DMPS:420:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "BEND:DMPS:420:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "BEND:DMPS:420:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "BEND:DMPS:420:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "BEND:DMPS:420:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "BEND:DMPS:420:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "1") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "BEND:DMPS:420: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, "BEND:DMPS:420:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "BEND:DMPS:420:TRIMTYPE.RVAL") field(INPB, "BEND:DMPS:420:CONFIG.RVAL") field(OUT, "BEND:DMPS:420:TRIMMAXNUM PP") } record(longout, "BEND:DMPS:420: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, "BEND:DMPS:420: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, "BEND:DMPS:400:TRIMRAMPRATE CP NMS") field(OMSL, "closed_loop") field(VAL, "") field(OUT, "BEND:DMPS:420:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "BEND:DMPS:420: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, "BEND:DMPS:400:TRIMSETL CP NMS") field(OMSL, "closed_loop") field(VAL, "") } record(bo, "BEND:DMPS:420: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, "BEND:DMPS:420: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, "BEND:DMPS:420: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, "0") } record(bo, "BEND:DMPS:420:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "0") } record(ao, "BEND:DMPS:420: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, "BEND:DMPS:420:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "BEND:DMPS:420: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, "BEND:DMPS:420: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, "BEND:DMPS:420:IMOVE") field(INPB, "BEND:DMPS:420:IACT") field(INPC, "BEND:DMPS:420:IRAMPRATE") field(INPD, "1.0") field(INPE, "BEND:DMPS:420:TRIMDLYPCT") field(INPF, "BEND:DMPS:420:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "BEND:DMPS:420:RAMPTIME_LEFT PP") } record(longout, "BEND:DMPS:420:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "BEND:DMPS:420:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "BEND:DMPS:420:RAMPDONE_CALC") } record(calc, "BEND:DMPS:420:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "BEND:DMPS:420:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "BEND:DMPS:420:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "BEND:DMPS:420: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, "BEND:DMPS:420:RAMPTIME_LEFT") field(OUT, "BEND:DMPS:420:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "BEND:DMPS:420:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "BEND:DMPS:420:RAMPTIME_LEFT NMS") field(OUT, "BEND:DMPS:420:RAMPDONE PP") } record(bo, "BEND:DMPS:420:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "BEND:DMPS:420:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "BEND:DMPS:420: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, "BEND:DMPS:420: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, "BEND:DMPS:420:STDZINIT") { field(DESC, "Proc. Stdz PVs on boot") field(PINI, "YES") field(DOL1, "1") field(DOL2, "1") field(DOL3, "1") field(LNK1, "BEND:DMPS:420:DEBUG.PROC PP") field(LNK2, "BEND:DMPS:420:STDZCYCLENUM.PROC PP") field(LNK3, "BEND:DMPS:420:STDZDISABLE.PROC PP") field(LNK4, "BEND:DMPS:420: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, "BEND:DMPS:420:STDZSUB") { field(DESC, "Stdz subroutine") field(INAM, "mgntStdzInit") field(SNAM, "mgntStdz") field(BRSV, "INVALID") field(INPA, "BEND:DMPS:420:STDZIMIN NPP NMS") field(INPB, "BEND:DMPS:420:STDZIMAX NPP NMS") field(INPC, "BEND:DMPS:420:STDZIFINAL NPP NMS") field(INPD, "BEND:DMPS:420:STDZCYCLENUM NPP NMS") field(INPE, "BEND:DMPS:420:STDZDIRECT.RVAL NPP NMS") field(INPF, "BEND:DMPS:420:STDZDISABLE.RVAL CPP NMS") field(INPG, "BEND:DMPS:420: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, "BEND:DMPS:420:STDZWF PP") field(OUTB, "BEND:DMPS:420: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, "BEND:DMPS:420:STDZWF") } record(mbbo, "BEND:DMPS:420: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, "BEND:DMPS:420: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, "BEND:DMPS:420:STDZMAINPS") { field(DESC, "Stdz by main or self") field(PINI, "YES") field(DTYP, "Soft Channel") field(ZNAM, "SELF") field(ONAM, "MAIN") } record(bo, "BEND:DMPS:420: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, "BEND:DMPS:420: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, "BEND:DMPS:420: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, "BEND:DMPS:420:STDZTOD") { field(DESC, "Successful Standardize Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "BEND:DMPS:420:STDZLOSTTOD") { field(DESC, "Standardize Lost Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(longout, "BEND:DMPS:420:STDZCYCLECNT") { field(DESC, "Cycle Count") field(PINI, "YES") } record(longout, "BEND:DMPS:420: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, "BEND:DMPS:420:STDZDIRECT") } # The default standardize direction is "UP" for # all LCLS Magnets.. record(bo, "BEND:DMPS:420:STDZDIRECT") { field(DESC, "Standardize Direction ") field(ZNAM, "UP") field(ONAM, "DOWN") field(VAL, "0") field(FLNK, "BEND:DMPS:420:STDZIMIN") } record(ao, "BEND:DMPS:420:STDZIMIN") { field(DESC, "Min-STDZ Current") field(PREC, "1") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(VAL, "0.0") field(FLNK, "BEND:DMPS:420:STDZIMAX") } record(ao, "BEND:DMPS:420:STDZIMAX") { field(DESC, "Max. Standarize Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(VAL, "200.0") field(FLNK, "BEND:DMPS:420:STDZIFINAL") } record(ao, "BEND:DMPS:420:STDZIFINAL") { field(DESC, "Final SDTZ Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(VAL, "0.0") field(FLNK, "BEND:DMPS:420: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, "BEND:DMPS:420: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, "BEND:DMPS:420:STDZITOL") { field(DESC, "Stdz min tolerance") field(PREC, "5") field(CALC, "MAX(ABS(A),ABS(B))*C") field(INPA, "BEND:DMPS:420:STDZIMIN CP NMS") field(INPB, "BEND:DMPS:420:STDZIMAX CP MMS") field(INPC, "0.05") field(INPD, "BEND:DMPS:420:STDZITOLR CP MMS") field(EGU, "A") field(FLNK, "BEND:DMPS:420:IDELTAS") field(PINI, "YES") } # D - factor (3.154/2 = 1.577) for EPSC, otherwise, set to 1.0 record(calc, "BEND:DMPS:420:STDZDLY") { field(DESC, "Ramp time for stdz cycle") field(CALC, "C>0?MAX(1,ABS((A-B)/C)*D):0") field(INPA, "BEND:DMPS:420:STDZIMIN CP NMS") field(INPB, "BEND:DMPS:420:STDZIMAX CP NMS") field(INPC, "BEND:DMPS:420:TRIMRAMPRATE CP NMS") field(INPD, "1.0") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") } record(calc, "BEND:DMPS:420:STDZRAMPDLY") { field(DESC, "Ramp delay total") field(CALC, "MAX(1,((A/100)*B+B))") field(PREC, "5") field(INPA, "BEND:DMPS:420:TRIMDLYPCT CP MS") field(INPB, "BEND:DMPS:420: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, "BEND:DMPS:420:STDZMINIDLY") { field(DESC, "Mini-stdz delay") field(CALC, "A") field(PREC, "5") field(A, "1.0") field(EGU, "sec") field(PINI, "YES") } record(ao, "BEND:DMPS:420: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, "BEND:DMPS:420:STDZMINIDELTA") { field(DESC, "Stdz mini % of IMAX") field(CALC, "(B/100)*(A-C)") field(INPA, "BEND:DMPS:420:IDES.HOPR") field(INPB, "BEND:DMPS:420:STDZMINIPCT CPP NMS") field(INPC, "BEND:DMPS:420:IDES.LOPR") field(PREC, "5") } record(calc, "BEND:DMPS:420:STDZMINISETPT") { field(DESC, "Mini Stdz delta") field(CALC, "C==0?MAX(E-D,B):MIN(E+D,A)") field(INPA, "BEND:DMPS:420:IDES.HOPR") field(INPB, "BEND:DMPS:420:IDES.LOPR") field(INPC, "BEND:DMPS:420:STDZDIRECT.RVAL") field(INPD, "BEND:DMPS:420:STDZMINIDELTA") field(INPE, "BEND:DMPS:420:IDES") field(PREC, "5") field(FLNK, "BEND:DMPS:420: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, "BEND:DMPS:420:STDZMINISETPTOOR") { field(DESC, "Mini Stdz setpoint out of range") field(CALC, "C==0?(E-DA)") field(INPA, "BEND:DMPS:420:IDES.HOPR") field(INPB, "BEND:DMPS:420:IDES.LOPR") field(INPC, "BEND:DMPS:420:STDZDIRECT.RVAL") field(INPD, "BEND:DMPS:420:STDZMINIDELTA") field(INPE, "BEND:DMPS:420: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, "BEND:DMPS:420: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, "BEND:DMPS:420:IADJUST.RVAL") field(INPB, "BEND:DMPS:420:STDZDIRECT.RVAL") field(INPC, "BEND:DMPS:420:STDZOK.RVAL") field(INPD, "BEND:DMPS:420:STDZDISABLE.RVAL") field(INPE, "BEND:DMPS:420:STATE.RVAL CPP NMS") field(INPF, "BEND:DMPS:420:ICTRL.RVAL") field(INPG, "BEND:DMPS:420:STATE.SEVR") field(INPH, "BEND:DMPS:420:BDELTAS.M") field(INPI, "BEND:DMPS:420:IACT.SEVR") field(OUT, "BEND:DMPS:420:STDZLOSTGO.SELN PP NMS") field(OOPT, "Transition To Non-zero") } record(seq, "BEND:DMPS:420:STDZLOSTGO") { field(DESC, "Process lost stdz") field(SELM, "Mask") field(DOL1, "1") field(DOL2, "0") field(LNK1, "BEND:DMPS:420:STDZLOSTTOD.PROC") field(LNK2, "BEND:DMPS:420:STDZOK PP") } # Record maximum current after standardize # Reset to IACT from sequence after trim # Disable processing during (mini-)standardize or trim record(calc, "BEND:DMPS:420:STDZIACTMAX") { field(DESC, "Max act current after stdz") field(CALC, "MAX(A, B)") field(DISV, "0") field(SDIS, "BEND:DMPS:420:CHECKPWRDIP_ENABLE") field(INPA, "BEND:DMPS:420:IACT CP") field(INPB, "BEND:DMPS:420:STDZIACTMAX") field(EGU, "A") field(FLNK, "BEND:DMPS:420:CHECKPWRDIP") } # Detect power dip if STDZOK is YES, STDZ is enabled, and IACT is valid # If IACT drops below STDZIACTMAX by more than the trim tolerance, clear STDZOK # Warning: Take the absolute value of the trim tolerance, or else quads of # negative polarity will always lose STDZ since their IDELTAS.I are negative. # Note: Large quads and bends are prone to losing STDZ even if they are # perturbed toward higher current since their current tends to overshoot # by greater than the trim tolerance before settling down. record(calcout, "BEND:DMPS:420:CHECKPWRDIP") { field(DESC, "Detect power dip") field(CALC, "(A-B>ABS(C))?3:0") field(DISV, "0") field(SDIS, "BEND:DMPS:420:CHECKPWRDIP_ENABLE") field(INPA, "BEND:DMPS:420:STDZIACTMAX") field(INPB, "BEND:DMPS:420:IACT") field(INPC, "BEND:DMPS:420:IDELTAS.I") field(OUT, "BEND:DMPS:420:STDZLOSTGO.SELN PP NMS") field(OOPT, "When Non-zero") } # Enable processing of STDZIACTMAX and CHECKPWRDIP only if # STDZOK = YES, STDZDISABLE = NO, CTRL != Trim (2), and # CTRL != Stdz (4) record(calc, "BEND:DMPS:420:CHECKPWRDIP_ENABLE") { field(CALC, "A&&!B&&(C#2)&&(C#4)") field(INPA, "BEND:DMPS:420:STDZOK.RVAL CP") field(INPB, "BEND:DMPS:420:STDZDISABLE.RVAL CP") field(INPC, "BEND:DMPS:420:CTRL.RVAL CP") } #! 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, "BEND:DMPS:420: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, "BEND:DMPS:420: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, "BEND:DMPS:420:CALBSET") { field(DESC, "Use DAC Calbration") field(SCAN, "10 second") field(CALC, "A&&(B==0)&&C?31:960") field(INPA, "BEND:DMPS:420:CALBOK") field(INPB, "BEND:DMPS:420:CALBDISABLE") field(INPC, "BEND:DMPS:420:CALBSLOPE") field(OOPT, "On Change") field(OUT, "BEND:DMPS:420: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, "BEND:DMPS:420:CALB_SEQ") { field(DESC, "Output Calib Values") field(SELM, "Mask") field(SELL, "BEND:DMPS:420: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, "BEND:DMPS:420:CALBSLOPE") field(DOL3, "BEND:DMPS:420: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, "BEND:DMPS:420:CALBTOD") { field(DESC, "Calibration Success Time") field(PINI, "YES") # field(DOL, "") field(OMSL, "supervisory") field(DTYP, "Soft Channel") info(autosaveFields,"VAL") } record(ao, "BEND:DMPS:420: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, "BEND:DMPS:420: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, "BEND:DMPS:420: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, "BEND:DMPS:420:CALBOFFSET") { field(DESC, "Calc DAC Offset") field(PREC, "6") field(EGU, "Counts") field(PINI, "YES") } record(bo, "BEND:DMPS:420: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, "BEND:DMPS:420:DACSLOPE") { field(DESC, "V to DAC slope") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "supervisory") field(PINI, "YES") field(FLNK, "BEND:DMPS:420:DACOFFSET") } # Default Offset used in conversion from Volts to DAC Counts record(ao, "BEND:DMPS:420:DACOFFSET") { field(DESC, "V to DAC offset") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "supervisory") field(PINI, "YES") field(FLNK, "BEND:DMPS:420: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, "BEND:DMPS:420: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, "BEND:DMPS:420:IACT") field(INPD, "BEND:DMPS:420:DACSLOPE") field(INPE, "BEND:DMPS:420:DACOFFSET") field(EGU, "Counts") field(PREC, "6") } record(ao, "BEND:DMPS:420:DAC") { field(DESC, "DAC Set point") field(EGU, "Counts") field(DOL, "") field(OMSL, "supervisory") field(PREC, "6") field(PINI, "YES") } record(ao, "BEND:DMPS:420:CALBIMIN") { field(DESC, "Calibration Min Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(DRVH, "200.0") field(HOPR, "200.0") field(DRVL, "0.0") field(LOPR, "0.0") field(PREC, "3") field(EGU, "A") field(VAL, "0.0") field(FLNK, "BEND:DMPS:420:CALBIMAX") } record(ao, "BEND:DMPS:420:CALBIMAX") { field(DESC, "Calibration Max Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(DRVH, "200.0") field(HOPR, "200.0") field(LOPR, "0.0") field(DRVL, "0.0") field(EGU, "A") field(VAL, "200.0") field(FLNK, "BEND:DMPS:420:CALBSTEPNUM") } record(ao, "BEND:DMPS:420:CALBIFINAL") { field(DESC, "Calibration Last Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(PREC, "3") field(EGU, "A") field(HOPR, "200.0") field(LOPR, "0.0") field(VAL, "0") } record(longout, "BEND:DMPS:420: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, "BEND:DMPS:420:CALBIDELTA") } record(calc, "BEND:DMPS:420:CALBIDELTA") { field(DESC, "Step size for CALB") field(CALC, "C=0?0:ABS((A-B)/C)") field(INPA, "BEND:DMPS:420:CALBIMAX") field(INPB, "BEND:DMPS:420:CALBIMIN") field(INPC, "BEND:DMPS:420: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, "BEND:DMPS:420:CALBIMULT") { field(DESC, "IACT vs ISETPT mult") field(CALC, "C#0||A=0?1:ABS(B/A)") field(INPA, "BEND:DMPS:400:ISETPT.DRVH") field(INPB, "BEND:DMPS:400:IACT.HOPR") field(INPC, "BEND:DMPS:420:PSCONTROLLER.RVAL CPP") field(EGU, "A") field(PINI, "YES") } # SNL dbputs DAC values here. 6-10 steps are possible. record(waveform, "BEND:DMPS:420:CALBICTRLWF") { field(DESC, "ICTRL setpoint array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") } record(waveform, "BEND:DMPS:420:DACWF") { field(DESC, "DAC count array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "BEND:DMPS:420:DACSA") } # Used only for xygraph edm plot record(subArray, "BEND:DMPS:420:DACSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "BEND:DMPS:420: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, "BEND:DMPS:420:CALCDACWF") { field(DESC, "Calc DAC counts array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "BEND:DMPS:420:CALCDACSA") } # Used only for xygraph edm plot record(subArray, "BEND:DMPS:420:CALCDACSA") { field(DESC, "Calc DAC counts") field(DTYP, "Soft Channel") field(INP, "BEND:DMPS:420: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, "BEND:DMPS:420:CALBYWF") { field(DESC, "mx + b") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "BEND:DMPS:420:CALBYSA") } # Used only for xygraph edm plot record(subArray, "BEND:DMPS:420:CALBYSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "BEND:DMPS:420:CALBYWF") field(MALM, "10") field(NELM, "6") field(INDX, "0") field(FTVL, "DOUBLE") } record(waveform, "BEND:DMPS:420:CALBIACTWF") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "BEND:DMPS:420:CALBIACTSA") } # Used only for xygraph edm plot record(subArray, "BEND:DMPS:420:CALBIACTSA") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(MALM, "10") field(NELM, "6") field(INP, "BEND:DMPS:420:CALBIACTWF") field(INDX, "0") field(FTVL, "DOUBLE") field(FLNK, "BEND:DMPS:420:CALBLIMITS") } # Check that measured current during calibration is within # tolerance. record(aSub, "BEND:DMPS:420: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, "BEND:DMPS:420:CALBSTEPNUM") field(INPB, "BEND:DMPS:420:CALBIACTWF") field(INPC, "BEND:DMPS:420: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, "BEND:DMPS:420: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, "BEND:DMPS:420:STDZITOL") field(INPH, "BEND:DMPS:420:DACSLOPE") field(INPI, "BEND:DMPS:420: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, "BEND:DMPS:420: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, "BEND:DMPS:420:CALBSTEPNUM") field(INPB, "BEND:DMPS:420:CALBIACTWF") field(INPC, "BEND:DMPS:420:DACWF") field(INPF, "BEND:DMPS:420: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 BEND:DMPS:420CALBOK 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, "BEND:DMPS:420:DEGAUSINIT") { field(DESC, "Proc. Degauss PVs on boot") field(PINI, "YES") field(DOL, "1") field(OUTA, "BEND:DMPS:420:DEGAUSIMIN.PROC PP") field(OUTB, "BEND:DMPS:420:DEGAUSIMAX.PROC PP") field(OUTC, "BEND:DMPS:420:DEGAUSTYPE.PROC PP") field(OUTD, "BEND:DMPS:420:DEGAUSSTEP.PROC PP") field(OUTE, "BEND:DMPS:420:MADNAME.PROC PP") field(OUTF, "BEND:DMPS:420:PSTYPE.PROC PP") field(OUTG, "BEND:DMPS:420: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, "BEND:DMPS:420:DEGAUSSUB") { field(DESC, "Degauss subroutine") field(INAM, "mgntDegaussInit") field(SNAM, "mgntDegauss") field(BRSV, "INVALID") field(INPA, "BEND:DMPS:420:DEGAUSIMIN NPP NMS") field(INPB, "BEND:DMPS:420:DEGAUSIMAX NPP NMS") field(INPC, "BEND:DMPS:420:DEGAUSTYPE.RVAL NPP NMS") field(INPE, "BEND:DMPS:420:DEGAUSMETHOD.RVAL NPP NMS") field(INPF, "BEND:DMPS:420:PSTYPE NPP NMS") field(INPG, "BEND:DMPS:420:DEBUG.RVAL NPP NMS") field(INPH, "BEND:DMPS:420: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, "BEND:DMPS:420:DEGAUSWF PP") field(OUTB, "BEND:DMPS:420:DEGAUSMSG PP") field(OUTC, "BEND:DMPS:420: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, "BEND:DMPS:420:DEGAUSWF") { field(DESC, "Degauss Setpts") field(NELM, "60") field(FTVL, "DOUBLE") } record(mbbo,"BEND:DMPS:420: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, "BEND:DMPS:420: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, "BEND:DMPS:420: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, "BEND:DMPS:420: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, "BEND:DMPS:420: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, "BEND:DMPS:420:DEGAUSIMIN") { field(DESC, "Min. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "200.0") field(LOPR, "-200.0") field(DRVH, "200.0") field(DRVL, "-200.0") field(VAL, "-200.0") } record(ao, "BEND:DMPS:420:DEGAUSIMAX") { field(DESC, "Max. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "200.0") field(LOPR, "-200.0") field(DRVH, "200.0") field(DRVL, "-200.0") field(VAL, "200.0") } # 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,"BEND:DMPS:420: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, "BEND:DMPS:420: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,"BEND:DMPS:420: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, "BEND:DMPS:420: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, "BEND:DMPS:420: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, "BEND:DMPS:420: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, "BEND:DMPS:420:DEGAUSTOD") { field(DESC, "Successful Degauss Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "BEND:DMPS:420:DEGAUSLOSTTOD") { field(DESC, "Degauss Lost Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "BEND:DMPS:420:DEGAUSTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "BEND:DMPS:420:DEGAUSTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "BEND:DMPS:420: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, "BEND:DMPS:420:DEGAUSGO") { field(DESC, "Set bdes of btrms to zero") field(ASG, "Internal") field(OUTA, "") field(OUTB, "") field(OUTC, "") field(OUTD, "") } # =========== CRYO ONLY =========== record(bo, "BEND:DMPS:420: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, "BEND:DMPS:420:DEGAUS_IMAX_CHECK") { field(DESC, "Check if imax shoud chg") field(CALC, "(C==4)&&(ABS(B)>ABS(A))?1:0") field(INPA, "BEND:DMPS:420:DEGAUS_IMAX") field(INPB, "BEND:DMPS:420:ISETPT") field(INPC, "BEND:DMPS:420:DEGAUSTYPE.RVAL") field(OUT, "BEND:DMPS:420:DEGAUS_IMAX_UPDATE.SELN") field(FLNK, "BEND:DMPS:420:DEGAUS_IMAX_UPDATE") } record(seq, "BEND:DMPS:420:DEGAUS_IMAX_UPDATE") { field(DESC, "Degauss IMAX Update") field(SELM, "Specified") field(DOL1, "BEND:DMPS:420:ISETPT") field(LNK1, "BEND:DMPS:420:DEGAUS_IMAX PP") } # Set the maximum current after a successful # degauss. This pv is updated by the # sequence. record(ao, "BEND:DMPS:420:DEGAUS_IMAX") { field(DESC, "Max I set afer a degauss") field(EGU, "Amps") field(PINI, "YES") field(PREC, "6") field(HOPR, "200.0") field(LOPR, "-200.0") field(DRVH, "200.0") field(DRVL, "-200.0") field(VAL, "200.0") field(FLNK, "BEND:DMPS:420:DEGAUS_IMAXPOL_CHECK") info(autosaveFields,"VAL,RVAL") } # Set the polarity if degauss_imax record(calcout, "BEND:DMPS:420:DEGAUS_IMAXPOL_CHECK") { field(DESC, "Determine polarity of imax") field(CALC, "A>=0?0:1") field(INPA, "BEND:DMPS:420:DEGAUS_IMAX") field(FLNK, "BEND:DMPS:420:DEGAUS_IMAXPOL") } record(bo, "BEND:DMPS:420:DEGAUS_IMAXPOL") { field(DESC, "Polarity of imax I") field(DTYP, "Raw Soft Channel") field(DOL, "BEND:DMPS:420:DEGAUS_IMAXPOL_CHECK") field(OMSL, "closed_loop") field(ZNAM, "Positive") field(ONAM, "Negative") field(FLNK, "BEND:DMPS:420: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, "BEND:DMPS:420:DEGAUS_ABSIMAX") { field(DESC, "Absolute Max. Degauss I") field(CALC, "ABS(A)") field(INPA, "BEND:DMPS:420:DEGAUS_IMAX") field(PREC, "6") field(EGU, "Amps") field(HOPR, "200.0") field(LOPR, "-200.0") info(autosaveFields,"VAL RVAL") } # IACT Polarity record(calcout, "BEND:DMPS:420:IACTPOL_CHECK") { field(DESC, "Determine IACT polarity") field(SCAN, "5 second") field(CALC, "ABS(A-B)>C?(A>=0?0:1):D") field(INPA, "BEND:DMPS:420:IACT") field(INPB, "BEND:DMPS:420:IACTPOL_CHECK.LA") field(INPC, "0.0001") field(INPD, "BEND:DMPS:420:IACTPOL_CHECK.PVAL") field(OOPT, "On Change") field(FLNK, "BEND:DMPS:420:IACTPOL") } record(bo, "BEND:DMPS:420: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,"BEND:DMPS:420: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, "BEND:DMPS:420:DEGAUSENABLE CP") field(INPB, "BEND:DMPS:420:DEGAUSOK") field(INPC, "BEND:DMPS:420:STATE CP") field(INPD, "BEND:DMPS:420:STATE.SEVR") field(OUT, "BEND:DMPS:420:DEGAUS_STATE_SEQ.SELN PP") field(ASG, "Internal") } record(seq, "BEND:DMPS:420:DEGAUS_STATE_SEQ") { field(DESC, "Degauss State Sequence") field(SELM, "Specified") field(SELL, "BEND:DMPS:420:DEGAUS_STATE_CHECK") field(LNK1, "BEND:DMPS:420:DEGAUS_STATE_DISABLE.PROC PP") field(LNK2, "BEND:DMPS:420:DEGAUS_STATE_LOST.PROC PP") field(LNK3, "BEND:DMPS:420:DEGAUS_STATE_GOOD.PROC PP") field(LNK4, "BEND:DMPS:420: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, "BEND:DMPS:420:DEGAUS_STATE_DISABLE") { field(DESC, "Degauss not used") field(LNK1, "BEND:DMPS:420:DEGAUSOK.ZSV") field(LNK2, "BEND:DMPS:420: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, "BEND:DMPS:420:STATMSG.FRSV") field(LNK4, "BEND:DMPS:420: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, "BEND:DMPS:420:DEGAUS_STATE_LOST") { field(DESC, "Degauss lost and ps On") field(DOL1, "1") field(LNK1, "BEND:DMPS:420:DEGAUSOK.ZSV") field(LNK2, "BEND:DMPS:420: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, "BEND:DMPS:420:STATMSG.FRSV") field(LNK4, "BEND:DMPS:420: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, "BEND:DMPS:420:DEGAUS_STATE_OFF") { field(DESC, "Degaused lost and ps Off") field(DOL1, "2") field(LNK1, "BEND:DMPS:420: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, "BEND:DMPS:420:STATMSG.FRSV") field(LNK3, "BEND:DMPS:420: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, "BEND:DMPS:420:DEGAUS_STATE_GOOD") { field(DESC, "Degauss good") field(DOL1, "1") field(LNK1, "BEND:DMPS:420: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, "BEND:DMPS:420:STATMSG.FRSV PP") field(LNK3, "BEND:DMPS:420:STATMSG.FVSV PP") field(LNK4, "") field(ASG, "Internal") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(mbbo, "BEND:DMPS:420:FUNC") { field(DESC, "BEND:DMPS:420 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, "0") field(FFVL, "0") field(OUT, "BEND:DMPS:420:CTRL CA") } # :CTRL pv is processed at boot in the # sequence mgntCtrl.st Processed in sequence # record(mbbo, "BEND:DMPS:420:CTRL") { field(DESC, "BEND:DMPS:420 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, "BEND:DMPS:420:SELECTEN.A PP") field(SDIS, "0") } # If a function has been selected set this unit to busy record(calcout, "BEND:DMPS:420:SELECTEN") { field(DESC, "Control Select Enable") field(CALC, "A>0?1:A") field(FLNK, "BEND:DMPS:420:BUSY") } # Set to FREE on IOC reboot record(bo, "BEND:DMPS:420:BUSY") { field(DESC, "BEND:DMPS:420 Ctrl Done") field(DOL, "BEND:DMPS:420:SELECTEN") field(ZNAM, "FREE") field(ONAM, "BUSY") field(PINI, "YES") field(FLNK, "BEND:DMPS:420:SELECT") } record(bo, "BEND:DMPS:420:SELECT") { field(ZNAM, "NO") field(ONAM, "YES") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") } record(bo, "BEND:DMPS:420: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, "BEND:DMPS:420:CTRLSTATE") { field(DESC, "BEND:DMPS:420 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("BEND:DMPS:420:CTRL",20,20,0,0,"BEND:DMPS:420:CTRL") #! Field("BEND:DMPS:420:CTRL.OUT",16777215,1,"BEND:DMPS:420:CTRL.OUT") #! Link("BEND:DMPS:420:CTRL.OUT","BEND:DMPS:420:SELECTEN.A") #! Field("BEND:DMPS:420:CTRL.VAL",16777215,1,"BEND:DMPS:420:CTRL.VAL") #! Record("BEND:DMPS:420:SELECTEN",321,381,0,0,"BEND:DMPS:420:SELECTEN") #! Field("BEND:DMPS:420:SELECTEN.A",16777215,0,"BEND:DMPS:420:SELECTEN.A") #! Field("BEND:DMPS:420:SELECTEN.FLNK",16777215,1,"BEND:DMPS:420:SELECTEN.FLNK") #! Link("BEND:DMPS:420:SELECTEN.FLNK","BEND:DMPS:420:BUSY") #! Field("BEND:DMPS:420:SELECTEN.VAL",16777215,1,"BEND:DMPS:420:SELECTEN.VAL") #! Record("BEND:DMPS:420:BUSY",623,274,0,0,"BEND:DMPS:420:BUSY") #! Field("BEND:DMPS:420:BUSY.DOL",16777215,0,"BEND:DMPS:420:BUSY.DOL") #! Link("BEND:DMPS:420:BUSY.DOL","BEND:DMPS:420:SELECTEN.VAL") #! Field("BEND:DMPS:420:BUSY.FLNK",16777215,1,"BEND:DMPS:420:BUSY.FLNK") #! Link("BEND:DMPS:420:BUSY.FLNK","BEND:DMPS:420:SELECT") #! Record("BEND:DMPS:420:SELECT",669,508,0,1,"BEND:DMPS:420:SELECT") #! Record("BEND:DMPS:420:FUNC",940,120,0,0,"BEND:DMPS:420:FUNC") #! Field("BEND:DMPS:420:FUNC.OUT",16777215,0,"BEND:DMPS:420:FUNC.OUT") #! Link("BEND:DMPS:420:FUNC.OUT","BEND:DMPS:420:CTRL.VAL") #! Record("BEND:DMPS:420:ABORT",193,41,0,0,"BEND:DMPS:420:ABORT") #! Record("BEND:DMPS:420:CTRLSTATE",369,34,0,0,"BEND:DMPS:420: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,"BEND:DMPS:420:SELECT is used for Multi-device selection.\nIt is enabled when associated BEND:DMPS:420:CTRL is \"0\" (DONE).\nIt is disabled when associated BEND:DMPS:420: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,"BEND:DMPS:420: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, "BEND:DMPS:420:BCTRL_INIT") { field(DESC, "Process BCTRL on boot") field(PINI, "YES") field(CALC, "A=3?1:0") field(INPA, "BEND:DMPS:420:BCTRL.SEVR") field(OUT, "BEND:DMPS:420: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, "BEND:DMPS:420:BACT") { field(DESC, "Actual B") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "BEND:DMPS:420:BACT") field(INPB, "BEND:DMPS:420:POLYCOEF") field(INPC, "BEND:DMPS:420:POLYCOEF.A") field(INPD, "BEND:DMPS:420:POLYCOEF.B") field(INPE, "BEND:DMPS:420:IACT MS") field(INPF, "BEND:DMPS:420:BDELTAS PP") field(INPG, "100") field(EGU, "GeV/c") field(HOPR, "15.7398") field(LOPR, "0.0296") field(HIHI, "15.7398") field(LOLO, "0.0296") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "15.7398") field(LOW, "0.0296") field(FLNK, "BEND:DMPS:420: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, "BEND:DMPS:420:BDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntPhyDeltas") field(EGU, "GeV/c") field(HOPR, "1") field(PREC, "7") field(BRSV, "INVALID") field(INPA, "BEND:DMPS:420:BDES") field(INPB, "BEND:DMPS:420:TRIMBTOL") field(INPC, "BEND:DMPS:420:TRIMBTOLR") field(INPD, "BEND:DMPS:420:CHCKBTOL") field(INPE, "BEND:DMPS:420:CHCKBTOLR") field(F, "2.0") field(INPG, "30") field(INPH, "BEND:DMPS:420:BACT.VAL") # # MPS absolute and relative tolerances field(INPP, "BEND:DMPS:420:MPSBTOL") field(INPQ, "BEND:DMPS:420:MPSBTOLR") field(FLNK, "BEND:DMPS:420:BCONLIMITS") info(autosaveFields,"F") } # This record is processed by BDELTAS record(aSub, "BEND:DMPS:420:BCONLIMITS") { field(DESC, "Config B-field Limits") field(INAM, "mgntInit") field(SNAM, "mgntBCONLimits") field(INPA, "BEND:DMPS:420:BDES") field(INPB, "BEND:DMPS:420:BDELTAS.I") field(INPG, "BEND:DMPS:420:DEBUG.RVAL") field(FTA, "DOUBLE") field(FTB, "DOUBLE") field(FTG, "ULONG") field(OUTA, "BEND:DMPS:420:BCON.HIGH") field(OUTB, "BEND:DMPS:420:BCON.LOW") field(OUTC, "BEND:DMPS:420:BCON.HIHI") field(OUTD, "BEND:DMPS:420:BCON.LOLO PP") field(FTVA, "DOUBLE") field(FTVB, "DOUBLE") field(FTVC, "DOUBLE") field(FTVD, "DOUBLE") field(BRSV, "INVALID") field(FLNK, "BEND:DMPS:420:IDELTAS") } # The following PV is processed by :BACT # which is processed by :BACT # record(fanout, "BEND:DMPS:420:BACTFO") { field(DESC, "BACT processing") field(SELM, "All") field(LNK1, "BEND:DMPS:420:BDIFF") field(LNK2, "BEND:DMPS:420:BADIFF") field(LNK3, "BEND:DMPS:420:BRATIO") field(LNK4, "BEND:DMPS:420:MPSLIMITS") field(LNK5, "BEND:DMPS:420:I2BSTATUS") field(LNK6, "BEND:DMPS:420:IACTFO.PROC") } record(calc, "BEND:DMPS:420:BDIFF") { field(DESC, "BDES-BACT") field(CALC, "A-B") field(INPA, "BEND:DMPS:420:BDES") field(INPB, "BEND:DMPS:420:BACT") field(EGU, "GeV/c") field(PREC, "7") } record(calc, "BEND:DMPS:420:BADIFF") { field(DESC, "Absolute BDES-BACT") field(INPA, "BEND:DMPS:420:BDIFF") field(EGU, "GeV/c") field(PREC, "7") field(CALC, "A<0?ABS(A):A") } record(calc, "BEND:DMPS:420:BRATIO") { field(DESC, "BACT Error") field(CALC, "B?A/B:0") field(INPA, "BEND:DMPS:420:BDIFF") field(INPB, "BEND:DMPS:420:BDES.HOPR") field(EGU, "GeV/c") field(PREC, "7") } record(mbbi, "BEND:DMPS:420: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, "BEND:DMPS:420:BACT.J") } # Note: for a string slave set the MONFL # macro to the following: # MONFL=:IMONCALC MS record(sub, "BEND:DMPS:420:BMON") { field(DESC, "Second Transductor") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "BEND:DMPS:420:BMON") field(INPB, "BEND:DMPS:420:POLYCOEF") field(INPC, "BEND:DMPS:420:POLYCOEF.A") field(INPD, "BEND:DMPS:420:POLYCOEF.B") field(INPE, "BEND:DMPS:420:IMON MS") field(INPF, "BEND:DMPS:420:BDELTAS.VAL") field(INPG, "100") field(EGU, "GeV/c") field(HOPR, "15.7398") field(LOPR, "0.0296") field(HIHI, "15.7398") field(LOLO, "0.0296") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "15.7398") field(LOW, "0.0296") } # 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=BEND:DMPS:400:BDES CP record(ao, "BEND:DMPS:420:BDES") { field(DESC, "Desired B-Field") field(PINI, "NO") field(DRVH, "15.7398") field(DRVL, "0.0296") field(HOPR, "15.7398") field(LOPR, "0.0296") field(PREC, "7") field(EGU, "GeV/c") field(MDEL, "-1") field(OMSL, "closed_loop") field(DOL, "BEND:DMPS:420:IDES2BDES") field(OUT, "BEND:DMPS:420:B2IDES PP") info(autosaveFields,"VAL") } record(sub, "BEND:DMPS:420:B2IDES") { field(DESC, "Convert Desired B-Field to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "BEND:DMPS:420:POLYCOEF") field(INPC, "BEND:DMPS:420:POLYCOEF.A") field(INPD, "BEND:DMPS:420:POLYCOEF.B") field(PREC, "7") field(EGU, "GeV/c") field(HOPR, "15.7398") field(LOPR, "0.0296") field(MDEL, "-1") field(INPE, "BEND:DMPS:420:BDES.DRVH") field(INPF, "BEND:DMPS:420:BDES.DRVL") field(BRSV, "INVALID") field(FLNK, "BEND:DMPS:420:IDES") } record(sub, "BEND:DMPS:420:BNOM") { field(DESC, "Nominal Field") field(PINI, "YES") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "BEND:DMPS:420:POLYCOEF") field(INPC, "BEND:DMPS:420:POLYCOEF.A") field(INPD, "BEND:DMPS:420:POLYCOEF.B") field(INPE, "BEND:DMPS:420:BDES.DRVH") field(INPF, "BEND:DMPS:420:BDES.DRVL") field(EGU, "GeV/c") field(HOPR, "15.7398") field(LOPR, "0.0296") field(PREC, "7") field(VAL, "0.0") field(FLNK, "BEND:DMPS:420:INOM") } record(sub, "BEND:DMPS:420:BACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "BEND:DMPS:420:BDES.VAL") field(INPB, "BEND:DMPS:420:BDES.DRVH") field(INPC, "BEND:DMPS:420:BDES.DRVL") field(INPD, "BEND:DMPS:420:BDELTAS.I") field(INPE, "BEND:DMPS:420:BDELTAS.J") field(INPG, "BEND:DMPS:420:STATE") field(INPH, "BEND:DMPS:420:HSTA") field(EGU, "GeV/c") field(HOPR, "15.7398") field(LOPR, "0.0296") field(PREC, "7") field(BRSV, "INVALID") } record(sub, "BEND:DMPS:420:BMONLIMITS") { field(DESC, "MON Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "BEND:DMPS:420:BDES.VAL") field(INPB, "BEND:DMPS:420:BDES.DRVH") field(INPC, "BEND:DMPS:420:BDES.DRVL") field(INPD, "BEND:DMPS:420:BDELTAS.K") field(INPE, "BEND:DMPS:420:BDELTAS.L") field(INPG, "BEND:DMPS:420:STATE") field(INPH, "BEND:DMPS:420:HSTA") field(EGU, "GeV/c") field(HOPR, "15.7398") field(LOPR, "0.0296") field(PREC, "7") field(BRSV, "INVALID") } record(seq, "BEND:DMPS:420:BLIMITS") { field(DESC, "ACT Limits") field(PREC, "7") field(DOL1, "BEND:DMPS:420:BLIMITS") field(LNK1, "BEND:DMPS:420:BACTLIMITS.F PP") field(DOL2, "BEND:DMPS:420:BACTLIMITS.I") field(LNK2, "BEND:DMPS:420:BACT.HIGH") field(DOL3, "BEND:DMPS:420:BACTLIMITS.J") field(LNK3, "BEND:DMPS:420:BACT.LOW") field(DOL4, "BEND:DMPS:420:BACTLIMITS.K") field(LNK4, "BEND:DMPS:420:BACT.HIHI") field(DOL5, "BEND:DMPS:420:BACTLIMITS.L") field(LNK5, "BEND:DMPS:420:BACT.LOLO") field(DOL6, "BEND:DMPS:420:BLIMITS") field(LNK6, "BEND:DMPS:420:BMONLIMITS.F PP") field(DOL7, "BEND:DMPS:420:BMONLIMITS.I") field(LNK7, "BEND:DMPS:420:BMON.HIGH") field(DOL8, "BEND:DMPS:420:BMONLIMITS.J") field(LNK8, "BEND:DMPS:420:BMON.LOW") field(DOL9, "BEND:DMPS:420:BMONLIMITS.K") field(LNK9, "BEND:DMPS:420:BMON.HIHI") field(DOLA, "BEND:DMPS:420:BMONLIMITS.L") field(LNKA, "BEND:DMPS:420:BMON.LOLO") field(FLNK, "BEND:DMPS:420:ILIMITS") field(SCAN, "5 second") } record(ao, "BEND:DMPS:420:BCTRL") { field(DESC, "B-Perturb") field(PREC, "7") field(EGU, "GeV/c") field(DRVH, "15.7398") field(DRVL, "0.0296") field(HOPR, "15.7398") field(LOPR, "0.0296") # 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, "BEND:DMPS:420: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, "BEND:DMPS:420:BCTRLGO") { field(DESC, "Update DES and perturb") field(PREC, "7") # Disable BACT limits field(DOL1, "1") field(LNK1, "BEND:DMPS:420:BLIMITS.VAL") # Update BDES with the BCTRL (slider) value field(DOL2, "BEND:DMPS:420:BCTRL.VAL") field(LNK2, "BEND:DMPS:420:BDES PP") field(DOL3, "1") field(LNK3, "BEND:DMPS:420:IDIRECT.PROC PP") field(DOL4, "1") field(LNK4, "BEND:DMPS:420:CHECKSTDZLOST.PROC PP") field(DOL5, "BEND:DMPS:420:BCTRL.VAL") field(LNK5, "BEND:DMPS:420:BCTRLSUB PP") # Re-enable BACT limits field(DOL6, "0") field(LNK6, "BEND:DMPS:420:BLIMITS.VAL") } # Convert B-field to Current and output to ISETPT record(sub, "BEND:DMPS:420:BCTRLSUB") { field(DESC, "Feedback") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "BEND:DMPS:420:POLYCOEF") field(INPC, "BEND:DMPS:420:POLYCOEF.A") field(INPD, "BEND:DMPS:420:POLYCOEF.B") field(INPE, "BEND:DMPS:420:BDES.DRVH") field(INPF, "BEND:DMPS:420:BDES.DRVL") field(PREC, "7") field(EGU, "GeV/c") field(HOPR, "15.7398") field(LOPR, "0.0296") field(MDEL, "-1") field(BRSV, "INVALID") field(FLNK, "BEND:DMPS:420:ISETPT") } record(ao, "BEND:DMPS:420:BDESPREVTRIM") { field(DESC, "trim bdes for undo") field(DTYP, "Soft Channel") field(DRVH, "15.7398") field(DRVL, "0.0296") field(EGU, "GeV/c") field(HOPR, "15.7398") field(LOPR, "0.0296") field(PREC, "7") field(PINI, "YES") info(autosaveFields,"VAL") } record(stringin, "BEND:DMPS:420:MADNAME") { field(DESC, "MAD deck nomenclature") field(PINI, "YES") field(VAL, "BYD3B") } record(ai, "BEND:DMPS:420: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, "3739.347096") } record(ao, "BEND:DMPS:420:BMAX") { field(DESC, "Max B-Field") field(DTYP, "Soft Channel") field(DRVH, "15.7398") field(DRVL, "0.0296") field(EGU, "GeV/c") field(HOPR, "15.7398") field(LOPR, "0.0296") field(PREC, "7") field(PINI, "YES") field(VAL, "15.7398") field(FLNK, "BEND:DMPS:420:BSTEP") } record(ao, "BEND:DMPS:420:BMIN") { field(DESC, "Min B-Field") field(DTYP, "Soft Channel") field(DRVH, "15.7398") field(DRVL, "0.0296") field(EGU, "GeV/c") field(HOPR, "15.7398") field(LOPR, "0.0296") field(PREC, "7") field(PINI, "YES") field(VAL, "0.0296") field(FLNK, "BEND:DMPS:420:BSTEP") } record(ao, "BEND:DMPS:420:BDESSAVE") { field(DESC, "bdes for save/load") field(DTYP, "Soft Channel") field(DRVH, "15.7398") field(DRVL, "0.0296") field(EGU, "GeV/c") field(HOPR, "15.7398") field(LOPR, "0.0296") field(PINI, "YES") field(PREC, "7") } # This record is processed by BEND:DMPS:420: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, "BEND:DMPS:420:BCON") { field(DESC, "Config B-Field ") field(DTYP, "Soft Channel") field(PREC, "7") field(EGU, "GeV/c") field(HOPR, "15.7398") field(LOPR, "0.0296") field(DRVH, "15.7398") field(DRVL, "0.0296") # 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 , "BEND:DMPS:420:ICON2BCON") field(OMSL, "closed_loop") field(OUT, "BEND:DMPS:420:B2ICON PP") info(autosaveFields,"VAL") } record(sub, "BEND:DMPS:420:B2ICON") { field(DESC, "Convert Desired ICon to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "BEND:DMPS:420:POLYCOEF") field(INPC, "BEND:DMPS:420:POLYCOEF.A") field(INPD, "BEND:DMPS:420:POLYCOEF.B") field(PREC, "7") field(EGU, "GeV/c") field(HOPR, "15.7398") field(LOPR, "0.0296") field(MDEL, "-1") field(INPE, "BEND:DMPS:420:BCON.DRVH") field(INPF, "BEND:DMPS:420:BCON.DRVL") field(BRSV, "INVALID") field(FLNK, "BEND:DMPS:420: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, "BEND:DMPS:420:BSTEP") { field(DESC, "B-Field step size") field(CALC, "(C==3)||(D==3)?0:ABS(A-B)*0.005") field(INPA, "BEND:DMPS:420:BMAX") field(INPB, "BEND:DMPS:420:BMIN") field(INPC, "BEND:DMPS:420:BMIN.SEVR") field(INPD, "BEND:DMPS:420:BMAX.SEVR") field(EGU, "GeV/c") 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,"BEND:DMPS:420:BCTRLDISABLECALC") { field(DESC, "Calc for disabling BCTRL") field(ASG, "Internal") field(CALC, "A?2:1") field(INPA, "BEND:DMPS:420:ONLINE CP") field(OUT, "BEND:DMPS:420:BCTRLDISABLEFOUT PP") } record(fanout, "BEND:DMPS:420:BCTRLDISABLEFOUT") { field(DESC, "Disable BCTRL fanout") field(SELM, "Specified") field(SELL, "BEND:DMPS:420:BCTRLDISABLECALC") field(LNK1, "BEND:DMPS:420:BCTRLDISABLE") field(LNK2, "BEND:DMPS:420:BCTRLENABLE") } record(stringout, "BEND:DMPS:420:BCTRLDISABLE") { field(DESC, "Disable BCTRL") field(DTYP, "Soft Channel") field(OUT, "BEND:DMPS:420:BCTRL.ASG") field(VAL, "NOWRITE") field(FLNK, "BEND:DMPS:420:BCTRLDISV_UPDATE") } record(stringout, "BEND:DMPS:420:BCTRLENABLE") { field(DESC, "Enable BCTRL") field(DTYP, "Soft Channel") field(OUT, "BEND:DMPS:420:BCTRL.ASG") field(VAL, "") field(FLNK, "BEND:DMPS:420:BCTRLDISV_UPDATE") } record(calcout, "BEND:DMPS:420:BCTRLDISV_UPDATE") { field(DESC, "Calc for updating BCTRL.DISV") field(ASG, "Internal") field(CALC, "A") field(INPA, "BEND:DMPS:420:ONLINE") field(OUT, "BEND:DMPS:420: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,"BEND:DMPS:420:BACT and MON\n are processed via links from \n BEND:DMPS:420:IACT (device raw value readback 1)\n and\n BEND:DMPS:420: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 BEND:DMPS:420:POLYCOEF\nC = First polynomial coefficient (offset if linear)\nD = Second polynomial coefficient (slope if linear)\nE = BEND:DMPS:420: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,"BEND:DMPS:420:BDES\n is processed when set by CA users or \n BEND:DMPS:420: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,"BEND:DMPS:420: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 BEND:DMPS:420: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 (BEND:DMPS:420: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,"BEND:DMPS:420:B*LIMITS and BEND:DMPS:420:BLIMITS:\n Calculate alarm and warning limits based on \n deltas from BEND:DMPS:420: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,"BEND:DMPS:420: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,"BEND:DMPS:420: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, "BEND:DMPS:420: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, "BEND:DMPS:420:MPSBTOL") { field(DESC, "Absolute mps tol") field(EGU, "GeV/c") field(PREC, "2") field(CALC, "ABS(A)*0.02") field(INPA, "BEND:DMPS:420:BMAX") field(PINI, "YES") } # # 21-Aug-2013: K. Luchini # Set channel access security so that users # cannot easily change values. record(ao, "BEND:DMPS:420:MPSBMAX") { field(DESC, "MPS Max B-field") field(EGU, "GeV/c") field(PREC, "7") field(DRVH, "15.7398") field(DRVL, "0.0296") field(PINI, "YES") field(VAL, "15.7398") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "BEND:DMPS:420:MPSBMIN") { field(DESC, "MPS Min B-field") field(EGU, "GeV/c") field(PREC, "7") field(DRVH, "15.7398") field(DRVL, "0.0296") field(PINI, "YES") field(VAL, "0.0296") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "BEND:DMPS:420:MPSBLLIM") { field(DESC, "MPS Low Limit B-field") field(EGU, "GeV/c") field(PREC, "7") field(DRVH, "15.7398") field(DRVL, "0.0296") field(PINI, "YES") field(VAL, "0.0296") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "BEND:DMPS:420:MPSBLLIM2") { field(DESC, "MPS Low Limit #2 B-field") field(EGU, "GeV/c") field(PREC, "7") field(DRVH, "15.7398") field(DRVL, "0.0296") field(PINI, "YES") field(VAL, "0.0296") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } # Set the default to Std record(mbbo, "BEND:DMPS:420: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, "BEND:DMPS:420:MPSLIMITS.E PP") } record(aSub, "BEND:DMPS:420: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, "BEND:DMPS:420:MPS.RVAL") field(INPB, "BEND:DMPS:420:BADIFF") field(INPC, "BEND:DMPS:420:BDELTAS.N") field(INPD, "BEND:DMPS:420:BACT") field(INPE, "BEND:DMPS:420:MPSBITMASK.RVAL") field(INPF, "BEND:DMPS:420:MPSBLLIM") field(INPG, "BEND:DMPS:420:MPSBMIN") field(INPH, "BEND:DMPS:420:MPSBMAX") field(INPI, "BEND:DMPS:420: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, "BEND:DMPS:420:INTOL.RVAL PP") field(OUTB, "BEND:DMPS:420:INTOL_BMIN.RVAL PP") field(OUTC, "BEND:DMPS:420:INTOL_BRANGE.RVAL PP") field(OUTD, "BEND:DMPS:420: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, "BEND:DMPS:420:INTOL") { field(DESC, "BACT within MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "BEND:DMPS:420:MPSLIMITS.VALA") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "BEND:DMPS:420:INTOL_BMIN") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "BEND:DMPS:420:MPSLIMITS.VALB") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "BEND:DMPS:420:INTOL_BMIN2") { field(DESC, "MPS tol #2") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "BEND:DMPS:420:MPSLIMITS.VALD") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "BEND:DMPS:420:INTOL_BRANGE") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "BEND:DMPS:420: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, "BEND:DMPS:420:CHCKITOL") { field(DESC, "Absolute Check I Tolerance") field(EGU, "A") field(FLNK, "BEND:DMPS:420:TRIMITOL") field(CALC, "ABS(A*B)") field(INPA, "BEND:DMPS:420:CHCKBTOL") field(INPB, "BEND:DMPS:420:POLYCOEF.B") field(PREC, "9") } record(calc, "BEND:DMPS:420:TRIMBTOL") { field(EGU, "GeV/c") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(DESC, "Absolute Trim Tolerance") field(CALC, "ABS(A)/2") field(INPA, "BEND:DMPS:420:CHCKBTOL") field(FLNK, "BEND:DMPS:420:CHCKITOL") } record(calc, "BEND:DMPS:420:CHCKBTOL") { field(DESC, "Check absolute tolerance") field(EGU, "A") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(FLNK, "BEND:DMPS:420:TRIMBTOL") field(CALC, "MAX(ABS(A),ABS(C))*(B/1000000)") field(INPA, "BEND:DMPS:420:BDES.HOPR") field(INPB, "BEND:DMPS:420:STABILITY") field(INPC, "BEND:DMPS:420:BDES.LOPR") } record(longout, "BEND:DMPS:420: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, "BEND:DMPS:420:CHCKBTOL") } record(calc, "BEND:DMPS:420:TRIMITOL") { field(DESC, "Absolute Trim I Tolerance") field(EGU, "GeV/c") field(CALC, "ABS(A*B)") field(INPA, "BEND:DMPS:420:POLYCOEF.B") field(INPB, "BEND:DMPS:420:TRIMBTOL") field(PREC, "9") } record(ai, "BEND:DMPS:420:TRIMBTOLR") { field(DESC, "Relative trim tol") field(PREC, "4") field(EGU, "%") field(HOPR, "1.0") field(LOPR, "0.0") field(PINI, "YES") } record(ai, "BEND:DMPS:420: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, "BEND:DMPS:420:FBCKFCOM") { field(ZNAM, "CA") field(ONAM, "FCOM") field(DESC, "CA Mode") field(PINI, "YES") field(SDIS, "0") } record(bo, "BEND:DMPS:420:PAU") { field(ZNAM, "NotConfigured") field(ONAM, "Configured") field(DESC, "PAU Present") field(PINI, "YES") field(SDIS, "0") field(FLNK, "BEND:DMPS:420:PAUGO") } record(fanout, "BEND:DMPS:420:PAUGO") { field(DESC, "PAU control") field(LNK1, "BEND:DMPS:420:PAUSTOP") field(LNK2, "BEND:DMPS:420: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, "BEND:DMPS:420:PAUSTART") { field(DESC, "Setup for PAU On") field(SDIS, "BEND:DMPS:420: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, "BEND:DMPS:420:PAUSTOP") { field(DESC, "Setup for PAU Off") field(SDIS, "BEND:DMPS:420: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, "BEND:DMPS:420:MCORDEVNAME") { field(DESC, "PS device name") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, "BEND:DMPS:400:") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "BEND:DMPS:420: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, "BEND:DMPS:420:PSTYPE.RVAL") field(INPC, "BEND:DMPS:420:TURNEDOFF.RVAL") field(INPD, "BEND:DMPS:420:CONFIG.RVAL") field(INPE, "BEND:DMPS:420:PSCATEGORY.RVAL") field(INPF, "BEND:DMPS:420:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "BEND:DMPS:420:AUTOCTRL.RVAL") field(INPJ, "BEND:DMPS:420:OUTOFSERVICE.RVAL") field(INPL, "BEND:DMPS:420:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "BEND:DMPS:420:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "BEND:DMPS:420:PAU") field(INPP, "BEND:DMPS:420:CALBDISABLE.RVAL") field(INPQ, "BEND:DMPS:420:PTRBDISABLE.RVAL") field(INPR, "BEND:DMPS:420:TRIMDISABLE.RVAL") field(INPS, "BEND:DMPS:420:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "BEND:DMPS:420:FBCK") field(INPU, "BEND:DMPS:420:TRIMTYPE.RVAL") field(INPV, "BEND:DMPS:420:STDZDIRECT.RVAL") field(INPW, "BEND:DMPS:420:DEGAUSENABLE.RVAL") field(FLNK, "BEND:DMPS:420:HSTA") } record(longin, "BEND:DMPS:420:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "BEND:DMPS:420:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "BEND:DMPS:420: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, "BEND:DMPS:420: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, "BEND:DMPS:420: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, "BEND:DMPS:420: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, "BEND:DMPS:420: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, "BEND:DMPS:420: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 BEND:DMPS:420:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses BEND:DMPS:420:FBCK. # This PV should be replaced by BEND:DMPS:420: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, "BEND:DMPS:420: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, "BEND:DMPS:420: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, "BEND:DMPS:420: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, "BEND:DMPS:400:OUTOFSERVICE CPP NMS") field(OMSL, "closed_loop") field(FLNK, "BEND:DMPS:420:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"BEND:DMPS:420:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "BEND:DMPS:420:OUTOFSERVICE NPP NMS") field(OUT, "BEND:DMPS:420:ONLINE PP") } record(bo, "BEND:DMPS:420:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "BEND:DMPS:420: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, "BEND:DMPS:420: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, "BEND:DMPS:420: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, "BEND:DMPS:420: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, "BEND:DMPS:420: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, "BEND:DMPS:420: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, "BEND:DMPS:420: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, "BEND:DMPS:420: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, "BEND:DMPS:420: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, "BEND:DMPS:420: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, "BEND:DMPS:420: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, "BEND:DMPS:420:TRIMTYPE") } record(stringout, "BEND:DMPS:420:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "BEND:DMPS:400:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "BEND:DMPS:420:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "BEND:DMPS:420:STATE.RVAL") field(INPB, "BEND:DMPS:420:INTLKSUMY.RVAL") field(OUT, "BEND:DMPS:420:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "BEND:DMPS:420: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, "BEND:DMPS:420:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "BEND:DMPS:420:STATE.RVAL") field(INPB, "BEND:DMPS:420:INTLKSUMY.RVAL") field(OUT, "BEND:DMPS:420:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "BEND:DMPS:420:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "BEND:DMPS:420:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "BEND:DMPS:420: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, "BEND:DMPS:420: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, "BEND:DMPS:420: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, "BEND:DMPS:420: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,"BEND:DMPS:420: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("BEND:DMPS:420:TURNEDOFF",3140,1907,0,1,"BEND:DMPS:420:TURNEDOFF") #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "BEND:DMPS:420:STATSUB") { field(DESC, "Build STATus ") field(INAM, "mgntInit") field(SNAM, "mgntSlcStat") field(INPA, "BEND:DMPS:420:BACT.STAT") field(INPB, "BEND:DMPS:420:BDES.STAT") field(INPC, "BEND:DMPS:420: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, "BEND:DMPS:420:BACT.SEVR") field(INPH, "BEND:DMPS:420:BDES.SEVR") field(INPI, "BEND:DMPS:420: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, "BEND:DMPS:420:STATE.RVAL") field(INPN, "BEND:DMPS:420:STDZOK") field(INPO, "BEND:DMPS:420:CALBOK") field(INPP, "BEND:DMPS:420:OUTOFSERVICE.RVAL") field(INPQ, "BEND:DMPS:420:CONFIG.RVAL") field(INPR, "BEND:DMPS:420:HSTA") field(INPS, "BEND:DMPS:420:CTRL.RVAL") field(INPT, "BEND:DMPS:420:DEGAUSOK") field(INPV, "BEND:DMPS:420: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, "BEND:DMPS:420:STAT") } record(longout, "BEND:DMPS:420:STAT") { field(DESC, "STAT sent to SLC") field(SCAN, "Passive") field(FLNK, "BEND:DMPS:420:STATCTRLSUB") field(DOL, "BEND:DMPS:420:STATSUB.VAL") field(OMSL, "closed_loop") } record(sSub, "BEND:DMPS:420:STATCTRLSUB") { field(DESC, "Decode SLC STAT into mbbo") field(INAM, "mgntInit") field(SNAM, "mgntStatDecode") field(INPA, "BEND:DMPS:420:STAT") field(INPB, "BEND:DMPS:420:HSTA") field(INPD, "BEND:DMPS:420:ONOFFCTRL.RVAL") field(FLNK, "BEND:DMPS:420:STATMSG") } record(mbbo, "BEND:DMPS:420: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, "BEND:DMPS:420:UNAVAILGO") field(DOL, "BEND:DMPS:420:STATCTRLSUB.W") } record(seq, "BEND:DMPS:420:UNAVAILGO") { field(DESC, "Process UNAVAIL") field(DOL1, "BEND:DMPS:420:STATSUB.U") field(LNK1, "BEND:DMPS:420:UNAVAIL PP") } record(stringout, "BEND:DMPS:420:SNLSTATMSG") { field(DTYP, "Soft Channel") } #! TextBox(TB0,820,1000,1200,1220,0,"Dialog",12,1,16777215,"BEND:DMPS:420:STATUSSUB - future\nOverall device status - takes input from action snls, record sevrs, master snl(s) and outputs final status\n\nInputs:\nA - BEND:DMPS:420:CTRLSTATUS - snl status\nB - MGNT:CTRLSTATUS - master list status\nC\nD - BEND:DMPS:420: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,"BEND:DMPS:420STATSUB\nformat control bo's into slc STAT\n\nInputs:\nA - BEND:DMPS:420:STATUS\nC - BEND:DMPS:420:ON\nD - BEND:DMPS:420:STDZOK\nE - BEND:DMPS:420:CALBOK\nF - BEND:DMPS:420:BACTDRIFT (future)\nG -\nH- BEND:DMPS:420:DACSTATUS\nI -BEND:DMPS:420:ADCSTATUS\nJ - BEND:DMPS:420:BACTSTATUS\nK - BEND:DMPS:420:BDESSTATUS\nL - BEND:DMPS:420:RIPLSTATUS\n\nOutput:\nP - BEND:DMPS:420: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, "BEND:DMPS:420: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, "BEND:DMPS:420: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, "BEND:DMPS:420: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, "BEND:DMPS:420: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 b-field of a slave with out a powered trim coil # equal to the main desired current and pass backwards # through the IVB poly. record(sub, "BEND:DMPS:420:IDES2BDES") { field(DESC, "Cal BDES") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "BEND:DMPS:420:IDES2BDES") field(INPB, "BEND:DMPS:420:POLYCOEF") field(INPC, "BEND:DMPS:420:POLYCOEF.A") field(INPD, "BEND:DMPS:420:POLYCOEF.B") field(INPE, "BEND:DMPS:400:IDES CP MS") field(INPF, "BEND:DMPS:400:BDELTAS PP") field(INPG, "100") field(EGU, "GeV/c") field(HOPR, "15.7398") field(LOPR, "0.0296") field(HIHI, "15.7398") field(LOLO, "0.0296") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "15.7398") field(LOW, "0.0296") field(FLNK, "BEND:DMPS:420:BDES") } # Calcuate the bcon of a slave using # the main desired current and pass backwards # through the IVB poly. # the trim b-field is acutally amps. record(sub, "BEND:DMPS:420:ICON2BCON") { field(DESC, "Cal BCON") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "BEND:DMPS:420:ICON2BCON") field(INPB, "BEND:DMPS:420:POLYCOEF") field(INPC, "BEND:DMPS:420:POLYCOEF.A") field(INPD, "BEND:DMPS:420:POLYCOEF.B") field(INPE, "BEND:DMPS:400:ICON CP NMS") field(INPF, "BEND:DMPS:400:BDELTAS PP") field(INPG, "100") field(EGU, "GeV/c") field(HOPR, "15.7398") field(LOPR, "0.0296") field(HIHI, "15.7398") field(LOLO, "0.0296") field(PREC, "7") field(BRSV, "INVALID") # Set MINOR alarms for main as the default, slaves will set NO_ALARM field(HHSV, "NO_ALARM") field(HSV, "NO_ALARM") field(LSV, "NO_ALARM") field(LLSV, "NO_ALARM") field(HIGH, "15.7398") field(LOW, "0.0296") field(FLNK, "BEND:DMPS:420:BCON") }#! 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, "QUAD:DMPS:600:IACT") { field(DESC, "Current") field(INP, "QUAD:DMPS:500:IACT CP NMS") field(EGU, "A") field(HOPR, "150.0") field(LOPR, "0.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "QUAD:DMPS:600:BACT") info(autosaveFields,"HYST") } record(bi, "QUAD:DMPS:600:STATE") { field(DESC, "PS On/Off Status") field(DTYP, "Raw Soft Channel") field(INP, "QUAD:DMPS:500:STATE CP MS") field(ZSV, "MAJOR") field(ZNAM, "OFF") field(ONAM, "ON") } record(ao, "QUAD:DMPS:600:IDES") { field(DESC, "Desired Current") field(PREC, "3") field(EGU, "A") field(HOPR, "150.0") field(LOPR, "0.0") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(MDEL, "-1") field(HIHI, "150.0") field(LOLO, "0.0") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "QUAD:DMPS:600:BDELTAS") field(DRVH, "150.0") field(DRVL, "0.0") field(DOL, "QUAD:DMPS:600: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, "QUAD:DMPS:600:ICTRL PP") } # This record is processed by QUAD:DMPS:600:ICON") # Note: we are not setting alarms here. record(ao, "QUAD:DMPS:600:ICON") { field(DESC, "Config I") field(DTYP, "Soft Channel") field(PREC, "3") field(HOPR, "150.0") field(LOPR, "0.0") field(DRVH, "150.0") field(DRVL, "0.0") field(DOL, "QUAD:DMPS:600:B2ICON.K") field(OMSL, "closed_loop") info(autosaveFields,"VAL") } record(ao, "QUAD:DMPS:600:INOM") { field(DESC, "Nominal Current") field(DOL, "QUAD:DMPS:600:BNOM.K") field(OMSL, "closed_loop") field(PREC, "3") field(EGU, "A") field(DRVH, "150.0") field(DRVL, "0.0") field(HOPR, "150.0") field(LOPR, "0.0") } record(ao, "QUAD:DMPS:600:ICTRL") { field(DESC, "Set Current") field(PREC, "3") field(EGU, "A") field(HOPR, "150.0") field(LOPR, "0.0") field(DRVH, "150.0") field(DRVL, "0.0") field(MDEL, "-1") field(FLNK, "QUAD:DMPS:600:ICTRLGO") field(OMSL, "supervisory") info(autosavefields,"VAL") } record(seq, "QUAD:DMPS:600:ICTRLGO") { field(DESC, "Process Current Setpoint") field(PREC, "3") # Set ISETPT to supervisory field(DOL1, "0") field(LNK1, "QUAD:DMPS:600:ISETPT.OMSL") field(DOL2, "QUAD:DMPS:600:ICTRL") field(LNK2, "QUAD:DMPS:600:ISETPT PP") # Set ISETPT to closed loop - get data from BCTRLSUB.K field(DOL3, "1") field(LNK3, "QUAD:DMPS:600:ISETPT.OMSL") } record(ao, "QUAD:DMPS:600:IMAX") { field(DESC, "Max I") field(DTYP, "Soft Channel") field(DRVH, "150.0") field(DRVL, "0.0") field(EGU, "A") field(HOPR, "150.0") field(LOPR, "0.0") field(PREC, "3") field(PINI, "YES") field(VAL, "150.0") field(FLNK, "QUAD:DMPS:600:IMIN") } record(ao, "QUAD:DMPS:600:IMIN") { field(DESC, "Min I") field(DTYP, "Soft Channel") field(DRVH, "150.0") field(DRVL, "0.0") field(EGU, "A") field(HOPR, "150.0") field(LOPR, "0.0") field(PREC, "3") field(VAL, "0.0") field(FLNK, "QUAD:DMPS:600:IRANGE") } record(sel, "QUAD:DMPS:600:IACTPREVOK") { field(DESC, "Last Good Current") field(EGU, "A") field(HOPR, "150.0") field(LOPR, "0.0") field(PREC, "3") field(NVL, "QUAD:DMPS:600:BACT.SEVR") field(INPA, "QUAD:DMPS:600:IACT NPP MS") field(INPB, "QUAD:DMPS:600:IACTPREVOK NPP MS") field(INPC, "QUAD:DMPS:600:IACTPREVOK NPP MS") field(INPD, "QUAD:DMPS:600:IACTPREVOK NPP MS") } record(sub, "QUAD:DMPS:600:IACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:DMPS:600:IDES") field(INPB, "QUAD:DMPS:600:ISETPT.DRVH") field(INPC, "QUAD:DMPS:600:ISETPT.DRVL") field(INPD, "QUAD:DMPS:600:IDELTAS.I") field(INPE, "QUAD:DMPS:600:IDELTAS.J") field(INPG, "QUAD:DMPS:600:STATE") field(INPH, "QUAD:DMPS:600:HSTA") field(EGU, "A") field(HOPR, "150.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(sub, "QUAD:DMPS:600:IMONLIMITS") { field(DESC, "Aux Current Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:DMPS:600:IDES") field(INPB, "QUAD:DMPS:600:ISETPT.DRVH") field(INPC, "QUAD:DMPS:600:ISETPT.DRVL") field(INPD, "QUAD:DMPS:600:IDELTAS.K") field(INPE, "QUAD:DMPS:600:IDELTAS.L") field(INPG, "QUAD:DMPS:600:STATE") field(INPH, "QUAD:DMPS:600:HSTA") field(EGU, "A") field(HOPR, "150.0") field(LOPR, "0.0") field(PREC, "3") field(BRSV, "INVALID") } record(seq, "QUAD:DMPS:600:ILIMITS") { field(DESC, "Set ACT and MON Limits") field(PREC, "3") field(DOL1, "QUAD:DMPS:600:BLIMITS") field(LNK1, "QUAD:DMPS:600:IACTLIMITS.F PP") field(DOL2, "QUAD:DMPS:600:IACTLIMITS.I") field(LNK2, "QUAD:DMPS:600:IACT.HIGH") field(DOL3, "QUAD:DMPS:600:IACTLIMITS.J") field(LNK3, "QUAD:DMPS:600:IACT.LOW") field(DOL4, "QUAD:DMPS:600:IACTLIMITS.K") field(LNK4, "QUAD:DMPS:600:IACT.HIHI") field(DOL5, "QUAD:DMPS:600:IACTLIMITS.L") field(LNK5, "QUAD:DMPS:600:IACT.LOLO") field(DOL6, "QUAD:DMPS:600:BLIMITS") field(LNK6, "QUAD:DMPS:600:IMONLIMITS.F PP") field(DOL7, "QUAD:DMPS:600:IMONLIMITS.I") field(LNK7, "QUAD:DMPS:600:IMON.HIGH") field(DOL8, "QUAD:DMPS:600:IMONLIMITS.J") field(LNK8, "QUAD:DMPS:600:IMON.LOW") field(DOL9, "QUAD:DMPS:600:IMONLIMITS.K") field(LNK9, "QUAD:DMPS:600:IMON.HIHI") field(DOLA, "QUAD:DMPS:600:IMONLIMITS.L") field(LNKA, "QUAD:DMPS:600: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, "QUAD:DMPS:600:IDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntRawDeltas") field(INPD, "QUAD:DMPS:600:TRIMBTOL") field(INPE, "QUAD:DMPS:600:CHCKBTOL") field(INPF, "QUAD:DMPS:600:BDELTAS.K") field(INPG, "QUAD:DMPS:600:BDELTAS.L") field(INPH, "QUAD:DMPS:600: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, "QUAD:DMPS:600:STDZITOLR") field(INPC, "QUAD:DMPS:600:STDZITOL") field(FLNK, "") } # All ps controllers with on/off control will set the macro ONOF # as follows: # # ONOF = QUAD:DMPS:500: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, "QUAD:DMPS:600: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 = QUAD:DMPS:500:RESET PP # record(bo, "QUAD:DMPS:600: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, "QUAD:DMPS:600:RAMPSTATE") { field(DESC, "PS Ramp Status") field(DTYP, "Soft Channel") field(DOL, "QUAD:DMPS:500: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, "QUAD:DMPS:600: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, "QUAD:DMPS:600:TRIMRAMPRATE") field(OUT, "") field(FLNK, "QUAD:DMPS:600:STDZDLY") } record(ao, "QUAD:DMPS:600:ISETPT") { field(DESC, "Current Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(EGU, "A") field(HOPR, "150.0") field(LOPR, "0.0") field(DRVH, "150.0") field(DRVL, "0.0") field(MDEL, "-1") field(OUT, "") field(DOL, "QUAD:DMPS:600: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, "QUAD:DMPS:600:IMON") { field(DESC, "Aux Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(INP, "QUAD:DMPS:500:IMON CP NMS") field(EGU, "A") field(HOPR, "150.0") field(LOPR, "0.0") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "QUAD:DMPS:600:BMON") } record(ao, "QUAD:DMPS:600:IRIPL") { field(DESC, "Ripple Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(DOL, "QUAD:DMPS:500:IRIPL CP NMS") field(OMSL, "closed_loop") field(EGU, "A") field(DRVH, "1.0") field(HOPR, "1.0") field(PREC, "3") field(FLNK, "QUAD:DMPS:600:IRIPLOK") } record(sub, "QUAD:DMPS:600:IRIPLOK") { field(DESC, "Ripple Current Status") field(INAM, "mgntInit") field(SNAM, "mgntRiplOK") field(INPA, "QUAD:DMPS:600:IRIPL.VAL") field(INPB, "QUAD:DMPS:600: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, "QUAD:DMPS:600:R") { field(DESC, "Resistance") field(EGU, "Ohms") field(PREC, "4") field(PINI, "YES") field(DOL, "QUAD:DMPS:500: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, "QUAD:DMPS:600:IGND") { field(DESC, "Ground Current") field(EGU, "A") field(PREC, "6") field(PINI, "YES") field(DOL, "QUAD:DMPS:500:IGND CP MS") field(OMSL, "closed_loop") } record(bi, "QUAD:DMPS:600:INTLKSUMY") { field(DESC, "Interlock Summary") field(INP, "QUAD:DMPS:500:INTLKSUMY CP MS") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(ZNAM, "OK") field(ONAM, "FAULT") field(PINI, "NO") } record(mbbo, "QUAD:DMPS:600: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, "QUAD:DMPS:500:COOLING CP NMS") field(OMSL, "closed_loop") } # The following PV is processed by :BACTFO # which is processed by :BACT record(fanout, "QUAD:DMPS:600:IACTFO") { field(DESC, "IACT processing") field(SELM, "All") field(LNK1, "QUAD:DMPS:600:IACTPREVOK") field(LNK2, "QUAD:DMPS:600:IDIFF") field(LNK3, "QUAD:DMPS:600:IADIFF") field(LNK4, "QUAD:DMPS:600:IRATIO") field(LNK5, "QUAD:DMPS:600:IDIRECT") field(LNK6, "QUAD:DMPS:600:IACTPOL_CHECK") } record(calc, "QUAD:DMPS:600:IDIFF") { field(DESC, "IDES-IACT") field(CALC, "A-B") field(INPA, "QUAD:DMPS:600:IDES") field(INPB, "QUAD:DMPS:600:IACT") field(EGU, "A") field(PREC, "9") field(HOPR, "150.0") field(LOPR, "0.0") } record(calc, "QUAD:DMPS:600:IADIFF") { field(DESC, "Absolute IDES-IACT") field(CALC, "A<0?ABS(A):A") field(INPA, "QUAD:DMPS:600:IDIFF") field(PREC, "9") } record(calc, "QUAD:DMPS:600:IRATIO") { field(DESC, "IDES-IACT/IMAX") field(CALC, "B?A/B:0") field(INPA, "QUAD:DMPS:600:IDIFF") field(INPB, "QUAD:DMPS:600:IDES.DRVH") field(PREC, "9") } record(calcout, "QUAD:DMPS:600:IRANGE") { field(DESC, "Current Range") field(PINI, "YES") field(CALC, "ABS(A-B)") field(INPA, "QUAD:DMPS:600:IMIN") field(INPB, "QUAD:DMPS:600: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, "QUAD:DMPS:600: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, "QUAD:DMPS:600:IACT") field(FLNK, "QUAD:DMPS:600:IACTPOL") } record(bo, "QUAD:DMPS:600:IACTPOL") { field(DESC, "Actual I Polarity") field(DTYP, "Raw Soft Channel") field(DOL, "QUAD:DMPS:600: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,"QUAD:DMPS:600:I*LIMITS:\n Calculate alarm and warning limits based on \n deltas from QUAD:DMPS:600:IDELTAS and the\n QUAD:DMPS:600: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,"QUAD:DMPS:600:IACT: \n Get copy of QUAD:DMPS:600:I. \n",null) #! TextBox(TB12,1280,3100,1760,3200,0,"Dialog",12,1,16777215,"QUAD:DMPS:600: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,"QUAD:DMPS:600:IDES:\n Contains raw value calculated by \nQUAD:DMPS:600: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 \nQUAD:DMPS:600:BDELTAS.\n",null) #! TextBox(TB10,56,1940,316,2340,0,"Dialog",12,1,16777215,"QUAD:DMPS:600: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 QUAD:DMPS:600: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 QUAD:DMPS:600: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,"QUAD:DMPS:600:ISETPT:\n Sets the hardware. When fast feedback is set on, this record is\n set to closed loop mode by QUAD:DMPS:600:FBCKSTART sequence. When \n the loop is closed, this record takes input calculated by \n BFBCK only. When fast feedback is set off, QUAD:DMPS:600:FBCKSTOP \n will set it back to supervisory so that the value can be set by \n QUAD:DMPS:600: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, "QUAD:DMPS:600:TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "QUAD:DMPS:600:TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "QUAD:DMPS:600:TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "QUAD:DMPS:600:TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "QUAD:DMPS:600:TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "QUAD:DMPS:600:TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "1") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "QUAD:DMPS:600: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, "QUAD:DMPS:600:TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "QUAD:DMPS:600:TRIMTYPE.RVAL") field(INPB, "QUAD:DMPS:600:CONFIG.RVAL") field(OUT, "QUAD:DMPS:600:TRIMMAXNUM PP") } record(longout, "QUAD:DMPS:600: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, "QUAD:DMPS:600: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, "QUAD:DMPS:500:TRIMRAMPRATE CP NMS") field(OMSL, "closed_loop") field(VAL, "") field(OUT, "QUAD:DMPS:600:IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "QUAD:DMPS:600: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, "QUAD:DMPS:500:TRIMSETL CP NMS") field(OMSL, "closed_loop") field(VAL, "") } record(bo, "QUAD:DMPS:600: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, "QUAD:DMPS:600: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, "QUAD:DMPS:600: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, "0") } record(bo, "QUAD:DMPS:600:SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "0") } record(ao, "QUAD:DMPS:600: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, "QUAD:DMPS:600:IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "QUAD:DMPS:600: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, "QUAD:DMPS:600: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, "QUAD:DMPS:600:IMOVE") field(INPB, "QUAD:DMPS:600:IACT") field(INPC, "QUAD:DMPS:600:IRAMPRATE") field(INPD, "1.0") field(INPE, "QUAD:DMPS:600:TRIMDLYPCT") field(INPF, "QUAD:DMPS:600:STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "QUAD:DMPS:600:RAMPTIME_LEFT PP") } record(longout, "QUAD:DMPS:600:RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "QUAD:DMPS:600:RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "QUAD:DMPS:600:RAMPDONE_CALC") } record(calc, "QUAD:DMPS:600:RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "QUAD:DMPS:600:RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "QUAD:DMPS:600:RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "QUAD:DMPS:600: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, "QUAD:DMPS:600:RAMPTIME_LEFT") field(OUT, "QUAD:DMPS:600:RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "QUAD:DMPS:600:RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "QUAD:DMPS:600:RAMPTIME_LEFT NMS") field(OUT, "QUAD:DMPS:600:RAMPDONE PP") } record(bo, "QUAD:DMPS:600:RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "QUAD:DMPS:600:RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "QUAD:DMPS:600: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, "QUAD:DMPS:600: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, "QUAD:DMPS:600:STDZINIT") { field(DESC, "Proc. Stdz PVs on boot") field(PINI, "YES") field(DOL1, "1") field(DOL2, "1") field(DOL3, "1") field(LNK1, "QUAD:DMPS:600:DEBUG.PROC PP") field(LNK2, "QUAD:DMPS:600:STDZCYCLENUM.PROC PP") field(LNK3, "QUAD:DMPS:600:STDZDISABLE.PROC PP") field(LNK4, "QUAD:DMPS:600: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, "QUAD:DMPS:600:STDZSUB") { field(DESC, "Stdz subroutine") field(INAM, "mgntStdzInit") field(SNAM, "mgntStdz") field(BRSV, "INVALID") field(INPA, "QUAD:DMPS:600:STDZIMIN NPP NMS") field(INPB, "QUAD:DMPS:600:STDZIMAX NPP NMS") field(INPC, "QUAD:DMPS:600:STDZIFINAL NPP NMS") field(INPD, "QUAD:DMPS:600:STDZCYCLENUM NPP NMS") field(INPE, "QUAD:DMPS:600:STDZDIRECT.RVAL NPP NMS") field(INPF, "QUAD:DMPS:600:STDZDISABLE.RVAL CPP NMS") field(INPG, "QUAD:DMPS:600: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, "QUAD:DMPS:600:STDZWF PP") field(OUTB, "QUAD:DMPS:600: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, "QUAD:DMPS:600:STDZWF") } record(mbbo, "QUAD:DMPS:600: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, "QUAD:DMPS:600: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, "QUAD:DMPS:600:STDZMAINPS") { field(DESC, "Stdz by main or self") field(PINI, "YES") field(DTYP, "Soft Channel") field(ZNAM, "SELF") field(ONAM, "MAIN") } record(bo, "QUAD:DMPS:600: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, "QUAD:DMPS:600: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, "QUAD:DMPS:600: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, "QUAD:DMPS:600:STDZTOD") { field(DESC, "Successful Standardize Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "QUAD:DMPS:600:STDZLOSTTOD") { field(DESC, "Standardize Lost Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(longout, "QUAD:DMPS:600:STDZCYCLECNT") { field(DESC, "Cycle Count") field(PINI, "YES") } record(longout, "QUAD:DMPS:600: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, "QUAD:DMPS:600:STDZDIRECT") } # The default standardize direction is "UP" for # all LCLS Magnets.. record(bo, "QUAD:DMPS:600:STDZDIRECT") { field(DESC, "Standardize Direction ") field(ZNAM, "UP") field(ONAM, "DOWN") field(VAL, "0") field(FLNK, "QUAD:DMPS:600:STDZIMIN") } record(ao, "QUAD:DMPS:600:STDZIMIN") { field(DESC, "Min-STDZ Current") field(PREC, "1") field(EGU, "A") field(HOPR, "150.0") field(LOPR, "0.0") field(VAL, "0.0") field(FLNK, "QUAD:DMPS:600:STDZIMAX") } record(ao, "QUAD:DMPS:600:STDZIMAX") { field(DESC, "Max. Standarize Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "150.0") field(LOPR, "0.0") field(VAL, "150.0") field(FLNK, "QUAD:DMPS:600:STDZIFINAL") } record(ao, "QUAD:DMPS:600:STDZIFINAL") { field(DESC, "Final SDTZ Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "150.0") field(LOPR, "0.0") field(VAL, "0.0") field(FLNK, "QUAD:DMPS:600: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, "QUAD:DMPS:600: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, "QUAD:DMPS:600:STDZITOL") { field(DESC, "Stdz min tolerance") field(PREC, "5") field(CALC, "MAX(ABS(A),ABS(B))*C") field(INPA, "QUAD:DMPS:600:STDZIMIN CP NMS") field(INPB, "QUAD:DMPS:600:STDZIMAX CP MMS") field(INPC, "0.05") field(INPD, "QUAD:DMPS:600:STDZITOLR CP MMS") field(EGU, "A") field(FLNK, "QUAD:DMPS:600:IDELTAS") field(PINI, "YES") } # D - factor (3.154/2 = 1.577) for EPSC, otherwise, set to 1.0 record(calc, "QUAD:DMPS:600:STDZDLY") { field(DESC, "Ramp time for stdz cycle") field(CALC, "C>0?MAX(1,ABS((A-B)/C)*D):0") field(INPA, "QUAD:DMPS:600:STDZIMIN CP NMS") field(INPB, "QUAD:DMPS:600:STDZIMAX CP NMS") field(INPC, "QUAD:DMPS:600:TRIMRAMPRATE CP NMS") field(INPD, "1.0") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") } record(calc, "QUAD:DMPS:600:STDZRAMPDLY") { field(DESC, "Ramp delay total") field(CALC, "MAX(1,((A/100)*B+B))") field(PREC, "5") field(INPA, "QUAD:DMPS:600:TRIMDLYPCT CP MS") field(INPB, "QUAD:DMPS:600: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, "QUAD:DMPS:600:STDZMINIDLY") { field(DESC, "Mini-stdz delay") field(CALC, "A") field(PREC, "5") field(A, "1.0") field(EGU, "sec") field(PINI, "YES") } record(ao, "QUAD:DMPS:600: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, "QUAD:DMPS:600:STDZMINIDELTA") { field(DESC, "Stdz mini % of IMAX") field(CALC, "(B/100)*(A-C)") field(INPA, "QUAD:DMPS:600:IDES.HOPR") field(INPB, "QUAD:DMPS:600:STDZMINIPCT CPP NMS") field(INPC, "QUAD:DMPS:600:IDES.LOPR") field(PREC, "5") } record(calc, "QUAD:DMPS:600:STDZMINISETPT") { field(DESC, "Mini Stdz delta") field(CALC, "C==0?MAX(E-D,B):MIN(E+D,A)") field(INPA, "QUAD:DMPS:600:IDES.HOPR") field(INPB, "QUAD:DMPS:600:IDES.LOPR") field(INPC, "QUAD:DMPS:600:STDZDIRECT.RVAL") field(INPD, "QUAD:DMPS:600:STDZMINIDELTA") field(INPE, "QUAD:DMPS:600:IDES") field(PREC, "5") field(FLNK, "QUAD:DMPS:600: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, "QUAD:DMPS:600:STDZMINISETPTOOR") { field(DESC, "Mini Stdz setpoint out of range") field(CALC, "C==0?(E-DA)") field(INPA, "QUAD:DMPS:600:IDES.HOPR") field(INPB, "QUAD:DMPS:600:IDES.LOPR") field(INPC, "QUAD:DMPS:600:STDZDIRECT.RVAL") field(INPD, "QUAD:DMPS:600:STDZMINIDELTA") field(INPE, "QUAD:DMPS:600: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, "QUAD:DMPS:600: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, "QUAD:DMPS:600:IADJUST.RVAL") field(INPB, "QUAD:DMPS:600:STDZDIRECT.RVAL") field(INPC, "QUAD:DMPS:600:STDZOK.RVAL") field(INPD, "QUAD:DMPS:600:STDZDISABLE.RVAL") field(INPE, "QUAD:DMPS:600:STATE.RVAL CPP NMS") field(INPF, "QUAD:DMPS:600:ICTRL.RVAL") field(INPG, "QUAD:DMPS:600:STATE.SEVR") field(INPH, "QUAD:DMPS:600:BDELTAS.M") field(INPI, "QUAD:DMPS:600:IACT.SEVR") field(OUT, "QUAD:DMPS:600:STDZLOSTGO.SELN PP NMS") field(OOPT, "Transition To Non-zero") } record(seq, "QUAD:DMPS:600:STDZLOSTGO") { field(DESC, "Process lost stdz") field(SELM, "Mask") field(DOL1, "1") field(DOL2, "0") field(LNK1, "QUAD:DMPS:600:STDZLOSTTOD.PROC") field(LNK2, "QUAD:DMPS:600:STDZOK PP") } # Record maximum current after standardize # Reset to IACT from sequence after trim # Disable processing during (mini-)standardize or trim record(calc, "QUAD:DMPS:600:STDZIACTMAX") { field(DESC, "Max act current after stdz") field(CALC, "MAX(A, B)") field(DISV, "0") field(SDIS, "QUAD:DMPS:600:CHECKPWRDIP_ENABLE") field(INPA, "QUAD:DMPS:600:IACT CP") field(INPB, "QUAD:DMPS:600:STDZIACTMAX") field(EGU, "A") field(FLNK, "QUAD:DMPS:600:CHECKPWRDIP") } # Detect power dip if STDZOK is YES, STDZ is enabled, and IACT is valid # If IACT drops below STDZIACTMAX by more than the trim tolerance, clear STDZOK # Warning: Take the absolute value of the trim tolerance, or else quads of # negative polarity will always lose STDZ since their IDELTAS.I are negative. # Note: Large quads and bends are prone to losing STDZ even if they are # perturbed toward higher current since their current tends to overshoot # by greater than the trim tolerance before settling down. record(calcout, "QUAD:DMPS:600:CHECKPWRDIP") { field(DESC, "Detect power dip") field(CALC, "(A-B>ABS(C))?3:0") field(DISV, "0") field(SDIS, "QUAD:DMPS:600:CHECKPWRDIP_ENABLE") field(INPA, "QUAD:DMPS:600:STDZIACTMAX") field(INPB, "QUAD:DMPS:600:IACT") field(INPC, "QUAD:DMPS:600:IDELTAS.I") field(OUT, "QUAD:DMPS:600:STDZLOSTGO.SELN PP NMS") field(OOPT, "When Non-zero") } # Enable processing of STDZIACTMAX and CHECKPWRDIP only if # STDZOK = YES, STDZDISABLE = NO, CTRL != Trim (2), and # CTRL != Stdz (4) record(calc, "QUAD:DMPS:600:CHECKPWRDIP_ENABLE") { field(CALC, "A&&!B&&(C#2)&&(C#4)") field(INPA, "QUAD:DMPS:600:STDZOK.RVAL CP") field(INPB, "QUAD:DMPS:600:STDZDISABLE.RVAL CP") field(INPC, "QUAD:DMPS:600:CTRL.RVAL CP") } #! 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, "QUAD:DMPS:600: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, "QUAD:DMPS:600: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, "QUAD:DMPS:600:CALBSET") { field(DESC, "Use DAC Calbration") field(SCAN, "10 second") field(CALC, "A&&(B==0)&&C?31:960") field(INPA, "QUAD:DMPS:600:CALBOK") field(INPB, "QUAD:DMPS:600:CALBDISABLE") field(INPC, "QUAD:DMPS:600:CALBSLOPE") field(OOPT, "On Change") field(OUT, "QUAD:DMPS:600: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, "QUAD:DMPS:600:CALB_SEQ") { field(DESC, "Output Calib Values") field(SELM, "Mask") field(SELL, "QUAD:DMPS:600: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, "QUAD:DMPS:600:CALBSLOPE") field(DOL3, "QUAD:DMPS:600: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, "QUAD:DMPS:600:CALBTOD") { field(DESC, "Calibration Success Time") field(PINI, "YES") # field(DOL, "") field(OMSL, "supervisory") field(DTYP, "Soft Channel") info(autosaveFields,"VAL") } record(ao, "QUAD:DMPS:600: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, "QUAD:DMPS:600: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, "QUAD:DMPS:600: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, "QUAD:DMPS:600:CALBOFFSET") { field(DESC, "Calc DAC Offset") field(PREC, "6") field(EGU, "Counts") field(PINI, "YES") } record(bo, "QUAD:DMPS:600: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, "QUAD:DMPS:600:DACSLOPE") { field(DESC, "V to DAC slope") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "supervisory") field(PINI, "YES") field(FLNK, "QUAD:DMPS:600:DACOFFSET") } # Default Offset used in conversion from Volts to DAC Counts record(ao, "QUAD:DMPS:600:DACOFFSET") { field(DESC, "V to DAC offset") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "supervisory") field(PINI, "YES") field(FLNK, "QUAD:DMPS:600: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, "QUAD:DMPS:600: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, "QUAD:DMPS:600:IACT") field(INPD, "QUAD:DMPS:600:DACSLOPE") field(INPE, "QUAD:DMPS:600:DACOFFSET") field(EGU, "Counts") field(PREC, "6") } record(ao, "QUAD:DMPS:600:DAC") { field(DESC, "DAC Set point") field(EGU, "Counts") field(DOL, "") field(OMSL, "supervisory") field(PREC, "6") field(PINI, "YES") } record(ao, "QUAD:DMPS:600:CALBIMIN") { field(DESC, "Calibration Min Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(DRVH, "150.0") field(HOPR, "150.0") field(DRVL, "0.0") field(LOPR, "0.0") field(PREC, "3") field(EGU, "A") field(VAL, "0.0") field(FLNK, "QUAD:DMPS:600:CALBIMAX") } record(ao, "QUAD:DMPS:600:CALBIMAX") { field(DESC, "Calibration Max Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(DRVH, "150.0") field(HOPR, "150.0") field(LOPR, "0.0") field(DRVL, "0.0") field(EGU, "A") field(VAL, "150.0") field(FLNK, "QUAD:DMPS:600:CALBSTEPNUM") } record(ao, "QUAD:DMPS:600:CALBIFINAL") { field(DESC, "Calibration Last Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(PREC, "3") field(EGU, "A") field(HOPR, "150.0") field(LOPR, "0.0") field(VAL, "0") } record(longout, "QUAD:DMPS:600: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, "QUAD:DMPS:600:CALBIDELTA") } record(calc, "QUAD:DMPS:600:CALBIDELTA") { field(DESC, "Step size for CALB") field(CALC, "C=0?0:ABS((A-B)/C)") field(INPA, "QUAD:DMPS:600:CALBIMAX") field(INPB, "QUAD:DMPS:600:CALBIMIN") field(INPC, "QUAD:DMPS:600: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, "QUAD:DMPS:600:CALBIMULT") { field(DESC, "IACT vs ISETPT mult") field(CALC, "C#0||A=0?1:ABS(B/A)") field(INPA, "QUAD:DMPS:500:ISETPT.DRVH") field(INPB, "QUAD:DMPS:500:IACT.HOPR") field(INPC, "QUAD:DMPS:600:PSCONTROLLER.RVAL CPP") field(EGU, "A") field(PINI, "YES") } # SNL dbputs DAC values here. 6-10 steps are possible. record(waveform, "QUAD:DMPS:600:CALBICTRLWF") { field(DESC, "ICTRL setpoint array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") } record(waveform, "QUAD:DMPS:600:DACWF") { field(DESC, "DAC count array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:DMPS:600:DACSA") } # Used only for xygraph edm plot record(subArray, "QUAD:DMPS:600:DACSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "QUAD:DMPS:600: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, "QUAD:DMPS:600:CALCDACWF") { field(DESC, "Calc DAC counts array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:DMPS:600:CALCDACSA") } # Used only for xygraph edm plot record(subArray, "QUAD:DMPS:600:CALCDACSA") { field(DESC, "Calc DAC counts") field(DTYP, "Soft Channel") field(INP, "QUAD:DMPS:600: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, "QUAD:DMPS:600:CALBYWF") { field(DESC, "mx + b") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:DMPS:600:CALBYSA") } # Used only for xygraph edm plot record(subArray, "QUAD:DMPS:600:CALBYSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "QUAD:DMPS:600:CALBYWF") field(MALM, "10") field(NELM, "6") field(INDX, "0") field(FTVL, "DOUBLE") } record(waveform, "QUAD:DMPS:600:CALBIACTWF") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "QUAD:DMPS:600:CALBIACTSA") } # Used only for xygraph edm plot record(subArray, "QUAD:DMPS:600:CALBIACTSA") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(MALM, "10") field(NELM, "6") field(INP, "QUAD:DMPS:600:CALBIACTWF") field(INDX, "0") field(FTVL, "DOUBLE") field(FLNK, "QUAD:DMPS:600:CALBLIMITS") } # Check that measured current during calibration is within # tolerance. record(aSub, "QUAD:DMPS:600: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, "QUAD:DMPS:600:CALBSTEPNUM") field(INPB, "QUAD:DMPS:600:CALBIACTWF") field(INPC, "QUAD:DMPS:600: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, "QUAD:DMPS:600: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, "QUAD:DMPS:600:STDZITOL") field(INPH, "QUAD:DMPS:600:DACSLOPE") field(INPI, "QUAD:DMPS:600: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, "QUAD:DMPS:600: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, "QUAD:DMPS:600:CALBSTEPNUM") field(INPB, "QUAD:DMPS:600:CALBIACTWF") field(INPC, "QUAD:DMPS:600:DACWF") field(INPF, "QUAD:DMPS:600: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 QUAD:DMPS:600CALBOK 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, "QUAD:DMPS:600:DEGAUSINIT") { field(DESC, "Proc. Degauss PVs on boot") field(PINI, "YES") field(DOL, "1") field(OUTA, "QUAD:DMPS:600:DEGAUSIMIN.PROC PP") field(OUTB, "QUAD:DMPS:600:DEGAUSIMAX.PROC PP") field(OUTC, "QUAD:DMPS:600:DEGAUSTYPE.PROC PP") field(OUTD, "QUAD:DMPS:600:DEGAUSSTEP.PROC PP") field(OUTE, "QUAD:DMPS:600:MADNAME.PROC PP") field(OUTF, "QUAD:DMPS:600:PSTYPE.PROC PP") field(OUTG, "QUAD:DMPS:600: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, "QUAD:DMPS:600:DEGAUSSUB") { field(DESC, "Degauss subroutine") field(INAM, "mgntDegaussInit") field(SNAM, "mgntDegauss") field(BRSV, "INVALID") field(INPA, "QUAD:DMPS:600:DEGAUSIMIN NPP NMS") field(INPB, "QUAD:DMPS:600:DEGAUSIMAX NPP NMS") field(INPC, "QUAD:DMPS:600:DEGAUSTYPE.RVAL NPP NMS") field(INPE, "QUAD:DMPS:600:DEGAUSMETHOD.RVAL NPP NMS") field(INPF, "QUAD:DMPS:600:PSTYPE NPP NMS") field(INPG, "QUAD:DMPS:600:DEBUG.RVAL NPP NMS") field(INPH, "QUAD:DMPS:600: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, "QUAD:DMPS:600:DEGAUSWF PP") field(OUTB, "QUAD:DMPS:600:DEGAUSMSG PP") field(OUTC, "QUAD:DMPS:600: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, "QUAD:DMPS:600:DEGAUSWF") { field(DESC, "Degauss Setpts") field(NELM, "60") field(FTVL, "DOUBLE") } record(mbbo,"QUAD:DMPS:600: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, "QUAD:DMPS:600: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, "QUAD:DMPS:600: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, "QUAD:DMPS:600: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, "QUAD:DMPS:600: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, "QUAD:DMPS:600:DEGAUSIMIN") { field(DESC, "Min. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "150.0") field(LOPR, "-150.0") field(DRVH, "150.0") field(DRVL, "-150.0") field(VAL, "-150.0") } record(ao, "QUAD:DMPS:600:DEGAUSIMAX") { field(DESC, "Max. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "150.0") field(LOPR, "-150.0") field(DRVH, "150.0") field(DRVL, "-150.0") field(VAL, "150.0") } # 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,"QUAD:DMPS:600: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, "QUAD:DMPS:600: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,"QUAD:DMPS:600: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, "QUAD:DMPS:600: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, "QUAD:DMPS:600: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, "QUAD:DMPS:600: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, "QUAD:DMPS:600:DEGAUSTOD") { field(DESC, "Successful Degauss Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "QUAD:DMPS:600:DEGAUSLOSTTOD") { field(DESC, "Degauss Lost Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "QUAD:DMPS:600:DEGAUSTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "QUAD:DMPS:600:DEGAUSTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "QUAD:DMPS:600: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, "QUAD:DMPS:600:DEGAUSGO") { field(DESC, "Set bdes of btrms to zero") field(ASG, "Internal") field(OUTA, "") field(OUTB, "") field(OUTC, "") field(OUTD, "") } # =========== CRYO ONLY =========== record(bo, "QUAD:DMPS:600: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, "QUAD:DMPS:600:DEGAUS_IMAX_CHECK") { field(DESC, "Check if imax shoud chg") field(CALC, "(C==4)&&(ABS(B)>ABS(A))?1:0") field(INPA, "QUAD:DMPS:600:DEGAUS_IMAX") field(INPB, "QUAD:DMPS:600:ISETPT") field(INPC, "QUAD:DMPS:600:DEGAUSTYPE.RVAL") field(OUT, "QUAD:DMPS:600:DEGAUS_IMAX_UPDATE.SELN") field(FLNK, "QUAD:DMPS:600:DEGAUS_IMAX_UPDATE") } record(seq, "QUAD:DMPS:600:DEGAUS_IMAX_UPDATE") { field(DESC, "Degauss IMAX Update") field(SELM, "Specified") field(DOL1, "QUAD:DMPS:600:ISETPT") field(LNK1, "QUAD:DMPS:600:DEGAUS_IMAX PP") } # Set the maximum current after a successful # degauss. This pv is updated by the # sequence. record(ao, "QUAD:DMPS:600:DEGAUS_IMAX") { field(DESC, "Max I set afer a degauss") field(EGU, "Amps") field(PINI, "YES") field(PREC, "6") field(HOPR, "150.0") field(LOPR, "-150.0") field(DRVH, "150.0") field(DRVL, "-150.0") field(VAL, "150.0") field(FLNK, "QUAD:DMPS:600:DEGAUS_IMAXPOL_CHECK") info(autosaveFields,"VAL,RVAL") } # Set the polarity if degauss_imax record(calcout, "QUAD:DMPS:600:DEGAUS_IMAXPOL_CHECK") { field(DESC, "Determine polarity of imax") field(CALC, "A>=0?0:1") field(INPA, "QUAD:DMPS:600:DEGAUS_IMAX") field(FLNK, "QUAD:DMPS:600:DEGAUS_IMAXPOL") } record(bo, "QUAD:DMPS:600:DEGAUS_IMAXPOL") { field(DESC, "Polarity of imax I") field(DTYP, "Raw Soft Channel") field(DOL, "QUAD:DMPS:600:DEGAUS_IMAXPOL_CHECK") field(OMSL, "closed_loop") field(ZNAM, "Positive") field(ONAM, "Negative") field(FLNK, "QUAD:DMPS:600: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, "QUAD:DMPS:600:DEGAUS_ABSIMAX") { field(DESC, "Absolute Max. Degauss I") field(CALC, "ABS(A)") field(INPA, "QUAD:DMPS:600:DEGAUS_IMAX") field(PREC, "6") field(EGU, "Amps") field(HOPR, "150.0") field(LOPR, "-150.0") info(autosaveFields,"VAL RVAL") } # IACT Polarity record(calcout, "QUAD:DMPS:600:IACTPOL_CHECK") { field(DESC, "Determine IACT polarity") field(SCAN, "5 second") field(CALC, "ABS(A-B)>C?(A>=0?0:1):D") field(INPA, "QUAD:DMPS:600:IACT") field(INPB, "QUAD:DMPS:600:IACTPOL_CHECK.LA") field(INPC, "0.0001") field(INPD, "QUAD:DMPS:600:IACTPOL_CHECK.PVAL") field(OOPT, "On Change") field(FLNK, "QUAD:DMPS:600:IACTPOL") } record(bo, "QUAD:DMPS:600: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,"QUAD:DMPS:600: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, "QUAD:DMPS:600:DEGAUSENABLE CP") field(INPB, "QUAD:DMPS:600:DEGAUSOK") field(INPC, "QUAD:DMPS:600:STATE CP") field(INPD, "QUAD:DMPS:600:STATE.SEVR") field(OUT, "QUAD:DMPS:600:DEGAUS_STATE_SEQ.SELN PP") field(ASG, "Internal") } record(seq, "QUAD:DMPS:600:DEGAUS_STATE_SEQ") { field(DESC, "Degauss State Sequence") field(SELM, "Specified") field(SELL, "QUAD:DMPS:600:DEGAUS_STATE_CHECK") field(LNK1, "QUAD:DMPS:600:DEGAUS_STATE_DISABLE.PROC PP") field(LNK2, "QUAD:DMPS:600:DEGAUS_STATE_LOST.PROC PP") field(LNK3, "QUAD:DMPS:600:DEGAUS_STATE_GOOD.PROC PP") field(LNK4, "QUAD:DMPS:600: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, "QUAD:DMPS:600:DEGAUS_STATE_DISABLE") { field(DESC, "Degauss not used") field(LNK1, "QUAD:DMPS:600:DEGAUSOK.ZSV") field(LNK2, "QUAD:DMPS:600: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, "QUAD:DMPS:600:STATMSG.FRSV") field(LNK4, "QUAD:DMPS:600: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, "QUAD:DMPS:600:DEGAUS_STATE_LOST") { field(DESC, "Degauss lost and ps On") field(DOL1, "1") field(LNK1, "QUAD:DMPS:600:DEGAUSOK.ZSV") field(LNK2, "QUAD:DMPS:600: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, "QUAD:DMPS:600:STATMSG.FRSV") field(LNK4, "QUAD:DMPS:600: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, "QUAD:DMPS:600:DEGAUS_STATE_OFF") { field(DESC, "Degaused lost and ps Off") field(DOL1, "2") field(LNK1, "QUAD:DMPS:600: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, "QUAD:DMPS:600:STATMSG.FRSV") field(LNK3, "QUAD:DMPS:600: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, "QUAD:DMPS:600:DEGAUS_STATE_GOOD") { field(DESC, "Degauss good") field(DOL1, "1") field(LNK1, "QUAD:DMPS:600: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, "QUAD:DMPS:600:STATMSG.FRSV PP") field(LNK3, "QUAD:DMPS:600:STATMSG.FVSV PP") field(LNK4, "") field(ASG, "Internal") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(mbbo, "QUAD:DMPS:600:FUNC") { field(DESC, "QUAD:DMPS:600 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, "0") field(FFVL, "0") field(OUT, "QUAD:DMPS:600:CTRL CA") } # :CTRL pv is processed at boot in the # sequence mgntCtrl.st Processed in sequence # record(mbbo, "QUAD:DMPS:600:CTRL") { field(DESC, "QUAD:DMPS:600 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, "QUAD:DMPS:600:SELECTEN.A PP") field(SDIS, "0") } # If a function has been selected set this unit to busy record(calcout, "QUAD:DMPS:600:SELECTEN") { field(DESC, "Control Select Enable") field(CALC, "A>0?1:A") field(FLNK, "QUAD:DMPS:600:BUSY") } # Set to FREE on IOC reboot record(bo, "QUAD:DMPS:600:BUSY") { field(DESC, "QUAD:DMPS:600 Ctrl Done") field(DOL, "QUAD:DMPS:600:SELECTEN") field(ZNAM, "FREE") field(ONAM, "BUSY") field(PINI, "YES") field(FLNK, "QUAD:DMPS:600:SELECT") } record(bo, "QUAD:DMPS:600:SELECT") { field(ZNAM, "NO") field(ONAM, "YES") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") } record(bo, "QUAD:DMPS:600: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, "QUAD:DMPS:600:CTRLSTATE") { field(DESC, "QUAD:DMPS:600 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("QUAD:DMPS:600:CTRL",20,20,0,0,"QUAD:DMPS:600:CTRL") #! Field("QUAD:DMPS:600:CTRL.OUT",16777215,1,"QUAD:DMPS:600:CTRL.OUT") #! Link("QUAD:DMPS:600:CTRL.OUT","QUAD:DMPS:600:SELECTEN.A") #! Field("QUAD:DMPS:600:CTRL.VAL",16777215,1,"QUAD:DMPS:600:CTRL.VAL") #! Record("QUAD:DMPS:600:SELECTEN",321,381,0,0,"QUAD:DMPS:600:SELECTEN") #! Field("QUAD:DMPS:600:SELECTEN.A",16777215,0,"QUAD:DMPS:600:SELECTEN.A") #! Field("QUAD:DMPS:600:SELECTEN.FLNK",16777215,1,"QUAD:DMPS:600:SELECTEN.FLNK") #! Link("QUAD:DMPS:600:SELECTEN.FLNK","QUAD:DMPS:600:BUSY") #! Field("QUAD:DMPS:600:SELECTEN.VAL",16777215,1,"QUAD:DMPS:600:SELECTEN.VAL") #! Record("QUAD:DMPS:600:BUSY",623,274,0,0,"QUAD:DMPS:600:BUSY") #! Field("QUAD:DMPS:600:BUSY.DOL",16777215,0,"QUAD:DMPS:600:BUSY.DOL") #! Link("QUAD:DMPS:600:BUSY.DOL","QUAD:DMPS:600:SELECTEN.VAL") #! Field("QUAD:DMPS:600:BUSY.FLNK",16777215,1,"QUAD:DMPS:600:BUSY.FLNK") #! Link("QUAD:DMPS:600:BUSY.FLNK","QUAD:DMPS:600:SELECT") #! Record("QUAD:DMPS:600:SELECT",669,508,0,1,"QUAD:DMPS:600:SELECT") #! Record("QUAD:DMPS:600:FUNC",940,120,0,0,"QUAD:DMPS:600:FUNC") #! Field("QUAD:DMPS:600:FUNC.OUT",16777215,0,"QUAD:DMPS:600:FUNC.OUT") #! Link("QUAD:DMPS:600:FUNC.OUT","QUAD:DMPS:600:CTRL.VAL") #! Record("QUAD:DMPS:600:ABORT",193,41,0,0,"QUAD:DMPS:600:ABORT") #! Record("QUAD:DMPS:600:CTRLSTATE",369,34,0,0,"QUAD:DMPS:600: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,"QUAD:DMPS:600:SELECT is used for Multi-device selection.\nIt is enabled when associated QUAD:DMPS:600:CTRL is \"0\" (DONE).\nIt is disabled when associated QUAD:DMPS:600: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,"QUAD:DMPS:600: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, "QUAD:DMPS:600:BCTRL_INIT") { field(DESC, "Process BCTRL on boot") field(PINI, "YES") field(CALC, "A=3?1:0") field(INPA, "QUAD:DMPS:600:BCTRL.SEVR") field(OUT, "QUAD:DMPS:600: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, "QUAD:DMPS:600:BACT") { field(DESC, "Actual B") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "QUAD:DMPS:600:BACT") field(INPB, "QUAD:DMPS:600:POLYCOEF") field(INPC, "QUAD:DMPS:600:POLYCOEF.A") field(INPD, "QUAD:DMPS:600:POLYCOEF.B") field(INPE, "QUAD:DMPS:600:IACT MS") field(INPF, "QUAD:DMPS:600:BDELTAS PP") field(INPG, "100") field(EGU, "kG") field(HOPR, "-0.0873") field(LOPR, "-38.5868") field(HIHI, "-0.0873") field(LOLO, "-38.5868") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "-0.0873") field(LOW, "-38.5868") field(FLNK, "QUAD:DMPS:600: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, "QUAD:DMPS:600:BDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntPhyDeltas") field(EGU, "kG") field(HOPR, "1") field(PREC, "7") field(BRSV, "INVALID") field(INPA, "QUAD:DMPS:600:BDES") field(INPB, "QUAD:DMPS:600:TRIMBTOL") field(INPC, "QUAD:DMPS:600:TRIMBTOLR") field(INPD, "QUAD:DMPS:600:CHCKBTOL") field(INPE, "QUAD:DMPS:600:CHCKBTOLR") field(F, "2.0") field(INPG, "30") field(INPH, "QUAD:DMPS:600:BACT.VAL") # # MPS absolute and relative tolerances field(INPP, "QUAD:DMPS:600:MPSBTOL") field(INPQ, "QUAD:DMPS:600:MPSBTOLR") field(FLNK, "QUAD:DMPS:600:BCONLIMITS") info(autosaveFields,"F") } # This record is processed by BDELTAS record(aSub, "QUAD:DMPS:600:BCONLIMITS") { field(DESC, "Config B-field Limits") field(INAM, "mgntInit") field(SNAM, "mgntBCONLimits") field(INPA, "QUAD:DMPS:600:BDES") field(INPB, "QUAD:DMPS:600:BDELTAS.I") field(INPG, "QUAD:DMPS:600:DEBUG.RVAL") field(FTA, "DOUBLE") field(FTB, "DOUBLE") field(FTG, "ULONG") field(OUTA, "QUAD:DMPS:600:BCON.HIGH") field(OUTB, "QUAD:DMPS:600:BCON.LOW") field(OUTC, "QUAD:DMPS:600:BCON.HIHI") field(OUTD, "QUAD:DMPS:600:BCON.LOLO PP") field(FTVA, "DOUBLE") field(FTVB, "DOUBLE") field(FTVC, "DOUBLE") field(FTVD, "DOUBLE") field(BRSV, "INVALID") field(FLNK, "QUAD:DMPS:600:IDELTAS") } # The following PV is processed by :BACT # which is processed by :BACT # record(fanout, "QUAD:DMPS:600:BACTFO") { field(DESC, "BACT processing") field(SELM, "All") field(LNK1, "QUAD:DMPS:600:BDIFF") field(LNK2, "QUAD:DMPS:600:BADIFF") field(LNK3, "QUAD:DMPS:600:BRATIO") field(LNK4, "QUAD:DMPS:600:MPSLIMITS") field(LNK5, "QUAD:DMPS:600:I2BSTATUS") field(LNK6, "QUAD:DMPS:600:IACTFO.PROC") } record(calc, "QUAD:DMPS:600:BDIFF") { field(DESC, "BDES-BACT") field(CALC, "A-B") field(INPA, "QUAD:DMPS:600:BDES") field(INPB, "QUAD:DMPS:600:BACT") field(EGU, "kG") field(PREC, "7") } record(calc, "QUAD:DMPS:600:BADIFF") { field(DESC, "Absolute BDES-BACT") field(INPA, "QUAD:DMPS:600:BDIFF") field(EGU, "kG") field(PREC, "7") field(CALC, "A<0?ABS(A):A") } record(calc, "QUAD:DMPS:600:BRATIO") { field(DESC, "BACT Error") field(CALC, "B?A/B:0") field(INPA, "QUAD:DMPS:600:BDIFF") field(INPB, "QUAD:DMPS:600:BDES.HOPR") field(EGU, "kG") field(PREC, "7") } record(mbbi, "QUAD:DMPS:600: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, "QUAD:DMPS:600:BACT.J") } # Note: for a string slave set the MONFL # macro to the following: # MONFL=:IMONCALC MS record(sub, "QUAD:DMPS:600:BMON") { field(DESC, "Second Transductor") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "QUAD:DMPS:600:BMON") field(INPB, "QUAD:DMPS:600:POLYCOEF") field(INPC, "QUAD:DMPS:600:POLYCOEF.A") field(INPD, "QUAD:DMPS:600:POLYCOEF.B") field(INPE, "QUAD:DMPS:600:IMON MS") field(INPF, "QUAD:DMPS:600:BDELTAS.VAL") field(INPG, "100") field(EGU, "kG") field(HOPR, "-0.0873") field(LOPR, "-38.5868") field(HIHI, "-0.0873") field(LOLO, "-38.5868") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "-0.0873") field(LOW, "-38.5868") } # 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=QUAD:DMPS:500:BDES CP record(ao, "QUAD:DMPS:600:BDES") { field(DESC, "Desired B-Field") field(PINI, "NO") field(DRVH, "-0.0873") field(DRVL, "-38.5868") field(HOPR, "-0.0873") field(LOPR, "-38.5868") field(PREC, "7") field(EGU, "kG") field(MDEL, "-1") field(OMSL, "closed_loop") field(DOL, "QUAD:DMPS:600:IDES2BDES") field(OUT, "QUAD:DMPS:600:B2IDES PP") info(autosaveFields,"VAL") } record(sub, "QUAD:DMPS:600:B2IDES") { field(DESC, "Convert Desired B-Field to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:DMPS:600:POLYCOEF") field(INPC, "QUAD:DMPS:600:POLYCOEF.A") field(INPD, "QUAD:DMPS:600:POLYCOEF.B") field(PREC, "7") field(EGU, "kG") field(HOPR, "-0.0873") field(LOPR, "-38.5868") field(MDEL, "-1") field(INPE, "QUAD:DMPS:600:BDES.DRVH") field(INPF, "QUAD:DMPS:600:BDES.DRVL") field(BRSV, "INVALID") field(FLNK, "QUAD:DMPS:600:IDES") } record(sub, "QUAD:DMPS:600:BNOM") { field(DESC, "Nominal Field") field(PINI, "YES") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:DMPS:600:POLYCOEF") field(INPC, "QUAD:DMPS:600:POLYCOEF.A") field(INPD, "QUAD:DMPS:600:POLYCOEF.B") field(INPE, "QUAD:DMPS:600:BDES.DRVH") field(INPF, "QUAD:DMPS:600:BDES.DRVL") field(EGU, "kG") field(HOPR, "-0.0873") field(LOPR, "-38.5868") field(PREC, "7") field(VAL, "0.0") field(FLNK, "QUAD:DMPS:600:INOM") } record(sub, "QUAD:DMPS:600:BACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:DMPS:600:BDES.VAL") field(INPB, "QUAD:DMPS:600:BDES.DRVH") field(INPC, "QUAD:DMPS:600:BDES.DRVL") field(INPD, "QUAD:DMPS:600:BDELTAS.I") field(INPE, "QUAD:DMPS:600:BDELTAS.J") field(INPG, "QUAD:DMPS:600:STATE") field(INPH, "QUAD:DMPS:600:HSTA") field(EGU, "kG") field(HOPR, "-0.0873") field(LOPR, "-38.5868") field(PREC, "7") field(BRSV, "INVALID") } record(sub, "QUAD:DMPS:600:BMONLIMITS") { field(DESC, "MON Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "QUAD:DMPS:600:BDES.VAL") field(INPB, "QUAD:DMPS:600:BDES.DRVH") field(INPC, "QUAD:DMPS:600:BDES.DRVL") field(INPD, "QUAD:DMPS:600:BDELTAS.K") field(INPE, "QUAD:DMPS:600:BDELTAS.L") field(INPG, "QUAD:DMPS:600:STATE") field(INPH, "QUAD:DMPS:600:HSTA") field(EGU, "kG") field(HOPR, "-0.0873") field(LOPR, "-38.5868") field(PREC, "7") field(BRSV, "INVALID") } record(seq, "QUAD:DMPS:600:BLIMITS") { field(DESC, "ACT Limits") field(PREC, "7") field(DOL1, "QUAD:DMPS:600:BLIMITS") field(LNK1, "QUAD:DMPS:600:BACTLIMITS.F PP") field(DOL2, "QUAD:DMPS:600:BACTLIMITS.I") field(LNK2, "QUAD:DMPS:600:BACT.HIGH") field(DOL3, "QUAD:DMPS:600:BACTLIMITS.J") field(LNK3, "QUAD:DMPS:600:BACT.LOW") field(DOL4, "QUAD:DMPS:600:BACTLIMITS.K") field(LNK4, "QUAD:DMPS:600:BACT.HIHI") field(DOL5, "QUAD:DMPS:600:BACTLIMITS.L") field(LNK5, "QUAD:DMPS:600:BACT.LOLO") field(DOL6, "QUAD:DMPS:600:BLIMITS") field(LNK6, "QUAD:DMPS:600:BMONLIMITS.F PP") field(DOL7, "QUAD:DMPS:600:BMONLIMITS.I") field(LNK7, "QUAD:DMPS:600:BMON.HIGH") field(DOL8, "QUAD:DMPS:600:BMONLIMITS.J") field(LNK8, "QUAD:DMPS:600:BMON.LOW") field(DOL9, "QUAD:DMPS:600:BMONLIMITS.K") field(LNK9, "QUAD:DMPS:600:BMON.HIHI") field(DOLA, "QUAD:DMPS:600:BMONLIMITS.L") field(LNKA, "QUAD:DMPS:600:BMON.LOLO") field(FLNK, "QUAD:DMPS:600:ILIMITS") field(SCAN, "5 second") } record(ao, "QUAD:DMPS:600:BCTRL") { field(DESC, "B-Perturb") field(PREC, "7") field(EGU, "kG") field(DRVH, "-0.0873") field(DRVL, "-38.5868") field(HOPR, "-0.0873") field(LOPR, "-38.5868") # 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, "QUAD:DMPS:600: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, "QUAD:DMPS:600:BCTRLGO") { field(DESC, "Update DES and perturb") field(PREC, "7") # Disable BACT limits field(DOL1, "1") field(LNK1, "QUAD:DMPS:600:BLIMITS.VAL") # Update BDES with the BCTRL (slider) value field(DOL2, "QUAD:DMPS:600:BCTRL.VAL") field(LNK2, "QUAD:DMPS:600:BDES PP") field(DOL3, "1") field(LNK3, "QUAD:DMPS:600:IDIRECT.PROC PP") field(DOL4, "1") field(LNK4, "QUAD:DMPS:600:CHECKSTDZLOST.PROC PP") field(DOL5, "QUAD:DMPS:600:BCTRL.VAL") field(LNK5, "QUAD:DMPS:600:BCTRLSUB PP") # Re-enable BACT limits field(DOL6, "0") field(LNK6, "QUAD:DMPS:600:BLIMITS.VAL") } # Convert B-field to Current and output to ISETPT record(sub, "QUAD:DMPS:600:BCTRLSUB") { field(DESC, "Feedback") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:DMPS:600:POLYCOEF") field(INPC, "QUAD:DMPS:600:POLYCOEF.A") field(INPD, "QUAD:DMPS:600:POLYCOEF.B") field(INPE, "QUAD:DMPS:600:BDES.DRVH") field(INPF, "QUAD:DMPS:600:BDES.DRVL") field(PREC, "7") field(EGU, "kG") field(HOPR, "-0.0873") field(LOPR, "-38.5868") field(MDEL, "-1") field(BRSV, "INVALID") field(FLNK, "QUAD:DMPS:600:ISETPT") } record(ao, "QUAD:DMPS:600:BDESPREVTRIM") { field(DESC, "trim bdes for undo") field(DTYP, "Soft Channel") field(DRVH, "-0.0873") field(DRVL, "-38.5868") field(EGU, "kG") field(HOPR, "-0.0873") field(LOPR, "-38.5868") field(PREC, "7") field(PINI, "YES") info(autosaveFields,"VAL") } record(stringin, "QUAD:DMPS:600:MADNAME") { field(DESC, "MAD deck nomenclature") field(PINI, "YES") field(VAL, "QDMP2B") } record(ai, "QUAD:DMPS:600: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, "3752.827538") } record(ao, "QUAD:DMPS:600:BMAX") { field(DESC, "Max B-Field") field(DTYP, "Soft Channel") field(DRVH, "-0.0873") field(DRVL, "-38.5868") field(EGU, "kG") field(HOPR, "-0.0873") field(LOPR, "-38.5868") field(PREC, "7") field(PINI, "YES") field(VAL, "-0.0873") field(FLNK, "QUAD:DMPS:600:BSTEP") } record(ao, "QUAD:DMPS:600:BMIN") { field(DESC, "Min B-Field") field(DTYP, "Soft Channel") field(DRVH, "-0.0873") field(DRVL, "-38.5868") field(EGU, "kG") field(HOPR, "-0.0873") field(LOPR, "-38.5868") field(PREC, "7") field(PINI, "YES") field(VAL, "-38.5868") field(FLNK, "QUAD:DMPS:600:BSTEP") } record(ao, "QUAD:DMPS:600:BDESSAVE") { field(DESC, "bdes for save/load") field(DTYP, "Soft Channel") field(DRVH, "-0.0873") field(DRVL, "-38.5868") field(EGU, "kG") field(HOPR, "-0.0873") field(LOPR, "-38.5868") field(PINI, "YES") field(PREC, "7") } # This record is processed by QUAD:DMPS:600: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, "QUAD:DMPS:600:BCON") { field(DESC, "Config B-Field ") field(DTYP, "Soft Channel") field(PREC, "7") field(EGU, "kG") field(HOPR, "-0.0873") field(LOPR, "-38.5868") field(DRVH, "-0.0873") field(DRVL, "-38.5868") # 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 , "QUAD:DMPS:600:ICON2BCON") field(OMSL, "closed_loop") field(OUT, "QUAD:DMPS:600:B2ICON PP") info(autosaveFields,"VAL") } record(sub, "QUAD:DMPS:600:B2ICON") { field(DESC, "Convert Desired ICon to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "QUAD:DMPS:600:POLYCOEF") field(INPC, "QUAD:DMPS:600:POLYCOEF.A") field(INPD, "QUAD:DMPS:600:POLYCOEF.B") field(PREC, "7") field(EGU, "kG") field(HOPR, "-0.0873") field(LOPR, "-38.5868") field(MDEL, "-1") field(INPE, "QUAD:DMPS:600:BCON.DRVH") field(INPF, "QUAD:DMPS:600:BCON.DRVL") field(BRSV, "INVALID") field(FLNK, "QUAD:DMPS:600: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, "QUAD:DMPS:600:BSTEP") { field(DESC, "B-Field step size") field(CALC, "(C==3)||(D==3)?0:ABS(A-B)*0.005") field(INPA, "QUAD:DMPS:600:BMAX") field(INPB, "QUAD:DMPS:600:BMIN") field(INPC, "QUAD:DMPS:600:BMIN.SEVR") field(INPD, "QUAD:DMPS:600:BMAX.SEVR") field(EGU, "kG") 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,"QUAD:DMPS:600:BCTRLDISABLECALC") { field(DESC, "Calc for disabling BCTRL") field(ASG, "Internal") field(CALC, "A?2:1") field(INPA, "QUAD:DMPS:600:ONLINE CP") field(OUT, "QUAD:DMPS:600:BCTRLDISABLEFOUT PP") } record(fanout, "QUAD:DMPS:600:BCTRLDISABLEFOUT") { field(DESC, "Disable BCTRL fanout") field(SELM, "Specified") field(SELL, "QUAD:DMPS:600:BCTRLDISABLECALC") field(LNK1, "QUAD:DMPS:600:BCTRLDISABLE") field(LNK2, "QUAD:DMPS:600:BCTRLENABLE") } record(stringout, "QUAD:DMPS:600:BCTRLDISABLE") { field(DESC, "Disable BCTRL") field(DTYP, "Soft Channel") field(OUT, "QUAD:DMPS:600:BCTRL.ASG") field(VAL, "NOWRITE") field(FLNK, "QUAD:DMPS:600:BCTRLDISV_UPDATE") } record(stringout, "QUAD:DMPS:600:BCTRLENABLE") { field(DESC, "Enable BCTRL") field(DTYP, "Soft Channel") field(OUT, "QUAD:DMPS:600:BCTRL.ASG") field(VAL, "") field(FLNK, "QUAD:DMPS:600:BCTRLDISV_UPDATE") } record(calcout, "QUAD:DMPS:600:BCTRLDISV_UPDATE") { field(DESC, "Calc for updating BCTRL.DISV") field(ASG, "Internal") field(CALC, "A") field(INPA, "QUAD:DMPS:600:ONLINE") field(OUT, "QUAD:DMPS:600: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,"QUAD:DMPS:600:BACT and MON\n are processed via links from \n QUAD:DMPS:600:IACT (device raw value readback 1)\n and\n QUAD:DMPS:600: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 QUAD:DMPS:600:POLYCOEF\nC = First polynomial coefficient (offset if linear)\nD = Second polynomial coefficient (slope if linear)\nE = QUAD:DMPS:600: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,"QUAD:DMPS:600:BDES\n is processed when set by CA users or \n QUAD:DMPS:600: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,"QUAD:DMPS:600: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 QUAD:DMPS:600: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 (QUAD:DMPS:600: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,"QUAD:DMPS:600:B*LIMITS and QUAD:DMPS:600:BLIMITS:\n Calculate alarm and warning limits based on \n deltas from QUAD:DMPS:600: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,"QUAD:DMPS:600: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,"QUAD:DMPS:600: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, "QUAD:DMPS:600: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, "QUAD:DMPS:600:MPSBTOL") { field(DESC, "Absolute mps tol") field(EGU, "kG") field(PREC, "2") field(CALC, "ABS(A)*0.02") field(INPA, "QUAD:DMPS:600:BMAX") field(PINI, "YES") } # # 21-Aug-2013: K. Luchini # Set channel access security so that users # cannot easily change values. record(ao, "QUAD:DMPS:600:MPSBMAX") { field(DESC, "MPS Max B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "-0.0873") field(DRVL, "-38.5868") field(PINI, "YES") field(VAL, "-0.0873") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "QUAD:DMPS:600:MPSBMIN") { field(DESC, "MPS Min B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "-0.0873") field(DRVL, "-38.5868") field(PINI, "YES") field(VAL, "-38.5868") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "QUAD:DMPS:600:MPSBLLIM") { field(DESC, "MPS Low Limit B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "-0.0873") field(DRVL, "-38.5868") field(PINI, "YES") field(VAL, "-38.5868") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "QUAD:DMPS:600:MPSBLLIM2") { field(DESC, "MPS Low Limit #2 B-field") field(EGU, "kG") field(PREC, "7") field(DRVH, "-0.0873") field(DRVL, "-38.5868") field(PINI, "YES") field(VAL, "-38.5868") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } # Set the default to Std record(mbbo, "QUAD:DMPS:600: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, "QUAD:DMPS:600:MPSLIMITS.E PP") } record(aSub, "QUAD:DMPS:600: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, "QUAD:DMPS:600:MPS.RVAL") field(INPB, "QUAD:DMPS:600:BADIFF") field(INPC, "QUAD:DMPS:600:BDELTAS.N") field(INPD, "QUAD:DMPS:600:BACT") field(INPE, "QUAD:DMPS:600:MPSBITMASK.RVAL") field(INPF, "QUAD:DMPS:600:MPSBLLIM") field(INPG, "QUAD:DMPS:600:MPSBMIN") field(INPH, "QUAD:DMPS:600:MPSBMAX") field(INPI, "QUAD:DMPS:600: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, "QUAD:DMPS:600:INTOL.RVAL PP") field(OUTB, "QUAD:DMPS:600:INTOL_BMIN.RVAL PP") field(OUTC, "QUAD:DMPS:600:INTOL_BRANGE.RVAL PP") field(OUTD, "QUAD:DMPS:600: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, "QUAD:DMPS:600:INTOL") { field(DESC, "BACT within MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:DMPS:600:MPSLIMITS.VALA") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "QUAD:DMPS:600:INTOL_BMIN") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:DMPS:600:MPSLIMITS.VALB") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "QUAD:DMPS:600:INTOL_BMIN2") { field(DESC, "MPS tol #2") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:DMPS:600:MPSLIMITS.VALD") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "QUAD:DMPS:600:INTOL_BRANGE") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "QUAD:DMPS:600: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, "QUAD:DMPS:600:CHCKITOL") { field(DESC, "Absolute Check I Tolerance") field(EGU, "A") field(FLNK, "QUAD:DMPS:600:TRIMITOL") field(CALC, "ABS(A*B)") field(INPA, "QUAD:DMPS:600:CHCKBTOL") field(INPB, "QUAD:DMPS:600:POLYCOEF.B") field(PREC, "9") } record(calc, "QUAD:DMPS:600:TRIMBTOL") { field(EGU, "kG") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(DESC, "Absolute Trim Tolerance") field(CALC, "ABS(A)/2") field(INPA, "QUAD:DMPS:600:CHCKBTOL") field(FLNK, "QUAD:DMPS:600:CHCKITOL") } record(calc, "QUAD:DMPS:600:CHCKBTOL") { field(DESC, "Check absolute tolerance") field(EGU, "A") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(FLNK, "QUAD:DMPS:600:TRIMBTOL") field(CALC, "MAX(ABS(A),ABS(C))*(B/1000000)") field(INPA, "QUAD:DMPS:600:BDES.HOPR") field(INPB, "QUAD:DMPS:600:STABILITY") field(INPC, "QUAD:DMPS:600:BDES.LOPR") } record(longout, "QUAD:DMPS:600: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, "QUAD:DMPS:600:CHCKBTOL") } record(calc, "QUAD:DMPS:600:TRIMITOL") { field(DESC, "Absolute Trim I Tolerance") field(EGU, "kG") field(CALC, "ABS(A*B)") field(INPA, "QUAD:DMPS:600:POLYCOEF.B") field(INPB, "QUAD:DMPS:600:TRIMBTOL") field(PREC, "9") } record(ai, "QUAD:DMPS:600:TRIMBTOLR") { field(DESC, "Relative trim tol") field(PREC, "4") field(EGU, "%") field(HOPR, "1.0") field(LOPR, "0.0") field(PINI, "YES") } record(ai, "QUAD:DMPS:600: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, "QUAD:DMPS:600:FBCKFCOM") { field(ZNAM, "CA") field(ONAM, "FCOM") field(DESC, "CA Mode") field(PINI, "YES") field(SDIS, "0") } record(bo, "QUAD:DMPS:600:PAU") { field(ZNAM, "NotConfigured") field(ONAM, "Configured") field(DESC, "PAU Present") field(PINI, "YES") field(SDIS, "0") field(FLNK, "QUAD:DMPS:600:PAUGO") } record(fanout, "QUAD:DMPS:600:PAUGO") { field(DESC, "PAU control") field(LNK1, "QUAD:DMPS:600:PAUSTOP") field(LNK2, "QUAD:DMPS:600: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, "QUAD:DMPS:600:PAUSTART") { field(DESC, "Setup for PAU On") field(SDIS, "QUAD:DMPS:600: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, "QUAD:DMPS:600:PAUSTOP") { field(DESC, "Setup for PAU Off") field(SDIS, "QUAD:DMPS:600: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, "QUAD:DMPS:600:MCORDEVNAME") { field(DESC, "PS device name") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, "QUAD:DMPS:500:") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "QUAD:DMPS:600: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, "QUAD:DMPS:600:PSTYPE.RVAL") field(INPC, "QUAD:DMPS:600:TURNEDOFF.RVAL") field(INPD, "QUAD:DMPS:600:CONFIG.RVAL") field(INPE, "QUAD:DMPS:600:PSCATEGORY.RVAL") field(INPF, "QUAD:DMPS:600:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "QUAD:DMPS:600:AUTOCTRL.RVAL") field(INPJ, "QUAD:DMPS:600:OUTOFSERVICE.RVAL") field(INPL, "QUAD:DMPS:600:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "QUAD:DMPS:600:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "QUAD:DMPS:600:PAU") field(INPP, "QUAD:DMPS:600:CALBDISABLE.RVAL") field(INPQ, "QUAD:DMPS:600:PTRBDISABLE.RVAL") field(INPR, "QUAD:DMPS:600:TRIMDISABLE.RVAL") field(INPS, "QUAD:DMPS:600:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "QUAD:DMPS:600:FBCK") field(INPU, "QUAD:DMPS:600:TRIMTYPE.RVAL") field(INPV, "QUAD:DMPS:600:STDZDIRECT.RVAL") field(INPW, "QUAD:DMPS:600:DEGAUSENABLE.RVAL") field(FLNK, "QUAD:DMPS:600:HSTA") } record(longin, "QUAD:DMPS:600:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "QUAD:DMPS:600:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "QUAD:DMPS:600: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, "QUAD:DMPS:600: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, "QUAD:DMPS:600: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, "QUAD:DMPS:600: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, "QUAD:DMPS:600: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, "QUAD:DMPS:600: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 QUAD:DMPS:600:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses QUAD:DMPS:600:FBCK. # This PV should be replaced by QUAD:DMPS:600: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, "QUAD:DMPS:600: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, "QUAD:DMPS:600: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, "QUAD:DMPS:600: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, "QUAD:DMPS:500:OUTOFSERVICE CPP NMS") field(OMSL, "closed_loop") field(FLNK, "QUAD:DMPS:600:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"QUAD:DMPS:600:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "QUAD:DMPS:600:OUTOFSERVICE NPP NMS") field(OUT, "QUAD:DMPS:600:ONLINE PP") } record(bo, "QUAD:DMPS:600:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "QUAD:DMPS:600: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, "QUAD:DMPS:600: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, "QUAD:DMPS:600: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, "QUAD:DMPS:600: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, "QUAD:DMPS:600: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, "QUAD:DMPS:600: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, "QUAD:DMPS:600: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, "QUAD:DMPS:600: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, "QUAD:DMPS:600: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, "QUAD:DMPS:600: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, "QUAD:DMPS:600: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, "QUAD:DMPS:600:TRIMTYPE") } record(stringout, "QUAD:DMPS:600:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "QUAD:DMPS:500:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "QUAD:DMPS:600:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "QUAD:DMPS:600:STATE.RVAL") field(INPB, "QUAD:DMPS:600:INTLKSUMY.RVAL") field(OUT, "QUAD:DMPS:600:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:DMPS:600: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, "QUAD:DMPS:600:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "QUAD:DMPS:600:STATE.RVAL") field(INPB, "QUAD:DMPS:600:INTLKSUMY.RVAL") field(OUT, "QUAD:DMPS:600:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "QUAD:DMPS:600:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "QUAD:DMPS:600:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "QUAD:DMPS:600: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, "QUAD:DMPS:600: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, "QUAD:DMPS:600: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, "QUAD:DMPS:600: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,"QUAD:DMPS:600: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("QUAD:DMPS:600:TURNEDOFF",3140,1907,0,1,"QUAD:DMPS:600:TURNEDOFF") #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "QUAD:DMPS:600:STATSUB") { field(DESC, "Build STATus ") field(INAM, "mgntInit") field(SNAM, "mgntSlcStat") field(INPA, "QUAD:DMPS:600:BACT.STAT") field(INPB, "QUAD:DMPS:600:BDES.STAT") field(INPC, "QUAD:DMPS:600: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, "QUAD:DMPS:600:BACT.SEVR") field(INPH, "QUAD:DMPS:600:BDES.SEVR") field(INPI, "QUAD:DMPS:600: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, "QUAD:DMPS:600:STATE.RVAL") field(INPN, "QUAD:DMPS:600:STDZOK") field(INPO, "QUAD:DMPS:600:CALBOK") field(INPP, "QUAD:DMPS:600:OUTOFSERVICE.RVAL") field(INPQ, "QUAD:DMPS:600:CONFIG.RVAL") field(INPR, "QUAD:DMPS:600:HSTA") field(INPS, "QUAD:DMPS:600:CTRL.RVAL") field(INPT, "QUAD:DMPS:600:DEGAUSOK") field(INPV, "QUAD:DMPS:600: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, "QUAD:DMPS:600:STAT") } record(longout, "QUAD:DMPS:600:STAT") { field(DESC, "STAT sent to SLC") field(SCAN, "Passive") field(FLNK, "QUAD:DMPS:600:STATCTRLSUB") field(DOL, "QUAD:DMPS:600:STATSUB.VAL") field(OMSL, "closed_loop") } record(sSub, "QUAD:DMPS:600:STATCTRLSUB") { field(DESC, "Decode SLC STAT into mbbo") field(INAM, "mgntInit") field(SNAM, "mgntStatDecode") field(INPA, "QUAD:DMPS:600:STAT") field(INPB, "QUAD:DMPS:600:HSTA") field(INPD, "QUAD:DMPS:600:ONOFFCTRL.RVAL") field(FLNK, "QUAD:DMPS:600:STATMSG") } record(mbbo, "QUAD:DMPS:600: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, "QUAD:DMPS:600:UNAVAILGO") field(DOL, "QUAD:DMPS:600:STATCTRLSUB.W") } record(seq, "QUAD:DMPS:600:UNAVAILGO") { field(DESC, "Process UNAVAIL") field(DOL1, "QUAD:DMPS:600:STATSUB.U") field(LNK1, "QUAD:DMPS:600:UNAVAIL PP") } record(stringout, "QUAD:DMPS:600:SNLSTATMSG") { field(DTYP, "Soft Channel") } #! TextBox(TB0,820,1000,1200,1220,0,"Dialog",12,1,16777215,"QUAD:DMPS:600:STATUSSUB - future\nOverall device status - takes input from action snls, record sevrs, master snl(s) and outputs final status\n\nInputs:\nA - QUAD:DMPS:600:CTRLSTATUS - snl status\nB - MGNT:CTRLSTATUS - master list status\nC\nD - QUAD:DMPS:600: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,"QUAD:DMPS:600STATSUB\nformat control bo's into slc STAT\n\nInputs:\nA - QUAD:DMPS:600:STATUS\nC - QUAD:DMPS:600:ON\nD - QUAD:DMPS:600:STDZOK\nE - QUAD:DMPS:600:CALBOK\nF - QUAD:DMPS:600:BACTDRIFT (future)\nG -\nH- QUAD:DMPS:600:DACSTATUS\nI -QUAD:DMPS:600:ADCSTATUS\nJ - QUAD:DMPS:600:BACTSTATUS\nK - QUAD:DMPS:600:BDESSTATUS\nL - QUAD:DMPS:600:RIPLSTATUS\n\nOutput:\nP - QUAD:DMPS:600: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, "QUAD:DMPS:600: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, "QUAD:DMPS:600: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, "QUAD:DMPS:600: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, "QUAD:DMPS:600: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 b-field of a slave with out a powered trim coil # equal to the main desired current and pass backwards # through the IVB poly. record(sub, "QUAD:DMPS:600:IDES2BDES") { field(DESC, "Cal BDES") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "QUAD:DMPS:600:IDES2BDES") field(INPB, "QUAD:DMPS:600:POLYCOEF") field(INPC, "QUAD:DMPS:600:POLYCOEF.A") field(INPD, "QUAD:DMPS:600:POLYCOEF.B") field(INPE, "QUAD:DMPS:500:IDES CP MS") field(INPF, "QUAD:DMPS:500:BDELTAS PP") field(INPG, "100") field(EGU, "kG") field(HOPR, "-0.0873") field(LOPR, "-38.5868") field(HIHI, "-0.0873") field(LOLO, "-38.5868") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "-0.0873") field(LOW, "-38.5868") field(FLNK, "QUAD:DMPS:600:BDES") } # Calcuate the bcon of a slave using # the main desired current and pass backwards # through the IVB poly. # the trim b-field is acutally amps. record(sub, "QUAD:DMPS:600:ICON2BCON") { field(DESC, "Cal BCON") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "QUAD:DMPS:600:ICON2BCON") field(INPB, "QUAD:DMPS:600:POLYCOEF") field(INPC, "QUAD:DMPS:600:POLYCOEF.A") field(INPD, "QUAD:DMPS:600:POLYCOEF.B") field(INPE, "QUAD:DMPS:500:ICON CP NMS") field(INPF, "QUAD:DMPS:500:BDELTAS PP") field(INPG, "100") field(EGU, "kG") field(HOPR, "-0.0873") field(LOPR, "-38.5868") field(HIHI, "-0.0873") field(LOLO, "-38.5868") field(PREC, "7") field(BRSV, "INVALID") # Set MINOR alarms for main as the default, slaves will set NO_ALARM field(HHSV, "NO_ALARM") field(HSV, "NO_ALARM") field(LSV, "NO_ALARM") field(LLSV, "NO_ALARM") field(HIGH, "-0.0873") field(LOW, "-38.5868") field(FLNK, "QUAD:DMPS:600:BCON") }#! Generated by VisualDCT v2.5 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND # When OMSL=supervisory the data is taken from the VAL. # Otherwise, data is taken from the DOL field. # Make sure to set PP to the output link so the desired pv is processed. record(dfanout, "BEND:LTUS:166:STDZSLAVESGO") { field(DESC, "STDZSLAVES Fanout Set") field(DOL, "BEND:LTUS:166:STDZGO.RVAL CP") field(OMSL, "closed_loop") field(OUTA, "BTRM:LTUS:165:CTRL CP") field(OUTB, "BTRM:LTUS:167:CTRL CP") field(OUTC, "BTRM:LTUS:168:CTRL CP") field(OUTD, "BTRM:LTUS:475:CTRL CP") field(OUTE, "BTRM:LTUS:477:CTRL CP") field(OUTF, "BTRM:LTUS:478:CTRL CP") field(OUTG, "") field(OUTH, "") field(PINI, "NO") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND # When OMSL=supervisory the data is taken from the VAL. # Otherwise, data is taken from the DOL field. # Make sure to set PP to the output link so the desired pv is processed. record(dfanout, "BEND:UNDS:3510:STDZSLAVESGO") { field(DESC, "STDZSLAVES Fanout Set") field(DOL, "BEND:UNDS:3510:STDZGO.RVAL CP") field(OMSL, "closed_loop") field(OUTA, "BTRM:UNDS:3510:CTRL CP") field(OUTB, "BTRM:UNDS:3530:CTRL CP") field(OUTC, "BTRM:UNDS:3550:CTRL CP") field(OUTD, "BTRM:UNDS:3570:CTRL CP") field(OUTE, "") field(OUTF, "") field(OUTG, "") field(OUTH, "") field(PINI, "NO") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND # When OMSL=supervisory the data is taken from the VAL. # Otherwise, data is taken from the DOL field. # Make sure to set PP to the output link so the desired pv is processed. record(dfanout, "BEND:DMPS:400:STDZSLAVESGO") { field(DESC, "STDZSLAVES Fanout Set") field(DOL, "BEND:LTUS:175:STDZGO.RVAL CP") field(OMSL, "closed_loop") field(OUTA, "BTRM:LTUS:175:CTRL CP") field(OUTB, "BTRM:LTUS:460:CTRL CP") field(OUTC, "") field(OUTD, "") field(OUTE, "") field(OUTF, "") field(OUTG, "") field(OUTH, "") field(PINI, "NO") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND # When OMSL=supervisory the data is taken from the VAL. # Otherwise, data is taken from the DOL field. # Make sure to set PP to the output link so the desired pv is processed. record(dfanout, "BEND:LTUS:764:STDZSLAVESGO") { field(DESC, "STDZSLAVES Fanout Set") field(DOL, "BEND:LTUS:764:STDZGO.RVAL CP") field(OMSL, "closed_loop") field(OUTA, "BTRM:LTUS:763:CTRL CP") field(OUTB, "BTRM:LTUS:765:CTRL CP") field(OUTC, "BTRM:LTUS:766:CTRL CP") field(OUTD, "") field(OUTE, "") field(OUTF, "") field(OUTG, "") field(OUTH, "") field(PINI, "NO") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "BEND:LTUS:764: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, "BEND:LTUS:764:PSTYPE.RVAL") field(INPC, "BEND:LTUS:764:TURNEDOFF.RVAL") field(INPD, "BEND:LTUS:764:CONFIG.RVAL") field(INPE, "BEND:LTUS:764:PSCATEGORY.RVAL") field(INPF, "BEND:LTUS:764:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "BEND:LTUS:764:AUTOCTRL.RVAL") field(INPJ, "BEND:LTUS:764:OUTOFSERVICE.RVAL") field(INPL, "BEND:LTUS:764:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "BEND:LTUS:764:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "BEND:LTUS:764:PAU") field(INPP, "BEND:LTUS:764:CALBDISABLE.RVAL") field(INPQ, "BEND:LTUS:764:PTRBDISABLE.RVAL") field(INPR, "BEND:LTUS:764:TRIMDISABLE.RVAL") field(INPS, "BEND:LTUS:764:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "BEND:LTUS:764:FBCK") field(INPU, "BEND:LTUS:764:TRIMTYPE.RVAL") field(INPV, "BEND:LTUS:764:STDZDIRECT.RVAL") field(INPW, "BEND:LTUS:764:DEGAUSENABLE.RVAL") field(FLNK, "BEND:LTUS:764:HSTA") } record(longin, "BEND:LTUS:764:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "BEND:LTUS:764:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "BEND:LTUS:764:DEGAUSENABLE") { field(DESC, "Degauss Enable") field(DTYP, "Raw Soft Channel") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(PINI, "YES") field(VAL, "1") 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, "BEND:LTUS:764: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, "BEND:LTUS:764: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, "BEND:LTUS:764:PTRBDISABLE") { field(DESC, "Perturb Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "BEND:LTUS:764:TRIMDISABLE") { field(DESC, "Trim Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "BEND:LTUS:764: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 BEND:LTUS:764:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses BEND:LTUS:764:FBCK. # This PV should be replaced by BEND:LTUS:764: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, "BEND:LTUS:764: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, "BEND:LTUS:764: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, "BEND:LTUS:764: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, "") field(OMSL, "supervisory") field(FLNK, "BEND:LTUS:764:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"BEND:LTUS:764:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "BEND:LTUS:764:OUTOFSERVICE NPP NMS") field(OUT, "BEND:LTUS:764:ONLINE PP") } record(bo, "BEND:LTUS:764:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "BEND:LTUS:764: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, "1") } record(bo, "BEND:LTUS:764: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, "1") } record(bo, "BEND:LTUS:764: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, "BEND:LTUS:764: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, "BEND:LTUS:764: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, "BEND:LTUS:764: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, "BEND:LTUS:764: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, "BEND:LTUS:764: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, "0") field(ASG, "NOWRITE") } record(mbbo, "BEND:LTUS:764: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, "1") field(ASG, "NOWRITE") } record(mbbo, "BEND:LTUS:764: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, "2") field(ASG, "NOWRITE") } record(mbbo, "BEND:LTUS:764: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, "2") field(ASG, "NOWRITE") field(FLNK, "BEND:LTUS:764:TRIMTYPE") } record(stringout, "BEND:LTUS:764:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "BEND:LTUS:764:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "BEND:LTUS:764:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "BEND:LTUS:764:STATE.RVAL") field(INPB, "BEND:LTUS:764:INTLKSUMY.RVAL") field(OUT, "BEND:LTUS:764:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "BEND:LTUS:764: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, "BEND:LTUS:764:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "BEND:LTUS:764:STATE.RVAL") field(INPB, "BEND:LTUS:764:INTLKSUMY.RVAL") field(OUT, "BEND:LTUS:764:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "BEND:LTUS:764:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "BEND:LTUS:764:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "BEND:LTUS:764: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, "BEND:LTUS:764:RAMPSTARTDLY") { field(DESC, "Tansition to ramp delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "2") } ######### For PSTYPE=2 Only ############# record(mbbo, "BEND:LTUS:764: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, "BEND:LTUS:764: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,"BEND:LTUS:764: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("BEND:LTUS:764:TURNEDOFF",3140,1907,0,1,"BEND:LTUS:764:TURNEDOFF") #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../../dbd/mgntSoft.dbd") #! DBDEND record(dfanout, "BEND:LTUS:764:DEGAUSINIT") { field(DESC, "Proc. Degauss PVs on boot") field(PINI, "YES") field(DOL, "1") field(OUTA, "BEND:LTUS:764:DEGAUSIMIN.PROC PP") field(OUTB, "BEND:LTUS:764:DEGAUSIMAX.PROC PP") field(OUTC, "BEND:LTUS:764:DEGAUSTYPE.PROC PP") field(OUTD, "BEND:LTUS:764:DEGAUSSTEP.PROC PP") field(OUTE, "BEND:LTUS:764:MADNAME.PROC PP") field(OUTF, "BEND:LTUS:764:PSTYPE.PROC PP") field(OUTG, "BEND:LTUS:764: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, "BEND:LTUS:764:DEGAUSSUB") { field(DESC, "Degauss subroutine") field(INAM, "mgntDegaussInit") field(SNAM, "mgntDegauss") field(BRSV, "INVALID") field(INPA, "BEND:LTUS:764:DEGAUSIMIN NPP NMS") field(INPB, "BEND:LTUS:764:DEGAUSIMAX NPP NMS") field(INPC, "BEND:LTUS:764:DEGAUSTYPE.RVAL NPP NMS") field(INPE, "BEND:LTUS:764:DEGAUSMETHOD.RVAL NPP NMS") field(INPF, "BEND:LTUS:764:PSTYPE NPP NMS") field(INPG, "BEND:LTUS:764:DEBUG.RVAL NPP NMS") field(INPH, "BEND:LTUS:764: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, "BEND:LTUS:764:DEGAUSWF PP") field(OUTB, "BEND:LTUS:764:DEGAUSMSG PP") field(OUTC, "BEND:LTUS:764: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, "BEND:LTUS:764:DEGAUSWF") { field(DESC, "Degauss Setpts") field(NELM, "60") field(FTVL, "DOUBLE") } record(mbbo,"BEND:LTUS:764: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, "BEND:LTUS:764: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, "BEND:LTUS:764: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, "BEND:LTUS:764: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, "BEND:LTUS:764: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, "BEND:LTUS:764: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, "BEND:LTUS:764: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,"BEND:LTUS:764: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, "BEND:LTUS:764:DEGAUSSUB") field(VAL, "3") } # 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,"BEND:LTUS:764: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, "2") } # 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, "BEND:LTUS:764: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, "BEND:LTUS:764: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, "BEND:LTUS:764: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, "BEND:LTUS:764:DEGAUSTOD") { field(DESC, "Successful Degauss Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "BEND:LTUS:764:DEGAUSLOSTTOD") { field(DESC, "Degauss Lost Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "BEND:LTUS:764:DEGAUSTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "BEND:LTUS:764:DEGAUSTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "BEND:LTUS:764: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, "BEND:LTUS:764:DEGAUSGO") { field(DESC, "Set bdes of btrms to zero") field(ASG, "Internal") field(OUTA, "BTRM:LTUS:763:BDES CP") field(OUTB, "BTRM:LTUS:765:BDES CP") field(OUTC, "BTRM:LTUS:766:BDES CP") field(OUTD, "") } # =========== CRYO ONLY =========== record(bo, "BEND:LTUS:764: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, "BEND:LTUS:764:DEGAUS_IMAX_CHECK") { field(DESC, "Check if imax shoud chg") field(CALC, "(C==4)&&(ABS(B)>ABS(A))?1:0") field(INPA, "BEND:LTUS:764:DEGAUS_IMAX") field(INPB, "BEND:LTUS:764:ISETPT") field(INPC, "BEND:LTUS:764:DEGAUSTYPE.RVAL") field(OUT, "BEND:LTUS:764:DEGAUS_IMAX_UPDATE.SELN") field(FLNK, "BEND:LTUS:764:DEGAUS_IMAX_UPDATE") } record(seq, "BEND:LTUS:764:DEGAUS_IMAX_UPDATE") { field(DESC, "Degauss IMAX Update") field(SELM, "Specified") field(DOL1, "BEND:LTUS:764:ISETPT") field(LNK1, "BEND:LTUS:764:DEGAUS_IMAX PP") } # Set the maximum current after a successful # degauss. This pv is updated by the # sequence. record(ao, "BEND:LTUS:764: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, "BEND:LTUS:764:DEGAUS_IMAXPOL_CHECK") info(autosaveFields,"VAL,RVAL") } # Set the polarity if degauss_imax record(calcout, "BEND:LTUS:764:DEGAUS_IMAXPOL_CHECK") { field(DESC, "Determine polarity of imax") field(CALC, "A>=0?0:1") field(INPA, "BEND:LTUS:764:DEGAUS_IMAX") field(FLNK, "BEND:LTUS:764:DEGAUS_IMAXPOL") } record(bo, "BEND:LTUS:764:DEGAUS_IMAXPOL") { field(DESC, "Polarity of imax I") field(DTYP, "Raw Soft Channel") field(DOL, "BEND:LTUS:764:DEGAUS_IMAXPOL_CHECK") field(OMSL, "closed_loop") field(ZNAM, "Positive") field(ONAM, "Negative") field(FLNK, "BEND:LTUS:764: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, "BEND:LTUS:764:DEGAUS_ABSIMAX") { field(DESC, "Absolute Max. Degauss I") field(CALC, "ABS(A)") field(INPA, "BEND:LTUS:764:DEGAUS_IMAX") field(PREC, "6") field(EGU, "Amps") field(HOPR, "$(IMAX)") field(LOPR, "-$(IMAX)") info(autosaveFields,"VAL RVAL") } # IACT Polarity record(calcout, "BEND:LTUS:764:IACTPOL_CHECK") { field(DESC, "Determine IACT polarity") field(SCAN, "5 second") field(CALC, "ABS(A-B)>C?(A>=0?0:1):D") field(INPA, "BEND:LTUS:764:IACT") field(INPB, "BEND:LTUS:764:IACTPOL_CHECK.LA") field(INPC, "0.0001") field(INPD, "BEND:LTUS:764:IACTPOL_CHECK.PVAL") field(OOPT, "On Change") field(FLNK, "BEND:LTUS:764:IACTPOL") } record(bo, "BEND:LTUS:764: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 record(mbbo, "BEND:LTUS:764:FUNC") { field(DESC, "BEND:LTUS:764 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, "1") field(THVL, "9") field(FRVL, "10") field(FVVL, "14") field(SXVL, "2") field(SVVL, "8") field(EIVL, "11") field(NIVL, "12") field(TEVL, "13") field(ELVL, "5") field(TVVL, "6") field(TTVL, "7") field(FTVL, "4") field(FFVL, "3") field(OUT, "BEND:LTUS:764:CTRL CA") } # :CTRL pv is processed at boot in the # sequence mgntCtrl.st Processed in sequence # record(mbbo, "BEND:LTUS:764:CTRL") { field(DESC, "BEND:LTUS:764 Control") field(PINI, "NO") field(ZRST, "Ready") field(ONST, "TRIM") field(TWST, "PERTURB") field(THST, "BCON_TO_BDES") field(FRST, "BACT_TO_BDES") field(FVST, "SAVE_BDES") field(SXST, "LOAD_BDES") field(SVST, "UNDO_BDES") field(EIST, "DAC_ZERO") field(NIST, "CALIB") field(TEST, "STDZ") field(ELST, "RESET") field(TVST, "TURN_ON") field(TTST, "TURN_OFF") field(FTST, "DEGAUSS") field(FFST, "") field(ZRVL, "0") field(ONVL, "2") field(TWVL, "6") field(THVL, "15") field(FRVL, "14") field(FVVL, "11") field(SXVL, "12") field(SVVL, "13") field(EIVL, "7") field(NIVL, "3") field(TEVL, "4") field(ELVL, "8") field(TVVL, "9") field(TTVL, "10") field(FTVL, "5") field(FFVL, "0") field(OUT, "BEND:LTUS:764:SELECTEN.A PP") field(SDIS, "0") } # If a function has been selected set this unit to busy record(calcout, "BEND:LTUS:764:SELECTEN") { field(DESC, "Control Select Enable") field(CALC, "A>0?1:A") field(FLNK, "BEND:LTUS:764:BUSY") } # Set to FREE on IOC reboot record(bo, "BEND:LTUS:764:BUSY") { field(DESC, "BEND:LTUS:764 Ctrl Done") field(DOL, "BEND:LTUS:764:SELECTEN") field(ZNAM, "FREE") field(ONAM, "BUSY") field(PINI, "YES") field(FLNK, "BEND:LTUS:764:SELECT") } record(bo, "BEND:LTUS:764:SELECT") { field(ZNAM, "NO") field(ONAM, "YES") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") } record(bo, "BEND:LTUS:764: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, "BEND:LTUS:764:CTRLSTATE") { field(DESC, "BEND:LTUS:764 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("BEND:LTUS:764:CTRL",20,20,0,0,"BEND:LTUS:764:CTRL") #! Field("BEND:LTUS:764:CTRL.OUT",16777215,1,"BEND:LTUS:764:CTRL.OUT") #! Link("BEND:LTUS:764:CTRL.OUT","BEND:LTUS:764:SELECTEN.A") #! Field("BEND:LTUS:764:CTRL.VAL",16777215,1,"BEND:LTUS:764:CTRL.VAL") #! Record("BEND:LTUS:764:SELECTEN",321,381,0,0,"BEND:LTUS:764:SELECTEN") #! Field("BEND:LTUS:764:SELECTEN.A",16777215,0,"BEND:LTUS:764:SELECTEN.A") #! Field("BEND:LTUS:764:SELECTEN.FLNK",16777215,1,"BEND:LTUS:764:SELECTEN.FLNK") #! Link("BEND:LTUS:764:SELECTEN.FLNK","BEND:LTUS:764:BUSY") #! Field("BEND:LTUS:764:SELECTEN.VAL",16777215,1,"BEND:LTUS:764:SELECTEN.VAL") #! Record("BEND:LTUS:764:BUSY",623,274,0,0,"BEND:LTUS:764:BUSY") #! Field("BEND:LTUS:764:BUSY.DOL",16777215,0,"BEND:LTUS:764:BUSY.DOL") #! Link("BEND:LTUS:764:BUSY.DOL","BEND:LTUS:764:SELECTEN.VAL") #! Field("BEND:LTUS:764:BUSY.FLNK",16777215,1,"BEND:LTUS:764:BUSY.FLNK") #! Link("BEND:LTUS:764:BUSY.FLNK","BEND:LTUS:764:SELECT") #! Record("BEND:LTUS:764:SELECT",669,508,0,1,"BEND:LTUS:764:SELECT") #! Record("BEND:LTUS:764:FUNC",940,120,0,0,"BEND:LTUS:764:FUNC") #! Field("BEND:LTUS:764:FUNC.OUT",16777215,0,"BEND:LTUS:764:FUNC.OUT") #! Link("BEND:LTUS:764:FUNC.OUT","BEND:LTUS:764:CTRL.VAL") #! Record("BEND:LTUS:764:ABORT",193,41,0,0,"BEND:LTUS:764:ABORT") #! Record("BEND:LTUS:764:CTRLSTATE",369,34,0,0,"BEND:LTUS:764: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,"BEND:LTUS:764:SELECT is used for Multi-device selection.\nIt is enabled when associated BEND:LTUS:764:CTRL is \"0\" (DONE).\nIt is disabled when associated BEND:LTUS:764: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,"BEND:LTUS:764: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(sSub, "BEND:UNDS:3510: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, "BEND:UNDS:3510:PSTYPE.RVAL") field(INPC, "BEND:UNDS:3510:TURNEDOFF.RVAL") field(INPD, "BEND:UNDS:3510:CONFIG.RVAL") field(INPE, "BEND:UNDS:3510:PSCATEGORY.RVAL") field(INPF, "BEND:UNDS:3510:INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "BEND:UNDS:3510:AUTOCTRL.RVAL") field(INPJ, "BEND:UNDS:3510:OUTOFSERVICE.RVAL") field(INPL, "BEND:UNDS:3510:STATE.RVAL") # This pv flags matlab feedback control field(INPN, "BEND:UNDS:3510:FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "BEND:UNDS:3510:PAU") field(INPP, "BEND:UNDS:3510:CALBDISABLE.RVAL") field(INPQ, "BEND:UNDS:3510:PTRBDISABLE.RVAL") field(INPR, "BEND:UNDS:3510:TRIMDISABLE.RVAL") field(INPS, "BEND:UNDS:3510:STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "BEND:UNDS:3510:FBCK") field(INPU, "BEND:UNDS:3510:TRIMTYPE.RVAL") field(INPV, "BEND:UNDS:3510:STDZDIRECT.RVAL") field(INPW, "BEND:UNDS:3510:DEGAUSENABLE.RVAL") field(FLNK, "BEND:UNDS:3510:HSTA") } record(longin, "BEND:UNDS:3510:HSTA") { field(DESC, "HSTA from EPICS") field(INP, "BEND:UNDS:3510:HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "BEND:UNDS:3510:DEGAUSENABLE") { field(DESC, "Degauss Enable") field(DTYP, "Raw Soft Channel") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(PINI, "YES") field(VAL, "1") 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, "BEND:UNDS:3510: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, "BEND:UNDS:3510: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, "BEND:UNDS:3510:PTRBDISABLE") { field(DESC, "Perturb Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "BEND:UNDS:3510:TRIMDISABLE") { field(DESC, "Trim Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "0") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "BEND:UNDS:3510: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 BEND:UNDS:3510:FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses BEND:UNDS:3510:FBCK. # This PV should be replaced by BEND:UNDS:3510: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, "BEND:UNDS:3510: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, "BEND:UNDS:3510: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, "BEND:UNDS:3510: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, "") field(OMSL, "supervisory") field(FLNK, "BEND:UNDS:3510:ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"BEND:UNDS:3510:ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "BEND:UNDS:3510:OUTOFSERVICE NPP NMS") field(OUT, "BEND:UNDS:3510:ONLINE PP") } record(bo, "BEND:UNDS:3510:ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "BEND:UNDS:3510: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, "1") } record(bo, "BEND:UNDS:3510: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, "1") } record(bo, "BEND:UNDS:3510: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, "BEND:UNDS:3510: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, "BEND:UNDS:3510: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, "BEND:UNDS:3510: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, "BEND:UNDS:3510: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, "BEND:UNDS:3510: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, "0") field(ASG, "NOWRITE") } record(mbbo, "BEND:UNDS:3510: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, "1") field(ASG, "NOWRITE") } record(mbbo, "BEND:UNDS:3510: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, "2") field(ASG, "NOWRITE") } record(mbbo, "BEND:UNDS:3510: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, "2") field(ASG, "NOWRITE") field(FLNK, "BEND:UNDS:3510:TRIMTYPE") } record(stringout, "BEND:UNDS:3510:MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "BEND:UNDS:3510:MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "BEND:UNDS:3510:TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "BEND:UNDS:3510:STATE.RVAL") field(INPB, "BEND:UNDS:3510:INTLKSUMY.RVAL") field(OUT, "BEND:UNDS:3510:TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "BEND:UNDS:3510: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, "BEND:UNDS:3510:TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "BEND:UNDS:3510:STATE.RVAL") field(INPB, "BEND:UNDS:3510:INTLKSUMY.RVAL") field(OUT, "BEND:UNDS:3510:TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "BEND:UNDS:3510:TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "BEND:UNDS:3510:PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "BEND:UNDS:3510: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, "BEND:UNDS:3510:RAMPSTARTDLY") { field(DESC, "Tansition to ramp delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "2") } ######### For PSTYPE=2 Only ############# record(mbbo, "BEND:UNDS:3510: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, "BEND:UNDS:3510: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,"BEND:UNDS:3510: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("BEND:UNDS:3510:TURNEDOFF",3140,1907,0,1,"BEND:UNDS:3510:TURNEDOFF") #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../../dbd/mgntSoft.dbd") #! DBDEND record(dfanout, "BEND:UNDS:3510:DEGAUSINIT") { field(DESC, "Proc. Degauss PVs on boot") field(PINI, "YES") field(DOL, "1") field(OUTA, "BEND:UNDS:3510:DEGAUSIMIN.PROC PP") field(OUTB, "BEND:UNDS:3510:DEGAUSIMAX.PROC PP") field(OUTC, "BEND:UNDS:3510:DEGAUSTYPE.PROC PP") field(OUTD, "BEND:UNDS:3510:DEGAUSSTEP.PROC PP") field(OUTE, "BEND:UNDS:3510:MADNAME.PROC PP") field(OUTF, "BEND:UNDS:3510:PSTYPE.PROC PP") field(OUTG, "BEND:UNDS:3510: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, "BEND:UNDS:3510:DEGAUSSUB") { field(DESC, "Degauss subroutine") field(INAM, "mgntDegaussInit") field(SNAM, "mgntDegauss") field(BRSV, "INVALID") field(INPA, "BEND:UNDS:3510:DEGAUSIMIN NPP NMS") field(INPB, "BEND:UNDS:3510:DEGAUSIMAX NPP NMS") field(INPC, "BEND:UNDS:3510:DEGAUSTYPE.RVAL NPP NMS") field(INPE, "BEND:UNDS:3510:DEGAUSMETHOD.RVAL NPP NMS") field(INPF, "BEND:UNDS:3510:PSTYPE NPP NMS") field(INPG, "BEND:UNDS:3510:DEBUG.RVAL NPP NMS") field(INPH, "BEND:UNDS:3510: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, "BEND:UNDS:3510:DEGAUSWF PP") field(OUTB, "BEND:UNDS:3510:DEGAUSMSG PP") field(OUTC, "BEND:UNDS:3510: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, "BEND:UNDS:3510:DEGAUSWF") { field(DESC, "Degauss Setpts") field(NELM, "60") field(FTVL, "DOUBLE") } record(mbbo,"BEND:UNDS:3510: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, "BEND:UNDS:3510: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, "BEND:UNDS:3510: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, "BEND:UNDS:3510: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, "BEND:UNDS:3510: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, "BEND:UNDS:3510: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, "BEND:UNDS:3510: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,"BEND:UNDS:3510: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, "BEND:UNDS:3510:DEGAUSSUB") field(VAL, "2") } # 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,"BEND:UNDS:3510: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, "2") } # 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, "BEND:UNDS:3510: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, "BEND:UNDS:3510: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, "BEND:UNDS:3510: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, "BEND:UNDS:3510:DEGAUSTOD") { field(DESC, "Successful Degauss Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "BEND:UNDS:3510:DEGAUSLOSTTOD") { field(DESC, "Degauss Lost Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "BEND:UNDS:3510:DEGAUSTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "BEND:UNDS:3510:DEGAUSTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "BEND:UNDS:3510: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, "BEND:UNDS:3510:DEGAUSGO") { field(DESC, "Set bdes of btrms to zero") field(ASG, "Internal") field(OUTA, "BTRM:UNDS:3510:BDES CP") field(OUTB, "BTRM:UNDS:3530:BDES CP") field(OUTC, "BTRM:UNDS:3550:BDES CP") field(OUTD, "BTRM:UNDS:3570:BDES CP") } # =========== CRYO ONLY =========== record(bo, "BEND:UNDS:3510: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, "BEND:UNDS:3510:DEGAUS_IMAX_CHECK") { field(DESC, "Check if imax shoud chg") field(CALC, "(C==4)&&(ABS(B)>ABS(A))?1:0") field(INPA, "BEND:UNDS:3510:DEGAUS_IMAX") field(INPB, "BEND:UNDS:3510:ISETPT") field(INPC, "BEND:UNDS:3510:DEGAUSTYPE.RVAL") field(OUT, "BEND:UNDS:3510:DEGAUS_IMAX_UPDATE.SELN") field(FLNK, "BEND:UNDS:3510:DEGAUS_IMAX_UPDATE") } record(seq, "BEND:UNDS:3510:DEGAUS_IMAX_UPDATE") { field(DESC, "Degauss IMAX Update") field(SELM, "Specified") field(DOL1, "BEND:UNDS:3510:ISETPT") field(LNK1, "BEND:UNDS:3510:DEGAUS_IMAX PP") } # Set the maximum current after a successful # degauss. This pv is updated by the # sequence. record(ao, "BEND:UNDS:3510: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, "BEND:UNDS:3510:DEGAUS_IMAXPOL_CHECK") info(autosaveFields,"VAL,RVAL") } # Set the polarity if degauss_imax record(calcout, "BEND:UNDS:3510:DEGAUS_IMAXPOL_CHECK") { field(DESC, "Determine polarity of imax") field(CALC, "A>=0?0:1") field(INPA, "BEND:UNDS:3510:DEGAUS_IMAX") field(FLNK, "BEND:UNDS:3510:DEGAUS_IMAXPOL") } record(bo, "BEND:UNDS:3510:DEGAUS_IMAXPOL") { field(DESC, "Polarity of imax I") field(DTYP, "Raw Soft Channel") field(DOL, "BEND:UNDS:3510:DEGAUS_IMAXPOL_CHECK") field(OMSL, "closed_loop") field(ZNAM, "Positive") field(ONAM, "Negative") field(FLNK, "BEND:UNDS:3510: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, "BEND:UNDS:3510:DEGAUS_ABSIMAX") { field(DESC, "Absolute Max. Degauss I") field(CALC, "ABS(A)") field(INPA, "BEND:UNDS:3510:DEGAUS_IMAX") field(PREC, "6") field(EGU, "Amps") field(HOPR, "$(IMAX)") field(LOPR, "-$(IMAX)") info(autosaveFields,"VAL RVAL") } # IACT Polarity record(calcout, "BEND:UNDS:3510:IACTPOL_CHECK") { field(DESC, "Determine IACT polarity") field(SCAN, "5 second") field(CALC, "ABS(A-B)>C?(A>=0?0:1):D") field(INPA, "BEND:UNDS:3510:IACT") field(INPB, "BEND:UNDS:3510:IACTPOL_CHECK.LA") field(INPC, "0.0001") field(INPD, "BEND:UNDS:3510:IACTPOL_CHECK.PVAL") field(OOPT, "On Change") field(FLNK, "BEND:UNDS:3510:IACTPOL") } record(bo, "BEND:UNDS:3510: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 record(mbbo, "BEND:UNDS:3510:FUNC") { field(DESC, "BEND:UNDS:3510 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, "1") field(THVL, "9") field(FRVL, "10") field(FVVL, "14") field(SXVL, "2") field(SVVL, "8") field(EIVL, "11") field(NIVL, "12") field(TEVL, "13") field(ELVL, "5") field(TVVL, "6") field(TTVL, "7") field(FTVL, "4") field(FFVL, "3") field(OUT, "BEND:UNDS:3510:CTRL CA") } # :CTRL pv is processed at boot in the # sequence mgntCtrl.st Processed in sequence # record(mbbo, "BEND:UNDS:3510:CTRL") { field(DESC, "BEND:UNDS:3510 Control") field(PINI, "NO") field(ZRST, "Ready") field(ONST, "TRIM") field(TWST, "PERTURB") field(THST, "BCON_TO_BDES") field(FRST, "BACT_TO_BDES") field(FVST, "SAVE_BDES") field(SXST, "LOAD_BDES") field(SVST, "UNDO_BDES") field(EIST, "DAC_ZERO") field(NIST, "CALIB") field(TEST, "STDZ") field(ELST, "RESET") field(TVST, "TURN_ON") field(TTST, "TURN_OFF") field(FTST, "DEGAUSS") field(FFST, "") field(ZRVL, "0") field(ONVL, "2") field(TWVL, "6") field(THVL, "15") field(FRVL, "14") field(FVVL, "11") field(SXVL, "12") field(SVVL, "13") field(EIVL, "7") field(NIVL, "3") field(TEVL, "4") field(ELVL, "8") field(TVVL, "9") field(TTVL, "10") field(FTVL, "5") field(FFVL, "0") field(OUT, "BEND:UNDS:3510:SELECTEN.A PP") field(SDIS, "0") } # If a function has been selected set this unit to busy record(calcout, "BEND:UNDS:3510:SELECTEN") { field(DESC, "Control Select Enable") field(CALC, "A>0?1:A") field(FLNK, "BEND:UNDS:3510:BUSY") } # Set to FREE on IOC reboot record(bo, "BEND:UNDS:3510:BUSY") { field(DESC, "BEND:UNDS:3510 Ctrl Done") field(DOL, "BEND:UNDS:3510:SELECTEN") field(ZNAM, "FREE") field(ONAM, "BUSY") field(PINI, "YES") field(FLNK, "BEND:UNDS:3510:SELECT") } record(bo, "BEND:UNDS:3510:SELECT") { field(ZNAM, "NO") field(ONAM, "YES") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") } record(bo, "BEND:UNDS:3510: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, "BEND:UNDS:3510:CTRLSTATE") { field(DESC, "BEND:UNDS:3510 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("BEND:UNDS:3510:CTRL",20,20,0,0,"BEND:UNDS:3510:CTRL") #! Field("BEND:UNDS:3510:CTRL.OUT",16777215,1,"BEND:UNDS:3510:CTRL.OUT") #! Link("BEND:UNDS:3510:CTRL.OUT","BEND:UNDS:3510:SELECTEN.A") #! Field("BEND:UNDS:3510:CTRL.VAL",16777215,1,"BEND:UNDS:3510:CTRL.VAL") #! Record("BEND:UNDS:3510:SELECTEN",321,381,0,0,"BEND:UNDS:3510:SELECTEN") #! Field("BEND:UNDS:3510:SELECTEN.A",16777215,0,"BEND:UNDS:3510:SELECTEN.A") #! Field("BEND:UNDS:3510:SELECTEN.FLNK",16777215,1,"BEND:UNDS:3510:SELECTEN.FLNK") #! Link("BEND:UNDS:3510:SELECTEN.FLNK","BEND:UNDS:3510:BUSY") #! Field("BEND:UNDS:3510:SELECTEN.VAL",16777215,1,"BEND:UNDS:3510:SELECTEN.VAL") #! Record("BEND:UNDS:3510:BUSY",623,274,0,0,"BEND:UNDS:3510:BUSY") #! Field("BEND:UNDS:3510:BUSY.DOL",16777215,0,"BEND:UNDS:3510:BUSY.DOL") #! Link("BEND:UNDS:3510:BUSY.DOL","BEND:UNDS:3510:SELECTEN.VAL") #! Field("BEND:UNDS:3510:BUSY.FLNK",16777215,1,"BEND:UNDS:3510:BUSY.FLNK") #! Link("BEND:UNDS:3510:BUSY.FLNK","BEND:UNDS:3510:SELECT") #! Record("BEND:UNDS:3510:SELECT",669,508,0,1,"BEND:UNDS:3510:SELECT") #! Record("BEND:UNDS:3510:FUNC",940,120,0,0,"BEND:UNDS:3510:FUNC") #! Field("BEND:UNDS:3510:FUNC.OUT",16777215,0,"BEND:UNDS:3510:FUNC.OUT") #! Link("BEND:UNDS:3510:FUNC.OUT","BEND:UNDS:3510:CTRL.VAL") #! Record("BEND:UNDS:3510:ABORT",193,41,0,0,"BEND:UNDS:3510:ABORT") #! Record("BEND:UNDS:3510:CTRLSTATE",369,34,0,0,"BEND:UNDS:3510: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,"BEND:UNDS:3510:SELECT is used for Multi-device selection.\nIt is enabled when associated BEND:UNDS:3510:CTRL is \"0\" (DONE).\nIt is disabled when associated BEND:UNDS:3510: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,"BEND:UNDS:3510: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.5 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND # Comment out the bar code pv by setting the macor # LNK="#" for the kicker I vs V poly coef record(stringout, "BEND:UNDS:3510:BARCODE") { field(DESC, "SLAC Barcode on Magnet") field(PINI, "YES") field(VAL, "000000") } record(stringout, "BEND:UNDS:3510:ENGNAME") { field(DESC, "Magnet Engineering Name") field(PINI, "YES") field(VAL, "Unknown") } record(sub, "BEND:UNDS:3510:POLYCOEF") { field(DESC, "BEND:UNDS:3510 Poly Coefs") field(INAM, "mgntNumPolyCoef") field(SNAM, "mgntNumPolyCoef") field(PREC, "8") field(A, "6.923589E-02") field(B, "2.849488E+00") field(C, "-2.979746E-03") field(D, "5.354610E-02") field(E, "4.554277E-03") field(F, "-2.171720E-02") field(G, "-1.071805E-04") field(H, "3.682357E-03") field(I, "0.0") field(J, "0.0") field(K, "0.0") field(L, "0.0") field(PINI, "YES") field(FLNK, "BEND:UNDS:3510:POLYCOEFNUM") } record(longin, "BEND:UNDS:3510:POLYCOEFNUM") { field(DESC, "No. of Poly Coef.") field(INP , "BEND:UNDS:3510:POLYCOEF.VAL NPP NMS") field(LOLO, "0") field(LLSV, "MAJOR") field(FLNK, "BEND:UNDS:3510:COEF2IVB") } record(sub, "BEND:UNDS:3510:COEF2IVB") { field(DESC, "Populate wf w/ poly coef") field(PINI, "YES") field(INAM, "mgntExplodeInit") field(SNAM, "mgntExplode") field(INPA, "BEND:UNDS:3510:POLYCOEF") field(INPB, "BEND:UNDS:3510:IVB") # Need to process IVB so that UDF=0 field(FLNK, "BEND:UNDS:3510:IVB") } # Note: this pv was requested by M. Woodley # so that he coudl get all the ivb poly coefficients # for a single magnet in one go. record(waveform, "BEND:UNDS:3510:IVB") { field(DESC, "Poly coef I vs B") field(DTYP, "Soft Channel") field(PREC, "8") field(NELM, "12") field(FTVL, "DOUBLE") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND # Comment out the bar code pv by setting the macor # LNK="#" for the kicker I vs V poly coef record(stringout, "BEND:UNDS:3530:BARCODE") { field(DESC, "SLAC Barcode on Magnet") field(PINI, "YES") field(VAL, "000000") } record(stringout, "BEND:UNDS:3530:ENGNAME") { field(DESC, "Magnet Engineering Name") field(PINI, "YES") field(VAL, "Unknown") } record(sub, "BEND:UNDS:3530:POLYCOEF") { field(DESC, "BEND:UNDS:3530 Poly Coefs") field(INAM, "mgntNumPolyCoef") field(SNAM, "mgntNumPolyCoef") field(PREC, "8") field(A, "6.889595E-02") field(B, "2.846475E+00") field(C, "-3.256468E-03") field(D, "5.230429E-02") field(E, "4.491223E-03") field(F, "-2.083358E-02") field(G, "-1.366529E-04") field(H, "3.509794E-03") field(I, "0.0") field(J, "0.0") field(K, "0.0") field(L, "0.0") field(PINI, "YES") field(FLNK, "BEND:UNDS:3530:POLYCOEFNUM") } record(longin, "BEND:UNDS:3530:POLYCOEFNUM") { field(DESC, "No. of Poly Coef.") field(INP , "BEND:UNDS:3530:POLYCOEF.VAL NPP NMS") field(LOLO, "0") field(LLSV, "MAJOR") field(FLNK, "BEND:UNDS:3530:COEF2IVB") } record(sub, "BEND:UNDS:3530:COEF2IVB") { field(DESC, "Populate wf w/ poly coef") field(PINI, "YES") field(INAM, "mgntExplodeInit") field(SNAM, "mgntExplode") field(INPA, "BEND:UNDS:3530:POLYCOEF") field(INPB, "BEND:UNDS:3530:IVB") # Need to process IVB so that UDF=0 field(FLNK, "BEND:UNDS:3530:IVB") } # Note: this pv was requested by M. Woodley # so that he coudl get all the ivb poly coefficients # for a single magnet in one go. record(waveform, "BEND:UNDS:3530:IVB") { field(DESC, "Poly coef I vs B") field(DTYP, "Soft Channel") field(PREC, "8") field(NELM, "12") field(FTVL, "DOUBLE") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND # Comment out the bar code pv by setting the macor # LNK="#" for the kicker I vs V poly coef record(stringout, "BEND:UNDS:3550:BARCODE") { field(DESC, "SLAC Barcode on Magnet") field(PINI, "YES") field(VAL, "000000") } record(stringout, "BEND:UNDS:3550:ENGNAME") { field(DESC, "Magnet Engineering Name") field(PINI, "YES") field(VAL, "Unknown") } record(sub, "BEND:UNDS:3550:POLYCOEF") { field(DESC, "BEND:UNDS:3550 Poly Coefs") field(INAM, "mgntNumPolyCoef") field(SNAM, "mgntNumPolyCoef") field(PREC, "8") field(A, "8.227240E-02") field(B, "2.839548E+00") field(C, "-5.139607E-03") field(D, "5.505767E-02") field(E, "5.620812E-03") field(F, "-2.126180E-02") field(G, "-2.825285E-04") field(H, "3.565568E-03") field(I, "0.0") field(J, "0.0") field(K, "0.0") field(L, "0.0") field(PINI, "YES") field(FLNK, "BEND:UNDS:3550:POLYCOEFNUM") } record(longin, "BEND:UNDS:3550:POLYCOEFNUM") { field(DESC, "No. of Poly Coef.") field(INP , "BEND:UNDS:3550:POLYCOEF.VAL NPP NMS") field(LOLO, "0") field(LLSV, "MAJOR") field(FLNK, "BEND:UNDS:3550:COEF2IVB") } record(sub, "BEND:UNDS:3550:COEF2IVB") { field(DESC, "Populate wf w/ poly coef") field(PINI, "YES") field(INAM, "mgntExplodeInit") field(SNAM, "mgntExplode") field(INPA, "BEND:UNDS:3550:POLYCOEF") field(INPB, "BEND:UNDS:3550:IVB") # Need to process IVB so that UDF=0 field(FLNK, "BEND:UNDS:3550:IVB") } # Note: this pv was requested by M. Woodley # so that he coudl get all the ivb poly coefficients # for a single magnet in one go. record(waveform, "BEND:UNDS:3550:IVB") { field(DESC, "Poly coef I vs B") field(DTYP, "Soft Channel") field(PREC, "8") field(NELM, "12") field(FTVL, "DOUBLE") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND # Comment out the bar code pv by setting the macor # LNK="#" for the kicker I vs V poly coef record(stringout, "BEND:UNDS:3570:BARCODE") { field(DESC, "SLAC Barcode on Magnet") field(PINI, "YES") field(VAL, "000000") } record(stringout, "BEND:UNDS:3570:ENGNAME") { field(DESC, "Magnet Engineering Name") field(PINI, "YES") field(VAL, "Unknown") } record(sub, "BEND:UNDS:3570:POLYCOEF") { field(DESC, "BEND:UNDS:3570 Poly Coefs") field(INAM, "mgntNumPolyCoef") field(SNAM, "mgntNumPolyCoef") field(PREC, "8") field(A, "7.345221E-02") field(B, "2.852310E+00") field(C, "-3.221954E-03") field(D, "5.203192E-02") field(E, "5.212466E-03") field(F, "-2.049071E-02") field(G, "-1.851465E-04") field(H, "3.506798E-03") field(I, "0.0") field(J, "0.0") field(K, "0.0") field(L, "0.0") field(PINI, "YES") field(FLNK, "BEND:UNDS:3570:POLYCOEFNUM") } record(longin, "BEND:UNDS:3570:POLYCOEFNUM") { field(DESC, "No. of Poly Coef.") field(INP , "BEND:UNDS:3570:POLYCOEF.VAL NPP NMS") field(LOLO, "0") field(LLSV, "MAJOR") field(FLNK, "BEND:UNDS:3570:COEF2IVB") } record(sub, "BEND:UNDS:3570:COEF2IVB") { field(DESC, "Populate wf w/ poly coef") field(PINI, "YES") field(INAM, "mgntExplodeInit") field(SNAM, "mgntExplode") field(INPA, "BEND:UNDS:3570:POLYCOEF") field(INPB, "BEND:UNDS:3570:IVB") # Need to process IVB so that UDF=0 field(FLNK, "BEND:UNDS:3570:IVB") } # Note: this pv was requested by M. Woodley # so that he coudl get all the ivb poly coefficients # for a single magnet in one go. record(waveform, "BEND:UNDS:3570:IVB") { field(DESC, "Poly coef I vs B") field(DTYP, "Soft Channel") field(PREC, "8") field(NELM, "12") field(FTVL, "DOUBLE") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND # Comment out the bar code pv by setting the macor # LNK="#" for the kicker I vs V poly coef record(stringout, "BEND:LTUS:475:BARCODE") { field(DESC, "SLAC Barcode on Magnet") field(PINI, "YES") field(VAL, "4529") } record(stringout, "BEND:LTUS:475:ENGNAME") { field(DESC, "Magnet Engineering Name") field(PINI, "YES") field(VAL, "Unknown") } record(sub, "BEND:LTUS:475:POLYCOEF") { field(DESC, "BEND:LTUS:475 Poly Coefs") field(INAM, "mgntNumPolyCoef") field(SNAM, "mgntNumPolyCoef") field(PREC, "8") field(A, "-7.513970E-01") field(B, "5.636675E+01") field(C, "-2.944125E+00") field(D, "1.687429E+00") field(E, "-4.270213E-01") field(F, "4.205544E-02") field(G, "0") field(H, "0") field(I, "0.0") field(J, "0.0") field(K, "0.0") field(L, "0.0") field(PINI, "YES") field(FLNK, "BEND:LTUS:475:POLYCOEFNUM") } record(longin, "BEND:LTUS:475:POLYCOEFNUM") { field(DESC, "No. of Poly Coef.") field(INP , "BEND:LTUS:475:POLYCOEF.VAL NPP NMS") field(LOLO, "0") field(LLSV, "MAJOR") field(FLNK, "BEND:LTUS:475:COEF2IVB") } record(sub, "BEND:LTUS:475:COEF2IVB") { field(DESC, "Populate wf w/ poly coef") field(PINI, "YES") field(INAM, "mgntExplodeInit") field(SNAM, "mgntExplode") field(INPA, "BEND:LTUS:475:POLYCOEF") field(INPB, "BEND:LTUS:475:IVB") # Need to process IVB so that UDF=0 field(FLNK, "BEND:LTUS:475:IVB") } # Note: this pv was requested by M. Woodley # so that he coudl get all the ivb poly coefficients # for a single magnet in one go. record(waveform, "BEND:LTUS:475:IVB") { field(DESC, "Poly coef I vs B") field(DTYP, "Soft Channel") field(PREC, "8") field(NELM, "12") field(FTVL, "DOUBLE") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND # Comment out the bar code pv by setting the macor # LNK="#" for the kicker I vs V poly coef record(stringout, "BEND:LTUS:476:BARCODE") { field(DESC, "SLAC Barcode on Magnet") field(PINI, "YES") field(VAL, "4548") } record(stringout, "BEND:LTUS:476:ENGNAME") { field(DESC, "Magnet Engineering Name") field(PINI, "YES") field(VAL, "Unknown") } record(sub, "BEND:LTUS:476:POLYCOEF") { field(DESC, "BEND:LTUS:476 Poly Coefs") field(INAM, "mgntNumPolyCoef") field(SNAM, "mgntNumPolyCoef") field(PREC, "8") field(A, "-7.834941E-01") field(B, "5.591593E+01") field(C, "-2.845905E+00") field(D, "1.627416E+00") field(E, "-4.176742E-01") field(F, "4.177028E-02") field(G, "0") field(H, "0") field(I, "0.0") field(J, "0.0") field(K, "0.0") field(L, "0.0") field(PINI, "YES") field(FLNK, "BEND:LTUS:476:POLYCOEFNUM") } record(longin, "BEND:LTUS:476:POLYCOEFNUM") { field(DESC, "No. of Poly Coef.") field(INP , "BEND:LTUS:476:POLYCOEF.VAL NPP NMS") field(LOLO, "0") field(LLSV, "MAJOR") field(FLNK, "BEND:LTUS:476:COEF2IVB") } record(sub, "BEND:LTUS:476:COEF2IVB") { field(DESC, "Populate wf w/ poly coef") field(PINI, "YES") field(INAM, "mgntExplodeInit") field(SNAM, "mgntExplode") field(INPA, "BEND:LTUS:476:POLYCOEF") field(INPB, "BEND:LTUS:476:IVB") # Need to process IVB so that UDF=0 field(FLNK, "BEND:LTUS:476:IVB") } # Note: this pv was requested by M. Woodley # so that he coudl get all the ivb poly coefficients # for a single magnet in one go. record(waveform, "BEND:LTUS:476:IVB") { field(DESC, "Poly coef I vs B") field(DTYP, "Soft Channel") field(PREC, "8") field(NELM, "12") field(FTVL, "DOUBLE") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND # Comment out the bar code pv by setting the macor # LNK="#" for the kicker I vs V poly coef record(stringout, "BEND:LTUS:477:BARCODE") { field(DESC, "SLAC Barcode on Magnet") field(PINI, "YES") field(VAL, "4540") } record(stringout, "BEND:LTUS:477:ENGNAME") { field(DESC, "Magnet Engineering Name") field(PINI, "YES") field(VAL, "Unknown") } record(sub, "BEND:LTUS:477:POLYCOEF") { field(DESC, "BEND:LTUS:477 Poly Coefs") field(INAM, "mgntNumPolyCoef") field(SNAM, "mgntNumPolyCoef") field(PREC, "8") field(A, "-8.380366E-01") field(B, "5.634547E+01") field(C, "-2.918518E+00") field(D, "1.650017E+00") field(E, "-4.189515E-01") field(F, "4.152080E-02") field(G, "0") field(H, "0") field(I, "0.0") field(J, "0.0") field(K, "0.0") field(L, "0.0") field(PINI, "YES") field(FLNK, "BEND:LTUS:477:POLYCOEFNUM") } record(longin, "BEND:LTUS:477:POLYCOEFNUM") { field(DESC, "No. of Poly Coef.") field(INP , "BEND:LTUS:477:POLYCOEF.VAL NPP NMS") field(LOLO, "0") field(LLSV, "MAJOR") field(FLNK, "BEND:LTUS:477:COEF2IVB") } record(sub, "BEND:LTUS:477:COEF2IVB") { field(DESC, "Populate wf w/ poly coef") field(PINI, "YES") field(INAM, "mgntExplodeInit") field(SNAM, "mgntExplode") field(INPA, "BEND:LTUS:477:POLYCOEF") field(INPB, "BEND:LTUS:477:IVB") # Need to process IVB so that UDF=0 field(FLNK, "BEND:LTUS:477:IVB") } # Note: this pv was requested by M. Woodley # so that he coudl get all the ivb poly coefficients # for a single magnet in one go. record(waveform, "BEND:LTUS:477:IVB") { field(DESC, "Poly coef I vs B") field(DTYP, "Soft Channel") field(PREC, "8") field(NELM, "12") field(FTVL, "DOUBLE") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND # Comment out the bar code pv by setting the macor # LNK="#" for the kicker I vs V poly coef record(stringout, "BEND:LTUS:478:BARCODE") { field(DESC, "SLAC Barcode on Magnet") field(PINI, "YES") field(VAL, "4539") } record(stringout, "BEND:LTUS:478:ENGNAME") { field(DESC, "Magnet Engineering Name") field(PINI, "YES") field(VAL, "Unknown") } record(sub, "BEND:LTUS:478:POLYCOEF") { field(DESC, "BEND:LTUS:478 Poly Coefs") field(INAM, "mgntNumPolyCoef") field(SNAM, "mgntNumPolyCoef") field(PREC, "8") field(A, "-6.973055E-01") field(B, "5.590107E+01") field(C, "-2.592690E+00") field(D, "1.484883E+00") field(E, "-3.820630E-01") field(F, "3.900744E-02") field(G, "0") field(H, "0") field(I, "0.0") field(J, "0.0") field(K, "0.0") field(L, "0.0") field(PINI, "YES") field(FLNK, "BEND:LTUS:478:POLYCOEFNUM") } record(longin, "BEND:LTUS:478:POLYCOEFNUM") { field(DESC, "No. of Poly Coef.") field(INP , "BEND:LTUS:478:POLYCOEF.VAL NPP NMS") field(LOLO, "0") field(LLSV, "MAJOR") field(FLNK, "BEND:LTUS:478:COEF2IVB") } record(sub, "BEND:LTUS:478:COEF2IVB") { field(DESC, "Populate wf w/ poly coef") field(PINI, "YES") field(INAM, "mgntExplodeInit") field(SNAM, "mgntExplode") field(INPA, "BEND:LTUS:478:POLYCOEF") field(INPB, "BEND:LTUS:478:IVB") # Need to process IVB so that UDF=0 field(FLNK, "BEND:LTUS:478:IVB") } # Note: this pv was requested by M. Woodley # so that he coudl get all the ivb poly coefficients # for a single magnet in one go. record(waveform, "BEND:LTUS:478:IVB") { field(DESC, "Poly coef I vs B") field(DTYP, "Soft Channel") field(PREC, "8") field(NELM, "12") field(FTVL, "DOUBLE") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND # Comment out the bar code pv by setting the macor # LNK="#" for the kicker I vs V poly coef record(stringout, "BEND:LTUS:165:BARCODE") { field(DESC, "SLAC Barcode on Magnet") field(PINI, "YES") field(VAL, "4537") } record(stringout, "BEND:LTUS:165:ENGNAME") { field(DESC, "Magnet Engineering Name") field(PINI, "YES") field(VAL, "Unknown") } record(sub, "BEND:LTUS:165:POLYCOEF") { field(DESC, "BEND:LTUS:165 Poly Coefs") field(INAM, "mgntNumPolyCoef") field(SNAM, "mgntNumPolyCoef") field(PREC, "8") field(A, "-7.139775E-01") field(B, "5.616477E+01") field(C, "-2.875467E+00") field(D, "1.635544E+00") field(E, "-4.174282E-01") field(F, "4.171038E-02") field(G, "0") field(H, "0") field(I, "0.0") field(J, "0.0") field(K, "0.0") field(L, "0.0") field(PINI, "YES") field(FLNK, "BEND:LTUS:165:POLYCOEFNUM") } record(longin, "BEND:LTUS:165:POLYCOEFNUM") { field(DESC, "No. of Poly Coef.") field(INP , "BEND:LTUS:165:POLYCOEF.VAL NPP NMS") field(LOLO, "0") field(LLSV, "MAJOR") field(FLNK, "BEND:LTUS:165:COEF2IVB") } record(sub, "BEND:LTUS:165:COEF2IVB") { field(DESC, "Populate wf w/ poly coef") field(PINI, "YES") field(INAM, "mgntExplodeInit") field(SNAM, "mgntExplode") field(INPA, "BEND:LTUS:165:POLYCOEF") field(INPB, "BEND:LTUS:165:IVB") # Need to process IVB so that UDF=0 field(FLNK, "BEND:LTUS:165:IVB") } # Note: this pv was requested by M. Woodley # so that he coudl get all the ivb poly coefficients # for a single magnet in one go. record(waveform, "BEND:LTUS:165:IVB") { field(DESC, "Poly coef I vs B") field(DTYP, "Soft Channel") field(PREC, "8") field(NELM, "12") field(FTVL, "DOUBLE") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND # Comment out the bar code pv by setting the macor # LNK="#" for the kicker I vs V poly coef record(stringout, "BEND:LTUS:166:BARCODE") { field(DESC, "SLAC Barcode on Magnet") field(PINI, "YES") field(VAL, "4535") } record(stringout, "BEND:LTUS:166:ENGNAME") { field(DESC, "Magnet Engineering Name") field(PINI, "YES") field(VAL, "Unknown") } record(sub, "BEND:LTUS:166:POLYCOEF") { field(DESC, "BEND:LTUS:166 Poly Coefs") field(INAM, "mgntNumPolyCoef") field(SNAM, "mgntNumPolyCoef") field(PREC, "8") field(A, "-7.157914E-01") field(B, "5.631336E+01") field(C, "-2.667481E+00") field(D, "1.507155E+00") field(E, "-3.880299E-01") field(F, "3.920874E-02") field(G, "0") field(H, "0") field(I, "0.0") field(J, "0.0") field(K, "0.0") field(L, "0.0") field(PINI, "YES") field(FLNK, "BEND:LTUS:166:POLYCOEFNUM") } record(longin, "BEND:LTUS:166:POLYCOEFNUM") { field(DESC, "No. of Poly Coef.") field(INP , "BEND:LTUS:166:POLYCOEF.VAL NPP NMS") field(LOLO, "0") field(LLSV, "MAJOR") field(FLNK, "BEND:LTUS:166:COEF2IVB") } record(sub, "BEND:LTUS:166:COEF2IVB") { field(DESC, "Populate wf w/ poly coef") field(PINI, "YES") field(INAM, "mgntExplodeInit") field(SNAM, "mgntExplode") field(INPA, "BEND:LTUS:166:POLYCOEF") field(INPB, "BEND:LTUS:166:IVB") # Need to process IVB so that UDF=0 field(FLNK, "BEND:LTUS:166:IVB") } # Note: this pv was requested by M. Woodley # so that he coudl get all the ivb poly coefficients # for a single magnet in one go. record(waveform, "BEND:LTUS:166:IVB") { field(DESC, "Poly coef I vs B") field(DTYP, "Soft Channel") field(PREC, "8") field(NELM, "12") field(FTVL, "DOUBLE") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND # Comment out the bar code pv by setting the macor # LNK="#" for the kicker I vs V poly coef record(stringout, "BEND:LTUS:167:BARCODE") { field(DESC, "SLAC Barcode on Magnet") field(PINI, "YES") field(VAL, "4536") } record(stringout, "BEND:LTUS:167:ENGNAME") { field(DESC, "Magnet Engineering Name") field(PINI, "YES") field(VAL, "Unknown") } record(sub, "BEND:LTUS:167:POLYCOEF") { field(DESC, "BEND:LTUS:167 Poly Coefs") field(INAM, "mgntNumPolyCoef") field(SNAM, "mgntNumPolyCoef") field(PREC, "8") field(A, "-7.542113E-01") field(B, "5.630636E+01") field(C, "-2.683797E+00") field(D, "1.488407E+00") field(E, "-3.769387E-01") field(F, "3.786328E-02") field(G, "0") field(H, "0") field(I, "0.0") field(J, "0.0") field(K, "0.0") field(L, "0.0") field(PINI, "YES") field(FLNK, "BEND:LTUS:167:POLYCOEFNUM") } record(longin, "BEND:LTUS:167:POLYCOEFNUM") { field(DESC, "No. of Poly Coef.") field(INP , "BEND:LTUS:167:POLYCOEF.VAL NPP NMS") field(LOLO, "0") field(LLSV, "MAJOR") field(FLNK, "BEND:LTUS:167:COEF2IVB") } record(sub, "BEND:LTUS:167:COEF2IVB") { field(DESC, "Populate wf w/ poly coef") field(PINI, "YES") field(INAM, "mgntExplodeInit") field(SNAM, "mgntExplode") field(INPA, "BEND:LTUS:167:POLYCOEF") field(INPB, "BEND:LTUS:167:IVB") # Need to process IVB so that UDF=0 field(FLNK, "BEND:LTUS:167:IVB") } # Note: this pv was requested by M. Woodley # so that he coudl get all the ivb poly coefficients # for a single magnet in one go. record(waveform, "BEND:LTUS:167:IVB") { field(DESC, "Poly coef I vs B") field(DTYP, "Soft Channel") field(PREC, "8") field(NELM, "12") field(FTVL, "DOUBLE") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND # Comment out the bar code pv by setting the macor # LNK="#" for the kicker I vs V poly coef record(stringout, "BEND:LTUS:168:BARCODE") { field(DESC, "SLAC Barcode on Magnet") field(PINI, "YES") field(VAL, "4531") } record(stringout, "BEND:LTUS:168:ENGNAME") { field(DESC, "Magnet Engineering Name") field(PINI, "YES") field(VAL, "Unknown") } record(sub, "BEND:LTUS:168:POLYCOEF") { field(DESC, "BEND:LTUS:168 Poly Coefs") field(INAM, "mgntNumPolyCoef") field(SNAM, "mgntNumPolyCoef") field(PREC, "8") field(A, "-7.342513E-01") field(B, "5.614453E+01") field(C, "-3.099961E+00") field(D, "1.787877E+00") field(E, "-4.577658E-01") field(F, "4.529980E-02") field(G, "0") field(H, "0") field(I, "0.0") field(J, "0.0") field(K, "0.0") field(L, "0.0") field(PINI, "YES") field(FLNK, "BEND:LTUS:168:POLYCOEFNUM") } record(longin, "BEND:LTUS:168:POLYCOEFNUM") { field(DESC, "No. of Poly Coef.") field(INP , "BEND:LTUS:168:POLYCOEF.VAL NPP NMS") field(LOLO, "0") field(LLSV, "MAJOR") field(FLNK, "BEND:LTUS:168:COEF2IVB") } record(sub, "BEND:LTUS:168:COEF2IVB") { field(DESC, "Populate wf w/ poly coef") field(PINI, "YES") field(INAM, "mgntExplodeInit") field(SNAM, "mgntExplode") field(INPA, "BEND:LTUS:168:POLYCOEF") field(INPB, "BEND:LTUS:168:IVB") # Need to process IVB so that UDF=0 field(FLNK, "BEND:LTUS:168:IVB") } # Note: this pv was requested by M. Woodley # so that he coudl get all the ivb poly coefficients # for a single magnet in one go. record(waveform, "BEND:LTUS:168:IVB") { field(DESC, "Poly coef I vs B") field(DTYP, "Soft Channel") field(PREC, "8") field(NELM, "12") field(FTVL, "DOUBLE") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND # Comment out the bar code pv by setting the macor # LNK="#" for the kicker I vs V poly coef record(stringout, "BEND:LTUS:175:BARCODE") { field(DESC, "SLAC Barcode on Magnet") field(PINI, "YES") field(VAL, "4510") } record(stringout, "BEND:LTUS:175:ENGNAME") { field(DESC, "Magnet Engineering Name") field(PINI, "YES") field(VAL, "Unknown") } record(sub, "BEND:LTUS:175:POLYCOEF") { field(DESC, "BEND:LTUS:175 Poly Coefs") field(INAM, "mgntNumPolyCoef") field(SNAM, "mgntNumPolyCoef") field(PREC, "8") field(A, "-1.084170E+00") field(B, "1.299190E+01") field(C, "-5.794292E-02") field(D, "5.024955E-03") field(E, "-2.349920E-04") field(F, "4.981495E-06") field(G, "0") field(H, "0") field(I, "0.0") field(J, "0.0") field(K, "0.0") field(L, "0.0") field(PINI, "YES") field(FLNK, "BEND:LTUS:175:POLYCOEFNUM") } record(longin, "BEND:LTUS:175:POLYCOEFNUM") { field(DESC, "No. of Poly Coef.") field(INP , "BEND:LTUS:175:POLYCOEF.VAL NPP NMS") field(LOLO, "0") field(LLSV, "MAJOR") field(FLNK, "BEND:LTUS:175:COEF2IVB") } record(sub, "BEND:LTUS:175:COEF2IVB") { field(DESC, "Populate wf w/ poly coef") field(PINI, "YES") field(INAM, "mgntExplodeInit") field(SNAM, "mgntExplode") field(INPA, "BEND:LTUS:175:POLYCOEF") field(INPB, "BEND:LTUS:175:IVB") # Need to process IVB so that UDF=0 field(FLNK, "BEND:LTUS:175:IVB") } # Note: this pv was requested by M. Woodley # so that he coudl get all the ivb poly coefficients # for a single magnet in one go. record(waveform, "BEND:LTUS:175:IVB") { field(DESC, "Poly coef I vs B") field(DTYP, "Soft Channel") field(PREC, "8") field(NELM, "12") field(FTVL, "DOUBLE") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND # Comment out the bar code pv by setting the macor # LNK="#" for the kicker I vs V poly coef record(stringout, "BEND:LTUS:460:BARCODE") { field(DESC, "SLAC Barcode on Magnet") field(PINI, "YES") field(VAL, "4509") } record(stringout, "BEND:LTUS:460:ENGNAME") { field(DESC, "Magnet Engineering Name") field(PINI, "YES") field(VAL, "Unknown") } record(sub, "BEND:LTUS:460:POLYCOEF") { field(DESC, "BEND:LTUS:460 Poly Coefs") field(INAM, "mgntNumPolyCoef") field(SNAM, "mgntNumPolyCoef") field(PREC, "8") field(A, "-1.042521E+00") field(B, "1.300644E+01") field(C, "-4.582990E-02") field(D, "2.336986E-03") field(E, "4.608602E-06") field(F, "-2.140751E-06") field(G, "0") field(H, "0") field(I, "0.0") field(J, "0.0") field(K, "0.0") field(L, "0.0") field(PINI, "YES") field(FLNK, "BEND:LTUS:460:POLYCOEFNUM") } record(longin, "BEND:LTUS:460:POLYCOEFNUM") { field(DESC, "No. of Poly Coef.") field(INP , "BEND:LTUS:460:POLYCOEF.VAL NPP NMS") field(LOLO, "0") field(LLSV, "MAJOR") field(FLNK, "BEND:LTUS:460:COEF2IVB") } record(sub, "BEND:LTUS:460:COEF2IVB") { field(DESC, "Populate wf w/ poly coef") field(PINI, "YES") field(INAM, "mgntExplodeInit") field(SNAM, "mgntExplode") field(INPA, "BEND:LTUS:460:POLYCOEF") field(INPB, "BEND:LTUS:460:IVB") # Need to process IVB so that UDF=0 field(FLNK, "BEND:LTUS:460:IVB") } # Note: this pv was requested by M. Woodley # so that he coudl get all the ivb poly coefficients # for a single magnet in one go. record(waveform, "BEND:LTUS:460:IVB") { field(DESC, "Poly coef I vs B") field(DTYP, "Soft Channel") field(PREC, "8") field(NELM, "12") field(FTVL, "DOUBLE") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND # Comment out the bar code pv by setting the macor # LNK="#" for the kicker I vs V poly coef record(stringout, "BEND:DMPS:400:BARCODE") { field(DESC, "SLAC Barcode on Magnet") field(PINI, "YES") field(VAL, "4521") } record(stringout, "BEND:DMPS:400:ENGNAME") { field(DESC, "Magnet Engineering Name") field(PINI, "YES") field(VAL, "Unknown") } record(sub, "BEND:DMPS:400:POLYCOEF") { field(DESC, "BEND:DMPS:400 Poly Coefs") field(INAM, "mgntNumPolyCoef") field(SNAM, "mgntNumPolyCoef") field(PREC, "8") field(A, "-3.413669E-01") field(B, "1.293443E+01") field(C, "-1.088283E-01") field(D, "1.470948E-02") field(E, "-8.340288E-04") field(F, "1.761874E-05") field(G, "0") field(H, "0") field(I, "0.0") field(J, "0.0") field(K, "0.0") field(L, "0.0") field(PINI, "YES") field(FLNK, "BEND:DMPS:400:POLYCOEFNUM") } record(longin, "BEND:DMPS:400:POLYCOEFNUM") { field(DESC, "No. of Poly Coef.") field(INP , "BEND:DMPS:400:POLYCOEF.VAL NPP NMS") field(LOLO, "0") field(LLSV, "MAJOR") field(FLNK, "BEND:DMPS:400:COEF2IVB") } record(sub, "BEND:DMPS:400:COEF2IVB") { field(DESC, "Populate wf w/ poly coef") field(PINI, "YES") field(INAM, "mgntExplodeInit") field(SNAM, "mgntExplode") field(INPA, "BEND:DMPS:400:POLYCOEF") field(INPB, "BEND:DMPS:400:IVB") # Need to process IVB so that UDF=0 field(FLNK, "BEND:DMPS:400:IVB") } # Note: this pv was requested by M. Woodley # so that he coudl get all the ivb poly coefficients # for a single magnet in one go. record(waveform, "BEND:DMPS:400:IVB") { field(DESC, "Poly coef I vs B") field(DTYP, "Soft Channel") field(PREC, "8") field(NELM, "12") field(FTVL, "DOUBLE") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND # Comment out the bar code pv by setting the macor # LNK="#" for the kicker I vs V poly coef record(stringout, "BEND:DMPS:410:BARCODE") { field(DESC, "SLAC Barcode on Magnet") field(PINI, "YES") field(VAL, "4520") } record(stringout, "BEND:DMPS:410:ENGNAME") { field(DESC, "Magnet Engineering Name") field(PINI, "YES") field(VAL, "Unknown") } record(sub, "BEND:DMPS:410:POLYCOEF") { field(DESC, "BEND:DMPS:410 Poly Coefs") field(INAM, "mgntNumPolyCoef") field(SNAM, "mgntNumPolyCoef") field(PREC, "8") field(A, "-3.489522E-01") field(B, "1.297008E+01") field(C, "-1.147648E-01") field(D, "1.584952E-02") field(E, "-9.285510E-04") field(F, "2.029655E-05") field(G, "0") field(H, "0") field(I, "0.0") field(J, "0.0") field(K, "0.0") field(L, "0.0") field(PINI, "YES") field(FLNK, "BEND:DMPS:410:POLYCOEFNUM") } record(longin, "BEND:DMPS:410:POLYCOEFNUM") { field(DESC, "No. of Poly Coef.") field(INP , "BEND:DMPS:410:POLYCOEF.VAL NPP NMS") field(LOLO, "0") field(LLSV, "MAJOR") field(FLNK, "BEND:DMPS:410:COEF2IVB") } record(sub, "BEND:DMPS:410:COEF2IVB") { field(DESC, "Populate wf w/ poly coef") field(PINI, "YES") field(INAM, "mgntExplodeInit") field(SNAM, "mgntExplode") field(INPA, "BEND:DMPS:410:POLYCOEF") field(INPB, "BEND:DMPS:410:IVB") # Need to process IVB so that UDF=0 field(FLNK, "BEND:DMPS:410:IVB") } # Note: this pv was requested by M. Woodley # so that he coudl get all the ivb poly coefficients # for a single magnet in one go. record(waveform, "BEND:DMPS:410:IVB") { field(DESC, "Poly coef I vs B") field(DTYP, "Soft Channel") field(PREC, "8") field(NELM, "12") field(FTVL, "DOUBLE") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND # Comment out the bar code pv by setting the macor # LNK="#" for the kicker I vs V poly coef record(stringout, "BEND:DMPS:420:BARCODE") { field(DESC, "SLAC Barcode on Magnet") field(PINI, "YES") field(VAL, "43519") } record(stringout, "BEND:DMPS:420:ENGNAME") { field(DESC, "Magnet Engineering Name") field(PINI, "YES") field(VAL, "Unknown") } record(sub, "BEND:DMPS:420:POLYCOEF") { field(DESC, "BEND:DMPS:420 Poly Coefs") field(INAM, "mgntNumPolyCoef") field(SNAM, "mgntNumPolyCoef") field(PREC, "8") field(A, "-3.843531E-01") field(B, "1.300512E+01") field(C, "-1.225371E-01") field(D, "1.698771E-02") field(E, "-1.002310E-03") field(F, "2.206829E-05") field(G, "0") field(H, "0") field(I, "0.0") field(J, "0.0") field(K, "0.0") field(L, "0.0") field(PINI, "YES") field(FLNK, "BEND:DMPS:420:POLYCOEFNUM") } record(longin, "BEND:DMPS:420:POLYCOEFNUM") { field(DESC, "No. of Poly Coef.") field(INP , "BEND:DMPS:420:POLYCOEF.VAL NPP NMS") field(LOLO, "0") field(LLSV, "MAJOR") field(FLNK, "BEND:DMPS:420:COEF2IVB") } record(sub, "BEND:DMPS:420:COEF2IVB") { field(DESC, "Populate wf w/ poly coef") field(PINI, "YES") field(INAM, "mgntExplodeInit") field(SNAM, "mgntExplode") field(INPA, "BEND:DMPS:420:POLYCOEF") field(INPB, "BEND:DMPS:420:IVB") # Need to process IVB so that UDF=0 field(FLNK, "BEND:DMPS:420:IVB") } # Note: this pv was requested by M. Woodley # so that he coudl get all the ivb poly coefficients # for a single magnet in one go. record(waveform, "BEND:DMPS:420:IVB") { field(DESC, "Poly coef I vs B") field(DTYP, "Soft Channel") field(PREC, "8") field(NELM, "12") field(FTVL, "DOUBLE") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND # Comment out the bar code pv by setting the macor # LNK="#" for the kicker I vs V poly coef record(stringout, "BEND:LTUS:525:BARCODE") { field(DESC, "SLAC Barcode on Magnet") field(PINI, "YES") field(VAL, "4500") } record(stringout, "BEND:LTUS:525:ENGNAME") { field(DESC, "Magnet Engineering Name") field(PINI, "YES") field(VAL, "Unknown") } record(sub, "BEND:LTUS:525:POLYCOEF") { field(DESC, "BEND:LTUS:525 Poly Coefs") field(INAM, "mgntNumPolyCoef") field(SNAM, "mgntNumPolyCoef") field(PREC, "8") field(A, "-5.979803E-02") field(B, "5.181674E-01") field(C, "-9.614444E-04") field(D, "4.672849E-05") field(E, "-7.713252E-07") field(F, "0") field(G, "0") field(H, "0") field(I, "0.0") field(J, "0.0") field(K, "0.0") field(L, "0.0") field(PINI, "YES") field(FLNK, "BEND:LTUS:525:POLYCOEFNUM") } record(longin, "BEND:LTUS:525:POLYCOEFNUM") { field(DESC, "No. of Poly Coef.") field(INP , "BEND:LTUS:525:POLYCOEF.VAL NPP NMS") field(LOLO, "0") field(LLSV, "MAJOR") field(FLNK, "BEND:LTUS:525:COEF2IVB") } record(sub, "BEND:LTUS:525:COEF2IVB") { field(DESC, "Populate wf w/ poly coef") field(PINI, "YES") field(INAM, "mgntExplodeInit") field(SNAM, "mgntExplode") field(INPA, "BEND:LTUS:525:POLYCOEF") field(INPB, "BEND:LTUS:525:IVB") # Need to process IVB so that UDF=0 field(FLNK, "BEND:LTUS:525:IVB") } # Note: this pv was requested by M. Woodley # so that he coudl get all the ivb poly coefficients # for a single magnet in one go. record(waveform, "BEND:LTUS:525:IVB") { field(DESC, "Poly coef I vs B") field(DTYP, "Soft Channel") field(PREC, "8") field(NELM, "12") field(FTVL, "DOUBLE") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND # Comment out the bar code pv by setting the macor # LNK="#" for the kicker I vs V poly coef record(stringout, "BEND:LTUS:565:BARCODE") { field(DESC, "SLAC Barcode on Magnet") field(PINI, "YES") field(VAL, "4501") } record(stringout, "BEND:LTUS:565:ENGNAME") { field(DESC, "Magnet Engineering Name") field(PINI, "YES") field(VAL, "Unknown") } record(sub, "BEND:LTUS:565:POLYCOEF") { field(DESC, "BEND:LTUS:565 Poly Coefs") field(INAM, "mgntNumPolyCoef") field(SNAM, "mgntNumPolyCoef") field(PREC, "8") field(A, "-6.313165E-02") field(B, "5.172933E-01") field(C, "-8.879085E-04") field(D, "3.905411E-05") field(E, "-5.877897E-07") field(F, "0") field(G, "0") field(H, "0") field(I, "0.0") field(J, "0.0") field(K, "0.0") field(L, "0.0") field(PINI, "YES") field(FLNK, "BEND:LTUS:565:POLYCOEFNUM") } record(longin, "BEND:LTUS:565:POLYCOEFNUM") { field(DESC, "No. of Poly Coef.") field(INP , "BEND:LTUS:565:POLYCOEF.VAL NPP NMS") field(LOLO, "0") field(LLSV, "MAJOR") field(FLNK, "BEND:LTUS:565:COEF2IVB") } record(sub, "BEND:LTUS:565:COEF2IVB") { field(DESC, "Populate wf w/ poly coef") field(PINI, "YES") field(INAM, "mgntExplodeInit") field(SNAM, "mgntExplode") field(INPA, "BEND:LTUS:565:POLYCOEF") field(INPB, "BEND:LTUS:565:IVB") # Need to process IVB so that UDF=0 field(FLNK, "BEND:LTUS:565:IVB") } # Note: this pv was requested by M. Woodley # so that he coudl get all the ivb poly coefficients # for a single magnet in one go. record(waveform, "BEND:LTUS:565:IVB") { field(DESC, "Poly coef I vs B") field(DTYP, "Soft Channel") field(PREC, "8") field(NELM, "12") field(FTVL, "DOUBLE") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND # Comment out the bar code pv by setting the macor # LNK="#" for the kicker I vs V poly coef record(stringout, "BEND:LTUS:763:BARCODE") { field(DESC, "SLAC Barcode on Magnet") field(PINI, "YES") field(VAL, "4550") } record(stringout, "BEND:LTUS:763:ENGNAME") { field(DESC, "Magnet Engineering Name") field(PINI, "YES") field(VAL, "Unknown") } record(sub, "BEND:LTUS:763:POLYCOEF") { field(DESC, "BEND:LTUS:763 Poly Coefs") field(INAM, "mgntNumPolyCoef") field(SNAM, "mgntNumPolyCoef") field(PREC, "8") field(A, "1.226728E-01") field(B, "6.089847E+00") field(C, "-3.300452E-03") field(D, "1.287441E-02") field(E, "2.337369E-04") field(F, "1.564616E-03") field(G, "0") field(H, "0") field(I, "0.0") field(J, "0.0") field(K, "0.0") field(L, "0.0") field(PINI, "YES") field(FLNK, "BEND:LTUS:763:POLYCOEFNUM") } record(longin, "BEND:LTUS:763:POLYCOEFNUM") { field(DESC, "No. of Poly Coef.") field(INP , "BEND:LTUS:763:POLYCOEF.VAL NPP NMS") field(LOLO, "0") field(LLSV, "MAJOR") field(FLNK, "BEND:LTUS:763:COEF2IVB") } record(sub, "BEND:LTUS:763:COEF2IVB") { field(DESC, "Populate wf w/ poly coef") field(PINI, "YES") field(INAM, "mgntExplodeInit") field(SNAM, "mgntExplode") field(INPA, "BEND:LTUS:763:POLYCOEF") field(INPB, "BEND:LTUS:763:IVB") # Need to process IVB so that UDF=0 field(FLNK, "BEND:LTUS:763:IVB") } # Note: this pv was requested by M. Woodley # so that he coudl get all the ivb poly coefficients # for a single magnet in one go. record(waveform, "BEND:LTUS:763:IVB") { field(DESC, "Poly coef I vs B") field(DTYP, "Soft Channel") field(PREC, "8") field(NELM, "12") field(FTVL, "DOUBLE") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND # Comment out the bar code pv by setting the macor # LNK="#" for the kicker I vs V poly coef record(stringout, "BEND:LTUS:764:BARCODE") { field(DESC, "SLAC Barcode on Magnet") field(PINI, "YES") field(VAL, "4551") } record(stringout, "BEND:LTUS:764:ENGNAME") { field(DESC, "Magnet Engineering Name") field(PINI, "YES") field(VAL, "Unknown") } record(sub, "BEND:LTUS:764:POLYCOEF") { field(DESC, "BEND:LTUS:764 Poly Coefs") field(INAM, "mgntNumPolyCoef") field(SNAM, "mgntNumPolyCoef") field(PREC, "8") field(A, "1.165391E-01") field(B, "6.137400E+00") field(C, "-2.876661E-03") field(D, "1.462685E-02") field(E, "1.116980E-05") field(F, "1.434732E-03") field(G, "0") field(H, "0") field(I, "0.0") field(J, "0.0") field(K, "0.0") field(L, "0.0") field(PINI, "YES") field(FLNK, "BEND:LTUS:764:POLYCOEFNUM") } record(longin, "BEND:LTUS:764:POLYCOEFNUM") { field(DESC, "No. of Poly Coef.") field(INP , "BEND:LTUS:764:POLYCOEF.VAL NPP NMS") field(LOLO, "0") field(LLSV, "MAJOR") field(FLNK, "BEND:LTUS:764:COEF2IVB") } record(sub, "BEND:LTUS:764:COEF2IVB") { field(DESC, "Populate wf w/ poly coef") field(PINI, "YES") field(INAM, "mgntExplodeInit") field(SNAM, "mgntExplode") field(INPA, "BEND:LTUS:764:POLYCOEF") field(INPB, "BEND:LTUS:764:IVB") # Need to process IVB so that UDF=0 field(FLNK, "BEND:LTUS:764:IVB") } # Note: this pv was requested by M. Woodley # so that he coudl get all the ivb poly coefficients # for a single magnet in one go. record(waveform, "BEND:LTUS:764:IVB") { field(DESC, "Poly coef I vs B") field(DTYP, "Soft Channel") field(PREC, "8") field(NELM, "12") field(FTVL, "DOUBLE") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND # Comment out the bar code pv by setting the macor # LNK="#" for the kicker I vs V poly coef record(stringout, "BEND:LTUS:765:BARCODE") { field(DESC, "SLAC Barcode on Magnet") field(PINI, "YES") field(VAL, "4552") } record(stringout, "BEND:LTUS:765:ENGNAME") { field(DESC, "Magnet Engineering Name") field(PINI, "YES") field(VAL, "Unknown") } record(sub, "BEND:LTUS:765:POLYCOEF") { field(DESC, "BEND:LTUS:765 Poly Coefs") field(INAM, "mgntNumPolyCoef") field(SNAM, "mgntNumPolyCoef") field(PREC, "8") field(A, "1.159230E-01") field(B, "6.103792E+00") field(C, "-3.086601E-03") field(D, "1.361500E-02") field(E, "1.101834E-04") field(F, "1.555011E-03") field(G, "0") field(H, "0") field(I, "0.0") field(J, "0.0") field(K, "0.0") field(L, "0.0") field(PINI, "YES") field(FLNK, "BEND:LTUS:765:POLYCOEFNUM") } record(longin, "BEND:LTUS:765:POLYCOEFNUM") { field(DESC, "No. of Poly Coef.") field(INP , "BEND:LTUS:765:POLYCOEF.VAL NPP NMS") field(LOLO, "0") field(LLSV, "MAJOR") field(FLNK, "BEND:LTUS:765:COEF2IVB") } record(sub, "BEND:LTUS:765:COEF2IVB") { field(DESC, "Populate wf w/ poly coef") field(PINI, "YES") field(INAM, "mgntExplodeInit") field(SNAM, "mgntExplode") field(INPA, "BEND:LTUS:765:POLYCOEF") field(INPB, "BEND:LTUS:765:IVB") # Need to process IVB so that UDF=0 field(FLNK, "BEND:LTUS:765:IVB") } # Note: this pv was requested by M. Woodley # so that he coudl get all the ivb poly coefficients # for a single magnet in one go. record(waveform, "BEND:LTUS:765:IVB") { field(DESC, "Poly coef I vs B") field(DTYP, "Soft Channel") field(PREC, "8") field(NELM, "12") field(FTVL, "DOUBLE") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND # Comment out the bar code pv by setting the macor # LNK="#" for the kicker I vs V poly coef record(stringout, "BEND:LTUS:766:BARCODE") { field(DESC, "SLAC Barcode on Magnet") field(PINI, "YES") field(VAL, "4553") } record(stringout, "BEND:LTUS:766:ENGNAME") { field(DESC, "Magnet Engineering Name") field(PINI, "YES") field(VAL, "Unknown") } record(sub, "BEND:LTUS:766:POLYCOEF") { field(DESC, "BEND:LTUS:766 Poly Coefs") field(INAM, "mgntNumPolyCoef") field(SNAM, "mgntNumPolyCoef") field(PREC, "8") field(A, "1.255900E-01") field(B, "6.109860E+00") field(C, "-3.360461E-03") field(D, "1.407456E-02") field(E, "1.608764E-04") field(F, "1.458262E-03") field(G, "0") field(H, "0") field(I, "0.0") field(J, "0.0") field(K, "0.0") field(L, "0.0") field(PINI, "YES") field(FLNK, "BEND:LTUS:766:POLYCOEFNUM") } record(longin, "BEND:LTUS:766:POLYCOEFNUM") { field(DESC, "No. of Poly Coef.") field(INP , "BEND:LTUS:766:POLYCOEF.VAL NPP NMS") field(LOLO, "0") field(LLSV, "MAJOR") field(FLNK, "BEND:LTUS:766:COEF2IVB") } record(sub, "BEND:LTUS:766:COEF2IVB") { field(DESC, "Populate wf w/ poly coef") field(PINI, "YES") field(INAM, "mgntExplodeInit") field(SNAM, "mgntExplode") field(INPA, "BEND:LTUS:766:POLYCOEF") field(INPB, "BEND:LTUS:766:IVB") # Need to process IVB so that UDF=0 field(FLNK, "BEND:LTUS:766:IVB") } # Note: this pv was requested by M. Woodley # so that he coudl get all the ivb poly coefficients # for a single magnet in one go. record(waveform, "BEND:LTUS:766:IVB") { field(DESC, "Poly coef I vs B") field(DTYP, "Soft Channel") field(PREC, "8") field(NELM, "12") field(FTVL, "DOUBLE") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND # Comment out the bar code pv by setting the macor # LNK="#" for the kicker I vs V poly coef record(stringout, "QUAD:LTUS:110:BARCODE") { field(DESC, "SLAC Barcode on Magnet") field(PINI, "YES") field(VAL, "4122") } record(stringout, "QUAD:LTUS:110:ENGNAME") { field(DESC, "Magnet Engineering Name") field(PINI, "YES") field(VAL, "Unknown") } record(sub, "QUAD:LTUS:110:POLYCOEF") { field(DESC, "QUAD:LTUS:110 Poly Coefs") field(INAM, "mgntNumPolyCoef") field(SNAM, "mgntNumPolyCoef") field(PREC, "8") field(A, "3.459387E-01") field(B, "1.751614E+00") field(C, "5.801022E-05") field(D, "2.092361E-06") field(E, "-1.739013E-08") field(F, "7.125408E-10") field(G, "0") field(H, "0") field(I, "0.0") field(J, "0.0") field(K, "0.0") field(L, "0.0") field(PINI, "YES") field(FLNK, "QUAD:LTUS:110:POLYCOEFNUM") } record(longin, "QUAD:LTUS:110:POLYCOEFNUM") { field(DESC, "No. of Poly Coef.") field(INP , "QUAD:LTUS:110:POLYCOEF.VAL NPP NMS") field(LOLO, "0") field(LLSV, "MAJOR") field(FLNK, "QUAD:LTUS:110:COEF2IVB") } record(sub, "QUAD:LTUS:110:COEF2IVB") { field(DESC, "Populate wf w/ poly coef") field(PINI, "YES") field(INAM, "mgntExplodeInit") field(SNAM, "mgntExplode") field(INPA, "QUAD:LTUS:110:POLYCOEF") field(INPB, "QUAD:LTUS:110:IVB") # Need to process IVB so that UDF=0 field(FLNK, "QUAD:LTUS:110:IVB") } # Note: this pv was requested by M. Woodley # so that he coudl get all the ivb poly coefficients # for a single magnet in one go. record(waveform, "QUAD:LTUS:110:IVB") { field(DESC, "Poly coef I vs B") field(DTYP, "Soft Channel") field(PREC, "8") field(NELM, "12") field(FTVL, "DOUBLE") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND # Comment out the bar code pv by setting the macor # LNK="#" for the kicker I vs V poly coef record(stringout, "QUAD:LTUS:120:BARCODE") { field(DESC, "SLAC Barcode on Magnet") field(PINI, "YES") field(VAL, "4130") } record(stringout, "QUAD:LTUS:120:ENGNAME") { field(DESC, "Magnet Engineering Name") field(PINI, "YES") field(VAL, "Unknown") } record(sub, "QUAD:LTUS:120:POLYCOEF") { field(DESC, "QUAD:LTUS:120 Poly Coefs") field(INAM, "mgntNumPolyCoef") field(SNAM, "mgntNumPolyCoef") field(PREC, "8") field(A, "3.389691E-01") field(B, "1.741856E+00") field(C, "5.479545E-05") field(D, "2.059042E-06") field(E, "-1.806835E-08") field(F, "7.337930E-10") field(G, "0") field(H, "0") field(I, "0.0") field(J, "0.0") field(K, "0.0") field(L, "0.0") field(PINI, "YES") field(FLNK, "QUAD:LTUS:120:POLYCOEFNUM") } record(longin, "QUAD:LTUS:120:POLYCOEFNUM") { field(DESC, "No. of Poly Coef.") field(INP , "QUAD:LTUS:120:POLYCOEF.VAL NPP NMS") field(LOLO, "0") field(LLSV, "MAJOR") field(FLNK, "QUAD:LTUS:120:COEF2IVB") } record(sub, "QUAD:LTUS:120:COEF2IVB") { field(DESC, "Populate wf w/ poly coef") field(PINI, "YES") field(INAM, "mgntExplodeInit") field(SNAM, "mgntExplode") field(INPA, "QUAD:LTUS:120:POLYCOEF") field(INPB, "QUAD:LTUS:120:IVB") # Need to process IVB so that UDF=0 field(FLNK, "QUAD:LTUS:120:IVB") } # Note: this pv was requested by M. Woodley # so that he coudl get all the ivb poly coefficients # for a single magnet in one go. record(waveform, "QUAD:LTUS:120:IVB") { field(DESC, "Poly coef I vs B") field(DTYP, "Soft Channel") field(PREC, "8") field(NELM, "12") field(FTVL, "DOUBLE") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND # Comment out the bar code pv by setting the macor # LNK="#" for the kicker I vs V poly coef record(stringout, "QUAD:LTUS:150:BARCODE") { field(DESC, "SLAC Barcode on Magnet") field(PINI, "YES") field(VAL, "4183") } record(stringout, "QUAD:LTUS:150:ENGNAME") { field(DESC, "Magnet Engineering Name") field(PINI, "YES") field(VAL, "Unknown") } record(sub, "QUAD:LTUS:150:POLYCOEF") { field(DESC, "QUAD:LTUS:150 Poly Coefs") field(INAM, "mgntNumPolyCoef") field(SNAM, "mgntNumPolyCoef") field(PREC, "8") field(A, "-8.309676E-01") field(B, "3.303490E+00") field(C, "-1.138941E-02") field(D, "3.685879E-04") field(E, "-5.412466E-06") field(F, "3.103263E-08") field(G, "0") field(H, "0") field(I, "0.0") field(J, "0.0") field(K, "0.0") field(L, "0.0") field(PINI, "YES") field(FLNK, "QUAD:LTUS:150:POLYCOEFNUM") } record(longin, "QUAD:LTUS:150:POLYCOEFNUM") { field(DESC, "No. of Poly Coef.") field(INP , "QUAD:LTUS:150:POLYCOEF.VAL NPP NMS") field(LOLO, "0") field(LLSV, "MAJOR") field(FLNK, "QUAD:LTUS:150:COEF2IVB") } record(sub, "QUAD:LTUS:150:COEF2IVB") { field(DESC, "Populate wf w/ poly coef") field(PINI, "YES") field(INAM, "mgntExplodeInit") field(SNAM, "mgntExplode") field(INPA, "QUAD:LTUS:150:POLYCOEF") field(INPB, "QUAD:LTUS:150:IVB") # Need to process IVB so that UDF=0 field(FLNK, "QUAD:LTUS:150:IVB") } # Note: this pv was requested by M. Woodley # so that he coudl get all the ivb poly coefficients # for a single magnet in one go. record(waveform, "QUAD:LTUS:150:IVB") { field(DESC, "Poly coef I vs B") field(DTYP, "Soft Channel") field(PREC, "8") field(NELM, "12") field(FTVL, "DOUBLE") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND # Comment out the bar code pv by setting the macor # LNK="#" for the kicker I vs V poly coef record(stringout, "QUAD:LTUS:180:BARCODE") { field(DESC, "SLAC Barcode on Magnet") field(PINI, "YES") field(VAL, "4187") } record(stringout, "QUAD:LTUS:180:ENGNAME") { field(DESC, "Magnet Engineering Name") field(PINI, "YES") field(VAL, "Unknown") } record(sub, "QUAD:LTUS:180:POLYCOEF") { field(DESC, "QUAD:LTUS:180 Poly Coefs") field(INAM, "mgntNumPolyCoef") field(SNAM, "mgntNumPolyCoef") field(PREC, "8") field(A, "-8.288047E-01") field(B, "-3.303165E+00") field(C, "-1.150527E-02") field(D, "-3.761377E-04") field(E, "-5.566078E-06") field(F, "-3.210417E-08") field(G, "0") field(H, "0") field(I, "0.0") field(J, "0.0") field(K, "0.0") field(L, "0.0") field(PINI, "YES") field(FLNK, "QUAD:LTUS:180:POLYCOEFNUM") } record(longin, "QUAD:LTUS:180:POLYCOEFNUM") { field(DESC, "No. of Poly Coef.") field(INP , "QUAD:LTUS:180:POLYCOEF.VAL NPP NMS") field(LOLO, "0") field(LLSV, "MAJOR") field(FLNK, "QUAD:LTUS:180:COEF2IVB") } record(sub, "QUAD:LTUS:180:COEF2IVB") { field(DESC, "Populate wf w/ poly coef") field(PINI, "YES") field(INAM, "mgntExplodeInit") field(SNAM, "mgntExplode") field(INPA, "QUAD:LTUS:180:POLYCOEF") field(INPB, "QUAD:LTUS:180:IVB") # Need to process IVB so that UDF=0 field(FLNK, "QUAD:LTUS:180:IVB") } # Note: this pv was requested by M. Woodley # so that he coudl get all the ivb poly coefficients # for a single magnet in one go. record(waveform, "QUAD:LTUS:180:IVB") { field(DESC, "Poly coef I vs B") field(DTYP, "Soft Channel") field(PREC, "8") field(NELM, "12") field(FTVL, "DOUBLE") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND # Comment out the bar code pv by setting the macor # LNK="#" for the kicker I vs V poly coef record(stringout, "QUAD:LTUS:235:BARCODE") { field(DESC, "SLAC Barcode on Magnet") field(PINI, "YES") field(VAL, "4185") } record(stringout, "QUAD:LTUS:235:ENGNAME") { field(DESC, "Magnet Engineering Name") field(PINI, "YES") field(VAL, "Unknown") } record(sub, "QUAD:LTUS:235:POLYCOEF") { field(DESC, "QUAD:LTUS:235 Poly Coefs") field(INAM, "mgntNumPolyCoef") field(SNAM, "mgntNumPolyCoef") field(PREC, "8") field(A, "-9.059225E-01") field(B, "3.342698E+00") field(C, "-1.258086E-02") field(D, "4.052787E-04") field(E, "-5.803959E-06") field(F, "3.208195E-08") field(G, "0") field(H, "0") field(I, "0.0") field(J, "0.0") field(K, "0.0") field(L, "0.0") field(PINI, "YES") field(FLNK, "QUAD:LTUS:235:POLYCOEFNUM") } record(longin, "QUAD:LTUS:235:POLYCOEFNUM") { field(DESC, "No. of Poly Coef.") field(INP , "QUAD:LTUS:235:POLYCOEF.VAL NPP NMS") field(LOLO, "0") field(LLSV, "MAJOR") field(FLNK, "QUAD:LTUS:235:COEF2IVB") } record(sub, "QUAD:LTUS:235:COEF2IVB") { field(DESC, "Populate wf w/ poly coef") field(PINI, "YES") field(INAM, "mgntExplodeInit") field(SNAM, "mgntExplode") field(INPA, "QUAD:LTUS:235:POLYCOEF") field(INPB, "QUAD:LTUS:235:IVB") # Need to process IVB so that UDF=0 field(FLNK, "QUAD:LTUS:235:IVB") } # Note: this pv was requested by M. Woodley # so that he coudl get all the ivb poly coefficients # for a single magnet in one go. record(waveform, "QUAD:LTUS:235:IVB") { field(DESC, "Poly coef I vs B") field(DTYP, "Soft Channel") field(PREC, "8") field(NELM, "12") field(FTVL, "DOUBLE") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND # Comment out the bar code pv by setting the macor # LNK="#" for the kicker I vs V poly coef record(stringout, "QUAD:LTUS:270:BARCODE") { field(DESC, "SLAC Barcode on Magnet") field(PINI, "YES") field(VAL, "4208") } record(stringout, "QUAD:LTUS:270:ENGNAME") { field(DESC, "Magnet Engineering Name") field(PINI, "YES") field(VAL, "Unknown") } record(sub, "QUAD:LTUS:270:POLYCOEF") { field(DESC, "QUAD:LTUS:270 Poly Coefs") field(INAM, "mgntNumPolyCoef") field(SNAM, "mgntNumPolyCoef") field(PREC, "8") field(A, "-8.050295E-01") field(B, "-3.298992E+00") field(C, "-1.064676E-02") field(D, "-3.357980E-04") field(E, "-4.748465E-06") field(F, "-2.601902E-08") field(G, "0") field(H, "0") field(I, "0.0") field(J, "0.0") field(K, "0.0") field(L, "0.0") field(PINI, "YES") field(FLNK, "QUAD:LTUS:270:POLYCOEFNUM") } record(longin, "QUAD:LTUS:270:POLYCOEFNUM") { field(DESC, "No. of Poly Coef.") field(INP , "QUAD:LTUS:270:POLYCOEF.VAL NPP NMS") field(LOLO, "0") field(LLSV, "MAJOR") field(FLNK, "QUAD:LTUS:270:COEF2IVB") } record(sub, "QUAD:LTUS:270:COEF2IVB") { field(DESC, "Populate wf w/ poly coef") field(PINI, "YES") field(INAM, "mgntExplodeInit") field(SNAM, "mgntExplode") field(INPA, "QUAD:LTUS:270:POLYCOEF") field(INPB, "QUAD:LTUS:270:IVB") # Need to process IVB so that UDF=0 field(FLNK, "QUAD:LTUS:270:IVB") } # Note: this pv was requested by M. Woodley # so that he coudl get all the ivb poly coefficients # for a single magnet in one go. record(waveform, "QUAD:LTUS:270:IVB") { field(DESC, "Poly coef I vs B") field(DTYP, "Soft Channel") field(PREC, "8") field(NELM, "12") field(FTVL, "DOUBLE") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND # Comment out the bar code pv by setting the macor # LNK="#" for the kicker I vs V poly coef record(stringout, "QUAD:LTUS:300:BARCODE") { field(DESC, "SLAC Barcode on Magnet") field(PINI, "YES") field(VAL, "4182") } record(stringout, "QUAD:LTUS:300:ENGNAME") { field(DESC, "Magnet Engineering Name") field(PINI, "YES") field(VAL, "Unknown") } record(sub, "QUAD:LTUS:300:POLYCOEF") { field(DESC, "QUAD:LTUS:300 Poly Coefs") field(INAM, "mgntNumPolyCoef") field(SNAM, "mgntNumPolyCoef") field(PREC, "8") field(A, "-9.132646E-01") field(B, "3.351558E+00") field(C, "-1.222532E-02") field(D, "4.077296E-04") field(E, "-6.153773E-06") field(F, "3.603770E-08") field(G, "0") field(H, "0") field(I, "0.0") field(J, "0.0") field(K, "0.0") field(L, "0.0") field(PINI, "YES") field(FLNK, "QUAD:LTUS:300:POLYCOEFNUM") } record(longin, "QUAD:LTUS:300:POLYCOEFNUM") { field(DESC, "No. of Poly Coef.") field(INP , "QUAD:LTUS:300:POLYCOEF.VAL NPP NMS") field(LOLO, "0") field(LLSV, "MAJOR") field(FLNK, "QUAD:LTUS:300:COEF2IVB") } record(sub, "QUAD:LTUS:300:COEF2IVB") { field(DESC, "Populate wf w/ poly coef") field(PINI, "YES") field(INAM, "mgntExplodeInit") field(SNAM, "mgntExplode") field(INPA, "QUAD:LTUS:300:POLYCOEF") field(INPB, "QUAD:LTUS:300:IVB") # Need to process IVB so that UDF=0 field(FLNK, "QUAD:LTUS:300:IVB") } # Note: this pv was requested by M. Woodley # so that he coudl get all the ivb poly coefficients # for a single magnet in one go. record(waveform, "QUAD:LTUS:300:IVB") { field(DESC, "Poly coef I vs B") field(DTYP, "Soft Channel") field(PREC, "8") field(NELM, "12") field(FTVL, "DOUBLE") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND # Comment out the bar code pv by setting the macor # LNK="#" for the kicker I vs V poly coef record(stringout, "QUAD:LTUS:345:BARCODE") { field(DESC, "SLAC Barcode on Magnet") field(PINI, "YES") field(VAL, "4181") } record(stringout, "QUAD:LTUS:345:ENGNAME") { field(DESC, "Magnet Engineering Name") field(PINI, "YES") field(VAL, "Unknown") } record(sub, "QUAD:LTUS:345:POLYCOEF") { field(DESC, "QUAD:LTUS:345 Poly Coefs") field(INAM, "mgntNumPolyCoef") field(SNAM, "mgntNumPolyCoef") field(PREC, "8") field(A, "-7.952017E-01") field(B, "-3.310610E+00") field(C, "-1.123964E-02") field(D, "-3.669940E-04") field(E, "-5.345367E-06") field(F, "-3.009527E-08") field(G, "0") field(H, "0") field(I, "0.0") field(J, "0.0") field(K, "0.0") field(L, "0.0") field(PINI, "YES") field(FLNK, "QUAD:LTUS:345:POLYCOEFNUM") } record(longin, "QUAD:LTUS:345:POLYCOEFNUM") { field(DESC, "No. of Poly Coef.") field(INP , "QUAD:LTUS:345:POLYCOEF.VAL NPP NMS") field(LOLO, "0") field(LLSV, "MAJOR") field(FLNK, "QUAD:LTUS:345:COEF2IVB") } record(sub, "QUAD:LTUS:345:COEF2IVB") { field(DESC, "Populate wf w/ poly coef") field(PINI, "YES") field(INAM, "mgntExplodeInit") field(SNAM, "mgntExplode") field(INPA, "QUAD:LTUS:345:POLYCOEF") field(INPB, "QUAD:LTUS:345:IVB") # Need to process IVB so that UDF=0 field(FLNK, "QUAD:LTUS:345:IVB") } # Note: this pv was requested by M. Woodley # so that he coudl get all the ivb poly coefficients # for a single magnet in one go. record(waveform, "QUAD:LTUS:345:IVB") { field(DESC, "Poly coef I vs B") field(DTYP, "Soft Channel") field(PREC, "8") field(NELM, "12") field(FTVL, "DOUBLE") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND # Comment out the bar code pv by setting the macor # LNK="#" for the kicker I vs V poly coef record(stringout, "QUAD:LTUS:370:BARCODE") { field(DESC, "SLAC Barcode on Magnet") field(PINI, "YES") field(VAL, "4184") } record(stringout, "QUAD:LTUS:370:ENGNAME") { field(DESC, "Magnet Engineering Name") field(PINI, "YES") field(VAL, "Unknown") } record(sub, "QUAD:LTUS:370:POLYCOEF") { field(DESC, "QUAD:LTUS:370 Poly Coefs") field(INAM, "mgntNumPolyCoef") field(SNAM, "mgntNumPolyCoef") field(PREC, "8") field(A, "-8.409317E-01") field(B, "3.334081E+00") field(C, "-1.191484E-02") field(D, "3.985380E-04") field(E, "-5.974093E-06") field(F, "3.465495E-08") field(G, "0") field(H, "0") field(I, "0.0") field(J, "0.0") field(K, "0.0") field(L, "0.0") field(PINI, "YES") field(FLNK, "QUAD:LTUS:370:POLYCOEFNUM") } record(longin, "QUAD:LTUS:370:POLYCOEFNUM") { field(DESC, "No. of Poly Coef.") field(INP , "QUAD:LTUS:370:POLYCOEF.VAL NPP NMS") field(LOLO, "0") field(LLSV, "MAJOR") field(FLNK, "QUAD:LTUS:370:COEF2IVB") } record(sub, "QUAD:LTUS:370:COEF2IVB") { field(DESC, "Populate wf w/ poly coef") field(PINI, "YES") field(INAM, "mgntExplodeInit") field(SNAM, "mgntExplode") field(INPA, "QUAD:LTUS:370:POLYCOEF") field(INPB, "QUAD:LTUS:370:IVB") # Need to process IVB so that UDF=0 field(FLNK, "QUAD:LTUS:370:IVB") } # Note: this pv was requested by M. Woodley # so that he coudl get all the ivb poly coefficients # for a single magnet in one go. record(waveform, "QUAD:LTUS:370:IVB") { field(DESC, "Poly coef I vs B") field(DTYP, "Soft Channel") field(PREC, "8") field(NELM, "12") field(FTVL, "DOUBLE") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND # Comment out the bar code pv by setting the macor # LNK="#" for the kicker I vs V poly coef record(stringout, "QUAD:LTUS:430:BARCODE") { field(DESC, "SLAC Barcode on Magnet") field(PINI, "YES") field(VAL, "4191") } record(stringout, "QUAD:LTUS:430:ENGNAME") { field(DESC, "Magnet Engineering Name") field(PINI, "YES") field(VAL, "Unknown") } record(sub, "QUAD:LTUS:430:POLYCOEF") { field(DESC, "QUAD:LTUS:430 Poly Coefs") field(INAM, "mgntNumPolyCoef") field(SNAM, "mgntNumPolyCoef") field(PREC, "8") field(A, "-9.777386E-01") field(B, "-3.359276E+00") field(C, "-1.312192E-02") field(D, "-4.199794E-04") field(E, "-5.938654E-06") field(F, "-3.214090E-08") field(G, "0") field(H, "0") field(I, "0.0") field(J, "0.0") field(K, "0.0") field(L, "0.0") field(PINI, "YES") field(FLNK, "QUAD:LTUS:430:POLYCOEFNUM") } record(longin, "QUAD:LTUS:430:POLYCOEFNUM") { field(DESC, "No. of Poly Coef.") field(INP , "QUAD:LTUS:430:POLYCOEF.VAL NPP NMS") field(LOLO, "0") field(LLSV, "MAJOR") field(FLNK, "QUAD:LTUS:430:COEF2IVB") } record(sub, "QUAD:LTUS:430:COEF2IVB") { field(DESC, "Populate wf w/ poly coef") field(PINI, "YES") field(INAM, "mgntExplodeInit") field(SNAM, "mgntExplode") field(INPA, "QUAD:LTUS:430:POLYCOEF") field(INPB, "QUAD:LTUS:430:IVB") # Need to process IVB so that UDF=0 field(FLNK, "QUAD:LTUS:430:IVB") } # Note: this pv was requested by M. Woodley # so that he coudl get all the ivb poly coefficients # for a single magnet in one go. record(waveform, "QUAD:LTUS:430:IVB") { field(DESC, "Poly coef I vs B") field(DTYP, "Soft Channel") field(PREC, "8") field(NELM, "12") field(FTVL, "DOUBLE") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND # Comment out the bar code pv by setting the macor # LNK="#" for the kicker I vs V poly coef record(stringout, "QUAD:LTUS:450:BARCODE") { field(DESC, "SLAC Barcode on Magnet") field(PINI, "YES") field(VAL, "4186") } record(stringout, "QUAD:LTUS:450:ENGNAME") { field(DESC, "Magnet Engineering Name") field(PINI, "YES") field(VAL, "Unknown") } record(sub, "QUAD:LTUS:450:POLYCOEF") { field(DESC, "QUAD:LTUS:450 Poly Coefs") field(INAM, "mgntNumPolyCoef") field(SNAM, "mgntNumPolyCoef") field(PREC, "8") field(A, "-8.493037E-01") field(B, "3.315557E+00") field(C, "-1.177410E-02") field(D, "3.870086E-04") field(E, "-5.742223E-06") field(F, "3.296684E-08") field(G, "0") field(H, "0") field(I, "0.0") field(J, "0.0") field(K, "0.0") field(L, "0.0") field(PINI, "YES") field(FLNK, "QUAD:LTUS:450:POLYCOEFNUM") } record(longin, "QUAD:LTUS:450:POLYCOEFNUM") { field(DESC, "No. of Poly Coef.") field(INP , "QUAD:LTUS:450:POLYCOEF.VAL NPP NMS") field(LOLO, "0") field(LLSV, "MAJOR") field(FLNK, "QUAD:LTUS:450:COEF2IVB") } record(sub, "QUAD:LTUS:450:COEF2IVB") { field(DESC, "Populate wf w/ poly coef") field(PINI, "YES") field(INAM, "mgntExplodeInit") field(SNAM, "mgntExplode") field(INPA, "QUAD:LTUS:450:POLYCOEF") field(INPB, "QUAD:LTUS:450:IVB") # Need to process IVB so that UDF=0 field(FLNK, "QUAD:LTUS:450:IVB") } # Note: this pv was requested by M. Woodley # so that he coudl get all the ivb poly coefficients # for a single magnet in one go. record(waveform, "QUAD:LTUS:450:IVB") { field(DESC, "Poly coef I vs B") field(DTYP, "Soft Channel") field(PREC, "8") field(NELM, "12") field(FTVL, "DOUBLE") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND # Comment out the bar code pv by setting the macor # LNK="#" for the kicker I vs V poly coef record(stringout, "QUAD:LTUS:470:BARCODE") { field(DESC, "SLAC Barcode on Magnet") field(PINI, "YES") field(VAL, "4115") } record(stringout, "QUAD:LTUS:470:ENGNAME") { field(DESC, "Magnet Engineering Name") field(PINI, "YES") field(VAL, "Unknown") } record(sub, "QUAD:LTUS:470:POLYCOEF") { field(DESC, "QUAD:LTUS:470 Poly Coefs") field(INAM, "mgntNumPolyCoef") field(SNAM, "mgntNumPolyCoef") field(PREC, "8") field(A, "-4.777025E-01") field(B, "-1.869766E+00") field(C, "-8.586230E-03") field(D, "-2.898664E-04") field(E, "-4.191221E-06") field(F, "-2.241675E-08") field(G, "0") field(H, "0") field(I, "0.0") field(J, "0.0") field(K, "0.0") field(L, "0.0") field(PINI, "YES") field(FLNK, "QUAD:LTUS:470:POLYCOEFNUM") } record(longin, "QUAD:LTUS:470:POLYCOEFNUM") { field(DESC, "No. of Poly Coef.") field(INP , "QUAD:LTUS:470:POLYCOEF.VAL NPP NMS") field(LOLO, "0") field(LLSV, "MAJOR") field(FLNK, "QUAD:LTUS:470:COEF2IVB") } record(sub, "QUAD:LTUS:470:COEF2IVB") { field(DESC, "Populate wf w/ poly coef") field(PINI, "YES") field(INAM, "mgntExplodeInit") field(SNAM, "mgntExplode") field(INPA, "QUAD:LTUS:470:POLYCOEF") field(INPB, "QUAD:LTUS:470:IVB") # Need to process IVB so that UDF=0 field(FLNK, "QUAD:LTUS:470:IVB") } # Note: this pv was requested by M. Woodley # so that he coudl get all the ivb poly coefficients # for a single magnet in one go. record(waveform, "QUAD:LTUS:470:IVB") { field(DESC, "Poly coef I vs B") field(DTYP, "Soft Channel") field(PREC, "8") field(NELM, "12") field(FTVL, "DOUBLE") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND # Comment out the bar code pv by setting the macor # LNK="#" for the kicker I vs V poly coef record(stringout, "QUAD:LTUS:500:BARCODE") { field(DESC, "SLAC Barcode on Magnet") field(PINI, "YES") field(VAL, "4119") } record(stringout, "QUAD:LTUS:500:ENGNAME") { field(DESC, "Magnet Engineering Name") field(PINI, "YES") field(VAL, "Unknown") } record(sub, "QUAD:LTUS:500:POLYCOEF") { field(DESC, "QUAD:LTUS:500 Poly Coefs") field(INAM, "mgntNumPolyCoef") field(SNAM, "mgntNumPolyCoef") field(PREC, "8") field(A, "-4.782697E-01") field(B, "-1.866561E+00") field(C, "-8.567711E-03") field(D, "-2.883264E-04") field(E, "-4.163223E-06") field(F, "-2.226127E-08") field(G, "0") field(H, "0") field(I, "0.0") field(J, "0.0") field(K, "0.0") field(L, "0.0") field(PINI, "YES") field(FLNK, "QUAD:LTUS:500:POLYCOEFNUM") } record(longin, "QUAD:LTUS:500:POLYCOEFNUM") { field(DESC, "No. of Poly Coef.") field(INP , "QUAD:LTUS:500:POLYCOEF.VAL NPP NMS") field(LOLO, "0") field(LLSV, "MAJOR") field(FLNK, "QUAD:LTUS:500:COEF2IVB") } record(sub, "QUAD:LTUS:500:COEF2IVB") { field(DESC, "Populate wf w/ poly coef") field(PINI, "YES") field(INAM, "mgntExplodeInit") field(SNAM, "mgntExplode") field(INPA, "QUAD:LTUS:500:POLYCOEF") field(INPB, "QUAD:LTUS:500:IVB") # Need to process IVB so that UDF=0 field(FLNK, "QUAD:LTUS:500:IVB") } # Note: this pv was requested by M. Woodley # so that he coudl get all the ivb poly coefficients # for a single magnet in one go. record(waveform, "QUAD:LTUS:500:IVB") { field(DESC, "Poly coef I vs B") field(DTYP, "Soft Channel") field(PREC, "8") field(NELM, "12") field(FTVL, "DOUBLE") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND # Comment out the bar code pv by setting the macor # LNK="#" for the kicker I vs V poly coef record(stringout, "QUAD:LTUS:510:BARCODE") { field(DESC, "SLAC Barcode on Magnet") field(PINI, "YES") field(VAL, "4132") } record(stringout, "QUAD:LTUS:510:ENGNAME") { field(DESC, "Magnet Engineering Name") field(PINI, "YES") field(VAL, "Unknown") } record(sub, "QUAD:LTUS:510:POLYCOEF") { field(DESC, "QUAD:LTUS:510 Poly Coefs") field(INAM, "mgntNumPolyCoef") field(SNAM, "mgntNumPolyCoef") field(PREC, "8") field(A, "-4.882141E-01") field(B, "1.864794E+00") field(C, "-8.524748E-03") field(D, "2.856148E-04") field(E, "-4.122501E-06") field(F, "2.206993E-08") field(G, "0") field(H, "0") field(I, "0.0") field(J, "0.0") field(K, "0.0") field(L, "0.0") field(PINI, "YES") field(FLNK, "QUAD:LTUS:510:POLYCOEFNUM") } record(longin, "QUAD:LTUS:510:POLYCOEFNUM") { field(DESC, "No. of Poly Coef.") field(INP , "QUAD:LTUS:510:POLYCOEF.VAL NPP NMS") field(LOLO, "0") field(LLSV, "MAJOR") field(FLNK, "QUAD:LTUS:510:COEF2IVB") } record(sub, "QUAD:LTUS:510:COEF2IVB") { field(DESC, "Populate wf w/ poly coef") field(PINI, "YES") field(INAM, "mgntExplodeInit") field(SNAM, "mgntExplode") field(INPA, "QUAD:LTUS:510:POLYCOEF") field(INPB, "QUAD:LTUS:510:IVB") # Need to process IVB so that UDF=0 field(FLNK, "QUAD:LTUS:510:IVB") } # Note: this pv was requested by M. Woodley # so that he coudl get all the ivb poly coefficients # for a single magnet in one go. record(waveform, "QUAD:LTUS:510:IVB") { field(DESC, "Poly coef I vs B") field(DTYP, "Soft Channel") field(PREC, "8") field(NELM, "12") field(FTVL, "DOUBLE") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND # Comment out the bar code pv by setting the macor # LNK="#" for the kicker I vs V poly coef record(stringout, "QUAD:LTUS:540:BARCODE") { field(DESC, "SLAC Barcode on Magnet") field(PINI, "YES") field(VAL, "4112") } record(stringout, "QUAD:LTUS:540:ENGNAME") { field(DESC, "Magnet Engineering Name") field(PINI, "YES") field(VAL, "Unknown") } record(sub, "QUAD:LTUS:540:POLYCOEF") { field(DESC, "QUAD:LTUS:540 Poly Coefs") field(INAM, "mgntNumPolyCoef") field(SNAM, "mgntNumPolyCoef") field(PREC, "8") field(A, "-4.595903E-01") field(B, "-1.851211E+00") field(C, "-8.361960E-03") field(D, "-2.810698E-04") field(E, "-4.012645E-06") field(F, "-2.120754E-08") field(G, "0") field(H, "0") field(I, "0.0") field(J, "0.0") field(K, "0.0") field(L, "0.0") field(PINI, "YES") field(FLNK, "QUAD:LTUS:540:POLYCOEFNUM") } record(longin, "QUAD:LTUS:540:POLYCOEFNUM") { field(DESC, "No. of Poly Coef.") field(INP , "QUAD:LTUS:540:POLYCOEF.VAL NPP NMS") field(LOLO, "0") field(LLSV, "MAJOR") field(FLNK, "QUAD:LTUS:540:COEF2IVB") } record(sub, "QUAD:LTUS:540:COEF2IVB") { field(DESC, "Populate wf w/ poly coef") field(PINI, "YES") field(INAM, "mgntExplodeInit") field(SNAM, "mgntExplode") field(INPA, "QUAD:LTUS:540:POLYCOEF") field(INPB, "QUAD:LTUS:540:IVB") # Need to process IVB so that UDF=0 field(FLNK, "QUAD:LTUS:540:IVB") } # Note: this pv was requested by M. Woodley # so that he coudl get all the ivb poly coefficients # for a single magnet in one go. record(waveform, "QUAD:LTUS:540:IVB") { field(DESC, "Poly coef I vs B") field(DTYP, "Soft Channel") field(PREC, "8") field(NELM, "12") field(FTVL, "DOUBLE") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND # Comment out the bar code pv by setting the macor # LNK="#" for the kicker I vs V poly coef record(stringout, "QUAD:LTUS:550:BARCODE") { field(DESC, "SLAC Barcode on Magnet") field(PINI, "YES") field(VAL, "4111") } record(stringout, "QUAD:LTUS:550:ENGNAME") { field(DESC, "Magnet Engineering Name") field(PINI, "YES") field(VAL, "Unknown") } record(sub, "QUAD:LTUS:550:POLYCOEF") { field(DESC, "QUAD:LTUS:550 Poly Coefs") field(INAM, "mgntNumPolyCoef") field(SNAM, "mgntNumPolyCoef") field(PREC, "8") field(A, "-4.731225E-01") field(B, "1.849044E+00") field(C, "-8.396095E-03") field(D, "2.821264E-04") field(E, "-4.046504E-06") field(F, "2.144131E-08") field(G, "0") field(H, "0") field(I, "0.0") field(J, "0.0") field(K, "0.0") field(L, "0.0") field(PINI, "YES") field(FLNK, "QUAD:LTUS:550:POLYCOEFNUM") } record(longin, "QUAD:LTUS:550:POLYCOEFNUM") { field(DESC, "No. of Poly Coef.") field(INP , "QUAD:LTUS:550:POLYCOEF.VAL NPP NMS") field(LOLO, "0") field(LLSV, "MAJOR") field(FLNK, "QUAD:LTUS:550:COEF2IVB") } record(sub, "QUAD:LTUS:550:COEF2IVB") { field(DESC, "Populate wf w/ poly coef") field(PINI, "YES") field(INAM, "mgntExplodeInit") field(SNAM, "mgntExplode") field(INPA, "QUAD:LTUS:550:POLYCOEF") field(INPB, "QUAD:LTUS:550:IVB") # Need to process IVB so that UDF=0 field(FLNK, "QUAD:LTUS:550:IVB") } # Note: this pv was requested by M. Woodley # so that he coudl get all the ivb poly coefficients # for a single magnet in one go. record(waveform, "QUAD:LTUS:550:IVB") { field(DESC, "Poly coef I vs B") field(DTYP, "Soft Channel") field(PREC, "8") field(NELM, "12") field(FTVL, "DOUBLE") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND # Comment out the bar code pv by setting the macor # LNK="#" for the kicker I vs V poly coef record(stringout, "QUAD:LTUS:560:BARCODE") { field(DESC, "SLAC Barcode on Magnet") field(PINI, "YES") field(VAL, "4113") } record(stringout, "QUAD:LTUS:560:ENGNAME") { field(DESC, "Magnet Engineering Name") field(PINI, "YES") field(VAL, "Unknown") } record(sub, "QUAD:LTUS:560:POLYCOEF") { field(DESC, "QUAD:LTUS:560 Poly Coefs") field(INAM, "mgntNumPolyCoef") field(SNAM, "mgntNumPolyCoef") field(PREC, "8") field(A, "-4.750687E-01") field(B, "-1.867862E+00") field(C, "-8.408554E-03") field(D, "-2.836056E-04") field(E, "-4.112537E-06") field(F, "-2.208087E-08") field(G, "0") field(H, "0") field(I, "0.0") field(J, "0.0") field(K, "0.0") field(L, "0.0") field(PINI, "YES") field(FLNK, "QUAD:LTUS:560:POLYCOEFNUM") } record(longin, "QUAD:LTUS:560:POLYCOEFNUM") { field(DESC, "No. of Poly Coef.") field(INP , "QUAD:LTUS:560:POLYCOEF.VAL NPP NMS") field(LOLO, "0") field(LLSV, "MAJOR") field(FLNK, "QUAD:LTUS:560:COEF2IVB") } record(sub, "QUAD:LTUS:560:COEF2IVB") { field(DESC, "Populate wf w/ poly coef") field(PINI, "YES") field(INAM, "mgntExplodeInit") field(SNAM, "mgntExplode") field(INPA, "QUAD:LTUS:560:POLYCOEF") field(INPB, "QUAD:LTUS:560:IVB") # Need to process IVB so that UDF=0 field(FLNK, "QUAD:LTUS:560:IVB") } # Note: this pv was requested by M. Woodley # so that he coudl get all the ivb poly coefficients # for a single magnet in one go. record(waveform, "QUAD:LTUS:560:IVB") { field(DESC, "Poly coef I vs B") field(DTYP, "Soft Channel") field(PREC, "8") field(NELM, "12") field(FTVL, "DOUBLE") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND # Comment out the bar code pv by setting the macor # LNK="#" for the kicker I vs V poly coef record(stringout, "QUAD:LTUS:570:BARCODE") { field(DESC, "SLAC Barcode on Magnet") field(PINI, "YES") field(VAL, "4059") } record(stringout, "QUAD:LTUS:570:ENGNAME") { field(DESC, "Magnet Engineering Name") field(PINI, "YES") field(VAL, "Unknown") } record(sub, "QUAD:LTUS:570:POLYCOEF") { field(DESC, "QUAD:LTUS:570 Poly Coefs") field(INAM, "mgntNumPolyCoef") field(SNAM, "mgntNumPolyCoef") field(PREC, "8") field(A, "1.181749E+00") field(B, "1.038589E+00") field(C, "-1.656737E-05") field(D, "5.518479E-07") field(E, "9.832695E-10") field(F, "7.731911E-11") field(G, "0") field(H, "0") field(I, "0.0") field(J, "0.0") field(K, "0.0") field(L, "0.0") field(PINI, "YES") field(FLNK, "QUAD:LTUS:570:POLYCOEFNUM") } record(longin, "QUAD:LTUS:570:POLYCOEFNUM") { field(DESC, "No. of Poly Coef.") field(INP , "QUAD:LTUS:570:POLYCOEF.VAL NPP NMS") field(LOLO, "0") field(LLSV, "MAJOR") field(FLNK, "QUAD:LTUS:570:COEF2IVB") } record(sub, "QUAD:LTUS:570:COEF2IVB") { field(DESC, "Populate wf w/ poly coef") field(PINI, "YES") field(INAM, "mgntExplodeInit") field(SNAM, "mgntExplode") field(INPA, "QUAD:LTUS:570:POLYCOEF") field(INPB, "QUAD:LTUS:570:IVB") # Need to process IVB so that UDF=0 field(FLNK, "QUAD:LTUS:570:IVB") } # Note: this pv was requested by M. Woodley # so that he coudl get all the ivb poly coefficients # for a single magnet in one go. record(waveform, "QUAD:LTUS:570:IVB") { field(DESC, "Poly coef I vs B") field(DTYP, "Soft Channel") field(PREC, "8") field(NELM, "12") field(FTVL, "DOUBLE") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND # Comment out the bar code pv by setting the macor # LNK="#" for the kicker I vs V poly coef record(stringout, "QUAD:LTUS:580:BARCODE") { field(DESC, "SLAC Barcode on Magnet") field(PINI, "YES") field(VAL, "4060") } record(stringout, "QUAD:LTUS:580:ENGNAME") { field(DESC, "Magnet Engineering Name") field(PINI, "YES") field(VAL, "Unknown") } record(sub, "QUAD:LTUS:580:POLYCOEF") { field(DESC, "QUAD:LTUS:580 Poly Coefs") field(INAM, "mgntNumPolyCoef") field(SNAM, "mgntNumPolyCoef") field(PREC, "8") field(A, "1.200267E+00") field(B, "1.038429E+00") field(C, "-2.037292E-05") field(D, "6.575916E-07") field(E, "1.231058E-09") field(F, "7.298263E-11") field(G, "0") field(H, "0") field(I, "0.0") field(J, "0.0") field(K, "0.0") field(L, "0.0") field(PINI, "YES") field(FLNK, "QUAD:LTUS:580:POLYCOEFNUM") } record(longin, "QUAD:LTUS:580:POLYCOEFNUM") { field(DESC, "No. of Poly Coef.") field(INP , "QUAD:LTUS:580:POLYCOEF.VAL NPP NMS") field(LOLO, "0") field(LLSV, "MAJOR") field(FLNK, "QUAD:LTUS:580:COEF2IVB") } record(sub, "QUAD:LTUS:580:COEF2IVB") { field(DESC, "Populate wf w/ poly coef") field(PINI, "YES") field(INAM, "mgntExplodeInit") field(SNAM, "mgntExplode") field(INPA, "QUAD:LTUS:580:POLYCOEF") field(INPB, "QUAD:LTUS:580:IVB") # Need to process IVB so that UDF=0 field(FLNK, "QUAD:LTUS:580:IVB") } # Note: this pv was requested by M. Woodley # so that he coudl get all the ivb poly coefficients # for a single magnet in one go. record(waveform, "QUAD:LTUS:580:IVB") { field(DESC, "Poly coef I vs B") field(DTYP, "Soft Channel") field(PREC, "8") field(NELM, "12") field(FTVL, "DOUBLE") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND # Comment out the bar code pv by setting the macor # LNK="#" for the kicker I vs V poly coef record(stringout, "QUAD:LTUS:620:BARCODE") { field(DESC, "SLAC Barcode on Magnet") field(PINI, "YES") field(VAL, "4116") } record(stringout, "QUAD:LTUS:620:ENGNAME") { field(DESC, "Magnet Engineering Name") field(PINI, "YES") field(VAL, "Unknown") } record(sub, "QUAD:LTUS:620:POLYCOEF") { field(DESC, "QUAD:LTUS:620 Poly Coefs") field(INAM, "mgntNumPolyCoef") field(SNAM, "mgntNumPolyCoef") field(PREC, "8") field(A, "4.117945E-01") field(B, "1.736899E+00") field(C, "2.041122E-05") field(D, "1.182926E-05") field(E, "5.816271E-09") field(F, "-3.360305E-09") field(G, "-7.870152E-13") field(H, "4.034652E-13") field(I, "0.0") field(J, "0.0") field(K, "0.0") field(L, "0.0") field(PINI, "YES") field(FLNK, "QUAD:LTUS:620:POLYCOEFNUM") } record(longin, "QUAD:LTUS:620:POLYCOEFNUM") { field(DESC, "No. of Poly Coef.") field(INP , "QUAD:LTUS:620:POLYCOEF.VAL NPP NMS") field(LOLO, "0") field(LLSV, "MAJOR") field(FLNK, "QUAD:LTUS:620:COEF2IVB") } record(sub, "QUAD:LTUS:620:COEF2IVB") { field(DESC, "Populate wf w/ poly coef") field(PINI, "YES") field(INAM, "mgntExplodeInit") field(SNAM, "mgntExplode") field(INPA, "QUAD:LTUS:620:POLYCOEF") field(INPB, "QUAD:LTUS:620:IVB") # Need to process IVB so that UDF=0 field(FLNK, "QUAD:LTUS:620:IVB") } # Note: this pv was requested by M. Woodley # so that he coudl get all the ivb poly coefficients # for a single magnet in one go. record(waveform, "QUAD:LTUS:620:IVB") { field(DESC, "Poly coef I vs B") field(DTYP, "Soft Channel") field(PREC, "8") field(NELM, "12") field(FTVL, "DOUBLE") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND # Comment out the bar code pv by setting the macor # LNK="#" for the kicker I vs V poly coef record(stringout, "QUAD:LTUS:640:BARCODE") { field(DESC, "SLAC Barcode on Magnet") field(PINI, "YES") field(VAL, "4117") } record(stringout, "QUAD:LTUS:640:ENGNAME") { field(DESC, "Magnet Engineering Name") field(PINI, "YES") field(VAL, "Unknown") } record(sub, "QUAD:LTUS:640:POLYCOEF") { field(DESC, "QUAD:LTUS:640 Poly Coefs") field(INAM, "mgntNumPolyCoef") field(SNAM, "mgntNumPolyCoef") field(PREC, "8") field(A, "3.982576E-01") field(B, "1.737145E+00") field(C, "2.080767E-05") field(D, "1.182343E-05") field(E, "5.672889E-09") field(F, "-3.377951E-09") field(G, "-7.287729E-13") field(H, "4.039708E-13") field(I, "0.0") field(J, "0.0") field(K, "0.0") field(L, "0.0") field(PINI, "YES") field(FLNK, "QUAD:LTUS:640:POLYCOEFNUM") } record(longin, "QUAD:LTUS:640:POLYCOEFNUM") { field(DESC, "No. of Poly Coef.") field(INP , "QUAD:LTUS:640:POLYCOEF.VAL NPP NMS") field(LOLO, "0") field(LLSV, "MAJOR") field(FLNK, "QUAD:LTUS:640:COEF2IVB") } record(sub, "QUAD:LTUS:640:COEF2IVB") { field(DESC, "Populate wf w/ poly coef") field(PINI, "YES") field(INAM, "mgntExplodeInit") field(SNAM, "mgntExplode") field(INPA, "QUAD:LTUS:640:POLYCOEF") field(INPB, "QUAD:LTUS:640:IVB") # Need to process IVB so that UDF=0 field(FLNK, "QUAD:LTUS:640:IVB") } # Note: this pv was requested by M. Woodley # so that he coudl get all the ivb poly coefficients # for a single magnet in one go. record(waveform, "QUAD:LTUS:640:IVB") { field(DESC, "Poly coef I vs B") field(DTYP, "Soft Channel") field(PREC, "8") field(NELM, "12") field(FTVL, "DOUBLE") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND # Comment out the bar code pv by setting the macor # LNK="#" for the kicker I vs V poly coef record(stringout, "QUAD:LTUS:660:BARCODE") { field(DESC, "SLAC Barcode on Magnet") field(PINI, "YES") field(VAL, "4127") } record(stringout, "QUAD:LTUS:660:ENGNAME") { field(DESC, "Magnet Engineering Name") field(PINI, "YES") field(VAL, "Unknown") } record(sub, "QUAD:LTUS:660:POLYCOEF") { field(DESC, "QUAD:LTUS:660 Poly Coefs") field(INAM, "mgntNumPolyCoef") field(SNAM, "mgntNumPolyCoef") field(PREC, "8") field(A, "3.507353E-01") field(B, "1.759510E+00") field(C, "4.887401E-05") field(D, "1.715484E-06") field(E, "-1.718592E-08") field(F, "6.937575E-10") field(G, "0") field(H, "0") field(I, "0.0") field(J, "0.0") field(K, "0.0") field(L, "0.0") field(PINI, "YES") field(FLNK, "QUAD:LTUS:660:POLYCOEFNUM") } record(longin, "QUAD:LTUS:660:POLYCOEFNUM") { field(DESC, "No. of Poly Coef.") field(INP , "QUAD:LTUS:660:POLYCOEF.VAL NPP NMS") field(LOLO, "0") field(LLSV, "MAJOR") field(FLNK, "QUAD:LTUS:660:COEF2IVB") } record(sub, "QUAD:LTUS:660:COEF2IVB") { field(DESC, "Populate wf w/ poly coef") field(PINI, "YES") field(INAM, "mgntExplodeInit") field(SNAM, "mgntExplode") field(INPA, "QUAD:LTUS:660:POLYCOEF") field(INPB, "QUAD:LTUS:660:IVB") # Need to process IVB so that UDF=0 field(FLNK, "QUAD:LTUS:660:IVB") } # Note: this pv was requested by M. Woodley # so that he coudl get all the ivb poly coefficients # for a single magnet in one go. record(waveform, "QUAD:LTUS:660:IVB") { field(DESC, "Poly coef I vs B") field(DTYP, "Soft Channel") field(PREC, "8") field(NELM, "12") field(FTVL, "DOUBLE") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND # Comment out the bar code pv by setting the macor # LNK="#" for the kicker I vs V poly coef record(stringout, "QUAD:LTUS:680:BARCODE") { field(DESC, "SLAC Barcode on Magnet") field(PINI, "YES") field(VAL, "4126") } record(stringout, "QUAD:LTUS:680:ENGNAME") { field(DESC, "Magnet Engineering Name") field(PINI, "YES") field(VAL, "Unknown") } record(sub, "QUAD:LTUS:680:POLYCOEF") { field(DESC, "QUAD:LTUS:680 Poly Coefs") field(INAM, "mgntNumPolyCoef") field(SNAM, "mgntNumPolyCoef") field(PREC, "8") field(A, "3.581261E-01") field(B, "1.754144E+00") field(C, "5.331068E-05") field(D, "1.682453E-06") field(E, "-1.705414E-08") field(F, "6.885203E-10") field(G, "0") field(H, "0") field(I, "0.0") field(J, "0.0") field(K, "0.0") field(L, "0.0") field(PINI, "YES") field(FLNK, "QUAD:LTUS:680:POLYCOEFNUM") } record(longin, "QUAD:LTUS:680:POLYCOEFNUM") { field(DESC, "No. of Poly Coef.") field(INP , "QUAD:LTUS:680:POLYCOEF.VAL NPP NMS") field(LOLO, "0") field(LLSV, "MAJOR") field(FLNK, "QUAD:LTUS:680:COEF2IVB") } record(sub, "QUAD:LTUS:680:COEF2IVB") { field(DESC, "Populate wf w/ poly coef") field(PINI, "YES") field(INAM, "mgntExplodeInit") field(SNAM, "mgntExplode") field(INPA, "QUAD:LTUS:680:POLYCOEF") field(INPB, "QUAD:LTUS:680:IVB") # Need to process IVB so that UDF=0 field(FLNK, "QUAD:LTUS:680:IVB") } # Note: this pv was requested by M. Woodley # so that he coudl get all the ivb poly coefficients # for a single magnet in one go. record(waveform, "QUAD:LTUS:680:IVB") { field(DESC, "Poly coef I vs B") field(DTYP, "Soft Channel") field(PREC, "8") field(NELM, "12") field(FTVL, "DOUBLE") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND # Comment out the bar code pv by setting the macor # LNK="#" for the kicker I vs V poly coef record(stringout, "QUAD:LTUS:725:BARCODE") { field(DESC, "SLAC Barcode on Magnet") field(PINI, "YES") field(VAL, "QFXL1") } record(stringout, "QUAD:LTUS:725:ENGNAME") { field(DESC, "Magnet Engineering Name") field(PINI, "YES") field(VAL, "Unknown") } record(sub, "QUAD:LTUS:725:POLYCOEF") { field(DESC, "QUAD:LTUS:725 Poly Coefs") field(INAM, "mgntNumPolyCoef") field(SNAM, "mgntNumPolyCoef") field(PREC, "8") field(A, "-3.804987E-01") field(B, "-1.825469E+00") field(C, "-5.086792E-03") field(D, "-1.621672E-04") field(E, "-2.284638E-06") field(F, "-1.274070E-08") field(G, "0") field(H, "0") field(I, "0.0") field(J, "0.0") field(K, "0.0") field(L, "0.0") field(PINI, "YES") field(FLNK, "QUAD:LTUS:725:POLYCOEFNUM") } record(longin, "QUAD:LTUS:725:POLYCOEFNUM") { field(DESC, "No. of Poly Coef.") field(INP , "QUAD:LTUS:725:POLYCOEF.VAL NPP NMS") field(LOLO, "0") field(LLSV, "MAJOR") field(FLNK, "QUAD:LTUS:725:COEF2IVB") } record(sub, "QUAD:LTUS:725:COEF2IVB") { field(DESC, "Populate wf w/ poly coef") field(PINI, "YES") field(INAM, "mgntExplodeInit") field(SNAM, "mgntExplode") field(INPA, "QUAD:LTUS:725:POLYCOEF") field(INPB, "QUAD:LTUS:725:IVB") # Need to process IVB so that UDF=0 field(FLNK, "QUAD:LTUS:725:IVB") } # Note: this pv was requested by M. Woodley # so that he coudl get all the ivb poly coefficients # for a single magnet in one go. record(waveform, "QUAD:LTUS:725:IVB") { field(DESC, "Poly coef I vs B") field(DTYP, "Soft Channel") field(PREC, "8") field(NELM, "12") field(FTVL, "DOUBLE") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND # Comment out the bar code pv by setting the macor # LNK="#" for the kicker I vs V poly coef record(stringout, "QUAD:LTUS:772:BARCODE") { field(DESC, "SLAC Barcode on Magnet") field(PINI, "YES") field(VAL, "QFXL2") } record(stringout, "QUAD:LTUS:772:ENGNAME") { field(DESC, "Magnet Engineering Name") field(PINI, "YES") field(VAL, "Unknown") } record(sub, "QUAD:LTUS:772:POLYCOEF") { field(DESC, "QUAD:LTUS:772 Poly Coefs") field(INAM, "mgntNumPolyCoef") field(SNAM, "mgntNumPolyCoef") field(PREC, "8") field(A, "-3.884358E-01") field(B, "-1.837423E+00") field(C, "-5.479441E-03") field(D, "-1.747152E-04") field(E, "-2.434366E-06") field(F, "-1.330323E-08") field(G, "0") field(H, "0") field(I, "0.0") field(J, "0.0") field(K, "0.0") field(L, "0.0") field(PINI, "YES") field(FLNK, "QUAD:LTUS:772:POLYCOEFNUM") } record(longin, "QUAD:LTUS:772:POLYCOEFNUM") { field(DESC, "No. of Poly Coef.") field(INP , "QUAD:LTUS:772:POLYCOEF.VAL NPP NMS") field(LOLO, "0") field(LLSV, "MAJOR") field(FLNK, "QUAD:LTUS:772:COEF2IVB") } record(sub, "QUAD:LTUS:772:COEF2IVB") { field(DESC, "Populate wf w/ poly coef") field(PINI, "YES") field(INAM, "mgntExplodeInit") field(SNAM, "mgntExplode") field(INPA, "QUAD:LTUS:772:POLYCOEF") field(INPB, "QUAD:LTUS:772:IVB") # Need to process IVB so that UDF=0 field(FLNK, "QUAD:LTUS:772:IVB") } # Note: this pv was requested by M. Woodley # so that he coudl get all the ivb poly coefficients # for a single magnet in one go. record(waveform, "QUAD:LTUS:772:IVB") { field(DESC, "Poly coef I vs B") field(DTYP, "Soft Channel") field(PREC, "8") field(NELM, "12") field(FTVL, "DOUBLE") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND # Comment out the bar code pv by setting the macor # LNK="#" for the kicker I vs V poly coef record(stringout, "QUAD:LTUS:820:BARCODE") { field(DESC, "SLAC Barcode on Magnet") field(PINI, "YES") field(VAL, "4129") } record(stringout, "QUAD:LTUS:820:ENGNAME") { field(DESC, "Magnet Engineering Name") field(PINI, "YES") field(VAL, "Unknown") } record(sub, "QUAD:LTUS:820:POLYCOEF") { field(DESC, "QUAD:LTUS:820 Poly Coefs") field(INAM, "mgntNumPolyCoef") field(SNAM, "mgntNumPolyCoef") field(PREC, "8") field(A, "3.268076E-01") field(B, "1.753977E+00") field(C, "3.184202E-05") field(D, "1.850620E-06") field(E, "-1.553787E-08") field(F, "6.553403E-10") field(G, "0") field(H, "0") field(I, "0.0") field(J, "0.0") field(K, "0.0") field(L, "0.0") field(PINI, "YES") field(FLNK, "QUAD:LTUS:820:POLYCOEFNUM") } record(longin, "QUAD:LTUS:820:POLYCOEFNUM") { field(DESC, "No. of Poly Coef.") field(INP , "QUAD:LTUS:820:POLYCOEF.VAL NPP NMS") field(LOLO, "0") field(LLSV, "MAJOR") field(FLNK, "QUAD:LTUS:820:COEF2IVB") } record(sub, "QUAD:LTUS:820:COEF2IVB") { field(DESC, "Populate wf w/ poly coef") field(PINI, "YES") field(INAM, "mgntExplodeInit") field(SNAM, "mgntExplode") field(INPA, "QUAD:LTUS:820:POLYCOEF") field(INPB, "QUAD:LTUS:820:IVB") # Need to process IVB so that UDF=0 field(FLNK, "QUAD:LTUS:820:IVB") } # Note: this pv was requested by M. Woodley # so that he coudl get all the ivb poly coefficients # for a single magnet in one go. record(waveform, "QUAD:LTUS:820:IVB") { field(DESC, "Poly coef I vs B") field(DTYP, "Soft Channel") field(PREC, "8") field(NELM, "12") field(FTVL, "DOUBLE") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND # Comment out the bar code pv by setting the macor # LNK="#" for the kicker I vs V poly coef record(stringout, "QUAD:LTUS:840:BARCODE") { field(DESC, "SLAC Barcode on Magnet") field(PINI, "YES") field(VAL, "4128") } record(stringout, "QUAD:LTUS:840:ENGNAME") { field(DESC, "Magnet Engineering Name") field(PINI, "YES") field(VAL, "Unknown") } record(sub, "QUAD:LTUS:840:POLYCOEF") { field(DESC, "QUAD:LTUS:840 Poly Coefs") field(INAM, "mgntNumPolyCoef") field(SNAM, "mgntNumPolyCoef") field(PREC, "8") field(A, "3.424134E-01") field(B, "1.753027E+00") field(C, "4.325701E-05") field(D, "1.293593E-06") field(E, "-1.638008E-08") field(F, "7.578318E-10") field(G, "0") field(H, "0") field(I, "0.0") field(J, "0.0") field(K, "0.0") field(L, "0.0") field(PINI, "YES") field(FLNK, "QUAD:LTUS:840:POLYCOEFNUM") } record(longin, "QUAD:LTUS:840:POLYCOEFNUM") { field(DESC, "No. of Poly Coef.") field(INP , "QUAD:LTUS:840:POLYCOEF.VAL NPP NMS") field(LOLO, "0") field(LLSV, "MAJOR") field(FLNK, "QUAD:LTUS:840:COEF2IVB") } record(sub, "QUAD:LTUS:840:COEF2IVB") { field(DESC, "Populate wf w/ poly coef") field(PINI, "YES") field(INAM, "mgntExplodeInit") field(SNAM, "mgntExplode") field(INPA, "QUAD:LTUS:840:POLYCOEF") field(INPB, "QUAD:LTUS:840:IVB") # Need to process IVB so that UDF=0 field(FLNK, "QUAD:LTUS:840:IVB") } # Note: this pv was requested by M. Woodley # so that he coudl get all the ivb poly coefficients # for a single magnet in one go. record(waveform, "QUAD:LTUS:840:IVB") { field(DESC, "Poly coef I vs B") field(DTYP, "Soft Channel") field(PREC, "8") field(NELM, "12") field(FTVL, "DOUBLE") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND # Comment out the bar code pv by setting the macor # LNK="#" for the kicker I vs V poly coef record(stringout, "QUAD:LTUS:860:BARCODE") { field(DESC, "SLAC Barcode on Magnet") field(PINI, "YES") field(VAL, "4123") } record(stringout, "QUAD:LTUS:860:ENGNAME") { field(DESC, "Magnet Engineering Name") field(PINI, "YES") field(VAL, "Unknown") } record(sub, "QUAD:LTUS:860:POLYCOEF") { field(DESC, "QUAD:LTUS:860 Poly Coefs") field(INAM, "mgntNumPolyCoef") field(SNAM, "mgntNumPolyCoef") field(PREC, "8") field(A, "3.387874E-01") field(B, "1.742436E+00") field(C, "5.173014E-05") field(D, "1.778187E-06") field(E, "-1.728850E-08") field(F, "7.041598E-10") field(G, "0") field(H, "0") field(I, "0.0") field(J, "0.0") field(K, "0.0") field(L, "0.0") field(PINI, "YES") field(FLNK, "QUAD:LTUS:860:POLYCOEFNUM") } record(longin, "QUAD:LTUS:860:POLYCOEFNUM") { field(DESC, "No. of Poly Coef.") field(INP , "QUAD:LTUS:860:POLYCOEF.VAL NPP NMS") field(LOLO, "0") field(LLSV, "MAJOR") field(FLNK, "QUAD:LTUS:860:COEF2IVB") } record(sub, "QUAD:LTUS:860:COEF2IVB") { field(DESC, "Populate wf w/ poly coef") field(PINI, "YES") field(INAM, "mgntExplodeInit") field(SNAM, "mgntExplode") field(INPA, "QUAD:LTUS:860:POLYCOEF") field(INPB, "QUAD:LTUS:860:IVB") # Need to process IVB so that UDF=0 field(FLNK, "QUAD:LTUS:860:IVB") } # Note: this pv was requested by M. Woodley # so that he coudl get all the ivb poly coefficients # for a single magnet in one go. record(waveform, "QUAD:LTUS:860:IVB") { field(DESC, "Poly coef I vs B") field(DTYP, "Soft Channel") field(PREC, "8") field(NELM, "12") field(FTVL, "DOUBLE") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND # Comment out the bar code pv by setting the macor # LNK="#" for the kicker I vs V poly coef record(stringout, "QUAD:LTUS:880:BARCODE") { field(DESC, "SLAC Barcode on Magnet") field(PINI, "YES") field(VAL, "4124") } record(stringout, "QUAD:LTUS:880:ENGNAME") { field(DESC, "Magnet Engineering Name") field(PINI, "YES") field(VAL, "Unknown") } record(sub, "QUAD:LTUS:880:POLYCOEF") { field(DESC, "QUAD:LTUS:880 Poly Coefs") field(INAM, "mgntNumPolyCoef") field(SNAM, "mgntNumPolyCoef") field(PREC, "8") field(A, "3.314476E-01") field(B, "1.758732E+00") field(C, "5.893159E-05") field(D, "1.828648E-06") field(E, "-1.835192E-08") field(F, "7.712221E-10") field(G, "0") field(H, "0") field(I, "0.0") field(J, "0.0") field(K, "0.0") field(L, "0.0") field(PINI, "YES") field(FLNK, "QUAD:LTUS:880:POLYCOEFNUM") } record(longin, "QUAD:LTUS:880:POLYCOEFNUM") { field(DESC, "No. of Poly Coef.") field(INP , "QUAD:LTUS:880:POLYCOEF.VAL NPP NMS") field(LOLO, "0") field(LLSV, "MAJOR") field(FLNK, "QUAD:LTUS:880:COEF2IVB") } record(sub, "QUAD:LTUS:880:COEF2IVB") { field(DESC, "Populate wf w/ poly coef") field(PINI, "YES") field(INAM, "mgntExplodeInit") field(SNAM, "mgntExplode") field(INPA, "QUAD:LTUS:880:POLYCOEF") field(INPB, "QUAD:LTUS:880:IVB") # Need to process IVB so that UDF=0 field(FLNK, "QUAD:LTUS:880:IVB") } # Note: this pv was requested by M. Woodley # so that he coudl get all the ivb poly coefficients # for a single magnet in one go. record(waveform, "QUAD:LTUS:880:IVB") { field(DESC, "Poly coef I vs B") field(DTYP, "Soft Channel") field(PREC, "8") field(NELM, "12") field(FTVL, "DOUBLE") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND # Comment out the bar code pv by setting the macor # LNK="#" for the kicker I vs V poly coef record(stringout, "QUAD:DMPS:300:BARCODE") { field(DESC, "SLAC Barcode on Magnet") field(PINI, "YES") field(VAL, "4218") } record(stringout, "QUAD:DMPS:300:ENGNAME") { field(DESC, "Magnet Engineering Name") field(PINI, "YES") field(VAL, "Unknown") } record(sub, "QUAD:DMPS:300:POLYCOEF") { field(DESC, "QUAD:DMPS:300 Poly Coefs") field(INAM, "mgntNumPolyCoef") field(SNAM, "mgntNumPolyCoef") field(PREC, "8") field(A, "-3.932256E-01") field(B, "3.310454E+00") field(C, "-7.842924E-03") field(D, "2.850097E-04") field(E, "-4.641089E-06") field(F, "2.903945E-08") field(G, "0") field(H, "0") field(I, "0.0") field(J, "0.0") field(K, "0.0") field(L, "0.0") field(PINI, "YES") field(FLNK, "QUAD:DMPS:300:POLYCOEFNUM") } record(longin, "QUAD:DMPS:300:POLYCOEFNUM") { field(DESC, "No. of Poly Coef.") field(INP , "QUAD:DMPS:300:POLYCOEF.VAL NPP NMS") field(LOLO, "0") field(LLSV, "MAJOR") field(FLNK, "QUAD:DMPS:300:COEF2IVB") } record(sub, "QUAD:DMPS:300:COEF2IVB") { field(DESC, "Populate wf w/ poly coef") field(PINI, "YES") field(INAM, "mgntExplodeInit") field(SNAM, "mgntExplode") field(INPA, "QUAD:DMPS:300:POLYCOEF") field(INPB, "QUAD:DMPS:300:IVB") # Need to process IVB so that UDF=0 field(FLNK, "QUAD:DMPS:300:IVB") } # Note: this pv was requested by M. Woodley # so that he coudl get all the ivb poly coefficients # for a single magnet in one go. record(waveform, "QUAD:DMPS:300:IVB") { field(DESC, "Poly coef I vs B") field(DTYP, "Soft Channel") field(PREC, "8") field(NELM, "12") field(FTVL, "DOUBLE") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND # Comment out the bar code pv by setting the macor # LNK="#" for the kicker I vs V poly coef record(stringout, "QUAD:DMPS:380:BARCODE") { field(DESC, "SLAC Barcode on Magnet") field(PINI, "YES") field(VAL, "4216") } record(stringout, "QUAD:DMPS:380:ENGNAME") { field(DESC, "Magnet Engineering Name") field(PINI, "YES") field(VAL, "Unknown") } record(sub, "QUAD:DMPS:380:POLYCOEF") { field(DESC, "QUAD:DMPS:380 Poly Coefs") field(INAM, "mgntNumPolyCoef") field(SNAM, "mgntNumPolyCoef") field(PREC, "8") field(A, "-3.913163E-01") field(B, "-3.232519E+00") field(C, "-5.462818E-03") field(D, "-1.815719E-04") field(E, "-2.666555E-06") field(F, "-1.541514E-08") field(G, "0") field(H, "0") field(I, "0.0") field(J, "0.0") field(K, "0.0") field(L, "0.0") field(PINI, "YES") field(FLNK, "QUAD:DMPS:380:POLYCOEFNUM") } record(longin, "QUAD:DMPS:380:POLYCOEFNUM") { field(DESC, "No. of Poly Coef.") field(INP , "QUAD:DMPS:380:POLYCOEF.VAL NPP NMS") field(LOLO, "0") field(LLSV, "MAJOR") field(FLNK, "QUAD:DMPS:380:COEF2IVB") } record(sub, "QUAD:DMPS:380:COEF2IVB") { field(DESC, "Populate wf w/ poly coef") field(PINI, "YES") field(INAM, "mgntExplodeInit") field(SNAM, "mgntExplode") field(INPA, "QUAD:DMPS:380:POLYCOEF") field(INPB, "QUAD:DMPS:380:IVB") # Need to process IVB so that UDF=0 field(FLNK, "QUAD:DMPS:380:IVB") } # Note: this pv was requested by M. Woodley # so that he coudl get all the ivb poly coefficients # for a single magnet in one go. record(waveform, "QUAD:DMPS:380:IVB") { field(DESC, "Poly coef I vs B") field(DTYP, "Soft Channel") field(PREC, "8") field(NELM, "12") field(FTVL, "DOUBLE") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND # Comment out the bar code pv by setting the macor # LNK="#" for the kicker I vs V poly coef record(stringout, "QUAD:DMPS:500:BARCODE") { field(DESC, "SLAC Barcode on Magnet") field(PINI, "YES") field(VAL, "4226") } record(stringout, "QUAD:DMPS:500:ENGNAME") { field(DESC, "Magnet Engineering Name") field(PINI, "YES") field(VAL, "Unknown") } record(sub, "QUAD:DMPS:500:POLYCOEF") { field(DESC, "QUAD:DMPS:500 Poly Coefs") field(INAM, "mgntNumPolyCoef") field(SNAM, "mgntNumPolyCoef") field(PREC, "8") field(A, "-3.238988E-01") field(B, "-3.959328E+00") field(C, "-6.364526E-03") field(D, "-2.620132E-04") field(E, "-5.259863E-06") field(F, "-4.274095E-08") field(G, "0") field(H, "0") field(I, "0.0") field(J, "0.0") field(K, "0.0") field(L, "0.0") field(PINI, "YES") field(FLNK, "QUAD:DMPS:500:POLYCOEFNUM") } record(longin, "QUAD:DMPS:500:POLYCOEFNUM") { field(DESC, "No. of Poly Coef.") field(INP , "QUAD:DMPS:500:POLYCOEF.VAL NPP NMS") field(LOLO, "0") field(LLSV, "MAJOR") field(FLNK, "QUAD:DMPS:500:COEF2IVB") } record(sub, "QUAD:DMPS:500:COEF2IVB") { field(DESC, "Populate wf w/ poly coef") field(PINI, "YES") field(INAM, "mgntExplodeInit") field(SNAM, "mgntExplode") field(INPA, "QUAD:DMPS:500:POLYCOEF") field(INPB, "QUAD:DMPS:500:IVB") # Need to process IVB so that UDF=0 field(FLNK, "QUAD:DMPS:500:IVB") } # Note: this pv was requested by M. Woodley # so that he coudl get all the ivb poly coefficients # for a single magnet in one go. record(waveform, "QUAD:DMPS:500:IVB") { field(DESC, "Poly coef I vs B") field(DTYP, "Soft Channel") field(PREC, "8") field(NELM, "12") field(FTVL, "DOUBLE") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND # Comment out the bar code pv by setting the macor # LNK="#" for the kicker I vs V poly coef record(stringout, "QUAD:DMPS:600:BARCODE") { field(DESC, "SLAC Barcode on Magnet") field(PINI, "YES") field(VAL, "4225") } record(stringout, "QUAD:DMPS:600:ENGNAME") { field(DESC, "Magnet Engineering Name") field(PINI, "YES") field(VAL, "Unknown") } record(sub, "QUAD:DMPS:600:POLYCOEF") { field(DESC, "QUAD:DMPS:600 Poly Coefs") field(INAM, "mgntNumPolyCoef") field(SNAM, "mgntNumPolyCoef") field(PREC, "8") field(A, "-3.461744E-01") field(B, "-3.959157E+00") field(C, "-6.093016E-03") field(D, "-2.409633E-04") field(E, "-4.718234E-06") field(F, "-3.814301E-08") field(G, "0") field(H, "0") field(I, "0.0") field(J, "0.0") field(K, "0.0") field(L, "0.0") field(PINI, "YES") field(FLNK, "QUAD:DMPS:600:POLYCOEFNUM") } record(longin, "QUAD:DMPS:600:POLYCOEFNUM") { field(DESC, "No. of Poly Coef.") field(INP , "QUAD:DMPS:600:POLYCOEF.VAL NPP NMS") field(LOLO, "0") field(LLSV, "MAJOR") field(FLNK, "QUAD:DMPS:600:COEF2IVB") } record(sub, "QUAD:DMPS:600:COEF2IVB") { field(DESC, "Populate wf w/ poly coef") field(PINI, "YES") field(INAM, "mgntExplodeInit") field(SNAM, "mgntExplode") field(INPA, "QUAD:DMPS:600:POLYCOEF") field(INPB, "QUAD:DMPS:600:IVB") # Need to process IVB so that UDF=0 field(FLNK, "QUAD:DMPS:600:IVB") } # Note: this pv was requested by M. Woodley # so that he coudl get all the ivb poly coefficients # for a single magnet in one go. record(waveform, "QUAD:DMPS:600:IVB") { field(DESC, "Poly coef I vs B") field(DTYP, "Soft Channel") field(PREC, "8") field(NELM, "12") field(FTVL, "DOUBLE") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND # Comment out the bar code pv by setting the macor # LNK="#" for the kicker I vs V poly coef record(stringout, "LGPS:LTUS:1:BARCODE") { field(DESC, "SLAC Barcode on Magnet") field(PINI, "YES") field(VAL, "000000") } record(stringout, "LGPS:LTUS:1:ENGNAME") { field(DESC, "Magnet Engineering Name") field(PINI, "YES") field(VAL, "Unknown") } record(sub, "LGPS:LTUS:1:POLYCOEF") { field(DESC, "LGPS:LTUS:1 Poly Coefs") field(INAM, "mgntNumPolyCoef") field(SNAM, "mgntNumPolyCoef") field(PREC, "8") field(A, "0") field(B, "1") field(C, "0") field(D, "0") field(E, "0") field(F, "0") field(G, "0") field(H, "0") field(I, "0.0") field(J, "0.0") field(K, "0.0") field(L, "0.0") field(PINI, "YES") field(FLNK, "LGPS:LTUS:1:POLYCOEFNUM") } record(longin, "LGPS:LTUS:1:POLYCOEFNUM") { field(DESC, "No. of Poly Coef.") field(INP , "LGPS:LTUS:1:POLYCOEF.VAL NPP NMS") field(LOLO, "0") field(LLSV, "MAJOR") field(FLNK, "LGPS:LTUS:1:COEF2IVB") } record(sub, "LGPS:LTUS:1:COEF2IVB") { field(DESC, "Populate wf w/ poly coef") field(PINI, "YES") field(INAM, "mgntExplodeInit") field(SNAM, "mgntExplode") field(INPA, "LGPS:LTUS:1:POLYCOEF") field(INPB, "LGPS:LTUS:1:IVB") # Need to process IVB so that UDF=0 field(FLNK, "LGPS:LTUS:1:IVB") } # Note: this pv was requested by M. Woodley # so that he coudl get all the ivb poly coefficients # for a single magnet in one go. record(waveform, "LGPS:LTUS:1:IVB") { field(DESC, "Poly coef I vs B") field(DTYP, "Soft Channel") field(PREC, "8") field(NELM, "12") field(FTVL, "DOUBLE") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND # Comment out the bar code pv by setting the macor # LNK="#" for the kicker I vs V poly coef record(stringout, "LGPS:LTUS:2:BARCODE") { field(DESC, "SLAC Barcode on Magnet") field(PINI, "YES") field(VAL, "000000") } record(stringout, "LGPS:LTUS:2:ENGNAME") { field(DESC, "Magnet Engineering Name") field(PINI, "YES") field(VAL, "Unknown") } record(sub, "LGPS:LTUS:2:POLYCOEF") { field(DESC, "LGPS:LTUS:2 Poly Coefs") field(INAM, "mgntNumPolyCoef") field(SNAM, "mgntNumPolyCoef") field(PREC, "8") field(A, "0") field(B, "1") field(C, "0") field(D, "0") field(E, "0") field(F, "0") field(G, "0") field(H, "0") field(I, "0.0") field(J, "0.0") field(K, "0.0") field(L, "0.0") field(PINI, "YES") field(FLNK, "LGPS:LTUS:2:POLYCOEFNUM") } record(longin, "LGPS:LTUS:2:POLYCOEFNUM") { field(DESC, "No. of Poly Coef.") field(INP , "LGPS:LTUS:2:POLYCOEF.VAL NPP NMS") field(LOLO, "0") field(LLSV, "MAJOR") field(FLNK, "LGPS:LTUS:2:COEF2IVB") } record(sub, "LGPS:LTUS:2:COEF2IVB") { field(DESC, "Populate wf w/ poly coef") field(PINI, "YES") field(INAM, "mgntExplodeInit") field(SNAM, "mgntExplode") field(INPA, "LGPS:LTUS:2:POLYCOEF") field(INPB, "LGPS:LTUS:2:IVB") # Need to process IVB so that UDF=0 field(FLNK, "LGPS:LTUS:2:IVB") } # Note: this pv was requested by M. Woodley # so that he coudl get all the ivb poly coefficients # for a single magnet in one go. record(waveform, "LGPS:LTUS:2:IVB") { field(DESC, "Poly coef I vs B") field(DTYP, "Soft Channel") field(PREC, "8") field(NELM, "12") field(FTVL, "DOUBLE") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND # Comment out the bar code pv by setting the macor # LNK="#" for the kicker I vs V poly coef record(stringout, "LGPS:LTUS:3:BARCODE") { field(DESC, "SLAC Barcode on Magnet") field(PINI, "YES") field(VAL, "000000") } record(stringout, "LGPS:LTUS:3:ENGNAME") { field(DESC, "Magnet Engineering Name") field(PINI, "YES") field(VAL, "Unknown") } record(sub, "LGPS:LTUS:3:POLYCOEF") { field(DESC, "LGPS:LTUS:3 Poly Coefs") field(INAM, "mgntNumPolyCoef") field(SNAM, "mgntNumPolyCoef") field(PREC, "8") field(A, "0") field(B, "1") field(C, "0") field(D, "0") field(E, "0") field(F, "0") field(G, "0") field(H, "0") field(I, "0.0") field(J, "0.0") field(K, "0.0") field(L, "0.0") field(PINI, "YES") field(FLNK, "LGPS:LTUS:3:POLYCOEFNUM") } record(longin, "LGPS:LTUS:3:POLYCOEFNUM") { field(DESC, "No. of Poly Coef.") field(INP , "LGPS:LTUS:3:POLYCOEF.VAL NPP NMS") field(LOLO, "0") field(LLSV, "MAJOR") field(FLNK, "LGPS:LTUS:3:COEF2IVB") } record(sub, "LGPS:LTUS:3:COEF2IVB") { field(DESC, "Populate wf w/ poly coef") field(PINI, "YES") field(INAM, "mgntExplodeInit") field(SNAM, "mgntExplode") field(INPA, "LGPS:LTUS:3:POLYCOEF") field(INPB, "LGPS:LTUS:3:IVB") # Need to process IVB so that UDF=0 field(FLNK, "LGPS:LTUS:3:IVB") } # Note: this pv was requested by M. Woodley # so that he coudl get all the ivb poly coefficients # for a single magnet in one go. record(waveform, "LGPS:LTUS:3:IVB") { field(DESC, "Poly coef I vs B") field(DTYP, "Soft Channel") field(PREC, "8") field(NELM, "12") field(FTVL, "DOUBLE") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND # Comment out the bar code pv by setting the macor # LNK="#" for the kicker I vs V poly coef record(stringout, "LGPS:LTUS:4:BARCODE") { field(DESC, "SLAC Barcode on Magnet") field(PINI, "YES") field(VAL, "000000") } record(stringout, "LGPS:LTUS:4:ENGNAME") { field(DESC, "Magnet Engineering Name") field(PINI, "YES") field(VAL, "Unknown") } record(sub, "LGPS:LTUS:4:POLYCOEF") { field(DESC, "LGPS:LTUS:4 Poly Coefs") field(INAM, "mgntNumPolyCoef") field(SNAM, "mgntNumPolyCoef") field(PREC, "8") field(A, "0") field(B, "1") field(C, "0") field(D, "0") field(E, "0") field(F, "0") field(G, "0") field(H, "0") field(I, "0.0") field(J, "0.0") field(K, "0.0") field(L, "0.0") field(PINI, "YES") field(FLNK, "LGPS:LTUS:4:POLYCOEFNUM") } record(longin, "LGPS:LTUS:4:POLYCOEFNUM") { field(DESC, "No. of Poly Coef.") field(INP , "LGPS:LTUS:4:POLYCOEF.VAL NPP NMS") field(LOLO, "0") field(LLSV, "MAJOR") field(FLNK, "LGPS:LTUS:4:COEF2IVB") } record(sub, "LGPS:LTUS:4:COEF2IVB") { field(DESC, "Populate wf w/ poly coef") field(PINI, "YES") field(INAM, "mgntExplodeInit") field(SNAM, "mgntExplode") field(INPA, "LGPS:LTUS:4:POLYCOEF") field(INPB, "LGPS:LTUS:4:IVB") # Need to process IVB so that UDF=0 field(FLNK, "LGPS:LTUS:4:IVB") } # Note: this pv was requested by M. Woodley # so that he coudl get all the ivb poly coefficients # for a single magnet in one go. record(waveform, "LGPS:LTUS:4:IVB") { field(DESC, "Poly coef I vs B") field(DTYP, "Soft Channel") field(PREC, "8") field(NELM, "12") field(FTVL, "DOUBLE") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND # Comment out the bar code pv by setting the macor # LNK="#" for the kicker I vs V poly coef record(stringout, "LGPS:LTUS:5:BARCODE") { field(DESC, "SLAC Barcode on Magnet") field(PINI, "YES") field(VAL, "000000") } record(stringout, "LGPS:LTUS:5:ENGNAME") { field(DESC, "Magnet Engineering Name") field(PINI, "YES") field(VAL, "Unknown") } record(sub, "LGPS:LTUS:5:POLYCOEF") { field(DESC, "LGPS:LTUS:5 Poly Coefs") field(INAM, "mgntNumPolyCoef") field(SNAM, "mgntNumPolyCoef") field(PREC, "8") field(A, "0") field(B, "1") field(C, "0") field(D, "0") field(E, "0") field(F, "0") field(G, "0") field(H, "0") field(I, "0.0") field(J, "0.0") field(K, "0.0") field(L, "0.0") field(PINI, "YES") field(FLNK, "LGPS:LTUS:5:POLYCOEFNUM") } record(longin, "LGPS:LTUS:5:POLYCOEFNUM") { field(DESC, "No. of Poly Coef.") field(INP , "LGPS:LTUS:5:POLYCOEF.VAL NPP NMS") field(LOLO, "0") field(LLSV, "MAJOR") field(FLNK, "LGPS:LTUS:5:COEF2IVB") } record(sub, "LGPS:LTUS:5:COEF2IVB") { field(DESC, "Populate wf w/ poly coef") field(PINI, "YES") field(INAM, "mgntExplodeInit") field(SNAM, "mgntExplode") field(INPA, "LGPS:LTUS:5:POLYCOEF") field(INPB, "LGPS:LTUS:5:IVB") # Need to process IVB so that UDF=0 field(FLNK, "LGPS:LTUS:5:IVB") } # Note: this pv was requested by M. Woodley # so that he coudl get all the ivb poly coefficients # for a single magnet in one go. record(waveform, "LGPS:LTUS:5:IVB") { field(DESC, "Poly coef I vs B") field(DTYP, "Soft Channel") field(PREC, "8") field(NELM, "12") field(FTVL, "DOUBLE") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND # Comment out the bar code pv by setting the macor # LNK="#" for the kicker I vs V poly coef record(stringout, "LGPS:LTUS:6:BARCODE") { field(DESC, "SLAC Barcode on Magnet") field(PINI, "YES") field(VAL, "000000") } record(stringout, "LGPS:LTUS:6:ENGNAME") { field(DESC, "Magnet Engineering Name") field(PINI, "YES") field(VAL, "Unknown") } record(sub, "LGPS:LTUS:6:POLYCOEF") { field(DESC, "LGPS:LTUS:6 Poly Coefs") field(INAM, "mgntNumPolyCoef") field(SNAM, "mgntNumPolyCoef") field(PREC, "8") field(A, "0") field(B, "1") field(C, "0") field(D, "0") field(E, "0") field(F, "0") field(G, "0") field(H, "0") field(I, "0.0") field(J, "0.0") field(K, "0.0") field(L, "0.0") field(PINI, "YES") field(FLNK, "LGPS:LTUS:6:POLYCOEFNUM") } record(longin, "LGPS:LTUS:6:POLYCOEFNUM") { field(DESC, "No. of Poly Coef.") field(INP , "LGPS:LTUS:6:POLYCOEF.VAL NPP NMS") field(LOLO, "0") field(LLSV, "MAJOR") field(FLNK, "LGPS:LTUS:6:COEF2IVB") } record(sub, "LGPS:LTUS:6:COEF2IVB") { field(DESC, "Populate wf w/ poly coef") field(PINI, "YES") field(INAM, "mgntExplodeInit") field(SNAM, "mgntExplode") field(INPA, "LGPS:LTUS:6:POLYCOEF") field(INPB, "LGPS:LTUS:6:IVB") # Need to process IVB so that UDF=0 field(FLNK, "LGPS:LTUS:6:IVB") } # Note: this pv was requested by M. Woodley # so that he coudl get all the ivb poly coefficients # for a single magnet in one go. record(waveform, "LGPS:LTUS:6:IVB") { field(DESC, "Poly coef I vs B") field(DTYP, "Soft Channel") field(PREC, "8") field(NELM, "12") field(FTVL, "DOUBLE") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND # Comment out the bar code pv by setting the macor # LNK="#" for the kicker I vs V poly coef record(stringout, "LGPS:LTUS:7:BARCODE") { field(DESC, "SLAC Barcode on Magnet") field(PINI, "YES") field(VAL, "000000") } record(stringout, "LGPS:LTUS:7:ENGNAME") { field(DESC, "Magnet Engineering Name") field(PINI, "YES") field(VAL, "Unknown") } record(sub, "LGPS:LTUS:7:POLYCOEF") { field(DESC, "LGPS:LTUS:7 Poly Coefs") field(INAM, "mgntNumPolyCoef") field(SNAM, "mgntNumPolyCoef") field(PREC, "8") field(A, "0") field(B, "1") field(C, "0") field(D, "0") field(E, "0") field(F, "0") field(G, "0") field(H, "0") field(I, "0.0") field(J, "0.0") field(K, "0.0") field(L, "0.0") field(PINI, "YES") field(FLNK, "LGPS:LTUS:7:POLYCOEFNUM") } record(longin, "LGPS:LTUS:7:POLYCOEFNUM") { field(DESC, "No. of Poly Coef.") field(INP , "LGPS:LTUS:7:POLYCOEF.VAL NPP NMS") field(LOLO, "0") field(LLSV, "MAJOR") field(FLNK, "LGPS:LTUS:7:COEF2IVB") } record(sub, "LGPS:LTUS:7:COEF2IVB") { field(DESC, "Populate wf w/ poly coef") field(PINI, "YES") field(INAM, "mgntExplodeInit") field(SNAM, "mgntExplode") field(INPA, "LGPS:LTUS:7:POLYCOEF") field(INPB, "LGPS:LTUS:7:IVB") # Need to process IVB so that UDF=0 field(FLNK, "LGPS:LTUS:7:IVB") } # Note: this pv was requested by M. Woodley # so that he coudl get all the ivb poly coefficients # for a single magnet in one go. record(waveform, "LGPS:LTUS:7:IVB") { field(DESC, "Poly coef I vs B") field(DTYP, "Soft Channel") field(PREC, "8") field(NELM, "12") field(FTVL, "DOUBLE") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND # Comment out the bar code pv by setting the macor # LNK="#" for the kicker I vs V poly coef record(stringout, "LGPS:UNDS:1:BARCODE") { field(DESC, "SLAC Barcode on Magnet") field(PINI, "YES") field(VAL, "000000") } record(stringout, "LGPS:UNDS:1:ENGNAME") { field(DESC, "Magnet Engineering Name") field(PINI, "YES") field(VAL, "Unknown") } record(sub, "LGPS:UNDS:1:POLYCOEF") { field(DESC, "LGPS:UNDS:1 Poly Coefs") field(INAM, "mgntNumPolyCoef") field(SNAM, "mgntNumPolyCoef") field(PREC, "8") field(A, "0") field(B, "1") field(C, "0") field(D, "0") field(E, "0") field(F, "0") field(G, "0") field(H, "0") field(I, "0.0") field(J, "0.0") field(K, "0.0") field(L, "0.0") field(PINI, "YES") field(FLNK, "LGPS:UNDS:1:POLYCOEFNUM") } record(longin, "LGPS:UNDS:1:POLYCOEFNUM") { field(DESC, "No. of Poly Coef.") field(INP , "LGPS:UNDS:1:POLYCOEF.VAL NPP NMS") field(LOLO, "0") field(LLSV, "MAJOR") field(FLNK, "LGPS:UNDS:1:COEF2IVB") } record(sub, "LGPS:UNDS:1:COEF2IVB") { field(DESC, "Populate wf w/ poly coef") field(PINI, "YES") field(INAM, "mgntExplodeInit") field(SNAM, "mgntExplode") field(INPA, "LGPS:UNDS:1:POLYCOEF") field(INPB, "LGPS:UNDS:1:IVB") # Need to process IVB so that UDF=0 field(FLNK, "LGPS:UNDS:1:IVB") } # Note: this pv was requested by M. Woodley # so that he coudl get all the ivb poly coefficients # for a single magnet in one go. record(waveform, "LGPS:UNDS:1:IVB") { field(DESC, "Poly coef I vs B") field(DTYP, "Soft Channel") field(PREC, "8") field(NELM, "12") field(FTVL, "DOUBLE") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND # Comment out the bar code pv by setting the macor # LNK="#" for the kicker I vs V poly coef record(stringout, "LGPS:UNDS:2:BARCODE") { field(DESC, "SLAC Barcode on Magnet") field(PINI, "YES") field(VAL, "000000") } record(stringout, "LGPS:UNDS:2:ENGNAME") { field(DESC, "Magnet Engineering Name") field(PINI, "YES") field(VAL, "Unknown") } record(sub, "LGPS:UNDS:2:POLYCOEF") { field(DESC, "LGPS:UNDS:2 Poly Coefs") field(INAM, "mgntNumPolyCoef") field(SNAM, "mgntNumPolyCoef") field(PREC, "8") field(A, "0") field(B, "1") field(C, "0") field(D, "0") field(E, "0") field(F, "0") field(G, "0") field(H, "0") field(I, "0.0") field(J, "0.0") field(K, "0.0") field(L, "0.0") field(PINI, "YES") field(FLNK, "LGPS:UNDS:2:POLYCOEFNUM") } record(longin, "LGPS:UNDS:2:POLYCOEFNUM") { field(DESC, "No. of Poly Coef.") field(INP , "LGPS:UNDS:2:POLYCOEF.VAL NPP NMS") field(LOLO, "0") field(LLSV, "MAJOR") field(FLNK, "LGPS:UNDS:2:COEF2IVB") } record(sub, "LGPS:UNDS:2:COEF2IVB") { field(DESC, "Populate wf w/ poly coef") field(PINI, "YES") field(INAM, "mgntExplodeInit") field(SNAM, "mgntExplode") field(INPA, "LGPS:UNDS:2:POLYCOEF") field(INPB, "LGPS:UNDS:2:IVB") # Need to process IVB so that UDF=0 field(FLNK, "LGPS:UNDS:2:IVB") } # Note: this pv was requested by M. Woodley # so that he coudl get all the ivb poly coefficients # for a single magnet in one go. record(waveform, "LGPS:UNDS:2:IVB") { field(DESC, "Poly coef I vs B") field(DTYP, "Soft Channel") field(PREC, "8") field(NELM, "12") field(FTVL, "DOUBLE") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND # This record is use for a standard unipolar power # supply without a polarity switch. This is the default # setting for the EPSC (no polarity switch). record(bo, "PSC:LTUS:MG01:STATESETPT") { field(DESC, "PS On/Off") field(DTYP, "EtherPSC") field(OUT, "#L0 N0 P0 S1 @172.27.141.134") field(ZNAM, "OFF") field(ONAM, "ON") field(DOL, "QUAD:LTUS:110:STATESETPT") field(OMSL, "supervisory") info(autosaveFields,"VAL RVAL") } record(bo, "PSC:LTUS:MG01:RESET") { field(DESC, "Interlock Reset") field(DTYP, "EtherPSC") field(OUT, "#L0 N0 P0 S2 @172.27.141.134") field(ZNAM, "RESET") field(ONAM, "NORESET") field(DOL, "QUAD:LTUS:110:RESET.RVAL") field(OMSL, "supervisory") } record(ao, "PSC:LTUS:MG01:IRAMPRATE") { field(DESC, "Ramp rate dI/dt") field(DTYP, "EtherPSC") field(OUT, "#L0 N0 P0 S4 @172.27.141.134") field(DRVH, "100.0") field(DRVL, "0.5") field(EGU, "A/sec") field(HOPR, "100.0") field(LOPR, "0.1") field(VAL, "10.0") field(PREC, "1") field(DOL, "QUAD:LTUS:110:IRAMPRATE") field(OMSL, "closed_loop") info(autosaveFields,"VAL") } record(bi, "PSC:LTUS:MG01:RAMPSTATE") { field(DESC, "Ramping Status") field(DTYP, "EtherPSC") field(INP, "#L0 N0 P0 S9 @172.27.141.134") field(ZNAM, "OFF") field(ONAM, "BUSY") field(ZSV, "NO_ALARM") field(OSV, "MINOR") field(FLNK, "QUAD:LTUS:110:RAMPSTATE") } record(bi, "PSC:LTUS:MG01:STATE") { field(DESC, "PS On/Off Status") field(DTYP, "EtherPSC") field(INP, "#L0 N0 P0 S10 @172.27.141.134") field(ZNAM, "OFF") field(ONAM, "ON") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(FLNK, "QUAD:LTUS:110:STATE") } record(bi, "PSC:LTUS:MG01:READY") { field(DESC, "PS Ready Fault") field(DTYP, "EtherPSC") field(INP, "#L0 N0 P0 S11 @172.27.141.134") field(ZNAM, "NOTREADY") field(ONAM, "READY") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") } record(bi, "PSC:LTUS:MG01:MAGNET0STATUS") { field(DESC, "Therm 1 Switch Status") field(DTYP, "EtherPSC") field(INP, "#L0 N0 P0 S12 @172.27.141.134") field(ZNAM, "FAULT") field(ONAM, "OK") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") } record(bi, "PSC:LTUS:MG01:MAGNET1STATUS") { field(DESC, "Magnet Interlock 1 Status") field(DTYP, "EtherPSC") field(INP, "#L0 N0 P0 S13 @172.27.141.134") field(ZNAM, "FAULT") field(ONAM, "OK") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") } record(bi, "PSC:LTUS:MG01:MAGNET2STATUS") { field(DESC, "Magnet Interlock 2 Status") field(DTYP, "EtherPSC") field(INP, "#L0 N0 P0 S14 @172.27.141.134") field(ZNAM, "FAULT") field(ONAM, "OK") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") } # Water Flow Switch. record(bi, "PSC:LTUS:MG01:MAGNET3STATUS") { field(DESC, "Magnet Interlock 3 Status") field(DTYP, "EtherPSC") field(INP, "#L0 N0 P0 S15 @172.27.141.134") field(ZNAM, "FAULT") field(ONAM, "OK") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(FLNK, "PSC:LTUS:MG01:MAGNET1STATUS") } record(bi, "PSC:LTUS:MG01:IACTSTATUS") { field(DESC, "Regulated Xductor Status") field(DTYP, "EtherPSC") field(INP, "#L0 N0 P0 S16 @172.27.141.134") field(ZNAM, "FAULT") field(ONAM, "OK") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") } record(bi, "PSC:LTUS:MG01:IGNDSTATUS") { field(DESC, "Ground Current Fault") field(DTYP, "EtherPSC") field(INP, "#L0 N0 P0 S17 @172.27.141.134") field(ZNAM, "FAULT") field(ONAM, "OK") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") } record(bi, "PSC:LTUS:MG01:FAULTSTATUS") { field(DESC, "Fault Latch") field(DTYP, "EtherPSC") field(INP, "#L0 N0 P0 S18 @172.27.141.134") field(ZNAM, "NO") field(ONAM, "YES") field(ZSV, "MINOR") field(OSV, "NO_ALARM") } record(bi, "PSC:LTUS:MG01:PSSTATE") { field(DESC, "PS on Readback") field(DTYP, "EtherPSC") field(INP, "#L0 N0 P0 S19 @172.27.141.134") field(ZNAM, "OFF") field(ONAM, "ON") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") } # For B136 (50B1) the polarity switch (limit switch) # Overload: mgnt_epsc_rev.template # PSSTATUS_0 = Normal polarity, where 0=NOT_NORMAL, 1=NORMAL # PSSTATUS_1 = Revese polarity, where 0=NOT_REVERSE, 1=REVERSE # record(bi, "PSC:LTUS:MG01:PS0STATUS") { field(DESC, "PS Status 0") field(DTYP, "EtherPSC") field(INP, "#L0 N0 P0 S20 @172.27.141.134") field(ZNAM, "FAULT") field(ONAM, "OK") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") } record(bi, "PSC:LTUS:MG01:PS1STATUS") { field(DESC, "PS Status 1") field(DTYP, "EtherPSC") field(INP, "#L0 N0 P0 S21 @172.27.141.134") field(ZNAM, "FAULT") field(ONAM, "OK") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") } record(bi, "PSC:LTUS:MG01:PS2STATUS") { field(DESC, "PS Status 2") field(DTYP, "EtherPSC") field(INP, "#L0 N0 P0 S22 @172.27.141.134") field(ZNAM, "FAULT") field(ONAM, "OK") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") } record(bi, "PSC:LTUS:MG01:PS3STATUS") { field(DESC, "PS Status 3") field(DTYP, "EtherPSC") field(INP, "#L0 N0 P0 S23 @172.27.141.134") field(ZNAM, "FAULT") field(ONAM, "OK") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") } record(bi, "PSC:LTUS:MG01:IMONSTATUS") { field(DESC, "Aux Xductor Interlock Status") field(DTYP, "EtherPSC") field(INP, "#L0 N0 P0 S24 @172.27.141.134") field(ZNAM, "FAULT") field(ONAM, "OK") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") } record(bi, "PSC:LTUS:MG01:MODE") { field(DESC, "Local Mode") field(DTYP, "EtherPSC") field(INP, "#L0 N0 P0 S25 @172.27.141.134") field(ZNAM, "LOCAL") field(ONAM, "REMOTE") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") } record(calc, "PSC:LTUS:MG01:CALBITOL") { field(DESC, "Calbration tolerance") field(EGU, "A") field(CALC, "(A-B)*C") field(A, "120.0") field(B, "-120.0") field(C, "0.01") field(PREC, "6") field(PINI, "YES") } record(bi, "PSC:LTUS:MG01:CALBOK_R") { field(DESC, "Calibration Status") field(DTYP, "EtherPSC") field(INP, "#L0 N0 P0 S26 @172.27.141.134") field(ZNAM, "FAULT") field(ONAM, "OK") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(FLNK,"PSC:LTUS:MG01:CALBCALC") } # Due to digital regulation of some ps # the calibration will have an error # if the current is below 1% of the # full range. So here ignore the # calbiration error if the ps is off # or if the current is below 1% of the # full range. record(calcout, "PSC:LTUS:MG01:CALBCALC") { field(DESC, "Calibration Status") field(CALC, "ABS(B)0)||(C>0)?1:0") field(INPA, "PS:LTUS:1:FaultStatus CPP NMS") field(INPB, "PS:LTUS:1:FaultStatus.SEVR NPP NMS") field(INPC, "PS:LTUS:1:FaultEvent CPP NMS") field(INPD, "PS:LTUS:1:FaultEvent.SEVR NPP NMS") field(OOPT, "Every Time") field(FLNK, "PS:LTUS:1:LatchedFaultState") } record(bi, "PS:LTUS:1:LatchedFaultState") { field(DESC, "Fault Latch Status") field(INP, "PS:LTUS:1:LatchedFaultStateCalc NPP NMS") field(ONAM, "FAULT") field(ZNAM, "OK") field(OSV, "MAJOR") field(ZSV, "NO_ALARM") field(FLNK, "LGPS:LTUS:1:INTLKSUMY PP MS") } # Status Conditional Register is set by the user to Enable # SRQs for changes in power supply status. record(longout, "PS:LTUS:1:StatusEnable") { field(DESC, "Enable Status Events") field(DTYP, "stream") field(OUT, "@mgnt_genesys.proto PSU-setsena(06) LGPS_LTUS_1") field(DOL, "191") field(OMSL, "closed_loop") } # The status event register will set a bit if a change in teh power supply occurs # and it is enabled. The register is clered when teh SEVE? or CLS commands are received. # A change in this register will generate SRQ # # Reading the status event register, clears bits of the status event register record(mbbiDirect, "PS:LTUS:1:StatusEvent") { field(DESC, "Status Event Register") field(DTYP, "stream") field(INP, "@mgnt_genesys.proto PSU-getseve(06) LGPS_LTUS_1") field(FLNK, "PS:LTUS:1:StatusEventSeq") } record(seq, "PS:LTUS:1:StatusEventSeq") { # Process the status event registers that show a fault. # Do nothing if the status byte register is 0. field(DESC, "Process Non-Zero Events") field(ASG, "Internal") field(SELM, "Mask") field(SELL, "PS:LTUS:1:StatusEvent") field(LNK3, "PS:LTUS:1:FaultEvent.PROC PP") field(LNK4, "PS:LTUS:1:FaultEvent.PROC PP") } record(mbbiDirect, "PS:LTUS:1:OperStatus") { field(DESC, "Status Conditional Register") field(DTYP, "stream") field(INP, "@mgnt_genesys.proto PSU-getstat(06) LGPS_LTUS_1") field(PINI, "YES") field(FLNK, "PS:LTUS:1:VoltMode") } record(bi, "PS:LTUS:1:VoltMode") { field(DESC, "Voltage Mode") field(INP, "PS:LTUS:1:OperStatus.B0 MS") field(ZNAM, "Not Constant") field(ONAM, "Constant") field(FLNK, "PS:LTUS:1:CurrMode") } record(bi, "PS:LTUS:1:CurrMode") { field(DESC, "Current Mode") field(INP, "PS:LTUS:1:OperStatus.B1 MS") field(ZNAM, "Not Constant") field(ONAM, "Constant") field(FLNK, "PS:LTUS:1:NoFaultState") } record(bi, "PS:LTUS:1:NoFaultState") { field(DESC, "No Fault Status") field(INP, "PS:LTUS:1:OperStatus.B2 MS") field(ZNAM, "FAULT") field(ONAM, "OK") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(FLNK, "PS:LTUS:1:ActiveFaultState") } record(bi, "PS:LTUS:1:ActiveFaultState") { field(DESC, "Active Fault Status") field(INP, "PS:LTUS:1:OperStatus.B3 MS") field(ZNAM, "OK") field(ONAM, "FAULT") field(ZSV, "NO_ALARM") field(OSV, "NO_ALARM") field(FLNK, "PS:LTUS:1:AutoStartMode") } # In this mode, the power supply restores its last # operation setting. Upon startup (AC Input power recycle), # the output is enabled or disabled according to its last settings record(bi, "PS:LTUS:1:AutoStartMode") { field(DESC, "Auto Start Mode") field(INP, "PS:LTUS:1:OperStatus.B4 MS") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(FLNK, "PS:LTUS:1:FoldBackMode") } # FoldBack protection will shut down the power supply output # if the load current exceeds the Output current limit # setting level. This protection is useful when the load # circuitry is sensitive to an overcurrent condition # # 4/27/2022: K.Luchini - swp ZSV and OSV, so ZSV is not alarmed # becase we want fold back mode to be disabled. record(bi, "PS:LTUS:1:FoldBackMode") { field(DESC, "Fold Back Protection") field(INP, "PS:LTUS:1:OperStatus.B5 MS") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(FLNK, "PS:LTUS:1:Mode") } record(bi, "PS:LTUS:1:Mode") { field(DESC, "Local Mode") field(INP, "PS:LTUS:1:OperStatus.B7 MS") field(ZNAM, "REMOTE") field(ONAM, "LOCAL") field(ZSV, "NO_ALARM") field(OSV, "MINOR") } record(bo, "PS:LTUS:1:FoldBackEnable") { field(DESC, "Fold Back Protection") field(DTYP, "stream") field(OUT, "@mgnt_genesys.proto PSU-setfld(06) LGPS_LTUS_1") field(ZNAM, "OFF") field(ONAM, "ON") } # This command is followed by the address (default=6),and is used # to access the power supply. record(longout, "PS:LTUS:1:Addr") { field(DESC, "Power Supply Address") field(DTYP, "stream") field(OUT, "@mgnt_genesys.proto PSU-comsetadr(06) LGPS_LTUS_1") field(DOL, "06") field(OMSL, "closed_loop") } record(mbbo, "PS:LTUS:1:MsgRespCode") { field(DESC, "Message Resonse Code") field(DTYP, "Raw Soft Channel") field(NOBT, "4") field(ZRST, "OK") field(ONST, "C01") field(TWST, "C02") field(THST, "C03") field(FRST, "C04") field(FVST, "C05") field(SXST, "E01") field(SVST, "E04") field(EIST, "E06") field(NIST, "E07") 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(EIVL, "8") field(NIVL, "9") field(UNSV, "INVALID") field(FLNK, "PS:LTUS:1:MsgResp") } record(mbbi, "PS:LTUS:1:MsgResp") { field(DESC, "Message Response") field(INP, "PS:LTUS:1:MsgRespCode.RVAL NPP MS") field(NOBT, "4") field(ZRST, "OK") field(ONST, "Illegal Command Query") field(TWST, "Missing Parameter") field(THST, "Illegal Parameter") field(FRST, "Checksum Error") field(FVST, "Setting out of range") field(SXST, "Prog Volt Exceeded") field(SVST, "Out Volt below UVL") field(EIST, "UVL above Out Volt") field(NIST, "ON request while Fault") field(ZRST, "NO_ALARM") field(ONST, "MAJOR") field(TWST, "MAJOR") field(THST, "MAJOR") field(FRST, "MAJOR") field(FVST, "MAJOR") field(SXST, "MAJOR") field(SVST, "MAJOR") field(EIST, "MAJOR") field(NIST, "MAJOR") field(UNSV, "INVALID") field(PINI, "YES") } record(stringout, "PS:LTUS:1:GetAnything") { field(DESC, "Get Anything") field(DTYP, "stream") field(OUT, "@mgnt_genesys.proto debug(06) LGPS_LTUS_1") } record(stringout, "PS:LTUS:1:SetAnything") { field(DESC, "Set anything") field(DTYP, "stream") field(OUT, "@mgnt_genesys.proto PSU-set(06) LGPS_LTUS_1") } record(mbbo, "PS:LTUS:1: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, "YES") field(VAL, "3") field(OUT, "LGPS:LTUS:1:COOLING PP") } record(bo, "PS:LTUS:1:RampState") { field(DESC, "PS Ramp Status") field(ZNAM, "OFF") field(ONAM, "BUSY") field(PINI, "YES") field(OUT, "LGPS:LTUS:1:RAMPSTATE PP") } record(stringin, "PS:LTUS:1:Drawing") { field(DESC, "Drawing Number") field(VAL, "PR-376-541-00") field(PINI, "YES") } record(stringin, "PS:LTUS:1:Location") { field(DESC, "Rack Location") field(VAL, "B005-2009") field(PINI, "YES") } record(bo, "PS:LTUS:1:CommLink") { field(DESC, "Communication Link Status") field(PINI, "YES") field(ZNAM, "Offline") field(ONAM, "Online") field(FLNK, "PS:LTUS:1:InitCommLinkCalc") } record(calcout,"PS:LTUS:1:InitCommLinkCalc") { field(DESC, "Init Pvs") field(OOPT, "Transition To Non-zero") field(FLNK, "PS:LTUS:1:InitCommLink") field(ASG, "Internal") } record(dfanout,"PS:LTUS:1:InitCommLink") { field(DESC, "PS Init") field(DOL, "0") field(OMSL, "closed_loop") field(OUTA, "PS:LTUS:1:Addr.PROC PP") field(OUTB, "PS:LTUS:1:State.PROC PP") field(OUTC, "PS:LTUS:1:FaultEnable.PROC PP") field(OUTD, "PS:LTUS:1:StatusEnable.PROC PP") field(OUTE, "PS:LTUS:1:ResetSeq.PROC PP") field(OUTF, "PS:LTUS:1:StatusEvent.PROC PP") field(OUTG, "PS:LTUS:1:OperStatus.PROC PP") field(OUTH, "PS:LTUS:1:IDN.PROC PP") field(FLNK, "PS:LTUS:1:InitCurrSetpt") field(ASG, "Internal") } # Process VSETPT on IOC startup record(seq,"PS:LTUS:1:InitCurrSetpt") { field(DESC, "Init current setpoint") field(DOL1, "0") field(LNK1, "PS:LTUS:1:VoltSetpt.DISV") field(LNK2, "PS:LTUS:1:CurrSetptOut.PROC") field(DOL3, "1") field(LNK3, "PS:LTUS:1:VoltSetpt.DISV") field(ASG, "Internal") } record(bo, "PS:LTUS:2:StateSetpt") { field(DESC, "Power Supply On/Off") field(ZNAM, "OFF") field(ONAM, "ON") } record(bo, "PS:LTUS:2:StateSetptOut") { field(DESC, "Power Supply On/Off") field(DTYP, "stream") field(OUT, "@mgnt_genesys.proto PSU-setonoff(06) LGPS_LTUS_2") field(ZNAM, "OFF") field(ONAM, "ON") field(FLNK, "PS:LTUS:2:State") } record(bi, "PS:LTUS:2:State") { field(DESC, "Power Supply On/Off Status") field(DTYP, "stream") field(INP, "@mgnt_genesys.proto PSU-getonoff(06) LGPS_LTUS_2") field(ZNAM, "OFF") field(ONAM, "ON") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(PINI, "YES") field(FLNK, "LGPS:LTUS:2:STATE NPP MS") } record(calcout, "PS:LTUS:2:StateCheck") { # Do nothing if the state is invalid. # If the state setpoint is invalid, then set state setpoint to state. # If the state and setpoint are the same, set off if state is off, # otherwise, set state setpoint to state. # If the state setpoint has changed, go on or off. Otherwise, the state # must've changed externally so follow it. # field(DESC, "PS State Check") field(CALC, "C=3?0:D=3?3:(A#B)&&(B#E)?B+1:A=0?1:3") field(OUT, "PS:LTUS:2:StateSeq.SELN PP") field(INPA, "PS:LTUS:2:State CPP") field(INPB, "PS:LTUS:2:StateSetpt CPP") field(INPC, "PS:LTUS:2:State.SEVR") field(INPD, "PS:LTUS:2:StateSetpt.SEVR") field(INPE, "PS:LTUS:2:StateCheck.LB") field(ASG, "Internal") } record(seq, "PS:LTUS:2:StateSeq") { field(DESC, "PS State Sequence") field(SELM, "Specified") field(LNK1, "PS:LTUS:2:StateOffSetptSeq.PROC PP") field(LNK2, "PS:LTUS:2:StateOnSetptSeq.PROC PP") field(DOL3, "PS:LTUS:2:State") field(LNK3, "PS:LTUS:2:StateSetptSeq PP") field(ASG, "Internal") } record(seq, "PS:LTUS:2:StateOnSetptSeq") { # When turning on, reset the power supply, # enable foldback protection, set the voltage # and current to max and delay befor setting # the state to 1 (on). # field(DESC, "PS On Sequence") field(LNK1, "PS:LTUS:2:Reset.PROC PP") field(LNK2, "PS:LTUS:2:StateReset.PROC PP") field(DOL3, "1") field(LNK3, "PS:LTUS:2:FoldBackEnable PP") field(DLY4, "0.2") field(DOL4, "LGPS:LTUS:2:BCTRL.HOPR") field(LNK4, "LGPS:LTUS:2:BCTRL PP") field(DLY5, "0.2") field(DOL5, "1") field(LNK5, "PS:LTUS:2:StateSetptSeq PP") field(ASG, "Internal") } record(seq, "PS:LTUS:2:StateOffSetptSeq") { # When turning off, set the voltage and current max and then wait before # before setting the state to 0 (off). # Note: Under normal circumstances you'd set the current and volts to 0, # and wait to allow the supply to ramp down before turning the supply off. # However, power conversion has requested to leave the voltage and current # unchanged before setting the state to 0 (off). # field(DESC, "PS Off Sequence") field(LNK1, "PS:LTUS:2:CurrSetptOut.PROC PP") field(DLY2, "0.2") field(LNK2, "PS:LTUS:2:StateSetptSeq PP") field(ASG, "Internal") } record(seq, "PS:LTUS:2:StateSetptSeq") { # Set both the desired and the actual setpoints to requested. # Renable status events in case of power-cycle. # field(DESC, "PS State Setpt Sequence") field(DOL1, "PS:LTUS:2:StateSetptSeq") field(LNK1, "LGPS:LTUS:2:STATESETPT PP") field(DOL2, "PS:LTUS:2:StateSetptSeq") field(LNK2, "PS:LTUS:2:StateSetpt PP") field(LNK3, "PS:LTUS:2:FaultEnable.PROC PP") field(LNK4, "PS:LTUS:2:StatusEnable.PROC PP") field(LNK5, "PS:LTUS:2:OperStatus.PROC PP") field(LNK6, "PS:LTUS:2:FaultStatus.PROC PP") field(FLNK, "PS:LTUS:2:IDN ") field(ASG, "Internal") } # The reset command brings the power supply to a safe and known state. # Output voltage: zero Remote/Local Mode: non-lockout remote # Output current: zero Auto-Restart Mode: OFF # Output ON/OFF: OFF OVP setting: maximum # FoldbBack ON/OFF: OFF UVL setting: zero # # The condiitional resgisters (FLT and STAT) are updated while other # registers are not changed. # record(bo, "PS:LTUS:2:StateReset") { field(DESC, "Power Supply Reset") field(DTYP, "stream") field(OUT, "@mgnt_genesys.proto PSU-comreset(06) LGPS_LTUS_2") field(ZNAM, "OFF") field(ONAM, "OFF") field(FLNK, "PS:LTUS:2:ResetSeq") } # Returns th power supply model identification as an ascii string: LAMBDA, GENX-Y record (stringin, "PS:LTUS:2:IDN") { field(DESC, "Identification") field(DTYP, "stream") field(INP, "@mgnt_genesys.proto PSU-getidn(06) LGPS_LTUS_2") field(PINI, "YES") field(FLNK, "PS:LTUS:2:SerialNo") } record(stringin, "PS:LTUS:2:SerialNo") { field(DESC, "Serial Number") field(DTYP, "stream") field(INP, "@mgnt_genesys.proto PSU-getsn(06) LGPS_LTUS_2") field(FLNK, "PS:LTUS:2:Revision") } record(stringin, "PS:LTUS:2:Revision") { field(DESC, "Software Revision") field(DTYP, "stream") field(INP, "@mgnt_genesys.proto PSU-getrev(06) LGPS_LTUS_2") } # We aren't interested in current since we are setting voltage. # The current is variable so it's meaningless. record(ai, "PS:LTUS:2:Curr") { field(DESC, "PS Current") field(DTYP, "stream") field(INP, "@mgnt_genesys.proto PSU-getcur(06) LGPS_LTUS_2") field(EGU, "Amps") field(PREC, "3") field(HOPR, "200") field(FLNK, "PS:LTUS:2:ResistanceInp") } record(ao, "PS:LTUS:2:CurrSetpt") { field(DESC, "Current Output") field(DTYP, "stream") field(OUT, "@mgnt_genesys.proto PSU-setcur(06) LGPS_LTUS_2") field(EGU, "Amps") field(PREC, "3") field(HOPR, "200") field(DRVH, "200") field(DOL, "PS:LTUS:2:CurrSetpt.HOPR") field(OMSL, "closed_loop") info(autosaveFields, "VAL") } record(ai, "PS:LTUS:2:CurrSetptRbck") { field(DESC, "Current Output Readback") field(DTYP, "stream") field(INP, "@mgnt_genesys.proto PSU-getsetcur(06) LGPS_LTUS_2") field(EGU, "Amps") field(PREC, "3") field(HOPR, "200") } # Calculate resistance if voltage and current are high enough. # Add smoothing of the resistance value. record(calc, "PS:LTUS:2:ResistanceInp") { field(DESC, "Resistance") field(ASG, "Internal") field(CALC, "B<=0?0:A<0.5?C:((B/A)*(1-D))+(C*D)") field(INPA, "PS:LTUS:2:Curr MS") field(INPB, "PS:LTUS:2:Volt MS") field(INPC, "PS:LTUS:2:ResistanceInp") field(INPD, "PS:LTUS:2:Resistance.D") field(EGU, "Ohm") field(PREC, "4") field(HOPR, "5") field(FLNK, "PS:LTUS:2:Resistance") } # Add offset to resistance for testing purposes. record(calc, "PS:LTUS:2:Resistance") { field(DESC, "Resistance") field(CALC, "C+E") field(INPC, "PS:LTUS:2:ResistanceInp") field(INPD, "0") field(EGU, "Ohm") field(PREC, "4") field(HOPR, "5") } record(ai, "PS:LTUS:2:Volt") { field(DESC, "PS Output Voltage") field(DTYP, "stream") field(INP, "@mgnt_genesys.proto PSU-getvolts(06) LGPS_LTUS_2") field(EGU, "Volts") field(PREC, "3") field(HOPR, "50.0") field(PINI, "YES") field(FLNK, "PS:LTUS:2:CurrAct") } record(ai, "PS:LTUS:2:CurrAct") { field(DESC, "PS Output Current") field(INP, "PS:LTUS:2:Volt NPP MS") field(EGU, "Amps") field(PREC, "3") field(HOPR, "200") field(FLNK, "LGPS:LTUS:2:IACT") } record(ao, "PS:LTUS:2:CurrSetptOut") { field(DESC, "Current to Volt Output") field(EGU, "Amps") field(PREC, "3") field(HOPR, "50.0") field(DRVH, "50.0") field(OUT, "PS:LTUS:2:VoltSetpt PP") info(autosaveFields, "VAL") } record(ao, "PS:LTUS:2:VoltSetpt") { field(DESC, "Voltage Output") field(DTYP, "stream") field(OUT, "@mgnt_genesys.proto PSU-setvolts(06) LGPS_LTUS_2") field(EGU, "Volts") field(PREC, "3") field(HOPR, "50.0") field(DRVH, "50.0") field(FLNK, "PS:LTUS:2:VoltSetptSeq") } record(seq, "PS:LTUS:2:VoltSetptSeq") { field(DESC, "Voltage Output Sequence") field(DLY1, "0.2") field(LNK1, "PS:LTUS:2:CurrSetpt.PROC PP") field(DLY2, "0.2") field(LNK2, "PS:LTUS:2:VoltSetptRbck.PROC PP") field(DLY3, "0.2") field(LNK3, "PS:LTUS:2:CurrSetptRbck.PROC PP") } record(ai, "PS:LTUS:2:VoltSetptRbck") { field(DESC, "Voltage Output Readback") field(DTYP, "stream") field(INP, "@mgnt_genesys.proto PSU-getsetvolts(06) LGPS_LTUS_2") field(EGU, "Volts") field(PREC, "3") field(HOPR, "50.0") field(FLNK, "PS:LTUS:2:CurrSetpt") } # Clear status command. Sets FEVE and SEVE registers to zero. record(bo, "PS:LTUS:2:Reset") { field(DESC, "Clear Errors") field(DTYP, "stream") field(OUT, "@mgnt_genesys.proto PSU-comclr(06) LGPS_LTUS_2") field(ZNAM, "RESET") field(ONAM, "NORESET") field(FLNK, "PS:LTUS:2:ResetSeq") } record(seq, "PS:LTUS:2:ResetSeq") { field(DESC, "Process Events") field(ASG, "Internal") field(LNK1, "PS:LTUS:2:FaultEvent.PROC PP") field(LNK2, "PS:LTUS:2:StatusEvent.PROC PP") } record(fanout, "PS:LTUS:2:UpdateFast") { # Process State before Curr since State may change Curr limits. field(DESC, "Fast Update") field(LNK1, "PS:LTUS:2:Volt.PROC") field(LNK2, "PS:LTUS:2:State.PROC") field(LNK3, "PS:LTUS:2:VoltSetptRbck.PROC") field(LNK4, "PS:LTUS:2:CurrSetptRbck.PROC") field(LNK5, "PS:LTUS:2:Curr.PROC") field(LNK6, "PS:LTUS:2:CurrAct.PROC") field(SCAN, ".5 second") field(DISV, "0") field(SDIS, "PS:LTUS:2:CommLink") field(ASG, "Internal") } record(fanout, "PS:LTUS:2:UpdateSlow") { field(DESC, "Slow Update") field(LNK1, "PS:LTUS:2:StatusEvent.PROC") field(LNK2, "PS:LTUS:2:OperStatus.PROC") field(LNK3, "PS:LTUS:2:FaultStatus.PROC") field(LNK4, "PS:LTUS:2:FaultEvent.PROC") field(SCAN, "2 second") field(DISV, "0") field(SDIS, "PS:LTUS:2:CommLink") field(ASG, "Internal") } # Conditional Registers # The faultconditional and status conditional registers # are read only registers that the uesrs may read to see the # condition of the power supply. # # # Fault Conditional Register record(longout, "PS:LTUS:2:FaultEnable") { field(DESC, "Enable Fault Events") field(DTYP, "stream") field(OUT, "@mgnt_genesys.proto PSU-setfena(06) LGPS_LTUS_2") field(DOL, "254") field(OMSL, "closed_loop") } # Reading the fault event register, clears bits of the fault event register # The fault event will set a bit if a condition occurs and it is Enabled. # The register is cleared when FEVE?, CLS or RST commands are received. record(mbbiDirect, "PS:LTUS:2:FaultEvent") { field(DESC, "Fault Event Register") field(DTYP, "stream") field(INP, "@mgnt_genesys.proto PSU-getfeve(06) LGPS_LTUS_2") } record(mbbiDirect,"PS:LTUS:2:FaultStatus") { field(DESC,"Fault Conditional Register") field(DTYP,"stream") field(INP, "@mgnt_genesys.proto PSU-getflt(06) LGPS_LTUS_2") field(FLNK, "PS:LTUS:2:ACState") } record(bi, "PS:LTUS:2:ACState") { field(DESC, "AC Status") field(INP, "PS:LTUS:2:FaultStatus.B1") field(ZNAM, "OK") field(ONAM, "FAULT") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(FLNK, "PS:LTUS:2:OverTemp") } # The OTP circuit shuts down the power supply before the internal # components can exceed their safe internal operating temperature. # When an OTP shutdown occurs, the VOLTAGE meter displays "O7P" # and the ALARM LED blinks.Resetting the OTP circuit can be # automatic (non-latched) or manual (latched) dependingon the # Safe-Start or AutoRestart mode. # # 1.Safe-Start mode: # In Safe-Start mode, the power supply stays OFF after the over # temperature condition has been removed. The display continues to show \u201cO7P\u201d and the # ALARM LEDcontinues to blink. To reset the OTP circuit, press the OUT # button (or send an OUT ON (OUT 1)command via the RS-232/RS-485 serialcommunicationport). # 2. Auto-Restart mode: # In Auto-Restart mode, the power supply recovers to its last setting # operational automatically when the over temperature condition is removed. # record(bi, "PS:LTUS:2:OverTemp") { field(DESC, "Over Temperature Status") field(INP, "PS:LTUS:2:FaultStatus.B2") field(ZNAM, "OK") field(ONAM, "FAULT") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(FLNK, "PS:LTUS:2:FoldBack") } # The supply output is turned On by front panel # button or OUT 1 command. record(bi, "PS:LTUS:2:FoldBack") { field(DESC, "FoldBack Shutdown") field(INP, "PS:LTUS:2:FaultStatus.B3") field(ZNAM, "OK") field(ONAM, "FAULT") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(FLNK, "PS:LTUS:2:OverVolt") } record(bi, "PS:LTUS:2:OverVolt") { field(DESC, "Over Voltage Status") field(INP, "PS:LTUS:2:FaultStatus.B4") field(ZNAM, "OK") field(ONAM, "FAULT") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(FLNK, "PS:LTUS:2:ShutOff") } record(bi, "PS:LTUS:2:ShutOff") { field(DESC, "J1 Analog In Shut Off") field(INP, "PS:LTUS:2:FaultStatus.B5") field(ZNAM, "OK") field(ONAM, "FAULT") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(FLNK, "PS:LTUS:2:ManualOff") } # The supply output is turned On by front # panel button or OUT 1 command record(bi, "PS:LTUS:2:ManualOff") { field(DESC, "Front Panel Off") field(INP, "PS:LTUS:2:FaultStatus.B6") field(ZNAM, "OK") field(ONAM, "FAULT") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(FLNK, "PS:LTUS:2:OutputState") } record(bi, "PS:LTUS:2:OutputState") { field(DESC, "J1 Analog In Enable Fault") field(INP, "PS:LTUS:2:FaultStatus.B7") field(ZNAM, "OK") field(ONAM, "FAULT") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") } record(calcout, "PS:LTUS:2:LatchedFaultStateCalc") { field(DESC, "Fault Latch Status Calc") field(ASG, "Internal") field(CALC, "(B=3)||(D=3)?0:(A>0)||(C>0)?1:0") field(INPA, "PS:LTUS:2:FaultStatus CPP NMS") field(INPB, "PS:LTUS:2:FaultStatus.SEVR NPP NMS") field(INPC, "PS:LTUS:2:FaultEvent CPP NMS") field(INPD, "PS:LTUS:2:FaultEvent.SEVR NPP NMS") field(OOPT, "Every Time") field(FLNK, "PS:LTUS:2:LatchedFaultState") } record(bi, "PS:LTUS:2:LatchedFaultState") { field(DESC, "Fault Latch Status") field(INP, "PS:LTUS:2:LatchedFaultStateCalc NPP NMS") field(ONAM, "FAULT") field(ZNAM, "OK") field(OSV, "MAJOR") field(ZSV, "NO_ALARM") field(FLNK, "LGPS:LTUS:2:INTLKSUMY PP MS") } # Status Conditional Register is set by the user to Enable # SRQs for changes in power supply status. record(longout, "PS:LTUS:2:StatusEnable") { field(DESC, "Enable Status Events") field(DTYP, "stream") field(OUT, "@mgnt_genesys.proto PSU-setsena(06) LGPS_LTUS_2") field(DOL, "191") field(OMSL, "closed_loop") } # The status event register will set a bit if a change in teh power supply occurs # and it is enabled. The register is clered when teh SEVE? or CLS commands are received. # A change in this register will generate SRQ # # Reading the status event register, clears bits of the status event register record(mbbiDirect, "PS:LTUS:2:StatusEvent") { field(DESC, "Status Event Register") field(DTYP, "stream") field(INP, "@mgnt_genesys.proto PSU-getseve(06) LGPS_LTUS_2") field(FLNK, "PS:LTUS:2:StatusEventSeq") } record(seq, "PS:LTUS:2:StatusEventSeq") { # Process the status event registers that show a fault. # Do nothing if the status byte register is 0. field(DESC, "Process Non-Zero Events") field(ASG, "Internal") field(SELM, "Mask") field(SELL, "PS:LTUS:2:StatusEvent") field(LNK3, "PS:LTUS:2:FaultEvent.PROC PP") field(LNK4, "PS:LTUS:2:FaultEvent.PROC PP") } record(mbbiDirect, "PS:LTUS:2:OperStatus") { field(DESC, "Status Conditional Register") field(DTYP, "stream") field(INP, "@mgnt_genesys.proto PSU-getstat(06) LGPS_LTUS_2") field(PINI, "YES") field(FLNK, "PS:LTUS:2:VoltMode") } record(bi, "PS:LTUS:2:VoltMode") { field(DESC, "Voltage Mode") field(INP, "PS:LTUS:2:OperStatus.B0 MS") field(ZNAM, "Not Constant") field(ONAM, "Constant") field(FLNK, "PS:LTUS:2:CurrMode") } record(bi, "PS:LTUS:2:CurrMode") { field(DESC, "Current Mode") field(INP, "PS:LTUS:2:OperStatus.B1 MS") field(ZNAM, "Not Constant") field(ONAM, "Constant") field(FLNK, "PS:LTUS:2:NoFaultState") } record(bi, "PS:LTUS:2:NoFaultState") { field(DESC, "No Fault Status") field(INP, "PS:LTUS:2:OperStatus.B2 MS") field(ZNAM, "FAULT") field(ONAM, "OK") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(FLNK, "PS:LTUS:2:ActiveFaultState") } record(bi, "PS:LTUS:2:ActiveFaultState") { field(DESC, "Active Fault Status") field(INP, "PS:LTUS:2:OperStatus.B3 MS") field(ZNAM, "OK") field(ONAM, "FAULT") field(ZSV, "NO_ALARM") field(OSV, "NO_ALARM") field(FLNK, "PS:LTUS:2:AutoStartMode") } # In this mode, the power supply restores its last # operation setting. Upon startup (AC Input power recycle), # the output is enabled or disabled according to its last settings record(bi, "PS:LTUS:2:AutoStartMode") { field(DESC, "Auto Start Mode") field(INP, "PS:LTUS:2:OperStatus.B4 MS") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(FLNK, "PS:LTUS:2:FoldBackMode") } # FoldBack protection will shut down the power supply output # if the load current exceeds the Output current limit # setting level. This protection is useful when the load # circuitry is sensitive to an overcurrent condition # # 4/27/2022: K.Luchini - swp ZSV and OSV, so ZSV is not alarmed # becase we want fold back mode to be disabled. record(bi, "PS:LTUS:2:FoldBackMode") { field(DESC, "Fold Back Protection") field(INP, "PS:LTUS:2:OperStatus.B5 MS") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(FLNK, "PS:LTUS:2:Mode") } record(bi, "PS:LTUS:2:Mode") { field(DESC, "Local Mode") field(INP, "PS:LTUS:2:OperStatus.B7 MS") field(ZNAM, "REMOTE") field(ONAM, "LOCAL") field(ZSV, "NO_ALARM") field(OSV, "MINOR") } record(bo, "PS:LTUS:2:FoldBackEnable") { field(DESC, "Fold Back Protection") field(DTYP, "stream") field(OUT, "@mgnt_genesys.proto PSU-setfld(06) LGPS_LTUS_2") field(ZNAM, "OFF") field(ONAM, "ON") } # This command is followed by the address (default=6),and is used # to access the power supply. record(longout, "PS:LTUS:2:Addr") { field(DESC, "Power Supply Address") field(DTYP, "stream") field(OUT, "@mgnt_genesys.proto PSU-comsetadr(06) LGPS_LTUS_2") field(DOL, "06") field(OMSL, "closed_loop") } record(mbbo, "PS:LTUS:2:MsgRespCode") { field(DESC, "Message Resonse Code") field(DTYP, "Raw Soft Channel") field(NOBT, "4") field(ZRST, "OK") field(ONST, "C01") field(TWST, "C02") field(THST, "C03") field(FRST, "C04") field(FVST, "C05") field(SXST, "E01") field(SVST, "E04") field(EIST, "E06") field(NIST, "E07") 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(EIVL, "8") field(NIVL, "9") field(UNSV, "INVALID") field(FLNK, "PS:LTUS:2:MsgResp") } record(mbbi, "PS:LTUS:2:MsgResp") { field(DESC, "Message Response") field(INP, "PS:LTUS:2:MsgRespCode.RVAL NPP MS") field(NOBT, "4") field(ZRST, "OK") field(ONST, "Illegal Command Query") field(TWST, "Missing Parameter") field(THST, "Illegal Parameter") field(FRST, "Checksum Error") field(FVST, "Setting out of range") field(SXST, "Prog Volt Exceeded") field(SVST, "Out Volt below UVL") field(EIST, "UVL above Out Volt") field(NIST, "ON request while Fault") field(ZRST, "NO_ALARM") field(ONST, "MAJOR") field(TWST, "MAJOR") field(THST, "MAJOR") field(FRST, "MAJOR") field(FVST, "MAJOR") field(SXST, "MAJOR") field(SVST, "MAJOR") field(EIST, "MAJOR") field(NIST, "MAJOR") field(UNSV, "INVALID") field(PINI, "YES") } record(stringout, "PS:LTUS:2:GetAnything") { field(DESC, "Get Anything") field(DTYP, "stream") field(OUT, "@mgnt_genesys.proto debug(06) LGPS_LTUS_2") } record(stringout, "PS:LTUS:2:SetAnything") { field(DESC, "Set anything") field(DTYP, "stream") field(OUT, "@mgnt_genesys.proto PSU-set(06) LGPS_LTUS_2") } record(mbbo, "PS:LTUS:2: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, "YES") field(VAL, "3") field(OUT, "LGPS:LTUS:2:COOLING PP") } record(bo, "PS:LTUS:2:RampState") { field(DESC, "PS Ramp Status") field(ZNAM, "OFF") field(ONAM, "BUSY") field(PINI, "YES") field(OUT, "LGPS:LTUS:2:RAMPSTATE PP") } record(stringin, "PS:LTUS:2:Drawing") { field(DESC, "Drawing Number") field(VAL, "PR-376-542-00") field(PINI, "YES") } record(stringin, "PS:LTUS:2:Location") { field(DESC, "Rack Location") field(VAL, "B911-3301") field(PINI, "YES") } record(bo, "PS:LTUS:2:CommLink") { field(DESC, "Communication Link Status") field(PINI, "YES") field(ZNAM, "Offline") field(ONAM, "Online") field(FLNK, "PS:LTUS:2:InitCommLinkCalc") } record(calcout,"PS:LTUS:2:InitCommLinkCalc") { field(DESC, "Init Pvs") field(OOPT, "Transition To Non-zero") field(FLNK, "PS:LTUS:2:InitCommLink") field(ASG, "Internal") } record(dfanout,"PS:LTUS:2:InitCommLink") { field(DESC, "PS Init") field(DOL, "0") field(OMSL, "closed_loop") field(OUTA, "PS:LTUS:2:Addr.PROC PP") field(OUTB, "PS:LTUS:2:State.PROC PP") field(OUTC, "PS:LTUS:2:FaultEnable.PROC PP") field(OUTD, "PS:LTUS:2:StatusEnable.PROC PP") field(OUTE, "PS:LTUS:2:ResetSeq.PROC PP") field(OUTF, "PS:LTUS:2:StatusEvent.PROC PP") field(OUTG, "PS:LTUS:2:OperStatus.PROC PP") field(OUTH, "PS:LTUS:2:IDN.PROC PP") field(FLNK, "PS:LTUS:2:InitCurrSetpt") field(ASG, "Internal") } # Process VSETPT on IOC startup record(seq,"PS:LTUS:2:InitCurrSetpt") { field(DESC, "Init current setpoint") field(DOL1, "0") field(LNK1, "PS:LTUS:2:VoltSetpt.DISV") field(LNK2, "PS:LTUS:2:CurrSetptOut.PROC") field(DOL3, "1") field(LNK3, "PS:LTUS:2:VoltSetpt.DISV") field(ASG, "Internal") } record(bo, "PS:LTUS:3:StateSetpt") { field(DESC, "Power Supply On/Off") field(ZNAM, "OFF") field(ONAM, "ON") } record(bo, "PS:LTUS:3:StateSetptOut") { field(DESC, "Power Supply On/Off") field(DTYP, "stream") field(OUT, "@mgnt_genesys.proto PSU-setonoff(06) LGPS_LTUS_3") field(ZNAM, "OFF") field(ONAM, "ON") field(FLNK, "PS:LTUS:3:State") } record(bi, "PS:LTUS:3:State") { field(DESC, "Power Supply On/Off Status") field(DTYP, "stream") field(INP, "@mgnt_genesys.proto PSU-getonoff(06) LGPS_LTUS_3") field(ZNAM, "OFF") field(ONAM, "ON") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(PINI, "YES") field(FLNK, "LGPS:LTUS:3:STATE NPP MS") } record(calcout, "PS:LTUS:3:StateCheck") { # Do nothing if the state is invalid. # If the state setpoint is invalid, then set state setpoint to state. # If the state and setpoint are the same, set off if state is off, # otherwise, set state setpoint to state. # If the state setpoint has changed, go on or off. Otherwise, the state # must've changed externally so follow it. # field(DESC, "PS State Check") field(CALC, "C=3?0:D=3?3:(A#B)&&(B#E)?B+1:A=0?1:3") field(OUT, "PS:LTUS:3:StateSeq.SELN PP") field(INPA, "PS:LTUS:3:State CPP") field(INPB, "PS:LTUS:3:StateSetpt CPP") field(INPC, "PS:LTUS:3:State.SEVR") field(INPD, "PS:LTUS:3:StateSetpt.SEVR") field(INPE, "PS:LTUS:3:StateCheck.LB") field(ASG, "Internal") } record(seq, "PS:LTUS:3:StateSeq") { field(DESC, "PS State Sequence") field(SELM, "Specified") field(LNK1, "PS:LTUS:3:StateOffSetptSeq.PROC PP") field(LNK2, "PS:LTUS:3:StateOnSetptSeq.PROC PP") field(DOL3, "PS:LTUS:3:State") field(LNK3, "PS:LTUS:3:StateSetptSeq PP") field(ASG, "Internal") } record(seq, "PS:LTUS:3:StateOnSetptSeq") { # When turning on, reset the power supply, # enable foldback protection, set the voltage # and current to max and delay befor setting # the state to 1 (on). # field(DESC, "PS On Sequence") field(LNK1, "PS:LTUS:3:Reset.PROC PP") field(LNK2, "PS:LTUS:3:StateReset.PROC PP") field(DOL3, "1") field(LNK3, "PS:LTUS:3:FoldBackEnable PP") field(DLY4, "0.2") field(DOL4, "LGPS:LTUS:3:BCTRL.HOPR") field(LNK4, "LGPS:LTUS:3:BCTRL PP") field(DLY5, "0.2") field(DOL5, "1") field(LNK5, "PS:LTUS:3:StateSetptSeq PP") field(ASG, "Internal") } record(seq, "PS:LTUS:3:StateOffSetptSeq") { # When turning off, set the voltage and current max and then wait before # before setting the state to 0 (off). # Note: Under normal circumstances you'd set the current and volts to 0, # and wait to allow the supply to ramp down before turning the supply off. # However, power conversion has requested to leave the voltage and current # unchanged before setting the state to 0 (off). # field(DESC, "PS Off Sequence") field(LNK1, "PS:LTUS:3:CurrSetptOut.PROC PP") field(DLY2, "0.2") field(LNK2, "PS:LTUS:3:StateSetptSeq PP") field(ASG, "Internal") } record(seq, "PS:LTUS:3:StateSetptSeq") { # Set both the desired and the actual setpoints to requested. # Renable status events in case of power-cycle. # field(DESC, "PS State Setpt Sequence") field(DOL1, "PS:LTUS:3:StateSetptSeq") field(LNK1, "LGPS:LTUS:3:STATESETPT PP") field(DOL2, "PS:LTUS:3:StateSetptSeq") field(LNK2, "PS:LTUS:3:StateSetpt PP") field(LNK3, "PS:LTUS:3:FaultEnable.PROC PP") field(LNK4, "PS:LTUS:3:StatusEnable.PROC PP") field(LNK5, "PS:LTUS:3:OperStatus.PROC PP") field(LNK6, "PS:LTUS:3:FaultStatus.PROC PP") field(FLNK, "PS:LTUS:3:IDN ") field(ASG, "Internal") } # The reset command brings the power supply to a safe and known state. # Output voltage: zero Remote/Local Mode: non-lockout remote # Output current: zero Auto-Restart Mode: OFF # Output ON/OFF: OFF OVP setting: maximum # FoldbBack ON/OFF: OFF UVL setting: zero # # The condiitional resgisters (FLT and STAT) are updated while other # registers are not changed. # record(bo, "PS:LTUS:3:StateReset") { field(DESC, "Power Supply Reset") field(DTYP, "stream") field(OUT, "@mgnt_genesys.proto PSU-comreset(06) LGPS_LTUS_3") field(ZNAM, "OFF") field(ONAM, "OFF") field(FLNK, "PS:LTUS:3:ResetSeq") } # Returns th power supply model identification as an ascii string: LAMBDA, GENX-Y record (stringin, "PS:LTUS:3:IDN") { field(DESC, "Identification") field(DTYP, "stream") field(INP, "@mgnt_genesys.proto PSU-getidn(06) LGPS_LTUS_3") field(PINI, "YES") field(FLNK, "PS:LTUS:3:SerialNo") } record(stringin, "PS:LTUS:3:SerialNo") { field(DESC, "Serial Number") field(DTYP, "stream") field(INP, "@mgnt_genesys.proto PSU-getsn(06) LGPS_LTUS_3") field(FLNK, "PS:LTUS:3:Revision") } record(stringin, "PS:LTUS:3:Revision") { field(DESC, "Software Revision") field(DTYP, "stream") field(INP, "@mgnt_genesys.proto PSU-getrev(06) LGPS_LTUS_3") } # We aren't interested in current since we are setting voltage. # The current is variable so it's meaningless. record(ai, "PS:LTUS:3:Curr") { field(DESC, "PS Current") field(DTYP, "stream") field(INP, "@mgnt_genesys.proto PSU-getcur(06) LGPS_LTUS_3") field(EGU, "Amps") field(PREC, "3") field(HOPR, "200") field(FLNK, "PS:LTUS:3:ResistanceInp") } record(ao, "PS:LTUS:3:CurrSetpt") { field(DESC, "Current Output") field(DTYP, "stream") field(OUT, "@mgnt_genesys.proto PSU-setcur(06) LGPS_LTUS_3") field(EGU, "Amps") field(PREC, "3") field(HOPR, "200") field(DRVH, "200") field(DOL, "PS:LTUS:3:CurrSetpt.HOPR") field(OMSL, "closed_loop") info(autosaveFields, "VAL") } record(ai, "PS:LTUS:3:CurrSetptRbck") { field(DESC, "Current Output Readback") field(DTYP, "stream") field(INP, "@mgnt_genesys.proto PSU-getsetcur(06) LGPS_LTUS_3") field(EGU, "Amps") field(PREC, "3") field(HOPR, "200") } # Calculate resistance if voltage and current are high enough. # Add smoothing of the resistance value. record(calc, "PS:LTUS:3:ResistanceInp") { field(DESC, "Resistance") field(ASG, "Internal") field(CALC, "B<=0?0:A<0.5?C:((B/A)*(1-D))+(C*D)") field(INPA, "PS:LTUS:3:Curr MS") field(INPB, "PS:LTUS:3:Volt MS") field(INPC, "PS:LTUS:3:ResistanceInp") field(INPD, "PS:LTUS:3:Resistance.D") field(EGU, "Ohm") field(PREC, "4") field(HOPR, "5") field(FLNK, "PS:LTUS:3:Resistance") } # Add offset to resistance for testing purposes. record(calc, "PS:LTUS:3:Resistance") { field(DESC, "Resistance") field(CALC, "C+E") field(INPC, "PS:LTUS:3:ResistanceInp") field(INPD, "0") field(EGU, "Ohm") field(PREC, "4") field(HOPR, "5") } record(ai, "PS:LTUS:3:Volt") { field(DESC, "PS Output Voltage") field(DTYP, "stream") field(INP, "@mgnt_genesys.proto PSU-getvolts(06) LGPS_LTUS_3") field(EGU, "Volts") field(PREC, "3") field(HOPR, "50.0") field(PINI, "YES") field(FLNK, "PS:LTUS:3:CurrAct") } record(ai, "PS:LTUS:3:CurrAct") { field(DESC, "PS Output Current") field(INP, "PS:LTUS:3:Volt NPP MS") field(EGU, "Amps") field(PREC, "3") field(HOPR, "200") field(FLNK, "LGPS:LTUS:3:IACT") } record(ao, "PS:LTUS:3:CurrSetptOut") { field(DESC, "Current to Volt Output") field(EGU, "Amps") field(PREC, "3") field(HOPR, "50.0") field(DRVH, "50.0") field(OUT, "PS:LTUS:3:VoltSetpt PP") info(autosaveFields, "VAL") } record(ao, "PS:LTUS:3:VoltSetpt") { field(DESC, "Voltage Output") field(DTYP, "stream") field(OUT, "@mgnt_genesys.proto PSU-setvolts(06) LGPS_LTUS_3") field(EGU, "Volts") field(PREC, "3") field(HOPR, "50.0") field(DRVH, "50.0") field(FLNK, "PS:LTUS:3:VoltSetptSeq") } record(seq, "PS:LTUS:3:VoltSetptSeq") { field(DESC, "Voltage Output Sequence") field(DLY1, "0.2") field(LNK1, "PS:LTUS:3:CurrSetpt.PROC PP") field(DLY2, "0.2") field(LNK2, "PS:LTUS:3:VoltSetptRbck.PROC PP") field(DLY3, "0.2") field(LNK3, "PS:LTUS:3:CurrSetptRbck.PROC PP") } record(ai, "PS:LTUS:3:VoltSetptRbck") { field(DESC, "Voltage Output Readback") field(DTYP, "stream") field(INP, "@mgnt_genesys.proto PSU-getsetvolts(06) LGPS_LTUS_3") field(EGU, "Volts") field(PREC, "3") field(HOPR, "50.0") field(FLNK, "PS:LTUS:3:CurrSetpt") } # Clear status command. Sets FEVE and SEVE registers to zero. record(bo, "PS:LTUS:3:Reset") { field(DESC, "Clear Errors") field(DTYP, "stream") field(OUT, "@mgnt_genesys.proto PSU-comclr(06) LGPS_LTUS_3") field(ZNAM, "RESET") field(ONAM, "NORESET") field(FLNK, "PS:LTUS:3:ResetSeq") } record(seq, "PS:LTUS:3:ResetSeq") { field(DESC, "Process Events") field(ASG, "Internal") field(LNK1, "PS:LTUS:3:FaultEvent.PROC PP") field(LNK2, "PS:LTUS:3:StatusEvent.PROC PP") } record(fanout, "PS:LTUS:3:UpdateFast") { # Process State before Curr since State may change Curr limits. field(DESC, "Fast Update") field(LNK1, "PS:LTUS:3:Volt.PROC") field(LNK2, "PS:LTUS:3:State.PROC") field(LNK3, "PS:LTUS:3:VoltSetptRbck.PROC") field(LNK4, "PS:LTUS:3:CurrSetptRbck.PROC") field(LNK5, "PS:LTUS:3:Curr.PROC") field(LNK6, "PS:LTUS:3:CurrAct.PROC") field(SCAN, ".5 second") field(DISV, "0") field(SDIS, "PS:LTUS:3:CommLink") field(ASG, "Internal") } record(fanout, "PS:LTUS:3:UpdateSlow") { field(DESC, "Slow Update") field(LNK1, "PS:LTUS:3:StatusEvent.PROC") field(LNK2, "PS:LTUS:3:OperStatus.PROC") field(LNK3, "PS:LTUS:3:FaultStatus.PROC") field(LNK4, "PS:LTUS:3:FaultEvent.PROC") field(SCAN, "2 second") field(DISV, "0") field(SDIS, "PS:LTUS:3:CommLink") field(ASG, "Internal") } # Conditional Registers # The faultconditional and status conditional registers # are read only registers that the uesrs may read to see the # condition of the power supply. # # # Fault Conditional Register record(longout, "PS:LTUS:3:FaultEnable") { field(DESC, "Enable Fault Events") field(DTYP, "stream") field(OUT, "@mgnt_genesys.proto PSU-setfena(06) LGPS_LTUS_3") field(DOL, "254") field(OMSL, "closed_loop") } # Reading the fault event register, clears bits of the fault event register # The fault event will set a bit if a condition occurs and it is Enabled. # The register is cleared when FEVE?, CLS or RST commands are received. record(mbbiDirect, "PS:LTUS:3:FaultEvent") { field(DESC, "Fault Event Register") field(DTYP, "stream") field(INP, "@mgnt_genesys.proto PSU-getfeve(06) LGPS_LTUS_3") } record(mbbiDirect,"PS:LTUS:3:FaultStatus") { field(DESC,"Fault Conditional Register") field(DTYP,"stream") field(INP, "@mgnt_genesys.proto PSU-getflt(06) LGPS_LTUS_3") field(FLNK, "PS:LTUS:3:ACState") } record(bi, "PS:LTUS:3:ACState") { field(DESC, "AC Status") field(INP, "PS:LTUS:3:FaultStatus.B1") field(ZNAM, "OK") field(ONAM, "FAULT") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(FLNK, "PS:LTUS:3:OverTemp") } # The OTP circuit shuts down the power supply before the internal # components can exceed their safe internal operating temperature. # When an OTP shutdown occurs, the VOLTAGE meter displays "O7P" # and the ALARM LED blinks.Resetting the OTP circuit can be # automatic (non-latched) or manual (latched) dependingon the # Safe-Start or AutoRestart mode. # # 1.Safe-Start mode: # In Safe-Start mode, the power supply stays OFF after the over # temperature condition has been removed. The display continues to show \u201cO7P\u201d and the # ALARM LEDcontinues to blink. To reset the OTP circuit, press the OUT # button (or send an OUT ON (OUT 1)command via the RS-232/RS-485 serialcommunicationport). # 2. Auto-Restart mode: # In Auto-Restart mode, the power supply recovers to its last setting # operational automatically when the over temperature condition is removed. # record(bi, "PS:LTUS:3:OverTemp") { field(DESC, "Over Temperature Status") field(INP, "PS:LTUS:3:FaultStatus.B2") field(ZNAM, "OK") field(ONAM, "FAULT") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(FLNK, "PS:LTUS:3:FoldBack") } # The supply output is turned On by front panel # button or OUT 1 command. record(bi, "PS:LTUS:3:FoldBack") { field(DESC, "FoldBack Shutdown") field(INP, "PS:LTUS:3:FaultStatus.B3") field(ZNAM, "OK") field(ONAM, "FAULT") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(FLNK, "PS:LTUS:3:OverVolt") } record(bi, "PS:LTUS:3:OverVolt") { field(DESC, "Over Voltage Status") field(INP, "PS:LTUS:3:FaultStatus.B4") field(ZNAM, "OK") field(ONAM, "FAULT") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(FLNK, "PS:LTUS:3:ShutOff") } record(bi, "PS:LTUS:3:ShutOff") { field(DESC, "J1 Analog In Shut Off") field(INP, "PS:LTUS:3:FaultStatus.B5") field(ZNAM, "OK") field(ONAM, "FAULT") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(FLNK, "PS:LTUS:3:ManualOff") } # The supply output is turned On by front # panel button or OUT 1 command record(bi, "PS:LTUS:3:ManualOff") { field(DESC, "Front Panel Off") field(INP, "PS:LTUS:3:FaultStatus.B6") field(ZNAM, "OK") field(ONAM, "FAULT") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(FLNK, "PS:LTUS:3:OutputState") } record(bi, "PS:LTUS:3:OutputState") { field(DESC, "J1 Analog In Enable Fault") field(INP, "PS:LTUS:3:FaultStatus.B7") field(ZNAM, "OK") field(ONAM, "FAULT") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") } record(calcout, "PS:LTUS:3:LatchedFaultStateCalc") { field(DESC, "Fault Latch Status Calc") field(ASG, "Internal") field(CALC, "(B=3)||(D=3)?0:(A>0)||(C>0)?1:0") field(INPA, "PS:LTUS:3:FaultStatus CPP NMS") field(INPB, "PS:LTUS:3:FaultStatus.SEVR NPP NMS") field(INPC, "PS:LTUS:3:FaultEvent CPP NMS") field(INPD, "PS:LTUS:3:FaultEvent.SEVR NPP NMS") field(OOPT, "Every Time") field(FLNK, "PS:LTUS:3:LatchedFaultState") } record(bi, "PS:LTUS:3:LatchedFaultState") { field(DESC, "Fault Latch Status") field(INP, "PS:LTUS:3:LatchedFaultStateCalc NPP NMS") field(ONAM, "FAULT") field(ZNAM, "OK") field(OSV, "MAJOR") field(ZSV, "NO_ALARM") field(FLNK, "LGPS:LTUS:3:INTLKSUMY PP MS") } # Status Conditional Register is set by the user to Enable # SRQs for changes in power supply status. record(longout, "PS:LTUS:3:StatusEnable") { field(DESC, "Enable Status Events") field(DTYP, "stream") field(OUT, "@mgnt_genesys.proto PSU-setsena(06) LGPS_LTUS_3") field(DOL, "191") field(OMSL, "closed_loop") } # The status event register will set a bit if a change in teh power supply occurs # and it is enabled. The register is clered when teh SEVE? or CLS commands are received. # A change in this register will generate SRQ # # Reading the status event register, clears bits of the status event register record(mbbiDirect, "PS:LTUS:3:StatusEvent") { field(DESC, "Status Event Register") field(DTYP, "stream") field(INP, "@mgnt_genesys.proto PSU-getseve(06) LGPS_LTUS_3") field(FLNK, "PS:LTUS:3:StatusEventSeq") } record(seq, "PS:LTUS:3:StatusEventSeq") { # Process the status event registers that show a fault. # Do nothing if the status byte register is 0. field(DESC, "Process Non-Zero Events") field(ASG, "Internal") field(SELM, "Mask") field(SELL, "PS:LTUS:3:StatusEvent") field(LNK3, "PS:LTUS:3:FaultEvent.PROC PP") field(LNK4, "PS:LTUS:3:FaultEvent.PROC PP") } record(mbbiDirect, "PS:LTUS:3:OperStatus") { field(DESC, "Status Conditional Register") field(DTYP, "stream") field(INP, "@mgnt_genesys.proto PSU-getstat(06) LGPS_LTUS_3") field(PINI, "YES") field(FLNK, "PS:LTUS:3:VoltMode") } record(bi, "PS:LTUS:3:VoltMode") { field(DESC, "Voltage Mode") field(INP, "PS:LTUS:3:OperStatus.B0 MS") field(ZNAM, "Not Constant") field(ONAM, "Constant") field(FLNK, "PS:LTUS:3:CurrMode") } record(bi, "PS:LTUS:3:CurrMode") { field(DESC, "Current Mode") field(INP, "PS:LTUS:3:OperStatus.B1 MS") field(ZNAM, "Not Constant") field(ONAM, "Constant") field(FLNK, "PS:LTUS:3:NoFaultState") } record(bi, "PS:LTUS:3:NoFaultState") { field(DESC, "No Fault Status") field(INP, "PS:LTUS:3:OperStatus.B2 MS") field(ZNAM, "FAULT") field(ONAM, "OK") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(FLNK, "PS:LTUS:3:ActiveFaultState") } record(bi, "PS:LTUS:3:ActiveFaultState") { field(DESC, "Active Fault Status") field(INP, "PS:LTUS:3:OperStatus.B3 MS") field(ZNAM, "OK") field(ONAM, "FAULT") field(ZSV, "NO_ALARM") field(OSV, "NO_ALARM") field(FLNK, "PS:LTUS:3:AutoStartMode") } # In this mode, the power supply restores its last # operation setting. Upon startup (AC Input power recycle), # the output is enabled or disabled according to its last settings record(bi, "PS:LTUS:3:AutoStartMode") { field(DESC, "Auto Start Mode") field(INP, "PS:LTUS:3:OperStatus.B4 MS") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(FLNK, "PS:LTUS:3:FoldBackMode") } # FoldBack protection will shut down the power supply output # if the load current exceeds the Output current limit # setting level. This protection is useful when the load # circuitry is sensitive to an overcurrent condition # # 4/27/2022: K.Luchini - swp ZSV and OSV, so ZSV is not alarmed # becase we want fold back mode to be disabled. record(bi, "PS:LTUS:3:FoldBackMode") { field(DESC, "Fold Back Protection") field(INP, "PS:LTUS:3:OperStatus.B5 MS") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(FLNK, "PS:LTUS:3:Mode") } record(bi, "PS:LTUS:3:Mode") { field(DESC, "Local Mode") field(INP, "PS:LTUS:3:OperStatus.B7 MS") field(ZNAM, "REMOTE") field(ONAM, "LOCAL") field(ZSV, "NO_ALARM") field(OSV, "MINOR") } record(bo, "PS:LTUS:3:FoldBackEnable") { field(DESC, "Fold Back Protection") field(DTYP, "stream") field(OUT, "@mgnt_genesys.proto PSU-setfld(06) LGPS_LTUS_3") field(ZNAM, "OFF") field(ONAM, "ON") } # This command is followed by the address (default=6),and is used # to access the power supply. record(longout, "PS:LTUS:3:Addr") { field(DESC, "Power Supply Address") field(DTYP, "stream") field(OUT, "@mgnt_genesys.proto PSU-comsetadr(06) LGPS_LTUS_3") field(DOL, "06") field(OMSL, "closed_loop") } record(mbbo, "PS:LTUS:3:MsgRespCode") { field(DESC, "Message Resonse Code") field(DTYP, "Raw Soft Channel") field(NOBT, "4") field(ZRST, "OK") field(ONST, "C01") field(TWST, "C02") field(THST, "C03") field(FRST, "C04") field(FVST, "C05") field(SXST, "E01") field(SVST, "E04") field(EIST, "E06") field(NIST, "E07") 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(EIVL, "8") field(NIVL, "9") field(UNSV, "INVALID") field(FLNK, "PS:LTUS:3:MsgResp") } record(mbbi, "PS:LTUS:3:MsgResp") { field(DESC, "Message Response") field(INP, "PS:LTUS:3:MsgRespCode.RVAL NPP MS") field(NOBT, "4") field(ZRST, "OK") field(ONST, "Illegal Command Query") field(TWST, "Missing Parameter") field(THST, "Illegal Parameter") field(FRST, "Checksum Error") field(FVST, "Setting out of range") field(SXST, "Prog Volt Exceeded") field(SVST, "Out Volt below UVL") field(EIST, "UVL above Out Volt") field(NIST, "ON request while Fault") field(ZRST, "NO_ALARM") field(ONST, "MAJOR") field(TWST, "MAJOR") field(THST, "MAJOR") field(FRST, "MAJOR") field(FVST, "MAJOR") field(SXST, "MAJOR") field(SVST, "MAJOR") field(EIST, "MAJOR") field(NIST, "MAJOR") field(UNSV, "INVALID") field(PINI, "YES") } record(stringout, "PS:LTUS:3:GetAnything") { field(DESC, "Get Anything") field(DTYP, "stream") field(OUT, "@mgnt_genesys.proto debug(06) LGPS_LTUS_3") } record(stringout, "PS:LTUS:3:SetAnything") { field(DESC, "Set anything") field(DTYP, "stream") field(OUT, "@mgnt_genesys.proto PSU-set(06) LGPS_LTUS_3") } record(mbbo, "PS:LTUS:3: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, "YES") field(VAL, "3") field(OUT, "LGPS:LTUS:3:COOLING PP") } record(bo, "PS:LTUS:3:RampState") { field(DESC, "PS Ramp Status") field(ZNAM, "OFF") field(ONAM, "BUSY") field(PINI, "YES") field(OUT, "LGPS:LTUS:3:RAMPSTATE PP") } record(stringin, "PS:LTUS:3:Drawing") { field(DESC, "Drawing Number") field(VAL, "PR-376-542-00") field(PINI, "YES") } record(stringin, "PS:LTUS:3:Location") { field(DESC, "Rack Location") field(VAL, "B911-3401") field(PINI, "YES") } record(bo, "PS:LTUS:3:CommLink") { field(DESC, "Communication Link Status") field(PINI, "YES") field(ZNAM, "Offline") field(ONAM, "Online") field(FLNK, "PS:LTUS:3:InitCommLinkCalc") } record(calcout,"PS:LTUS:3:InitCommLinkCalc") { field(DESC, "Init Pvs") field(OOPT, "Transition To Non-zero") field(FLNK, "PS:LTUS:3:InitCommLink") field(ASG, "Internal") } record(dfanout,"PS:LTUS:3:InitCommLink") { field(DESC, "PS Init") field(DOL, "0") field(OMSL, "closed_loop") field(OUTA, "PS:LTUS:3:Addr.PROC PP") field(OUTB, "PS:LTUS:3:State.PROC PP") field(OUTC, "PS:LTUS:3:FaultEnable.PROC PP") field(OUTD, "PS:LTUS:3:StatusEnable.PROC PP") field(OUTE, "PS:LTUS:3:ResetSeq.PROC PP") field(OUTF, "PS:LTUS:3:StatusEvent.PROC PP") field(OUTG, "PS:LTUS:3:OperStatus.PROC PP") field(OUTH, "PS:LTUS:3:IDN.PROC PP") field(FLNK, "PS:LTUS:3:InitCurrSetpt") field(ASG, "Internal") } # Process VSETPT on IOC startup record(seq,"PS:LTUS:3:InitCurrSetpt") { field(DESC, "Init current setpoint") field(DOL1, "0") field(LNK1, "PS:LTUS:3:VoltSetpt.DISV") field(LNK2, "PS:LTUS:3:CurrSetptOut.PROC") field(DOL3, "1") field(LNK3, "PS:LTUS:3:VoltSetpt.DISV") field(ASG, "Internal") } record(bo, "PS:LTUS:4:StateSetpt") { field(DESC, "Power Supply On/Off") field(ZNAM, "OFF") field(ONAM, "ON") } record(bo, "PS:LTUS:4:StateSetptOut") { field(DESC, "Power Supply On/Off") field(DTYP, "stream") field(OUT, "@mgnt_genesys.proto PSU-setonoff(06) LGPS_LTUS_4") field(ZNAM, "OFF") field(ONAM, "ON") field(FLNK, "PS:LTUS:4:State") } record(bi, "PS:LTUS:4:State") { field(DESC, "Power Supply On/Off Status") field(DTYP, "stream") field(INP, "@mgnt_genesys.proto PSU-getonoff(06) LGPS_LTUS_4") field(ZNAM, "OFF") field(ONAM, "ON") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(PINI, "YES") field(FLNK, "LGPS:LTUS:4:STATE NPP MS") } record(calcout, "PS:LTUS:4:StateCheck") { # Do nothing if the state is invalid. # If the state setpoint is invalid, then set state setpoint to state. # If the state and setpoint are the same, set off if state is off, # otherwise, set state setpoint to state. # If the state setpoint has changed, go on or off. Otherwise, the state # must've changed externally so follow it. # field(DESC, "PS State Check") field(CALC, "C=3?0:D=3?3:(A#B)&&(B#E)?B+1:A=0?1:3") field(OUT, "PS:LTUS:4:StateSeq.SELN PP") field(INPA, "PS:LTUS:4:State CPP") field(INPB, "PS:LTUS:4:StateSetpt CPP") field(INPC, "PS:LTUS:4:State.SEVR") field(INPD, "PS:LTUS:4:StateSetpt.SEVR") field(INPE, "PS:LTUS:4:StateCheck.LB") field(ASG, "Internal") } record(seq, "PS:LTUS:4:StateSeq") { field(DESC, "PS State Sequence") field(SELM, "Specified") field(LNK1, "PS:LTUS:4:StateOffSetptSeq.PROC PP") field(LNK2, "PS:LTUS:4:StateOnSetptSeq.PROC PP") field(DOL3, "PS:LTUS:4:State") field(LNK3, "PS:LTUS:4:StateSetptSeq PP") field(ASG, "Internal") } record(seq, "PS:LTUS:4:StateOnSetptSeq") { # When turning on, reset the power supply, # enable foldback protection, set the voltage # and current to max and delay befor setting # the state to 1 (on). # field(DESC, "PS On Sequence") field(LNK1, "PS:LTUS:4:Reset.PROC PP") field(LNK2, "PS:LTUS:4:StateReset.PROC PP") field(DOL3, "1") field(LNK3, "PS:LTUS:4:FoldBackEnable PP") field(DLY4, "0.2") field(DOL4, "LGPS:LTUS:4:BCTRL.HOPR") field(LNK4, "LGPS:LTUS:4:BCTRL PP") field(DLY5, "0.2") field(DOL5, "1") field(LNK5, "PS:LTUS:4:StateSetptSeq PP") field(ASG, "Internal") } record(seq, "PS:LTUS:4:StateOffSetptSeq") { # When turning off, set the voltage and current max and then wait before # before setting the state to 0 (off). # Note: Under normal circumstances you'd set the current and volts to 0, # and wait to allow the supply to ramp down before turning the supply off. # However, power conversion has requested to leave the voltage and current # unchanged before setting the state to 0 (off). # field(DESC, "PS Off Sequence") field(LNK1, "PS:LTUS:4:CurrSetptOut.PROC PP") field(DLY2, "0.2") field(LNK2, "PS:LTUS:4:StateSetptSeq PP") field(ASG, "Internal") } record(seq, "PS:LTUS:4:StateSetptSeq") { # Set both the desired and the actual setpoints to requested. # Renable status events in case of power-cycle. # field(DESC, "PS State Setpt Sequence") field(DOL1, "PS:LTUS:4:StateSetptSeq") field(LNK1, "LGPS:LTUS:4:STATESETPT PP") field(DOL2, "PS:LTUS:4:StateSetptSeq") field(LNK2, "PS:LTUS:4:StateSetpt PP") field(LNK3, "PS:LTUS:4:FaultEnable.PROC PP") field(LNK4, "PS:LTUS:4:StatusEnable.PROC PP") field(LNK5, "PS:LTUS:4:OperStatus.PROC PP") field(LNK6, "PS:LTUS:4:FaultStatus.PROC PP") field(FLNK, "PS:LTUS:4:IDN ") field(ASG, "Internal") } # The reset command brings the power supply to a safe and known state. # Output voltage: zero Remote/Local Mode: non-lockout remote # Output current: zero Auto-Restart Mode: OFF # Output ON/OFF: OFF OVP setting: maximum # FoldbBack ON/OFF: OFF UVL setting: zero # # The condiitional resgisters (FLT and STAT) are updated while other # registers are not changed. # record(bo, "PS:LTUS:4:StateReset") { field(DESC, "Power Supply Reset") field(DTYP, "stream") field(OUT, "@mgnt_genesys.proto PSU-comreset(06) LGPS_LTUS_4") field(ZNAM, "OFF") field(ONAM, "OFF") field(FLNK, "PS:LTUS:4:ResetSeq") } # Returns th power supply model identification as an ascii string: LAMBDA, GENX-Y record (stringin, "PS:LTUS:4:IDN") { field(DESC, "Identification") field(DTYP, "stream") field(INP, "@mgnt_genesys.proto PSU-getidn(06) LGPS_LTUS_4") field(PINI, "YES") field(FLNK, "PS:LTUS:4:SerialNo") } record(stringin, "PS:LTUS:4:SerialNo") { field(DESC, "Serial Number") field(DTYP, "stream") field(INP, "@mgnt_genesys.proto PSU-getsn(06) LGPS_LTUS_4") field(FLNK, "PS:LTUS:4:Revision") } record(stringin, "PS:LTUS:4:Revision") { field(DESC, "Software Revision") field(DTYP, "stream") field(INP, "@mgnt_genesys.proto PSU-getrev(06) LGPS_LTUS_4") } # We aren't interested in current since we are setting voltage. # The current is variable so it's meaningless. record(ai, "PS:LTUS:4:Curr") { field(DESC, "PS Current") field(DTYP, "stream") field(INP, "@mgnt_genesys.proto PSU-getcur(06) LGPS_LTUS_4") field(EGU, "Amps") field(PREC, "3") field(HOPR, "200") field(FLNK, "PS:LTUS:4:ResistanceInp") } record(ao, "PS:LTUS:4:CurrSetpt") { field(DESC, "Current Output") field(DTYP, "stream") field(OUT, "@mgnt_genesys.proto PSU-setcur(06) LGPS_LTUS_4") field(EGU, "Amps") field(PREC, "3") field(HOPR, "200") field(DRVH, "200") field(DOL, "PS:LTUS:4:CurrSetpt.HOPR") field(OMSL, "closed_loop") info(autosaveFields, "VAL") } record(ai, "PS:LTUS:4:CurrSetptRbck") { field(DESC, "Current Output Readback") field(DTYP, "stream") field(INP, "@mgnt_genesys.proto PSU-getsetcur(06) LGPS_LTUS_4") field(EGU, "Amps") field(PREC, "3") field(HOPR, "200") } # Calculate resistance if voltage and current are high enough. # Add smoothing of the resistance value. record(calc, "PS:LTUS:4:ResistanceInp") { field(DESC, "Resistance") field(ASG, "Internal") field(CALC, "B<=0?0:A<0.5?C:((B/A)*(1-D))+(C*D)") field(INPA, "PS:LTUS:4:Curr MS") field(INPB, "PS:LTUS:4:Volt MS") field(INPC, "PS:LTUS:4:ResistanceInp") field(INPD, "PS:LTUS:4:Resistance.D") field(EGU, "Ohm") field(PREC, "4") field(HOPR, "5") field(FLNK, "PS:LTUS:4:Resistance") } # Add offset to resistance for testing purposes. record(calc, "PS:LTUS:4:Resistance") { field(DESC, "Resistance") field(CALC, "C+E") field(INPC, "PS:LTUS:4:ResistanceInp") field(INPD, "0") field(EGU, "Ohm") field(PREC, "4") field(HOPR, "5") } record(ai, "PS:LTUS:4:Volt") { field(DESC, "PS Output Voltage") field(DTYP, "stream") field(INP, "@mgnt_genesys.proto PSU-getvolts(06) LGPS_LTUS_4") field(EGU, "Volts") field(PREC, "3") field(HOPR, "50.0") field(PINI, "YES") field(FLNK, "PS:LTUS:4:CurrAct") } record(ai, "PS:LTUS:4:CurrAct") { field(DESC, "PS Output Current") field(INP, "PS:LTUS:4:Volt NPP MS") field(EGU, "Amps") field(PREC, "3") field(HOPR, "200") field(FLNK, "LGPS:LTUS:4:IACT") } record(ao, "PS:LTUS:4:CurrSetptOut") { field(DESC, "Current to Volt Output") field(EGU, "Amps") field(PREC, "3") field(HOPR, "50.0") field(DRVH, "50.0") field(OUT, "PS:LTUS:4:VoltSetpt PP") info(autosaveFields, "VAL") } record(ao, "PS:LTUS:4:VoltSetpt") { field(DESC, "Voltage Output") field(DTYP, "stream") field(OUT, "@mgnt_genesys.proto PSU-setvolts(06) LGPS_LTUS_4") field(EGU, "Volts") field(PREC, "3") field(HOPR, "50.0") field(DRVH, "50.0") field(FLNK, "PS:LTUS:4:VoltSetptSeq") } record(seq, "PS:LTUS:4:VoltSetptSeq") { field(DESC, "Voltage Output Sequence") field(DLY1, "0.2") field(LNK1, "PS:LTUS:4:CurrSetpt.PROC PP") field(DLY2, "0.2") field(LNK2, "PS:LTUS:4:VoltSetptRbck.PROC PP") field(DLY3, "0.2") field(LNK3, "PS:LTUS:4:CurrSetptRbck.PROC PP") } record(ai, "PS:LTUS:4:VoltSetptRbck") { field(DESC, "Voltage Output Readback") field(DTYP, "stream") field(INP, "@mgnt_genesys.proto PSU-getsetvolts(06) LGPS_LTUS_4") field(EGU, "Volts") field(PREC, "3") field(HOPR, "50.0") field(FLNK, "PS:LTUS:4:CurrSetpt") } # Clear status command. Sets FEVE and SEVE registers to zero. record(bo, "PS:LTUS:4:Reset") { field(DESC, "Clear Errors") field(DTYP, "stream") field(OUT, "@mgnt_genesys.proto PSU-comclr(06) LGPS_LTUS_4") field(ZNAM, "RESET") field(ONAM, "NORESET") field(FLNK, "PS:LTUS:4:ResetSeq") } record(seq, "PS:LTUS:4:ResetSeq") { field(DESC, "Process Events") field(ASG, "Internal") field(LNK1, "PS:LTUS:4:FaultEvent.PROC PP") field(LNK2, "PS:LTUS:4:StatusEvent.PROC PP") } record(fanout, "PS:LTUS:4:UpdateFast") { # Process State before Curr since State may change Curr limits. field(DESC, "Fast Update") field(LNK1, "PS:LTUS:4:Volt.PROC") field(LNK2, "PS:LTUS:4:State.PROC") field(LNK3, "PS:LTUS:4:VoltSetptRbck.PROC") field(LNK4, "PS:LTUS:4:CurrSetptRbck.PROC") field(LNK5, "PS:LTUS:4:Curr.PROC") field(LNK6, "PS:LTUS:4:CurrAct.PROC") field(SCAN, ".5 second") field(DISV, "0") field(SDIS, "PS:LTUS:4:CommLink") field(ASG, "Internal") } record(fanout, "PS:LTUS:4:UpdateSlow") { field(DESC, "Slow Update") field(LNK1, "PS:LTUS:4:StatusEvent.PROC") field(LNK2, "PS:LTUS:4:OperStatus.PROC") field(LNK3, "PS:LTUS:4:FaultStatus.PROC") field(LNK4, "PS:LTUS:4:FaultEvent.PROC") field(SCAN, "2 second") field(DISV, "0") field(SDIS, "PS:LTUS:4:CommLink") field(ASG, "Internal") } # Conditional Registers # The faultconditional and status conditional registers # are read only registers that the uesrs may read to see the # condition of the power supply. # # # Fault Conditional Register record(longout, "PS:LTUS:4:FaultEnable") { field(DESC, "Enable Fault Events") field(DTYP, "stream") field(OUT, "@mgnt_genesys.proto PSU-setfena(06) LGPS_LTUS_4") field(DOL, "254") field(OMSL, "closed_loop") } # Reading the fault event register, clears bits of the fault event register # The fault event will set a bit if a condition occurs and it is Enabled. # The register is cleared when FEVE?, CLS or RST commands are received. record(mbbiDirect, "PS:LTUS:4:FaultEvent") { field(DESC, "Fault Event Register") field(DTYP, "stream") field(INP, "@mgnt_genesys.proto PSU-getfeve(06) LGPS_LTUS_4") } record(mbbiDirect,"PS:LTUS:4:FaultStatus") { field(DESC,"Fault Conditional Register") field(DTYP,"stream") field(INP, "@mgnt_genesys.proto PSU-getflt(06) LGPS_LTUS_4") field(FLNK, "PS:LTUS:4:ACState") } record(bi, "PS:LTUS:4:ACState") { field(DESC, "AC Status") field(INP, "PS:LTUS:4:FaultStatus.B1") field(ZNAM, "OK") field(ONAM, "FAULT") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(FLNK, "PS:LTUS:4:OverTemp") } # The OTP circuit shuts down the power supply before the internal # components can exceed their safe internal operating temperature. # When an OTP shutdown occurs, the VOLTAGE meter displays "O7P" # and the ALARM LED blinks.Resetting the OTP circuit can be # automatic (non-latched) or manual (latched) dependingon the # Safe-Start or AutoRestart mode. # # 1.Safe-Start mode: # In Safe-Start mode, the power supply stays OFF after the over # temperature condition has been removed. The display continues to show \u201cO7P\u201d and the # ALARM LEDcontinues to blink. To reset the OTP circuit, press the OUT # button (or send an OUT ON (OUT 1)command via the RS-232/RS-485 serialcommunicationport). # 2. Auto-Restart mode: # In Auto-Restart mode, the power supply recovers to its last setting # operational automatically when the over temperature condition is removed. # record(bi, "PS:LTUS:4:OverTemp") { field(DESC, "Over Temperature Status") field(INP, "PS:LTUS:4:FaultStatus.B2") field(ZNAM, "OK") field(ONAM, "FAULT") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(FLNK, "PS:LTUS:4:FoldBack") } # The supply output is turned On by front panel # button or OUT 1 command. record(bi, "PS:LTUS:4:FoldBack") { field(DESC, "FoldBack Shutdown") field(INP, "PS:LTUS:4:FaultStatus.B3") field(ZNAM, "OK") field(ONAM, "FAULT") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(FLNK, "PS:LTUS:4:OverVolt") } record(bi, "PS:LTUS:4:OverVolt") { field(DESC, "Over Voltage Status") field(INP, "PS:LTUS:4:FaultStatus.B4") field(ZNAM, "OK") field(ONAM, "FAULT") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(FLNK, "PS:LTUS:4:ShutOff") } record(bi, "PS:LTUS:4:ShutOff") { field(DESC, "J1 Analog In Shut Off") field(INP, "PS:LTUS:4:FaultStatus.B5") field(ZNAM, "OK") field(ONAM, "FAULT") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(FLNK, "PS:LTUS:4:ManualOff") } # The supply output is turned On by front # panel button or OUT 1 command record(bi, "PS:LTUS:4:ManualOff") { field(DESC, "Front Panel Off") field(INP, "PS:LTUS:4:FaultStatus.B6") field(ZNAM, "OK") field(ONAM, "FAULT") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(FLNK, "PS:LTUS:4:OutputState") } record(bi, "PS:LTUS:4:OutputState") { field(DESC, "J1 Analog In Enable Fault") field(INP, "PS:LTUS:4:FaultStatus.B7") field(ZNAM, "OK") field(ONAM, "FAULT") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") } record(calcout, "PS:LTUS:4:LatchedFaultStateCalc") { field(DESC, "Fault Latch Status Calc") field(ASG, "Internal") field(CALC, "(B=3)||(D=3)?0:(A>0)||(C>0)?1:0") field(INPA, "PS:LTUS:4:FaultStatus CPP NMS") field(INPB, "PS:LTUS:4:FaultStatus.SEVR NPP NMS") field(INPC, "PS:LTUS:4:FaultEvent CPP NMS") field(INPD, "PS:LTUS:4:FaultEvent.SEVR NPP NMS") field(OOPT, "Every Time") field(FLNK, "PS:LTUS:4:LatchedFaultState") } record(bi, "PS:LTUS:4:LatchedFaultState") { field(DESC, "Fault Latch Status") field(INP, "PS:LTUS:4:LatchedFaultStateCalc NPP NMS") field(ONAM, "FAULT") field(ZNAM, "OK") field(OSV, "MAJOR") field(ZSV, "NO_ALARM") field(FLNK, "LGPS:LTUS:4:INTLKSUMY PP MS") } # Status Conditional Register is set by the user to Enable # SRQs for changes in power supply status. record(longout, "PS:LTUS:4:StatusEnable") { field(DESC, "Enable Status Events") field(DTYP, "stream") field(OUT, "@mgnt_genesys.proto PSU-setsena(06) LGPS_LTUS_4") field(DOL, "191") field(OMSL, "closed_loop") } # The status event register will set a bit if a change in teh power supply occurs # and it is enabled. The register is clered when teh SEVE? or CLS commands are received. # A change in this register will generate SRQ # # Reading the status event register, clears bits of the status event register record(mbbiDirect, "PS:LTUS:4:StatusEvent") { field(DESC, "Status Event Register") field(DTYP, "stream") field(INP, "@mgnt_genesys.proto PSU-getseve(06) LGPS_LTUS_4") field(FLNK, "PS:LTUS:4:StatusEventSeq") } record(seq, "PS:LTUS:4:StatusEventSeq") { # Process the status event registers that show a fault. # Do nothing if the status byte register is 0. field(DESC, "Process Non-Zero Events") field(ASG, "Internal") field(SELM, "Mask") field(SELL, "PS:LTUS:4:StatusEvent") field(LNK3, "PS:LTUS:4:FaultEvent.PROC PP") field(LNK4, "PS:LTUS:4:FaultEvent.PROC PP") } record(mbbiDirect, "PS:LTUS:4:OperStatus") { field(DESC, "Status Conditional Register") field(DTYP, "stream") field(INP, "@mgnt_genesys.proto PSU-getstat(06) LGPS_LTUS_4") field(PINI, "YES") field(FLNK, "PS:LTUS:4:VoltMode") } record(bi, "PS:LTUS:4:VoltMode") { field(DESC, "Voltage Mode") field(INP, "PS:LTUS:4:OperStatus.B0 MS") field(ZNAM, "Not Constant") field(ONAM, "Constant") field(FLNK, "PS:LTUS:4:CurrMode") } record(bi, "PS:LTUS:4:CurrMode") { field(DESC, "Current Mode") field(INP, "PS:LTUS:4:OperStatus.B1 MS") field(ZNAM, "Not Constant") field(ONAM, "Constant") field(FLNK, "PS:LTUS:4:NoFaultState") } record(bi, "PS:LTUS:4:NoFaultState") { field(DESC, "No Fault Status") field(INP, "PS:LTUS:4:OperStatus.B2 MS") field(ZNAM, "FAULT") field(ONAM, "OK") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(FLNK, "PS:LTUS:4:ActiveFaultState") } record(bi, "PS:LTUS:4:ActiveFaultState") { field(DESC, "Active Fault Status") field(INP, "PS:LTUS:4:OperStatus.B3 MS") field(ZNAM, "OK") field(ONAM, "FAULT") field(ZSV, "NO_ALARM") field(OSV, "NO_ALARM") field(FLNK, "PS:LTUS:4:AutoStartMode") } # In this mode, the power supply restores its last # operation setting. Upon startup (AC Input power recycle), # the output is enabled or disabled according to its last settings record(bi, "PS:LTUS:4:AutoStartMode") { field(DESC, "Auto Start Mode") field(INP, "PS:LTUS:4:OperStatus.B4 MS") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(FLNK, "PS:LTUS:4:FoldBackMode") } # FoldBack protection will shut down the power supply output # if the load current exceeds the Output current limit # setting level. This protection is useful when the load # circuitry is sensitive to an overcurrent condition # # 4/27/2022: K.Luchini - swp ZSV and OSV, so ZSV is not alarmed # becase we want fold back mode to be disabled. record(bi, "PS:LTUS:4:FoldBackMode") { field(DESC, "Fold Back Protection") field(INP, "PS:LTUS:4:OperStatus.B5 MS") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(FLNK, "PS:LTUS:4:Mode") } record(bi, "PS:LTUS:4:Mode") { field(DESC, "Local Mode") field(INP, "PS:LTUS:4:OperStatus.B7 MS") field(ZNAM, "REMOTE") field(ONAM, "LOCAL") field(ZSV, "NO_ALARM") field(OSV, "MINOR") } record(bo, "PS:LTUS:4:FoldBackEnable") { field(DESC, "Fold Back Protection") field(DTYP, "stream") field(OUT, "@mgnt_genesys.proto PSU-setfld(06) LGPS_LTUS_4") field(ZNAM, "OFF") field(ONAM, "ON") } # This command is followed by the address (default=6),and is used # to access the power supply. record(longout, "PS:LTUS:4:Addr") { field(DESC, "Power Supply Address") field(DTYP, "stream") field(OUT, "@mgnt_genesys.proto PSU-comsetadr(06) LGPS_LTUS_4") field(DOL, "06") field(OMSL, "closed_loop") } record(mbbo, "PS:LTUS:4:MsgRespCode") { field(DESC, "Message Resonse Code") field(DTYP, "Raw Soft Channel") field(NOBT, "4") field(ZRST, "OK") field(ONST, "C01") field(TWST, "C02") field(THST, "C03") field(FRST, "C04") field(FVST, "C05") field(SXST, "E01") field(SVST, "E04") field(EIST, "E06") field(NIST, "E07") 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(EIVL, "8") field(NIVL, "9") field(UNSV, "INVALID") field(FLNK, "PS:LTUS:4:MsgResp") } record(mbbi, "PS:LTUS:4:MsgResp") { field(DESC, "Message Response") field(INP, "PS:LTUS:4:MsgRespCode.RVAL NPP MS") field(NOBT, "4") field(ZRST, "OK") field(ONST, "Illegal Command Query") field(TWST, "Missing Parameter") field(THST, "Illegal Parameter") field(FRST, "Checksum Error") field(FVST, "Setting out of range") field(SXST, "Prog Volt Exceeded") field(SVST, "Out Volt below UVL") field(EIST, "UVL above Out Volt") field(NIST, "ON request while Fault") field(ZRST, "NO_ALARM") field(ONST, "MAJOR") field(TWST, "MAJOR") field(THST, "MAJOR") field(FRST, "MAJOR") field(FVST, "MAJOR") field(SXST, "MAJOR") field(SVST, "MAJOR") field(EIST, "MAJOR") field(NIST, "MAJOR") field(UNSV, "INVALID") field(PINI, "YES") } record(stringout, "PS:LTUS:4:GetAnything") { field(DESC, "Get Anything") field(DTYP, "stream") field(OUT, "@mgnt_genesys.proto debug(06) LGPS_LTUS_4") } record(stringout, "PS:LTUS:4:SetAnything") { field(DESC, "Set anything") field(DTYP, "stream") field(OUT, "@mgnt_genesys.proto PSU-set(06) LGPS_LTUS_4") } record(mbbo, "PS:LTUS:4: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, "YES") field(VAL, "3") field(OUT, "LGPS:LTUS:4:COOLING PP") } record(bo, "PS:LTUS:4:RampState") { field(DESC, "PS Ramp Status") field(ZNAM, "OFF") field(ONAM, "BUSY") field(PINI, "YES") field(OUT, "LGPS:LTUS:4:RAMPSTATE PP") } record(stringin, "PS:LTUS:4:Drawing") { field(DESC, "Drawing Number") field(VAL, "PR-376-542-00") field(PINI, "YES") } record(stringin, "PS:LTUS:4:Location") { field(DESC, "Rack Location") field(VAL, "B911-3404") field(PINI, "YES") } record(bo, "PS:LTUS:4:CommLink") { field(DESC, "Communication Link Status") field(PINI, "YES") field(ZNAM, "Offline") field(ONAM, "Online") field(FLNK, "PS:LTUS:4:InitCommLinkCalc") } record(calcout,"PS:LTUS:4:InitCommLinkCalc") { field(DESC, "Init Pvs") field(OOPT, "Transition To Non-zero") field(FLNK, "PS:LTUS:4:InitCommLink") field(ASG, "Internal") } record(dfanout,"PS:LTUS:4:InitCommLink") { field(DESC, "PS Init") field(DOL, "0") field(OMSL, "closed_loop") field(OUTA, "PS:LTUS:4:Addr.PROC PP") field(OUTB, "PS:LTUS:4:State.PROC PP") field(OUTC, "PS:LTUS:4:FaultEnable.PROC PP") field(OUTD, "PS:LTUS:4:StatusEnable.PROC PP") field(OUTE, "PS:LTUS:4:ResetSeq.PROC PP") field(OUTF, "PS:LTUS:4:StatusEvent.PROC PP") field(OUTG, "PS:LTUS:4:OperStatus.PROC PP") field(OUTH, "PS:LTUS:4:IDN.PROC PP") field(FLNK, "PS:LTUS:4:InitCurrSetpt") field(ASG, "Internal") } # Process VSETPT on IOC startup record(seq,"PS:LTUS:4:InitCurrSetpt") { field(DESC, "Init current setpoint") field(DOL1, "0") field(LNK1, "PS:LTUS:4:VoltSetpt.DISV") field(LNK2, "PS:LTUS:4:CurrSetptOut.PROC") field(DOL3, "1") field(LNK3, "PS:LTUS:4:VoltSetpt.DISV") field(ASG, "Internal") } record(bo, "PS:LTUS:5:StateSetpt") { field(DESC, "Power Supply On/Off") field(ZNAM, "OFF") field(ONAM, "ON") } record(bo, "PS:LTUS:5:StateSetptOut") { field(DESC, "Power Supply On/Off") field(DTYP, "stream") field(OUT, "@mgnt_genesys.proto PSU-setonoff(06) LGPS_LTUS_5") field(ZNAM, "OFF") field(ONAM, "ON") field(FLNK, "PS:LTUS:5:State") } record(bi, "PS:LTUS:5:State") { field(DESC, "Power Supply On/Off Status") field(DTYP, "stream") field(INP, "@mgnt_genesys.proto PSU-getonoff(06) LGPS_LTUS_5") field(ZNAM, "OFF") field(ONAM, "ON") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(PINI, "YES") field(FLNK, "LGPS:LTUS:5:STATE NPP MS") } record(calcout, "PS:LTUS:5:StateCheck") { # Do nothing if the state is invalid. # If the state setpoint is invalid, then set state setpoint to state. # If the state and setpoint are the same, set off if state is off, # otherwise, set state setpoint to state. # If the state setpoint has changed, go on or off. Otherwise, the state # must've changed externally so follow it. # field(DESC, "PS State Check") field(CALC, "C=3?0:D=3?3:(A#B)&&(B#E)?B+1:A=0?1:3") field(OUT, "PS:LTUS:5:StateSeq.SELN PP") field(INPA, "PS:LTUS:5:State CPP") field(INPB, "PS:LTUS:5:StateSetpt CPP") field(INPC, "PS:LTUS:5:State.SEVR") field(INPD, "PS:LTUS:5:StateSetpt.SEVR") field(INPE, "PS:LTUS:5:StateCheck.LB") field(ASG, "Internal") } record(seq, "PS:LTUS:5:StateSeq") { field(DESC, "PS State Sequence") field(SELM, "Specified") field(LNK1, "PS:LTUS:5:StateOffSetptSeq.PROC PP") field(LNK2, "PS:LTUS:5:StateOnSetptSeq.PROC PP") field(DOL3, "PS:LTUS:5:State") field(LNK3, "PS:LTUS:5:StateSetptSeq PP") field(ASG, "Internal") } record(seq, "PS:LTUS:5:StateOnSetptSeq") { # When turning on, reset the power supply, # enable foldback protection, set the voltage # and current to max and delay befor setting # the state to 1 (on). # field(DESC, "PS On Sequence") field(LNK1, "PS:LTUS:5:Reset.PROC PP") field(LNK2, "PS:LTUS:5:StateReset.PROC PP") field(DOL3, "1") field(LNK3, "PS:LTUS:5:FoldBackEnable PP") field(DLY4, "0.2") field(DOL4, "LGPS:LTUS:5:BCTRL.HOPR") field(LNK4, "LGPS:LTUS:5:BCTRL PP") field(DLY5, "0.2") field(DOL5, "1") field(LNK5, "PS:LTUS:5:StateSetptSeq PP") field(ASG, "Internal") } record(seq, "PS:LTUS:5:StateOffSetptSeq") { # When turning off, set the voltage and current max and then wait before # before setting the state to 0 (off). # Note: Under normal circumstances you'd set the current and volts to 0, # and wait to allow the supply to ramp down before turning the supply off. # However, power conversion has requested to leave the voltage and current # unchanged before setting the state to 0 (off). # field(DESC, "PS Off Sequence") field(LNK1, "PS:LTUS:5:CurrSetptOut.PROC PP") field(DLY2, "0.2") field(LNK2, "PS:LTUS:5:StateSetptSeq PP") field(ASG, "Internal") } record(seq, "PS:LTUS:5:StateSetptSeq") { # Set both the desired and the actual setpoints to requested. # Renable status events in case of power-cycle. # field(DESC, "PS State Setpt Sequence") field(DOL1, "PS:LTUS:5:StateSetptSeq") field(LNK1, "LGPS:LTUS:5:STATESETPT PP") field(DOL2, "PS:LTUS:5:StateSetptSeq") field(LNK2, "PS:LTUS:5:StateSetpt PP") field(LNK3, "PS:LTUS:5:FaultEnable.PROC PP") field(LNK4, "PS:LTUS:5:StatusEnable.PROC PP") field(LNK5, "PS:LTUS:5:OperStatus.PROC PP") field(LNK6, "PS:LTUS:5:FaultStatus.PROC PP") field(FLNK, "PS:LTUS:5:IDN ") field(ASG, "Internal") } # The reset command brings the power supply to a safe and known state. # Output voltage: zero Remote/Local Mode: non-lockout remote # Output current: zero Auto-Restart Mode: OFF # Output ON/OFF: OFF OVP setting: maximum # FoldbBack ON/OFF: OFF UVL setting: zero # # The condiitional resgisters (FLT and STAT) are updated while other # registers are not changed. # record(bo, "PS:LTUS:5:StateReset") { field(DESC, "Power Supply Reset") field(DTYP, "stream") field(OUT, "@mgnt_genesys.proto PSU-comreset(06) LGPS_LTUS_5") field(ZNAM, "OFF") field(ONAM, "OFF") field(FLNK, "PS:LTUS:5:ResetSeq") } # Returns th power supply model identification as an ascii string: LAMBDA, GENX-Y record (stringin, "PS:LTUS:5:IDN") { field(DESC, "Identification") field(DTYP, "stream") field(INP, "@mgnt_genesys.proto PSU-getidn(06) LGPS_LTUS_5") field(PINI, "YES") field(FLNK, "PS:LTUS:5:SerialNo") } record(stringin, "PS:LTUS:5:SerialNo") { field(DESC, "Serial Number") field(DTYP, "stream") field(INP, "@mgnt_genesys.proto PSU-getsn(06) LGPS_LTUS_5") field(FLNK, "PS:LTUS:5:Revision") } record(stringin, "PS:LTUS:5:Revision") { field(DESC, "Software Revision") field(DTYP, "stream") field(INP, "@mgnt_genesys.proto PSU-getrev(06) LGPS_LTUS_5") } # We aren't interested in current since we are setting voltage. # The current is variable so it's meaningless. record(ai, "PS:LTUS:5:Curr") { field(DESC, "PS Current") field(DTYP, "stream") field(INP, "@mgnt_genesys.proto PSU-getcur(06) LGPS_LTUS_5") field(EGU, "Amps") field(PREC, "3") field(HOPR, "200") field(FLNK, "PS:LTUS:5:ResistanceInp") } record(ao, "PS:LTUS:5:CurrSetpt") { field(DESC, "Current Output") field(DTYP, "stream") field(OUT, "@mgnt_genesys.proto PSU-setcur(06) LGPS_LTUS_5") field(EGU, "Amps") field(PREC, "3") field(HOPR, "200") field(DRVH, "200") field(DOL, "PS:LTUS:5:CurrSetpt.HOPR") field(OMSL, "closed_loop") info(autosaveFields, "VAL") } record(ai, "PS:LTUS:5:CurrSetptRbck") { field(DESC, "Current Output Readback") field(DTYP, "stream") field(INP, "@mgnt_genesys.proto PSU-getsetcur(06) LGPS_LTUS_5") field(EGU, "Amps") field(PREC, "3") field(HOPR, "200") } # Calculate resistance if voltage and current are high enough. # Add smoothing of the resistance value. record(calc, "PS:LTUS:5:ResistanceInp") { field(DESC, "Resistance") field(ASG, "Internal") field(CALC, "B<=0?0:A<0.5?C:((B/A)*(1-D))+(C*D)") field(INPA, "PS:LTUS:5:Curr MS") field(INPB, "PS:LTUS:5:Volt MS") field(INPC, "PS:LTUS:5:ResistanceInp") field(INPD, "PS:LTUS:5:Resistance.D") field(EGU, "Ohm") field(PREC, "4") field(HOPR, "5") field(FLNK, "PS:LTUS:5:Resistance") } # Add offset to resistance for testing purposes. record(calc, "PS:LTUS:5:Resistance") { field(DESC, "Resistance") field(CALC, "C+E") field(INPC, "PS:LTUS:5:ResistanceInp") field(INPD, "0") field(EGU, "Ohm") field(PREC, "4") field(HOPR, "5") } record(ai, "PS:LTUS:5:Volt") { field(DESC, "PS Output Voltage") field(DTYP, "stream") field(INP, "@mgnt_genesys.proto PSU-getvolts(06) LGPS_LTUS_5") field(EGU, "Volts") field(PREC, "3") field(HOPR, "50.0") field(PINI, "YES") field(FLNK, "PS:LTUS:5:CurrAct") } record(ai, "PS:LTUS:5:CurrAct") { field(DESC, "PS Output Current") field(INP, "PS:LTUS:5:Volt NPP MS") field(EGU, "Amps") field(PREC, "3") field(HOPR, "200") field(FLNK, "LGPS:LTUS:5:IACT") } record(ao, "PS:LTUS:5:CurrSetptOut") { field(DESC, "Current to Volt Output") field(EGU, "Amps") field(PREC, "3") field(HOPR, "50.0") field(DRVH, "50.0") field(OUT, "PS:LTUS:5:VoltSetpt PP") info(autosaveFields, "VAL") } record(ao, "PS:LTUS:5:VoltSetpt") { field(DESC, "Voltage Output") field(DTYP, "stream") field(OUT, "@mgnt_genesys.proto PSU-setvolts(06) LGPS_LTUS_5") field(EGU, "Volts") field(PREC, "3") field(HOPR, "50.0") field(DRVH, "50.0") field(FLNK, "PS:LTUS:5:VoltSetptSeq") } record(seq, "PS:LTUS:5:VoltSetptSeq") { field(DESC, "Voltage Output Sequence") field(DLY1, "0.2") field(LNK1, "PS:LTUS:5:CurrSetpt.PROC PP") field(DLY2, "0.2") field(LNK2, "PS:LTUS:5:VoltSetptRbck.PROC PP") field(DLY3, "0.2") field(LNK3, "PS:LTUS:5:CurrSetptRbck.PROC PP") } record(ai, "PS:LTUS:5:VoltSetptRbck") { field(DESC, "Voltage Output Readback") field(DTYP, "stream") field(INP, "@mgnt_genesys.proto PSU-getsetvolts(06) LGPS_LTUS_5") field(EGU, "Volts") field(PREC, "3") field(HOPR, "50.0") field(FLNK, "PS:LTUS:5:CurrSetpt") } # Clear status command. Sets FEVE and SEVE registers to zero. record(bo, "PS:LTUS:5:Reset") { field(DESC, "Clear Errors") field(DTYP, "stream") field(OUT, "@mgnt_genesys.proto PSU-comclr(06) LGPS_LTUS_5") field(ZNAM, "RESET") field(ONAM, "NORESET") field(FLNK, "PS:LTUS:5:ResetSeq") } record(seq, "PS:LTUS:5:ResetSeq") { field(DESC, "Process Events") field(ASG, "Internal") field(LNK1, "PS:LTUS:5:FaultEvent.PROC PP") field(LNK2, "PS:LTUS:5:StatusEvent.PROC PP") } record(fanout, "PS:LTUS:5:UpdateFast") { # Process State before Curr since State may change Curr limits. field(DESC, "Fast Update") field(LNK1, "PS:LTUS:5:Volt.PROC") field(LNK2, "PS:LTUS:5:State.PROC") field(LNK3, "PS:LTUS:5:VoltSetptRbck.PROC") field(LNK4, "PS:LTUS:5:CurrSetptRbck.PROC") field(LNK5, "PS:LTUS:5:Curr.PROC") field(LNK6, "PS:LTUS:5:CurrAct.PROC") field(SCAN, ".5 second") field(DISV, "0") field(SDIS, "PS:LTUS:5:CommLink") field(ASG, "Internal") } record(fanout, "PS:LTUS:5:UpdateSlow") { field(DESC, "Slow Update") field(LNK1, "PS:LTUS:5:StatusEvent.PROC") field(LNK2, "PS:LTUS:5:OperStatus.PROC") field(LNK3, "PS:LTUS:5:FaultStatus.PROC") field(LNK4, "PS:LTUS:5:FaultEvent.PROC") field(SCAN, "2 second") field(DISV, "0") field(SDIS, "PS:LTUS:5:CommLink") field(ASG, "Internal") } # Conditional Registers # The faultconditional and status conditional registers # are read only registers that the uesrs may read to see the # condition of the power supply. # # # Fault Conditional Register record(longout, "PS:LTUS:5:FaultEnable") { field(DESC, "Enable Fault Events") field(DTYP, "stream") field(OUT, "@mgnt_genesys.proto PSU-setfena(06) LGPS_LTUS_5") field(DOL, "254") field(OMSL, "closed_loop") } # Reading the fault event register, clears bits of the fault event register # The fault event will set a bit if a condition occurs and it is Enabled. # The register is cleared when FEVE?, CLS or RST commands are received. record(mbbiDirect, "PS:LTUS:5:FaultEvent") { field(DESC, "Fault Event Register") field(DTYP, "stream") field(INP, "@mgnt_genesys.proto PSU-getfeve(06) LGPS_LTUS_5") } record(mbbiDirect,"PS:LTUS:5:FaultStatus") { field(DESC,"Fault Conditional Register") field(DTYP,"stream") field(INP, "@mgnt_genesys.proto PSU-getflt(06) LGPS_LTUS_5") field(FLNK, "PS:LTUS:5:ACState") } record(bi, "PS:LTUS:5:ACState") { field(DESC, "AC Status") field(INP, "PS:LTUS:5:FaultStatus.B1") field(ZNAM, "OK") field(ONAM, "FAULT") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(FLNK, "PS:LTUS:5:OverTemp") } # The OTP circuit shuts down the power supply before the internal # components can exceed their safe internal operating temperature. # When an OTP shutdown occurs, the VOLTAGE meter displays "O7P" # and the ALARM LED blinks.Resetting the OTP circuit can be # automatic (non-latched) or manual (latched) dependingon the # Safe-Start or AutoRestart mode. # # 1.Safe-Start mode: # In Safe-Start mode, the power supply stays OFF after the over # temperature condition has been removed. The display continues to show \u201cO7P\u201d and the # ALARM LEDcontinues to blink. To reset the OTP circuit, press the OUT # button (or send an OUT ON (OUT 1)command via the RS-232/RS-485 serialcommunicationport). # 2. Auto-Restart mode: # In Auto-Restart mode, the power supply recovers to its last setting # operational automatically when the over temperature condition is removed. # record(bi, "PS:LTUS:5:OverTemp") { field(DESC, "Over Temperature Status") field(INP, "PS:LTUS:5:FaultStatus.B2") field(ZNAM, "OK") field(ONAM, "FAULT") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(FLNK, "PS:LTUS:5:FoldBack") } # The supply output is turned On by front panel # button or OUT 1 command. record(bi, "PS:LTUS:5:FoldBack") { field(DESC, "FoldBack Shutdown") field(INP, "PS:LTUS:5:FaultStatus.B3") field(ZNAM, "OK") field(ONAM, "FAULT") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(FLNK, "PS:LTUS:5:OverVolt") } record(bi, "PS:LTUS:5:OverVolt") { field(DESC, "Over Voltage Status") field(INP, "PS:LTUS:5:FaultStatus.B4") field(ZNAM, "OK") field(ONAM, "FAULT") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(FLNK, "PS:LTUS:5:ShutOff") } record(bi, "PS:LTUS:5:ShutOff") { field(DESC, "J1 Analog In Shut Off") field(INP, "PS:LTUS:5:FaultStatus.B5") field(ZNAM, "OK") field(ONAM, "FAULT") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(FLNK, "PS:LTUS:5:ManualOff") } # The supply output is turned On by front # panel button or OUT 1 command record(bi, "PS:LTUS:5:ManualOff") { field(DESC, "Front Panel Off") field(INP, "PS:LTUS:5:FaultStatus.B6") field(ZNAM, "OK") field(ONAM, "FAULT") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(FLNK, "PS:LTUS:5:OutputState") } record(bi, "PS:LTUS:5:OutputState") { field(DESC, "J1 Analog In Enable Fault") field(INP, "PS:LTUS:5:FaultStatus.B7") field(ZNAM, "OK") field(ONAM, "FAULT") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") } record(calcout, "PS:LTUS:5:LatchedFaultStateCalc") { field(DESC, "Fault Latch Status Calc") field(ASG, "Internal") field(CALC, "(B=3)||(D=3)?0:(A>0)||(C>0)?1:0") field(INPA, "PS:LTUS:5:FaultStatus CPP NMS") field(INPB, "PS:LTUS:5:FaultStatus.SEVR NPP NMS") field(INPC, "PS:LTUS:5:FaultEvent CPP NMS") field(INPD, "PS:LTUS:5:FaultEvent.SEVR NPP NMS") field(OOPT, "Every Time") field(FLNK, "PS:LTUS:5:LatchedFaultState") } record(bi, "PS:LTUS:5:LatchedFaultState") { field(DESC, "Fault Latch Status") field(INP, "PS:LTUS:5:LatchedFaultStateCalc NPP NMS") field(ONAM, "FAULT") field(ZNAM, "OK") field(OSV, "MAJOR") field(ZSV, "NO_ALARM") field(FLNK, "LGPS:LTUS:5:INTLKSUMY PP MS") } # Status Conditional Register is set by the user to Enable # SRQs for changes in power supply status. record(longout, "PS:LTUS:5:StatusEnable") { field(DESC, "Enable Status Events") field(DTYP, "stream") field(OUT, "@mgnt_genesys.proto PSU-setsena(06) LGPS_LTUS_5") field(DOL, "191") field(OMSL, "closed_loop") } # The status event register will set a bit if a change in teh power supply occurs # and it is enabled. The register is clered when teh SEVE? or CLS commands are received. # A change in this register will generate SRQ # # Reading the status event register, clears bits of the status event register record(mbbiDirect, "PS:LTUS:5:StatusEvent") { field(DESC, "Status Event Register") field(DTYP, "stream") field(INP, "@mgnt_genesys.proto PSU-getseve(06) LGPS_LTUS_5") field(FLNK, "PS:LTUS:5:StatusEventSeq") } record(seq, "PS:LTUS:5:StatusEventSeq") { # Process the status event registers that show a fault. # Do nothing if the status byte register is 0. field(DESC, "Process Non-Zero Events") field(ASG, "Internal") field(SELM, "Mask") field(SELL, "PS:LTUS:5:StatusEvent") field(LNK3, "PS:LTUS:5:FaultEvent.PROC PP") field(LNK4, "PS:LTUS:5:FaultEvent.PROC PP") } record(mbbiDirect, "PS:LTUS:5:OperStatus") { field(DESC, "Status Conditional Register") field(DTYP, "stream") field(INP, "@mgnt_genesys.proto PSU-getstat(06) LGPS_LTUS_5") field(PINI, "YES") field(FLNK, "PS:LTUS:5:VoltMode") } record(bi, "PS:LTUS:5:VoltMode") { field(DESC, "Voltage Mode") field(INP, "PS:LTUS:5:OperStatus.B0 MS") field(ZNAM, "Not Constant") field(ONAM, "Constant") field(FLNK, "PS:LTUS:5:CurrMode") } record(bi, "PS:LTUS:5:CurrMode") { field(DESC, "Current Mode") field(INP, "PS:LTUS:5:OperStatus.B1 MS") field(ZNAM, "Not Constant") field(ONAM, "Constant") field(FLNK, "PS:LTUS:5:NoFaultState") } record(bi, "PS:LTUS:5:NoFaultState") { field(DESC, "No Fault Status") field(INP, "PS:LTUS:5:OperStatus.B2 MS") field(ZNAM, "FAULT") field(ONAM, "OK") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(FLNK, "PS:LTUS:5:ActiveFaultState") } record(bi, "PS:LTUS:5:ActiveFaultState") { field(DESC, "Active Fault Status") field(INP, "PS:LTUS:5:OperStatus.B3 MS") field(ZNAM, "OK") field(ONAM, "FAULT") field(ZSV, "NO_ALARM") field(OSV, "NO_ALARM") field(FLNK, "PS:LTUS:5:AutoStartMode") } # In this mode, the power supply restores its last # operation setting. Upon startup (AC Input power recycle), # the output is enabled or disabled according to its last settings record(bi, "PS:LTUS:5:AutoStartMode") { field(DESC, "Auto Start Mode") field(INP, "PS:LTUS:5:OperStatus.B4 MS") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(FLNK, "PS:LTUS:5:FoldBackMode") } # FoldBack protection will shut down the power supply output # if the load current exceeds the Output current limit # setting level. This protection is useful when the load # circuitry is sensitive to an overcurrent condition # # 4/27/2022: K.Luchini - swp ZSV and OSV, so ZSV is not alarmed # becase we want fold back mode to be disabled. record(bi, "PS:LTUS:5:FoldBackMode") { field(DESC, "Fold Back Protection") field(INP, "PS:LTUS:5:OperStatus.B5 MS") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(FLNK, "PS:LTUS:5:Mode") } record(bi, "PS:LTUS:5:Mode") { field(DESC, "Local Mode") field(INP, "PS:LTUS:5:OperStatus.B7 MS") field(ZNAM, "REMOTE") field(ONAM, "LOCAL") field(ZSV, "NO_ALARM") field(OSV, "MINOR") } record(bo, "PS:LTUS:5:FoldBackEnable") { field(DESC, "Fold Back Protection") field(DTYP, "stream") field(OUT, "@mgnt_genesys.proto PSU-setfld(06) LGPS_LTUS_5") field(ZNAM, "OFF") field(ONAM, "ON") } # This command is followed by the address (default=6),and is used # to access the power supply. record(longout, "PS:LTUS:5:Addr") { field(DESC, "Power Supply Address") field(DTYP, "stream") field(OUT, "@mgnt_genesys.proto PSU-comsetadr(06) LGPS_LTUS_5") field(DOL, "06") field(OMSL, "closed_loop") } record(mbbo, "PS:LTUS:5:MsgRespCode") { field(DESC, "Message Resonse Code") field(DTYP, "Raw Soft Channel") field(NOBT, "4") field(ZRST, "OK") field(ONST, "C01") field(TWST, "C02") field(THST, "C03") field(FRST, "C04") field(FVST, "C05") field(SXST, "E01") field(SVST, "E04") field(EIST, "E06") field(NIST, "E07") 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(EIVL, "8") field(NIVL, "9") field(UNSV, "INVALID") field(FLNK, "PS:LTUS:5:MsgResp") } record(mbbi, "PS:LTUS:5:MsgResp") { field(DESC, "Message Response") field(INP, "PS:LTUS:5:MsgRespCode.RVAL NPP MS") field(NOBT, "4") field(ZRST, "OK") field(ONST, "Illegal Command Query") field(TWST, "Missing Parameter") field(THST, "Illegal Parameter") field(FRST, "Checksum Error") field(FVST, "Setting out of range") field(SXST, "Prog Volt Exceeded") field(SVST, "Out Volt below UVL") field(EIST, "UVL above Out Volt") field(NIST, "ON request while Fault") field(ZRST, "NO_ALARM") field(ONST, "MAJOR") field(TWST, "MAJOR") field(THST, "MAJOR") field(FRST, "MAJOR") field(FVST, "MAJOR") field(SXST, "MAJOR") field(SVST, "MAJOR") field(EIST, "MAJOR") field(NIST, "MAJOR") field(UNSV, "INVALID") field(PINI, "YES") } record(stringout, "PS:LTUS:5:GetAnything") { field(DESC, "Get Anything") field(DTYP, "stream") field(OUT, "@mgnt_genesys.proto debug(06) LGPS_LTUS_5") } record(stringout, "PS:LTUS:5:SetAnything") { field(DESC, "Set anything") field(DTYP, "stream") field(OUT, "@mgnt_genesys.proto PSU-set(06) LGPS_LTUS_5") } record(mbbo, "PS:LTUS:5: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, "YES") field(VAL, "3") field(OUT, "LGPS:LTUS:5:COOLING PP") } record(bo, "PS:LTUS:5:RampState") { field(DESC, "PS Ramp Status") field(ZNAM, "OFF") field(ONAM, "BUSY") field(PINI, "YES") field(OUT, "LGPS:LTUS:5:RAMPSTATE PP") } record(stringin, "PS:LTUS:5:Drawing") { field(DESC, "Drawing Number") field(VAL, "PR-376-542-00") field(PINI, "YES") } record(stringin, "PS:LTUS:5:Location") { field(DESC, "Rack Location") field(VAL, "B911-3501") field(PINI, "YES") } record(bo, "PS:LTUS:5:CommLink") { field(DESC, "Communication Link Status") field(PINI, "YES") field(ZNAM, "Offline") field(ONAM, "Online") field(FLNK, "PS:LTUS:5:InitCommLinkCalc") } record(calcout,"PS:LTUS:5:InitCommLinkCalc") { field(DESC, "Init Pvs") field(OOPT, "Transition To Non-zero") field(FLNK, "PS:LTUS:5:InitCommLink") field(ASG, "Internal") } record(dfanout,"PS:LTUS:5:InitCommLink") { field(DESC, "PS Init") field(DOL, "0") field(OMSL, "closed_loop") field(OUTA, "PS:LTUS:5:Addr.PROC PP") field(OUTB, "PS:LTUS:5:State.PROC PP") field(OUTC, "PS:LTUS:5:FaultEnable.PROC PP") field(OUTD, "PS:LTUS:5:StatusEnable.PROC PP") field(OUTE, "PS:LTUS:5:ResetSeq.PROC PP") field(OUTF, "PS:LTUS:5:StatusEvent.PROC PP") field(OUTG, "PS:LTUS:5:OperStatus.PROC PP") field(OUTH, "PS:LTUS:5:IDN.PROC PP") field(FLNK, "PS:LTUS:5:InitCurrSetpt") field(ASG, "Internal") } # Process VSETPT on IOC startup record(seq,"PS:LTUS:5:InitCurrSetpt") { field(DESC, "Init current setpoint") field(DOL1, "0") field(LNK1, "PS:LTUS:5:VoltSetpt.DISV") field(LNK2, "PS:LTUS:5:CurrSetptOut.PROC") field(DOL3, "1") field(LNK3, "PS:LTUS:5:VoltSetpt.DISV") field(ASG, "Internal") } record(bo, "PS:LTUS:6:StateSetpt") { field(DESC, "Power Supply On/Off") field(ZNAM, "OFF") field(ONAM, "ON") } record(bo, "PS:LTUS:6:StateSetptOut") { field(DESC, "Power Supply On/Off") field(DTYP, "stream") field(OUT, "@mgnt_genesys.proto PSU-setonoff(06) LGPS_LTUS_6") field(ZNAM, "OFF") field(ONAM, "ON") field(FLNK, "PS:LTUS:6:State") } record(bi, "PS:LTUS:6:State") { field(DESC, "Power Supply On/Off Status") field(DTYP, "stream") field(INP, "@mgnt_genesys.proto PSU-getonoff(06) LGPS_LTUS_6") field(ZNAM, "OFF") field(ONAM, "ON") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(PINI, "YES") field(FLNK, "LGPS:LTUS:6:STATE NPP MS") } record(calcout, "PS:LTUS:6:StateCheck") { # Do nothing if the state is invalid. # If the state setpoint is invalid, then set state setpoint to state. # If the state and setpoint are the same, set off if state is off, # otherwise, set state setpoint to state. # If the state setpoint has changed, go on or off. Otherwise, the state # must've changed externally so follow it. # field(DESC, "PS State Check") field(CALC, "C=3?0:D=3?3:(A#B)&&(B#E)?B+1:A=0?1:3") field(OUT, "PS:LTUS:6:StateSeq.SELN PP") field(INPA, "PS:LTUS:6:State CPP") field(INPB, "PS:LTUS:6:StateSetpt CPP") field(INPC, "PS:LTUS:6:State.SEVR") field(INPD, "PS:LTUS:6:StateSetpt.SEVR") field(INPE, "PS:LTUS:6:StateCheck.LB") field(ASG, "Internal") } record(seq, "PS:LTUS:6:StateSeq") { field(DESC, "PS State Sequence") field(SELM, "Specified") field(LNK1, "PS:LTUS:6:StateOffSetptSeq.PROC PP") field(LNK2, "PS:LTUS:6:StateOnSetptSeq.PROC PP") field(DOL3, "PS:LTUS:6:State") field(LNK3, "PS:LTUS:6:StateSetptSeq PP") field(ASG, "Internal") } record(seq, "PS:LTUS:6:StateOnSetptSeq") { # When turning on, reset the power supply, # enable foldback protection, set the voltage # and current to max and delay befor setting # the state to 1 (on). # field(DESC, "PS On Sequence") field(LNK1, "PS:LTUS:6:Reset.PROC PP") field(LNK2, "PS:LTUS:6:StateReset.PROC PP") field(DOL3, "1") field(LNK3, "PS:LTUS:6:FoldBackEnable PP") field(DLY4, "0.2") field(DOL4, "LGPS:LTUS:6:BCTRL.HOPR") field(LNK4, "LGPS:LTUS:6:BCTRL PP") field(DLY5, "0.2") field(DOL5, "1") field(LNK5, "PS:LTUS:6:StateSetptSeq PP") field(ASG, "Internal") } record(seq, "PS:LTUS:6:StateOffSetptSeq") { # When turning off, set the voltage and current max and then wait before # before setting the state to 0 (off). # Note: Under normal circumstances you'd set the current and volts to 0, # and wait to allow the supply to ramp down before turning the supply off. # However, power conversion has requested to leave the voltage and current # unchanged before setting the state to 0 (off). # field(DESC, "PS Off Sequence") field(LNK1, "PS:LTUS:6:CurrSetptOut.PROC PP") field(DLY2, "0.2") field(LNK2, "PS:LTUS:6:StateSetptSeq PP") field(ASG, "Internal") } record(seq, "PS:LTUS:6:StateSetptSeq") { # Set both the desired and the actual setpoints to requested. # Renable status events in case of power-cycle. # field(DESC, "PS State Setpt Sequence") field(DOL1, "PS:LTUS:6:StateSetptSeq") field(LNK1, "LGPS:LTUS:6:STATESETPT PP") field(DOL2, "PS:LTUS:6:StateSetptSeq") field(LNK2, "PS:LTUS:6:StateSetpt PP") field(LNK3, "PS:LTUS:6:FaultEnable.PROC PP") field(LNK4, "PS:LTUS:6:StatusEnable.PROC PP") field(LNK5, "PS:LTUS:6:OperStatus.PROC PP") field(LNK6, "PS:LTUS:6:FaultStatus.PROC PP") field(FLNK, "PS:LTUS:6:IDN ") field(ASG, "Internal") } # The reset command brings the power supply to a safe and known state. # Output voltage: zero Remote/Local Mode: non-lockout remote # Output current: zero Auto-Restart Mode: OFF # Output ON/OFF: OFF OVP setting: maximum # FoldbBack ON/OFF: OFF UVL setting: zero # # The condiitional resgisters (FLT and STAT) are updated while other # registers are not changed. # record(bo, "PS:LTUS:6:StateReset") { field(DESC, "Power Supply Reset") field(DTYP, "stream") field(OUT, "@mgnt_genesys.proto PSU-comreset(06) LGPS_LTUS_6") field(ZNAM, "OFF") field(ONAM, "OFF") field(FLNK, "PS:LTUS:6:ResetSeq") } # Returns th power supply model identification as an ascii string: LAMBDA, GENX-Y record (stringin, "PS:LTUS:6:IDN") { field(DESC, "Identification") field(DTYP, "stream") field(INP, "@mgnt_genesys.proto PSU-getidn(06) LGPS_LTUS_6") field(PINI, "YES") field(FLNK, "PS:LTUS:6:SerialNo") } record(stringin, "PS:LTUS:6:SerialNo") { field(DESC, "Serial Number") field(DTYP, "stream") field(INP, "@mgnt_genesys.proto PSU-getsn(06) LGPS_LTUS_6") field(FLNK, "PS:LTUS:6:Revision") } record(stringin, "PS:LTUS:6:Revision") { field(DESC, "Software Revision") field(DTYP, "stream") field(INP, "@mgnt_genesys.proto PSU-getrev(06) LGPS_LTUS_6") } # We aren't interested in current since we are setting voltage. # The current is variable so it's meaningless. record(ai, "PS:LTUS:6:Curr") { field(DESC, "PS Current") field(DTYP, "stream") field(INP, "@mgnt_genesys.proto PSU-getcur(06) LGPS_LTUS_6") field(EGU, "Amps") field(PREC, "3") field(HOPR, "200") field(FLNK, "PS:LTUS:6:ResistanceInp") } record(ao, "PS:LTUS:6:CurrSetpt") { field(DESC, "Current Output") field(DTYP, "stream") field(OUT, "@mgnt_genesys.proto PSU-setcur(06) LGPS_LTUS_6") field(EGU, "Amps") field(PREC, "3") field(HOPR, "200") field(DRVH, "200") field(DOL, "PS:LTUS:6:CurrSetpt.HOPR") field(OMSL, "closed_loop") info(autosaveFields, "VAL") } record(ai, "PS:LTUS:6:CurrSetptRbck") { field(DESC, "Current Output Readback") field(DTYP, "stream") field(INP, "@mgnt_genesys.proto PSU-getsetcur(06) LGPS_LTUS_6") field(EGU, "Amps") field(PREC, "3") field(HOPR, "200") } # Calculate resistance if voltage and current are high enough. # Add smoothing of the resistance value. record(calc, "PS:LTUS:6:ResistanceInp") { field(DESC, "Resistance") field(ASG, "Internal") field(CALC, "B<=0?0:A<0.5?C:((B/A)*(1-D))+(C*D)") field(INPA, "PS:LTUS:6:Curr MS") field(INPB, "PS:LTUS:6:Volt MS") field(INPC, "PS:LTUS:6:ResistanceInp") field(INPD, "PS:LTUS:6:Resistance.D") field(EGU, "Ohm") field(PREC, "4") field(HOPR, "5") field(FLNK, "PS:LTUS:6:Resistance") } # Add offset to resistance for testing purposes. record(calc, "PS:LTUS:6:Resistance") { field(DESC, "Resistance") field(CALC, "C+E") field(INPC, "PS:LTUS:6:ResistanceInp") field(INPD, "0") field(EGU, "Ohm") field(PREC, "4") field(HOPR, "5") } record(ai, "PS:LTUS:6:Volt") { field(DESC, "PS Output Voltage") field(DTYP, "stream") field(INP, "@mgnt_genesys.proto PSU-getvolts(06) LGPS_LTUS_6") field(EGU, "Volts") field(PREC, "3") field(HOPR, "50.0") field(PINI, "YES") field(FLNK, "PS:LTUS:6:CurrAct") } record(ai, "PS:LTUS:6:CurrAct") { field(DESC, "PS Output Current") field(INP, "PS:LTUS:6:Volt NPP MS") field(EGU, "Amps") field(PREC, "3") field(HOPR, "200") field(FLNK, "LGPS:LTUS:6:IACT") } record(ao, "PS:LTUS:6:CurrSetptOut") { field(DESC, "Current to Volt Output") field(EGU, "Amps") field(PREC, "3") field(HOPR, "50.0") field(DRVH, "50.0") field(OUT, "PS:LTUS:6:VoltSetpt PP") info(autosaveFields, "VAL") } record(ao, "PS:LTUS:6:VoltSetpt") { field(DESC, "Voltage Output") field(DTYP, "stream") field(OUT, "@mgnt_genesys.proto PSU-setvolts(06) LGPS_LTUS_6") field(EGU, "Volts") field(PREC, "3") field(HOPR, "50.0") field(DRVH, "50.0") field(FLNK, "PS:LTUS:6:VoltSetptSeq") } record(seq, "PS:LTUS:6:VoltSetptSeq") { field(DESC, "Voltage Output Sequence") field(DLY1, "0.2") field(LNK1, "PS:LTUS:6:CurrSetpt.PROC PP") field(DLY2, "0.2") field(LNK2, "PS:LTUS:6:VoltSetptRbck.PROC PP") field(DLY3, "0.2") field(LNK3, "PS:LTUS:6:CurrSetptRbck.PROC PP") } record(ai, "PS:LTUS:6:VoltSetptRbck") { field(DESC, "Voltage Output Readback") field(DTYP, "stream") field(INP, "@mgnt_genesys.proto PSU-getsetvolts(06) LGPS_LTUS_6") field(EGU, "Volts") field(PREC, "3") field(HOPR, "50.0") field(FLNK, "PS:LTUS:6:CurrSetpt") } # Clear status command. Sets FEVE and SEVE registers to zero. record(bo, "PS:LTUS:6:Reset") { field(DESC, "Clear Errors") field(DTYP, "stream") field(OUT, "@mgnt_genesys.proto PSU-comclr(06) LGPS_LTUS_6") field(ZNAM, "RESET") field(ONAM, "NORESET") field(FLNK, "PS:LTUS:6:ResetSeq") } record(seq, "PS:LTUS:6:ResetSeq") { field(DESC, "Process Events") field(ASG, "Internal") field(LNK1, "PS:LTUS:6:FaultEvent.PROC PP") field(LNK2, "PS:LTUS:6:StatusEvent.PROC PP") } record(fanout, "PS:LTUS:6:UpdateFast") { # Process State before Curr since State may change Curr limits. field(DESC, "Fast Update") field(LNK1, "PS:LTUS:6:Volt.PROC") field(LNK2, "PS:LTUS:6:State.PROC") field(LNK3, "PS:LTUS:6:VoltSetptRbck.PROC") field(LNK4, "PS:LTUS:6:CurrSetptRbck.PROC") field(LNK5, "PS:LTUS:6:Curr.PROC") field(LNK6, "PS:LTUS:6:CurrAct.PROC") field(SCAN, ".5 second") field(DISV, "0") field(SDIS, "PS:LTUS:6:CommLink") field(ASG, "Internal") } record(fanout, "PS:LTUS:6:UpdateSlow") { field(DESC, "Slow Update") field(LNK1, "PS:LTUS:6:StatusEvent.PROC") field(LNK2, "PS:LTUS:6:OperStatus.PROC") field(LNK3, "PS:LTUS:6:FaultStatus.PROC") field(LNK4, "PS:LTUS:6:FaultEvent.PROC") field(SCAN, "2 second") field(DISV, "0") field(SDIS, "PS:LTUS:6:CommLink") field(ASG, "Internal") } # Conditional Registers # The faultconditional and status conditional registers # are read only registers that the uesrs may read to see the # condition of the power supply. # # # Fault Conditional Register record(longout, "PS:LTUS:6:FaultEnable") { field(DESC, "Enable Fault Events") field(DTYP, "stream") field(OUT, "@mgnt_genesys.proto PSU-setfena(06) LGPS_LTUS_6") field(DOL, "254") field(OMSL, "closed_loop") } # Reading the fault event register, clears bits of the fault event register # The fault event will set a bit if a condition occurs and it is Enabled. # The register is cleared when FEVE?, CLS or RST commands are received. record(mbbiDirect, "PS:LTUS:6:FaultEvent") { field(DESC, "Fault Event Register") field(DTYP, "stream") field(INP, "@mgnt_genesys.proto PSU-getfeve(06) LGPS_LTUS_6") } record(mbbiDirect,"PS:LTUS:6:FaultStatus") { field(DESC,"Fault Conditional Register") field(DTYP,"stream") field(INP, "@mgnt_genesys.proto PSU-getflt(06) LGPS_LTUS_6") field(FLNK, "PS:LTUS:6:ACState") } record(bi, "PS:LTUS:6:ACState") { field(DESC, "AC Status") field(INP, "PS:LTUS:6:FaultStatus.B1") field(ZNAM, "OK") field(ONAM, "FAULT") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(FLNK, "PS:LTUS:6:OverTemp") } # The OTP circuit shuts down the power supply before the internal # components can exceed their safe internal operating temperature. # When an OTP shutdown occurs, the VOLTAGE meter displays "O7P" # and the ALARM LED blinks.Resetting the OTP circuit can be # automatic (non-latched) or manual (latched) dependingon the # Safe-Start or AutoRestart mode. # # 1.Safe-Start mode: # In Safe-Start mode, the power supply stays OFF after the over # temperature condition has been removed. The display continues to show \u201cO7P\u201d and the # ALARM LEDcontinues to blink. To reset the OTP circuit, press the OUT # button (or send an OUT ON (OUT 1)command via the RS-232/RS-485 serialcommunicationport). # 2. Auto-Restart mode: # In Auto-Restart mode, the power supply recovers to its last setting # operational automatically when the over temperature condition is removed. # record(bi, "PS:LTUS:6:OverTemp") { field(DESC, "Over Temperature Status") field(INP, "PS:LTUS:6:FaultStatus.B2") field(ZNAM, "OK") field(ONAM, "FAULT") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(FLNK, "PS:LTUS:6:FoldBack") } # The supply output is turned On by front panel # button or OUT 1 command. record(bi, "PS:LTUS:6:FoldBack") { field(DESC, "FoldBack Shutdown") field(INP, "PS:LTUS:6:FaultStatus.B3") field(ZNAM, "OK") field(ONAM, "FAULT") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(FLNK, "PS:LTUS:6:OverVolt") } record(bi, "PS:LTUS:6:OverVolt") { field(DESC, "Over Voltage Status") field(INP, "PS:LTUS:6:FaultStatus.B4") field(ZNAM, "OK") field(ONAM, "FAULT") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(FLNK, "PS:LTUS:6:ShutOff") } record(bi, "PS:LTUS:6:ShutOff") { field(DESC, "J1 Analog In Shut Off") field(INP, "PS:LTUS:6:FaultStatus.B5") field(ZNAM, "OK") field(ONAM, "FAULT") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(FLNK, "PS:LTUS:6:ManualOff") } # The supply output is turned On by front # panel button or OUT 1 command record(bi, "PS:LTUS:6:ManualOff") { field(DESC, "Front Panel Off") field(INP, "PS:LTUS:6:FaultStatus.B6") field(ZNAM, "OK") field(ONAM, "FAULT") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(FLNK, "PS:LTUS:6:OutputState") } record(bi, "PS:LTUS:6:OutputState") { field(DESC, "J1 Analog In Enable Fault") field(INP, "PS:LTUS:6:FaultStatus.B7") field(ZNAM, "OK") field(ONAM, "FAULT") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") } record(calcout, "PS:LTUS:6:LatchedFaultStateCalc") { field(DESC, "Fault Latch Status Calc") field(ASG, "Internal") field(CALC, "(B=3)||(D=3)?0:(A>0)||(C>0)?1:0") field(INPA, "PS:LTUS:6:FaultStatus CPP NMS") field(INPB, "PS:LTUS:6:FaultStatus.SEVR NPP NMS") field(INPC, "PS:LTUS:6:FaultEvent CPP NMS") field(INPD, "PS:LTUS:6:FaultEvent.SEVR NPP NMS") field(OOPT, "Every Time") field(FLNK, "PS:LTUS:6:LatchedFaultState") } record(bi, "PS:LTUS:6:LatchedFaultState") { field(DESC, "Fault Latch Status") field(INP, "PS:LTUS:6:LatchedFaultStateCalc NPP NMS") field(ONAM, "FAULT") field(ZNAM, "OK") field(OSV, "MAJOR") field(ZSV, "NO_ALARM") field(FLNK, "LGPS:LTUS:6:INTLKSUMY PP MS") } # Status Conditional Register is set by the user to Enable # SRQs for changes in power supply status. record(longout, "PS:LTUS:6:StatusEnable") { field(DESC, "Enable Status Events") field(DTYP, "stream") field(OUT, "@mgnt_genesys.proto PSU-setsena(06) LGPS_LTUS_6") field(DOL, "191") field(OMSL, "closed_loop") } # The status event register will set a bit if a change in teh power supply occurs # and it is enabled. The register is clered when teh SEVE? or CLS commands are received. # A change in this register will generate SRQ # # Reading the status event register, clears bits of the status event register record(mbbiDirect, "PS:LTUS:6:StatusEvent") { field(DESC, "Status Event Register") field(DTYP, "stream") field(INP, "@mgnt_genesys.proto PSU-getseve(06) LGPS_LTUS_6") field(FLNK, "PS:LTUS:6:StatusEventSeq") } record(seq, "PS:LTUS:6:StatusEventSeq") { # Process the status event registers that show a fault. # Do nothing if the status byte register is 0. field(DESC, "Process Non-Zero Events") field(ASG, "Internal") field(SELM, "Mask") field(SELL, "PS:LTUS:6:StatusEvent") field(LNK3, "PS:LTUS:6:FaultEvent.PROC PP") field(LNK4, "PS:LTUS:6:FaultEvent.PROC PP") } record(mbbiDirect, "PS:LTUS:6:OperStatus") { field(DESC, "Status Conditional Register") field(DTYP, "stream") field(INP, "@mgnt_genesys.proto PSU-getstat(06) LGPS_LTUS_6") field(PINI, "YES") field(FLNK, "PS:LTUS:6:VoltMode") } record(bi, "PS:LTUS:6:VoltMode") { field(DESC, "Voltage Mode") field(INP, "PS:LTUS:6:OperStatus.B0 MS") field(ZNAM, "Not Constant") field(ONAM, "Constant") field(FLNK, "PS:LTUS:6:CurrMode") } record(bi, "PS:LTUS:6:CurrMode") { field(DESC, "Current Mode") field(INP, "PS:LTUS:6:OperStatus.B1 MS") field(ZNAM, "Not Constant") field(ONAM, "Constant") field(FLNK, "PS:LTUS:6:NoFaultState") } record(bi, "PS:LTUS:6:NoFaultState") { field(DESC, "No Fault Status") field(INP, "PS:LTUS:6:OperStatus.B2 MS") field(ZNAM, "FAULT") field(ONAM, "OK") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(FLNK, "PS:LTUS:6:ActiveFaultState") } record(bi, "PS:LTUS:6:ActiveFaultState") { field(DESC, "Active Fault Status") field(INP, "PS:LTUS:6:OperStatus.B3 MS") field(ZNAM, "OK") field(ONAM, "FAULT") field(ZSV, "NO_ALARM") field(OSV, "NO_ALARM") field(FLNK, "PS:LTUS:6:AutoStartMode") } # In this mode, the power supply restores its last # operation setting. Upon startup (AC Input power recycle), # the output is enabled or disabled according to its last settings record(bi, "PS:LTUS:6:AutoStartMode") { field(DESC, "Auto Start Mode") field(INP, "PS:LTUS:6:OperStatus.B4 MS") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(FLNK, "PS:LTUS:6:FoldBackMode") } # FoldBack protection will shut down the power supply output # if the load current exceeds the Output current limit # setting level. This protection is useful when the load # circuitry is sensitive to an overcurrent condition # # 4/27/2022: K.Luchini - swp ZSV and OSV, so ZSV is not alarmed # becase we want fold back mode to be disabled. record(bi, "PS:LTUS:6:FoldBackMode") { field(DESC, "Fold Back Protection") field(INP, "PS:LTUS:6:OperStatus.B5 MS") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(FLNK, "PS:LTUS:6:Mode") } record(bi, "PS:LTUS:6:Mode") { field(DESC, "Local Mode") field(INP, "PS:LTUS:6:OperStatus.B7 MS") field(ZNAM, "REMOTE") field(ONAM, "LOCAL") field(ZSV, "NO_ALARM") field(OSV, "MINOR") } record(bo, "PS:LTUS:6:FoldBackEnable") { field(DESC, "Fold Back Protection") field(DTYP, "stream") field(OUT, "@mgnt_genesys.proto PSU-setfld(06) LGPS_LTUS_6") field(ZNAM, "OFF") field(ONAM, "ON") } # This command is followed by the address (default=6),and is used # to access the power supply. record(longout, "PS:LTUS:6:Addr") { field(DESC, "Power Supply Address") field(DTYP, "stream") field(OUT, "@mgnt_genesys.proto PSU-comsetadr(06) LGPS_LTUS_6") field(DOL, "06") field(OMSL, "closed_loop") } record(mbbo, "PS:LTUS:6:MsgRespCode") { field(DESC, "Message Resonse Code") field(DTYP, "Raw Soft Channel") field(NOBT, "4") field(ZRST, "OK") field(ONST, "C01") field(TWST, "C02") field(THST, "C03") field(FRST, "C04") field(FVST, "C05") field(SXST, "E01") field(SVST, "E04") field(EIST, "E06") field(NIST, "E07") 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(EIVL, "8") field(NIVL, "9") field(UNSV, "INVALID") field(FLNK, "PS:LTUS:6:MsgResp") } record(mbbi, "PS:LTUS:6:MsgResp") { field(DESC, "Message Response") field(INP, "PS:LTUS:6:MsgRespCode.RVAL NPP MS") field(NOBT, "4") field(ZRST, "OK") field(ONST, "Illegal Command Query") field(TWST, "Missing Parameter") field(THST, "Illegal Parameter") field(FRST, "Checksum Error") field(FVST, "Setting out of range") field(SXST, "Prog Volt Exceeded") field(SVST, "Out Volt below UVL") field(EIST, "UVL above Out Volt") field(NIST, "ON request while Fault") field(ZRST, "NO_ALARM") field(ONST, "MAJOR") field(TWST, "MAJOR") field(THST, "MAJOR") field(FRST, "MAJOR") field(FVST, "MAJOR") field(SXST, "MAJOR") field(SVST, "MAJOR") field(EIST, "MAJOR") field(NIST, "MAJOR") field(UNSV, "INVALID") field(PINI, "YES") } record(stringout, "PS:LTUS:6:GetAnything") { field(DESC, "Get Anything") field(DTYP, "stream") field(OUT, "@mgnt_genesys.proto debug(06) LGPS_LTUS_6") } record(stringout, "PS:LTUS:6:SetAnything") { field(DESC, "Set anything") field(DTYP, "stream") field(OUT, "@mgnt_genesys.proto PSU-set(06) LGPS_LTUS_6") } record(mbbo, "PS:LTUS:6: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, "YES") field(VAL, "3") field(OUT, "LGPS:LTUS:6:COOLING PP") } record(bo, "PS:LTUS:6:RampState") { field(DESC, "PS Ramp Status") field(ZNAM, "OFF") field(ONAM, "BUSY") field(PINI, "YES") field(OUT, "LGPS:LTUS:6:RAMPSTATE PP") } record(stringin, "PS:LTUS:6:Drawing") { field(DESC, "Drawing Number") field(VAL, "PR-376-543-00") field(PINI, "YES") } record(stringin, "PS:LTUS:6:Location") { field(DESC, "Rack Location") field(VAL, "B912-1201") field(PINI, "YES") } record(bo, "PS:LTUS:6:CommLink") { field(DESC, "Communication Link Status") field(PINI, "YES") field(ZNAM, "Offline") field(ONAM, "Online") field(FLNK, "PS:LTUS:6:InitCommLinkCalc") } record(calcout,"PS:LTUS:6:InitCommLinkCalc") { field(DESC, "Init Pvs") field(OOPT, "Transition To Non-zero") field(FLNK, "PS:LTUS:6:InitCommLink") field(ASG, "Internal") } record(dfanout,"PS:LTUS:6:InitCommLink") { field(DESC, "PS Init") field(DOL, "0") field(OMSL, "closed_loop") field(OUTA, "PS:LTUS:6:Addr.PROC PP") field(OUTB, "PS:LTUS:6:State.PROC PP") field(OUTC, "PS:LTUS:6:FaultEnable.PROC PP") field(OUTD, "PS:LTUS:6:StatusEnable.PROC PP") field(OUTE, "PS:LTUS:6:ResetSeq.PROC PP") field(OUTF, "PS:LTUS:6:StatusEvent.PROC PP") field(OUTG, "PS:LTUS:6:OperStatus.PROC PP") field(OUTH, "PS:LTUS:6:IDN.PROC PP") field(FLNK, "PS:LTUS:6:InitCurrSetpt") field(ASG, "Internal") } # Process VSETPT on IOC startup record(seq,"PS:LTUS:6:InitCurrSetpt") { field(DESC, "Init current setpoint") field(DOL1, "0") field(LNK1, "PS:LTUS:6:VoltSetpt.DISV") field(LNK2, "PS:LTUS:6:CurrSetptOut.PROC") field(DOL3, "1") field(LNK3, "PS:LTUS:6:VoltSetpt.DISV") field(ASG, "Internal") } record(bo, "PS:LTUS:7:StateSetpt") { field(DESC, "Power Supply On/Off") field(ZNAM, "OFF") field(ONAM, "ON") } record(bo, "PS:LTUS:7:StateSetptOut") { field(DESC, "Power Supply On/Off") field(DTYP, "stream") field(OUT, "@mgnt_genesys.proto PSU-setonoff(06) LGPS_LTUS_7") field(ZNAM, "OFF") field(ONAM, "ON") field(FLNK, "PS:LTUS:7:State") } record(bi, "PS:LTUS:7:State") { field(DESC, "Power Supply On/Off Status") field(DTYP, "stream") field(INP, "@mgnt_genesys.proto PSU-getonoff(06) LGPS_LTUS_7") field(ZNAM, "OFF") field(ONAM, "ON") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(PINI, "YES") field(FLNK, "LGPS:LTUS:7:STATE NPP MS") } record(calcout, "PS:LTUS:7:StateCheck") { # Do nothing if the state is invalid. # If the state setpoint is invalid, then set state setpoint to state. # If the state and setpoint are the same, set off if state is off, # otherwise, set state setpoint to state. # If the state setpoint has changed, go on or off. Otherwise, the state # must've changed externally so follow it. # field(DESC, "PS State Check") field(CALC, "C=3?0:D=3?3:(A#B)&&(B#E)?B+1:A=0?1:3") field(OUT, "PS:LTUS:7:StateSeq.SELN PP") field(INPA, "PS:LTUS:7:State CPP") field(INPB, "PS:LTUS:7:StateSetpt CPP") field(INPC, "PS:LTUS:7:State.SEVR") field(INPD, "PS:LTUS:7:StateSetpt.SEVR") field(INPE, "PS:LTUS:7:StateCheck.LB") field(ASG, "Internal") } record(seq, "PS:LTUS:7:StateSeq") { field(DESC, "PS State Sequence") field(SELM, "Specified") field(LNK1, "PS:LTUS:7:StateOffSetptSeq.PROC PP") field(LNK2, "PS:LTUS:7:StateOnSetptSeq.PROC PP") field(DOL3, "PS:LTUS:7:State") field(LNK3, "PS:LTUS:7:StateSetptSeq PP") field(ASG, "Internal") } record(seq, "PS:LTUS:7:StateOnSetptSeq") { # When turning on, reset the power supply, # enable foldback protection, set the voltage # and current to max and delay befor setting # the state to 1 (on). # field(DESC, "PS On Sequence") field(LNK1, "PS:LTUS:7:Reset.PROC PP") field(LNK2, "PS:LTUS:7:StateReset.PROC PP") field(DOL3, "1") field(LNK3, "PS:LTUS:7:FoldBackEnable PP") field(DLY4, "0.2") field(DOL4, "LGPS:LTUS:7:BCTRL.HOPR") field(LNK4, "LGPS:LTUS:7:BCTRL PP") field(DLY5, "0.2") field(DOL5, "1") field(LNK5, "PS:LTUS:7:StateSetptSeq PP") field(ASG, "Internal") } record(seq, "PS:LTUS:7:StateOffSetptSeq") { # When turning off, set the voltage and current max and then wait before # before setting the state to 0 (off). # Note: Under normal circumstances you'd set the current and volts to 0, # and wait to allow the supply to ramp down before turning the supply off. # However, power conversion has requested to leave the voltage and current # unchanged before setting the state to 0 (off). # field(DESC, "PS Off Sequence") field(LNK1, "PS:LTUS:7:CurrSetptOut.PROC PP") field(DLY2, "0.2") field(LNK2, "PS:LTUS:7:StateSetptSeq PP") field(ASG, "Internal") } record(seq, "PS:LTUS:7:StateSetptSeq") { # Set both the desired and the actual setpoints to requested. # Renable status events in case of power-cycle. # field(DESC, "PS State Setpt Sequence") field(DOL1, "PS:LTUS:7:StateSetptSeq") field(LNK1, "LGPS:LTUS:7:STATESETPT PP") field(DOL2, "PS:LTUS:7:StateSetptSeq") field(LNK2, "PS:LTUS:7:StateSetpt PP") field(LNK3, "PS:LTUS:7:FaultEnable.PROC PP") field(LNK4, "PS:LTUS:7:StatusEnable.PROC PP") field(LNK5, "PS:LTUS:7:OperStatus.PROC PP") field(LNK6, "PS:LTUS:7:FaultStatus.PROC PP") field(FLNK, "PS:LTUS:7:IDN ") field(ASG, "Internal") } # The reset command brings the power supply to a safe and known state. # Output voltage: zero Remote/Local Mode: non-lockout remote # Output current: zero Auto-Restart Mode: OFF # Output ON/OFF: OFF OVP setting: maximum # FoldbBack ON/OFF: OFF UVL setting: zero # # The condiitional resgisters (FLT and STAT) are updated while other # registers are not changed. # record(bo, "PS:LTUS:7:StateReset") { field(DESC, "Power Supply Reset") field(DTYP, "stream") field(OUT, "@mgnt_genesys.proto PSU-comreset(06) LGPS_LTUS_7") field(ZNAM, "OFF") field(ONAM, "OFF") field(FLNK, "PS:LTUS:7:ResetSeq") } # Returns th power supply model identification as an ascii string: LAMBDA, GENX-Y record (stringin, "PS:LTUS:7:IDN") { field(DESC, "Identification") field(DTYP, "stream") field(INP, "@mgnt_genesys.proto PSU-getidn(06) LGPS_LTUS_7") field(PINI, "YES") field(FLNK, "PS:LTUS:7:SerialNo") } record(stringin, "PS:LTUS:7:SerialNo") { field(DESC, "Serial Number") field(DTYP, "stream") field(INP, "@mgnt_genesys.proto PSU-getsn(06) LGPS_LTUS_7") field(FLNK, "PS:LTUS:7:Revision") } record(stringin, "PS:LTUS:7:Revision") { field(DESC, "Software Revision") field(DTYP, "stream") field(INP, "@mgnt_genesys.proto PSU-getrev(06) LGPS_LTUS_7") } # We aren't interested in current since we are setting voltage. # The current is variable so it's meaningless. record(ai, "PS:LTUS:7:Curr") { field(DESC, "PS Current") field(DTYP, "stream") field(INP, "@mgnt_genesys.proto PSU-getcur(06) LGPS_LTUS_7") field(EGU, "Amps") field(PREC, "3") field(HOPR, "200") field(FLNK, "PS:LTUS:7:ResistanceInp") } record(ao, "PS:LTUS:7:CurrSetpt") { field(DESC, "Current Output") field(DTYP, "stream") field(OUT, "@mgnt_genesys.proto PSU-setcur(06) LGPS_LTUS_7") field(EGU, "Amps") field(PREC, "3") field(HOPR, "200") field(DRVH, "200") field(DOL, "PS:LTUS:7:CurrSetpt.HOPR") field(OMSL, "closed_loop") info(autosaveFields, "VAL") } record(ai, "PS:LTUS:7:CurrSetptRbck") { field(DESC, "Current Output Readback") field(DTYP, "stream") field(INP, "@mgnt_genesys.proto PSU-getsetcur(06) LGPS_LTUS_7") field(EGU, "Amps") field(PREC, "3") field(HOPR, "200") } # Calculate resistance if voltage and current are high enough. # Add smoothing of the resistance value. record(calc, "PS:LTUS:7:ResistanceInp") { field(DESC, "Resistance") field(ASG, "Internal") field(CALC, "B<=0?0:A<0.5?C:((B/A)*(1-D))+(C*D)") field(INPA, "PS:LTUS:7:Curr MS") field(INPB, "PS:LTUS:7:Volt MS") field(INPC, "PS:LTUS:7:ResistanceInp") field(INPD, "PS:LTUS:7:Resistance.D") field(EGU, "Ohm") field(PREC, "4") field(HOPR, "5") field(FLNK, "PS:LTUS:7:Resistance") } # Add offset to resistance for testing purposes. record(calc, "PS:LTUS:7:Resistance") { field(DESC, "Resistance") field(CALC, "C+E") field(INPC, "PS:LTUS:7:ResistanceInp") field(INPD, "0") field(EGU, "Ohm") field(PREC, "4") field(HOPR, "5") } record(ai, "PS:LTUS:7:Volt") { field(DESC, "PS Output Voltage") field(DTYP, "stream") field(INP, "@mgnt_genesys.proto PSU-getvolts(06) LGPS_LTUS_7") field(EGU, "Volts") field(PREC, "3") field(HOPR, "50.0") field(PINI, "YES") field(FLNK, "PS:LTUS:7:CurrAct") } record(ai, "PS:LTUS:7:CurrAct") { field(DESC, "PS Output Current") field(INP, "PS:LTUS:7:Volt NPP MS") field(EGU, "Amps") field(PREC, "3") field(HOPR, "200") field(FLNK, "LGPS:LTUS:7:IACT") } record(ao, "PS:LTUS:7:CurrSetptOut") { field(DESC, "Current to Volt Output") field(EGU, "Amps") field(PREC, "3") field(HOPR, "50.0") field(DRVH, "50.0") field(OUT, "PS:LTUS:7:VoltSetpt PP") info(autosaveFields, "VAL") } record(ao, "PS:LTUS:7:VoltSetpt") { field(DESC, "Voltage Output") field(DTYP, "stream") field(OUT, "@mgnt_genesys.proto PSU-setvolts(06) LGPS_LTUS_7") field(EGU, "Volts") field(PREC, "3") field(HOPR, "50.0") field(DRVH, "50.0") field(FLNK, "PS:LTUS:7:VoltSetptSeq") } record(seq, "PS:LTUS:7:VoltSetptSeq") { field(DESC, "Voltage Output Sequence") field(DLY1, "0.2") field(LNK1, "PS:LTUS:7:CurrSetpt.PROC PP") field(DLY2, "0.2") field(LNK2, "PS:LTUS:7:VoltSetptRbck.PROC PP") field(DLY3, "0.2") field(LNK3, "PS:LTUS:7:CurrSetptRbck.PROC PP") } record(ai, "PS:LTUS:7:VoltSetptRbck") { field(DESC, "Voltage Output Readback") field(DTYP, "stream") field(INP, "@mgnt_genesys.proto PSU-getsetvolts(06) LGPS_LTUS_7") field(EGU, "Volts") field(PREC, "3") field(HOPR, "50.0") field(FLNK, "PS:LTUS:7:CurrSetpt") } # Clear status command. Sets FEVE and SEVE registers to zero. record(bo, "PS:LTUS:7:Reset") { field(DESC, "Clear Errors") field(DTYP, "stream") field(OUT, "@mgnt_genesys.proto PSU-comclr(06) LGPS_LTUS_7") field(ZNAM, "RESET") field(ONAM, "NORESET") field(FLNK, "PS:LTUS:7:ResetSeq") } record(seq, "PS:LTUS:7:ResetSeq") { field(DESC, "Process Events") field(ASG, "Internal") field(LNK1, "PS:LTUS:7:FaultEvent.PROC PP") field(LNK2, "PS:LTUS:7:StatusEvent.PROC PP") } record(fanout, "PS:LTUS:7:UpdateFast") { # Process State before Curr since State may change Curr limits. field(DESC, "Fast Update") field(LNK1, "PS:LTUS:7:Volt.PROC") field(LNK2, "PS:LTUS:7:State.PROC") field(LNK3, "PS:LTUS:7:VoltSetptRbck.PROC") field(LNK4, "PS:LTUS:7:CurrSetptRbck.PROC") field(LNK5, "PS:LTUS:7:Curr.PROC") field(LNK6, "PS:LTUS:7:CurrAct.PROC") field(SCAN, ".5 second") field(DISV, "0") field(SDIS, "PS:LTUS:7:CommLink") field(ASG, "Internal") } record(fanout, "PS:LTUS:7:UpdateSlow") { field(DESC, "Slow Update") field(LNK1, "PS:LTUS:7:StatusEvent.PROC") field(LNK2, "PS:LTUS:7:OperStatus.PROC") field(LNK3, "PS:LTUS:7:FaultStatus.PROC") field(LNK4, "PS:LTUS:7:FaultEvent.PROC") field(SCAN, "2 second") field(DISV, "0") field(SDIS, "PS:LTUS:7:CommLink") field(ASG, "Internal") } # Conditional Registers # The faultconditional and status conditional registers # are read only registers that the uesrs may read to see the # condition of the power supply. # # # Fault Conditional Register record(longout, "PS:LTUS:7:FaultEnable") { field(DESC, "Enable Fault Events") field(DTYP, "stream") field(OUT, "@mgnt_genesys.proto PSU-setfena(06) LGPS_LTUS_7") field(DOL, "254") field(OMSL, "closed_loop") } # Reading the fault event register, clears bits of the fault event register # The fault event will set a bit if a condition occurs and it is Enabled. # The register is cleared when FEVE?, CLS or RST commands are received. record(mbbiDirect, "PS:LTUS:7:FaultEvent") { field(DESC, "Fault Event Register") field(DTYP, "stream") field(INP, "@mgnt_genesys.proto PSU-getfeve(06) LGPS_LTUS_7") } record(mbbiDirect,"PS:LTUS:7:FaultStatus") { field(DESC,"Fault Conditional Register") field(DTYP,"stream") field(INP, "@mgnt_genesys.proto PSU-getflt(06) LGPS_LTUS_7") field(FLNK, "PS:LTUS:7:ACState") } record(bi, "PS:LTUS:7:ACState") { field(DESC, "AC Status") field(INP, "PS:LTUS:7:FaultStatus.B1") field(ZNAM, "OK") field(ONAM, "FAULT") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(FLNK, "PS:LTUS:7:OverTemp") } # The OTP circuit shuts down the power supply before the internal # components can exceed their safe internal operating temperature. # When an OTP shutdown occurs, the VOLTAGE meter displays "O7P" # and the ALARM LED blinks.Resetting the OTP circuit can be # automatic (non-latched) or manual (latched) dependingon the # Safe-Start or AutoRestart mode. # # 1.Safe-Start mode: # In Safe-Start mode, the power supply stays OFF after the over # temperature condition has been removed. The display continues to show \u201cO7P\u201d and the # ALARM LEDcontinues to blink. To reset the OTP circuit, press the OUT # button (or send an OUT ON (OUT 1)command via the RS-232/RS-485 serialcommunicationport). # 2. Auto-Restart mode: # In Auto-Restart mode, the power supply recovers to its last setting # operational automatically when the over temperature condition is removed. # record(bi, "PS:LTUS:7:OverTemp") { field(DESC, "Over Temperature Status") field(INP, "PS:LTUS:7:FaultStatus.B2") field(ZNAM, "OK") field(ONAM, "FAULT") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(FLNK, "PS:LTUS:7:FoldBack") } # The supply output is turned On by front panel # button or OUT 1 command. record(bi, "PS:LTUS:7:FoldBack") { field(DESC, "FoldBack Shutdown") field(INP, "PS:LTUS:7:FaultStatus.B3") field(ZNAM, "OK") field(ONAM, "FAULT") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(FLNK, "PS:LTUS:7:OverVolt") } record(bi, "PS:LTUS:7:OverVolt") { field(DESC, "Over Voltage Status") field(INP, "PS:LTUS:7:FaultStatus.B4") field(ZNAM, "OK") field(ONAM, "FAULT") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(FLNK, "PS:LTUS:7:ShutOff") } record(bi, "PS:LTUS:7:ShutOff") { field(DESC, "J1 Analog In Shut Off") field(INP, "PS:LTUS:7:FaultStatus.B5") field(ZNAM, "OK") field(ONAM, "FAULT") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(FLNK, "PS:LTUS:7:ManualOff") } # The supply output is turned On by front # panel button or OUT 1 command record(bi, "PS:LTUS:7:ManualOff") { field(DESC, "Front Panel Off") field(INP, "PS:LTUS:7:FaultStatus.B6") field(ZNAM, "OK") field(ONAM, "FAULT") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(FLNK, "PS:LTUS:7:OutputState") } record(bi, "PS:LTUS:7:OutputState") { field(DESC, "J1 Analog In Enable Fault") field(INP, "PS:LTUS:7:FaultStatus.B7") field(ZNAM, "OK") field(ONAM, "FAULT") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") } record(calcout, "PS:LTUS:7:LatchedFaultStateCalc") { field(DESC, "Fault Latch Status Calc") field(ASG, "Internal") field(CALC, "(B=3)||(D=3)?0:(A>0)||(C>0)?1:0") field(INPA, "PS:LTUS:7:FaultStatus CPP NMS") field(INPB, "PS:LTUS:7:FaultStatus.SEVR NPP NMS") field(INPC, "PS:LTUS:7:FaultEvent CPP NMS") field(INPD, "PS:LTUS:7:FaultEvent.SEVR NPP NMS") field(OOPT, "Every Time") field(FLNK, "PS:LTUS:7:LatchedFaultState") } record(bi, "PS:LTUS:7:LatchedFaultState") { field(DESC, "Fault Latch Status") field(INP, "PS:LTUS:7:LatchedFaultStateCalc NPP NMS") field(ONAM, "FAULT") field(ZNAM, "OK") field(OSV, "MAJOR") field(ZSV, "NO_ALARM") field(FLNK, "LGPS:LTUS:7:INTLKSUMY PP MS") } # Status Conditional Register is set by the user to Enable # SRQs for changes in power supply status. record(longout, "PS:LTUS:7:StatusEnable") { field(DESC, "Enable Status Events") field(DTYP, "stream") field(OUT, "@mgnt_genesys.proto PSU-setsena(06) LGPS_LTUS_7") field(DOL, "191") field(OMSL, "closed_loop") } # The status event register will set a bit if a change in teh power supply occurs # and it is enabled. The register is clered when teh SEVE? or CLS commands are received. # A change in this register will generate SRQ # # Reading the status event register, clears bits of the status event register record(mbbiDirect, "PS:LTUS:7:StatusEvent") { field(DESC, "Status Event Register") field(DTYP, "stream") field(INP, "@mgnt_genesys.proto PSU-getseve(06) LGPS_LTUS_7") field(FLNK, "PS:LTUS:7:StatusEventSeq") } record(seq, "PS:LTUS:7:StatusEventSeq") { # Process the status event registers that show a fault. # Do nothing if the status byte register is 0. field(DESC, "Process Non-Zero Events") field(ASG, "Internal") field(SELM, "Mask") field(SELL, "PS:LTUS:7:StatusEvent") field(LNK3, "PS:LTUS:7:FaultEvent.PROC PP") field(LNK4, "PS:LTUS:7:FaultEvent.PROC PP") } record(mbbiDirect, "PS:LTUS:7:OperStatus") { field(DESC, "Status Conditional Register") field(DTYP, "stream") field(INP, "@mgnt_genesys.proto PSU-getstat(06) LGPS_LTUS_7") field(PINI, "YES") field(FLNK, "PS:LTUS:7:VoltMode") } record(bi, "PS:LTUS:7:VoltMode") { field(DESC, "Voltage Mode") field(INP, "PS:LTUS:7:OperStatus.B0 MS") field(ZNAM, "Not Constant") field(ONAM, "Constant") field(FLNK, "PS:LTUS:7:CurrMode") } record(bi, "PS:LTUS:7:CurrMode") { field(DESC, "Current Mode") field(INP, "PS:LTUS:7:OperStatus.B1 MS") field(ZNAM, "Not Constant") field(ONAM, "Constant") field(FLNK, "PS:LTUS:7:NoFaultState") } record(bi, "PS:LTUS:7:NoFaultState") { field(DESC, "No Fault Status") field(INP, "PS:LTUS:7:OperStatus.B2 MS") field(ZNAM, "FAULT") field(ONAM, "OK") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(FLNK, "PS:LTUS:7:ActiveFaultState") } record(bi, "PS:LTUS:7:ActiveFaultState") { field(DESC, "Active Fault Status") field(INP, "PS:LTUS:7:OperStatus.B3 MS") field(ZNAM, "OK") field(ONAM, "FAULT") field(ZSV, "NO_ALARM") field(OSV, "NO_ALARM") field(FLNK, "PS:LTUS:7:AutoStartMode") } # In this mode, the power supply restores its last # operation setting. Upon startup (AC Input power recycle), # the output is enabled or disabled according to its last settings record(bi, "PS:LTUS:7:AutoStartMode") { field(DESC, "Auto Start Mode") field(INP, "PS:LTUS:7:OperStatus.B4 MS") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(FLNK, "PS:LTUS:7:FoldBackMode") } # FoldBack protection will shut down the power supply output # if the load current exceeds the Output current limit # setting level. This protection is useful when the load # circuitry is sensitive to an overcurrent condition # # 4/27/2022: K.Luchini - swp ZSV and OSV, so ZSV is not alarmed # becase we want fold back mode to be disabled. record(bi, "PS:LTUS:7:FoldBackMode") { field(DESC, "Fold Back Protection") field(INP, "PS:LTUS:7:OperStatus.B5 MS") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(FLNK, "PS:LTUS:7:Mode") } record(bi, "PS:LTUS:7:Mode") { field(DESC, "Local Mode") field(INP, "PS:LTUS:7:OperStatus.B7 MS") field(ZNAM, "REMOTE") field(ONAM, "LOCAL") field(ZSV, "NO_ALARM") field(OSV, "MINOR") } record(bo, "PS:LTUS:7:FoldBackEnable") { field(DESC, "Fold Back Protection") field(DTYP, "stream") field(OUT, "@mgnt_genesys.proto PSU-setfld(06) LGPS_LTUS_7") field(ZNAM, "OFF") field(ONAM, "ON") } # This command is followed by the address (default=6),and is used # to access the power supply. record(longout, "PS:LTUS:7:Addr") { field(DESC, "Power Supply Address") field(DTYP, "stream") field(OUT, "@mgnt_genesys.proto PSU-comsetadr(06) LGPS_LTUS_7") field(DOL, "06") field(OMSL, "closed_loop") } record(mbbo, "PS:LTUS:7:MsgRespCode") { field(DESC, "Message Resonse Code") field(DTYP, "Raw Soft Channel") field(NOBT, "4") field(ZRST, "OK") field(ONST, "C01") field(TWST, "C02") field(THST, "C03") field(FRST, "C04") field(FVST, "C05") field(SXST, "E01") field(SVST, "E04") field(EIST, "E06") field(NIST, "E07") 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(EIVL, "8") field(NIVL, "9") field(UNSV, "INVALID") field(FLNK, "PS:LTUS:7:MsgResp") } record(mbbi, "PS:LTUS:7:MsgResp") { field(DESC, "Message Response") field(INP, "PS:LTUS:7:MsgRespCode.RVAL NPP MS") field(NOBT, "4") field(ZRST, "OK") field(ONST, "Illegal Command Query") field(TWST, "Missing Parameter") field(THST, "Illegal Parameter") field(FRST, "Checksum Error") field(FVST, "Setting out of range") field(SXST, "Prog Volt Exceeded") field(SVST, "Out Volt below UVL") field(EIST, "UVL above Out Volt") field(NIST, "ON request while Fault") field(ZRST, "NO_ALARM") field(ONST, "MAJOR") field(TWST, "MAJOR") field(THST, "MAJOR") field(FRST, "MAJOR") field(FVST, "MAJOR") field(SXST, "MAJOR") field(SVST, "MAJOR") field(EIST, "MAJOR") field(NIST, "MAJOR") field(UNSV, "INVALID") field(PINI, "YES") } record(stringout, "PS:LTUS:7:GetAnything") { field(DESC, "Get Anything") field(DTYP, "stream") field(OUT, "@mgnt_genesys.proto debug(06) LGPS_LTUS_7") } record(stringout, "PS:LTUS:7:SetAnything") { field(DESC, "Set anything") field(DTYP, "stream") field(OUT, "@mgnt_genesys.proto PSU-set(06) LGPS_LTUS_7") } record(mbbo, "PS:LTUS:7: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, "YES") field(VAL, "3") field(OUT, "LGPS:LTUS:7:COOLING PP") } record(bo, "PS:LTUS:7:RampState") { field(DESC, "PS Ramp Status") field(ZNAM, "OFF") field(ONAM, "BUSY") field(PINI, "YES") field(OUT, "LGPS:LTUS:7:RAMPSTATE PP") } record(stringin, "PS:LTUS:7:Drawing") { field(DESC, "Drawing Number") field(VAL, "PR-376-543-00") field(PINI, "YES") } record(stringin, "PS:LTUS:7:Location") { field(DESC, "Rack Location") field(VAL, "B912-1301") field(PINI, "YES") } record(bo, "PS:LTUS:7:CommLink") { field(DESC, "Communication Link Status") field(PINI, "YES") field(ZNAM, "Offline") field(ONAM, "Online") field(FLNK, "PS:LTUS:7:InitCommLinkCalc") } record(calcout,"PS:LTUS:7:InitCommLinkCalc") { field(DESC, "Init Pvs") field(OOPT, "Transition To Non-zero") field(FLNK, "PS:LTUS:7:InitCommLink") field(ASG, "Internal") } record(dfanout,"PS:LTUS:7:InitCommLink") { field(DESC, "PS Init") field(DOL, "0") field(OMSL, "closed_loop") field(OUTA, "PS:LTUS:7:Addr.PROC PP") field(OUTB, "PS:LTUS:7:State.PROC PP") field(OUTC, "PS:LTUS:7:FaultEnable.PROC PP") field(OUTD, "PS:LTUS:7:StatusEnable.PROC PP") field(OUTE, "PS:LTUS:7:ResetSeq.PROC PP") field(OUTF, "PS:LTUS:7:StatusEvent.PROC PP") field(OUTG, "PS:LTUS:7:OperStatus.PROC PP") field(OUTH, "PS:LTUS:7:IDN.PROC PP") field(FLNK, "PS:LTUS:7:InitCurrSetpt") field(ASG, "Internal") } # Process VSETPT on IOC startup record(seq,"PS:LTUS:7:InitCurrSetpt") { field(DESC, "Init current setpoint") field(DOL1, "0") field(LNK1, "PS:LTUS:7:VoltSetpt.DISV") field(LNK2, "PS:LTUS:7:CurrSetptOut.PROC") field(DOL3, "1") field(LNK3, "PS:LTUS:7:VoltSetpt.DISV") field(ASG, "Internal") } record(bo, "PS:UNDS:1:StateSetpt") { field(DESC, "Power Supply On/Off") field(ZNAM, "OFF") field(ONAM, "ON") } record(bo, "PS:UNDS:1:StateSetptOut") { field(DESC, "Power Supply On/Off") field(DTYP, "stream") field(OUT, "@mgnt_genesys_alt.proto PSU-setonoff(06) LGPS_UNDS_1") field(ZNAM, "OFF") field(ONAM, "ON") field(FLNK, "PS:UNDS:1:State") } record(bi, "PS:UNDS:1:State") { field(DESC, "Power Supply On/Off Status") field(DTYP, "stream") field(INP, "@mgnt_genesys_alt.proto PSU-getonoff(06) LGPS_UNDS_1") field(ZNAM, "OFF") field(ONAM, "ON") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(PINI, "YES") field(FLNK, "LGPS:UNDS:1:STATE NPP MS") } record(calcout, "PS:UNDS:1:StateCheck") { # Do nothing if the state is invalid. # If the state setpoint is invalid, then set state setpoint to state. # If the state and setpoint are the same, set off if state is off, # otherwise, set state setpoint to state. # If the state setpoint has changed, go on or off. Otherwise, the state # must've changed externally so follow it. # field(DESC, "PS State Check") field(CALC, "C=3?0:D=3?3:(A#B)&&(B#E)?B+1:A=0?1:3") field(OUT, "PS:UNDS:1:StateSeq.SELN PP") field(INPA, "PS:UNDS:1:State CPP") field(INPB, "PS:UNDS:1:StateSetpt CPP") field(INPC, "PS:UNDS:1:State.SEVR") field(INPD, "PS:UNDS:1:StateSetpt.SEVR") field(INPE, "PS:UNDS:1:StateCheck.LB") field(ASG, "Internal") } record(seq, "PS:UNDS:1:StateSeq") { field(DESC, "PS State Sequence") field(SELM, "Specified") field(LNK1, "PS:UNDS:1:StateOffSetptSeq.PROC PP") field(LNK2, "PS:UNDS:1:StateOnSetptSeq.PROC PP") field(DOL3, "PS:UNDS:1:State") field(LNK3, "PS:UNDS:1:StateSetptSeq PP") field(ASG, "Internal") } record(seq, "PS:UNDS:1:StateOnSetptSeq") { # When turning on, reset the power supply, # enable foldback protection, set the voltage # and current to max and delay befor setting # the state to 1 (on). # field(DESC, "PS On Sequence") field(LNK1, "PS:UNDS:1:Reset.PROC PP") field(LNK2, "PS:UNDS:1:StateReset.PROC PP") field(DOL3, "1") field(LNK3, "PS:UNDS:1:FoldBackEnable PP") field(DLY4, "0.2") field(DOL4, "LGPS:UNDS:1:BCTRL.HOPR") field(LNK4, "LGPS:UNDS:1:BCTRL PP") field(DLY5, "0.2") field(DOL5, "1") field(LNK5, "PS:UNDS:1:StateSetptSeq PP") field(ASG, "Internal") } record(seq, "PS:UNDS:1:StateOffSetptSeq") { # When turning off, set the voltage and current max and then wait before # before setting the state to 0 (off). # Note: Under normal circumstances you'd set the current and volts to 0, # and wait to allow the supply to ramp down before turning the supply off. # However, power conversion has requested to leave the voltage and current # unchanged before setting the state to 0 (off). # field(DESC, "PS Off Sequence") field(LNK1, "PS:UNDS:1:CurrSetptOut.PROC PP") field(DLY2, "0.2") field(LNK2, "PS:UNDS:1:StateSetptSeq PP") field(ASG, "Internal") } record(seq, "PS:UNDS:1:StateSetptSeq") { # Set both the desired and the actual setpoints to requested. # Renable status events in case of power-cycle. # field(DESC, "PS State Setpt Sequence") field(DOL1, "PS:UNDS:1:StateSetptSeq") field(LNK1, "LGPS:UNDS:1:STATESETPT PP") field(DOL2, "PS:UNDS:1:StateSetptSeq") field(LNK2, "PS:UNDS:1:StateSetpt PP") field(LNK3, "PS:UNDS:1:FaultEnable.PROC PP") field(LNK4, "PS:UNDS:1:StatusEnable.PROC PP") field(LNK5, "PS:UNDS:1:OperStatus.PROC PP") field(LNK6, "PS:UNDS:1:FaultStatus.PROC PP") field(FLNK, "PS:UNDS:1:IDN ") field(ASG, "Internal") } # The reset command brings the power supply to a safe and known state. # Output voltage: zero Remote/Local Mode: non-lockout remote # Output current: zero Auto-Restart Mode: OFF # Output ON/OFF: OFF OVP setting: maximum # FoldbBack ON/OFF: OFF UVL setting: zero # # The condiitional resgisters (FLT and STAT) are updated while other # registers are not changed. # record(bo, "PS:UNDS:1:StateReset") { field(DESC, "Power Supply Reset") field(DTYP, "stream") field(OUT, "@mgnt_genesys_alt.proto PSU-comreset(06) LGPS_UNDS_1") field(ZNAM, "OFF") field(ONAM, "OFF") field(FLNK, "PS:UNDS:1:ResetSeq") } # Returns th power supply model identification as an ascii string: LAMBDA, GENX-Y record (stringin, "PS:UNDS:1:IDN") { field(DESC, "Identification") field(DTYP, "stream") field(INP, "@mgnt_genesys_alt.proto PSU-getidn(06) LGPS_UNDS_1") field(PINI, "YES") field(FLNK, "PS:UNDS:1:SerialNo") } record(stringin, "PS:UNDS:1:SerialNo") { field(DESC, "Serial Number") field(DTYP, "stream") field(INP, "@mgnt_genesys_alt.proto PSU-getsn(06) LGPS_UNDS_1") field(FLNK, "PS:UNDS:1:Revision") } record(stringin, "PS:UNDS:1:Revision") { field(DESC, "Software Revision") field(DTYP, "stream") field(INP, "@mgnt_genesys_alt.proto PSU-getrev(06) LGPS_UNDS_1") } # We aren't interested in current since we are setting voltage. # The current is variable so it's meaningless. record(ai, "PS:UNDS:1:Curr") { field(DESC, "PS Current") field(DTYP, "stream") field(INP, "@mgnt_genesys_alt.proto PSU-getcur(06) LGPS_UNDS_1") field(EGU, "Amps") field(PREC, "3") field(HOPR, "200") field(FLNK, "PS:UNDS:1:ResistanceInp") } record(ao, "PS:UNDS:1:CurrSetpt") { field(DESC, "Current Output") field(DTYP, "stream") field(OUT, "@mgnt_genesys_alt.proto PSU-setcur(06) LGPS_UNDS_1") field(EGU, "Amps") field(PREC, "3") field(HOPR, "200") field(DRVH, "200") field(DOL, "PS:UNDS:1:CurrSetpt.HOPR") field(OMSL, "closed_loop") info(autosaveFields, "VAL") } record(ai, "PS:UNDS:1:CurrSetptRbck") { field(DESC, "Current Output Readback") field(DTYP, "stream") field(INP, "@mgnt_genesys_alt.proto PSU-getsetcur(06) LGPS_UNDS_1") field(EGU, "Amps") field(PREC, "3") field(HOPR, "200") } # Calculate resistance if voltage and current are high enough. # Add smoothing of the resistance value. record(calc, "PS:UNDS:1:ResistanceInp") { field(DESC, "Resistance") field(ASG, "Internal") field(CALC, "B<=0?0:A<0.5?C:((B/A)*(1-D))+(C*D)") field(INPA, "PS:UNDS:1:Curr MS") field(INPB, "PS:UNDS:1:Volt MS") field(INPC, "PS:UNDS:1:ResistanceInp") field(INPD, "PS:UNDS:1:Resistance.D") field(EGU, "Ohm") field(PREC, "4") field(HOPR, "5") field(FLNK, "PS:UNDS:1:Resistance") } # Add offset to resistance for testing purposes. record(calc, "PS:UNDS:1:Resistance") { field(DESC, "Resistance") field(CALC, "C+E") field(INPC, "PS:UNDS:1:ResistanceInp") field(INPD, "0") field(EGU, "Ohm") field(PREC, "4") field(HOPR, "5") } record(ai, "PS:UNDS:1:Volt") { field(DESC, "PS Output Voltage") field(DTYP, "stream") field(INP, "@mgnt_genesys_alt.proto PSU-getvolts(06) LGPS_UNDS_1") field(EGU, "Volts") field(PREC, "3") field(HOPR, "50.0") field(PINI, "YES") field(FLNK, "PS:UNDS:1:CurrAct") } record(ai, "PS:UNDS:1:CurrAct") { field(DESC, "PS Output Current") field(INP, "PS:UNDS:1:Volt NPP MS") field(EGU, "Amps") field(PREC, "3") field(HOPR, "200") field(FLNK, "LGPS:UNDS:1:IACT") } record(ao, "PS:UNDS:1:CurrSetptOut") { field(DESC, "Current to Volt Output") field(EGU, "Amps") field(PREC, "3") field(HOPR, "50.0") field(DRVH, "50.0") field(OUT, "PS:UNDS:1:VoltSetpt PP") info(autosaveFields, "VAL") } record(ao, "PS:UNDS:1:VoltSetpt") { field(DESC, "Voltage Output") field(DTYP, "stream") field(OUT, "@mgnt_genesys_alt.proto PSU-setvolts(06) LGPS_UNDS_1") field(EGU, "Volts") field(PREC, "3") field(HOPR, "50.0") field(DRVH, "50.0") field(FLNK, "PS:UNDS:1:VoltSetptSeq") } record(seq, "PS:UNDS:1:VoltSetptSeq") { field(DESC, "Voltage Output Sequence") field(DLY1, "0.2") field(LNK1, "PS:UNDS:1:CurrSetpt.PROC PP") field(DLY2, "0.2") field(LNK2, "PS:UNDS:1:VoltSetptRbck.PROC PP") field(DLY3, "0.2") field(LNK3, "PS:UNDS:1:CurrSetptRbck.PROC PP") } record(ai, "PS:UNDS:1:VoltSetptRbck") { field(DESC, "Voltage Output Readback") field(DTYP, "stream") field(INP, "@mgnt_genesys_alt.proto PSU-getsetvolts(06) LGPS_UNDS_1") field(EGU, "Volts") field(PREC, "3") field(HOPR, "50.0") field(FLNK, "PS:UNDS:1:CurrSetpt") } # Clear status command. Sets FEVE and SEVE registers to zero. record(bo, "PS:UNDS:1:Reset") { field(DESC, "Clear Errors") field(DTYP, "stream") field(OUT, "@mgnt_genesys_alt.proto PSU-comclr(06) LGPS_UNDS_1") field(ZNAM, "RESET") field(ONAM, "NORESET") field(FLNK, "PS:UNDS:1:ResetSeq") } record(seq, "PS:UNDS:1:ResetSeq") { field(DESC, "Process Events") field(ASG, "Internal") field(LNK1, "PS:UNDS:1:FaultEvent.PROC PP") field(LNK2, "PS:UNDS:1:StatusEvent.PROC PP") } record(fanout, "PS:UNDS:1:UpdateFast") { # Process State before Curr since State may change Curr limits. field(DESC, "Fast Update") field(LNK1, "PS:UNDS:1:Volt.PROC") field(LNK2, "PS:UNDS:1:State.PROC") field(LNK3, "PS:UNDS:1:VoltSetptRbck.PROC") field(LNK4, "PS:UNDS:1:CurrSetptRbck.PROC") field(LNK5, "PS:UNDS:1:Curr.PROC") field(LNK6, "PS:UNDS:1:CurrAct.PROC") field(SCAN, ".5 second") field(DISV, "0") field(SDIS, "PS:UNDS:1:CommLink") field(ASG, "Internal") } record(fanout, "PS:UNDS:1:UpdateSlow") { field(DESC, "Slow Update") field(LNK1, "PS:UNDS:1:StatusEvent.PROC") field(LNK2, "PS:UNDS:1:OperStatus.PROC") field(LNK3, "PS:UNDS:1:FaultStatus.PROC") field(LNK4, "PS:UNDS:1:FaultEvent.PROC") field(SCAN, "2 second") field(DISV, "0") field(SDIS, "PS:UNDS:1:CommLink") field(ASG, "Internal") } # Conditional Registers # The faultconditional and status conditional registers # are read only registers that the uesrs may read to see the # condition of the power supply. # # # Fault Conditional Register record(longout, "PS:UNDS:1:FaultEnable") { field(DESC, "Enable Fault Events") field(DTYP, "stream") field(OUT, "@mgnt_genesys_alt.proto PSU-setfena(06) LGPS_UNDS_1") field(DOL, "254") field(OMSL, "closed_loop") } # Reading the fault event register, clears bits of the fault event register # The fault event will set a bit if a condition occurs and it is Enabled. # The register is cleared when FEVE?, CLS or RST commands are received. record(mbbiDirect, "PS:UNDS:1:FaultEvent") { field(DESC, "Fault Event Register") field(DTYP, "stream") field(INP, "@mgnt_genesys_alt.proto PSU-getfeve(06) LGPS_UNDS_1") } record(mbbiDirect,"PS:UNDS:1:FaultStatus") { field(DESC,"Fault Conditional Register") field(DTYP,"stream") field(INP, "@mgnt_genesys_alt.proto PSU-getflt(06) LGPS_UNDS_1") field(FLNK, "PS:UNDS:1:ACState") } record(bi, "PS:UNDS:1:ACState") { field(DESC, "AC Status") field(INP, "PS:UNDS:1:FaultStatus.B1") field(ZNAM, "OK") field(ONAM, "FAULT") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(FLNK, "PS:UNDS:1:OverTemp") } # The OTP circuit shuts down the power supply before the internal # components can exceed their safe internal operating temperature. # When an OTP shutdown occurs, the VOLTAGE meter displays "O7P" # and the ALARM LED blinks.Resetting the OTP circuit can be # automatic (non-latched) or manual (latched) dependingon the # Safe-Start or AutoRestart mode. # # 1.Safe-Start mode: # In Safe-Start mode, the power supply stays OFF after the over # temperature condition has been removed. The display continues to show \u201cO7P\u201d and the # ALARM LEDcontinues to blink. To reset the OTP circuit, press the OUT # button (or send an OUT ON (OUT 1)command via the RS-232/RS-485 serialcommunicationport). # 2. Auto-Restart mode: # In Auto-Restart mode, the power supply recovers to its last setting # operational automatically when the over temperature condition is removed. # record(bi, "PS:UNDS:1:OverTemp") { field(DESC, "Over Temperature Status") field(INP, "PS:UNDS:1:FaultStatus.B2") field(ZNAM, "OK") field(ONAM, "FAULT") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(FLNK, "PS:UNDS:1:FoldBack") } # The supply output is turned On by front panel # button or OUT 1 command. record(bi, "PS:UNDS:1:FoldBack") { field(DESC, "FoldBack Shutdown") field(INP, "PS:UNDS:1:FaultStatus.B3") field(ZNAM, "OK") field(ONAM, "FAULT") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(FLNK, "PS:UNDS:1:OverVolt") } record(bi, "PS:UNDS:1:OverVolt") { field(DESC, "Over Voltage Status") field(INP, "PS:UNDS:1:FaultStatus.B4") field(ZNAM, "OK") field(ONAM, "FAULT") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(FLNK, "PS:UNDS:1:ShutOff") } record(bi, "PS:UNDS:1:ShutOff") { field(DESC, "J1 Analog In Shut Off") field(INP, "PS:UNDS:1:FaultStatus.B5") field(ZNAM, "OK") field(ONAM, "FAULT") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(FLNK, "PS:UNDS:1:ManualOff") } # The supply output is turned On by front # panel button or OUT 1 command record(bi, "PS:UNDS:1:ManualOff") { field(DESC, "Front Panel Off") field(INP, "PS:UNDS:1:FaultStatus.B6") field(ZNAM, "OK") field(ONAM, "FAULT") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(FLNK, "PS:UNDS:1:OutputState") } record(bi, "PS:UNDS:1:OutputState") { field(DESC, "J1 Analog In Enable Fault") field(INP, "PS:UNDS:1:FaultStatus.B7") field(ZNAM, "OK") field(ONAM, "FAULT") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") } record(calcout, "PS:UNDS:1:LatchedFaultStateCalc") { field(DESC, "Fault Latch Status Calc") field(ASG, "Internal") field(CALC, "(B=3)||(D=3)?0:(A>0)||(C>0)?1:0") field(INPA, "PS:UNDS:1:FaultStatus CPP NMS") field(INPB, "PS:UNDS:1:FaultStatus.SEVR NPP NMS") field(INPC, "PS:UNDS:1:FaultEvent CPP NMS") field(INPD, "PS:UNDS:1:FaultEvent.SEVR NPP NMS") field(OOPT, "Every Time") field(FLNK, "PS:UNDS:1:LatchedFaultState") } record(bi, "PS:UNDS:1:LatchedFaultState") { field(DESC, "Fault Latch Status") field(INP, "PS:UNDS:1:LatchedFaultStateCalc NPP NMS") field(ONAM, "FAULT") field(ZNAM, "OK") field(OSV, "MAJOR") field(ZSV, "NO_ALARM") field(FLNK, "LGPS:UNDS:1:INTLKSUMY PP MS") } # Status Conditional Register is set by the user to Enable # SRQs for changes in power supply status. record(longout, "PS:UNDS:1:StatusEnable") { field(DESC, "Enable Status Events") field(DTYP, "stream") field(OUT, "@mgnt_genesys_alt.proto PSU-setsena(06) LGPS_UNDS_1") field(DOL, "191") field(OMSL, "closed_loop") } # The status event register will set a bit if a change in teh power supply occurs # and it is enabled. The register is clered when teh SEVE? or CLS commands are received. # A change in this register will generate SRQ # # Reading the status event register, clears bits of the status event register record(mbbiDirect, "PS:UNDS:1:StatusEvent") { field(DESC, "Status Event Register") field(DTYP, "stream") field(INP, "@mgnt_genesys_alt.proto PSU-getseve(06) LGPS_UNDS_1") field(FLNK, "PS:UNDS:1:StatusEventSeq") } record(seq, "PS:UNDS:1:StatusEventSeq") { # Process the status event registers that show a fault. # Do nothing if the status byte register is 0. field(DESC, "Process Non-Zero Events") field(ASG, "Internal") field(SELM, "Mask") field(SELL, "PS:UNDS:1:StatusEvent") field(LNK3, "PS:UNDS:1:FaultEvent.PROC PP") field(LNK4, "PS:UNDS:1:FaultEvent.PROC PP") } record(mbbiDirect, "PS:UNDS:1:OperStatus") { field(DESC, "Status Conditional Register") field(DTYP, "stream") field(INP, "@mgnt_genesys_alt.proto PSU-getstat(06) LGPS_UNDS_1") field(PINI, "YES") field(FLNK, "PS:UNDS:1:VoltMode") } record(bi, "PS:UNDS:1:VoltMode") { field(DESC, "Voltage Mode") field(INP, "PS:UNDS:1:OperStatus.B0 MS") field(ZNAM, "Not Constant") field(ONAM, "Constant") field(FLNK, "PS:UNDS:1:CurrMode") } record(bi, "PS:UNDS:1:CurrMode") { field(DESC, "Current Mode") field(INP, "PS:UNDS:1:OperStatus.B1 MS") field(ZNAM, "Not Constant") field(ONAM, "Constant") field(FLNK, "PS:UNDS:1:NoFaultState") } record(bi, "PS:UNDS:1:NoFaultState") { field(DESC, "No Fault Status") field(INP, "PS:UNDS:1:OperStatus.B2 MS") field(ZNAM, "FAULT") field(ONAM, "OK") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(FLNK, "PS:UNDS:1:ActiveFaultState") } record(bi, "PS:UNDS:1:ActiveFaultState") { field(DESC, "Active Fault Status") field(INP, "PS:UNDS:1:OperStatus.B3 MS") field(ZNAM, "OK") field(ONAM, "FAULT") field(ZSV, "NO_ALARM") field(OSV, "NO_ALARM") field(FLNK, "PS:UNDS:1:AutoStartMode") } # In this mode, the power supply restores its last # operation setting. Upon startup (AC Input power recycle), # the output is enabled or disabled according to its last settings record(bi, "PS:UNDS:1:AutoStartMode") { field(DESC, "Auto Start Mode") field(INP, "PS:UNDS:1:OperStatus.B4 MS") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(FLNK, "PS:UNDS:1:FoldBackMode") } # FoldBack protection will shut down the power supply output # if the load current exceeds the Output current limit # setting level. This protection is useful when the load # circuitry is sensitive to an overcurrent condition # # 4/27/2022: K.Luchini - swp ZSV and OSV, so ZSV is not alarmed # becase we want fold back mode to be disabled. record(bi, "PS:UNDS:1:FoldBackMode") { field(DESC, "Fold Back Protection") field(INP, "PS:UNDS:1:OperStatus.B5 MS") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(FLNK, "PS:UNDS:1:Mode") } record(bi, "PS:UNDS:1:Mode") { field(DESC, "Local Mode") field(INP, "PS:UNDS:1:OperStatus.B7 MS") field(ZNAM, "REMOTE") field(ONAM, "LOCAL") field(ZSV, "NO_ALARM") field(OSV, "MINOR") } record(bo, "PS:UNDS:1:FoldBackEnable") { field(DESC, "Fold Back Protection") field(DTYP, "stream") field(OUT, "@mgnt_genesys_alt.proto PSU-setfld(06) LGPS_UNDS_1") field(ZNAM, "OFF") field(ONAM, "ON") } # This command is followed by the address (default=6),and is used # to access the power supply. record(longout, "PS:UNDS:1:Addr") { field(DESC, "Power Supply Address") field(DTYP, "stream") field(OUT, "@mgnt_genesys_alt.proto PSU-comsetadr(06) LGPS_UNDS_1") field(DOL, "06") field(OMSL, "closed_loop") } record(mbbo, "PS:UNDS:1:MsgRespCode") { field(DESC, "Message Resonse Code") field(DTYP, "Raw Soft Channel") field(NOBT, "4") field(ZRST, "OK") field(ONST, "C01") field(TWST, "C02") field(THST, "C03") field(FRST, "C04") field(FVST, "C05") field(SXST, "E01") field(SVST, "E04") field(EIST, "E06") field(NIST, "E07") 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(EIVL, "8") field(NIVL, "9") field(UNSV, "INVALID") field(FLNK, "PS:UNDS:1:MsgResp") } record(mbbi, "PS:UNDS:1:MsgResp") { field(DESC, "Message Response") field(INP, "PS:UNDS:1:MsgRespCode.RVAL NPP MS") field(NOBT, "4") field(ZRST, "OK") field(ONST, "Illegal Command Query") field(TWST, "Missing Parameter") field(THST, "Illegal Parameter") field(FRST, "Checksum Error") field(FVST, "Setting out of range") field(SXST, "Prog Volt Exceeded") field(SVST, "Out Volt below UVL") field(EIST, "UVL above Out Volt") field(NIST, "ON request while Fault") field(ZRST, "NO_ALARM") field(ONST, "MAJOR") field(TWST, "MAJOR") field(THST, "MAJOR") field(FRST, "MAJOR") field(FVST, "MAJOR") field(SXST, "MAJOR") field(SVST, "MAJOR") field(EIST, "MAJOR") field(NIST, "MAJOR") field(UNSV, "INVALID") field(PINI, "YES") } record(stringout, "PS:UNDS:1:GetAnything") { field(DESC, "Get Anything") field(DTYP, "stream") field(OUT, "@mgnt_genesys_alt.proto debug(06) LGPS_UNDS_1") } record(stringout, "PS:UNDS:1:SetAnything") { field(DESC, "Set anything") field(DTYP, "stream") field(OUT, "@mgnt_genesys_alt.proto PSU-set(06) LGPS_UNDS_1") } record(mbbo, "PS:UNDS:1: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, "YES") field(VAL, "3") field(OUT, "LGPS:UNDS:1:COOLING PP") } record(bo, "PS:UNDS:1:RampState") { field(DESC, "PS Ramp Status") field(ZNAM, "OFF") field(ONAM, "BUSY") field(PINI, "YES") field(OUT, "LGPS:UNDS:1:RAMPSTATE PP") } record(stringin, "PS:UNDS:1:Drawing") { field(DESC, "Drawing Number") field(VAL, "PR-376-551-00") field(PINI, "YES") } record(stringin, "PS:UNDS:1:Location") { field(DESC, "Rack Location") field(VAL, "B913-1501") field(PINI, "YES") } record(bo, "PS:UNDS:1:CommLink") { field(DESC, "Communication Link Status") field(PINI, "YES") field(ZNAM, "Offline") field(ONAM, "Online") field(FLNK, "PS:UNDS:1:InitCommLinkCalc") } record(calcout,"PS:UNDS:1:InitCommLinkCalc") { field(DESC, "Init Pvs") field(OOPT, "Transition To Non-zero") field(FLNK, "PS:UNDS:1:InitCommLink") field(ASG, "Internal") } record(dfanout,"PS:UNDS:1:InitCommLink") { field(DESC, "PS Init") field(DOL, "0") field(OMSL, "closed_loop") field(OUTA, "PS:UNDS:1:Addr.PROC PP") field(OUTB, "PS:UNDS:1:State.PROC PP") field(OUTC, "PS:UNDS:1:FaultEnable.PROC PP") field(OUTD, "PS:UNDS:1:StatusEnable.PROC PP") field(OUTE, "PS:UNDS:1:ResetSeq.PROC PP") field(OUTF, "PS:UNDS:1:StatusEvent.PROC PP") field(OUTG, "PS:UNDS:1:OperStatus.PROC PP") field(OUTH, "PS:UNDS:1:IDN.PROC PP") field(FLNK, "PS:UNDS:1:InitCurrSetpt") field(ASG, "Internal") } # Process VSETPT on IOC startup record(seq,"PS:UNDS:1:InitCurrSetpt") { field(DESC, "Init current setpoint") field(DOL1, "0") field(LNK1, "PS:UNDS:1:VoltSetpt.DISV") field(LNK2, "PS:UNDS:1:CurrSetptOut.PROC") field(DOL3, "1") field(LNK3, "PS:UNDS:1:VoltSetpt.DISV") field(ASG, "Internal") } record(bo, "PS:UNDS:2:StateSetpt") { field(DESC, "Power Supply On/Off") field(ZNAM, "OFF") field(ONAM, "ON") } record(bo, "PS:UNDS:2:StateSetptOut") { field(DESC, "Power Supply On/Off") field(DTYP, "stream") field(OUT, "@mgnt_genesys.proto PSU-setonoff(06) LGPS_UNDS_2") field(ZNAM, "OFF") field(ONAM, "ON") field(FLNK, "PS:UNDS:2:State") } record(bi, "PS:UNDS:2:State") { field(DESC, "Power Supply On/Off Status") field(DTYP, "stream") field(INP, "@mgnt_genesys.proto PSU-getonoff(06) LGPS_UNDS_2") field(ZNAM, "OFF") field(ONAM, "ON") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(PINI, "YES") field(FLNK, "LGPS:UNDS:2:STATE NPP MS") } record(calcout, "PS:UNDS:2:StateCheck") { # Do nothing if the state is invalid. # If the state setpoint is invalid, then set state setpoint to state. # If the state and setpoint are the same, set off if state is off, # otherwise, set state setpoint to state. # If the state setpoint has changed, go on or off. Otherwise, the state # must've changed externally so follow it. # field(DESC, "PS State Check") field(CALC, "C=3?0:D=3?3:(A#B)&&(B#E)?B+1:A=0?1:3") field(OUT, "PS:UNDS:2:StateSeq.SELN PP") field(INPA, "PS:UNDS:2:State CPP") field(INPB, "PS:UNDS:2:StateSetpt CPP") field(INPC, "PS:UNDS:2:State.SEVR") field(INPD, "PS:UNDS:2:StateSetpt.SEVR") field(INPE, "PS:UNDS:2:StateCheck.LB") field(ASG, "Internal") } record(seq, "PS:UNDS:2:StateSeq") { field(DESC, "PS State Sequence") field(SELM, "Specified") field(LNK1, "PS:UNDS:2:StateOffSetptSeq.PROC PP") field(LNK2, "PS:UNDS:2:StateOnSetptSeq.PROC PP") field(DOL3, "PS:UNDS:2:State") field(LNK3, "PS:UNDS:2:StateSetptSeq PP") field(ASG, "Internal") } record(seq, "PS:UNDS:2:StateOnSetptSeq") { # When turning on, reset the power supply, # enable foldback protection, set the voltage # and current to max and delay befor setting # the state to 1 (on). # field(DESC, "PS On Sequence") field(LNK1, "PS:UNDS:2:Reset.PROC PP") field(LNK2, "PS:UNDS:2:StateReset.PROC PP") field(DOL3, "1") field(LNK3, "PS:UNDS:2:FoldBackEnable PP") field(DLY4, "0.2") field(DOL4, "LGPS:UNDS:2:BCTRL.HOPR") field(LNK4, "LGPS:UNDS:2:BCTRL PP") field(DLY5, "0.2") field(DOL5, "1") field(LNK5, "PS:UNDS:2:StateSetptSeq PP") field(ASG, "Internal") } record(seq, "PS:UNDS:2:StateOffSetptSeq") { # When turning off, set the voltage and current max and then wait before # before setting the state to 0 (off). # Note: Under normal circumstances you'd set the current and volts to 0, # and wait to allow the supply to ramp down before turning the supply off. # However, power conversion has requested to leave the voltage and current # unchanged before setting the state to 0 (off). # field(DESC, "PS Off Sequence") field(LNK1, "PS:UNDS:2:CurrSetptOut.PROC PP") field(DLY2, "0.2") field(LNK2, "PS:UNDS:2:StateSetptSeq PP") field(ASG, "Internal") } record(seq, "PS:UNDS:2:StateSetptSeq") { # Set both the desired and the actual setpoints to requested. # Renable status events in case of power-cycle. # field(DESC, "PS State Setpt Sequence") field(DOL1, "PS:UNDS:2:StateSetptSeq") field(LNK1, "LGPS:UNDS:2:STATESETPT PP") field(DOL2, "PS:UNDS:2:StateSetptSeq") field(LNK2, "PS:UNDS:2:StateSetpt PP") field(LNK3, "PS:UNDS:2:FaultEnable.PROC PP") field(LNK4, "PS:UNDS:2:StatusEnable.PROC PP") field(LNK5, "PS:UNDS:2:OperStatus.PROC PP") field(LNK6, "PS:UNDS:2:FaultStatus.PROC PP") field(FLNK, "PS:UNDS:2:IDN ") field(ASG, "Internal") } # The reset command brings the power supply to a safe and known state. # Output voltage: zero Remote/Local Mode: non-lockout remote # Output current: zero Auto-Restart Mode: OFF # Output ON/OFF: OFF OVP setting: maximum # FoldbBack ON/OFF: OFF UVL setting: zero # # The condiitional resgisters (FLT and STAT) are updated while other # registers are not changed. # record(bo, "PS:UNDS:2:StateReset") { field(DESC, "Power Supply Reset") field(DTYP, "stream") field(OUT, "@mgnt_genesys.proto PSU-comreset(06) LGPS_UNDS_2") field(ZNAM, "OFF") field(ONAM, "OFF") field(FLNK, "PS:UNDS:2:ResetSeq") } # Returns th power supply model identification as an ascii string: LAMBDA, GENX-Y record (stringin, "PS:UNDS:2:IDN") { field(DESC, "Identification") field(DTYP, "stream") field(INP, "@mgnt_genesys.proto PSU-getidn(06) LGPS_UNDS_2") field(PINI, "YES") field(FLNK, "PS:UNDS:2:SerialNo") } record(stringin, "PS:UNDS:2:SerialNo") { field(DESC, "Serial Number") field(DTYP, "stream") field(INP, "@mgnt_genesys.proto PSU-getsn(06) LGPS_UNDS_2") field(FLNK, "PS:UNDS:2:Revision") } record(stringin, "PS:UNDS:2:Revision") { field(DESC, "Software Revision") field(DTYP, "stream") field(INP, "@mgnt_genesys.proto PSU-getrev(06) LGPS_UNDS_2") } # We aren't interested in current since we are setting voltage. # The current is variable so it's meaningless. record(ai, "PS:UNDS:2:Curr") { field(DESC, "PS Current") field(DTYP, "stream") field(INP, "@mgnt_genesys.proto PSU-getcur(06) LGPS_UNDS_2") field(EGU, "Amps") field(PREC, "3") field(HOPR, "200") field(FLNK, "PS:UNDS:2:ResistanceInp") } record(ao, "PS:UNDS:2:CurrSetpt") { field(DESC, "Current Output") field(DTYP, "stream") field(OUT, "@mgnt_genesys.proto PSU-setcur(06) LGPS_UNDS_2") field(EGU, "Amps") field(PREC, "3") field(HOPR, "200") field(DRVH, "200") field(DOL, "PS:UNDS:2:CurrSetpt.HOPR") field(OMSL, "closed_loop") info(autosaveFields, "VAL") } record(ai, "PS:UNDS:2:CurrSetptRbck") { field(DESC, "Current Output Readback") field(DTYP, "stream") field(INP, "@mgnt_genesys.proto PSU-getsetcur(06) LGPS_UNDS_2") field(EGU, "Amps") field(PREC, "3") field(HOPR, "200") } # Calculate resistance if voltage and current are high enough. # Add smoothing of the resistance value. record(calc, "PS:UNDS:2:ResistanceInp") { field(DESC, "Resistance") field(ASG, "Internal") field(CALC, "B<=0?0:A<0.5?C:((B/A)*(1-D))+(C*D)") field(INPA, "PS:UNDS:2:Curr MS") field(INPB, "PS:UNDS:2:Volt MS") field(INPC, "PS:UNDS:2:ResistanceInp") field(INPD, "PS:UNDS:2:Resistance.D") field(EGU, "Ohm") field(PREC, "4") field(HOPR, "5") field(FLNK, "PS:UNDS:2:Resistance") } # Add offset to resistance for testing purposes. record(calc, "PS:UNDS:2:Resistance") { field(DESC, "Resistance") field(CALC, "C+E") field(INPC, "PS:UNDS:2:ResistanceInp") field(INPD, "0") field(EGU, "Ohm") field(PREC, "4") field(HOPR, "5") } record(ai, "PS:UNDS:2:Volt") { field(DESC, "PS Output Voltage") field(DTYP, "stream") field(INP, "@mgnt_genesys.proto PSU-getvolts(06) LGPS_UNDS_2") field(EGU, "Volts") field(PREC, "3") field(HOPR, "50.0") field(PINI, "YES") field(FLNK, "PS:UNDS:2:CurrAct") } record(ai, "PS:UNDS:2:CurrAct") { field(DESC, "PS Output Current") field(INP, "PS:UNDS:2:Volt NPP MS") field(EGU, "Amps") field(PREC, "3") field(HOPR, "200") field(FLNK, "LGPS:UNDS:2:IACT") } record(ao, "PS:UNDS:2:CurrSetptOut") { field(DESC, "Current to Volt Output") field(EGU, "Amps") field(PREC, "3") field(HOPR, "50.0") field(DRVH, "50.0") field(OUT, "PS:UNDS:2:VoltSetpt PP") info(autosaveFields, "VAL") } record(ao, "PS:UNDS:2:VoltSetpt") { field(DESC, "Voltage Output") field(DTYP, "stream") field(OUT, "@mgnt_genesys.proto PSU-setvolts(06) LGPS_UNDS_2") field(EGU, "Volts") field(PREC, "3") field(HOPR, "50.0") field(DRVH, "50.0") field(FLNK, "PS:UNDS:2:VoltSetptSeq") } record(seq, "PS:UNDS:2:VoltSetptSeq") { field(DESC, "Voltage Output Sequence") field(DLY1, "0.2") field(LNK1, "PS:UNDS:2:CurrSetpt.PROC PP") field(DLY2, "0.2") field(LNK2, "PS:UNDS:2:VoltSetptRbck.PROC PP") field(DLY3, "0.2") field(LNK3, "PS:UNDS:2:CurrSetptRbck.PROC PP") } record(ai, "PS:UNDS:2:VoltSetptRbck") { field(DESC, "Voltage Output Readback") field(DTYP, "stream") field(INP, "@mgnt_genesys.proto PSU-getsetvolts(06) LGPS_UNDS_2") field(EGU, "Volts") field(PREC, "3") field(HOPR, "50.0") field(FLNK, "PS:UNDS:2:CurrSetpt") } # Clear status command. Sets FEVE and SEVE registers to zero. record(bo, "PS:UNDS:2:Reset") { field(DESC, "Clear Errors") field(DTYP, "stream") field(OUT, "@mgnt_genesys.proto PSU-comclr(06) LGPS_UNDS_2") field(ZNAM, "RESET") field(ONAM, "NORESET") field(FLNK, "PS:UNDS:2:ResetSeq") } record(seq, "PS:UNDS:2:ResetSeq") { field(DESC, "Process Events") field(ASG, "Internal") field(LNK1, "PS:UNDS:2:FaultEvent.PROC PP") field(LNK2, "PS:UNDS:2:StatusEvent.PROC PP") } record(fanout, "PS:UNDS:2:UpdateFast") { # Process State before Curr since State may change Curr limits. field(DESC, "Fast Update") field(LNK1, "PS:UNDS:2:Volt.PROC") field(LNK2, "PS:UNDS:2:State.PROC") field(LNK3, "PS:UNDS:2:VoltSetptRbck.PROC") field(LNK4, "PS:UNDS:2:CurrSetptRbck.PROC") field(LNK5, "PS:UNDS:2:Curr.PROC") field(LNK6, "PS:UNDS:2:CurrAct.PROC") field(SCAN, ".5 second") field(DISV, "0") field(SDIS, "PS:UNDS:2:CommLink") field(ASG, "Internal") } record(fanout, "PS:UNDS:2:UpdateSlow") { field(DESC, "Slow Update") field(LNK1, "PS:UNDS:2:StatusEvent.PROC") field(LNK2, "PS:UNDS:2:OperStatus.PROC") field(LNK3, "PS:UNDS:2:FaultStatus.PROC") field(LNK4, "PS:UNDS:2:FaultEvent.PROC") field(SCAN, "2 second") field(DISV, "0") field(SDIS, "PS:UNDS:2:CommLink") field(ASG, "Internal") } # Conditional Registers # The faultconditional and status conditional registers # are read only registers that the uesrs may read to see the # condition of the power supply. # # # Fault Conditional Register record(longout, "PS:UNDS:2:FaultEnable") { field(DESC, "Enable Fault Events") field(DTYP, "stream") field(OUT, "@mgnt_genesys.proto PSU-setfena(06) LGPS_UNDS_2") field(DOL, "254") field(OMSL, "closed_loop") } # Reading the fault event register, clears bits of the fault event register # The fault event will set a bit if a condition occurs and it is Enabled. # The register is cleared when FEVE?, CLS or RST commands are received. record(mbbiDirect, "PS:UNDS:2:FaultEvent") { field(DESC, "Fault Event Register") field(DTYP, "stream") field(INP, "@mgnt_genesys.proto PSU-getfeve(06) LGPS_UNDS_2") } record(mbbiDirect,"PS:UNDS:2:FaultStatus") { field(DESC,"Fault Conditional Register") field(DTYP,"stream") field(INP, "@mgnt_genesys.proto PSU-getflt(06) LGPS_UNDS_2") field(FLNK, "PS:UNDS:2:ACState") } record(bi, "PS:UNDS:2:ACState") { field(DESC, "AC Status") field(INP, "PS:UNDS:2:FaultStatus.B1") field(ZNAM, "OK") field(ONAM, "FAULT") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(FLNK, "PS:UNDS:2:OverTemp") } # The OTP circuit shuts down the power supply before the internal # components can exceed their safe internal operating temperature. # When an OTP shutdown occurs, the VOLTAGE meter displays "O7P" # and the ALARM LED blinks.Resetting the OTP circuit can be # automatic (non-latched) or manual (latched) dependingon the # Safe-Start or AutoRestart mode. # # 1.Safe-Start mode: # In Safe-Start mode, the power supply stays OFF after the over # temperature condition has been removed. The display continues to show \u201cO7P\u201d and the # ALARM LEDcontinues to blink. To reset the OTP circuit, press the OUT # button (or send an OUT ON (OUT 1)command via the RS-232/RS-485 serialcommunicationport). # 2. Auto-Restart mode: # In Auto-Restart mode, the power supply recovers to its last setting # operational automatically when the over temperature condition is removed. # record(bi, "PS:UNDS:2:OverTemp") { field(DESC, "Over Temperature Status") field(INP, "PS:UNDS:2:FaultStatus.B2") field(ZNAM, "OK") field(ONAM, "FAULT") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(FLNK, "PS:UNDS:2:FoldBack") } # The supply output is turned On by front panel # button or OUT 1 command. record(bi, "PS:UNDS:2:FoldBack") { field(DESC, "FoldBack Shutdown") field(INP, "PS:UNDS:2:FaultStatus.B3") field(ZNAM, "OK") field(ONAM, "FAULT") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(FLNK, "PS:UNDS:2:OverVolt") } record(bi, "PS:UNDS:2:OverVolt") { field(DESC, "Over Voltage Status") field(INP, "PS:UNDS:2:FaultStatus.B4") field(ZNAM, "OK") field(ONAM, "FAULT") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(FLNK, "PS:UNDS:2:ShutOff") } record(bi, "PS:UNDS:2:ShutOff") { field(DESC, "J1 Analog In Shut Off") field(INP, "PS:UNDS:2:FaultStatus.B5") field(ZNAM, "OK") field(ONAM, "FAULT") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(FLNK, "PS:UNDS:2:ManualOff") } # The supply output is turned On by front # panel button or OUT 1 command record(bi, "PS:UNDS:2:ManualOff") { field(DESC, "Front Panel Off") field(INP, "PS:UNDS:2:FaultStatus.B6") field(ZNAM, "OK") field(ONAM, "FAULT") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(FLNK, "PS:UNDS:2:OutputState") } record(bi, "PS:UNDS:2:OutputState") { field(DESC, "J1 Analog In Enable Fault") field(INP, "PS:UNDS:2:FaultStatus.B7") field(ZNAM, "OK") field(ONAM, "FAULT") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") } record(calcout, "PS:UNDS:2:LatchedFaultStateCalc") { field(DESC, "Fault Latch Status Calc") field(ASG, "Internal") field(CALC, "(B=3)||(D=3)?0:(A>0)||(C>0)?1:0") field(INPA, "PS:UNDS:2:FaultStatus CPP NMS") field(INPB, "PS:UNDS:2:FaultStatus.SEVR NPP NMS") field(INPC, "PS:UNDS:2:FaultEvent CPP NMS") field(INPD, "PS:UNDS:2:FaultEvent.SEVR NPP NMS") field(OOPT, "Every Time") field(FLNK, "PS:UNDS:2:LatchedFaultState") } record(bi, "PS:UNDS:2:LatchedFaultState") { field(DESC, "Fault Latch Status") field(INP, "PS:UNDS:2:LatchedFaultStateCalc NPP NMS") field(ONAM, "FAULT") field(ZNAM, "OK") field(OSV, "MAJOR") field(ZSV, "NO_ALARM") field(FLNK, "LGPS:UNDS:2:INTLKSUMY PP MS") } # Status Conditional Register is set by the user to Enable # SRQs for changes in power supply status. record(longout, "PS:UNDS:2:StatusEnable") { field(DESC, "Enable Status Events") field(DTYP, "stream") field(OUT, "@mgnt_genesys.proto PSU-setsena(06) LGPS_UNDS_2") field(DOL, "191") field(OMSL, "closed_loop") } # The status event register will set a bit if a change in teh power supply occurs # and it is enabled. The register is clered when teh SEVE? or CLS commands are received. # A change in this register will generate SRQ # # Reading the status event register, clears bits of the status event register record(mbbiDirect, "PS:UNDS:2:StatusEvent") { field(DESC, "Status Event Register") field(DTYP, "stream") field(INP, "@mgnt_genesys.proto PSU-getseve(06) LGPS_UNDS_2") field(FLNK, "PS:UNDS:2:StatusEventSeq") } record(seq, "PS:UNDS:2:StatusEventSeq") { # Process the status event registers that show a fault. # Do nothing if the status byte register is 0. field(DESC, "Process Non-Zero Events") field(ASG, "Internal") field(SELM, "Mask") field(SELL, "PS:UNDS:2:StatusEvent") field(LNK3, "PS:UNDS:2:FaultEvent.PROC PP") field(LNK4, "PS:UNDS:2:FaultEvent.PROC PP") } record(mbbiDirect, "PS:UNDS:2:OperStatus") { field(DESC, "Status Conditional Register") field(DTYP, "stream") field(INP, "@mgnt_genesys.proto PSU-getstat(06) LGPS_UNDS_2") field(PINI, "YES") field(FLNK, "PS:UNDS:2:VoltMode") } record(bi, "PS:UNDS:2:VoltMode") { field(DESC, "Voltage Mode") field(INP, "PS:UNDS:2:OperStatus.B0 MS") field(ZNAM, "Not Constant") field(ONAM, "Constant") field(FLNK, "PS:UNDS:2:CurrMode") } record(bi, "PS:UNDS:2:CurrMode") { field(DESC, "Current Mode") field(INP, "PS:UNDS:2:OperStatus.B1 MS") field(ZNAM, "Not Constant") field(ONAM, "Constant") field(FLNK, "PS:UNDS:2:NoFaultState") } record(bi, "PS:UNDS:2:NoFaultState") { field(DESC, "No Fault Status") field(INP, "PS:UNDS:2:OperStatus.B2 MS") field(ZNAM, "FAULT") field(ONAM, "OK") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(FLNK, "PS:UNDS:2:ActiveFaultState") } record(bi, "PS:UNDS:2:ActiveFaultState") { field(DESC, "Active Fault Status") field(INP, "PS:UNDS:2:OperStatus.B3 MS") field(ZNAM, "OK") field(ONAM, "FAULT") field(ZSV, "NO_ALARM") field(OSV, "NO_ALARM") field(FLNK, "PS:UNDS:2:AutoStartMode") } # In this mode, the power supply restores its last # operation setting. Upon startup (AC Input power recycle), # the output is enabled or disabled according to its last settings record(bi, "PS:UNDS:2:AutoStartMode") { field(DESC, "Auto Start Mode") field(INP, "PS:UNDS:2:OperStatus.B4 MS") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(FLNK, "PS:UNDS:2:FoldBackMode") } # FoldBack protection will shut down the power supply output # if the load current exceeds the Output current limit # setting level. This protection is useful when the load # circuitry is sensitive to an overcurrent condition # # 4/27/2022: K.Luchini - swp ZSV and OSV, so ZSV is not alarmed # becase we want fold back mode to be disabled. record(bi, "PS:UNDS:2:FoldBackMode") { field(DESC, "Fold Back Protection") field(INP, "PS:UNDS:2:OperStatus.B5 MS") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(FLNK, "PS:UNDS:2:Mode") } record(bi, "PS:UNDS:2:Mode") { field(DESC, "Local Mode") field(INP, "PS:UNDS:2:OperStatus.B7 MS") field(ZNAM, "REMOTE") field(ONAM, "LOCAL") field(ZSV, "NO_ALARM") field(OSV, "MINOR") } record(bo, "PS:UNDS:2:FoldBackEnable") { field(DESC, "Fold Back Protection") field(DTYP, "stream") field(OUT, "@mgnt_genesys.proto PSU-setfld(06) LGPS_UNDS_2") field(ZNAM, "OFF") field(ONAM, "ON") } # This command is followed by the address (default=6),and is used # to access the power supply. record(longout, "PS:UNDS:2:Addr") { field(DESC, "Power Supply Address") field(DTYP, "stream") field(OUT, "@mgnt_genesys.proto PSU-comsetadr(06) LGPS_UNDS_2") field(DOL, "06") field(OMSL, "closed_loop") } record(mbbo, "PS:UNDS:2:MsgRespCode") { field(DESC, "Message Resonse Code") field(DTYP, "Raw Soft Channel") field(NOBT, "4") field(ZRST, "OK") field(ONST, "C01") field(TWST, "C02") field(THST, "C03") field(FRST, "C04") field(FVST, "C05") field(SXST, "E01") field(SVST, "E04") field(EIST, "E06") field(NIST, "E07") 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(EIVL, "8") field(NIVL, "9") field(UNSV, "INVALID") field(FLNK, "PS:UNDS:2:MsgResp") } record(mbbi, "PS:UNDS:2:MsgResp") { field(DESC, "Message Response") field(INP, "PS:UNDS:2:MsgRespCode.RVAL NPP MS") field(NOBT, "4") field(ZRST, "OK") field(ONST, "Illegal Command Query") field(TWST, "Missing Parameter") field(THST, "Illegal Parameter") field(FRST, "Checksum Error") field(FVST, "Setting out of range") field(SXST, "Prog Volt Exceeded") field(SVST, "Out Volt below UVL") field(EIST, "UVL above Out Volt") field(NIST, "ON request while Fault") field(ZRST, "NO_ALARM") field(ONST, "MAJOR") field(TWST, "MAJOR") field(THST, "MAJOR") field(FRST, "MAJOR") field(FVST, "MAJOR") field(SXST, "MAJOR") field(SVST, "MAJOR") field(EIST, "MAJOR") field(NIST, "MAJOR") field(UNSV, "INVALID") field(PINI, "YES") } record(stringout, "PS:UNDS:2:GetAnything") { field(DESC, "Get Anything") field(DTYP, "stream") field(OUT, "@mgnt_genesys.proto debug(06) LGPS_UNDS_2") } record(stringout, "PS:UNDS:2:SetAnything") { field(DESC, "Set anything") field(DTYP, "stream") field(OUT, "@mgnt_genesys.proto PSU-set(06) LGPS_UNDS_2") } record(mbbo, "PS:UNDS:2: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, "YES") field(VAL, "3") field(OUT, "LGPS:UNDS:2:COOLING PP") } record(bo, "PS:UNDS:2:RampState") { field(DESC, "PS Ramp Status") field(ZNAM, "OFF") field(ONAM, "BUSY") field(PINI, "YES") field(OUT, "LGPS:UNDS:2:RAMPSTATE PP") } record(stringin, "PS:UNDS:2:Drawing") { field(DESC, "Drawing Number") field(VAL, "PR-376-552-00") field(PINI, "YES") } record(stringin, "PS:UNDS:2:Location") { field(DESC, "Rack Location") field(VAL, "B921-5101") field(PINI, "YES") } record(bo, "PS:UNDS:2:CommLink") { field(DESC, "Communication Link Status") field(PINI, "YES") field(ZNAM, "Offline") field(ONAM, "Online") field(FLNK, "PS:UNDS:2:InitCommLinkCalc") } record(calcout,"PS:UNDS:2:InitCommLinkCalc") { field(DESC, "Init Pvs") field(OOPT, "Transition To Non-zero") field(FLNK, "PS:UNDS:2:InitCommLink") field(ASG, "Internal") } record(dfanout,"PS:UNDS:2:InitCommLink") { field(DESC, "PS Init") field(DOL, "0") field(OMSL, "closed_loop") field(OUTA, "PS:UNDS:2:Addr.PROC PP") field(OUTB, "PS:UNDS:2:State.PROC PP") field(OUTC, "PS:UNDS:2:FaultEnable.PROC PP") field(OUTD, "PS:UNDS:2:StatusEnable.PROC PP") field(OUTE, "PS:UNDS:2:ResetSeq.PROC PP") field(OUTF, "PS:UNDS:2:StatusEvent.PROC PP") field(OUTG, "PS:UNDS:2:OperStatus.PROC PP") field(OUTH, "PS:UNDS:2:IDN.PROC PP") field(FLNK, "PS:UNDS:2:InitCurrSetpt") field(ASG, "Internal") } # Process VSETPT on IOC startup record(seq,"PS:UNDS:2:InitCurrSetpt") { field(DESC, "Init current setpoint") field(DOL1, "0") field(LNK1, "PS:UNDS:2:VoltSetpt.DISV") field(LNK2, "PS:UNDS:2:CurrSetptOut.PROC") field(DOL3, "1") field(LNK3, "PS:UNDS:2:VoltSetpt.DISV") field(ASG, "Internal") } record(asyn,"SIOC:SYS0:MG07:ASYNDRIVER") { field(DTYP,"asynRecordDevice") field(PORT,"LGPS_LTUS_1") field(ADDR,"6") field(OMAX,"0") field(IMAX,"0") }